[med-svn] [ncbi-blast+] 01/02: Imported Upstream version 2.4.0

Aaron M. Ucko ucko at moszumanska.debian.org
Thu Aug 4 02:29:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

ucko pushed a commit to branch upstream
in repository ncbi-blast+.

commit c943f5523f1ffa749c97d9323fe7416eb1f35438
Author: Aaron M. Ucko <ucko at debian.org>
Date:   Wed Aug 3 11:06:19 2016 -0400

    Imported Upstream version 2.4.0
---
 .../msvc1000_prj/Makefile.WinMain.app.msvc         |   11 -
 .../msvc1000_prj/Makefile.wxWidgets.app.msvc       |   11 -
 c++/compilers/msvc1000_prj/build.sh                |  257 --
 c++/compilers/msvc1000_prj/build_exec.bat          |   50 -
 c++/compilers/msvc1000_prj/build_util.sh           |   67 -
 c++/compilers/msvc1000_prj/check.sh                |  275 --
 c++/compilers/msvc1000_prj/configure.bat           |  393 --
 c++/compilers/msvc1000_prj/datatool.bat            |  188 -
 .../dll/build/UtilityProjects/_CONFIGURE_.vcxproj  |  141 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcxproj     |  141 -
 .../dll/build/UtilityProjects/configure._          |    4 -
 .../dll/build/UtilityProjects/configure_dialog._   |    4 -
 c++/compilers/msvc1000_prj/dll/build/all.bat       |   42 -
 .../msvc1000_prj/dll/build/all_gbench.bat          |   75 -
 c++/compilers/msvc1000_prj/dll/build/all_gui.bat   |   75 -
 c++/compilers/msvc1000_prj/dll/build/all_ncbi.bat  |   75 -
 .../gbench/UtilityProjects/_CONFIGURE_.vcxproj     |  145 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcxproj     |  145 -
 .../dll/build/gbench/UtilityProjects/configure._   |    5 -
 .../gbench/UtilityProjects/configure_dialog._      |    5 -
 .../dll/build/gbench/configure_prebuild.bat        |   48 -
 .../gbench/gbench_install/gbench-install.vcxproj   |  218 --
 .../msvc1000_prj/dll/build/gbench/ncbi_gbench.sln  |   35 -
 .../build/gui/UtilityProjects/_CONFIGURE_.vcxproj  |  141 -
 .../gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj |  141 -
 .../dll/build/gui/UtilityProjects/configure._      |    4 -
 .../build/gui/UtilityProjects/configure_dialog._   |    4 -
 .../msvc1000_prj/dll/build/gui/ncbi_gui_dll.sln    |   35 -
 .../gbench-install-internal.vcxproj                |  218 --
 .../msvc1000_prj/dll/build/ncbi_cpp_dll.sln        |   35 -
 c++/compilers/msvc1000_prj/dll/dll_main.cpp        |   18 -
 .../msvc1000_prj/dll/third_party_dll_install.mak   |   62 -
 .../dll/third_party_dll_install.vcxproj            |  409 --
 .../dll/third_party_msvcdll_install.vcxproj        |  409 --
 c++/compilers/msvc1000_prj/install.sh              |  187 -
 c++/compilers/msvc1000_prj/lock_ptb_config.bat     |   94 -
 c++/compilers/msvc1000_prj/make.bat                |  220 --
 c++/compilers/msvc1000_prj/make_ncbi.bat           |   60 -
 c++/compilers/msvc1000_prj/msvcvars.bat            |   14 -
 c++/compilers/msvc1000_prj/ncbi.rc                 |    1 -
 c++/compilers/msvc1000_prj/ncbilogo.ico            |  Bin 766 -> 0 bytes
 c++/compilers/msvc1000_prj/ptb.bat                 |  275 --
 .../static/build/UtilityProjects/PTB.sln           |  121 -
 .../build/UtilityProjects/_CONFIGURE_.vcxproj      |  141 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcxproj     |  141 -
 .../static/build/UtilityProjects/configure._       |    4 -
 .../build/UtilityProjects/configure_dialog._       |    4 -
 c++/compilers/msvc1000_prj/static/build/all.bat    |   39 -
 .../msvc1000_prj/static/build/all_gui.bat          |   81 -
 .../msvc1000_prj/static/build/all_ncbi.bat         |   81 -
 .../msbuild/msbuild_dataobj.lib.vcxproj            |  147 -
 .../project_tree_builder.exe.vcxproj               |  414 --
 .../static/build/corelib/xncbi.lib.vcxproj         |  508 ---
 .../build/gui/UtilityProjects/_CONFIGURE_.vcxproj  |  141 -
 .../gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj |  141 -
 .../static/build/gui/UtilityProjects/configure._   |    4 -
 .../build/gui/UtilityProjects/configure_dialog._   |    4 -
 .../msvc1000_prj/static/build/gui/ncbi_gui.sln     |   35 -
 .../msvc1000_prj/static/build/ncbi_cpp.sln         |   35 -
 .../build/serial/datatool/datatool.exe.vcxproj     |  505 ---
 .../static/build/serial/xser.lib.vcxproj           |  532 ---
 .../static/build/util/regexp/regexp.lib.vcxproj    |  362 --
 .../static/build/util/xregexp/xregexp.lib.vcxproj  |  175 -
 .../static/build/util/xutil.lib.vcxproj            |  307 --
 .../static/third_party_msvcstatic_install.vcxproj  |  409 --
 .../static/third_party_static_install.mak          |   62 -
 .../static/third_party_static_install.vcxproj      |  409 --
 .../msvc1000_prj/third_party_install.meta.mk       |  326 --
 .../user/build/UtilityProjects/_CONFIGURE_.vcxproj |  141 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcxproj     |  141 -
 .../user/build/UtilityProjects/configure._         |    4 -
 .../user/build/UtilityProjects/configure_dialog._  |    4 -
 .../msvc1000_prj/user/build/ncbi_user.sln          |   35 -
 .../msvc900_prj/Makefile.WinMain.app.msvc          |   11 -
 .../msvc900_prj/Makefile.wxWidgets.app.msvc        |   11 -
 c++/compilers/msvc900_prj/build.sh                 |  176 -
 c++/compilers/msvc900_prj/build_exec.bat           |   50 -
 c++/compilers/msvc900_prj/check.sh                 |  145 -
 c++/compilers/msvc900_prj/configure.bat            |  393 --
 c++/compilers/msvc900_prj/datatool.bat             |  133 -
 .../dll/build/UtilityProjects/_CONFIGURE_.vcproj   |  138 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcproj      |  138 -
 .../dll/build/UtilityProjects/configure._          |    4 -
 .../dll/build/UtilityProjects/configure_dialog._   |    4 -
 c++/compilers/msvc900_prj/dll/build/all.bat        |   42 -
 c++/compilers/msvc900_prj/dll/build/all_gbench.bat |   75 -
 c++/compilers/msvc900_prj/dll/build/all_gui.bat    |   75 -
 c++/compilers/msvc900_prj/dll/build/all_ncbi.bat   |   75 -
 .../gbench/UtilityProjects/_CONFIGURE_.vcproj      |  138 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcproj      |  138 -
 .../dll/build/gbench/UtilityProjects/configure._   |    5 -
 .../gbench/UtilityProjects/configure_dialog._      |    5 -
 .../gbench/gbench_install/gbench-install.vcproj    |  122 -
 .../msvc900_prj/dll/build/gbench/ncbi_gbench.sln   |   39 -
 .../build/gui/UtilityProjects/_CONFIGURE_.vcproj   |  138 -
 .../gui/UtilityProjects/_CONFIGURE_DIALOG_.vcproj  |  138 -
 .../dll/build/gui/UtilityProjects/configure._      |    4 -
 .../build/gui/UtilityProjects/configure_dialog._   |    4 -
 .../msvc900_prj/dll/build/gui/ncbi_gui_dll.sln     |   39 -
 .../gbench-install-internal.vcproj                 |  122 -
 .../msvc900_prj/dll/build/ncbi_cpp_dll.sln         |   39 -
 .../wrappers/UtilityProjects/_CONFIGURE_.vcproj    |  138 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcproj      |  138 -
 .../dll/build/wrappers/UtilityProjects/configure._ |    4 -
 .../wrappers/UtilityProjects/configure_dialog._    |    4 -
 .../msvc900_prj/dll/build/wrappers/wrappers.sln    |   27 -
 c++/compilers/msvc900_prj/dll/dll_main.cpp         |   18 -
 .../msvc900_prj/dll/third_party_dll_install.mak    |   62 -
 .../msvc900_prj/dll/third_party_dll_install.vcproj |  169 -
 .../dll/third_party_msvcdll_install.vcproj         |  169 -
 c++/compilers/msvc900_prj/install.sh               |  175 -
 c++/compilers/msvc900_prj/lock_ptb_config.bat      |   94 -
 c++/compilers/msvc900_prj/make.bat                 |  192 -
 c++/compilers/msvc900_prj/make_ncbi.bat            |   51 -
 c++/compilers/msvc900_prj/msvcvars.bat             |   14 -
 c++/compilers/msvc900_prj/ncbi.rc                  |    1 -
 c++/compilers/msvc900_prj/ncbilogo.ico             |  Bin 766 -> 0 bytes
 c++/compilers/msvc900_prj/ptb.bat                  |  276 --
 .../static/build/UtilityProjects/PTB.sln           |  132 -
 .../build/UtilityProjects/_CONFIGURE_.vcproj       |  138 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcproj      |  138 -
 .../static/build/UtilityProjects/configure._       |    4 -
 .../build/UtilityProjects/configure_dialog._       |    4 -
 c++/compilers/msvc900_prj/static/build/all.bat     |   39 -
 c++/compilers/msvc900_prj/static/build/all_gui.bat |   81 -
 .../msvc900_prj/static/build/all_ncbi.bat          |   81 -
 .../msbuild/msbuild_dataobj.lib.vcproj             |   71 -
 .../project_tree_builder.exe.vcproj                | 1067 -----
 .../static/build/corelib/xncbi.lib.vcproj          | 1353 -------
 .../build/gui/UtilityProjects/_CONFIGURE_.vcproj   |  138 -
 .../gui/UtilityProjects/_CONFIGURE_DIALOG_.vcproj  |  138 -
 .../static/build/gui/UtilityProjects/configure._   |    4 -
 .../build/gui/UtilityProjects/configure_dialog._   |    4 -
 .../msvc900_prj/static/build/gui/ncbi_gui.sln      |   39 -
 .../msvc900_prj/static/build/ncbi_cpp.sln          |   35 -
 .../build/serial/datatool/datatool.exe.vcproj      | 1458 -------
 .../static/build/serial/xser.lib.vcproj            | 1642 --------
 .../static/build/util/regexp/regexp.lib.vcproj     |  223 --
 .../static/build/util/xregexp/xregexp.lib.vcproj   |   76 -
 .../msvc900_prj/static/build/util/xutil.lib.vcproj |  796 ----
 .../static/third_party_msvcstatic_install.vcproj   |  313 --
 .../static/third_party_static_install.mak          |   62 -
 .../static/third_party_static_install.vcproj       |  313 --
 .../msvc900_prj/third_party_install.meta.mk        |  326 --
 .../user/build/UtilityProjects/_CONFIGURE_.vcproj  |  138 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcproj      |  138 -
 .../user/build/UtilityProjects/configure._         |    4 -
 .../user/build/UtilityProjects/configure_dialog._  |    4 -
 c++/compilers/msvc900_prj/user/build/ncbi_user.sln |   39 -
 c++/compilers/unix/GCC.sh                          |    7 +-
 c++/compilers/unix/ICC.sh                          |    7 +-
 c++/compilers/unix/WorkShop.sh                     |   76 -
 c++/compilers/unix/WorkShop510.sh                  |   17 -
 c++/compilers/unix/WorkShop511.sh                  |   17 -
 c++/compilers/unix/WorkShop59.sh                   |   17 -
 c++/compilers/unix/cxx_filter.WorkShop.awk         |  106 -
 c++/compilers/unix/cxx_filter.WorkShop.sh          |   26 -
 c++/compilers/unix/cxx_filter.WorkShop59.sh        |    8 -
 c++/compilers/unix/psrc                            |    2 -
 c++/compilers/vs2012/Makefile.WinMain.app.msvc     |   11 -
 c++/compilers/vs2012/Makefile.wxWidgets.app.msvc   |   11 -
 c++/compilers/vs2012/build.sh                      |  257 --
 c++/compilers/vs2012/build_exec.bat                |   50 -
 c++/compilers/vs2012/build_util.sh                 |   67 -
 c++/compilers/vs2012/check.sh                      |  149 -
 c++/compilers/vs2012/configure.bat                 |  393 --
 c++/compilers/vs2012/datatool.bat                  |  188 -
 .../dll/build/UtilityProjects/_CONFIGURE_.vcxproj  |  145 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcxproj     |  145 -
 .../vs2012/dll/build/UtilityProjects/configure._   |    4 -
 .../dll/build/UtilityProjects/configure_dialog._   |    4 -
 c++/compilers/vs2012/dll/build/all.bat             |   42 -
 c++/compilers/vs2012/dll/build/all_gbench.bat      |   75 -
 c++/compilers/vs2012/dll/build/all_gui.bat         |   75 -
 c++/compilers/vs2012/dll/build/all_ncbi.bat        |   75 -
 .../gbench/UtilityProjects/_CONFIGURE_.vcxproj     |  149 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcxproj     |  149 -
 .../dll/build/gbench/UtilityProjects/configure._   |    5 -
 .../gbench/UtilityProjects/configure_dialog._      |    5 -
 .../vs2012/dll/build/gbench/configure_prebuild.bat |   48 -
 .../gbench/gbench_install/gbench-install.vcxproj   |  218 --
 .../vs2012/dll/build/gbench/ncbi_gbench.sln        |   35 -
 .../build/gui/UtilityProjects/_CONFIGURE_.vcxproj  |  145 -
 .../gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj |  145 -
 .../dll/build/gui/UtilityProjects/configure._      |    4 -
 .../build/gui/UtilityProjects/configure_dialog._   |    4 -
 .../vs2012/dll/build/gui/ncbi_gui_dll.sln          |   35 -
 .../gbench-install-internal.vcxproj                |  218 --
 c++/compilers/vs2012/dll/build/ncbi_cpp_dll.sln    |   35 -
 c++/compilers/vs2012/dll/dll_main.cpp              |   18 -
 .../vs2012/dll/third_party_dll_install.mak         |   62 -
 .../vs2012/dll/third_party_dll_install.vcxproj     |  433 --
 .../vs2012/dll/third_party_msvcdll_install.vcxproj |  433 --
 c++/compilers/vs2012/install.sh                    |  186 -
 c++/compilers/vs2012/lock_ptb_config.bat           |   94 -
 c++/compilers/vs2012/make.bat                      |  220 --
 c++/compilers/vs2012/make_ncbi.bat                 |   60 -
 c++/compilers/vs2012/msvcvars.bat                  |   14 -
 c++/compilers/vs2012/ncbi.rc                       |    1 -
 c++/compilers/vs2012/ncbilogo.ico                  |  Bin 766 -> 0 bytes
 c++/compilers/vs2012/ptb.bat                       |  275 --
 .../vs2012/static/build/UtilityProjects/PTB.sln    |   79 -
 .../build/UtilityProjects/_CONFIGURE_.vcxproj      |  145 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcxproj     |  145 -
 .../static/build/UtilityProjects/configure._       |    4 -
 .../build/UtilityProjects/configure_dialog._       |    4 -
 c++/compilers/vs2012/static/build/all.bat          |   39 -
 c++/compilers/vs2012/static/build/all_gui.bat      |   79 -
 c++/compilers/vs2012/static/build/all_ncbi.bat     |   79 -
 .../msbuild/msbuild_dataobj.lib.vcxproj            |  149 -
 .../project_tree_builder.exe.vcxproj               |  416 --
 .../vs2012/static/build/corelib/xncbi.lib.vcxproj  |  450 ---
 .../build/gui/UtilityProjects/_CONFIGURE_.vcxproj  |  145 -
 .../gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj |  145 -
 .../static/build/gui/UtilityProjects/configure._   |    4 -
 .../build/gui/UtilityProjects/configure_dialog._   |    4 -
 c++/compilers/vs2012/static/build/gui/ncbi_gui.sln |   35 -
 c++/compilers/vs2012/static/build/ncbi_cpp.sln     |   35 -
 .../build/serial/datatool/datatool.exe.vcxproj     |  507 ---
 .../vs2012/static/build/serial/xser.lib.vcxproj    |  534 ---
 .../static/build/util/regexp/regexp.lib.vcxproj    |  364 --
 .../static/build/util/xregexp/xregexp.lib.vcxproj  |  177 -
 .../vs2012/static/build/util/xutil.lib.vcxproj     |  309 --
 .../static/third_party_msvcstatic_install.vcxproj  |  433 --
 .../vs2012/static/third_party_static_install.mak   |   62 -
 .../static/third_party_static_install.vcxproj      |  433 --
 c++/compilers/vs2012/third_party_install.meta.mk   |  326 --
 .../user/build/UtilityProjects/_CONFIGURE_.vcxproj |  145 -
 .../UtilityProjects/_CONFIGURE_DIALOG_.vcxproj     |  145 -
 .../vs2012/user/build/UtilityProjects/configure._  |    4 -
 .../user/build/UtilityProjects/configure_dialog._  |    4 -
 c++/compilers/vs2012/user/build/ncbi_user.sln      |   35 -
 c++/compilers/vs2013/check.sh                      |    2 +-
 c++/compilers/vs2013/make.bat                      |    2 +-
 .../msbuild/msbuild_dataobj.lib.vcxproj            |    4 +-
 .../project_tree_builder.exe.vcxproj               |    4 +-
 c++/compilers/vs2013/third_party_install.meta.mk   |   10 +-
 c++/compilers/xCode/Application.applescript        |  748 ----
 .../xCode/English.lproj/InfoPlist.strings          |  Bin 746 -> 0 bytes
 .../English.lproj/InstallLibsPanel.nib/classes.nib |    4 -
 .../InstallLibsPanel.nib/data.dependency           |   10 -
 .../English.lproj/InstallLibsPanel.nib/info.nib    |   16 -
 .../InstallLibsPanel.nib/keyedobjects.nib          |  Bin 11142 -> 0 bytes
 .../xCode/English.lproj/MainMenu.nib/classes.nib   |   19 -
 .../xCode/English.lproj/MainMenu.nib/info.nib      |   21 -
 .../English.lproj/MainMenu.nib/keyedobjects.nib    |  Bin 47767 -> 0 bytes
 c++/compilers/xCode/English.lproj/locversion.plist |   14 -
 c++/compilers/xCode/Info-Xcode.plist               |   26 -
 c++/compilers/xCode/Libraries.applescript          |  442 ---
 c++/compilers/xCode/ProjBuilder.applescript        |  658 ----
 c++/compilers/xCode/cpp.icns                       |  Bin 324906 -> 0 bytes
 c++/compilers/xCode/diskimage.tmpl                 |   76 -
 c++/compilers/xCode/main.m                         |   40 -
 c++/compilers/xCode/thirdpartylibs.sh              |  120 -
 .../xCode/xCode.xcodeproj/project.pbxproj          |  369 --
 c++/compilers/xcode30_prj/configure                |    3 +-
 c++/compilers/xcode30_prj/copyutl.sh               |   44 +
 c++/compilers/xcode30_prj/datatool.sh              |    2 +-
 c++/compilers/xcode30_prj/ptb.sh                   |    2 +-
 .../UtilityProjects/PTB.xcodeproj/project.pbxproj  |    6 +-
 c++/compilers/xcode30_prj/xcodebuild.sh            |    2 +-
 c++/include/algo/blast/api/bl2seq.hpp              |    2 +-
 .../algo/blast/api/blast_advprot_options.hpp       |    2 +-
 .../algo/blast/api/blast_options_builder.hpp       |    2 +-
 .../algo/blast/api/blast_options_handle.hpp        |    2 +-
 c++/include/algo/blast/api/blast_prot_options.hpp  |    2 +-
 c++/include/algo/blast/api/blast_results.hpp       |    9 +-
 c++/include/algo/blast/api/blast_seqinfosrc.hpp    |    7 +-
 c++/include/algo/blast/api/local_db_adapter.hpp    |    2 +-
 c++/include/algo/blast/api/psiblast_options.hpp    |    2 +-
 c++/include/algo/blast/api/remote_blast.hpp        |    4 +-
 c++/include/algo/blast/api/search_strategy.hpp     |    2 +-
 c++/include/algo/blast/api/seqinfosrc_seqdb.hpp    |    7 +-
 c++/include/algo/blast/api/seqinfosrc_seqvec.hpp   |    7 +-
 c++/include/algo/blast/api/seqsrc_multiseq.hpp     |    2 +-
 c++/include/algo/blast/api/tblastn_options.hpp     |    2 +-
 c++/include/algo/blast/api/uniform_search.hpp      |    2 +-
 c++/include/algo/blast/blastinput/blast_args.hpp   |    2 +-
 .../algo/blast/blastinput/blast_input_aux.hpp      |    2 +-
 .../algo/blast/blastinput/cmdline_flags.hpp        |    6 +-
 .../algo/blast/blastinput/deltablast_args.hpp      |    2 +-
 .../algo/blast/blastinput/psiblast_args.hpp        |    2 +-
 .../composition_adjustment.h                       |    6 +-
 c++/include/algo/blast/core/blast_kappa.h          |   55 +-
 c++/include/algo/blast/core/blast_stat.h           |  140 +-
 c++/include/algo/blast/format/blast_format.hpp     |   12 +-
 c++/include/algo/blast/format/blastfmtutil.hpp     |    2 +-
 c++/include/algo/blast/format/blastxml2_format.hpp |    2 +-
 c++/include/algo/blast/format/data4xml2format.hpp  |    2 +-
 c++/include/algo/blast/igblast/igblast.hpp         |   35 +-
 c++/include/algo/dustmask/symdust.hpp              |    7 +-
 c++/include/cgi/cgi_serial.hpp                     |   28 +-
 c++/include/cgi/cgi_session.hpp                    |    6 +-
 c++/include/cgi/cgiapp.hpp                         |   50 +-
 c++/include/cgi/error_codes.hpp                    |    6 +-
 c++/include/cgi/ncbicgi.hpp                        |   40 +-
 c++/include/cgi/ncbicgir.hpp                       |   53 +-
 c++/include/common/boost_skew_guard.hpp            |   62 +
 c++/include/common/config/ncbiconf_msvc.h          |   13 +-
 c++/include/common/config/ncbiconf_universal.h     |    3 +-
 c++/include/common/config/ncbiconf_xcode.h         |   46 +-
 c++/include/common/ncbi_export.h                   |   11 +-
 c++/include/common/ncbi_package_ver.h              |    2 +-
 c++/include/common/ncbi_source_ver.h               |    6 +-
 c++/include/common/ncbiconf_impl.h                 |    9 +-
 c++/include/connect/ncbi_buffer.h                  |    4 +-
 c++/include/connect/ncbi_conn_exception.hpp        |    4 +-
 c++/include/connect/ncbi_conn_reader_writer.hpp    |   14 +-
 c++/include/connect/ncbi_conn_stream.hpp           |    8 +-
 c++/include/connect/ncbi_connection.h              |   29 +-
 c++/include/connect/ncbi_connutil.h                |   19 +-
 c++/include/connect/ncbi_core_cxx.hpp              |    6 +-
 c++/include/connect/ncbi_http_connector.h          |   50 +-
 c++/include/connect/ncbi_http_session.hpp          |   71 +-
 c++/include/connect/ncbi_lbos.hpp                  |  257 ++
 c++/include/connect/ncbi_pipe.hpp                  |   26 +-
 c++/include/connect/ncbi_service.h                 |   31 +-
 c++/include/connect/ncbi_socket.h                  |    4 +-
 c++/include/connect/ncbi_util.h                    |    8 +-
 c++/include/connect/server_monitor.hpp             |   18 +-
 c++/include/connect/services/grid_client.hpp       |   29 +-
 c++/include/connect/services/grid_rw_impl.hpp      |    8 +-
 c++/include/connect/services/grid_worker.hpp       |  111 +-
 c++/include/connect/services/grid_worker_app.hpp   |   52 +-
 .../neticache_client_int.hpp}                      |   44 +-
 .../connect/services/impl/netschedule_api_int.hpp  |  312 ++
 .../connect/services/impl/netstorage_impl.hpp      |  266 ++
 .../connect/services/impl/netstorage_int.hpp       |  289 ++
 c++/include/connect/services/json_over_uttp.hpp    |    4 +-
 c++/include/connect/services/netcache_api.hpp      |   24 +-
 c++/include/connect/services/netcache_api_expt.hpp |    6 +-
 c++/include/connect/services/netcomponent.hpp      |   29 +-
 c++/include/connect/services/neticache_client.hpp  |   23 +-
 c++/include/connect/services/netschedule_api.hpp   |  317 +-
 c++/include/connect/services/netservice_api.hpp    |   21 +-
 c++/include/connect/services/netstorage.hpp        |   48 +-
 .../{netstorage_admin.hpp => netstorage_ft.hpp}    |   45 +-
 c++/include/connect/services/netstorage_impl.hpp   |  478 +--
 c++/include/connect/services/ns_output_parser.hpp  |   91 +-
 c++/include/connect/services/remote_app.hpp        |   12 +-
 c++/include/connect/services/srv_connections.hpp   |   89 +-
 c++/include/corelib/ddumpable.hpp                  |    4 +-
 c++/include/corelib/env_reg.hpp                    |    3 +-
 c++/include/corelib/error_codes.hpp                |    2 +-
 c++/include/corelib/impl/listener_stack.hpp        |    2 +-
 c++/include/corelib/impl/ncbi_atomic_defs.h        |    2 +-
 c++/include/corelib/impl/stringutf8_deprecated.hpp |   38 +-
 c++/include/corelib/impl/stringutf8_deprecated.inl |   40 +-
 c++/include/corelib/metareg.hpp                    |   14 +-
 c++/include/corelib/ncbi_autoinit.hpp              |    2 +-
 c++/include/corelib/ncbi_bswap.hpp                 |    8 +-
 c++/include/corelib/ncbi_config.hpp                |   19 +-
 c++/include/corelib/ncbi_limits.h                  |    6 +-
 c++/include/corelib/ncbi_message.hpp               |    2 +-
 c++/include/corelib/ncbi_os_mswin.hpp              |    2 +-
 c++/include/corelib/ncbi_process.hpp               |   31 +-
 c++/include/corelib/ncbi_safe_static.hpp           |   59 +-
 c++/include/corelib/ncbi_url.hpp                   |    3 +-
 c++/include/corelib/ncbiapp.hpp                    |   15 +-
 c++/include/corelib/ncbiargs.hpp                   |   78 +-
 c++/include/corelib/ncbidbg.hpp                    |    4 +-
 c++/include/corelib/ncbidiag.hpp                   |   51 +-
 c++/include/corelib/ncbienv.hpp                    |    2 +-
 c++/include/corelib/ncbiexpt.hpp                   |   12 +-
 c++/include/corelib/ncbifile.hpp                   |  136 +-
 c++/include/corelib/ncbimisc.hpp                   |   81 +-
 c++/include/corelib/ncbimtx.hpp                    |   26 +-
 c++/include/corelib/ncbireg.hpp                    |   35 +-
 c++/include/corelib/ncbistr.hpp                    | 1110 +++---
 c++/include/corelib/ncbistr_util.hpp               |   69 +-
 c++/include/corelib/ncbitime.hpp                   |    7 +-
 c++/include/corelib/plugin_manager.hpp             |    4 +-
 c++/include/corelib/request_ctx.hpp                |  177 +-
 c++/include/corelib/tempstr.hpp                    |  148 +-
 c++/include/corelib/test_boost.hpp                 |  210 +-
 c++/include/corelib/test_mt.hpp                    |   25 +-
 c++/include/corelib/version.hpp                    |   40 +-
 c++/include/dbapi/dbapi.hpp                        |   22 +-
 c++/include/dbapi/driver/dbapi_conn_factory.hpp    |    2 +-
 c++/include/dbapi/driver/dbapi_driver_conn_mgr.hpp |   20 +-
 c++/include/dbapi/driver/dbapi_driver_convert.hpp  |    8 +-
 c++/include/dbapi/driver/dbapi_object_convert.hpp  |    5 +-
 c++/include/dbapi/driver/dbapi_svc_mapper.hpp      |   31 +-
 c++/include/dbapi/driver/drivers.hpp               |    4 +-
 c++/include/dbapi/driver/impl/dbapi_impl_cmd.hpp   |    6 +-
 .../dbapi/driver/impl/dbapi_impl_connection.hpp    |   19 +-
 .../dbapi/driver/impl/dbapi_impl_context.hpp       |   15 +-
 .../dbapi/driver/impl/dbapi_impl_result.hpp        |   13 +-
 c++/include/dbapi/driver/interfaces.hpp            |   72 +-
 c++/include/dbapi/driver/odbc/interfaces.hpp       |   33 +-
 c++/include/dbapi/driver/odbc/unix_odbc/odbcinst.h |  217 +-
 c++/include/dbapi/driver/odbc/unix_odbc/sql.h      |   28 +-
 c++/include/dbapi/driver/odbc/unix_odbc/sqlext.h   |  175 +-
 c++/include/dbapi/driver/odbc/unix_odbc/sqlspi.h   |  173 +
 c++/include/dbapi/driver/odbc/unix_odbc/sqltypes.h |  106 +-
 c++/include/dbapi/driver/odbc/unix_odbc/sqlucode.h |    4 +-
 .../dbapi/driver/odbc/unix_odbc/unixodbc_conf.h    |    7 +
 c++/include/dbapi/driver/public.hpp                |   65 +-
 c++/include/dbapi/driver/types.hpp                 |  111 +-
 c++/include/dbapi/driver/util/blobstore.hpp        |   34 +-
 c++/include/dbapi/driver/util/parameters.hpp       |    4 +-
 c++/include/dbapi/error_codes.hpp                  |    5 +-
 c++/include/dbapi/variant.hpp                      |   33 +-
 c++/include/ncbi_pch.hpp                           |    2 +-
 c++/include/ncbi_source_ver.h                      |    2 +-
 c++/include/ncbiconf.h                             |    2 +-
 c++/include/objects/entrez2/Entrez2_id_list.hpp    |    5 +-
 c++/include/objects/entrez2/entrez2_client.hpp     |   67 +-
 c++/include/objects/general/Dbtag.hpp              |    7 +-
 c++/include/objects/general/User_field.hpp         |  256 +-
 c++/include/objects/general/User_object.hpp        |   35 +-
 .../genomecoll/GCClient_GetAssemblyReques.hpp      |    3 +-
 c++/include/objects/genomecoll/GC_Sequence.hpp     |    2 +-
 .../objects/genomecoll/genomic_collections_cli.hpp |   55 +-
 .../{seq/Seq_gap.hpp => id2/id2_client.hpp}        |   60 +-
 .../id2/id2processor.hpp}                          |   59 +-
 .../id2/id2processor_interface.hpp}                |   39 +-
 c++/include/objects/macro/String_constraint.hpp    |    4 +-
 c++/include/objects/misc/error_codes.hpp           |    2 +-
 c++/include/objects/seq/Bioseq.hpp                 |    4 +-
 c++/include/objects/seq/Seq_gap.hpp                |   38 +-
 c++/include/objects/seq/Seq_inst.hpp               |    5 +-
 c++/include/objects/seq/seq_loc_mapper_base.hpp    |   55 +-
 c++/include/objects/seq/sofa_map.hpp               |    6 +-
 c++/include/objects/seqalign/Dense_diag.hpp        |    2 +-
 c++/include/objects/seqfeat/BioSource.hpp          |    4 +-
 c++/include/objects/seqfeat/Gb_qual.hpp            |   22 +-
 c++/include/objects/seqfeat/Prot_ref.hpp           |    5 +-
 c++/include/objects/seqfeat/RNA_ref.hpp            |    4 +-
 c++/include/objects/seqfeat/SeqFeatData.hpp        |    2 +-
 c++/include/objects/seqfeat/Seq_feat.hpp           |   13 +-
 c++/include/objects/seqfeat/SubSource.hpp          |   15 +-
 .../objects/seqfeat/{RNA_ref.hpp => Trna_ext.hpp}  |   40 +-
 c++/include/objects/seqfeat/seqfeat_macros.hpp     |   22 +-
 c++/include/objects/seqloc/Seq_id.hpp              |   18 +-
 c++/include/objects/seqloc/Seq_loc.hpp             |   11 +-
 c++/include/objects/taxon1/taxon1.hpp              |  108 +-
 c++/include/objects/taxon3/cached_taxon3.hpp       |    2 +-
 c++/include/objects/taxon3/itaxon3.hpp             |    2 +-
 c++/include/objects/taxon3/taxon3.hpp              |    2 +-
 c++/include/objects/trackmgr/TMgr_IdentityId.hpp   |    3 +-
 c++/include/objects/trackmgr/blast_client.hpp      |    8 +-
 ...rvalue_client.hpp => createtrackset_client.hpp} |   41 +-
 .../objects/trackmgr/createusertrack_client.hpp    |    8 +-
 .../objects/trackmgr/displaytrack_client.hpp       |    8 +-
 c++/include/objects/trackmgr/gridrpcclient.hpp     |   40 +-
 .../objects/trackmgr/item_resolver_client.hpp      |    8 +-
 .../objects/trackmgr/removeusertrack_client.hpp    |    8 +-
 ..._client.hpp => supported_assemblies_client.hpp} |   43 +-
 .../objects/trackmgr/switch_context_client.hpp     |    8 +-
 .../objects/trackmgr/track_attrvalue_client.hpp    |    8 +-
 c++/include/objects/trackmgr/trackmgr_client.hpp   |   22 +-
 ...ck_attrvalue_client.hpp => trackset_client.hpp} |   41 +-
 c++/include/objects/valerr/ValidErrItem.hpp        |    2 +-
 c++/include/objects/valid/Comment_rule.hpp         |   10 +-
 c++/include/objmgr/annot_selector.hpp              |   10 +-
 c++/include/objmgr/bioseq_handle.hpp               |   15 +-
 c++/include/objmgr/data_loader.hpp                 |   82 +-
 c++/include/objmgr/error_codes.hpp                 |    3 +-
 c++/include/objmgr/gc_assembly_parser.hpp          |    2 +-
 c++/include/objmgr/impl/annot_collector.hpp        |   18 +-
 c++/include/objmgr/impl/bioseq_info.hpp            |    4 +-
 c++/include/objmgr/impl/data_source.hpp            |   24 +-
 c++/include/objmgr/impl/handle_range_map.hpp       |    2 +-
 c++/include/objmgr/impl/scope_impl.hpp             |   43 +-
 c++/include/objmgr/impl/seq_annot_info.hpp         |    7 +-
 c++/include/objmgr/impl/seq_id_sort.hpp            |  131 +
 c++/include/objmgr/impl/seq_loc_cvt.hpp            |   36 +-
 c++/include/objmgr/impl/snp_annot_info.hpp         |   46 +-
 .../genbank => objmgr}/impl/split_parser.hpp       |    4 +-
 c++/include/objmgr/impl/tse_assigner.hpp           |    2 +-
 c++/include/objmgr/impl/tse_split_info.hpp         |    2 +-
 c++/include/objmgr/object_manager.hpp              |    7 +-
 c++/include/objmgr/objmgr_exception.hpp            |    6 +-
 c++/include/objmgr/scope.hpp                       |  221 +-
 c++/include/objmgr/seq_entry_ci.hpp                |    2 +-
 c++/include/objmgr/seq_feat_handle.hpp             |    4 +-
 c++/include/objmgr/seq_loc_mapper.hpp              |    2 +-
 c++/include/objmgr/seq_map.hpp                     |    5 +-
 c++/include/objmgr/seq_map_ci.hpp                  |   16 +-
 c++/include/objmgr/util/create_defline.hpp         |   10 +-
 c++/include/objmgr/util/feature.hpp                |   44 +-
 c++/include/objmgr/util/objutil.hpp                |    2 +-
 c++/include/objmgr/util/sequence.hpp               |   31 +-
 .../objtools/align_format/align_format_util.hpp    |   77 +-
 c++/include/objtools/align_format/format_flags.hpp |   19 +-
 .../objtools/align_format/seqalignfilter.hpp       |    2 +-
 c++/include/objtools/align_format/tabular.hpp      |   17 +-
 c++/include/objtools/align_format/taxFormat.hpp    |  296 ++
 c++/include/objtools/alnmgr/pairwise_aln.hpp       |   20 +-
 c++/include/objtools/alnmgr/sparse_aln.hpp         |    3 +-
 .../blast/blastdb_format/blastdb_seqid.hpp         |   14 +-
 .../blast/seqdb_reader/impl/seqdbatlas.hpp         |   24 +-
 .../blast/seqdb_reader/impl/seqdbgeneral.hpp       |    2 +-
 .../objtools/blast/seqdb_reader/impl/seqdbisam.hpp |    4 +-
 .../objtools/blast/seqdb_reader/impl/seqdbvol.hpp  |    2 +-
 .../objtools/blast/seqdb_reader/seqdbcommon.hpp    |    8 +-
 .../objtools/blast/seqdb_reader/seqdbexpert.hpp    |    2 +-
 .../objtools/blast/seqdb_writer/build_db.hpp       |   35 +-
 .../blast/seqdb_writer/multisource_util.hpp        |    7 +-
 .../objtools/blast/seqdb_writer/writedb.hpp        |    2 +-
 c++/include/objtools/cleanup/cleanup.hpp           |  199 +-
 c++/include/objtools/cleanup/newcleanup.hpp        |    2 -
 .../data_loaders/genbank/cache/reader_cache.hpp    |   10 +-
 .../data_loaders/genbank/cache/writer_cache.hpp    |   20 +-
 .../objtools/data_loaders/genbank/gbloader.hpp     |   20 +-
 .../data_loaders/genbank/gbloader_params.h         |    2 +-
 .../genbank/gicache/reader_gicache.hpp             |    5 +-
 .../data_loaders/genbank/impl/dispatcher.hpp       |   28 +-
 .../data_loaders/genbank/impl/info_cache.hpp       |   88 +-
 .../data_loaders/genbank/impl/processors.hpp       |    5 +-
 .../data_loaders/genbank/impl/reader_id1_base.hpp  |    4 +-
 .../data_loaders/genbank/impl/reader_id2_base.hpp  |   40 +-
 .../data_loaders/genbank/impl/request_result.hpp   |  437 ++-
 .../data_loaders/genbank/impl/statistics.hpp       |    4 +-
 .../objtools/data_loaders/genbank/reader.hpp       |   54 +-
 .../data_loaders/genbank/reader_interface.hpp      |    4 +-
 .../objtools/data_loaders/genbank/writer.hpp       |   10 +-
 .../data_loaders/genbank/writer_interface.hpp      |    4 +-
 c++/include/objtools/data_loaders/loaders.hpp      |    2 +-
 c++/include/objtools/edit/autodef.hpp              |   17 +-
 .../objtools/edit/autodef_feature_clause.hpp       |    4 +-
 .../objtools/edit/autodef_feature_clause_base.hpp  |   12 +-
 c++/include/objtools/edit/autodef_mod_combo.hpp    |    7 +-
 c++/include/objtools/edit/autodef_options.hpp      |   31 +-
 c++/include/objtools/edit/cds_fix.hpp              |   15 +-
 c++/include/objtools/edit/feattable_edit.hpp       |   11 +-
 c++/include/objtools/edit/loc_edit.hpp             |    5 +-
 c++/include/objtools/edit/parse_text_options.hpp   |    2 +-
 .../publication_edit.hpp}                          |   50 +-
 c++/include/objtools/edit/rna_edit.hpp             |    2 +-
 c++/include/objtools/edit/seq_entry_edit.hpp       |   18 +-
 c++/include/objtools/edit/source_edit.hpp          |    2 +-
 c++/include/objtools/edit/struc_comm_field.hpp     |   44 +-
 c++/include/objtools/error_codes.hpp               |    4 +-
 c++/include/objtools/format/cigar_formatter.hpp    |    2 +-
 c++/include/objtools/format/context.hpp            |   15 +-
 c++/include/objtools/format/flat_file_config.hpp   |    8 +-
 .../objtools/format/flat_file_generator.hpp        |    2 +-
 c++/include/objtools/format/gather_items.hpp       |    3 +-
 c++/include/objtools/format/genbank_gather.hpp     |    3 +-
 c++/include/objtools/format/items/comment_item.hpp |    3 +-
 c++/include/objtools/format/items/gene_finder.hpp  |    4 +-
 c++/include/objtools/format/items/tsa_item.hpp     |    7 +-
 c++/include/objtools/format/sam_formatter.hpp      |    2 +-
 c++/include/objtools/readers/bed_reader.hpp        |    2 +-
 c++/include/objtools/readers/error_container.hpp   |    2 +-
 c++/include/objtools/readers/fasta.hpp             |   35 +-
 c++/include/objtools/readers/gff2_data.hpp         |   13 +-
 c++/include/objtools/readers/gff2_reader.hpp       |   12 +-
 c++/include/objtools/readers/gff3_reader.hpp       |    9 +-
 c++/include/objtools/readers/gtf_reader.hpp        |    7 +-
 c++/include/objtools/readers/gvf_reader.hpp        |    3 +-
 c++/include/objtools/readers/idmapper.hpp          |    2 +-
 c++/include/objtools/readers/line_error.hpp        |    2 +-
 c++/include/objtools/readers/message_listener.hpp  |    2 +-
 c++/include/objtools/readers/microarray_reader.hpp |    2 +-
 c++/include/objtools/readers/reader_base.hpp       |    2 +-
 c++/include/objtools/readers/readfeat.hpp          |    6 +-
 c++/include/objtools/readers/rm_reader.hpp         |    2 +-
 c++/include/objtools/readers/source_mod_parser.hpp |    7 +-
 c++/include/objtools/readers/ucscregion_reader.hpp |    2 +-
 c++/include/objtools/readers/vcf_reader.hpp        |    2 +-
 c++/include/objtools/readers/wiggle_reader.hpp     |    2 +-
 c++/include/serial/enumvalues.hpp                  |    2 +-
 c++/include/serial/impl/choice.hpp                 |    4 +-
 c++/include/serial/impl/classinfohelper.hpp        |    5 +-
 c++/include/serial/impl/memberlist.hpp             |    2 +-
 c++/include/serial/impl/stltypes.hpp               |    2 +-
 c++/include/serial/objistrasn.hpp                  |    3 +-
 c++/include/serial/objistrjson.hpp                 |    2 +-
 c++/include/serial/objostr.hpp                     |   24 +-
 c++/include/serial/objostrjson.hpp                 |    2 +-
 c++/include/serial/rpcbase.hpp                     |  181 +-
 c++/include/serial/rpcbase_impl.hpp                |  170 +
 c++/include/serial/serialimpl.hpp                  |    2 +-
 c++/include/serial/serialutil.hpp                  |    2 +-
 c++/include/util/bitset/bm.h                       |    4 +-
 c++/include/util/bitset/bmalloc.h                  |    6 +-
 c++/include/util/bitset/bmblocks.h                 |    6 +-
 c++/include/util/bitset/bmconst.h                  |    9 +-
 c++/include/util/bitset/bmfunc.h                   |   27 +-
 c++/include/util/bitset/bmutil.h                   |   26 +-
 c++/include/util/bitset/encoding.h                 |    4 +-
 c++/include/util/cache/icache_cf.hpp               |    4 +-
 c++/include/util/file_manifest.hpp                 |  238 ++
 c++/include/util/format_guess.hpp                  |    4 +-
 c++/include/util/id_mux.hpp                        |    4 +-
 c++/include/util/line_reader.hpp                   |   34 +-
 c++/include/util/ncbi_cache.hpp                    |   20 +-
 c++/include/util/range_coll.hpp                    |    4 +-
 c++/include/util/resize_iter.hpp                   |   18 +-
 c++/include/util/retry_ctx.hpp                     |    4 +-
 c++/include/util/stream_source.hpp                 |  236 ++
 c++/include/util/sync_queue.hpp                    |  673 ++--
 c++/include/util/thread_pool_old.hpp               |    8 +-
 c++/include/util/transmissionrw.hpp                |    8 +-
 c++/include/util/value_convert.hpp                 |  241 +-
 c++/include/util/value_convert_policy.hpp          |  415 +-
 c++/scripts/common/add_vdb.sh                      |   15 +-
 c++/scripts/common/check/check_add.sh              |   11 +-
 c++/scripts/common/check/check_exec.sh             |    6 +-
 c++/scripts/common/check/check_exec_test.sh        |    6 +-
 c++/scripts/common/check/check_make_cfg.sh         |   16 +-
 c++/scripts/common/check/check_make_unix.sh        |   25 +-
 .../common/check/inspxe-suppressions/_vs.sup       |   37 +
 c++/scripts/common/check/inspxe.sh                 |    2 +-
 c++/scripts/common/check/valgrind.supp             |   37 +-
 c++/scripts/common/common.sh                       |    2 +-
 c++/scripts/common/impl/generate_all_objects.sh    |    6 +-
 c++/scripts/common/impl/install.sh                 |    2 +-
 c++/scripts/common/impl/run_with_lock.sh           |    2 +-
 c++/scripts/common/new_project.wsf                 |    2 +-
 c++/scripts/common/project_utilits.js              |   22 +-
 c++/scripts/projects/blast/Manifest                |    8 +-
 c++/scripts/projects/blast/components.link         |   17 +-
 .../projects/blast/post_build/blast_utils.py       |   75 +-
 .../projects/blast/post_build/make_installers.py   |   27 +-
 .../projects/blast/post_build/rpm/make_rpm.py      |   37 +-
 .../projects/blast/post_build/rpm/ncbi-blast.spec  |   44 +
 c++/scripts/projects/blast/post_build/rpm/test.sh  |   13 +
 .../projects/blast/post_build/win/make_win.py      |    9 +-
 c++/scripts/projects/corelib/Manifest              |    4 +-
 c++/scripts/projects/datatool/ChangeLog            |   10 +
 c++/scripts/projects/datatool/Manifest             |    4 +-
 c++/scripts/projects/datatool/components.link      |    4 +-
 c++/scripts/projects/dispatcher/Manifest           |    4 +-
 c++/scripts/projects/grid/ChangeLog                |  219 --
 c++/scripts/projects/grid/LICENSE                  |   19 -
 c++/scripts/projects/grid/Manifest                 |   55 -
 c++/scripts/projects/grid/README                   |   66 -
 c++/scripts/projects/grid/components.link          |    5 -
 c++/scripts/projects/grid/project.lst              |   24 -
 c++/scripts/projects/igblast/Manifest              |   13 +-
 c++/scripts/projects/igblast/README                |   13 +-
 c++/scripts/projects/igblast/components.link       |   17 +-
 .../projects/igblast/post_build/blast_utils.py     |   60 +-
 .../ncbi-igblast.pmdoc/01_stage-contents.xml       |    1 -
 .../macosx/ncbi-igblast.pmdoc/01_stage.xml         |    1 -
 .../post_build/macosx/ncbi-igblast.pmdoc/index.xml |    1 -
 .../igblast/post_build/macosx/ncbi-igblast.sh      |  153 +-
 .../igblast/post_build/macosx/ncbi_igblast         |    1 -
 .../projects/igblast/post_build/make_installers.py |   25 +-
 .../projects/igblast/post_build/rpm/make_rpm.py    |   38 +-
 .../projects/igblast/post_build/win/make_win.py    |   13 +-
 c++/scripts/projects/ncbi_applog/ChangeLog         |   49 +-
 c++/scripts/projects/ncbi_applog/Manifest          |    4 +-
 c++/scripts/projects/ncbi_applog/README            |    2 +-
 c++/scripts/projects/ncbi_gui_base.lst             |    2 +
 c++/scripts/projects/netcache/ChangeLog            |   25 +
 c++/scripts/projects/netschedule/ChangeLog         |   27 +
 c++/scripts/projects/netschedule/components.link   |    6 +-
 c++/scripts/projects/netstorage/ChangeLog          |    5 +
 c++/scripts/projects/netstorage/components.link    |    8 +-
 c++/scripts/projects/netstorage/project.lst        |   11 +
 c++/scripts/projects/netstorage_gc/project.lst     |    3 +-
 .../projects/project_tree_builder/ChangeLog        |    3 +
 c++/scripts/projects/project_tree_builder/Manifest |    5 +-
 .../projects/project_tree_builder/components.link  |    4 +-
 c++/scripts/projects/public/Manifest               |   21 +-
 c++/scripts/projects/public/components.link        |   23 +-
 .../public/tagprecommit/use_embedded_ptb.py        |   32 +
 c++/scripts/projects/python_ncbi_dbapi/ChangeLog   |    3 +
 .../python_ncbi_dbapi/post_build/post_build.py     |    4 +-
 c++/scripts/projects/python_ncbi_dbapi/project.lst |    4 +-
 c++/scripts/projects/xmlwrapp/Manifest             |   13 +-
 c++/src/Makefile.in                                |    2 +-
 c++/src/algo/Makefile.in                           |    2 +-
 c++/src/algo/blast/api/bl2seq.cpp                  |    2 +-
 c++/src/algo/blast/api/blast_objmgr_tools.cpp      |   71 +-
 c++/src/algo/blast/api/blast_options_builder.cpp   |    4 +-
 c++/src/algo/blast/api/blast_results.cpp           |    9 +-
 c++/src/algo/blast/api/blast_seqalign.cpp          |   23 +-
 c++/src/algo/blast/api/blast_setup_cxx.cpp         |   12 +-
 c++/src/algo/blast/api/dust_filter.cpp             |    5 +-
 c++/src/algo/blast/api/local_blast.cpp             |    6 +-
 c++/src/algo/blast/api/local_db_adapter.cpp        |    2 +-
 c++/src/algo/blast/api/msa_pssm_input.cpp          |    2 +-
 c++/src/algo/blast/api/prelim_stage.cpp            |    2 +-
 c++/src/algo/blast/api/psiblast_aux_priv.cpp       |    4 +-
 c++/src/algo/blast/api/remote_blast.cpp            |   52 +-
 c++/src/algo/blast/api/remote_search.cpp           |    2 +-
 c++/src/algo/blast/api/search_strategy.cpp         |    2 +-
 c++/src/algo/blast/api/seqinfosrc_bioseq.hpp       |    9 +-
 c++/src/algo/blast/api/seqsrc_multiseq.cpp         |    2 +-
 c++/src/algo/blast/api/seqsrc_seqdb.cpp            |    2 +-
 c++/src/algo/blast/api/uniform_search.cpp          |    2 +-
 c++/src/algo/blast/api/version.cpp                 |   16 +-
 c++/src/algo/blast/blastinput/blast_args.cpp       |   22 +-
 .../algo/blast/blastinput/blast_fasta_input.cpp    |   15 +-
 c++/src/algo/blast/blastinput/blast_input_aux.cpp  |    8 +-
 c++/src/algo/blast/blastinput/blastn_args.cpp      |    4 +-
 c++/src/algo/blast/blastinput/cmdline_flags.cpp    |    6 +-
 c++/src/algo/blast/blastinput/deltablast_args.cpp  |    4 +-
 c++/src/algo/blast/blastinput/psiblast_args.cpp    |    4 +-
 .../unit_test/blast_scope_src_unit_test.cpp        |    7 +-
 .../blastinput/unit_test/blastinput_unit_test.cpp  |   52 +-
 .../blast/blastinput/unit_test/data/localid.txt    |    9 +
 .../composition_adjustment.c                       |   12 +-
 .../blast/composition_adjustment/redo_alignment.c  |  209 +-
 c++/src/algo/blast/core/Makefile.blast.lib         |    9 +-
 c++/src/algo/blast/core/Makefile.blast.lib.unix    |    7 +-
 c++/src/algo/blast/core/blast_engine.c             |    8 +-
 c++/src/algo/blast/core/blast_gapalign.c           |    4 +-
 c++/src/algo/blast/core/blast_hits.c               |  695 ++--
 c++/src/algo/blast/core/blast_hspstream_mt_utils.c |   16 +-
 c++/src/algo/blast/core/blast_hspstream_mt_utils.h |   13 +-
 c++/src/algo/blast/core/blast_kappa.c              | 1459 +++++--
 c++/src/algo/blast/core/blast_options.c            |   28 +-
 c++/src/algo/blast/core/blast_seg.c                |    4 +-
 c++/src/algo/blast/core/blast_setup.c              |    7 +-
 c++/src/algo/blast/core/blast_stat.c               |  563 +--
 c++/src/algo/blast/core/blast_traceback.c          |  448 ++-
 c++/src/algo/blast/core/blast_traceback_mt_priv.c  |   46 +-
 c++/src/algo/blast/core/blast_util.c               |    4 +-
 c++/src/algo/blast/core/boost_erf.c                |  256 ++
 .../main.cpp => algo/blast/core/boost_erf.h}       |   28 +-
 c++/src/algo/blast/core/greedy_align.c             |    6 +-
 c++/src/algo/blast/dbindex/makeindex/main.cpp      |    4 +-
 .../algo/blast/format/Makefile.xblastformat.lib    |    2 +-
 c++/src/algo/blast/format/blast_format.cpp         |   64 +-
 c++/src/algo/blast/format/blastfmtutil.cpp         |    4 +-
 c++/src/algo/blast/format/blastxml2_format.cpp     |    2 +-
 c++/src/algo/blast/format/data4xml2format.cpp      |    2 +-
 c++/src/algo/blast/igblast/igblast.cpp             |  171 +-
 c++/src/algo/blast/unit_tests/api/Makefile.in      |    7 +-
 .../unit_tests/api/Makefile.stat_unit_test.app     |   15 +
 .../algo/blast/unit_tests/api/bl2seq_unit_test.cpp |    6 +-
 .../blast/unit_tests/api/blastengine_unit_test.cpp |   14 +-
 .../blast/unit_tests/api/blastextend_unit_test.cpp |    6 +-
 .../blast/unit_tests/api/blastfilter_unit_test.cpp |   22 +-
 .../blast/unit_tests/api/blasthits_unit_test.cpp   |    6 +-
 .../blast/unit_tests/api/blastsetup_unit_test.cpp  |   15 +-
 c++/src/algo/blast/unit_tests/api/data/biased.fsa  |    0
 .../blast/unit_tests/api/data/msa.clustalw.txt     |    0
 .../algo/blast/unit_tests/api/delta_unit_test.cpp  |   28 +-
 .../blast/unit_tests/api/psiblast_unit_test.cpp    |   18 +-
 .../api/pssmenginefreqratios_unit_test.cpp         |    4 +-
 .../unit_tests/api/redoalignment_unit_test.cpp     |   10 +-
 .../algo/blast/unit_tests/api/rps_unit_test.cpp    |   18 +-
 .../algo/blast/unit_tests/api/stat_unit_test.cpp   |   78 +
 .../unit_tests/api/uniform_search_unit_test.cpp    |   10 +-
 .../unit_tests/api/version_reference_unit_test.cpp |    4 +-
 .../blast_format/seqalignfilter_unit_test.cpp      |    6 +-
 .../blast/unit_tests/seqdb_reader/data/big_gi.pnd  |  Bin 0 -> 80 bytes
 .../blast/unit_tests/seqdb_reader/data/big_gi.pni  |  Bin 0 -> 52 bytes
 .../unit_tests/seqdb_reader/seqdb_unit_test.cpp    |   75 +-
 c++/src/algo/winmask/win_mask_gen_counts.cpp       |    4 +-
 c++/src/app/Makefile.in                            |    6 +-
 c++/src/app/blast/Makefile.blastn.app              |    2 +-
 c++/src/app/blast/blast_app_util.cpp               |   74 +-
 c++/src/app/blast/blast_app_util.hpp               |   30 +-
 c++/src/app/blast/blast_formatter.cpp              |   12 +-
 c++/src/app/blast/blastn_app.cpp                   |   21 +-
 c++/src/app/blast/blastp_app.cpp                   |   17 +-
 c++/src/app/blast/blastx_app.cpp                   |   19 +-
 c++/src/app/blast/deltablast_app.cpp               |   19 +-
 c++/src/app/blast/psiblast_app.cpp                 |   29 +-
 c++/src/app/blast/rpsblast_app.cpp                 |   19 +-
 c++/src/app/blast/rpstblastn_app.cpp               |   19 +-
 c++/src/app/blast/seedtop_app.cpp                  |    4 +-
 c++/src/app/blast/tblastn_app.cpp                  |   22 +-
 c++/src/app/blast/tblastx_app.cpp                  |   19 +-
 c++/src/app/blastdb/blastdb_aliastool.cpp          |    8 +-
 c++/src/app/blastdb/blastdbcheck.cpp               |    4 +-
 c++/src/app/blastdb/blastdbcmd.cpp                 |   10 +-
 c++/src/app/blastdb/blastdbcp.cpp                  |   94 +-
 c++/src/app/blastdb/convert2blastmask.cpp          |    4 +-
 c++/src/app/blastdb/makeblastdb.cpp                |   12 +-
 c++/src/app/blastdb/makeprofiledb.cpp              |    6 +-
 c++/src/app/dustmasker/main.cpp                    |    4 +-
 c++/src/app/segmasker/segmasker.cpp                |    4 +-
 c++/src/app/winmasker/main.cpp                     |    4 +-
 c++/src/build-system/Makefile.app.in               |    5 +-
 c++/src/build-system/Makefile.dll.in               |    2 +-
 c++/src/build-system/Makefile.flat_tuneups         |   10 +-
 c++/src/build-system/Makefile.in                   |    4 +-
 c++/src/build-system/Makefile.meta.gmake=yes       |    2 +-
 c++/src/build-system/Makefile.meta_l               |   28 +-
 c++/src/build-system/Makefile.meta_p               |    4 +-
 c++/src/build-system/Makefile.mk.in                |   48 +-
 c++/src/build-system/Makefile.mk.in.msvc           |   10 +
 c++/src/build-system/Makefile.requirements         |    2 +-
 c++/src/build-system/Makefile.rules.in             |   13 +-
 c++/src/build-system/NEWS                          |    2 +
 c++/src/build-system/aclocal.m4                    |   31 +-
 c++/src/build-system/config.h.in                   |   48 +
 c++/src/build-system/configure                     | 3915 +++++++++++++++----
 c++/src/build-system/configure.ac                  |  260 +-
 c++/src/build-system/helpers/Makefile.in           |    6 +
 .../helpers/Makefile.run_with_lock.app             |   19 +
 c++/src/build-system/helpers/run_with_lock.c       |  537 +++
 c++/src/build-system/install.sh.in                 |    2 +-
 c++/src/build-system/library_relations.txt         |  197 +-
 c++/src/build-system/m4/ax_check_gnu_make.m4       |   84 +
 .../build-system/{ => m4}/ax_jni_include_dir.m4    |    0
 c++/src/build-system/m4/ax_prog_cc_for_build.m4    |  131 +
 c++/src/build-system/ncbi_package_version          |    2 +-
 c++/src/build-system/new_module.sh.in              |   16 +-
 c++/src/build-system/project_tree_builder.ini      |  119 +-
 .../project_tree_builder/file_contents.cpp         |    8 +-
 .../project_tree_builder/mac_prj_generator.cpp     |   12 +-
 .../project_tree_builder/msvc_configure.cpp        |    6 +-
 .../project_tree_builder/msvc_dlls_info_utils.hpp  |    6 +-
 .../project_tree_builder/msvc_makefile.cpp         |   24 +-
 .../project_tree_builder/msvc_prj_utils.cpp        |    4 +-
 .../project_tree_builder/msvc_site.cpp             |   42 +-
 .../project_tree_builder/prj_file_collector.cpp    |    6 +-
 .../project_tree_builder/proj_builder_app.cpp      |   24 +-
 .../project_tree_builder/proj_projects.cpp         |    6 +-
 .../project_tree_builder/proj_tree.cpp             |   10 +-
 .../project_tree_builder/proj_tree_builder.cpp     |   10 +-
 .../build-system/project_tree_builder/resolver.cpp |    4 +-
 c++/src/build-system/relocate.sh.in                |    2 +-
 c++/src/cgi/cgiapp.cpp                             |  351 +-
 c++/src/cgi/cgictx.cpp                             |   15 +-
 c++/src/cgi/fcgi_run.cpp                           |   41 +-
 c++/src/cgi/ncbicgi.cpp                            |   84 +-
 c++/src/cgi/ncbicgir.cpp                           |  288 +-
 c++/src/cgi/ref_args.cpp                           |    8 +-
 c++/src/cgi/user_agent.cpp                         |   20 +-
 c++/src/connect/Makefile.connect.lib               |    7 +-
 c++/src/connect/Makefile.connect.lib.unix          |   44 +-
 c++/src/connect/Makefile.xconnect.lib              |    4 +-
 c++/src/connect/Makefile.xxconnect.lib             |    6 +-
 c++/src/connect/Makefile.xxconnect.lib.unix        |    7 +-
 c++/src/connect/ncbi_base64.c                      |   26 +-
 c++/src/connect/ncbi_buffer.c                      |   33 +-
 c++/src/connect/ncbi_conn_stream.cpp               |   27 +-
 c++/src/connect/ncbi_conn_test.cpp                 |   20 +-
 c++/src/connect/ncbi_connection.c                  |   29 +-
 c++/src/connect/ncbi_connutil.c                    |   27 +-
 c++/src/connect/ncbi_core.c                        |    9 +-
 c++/src/connect/ncbi_core_cxx.cpp                  |   34 +-
 c++/src/connect/ncbi_dispd.c                       |   19 +-
 c++/src/connect/ncbi_gnutls.c                      |   72 +-
 c++/src/connect/ncbi_http_connector.c              | 1232 ++++--
 c++/src/connect/ncbi_http_session.cpp              |   94 +-
 c++/src/connect/ncbi_lbos.c                        | 2793 +++++++++++++
 c++/src/connect/ncbi_lbos.h                        |  176 +
 c++/src/connect/ncbi_lbos_cxx.cpp                  |  568 +++
 c++/src/connect/ncbi_lbosp.h                       |  607 +++
 c++/src/connect/ncbi_lbosp.hpp                     |   96 +
 c++/src/connect/ncbi_local.c                       |    4 +-
 c++/src/connect/ncbi_pipe.cpp                      |  282 +-
 c++/src/connect/ncbi_priv.c                        |   15 +-
 c++/src/connect/ncbi_priv.h                        |    9 +-
 c++/src/connect/ncbi_sendmail.c                    |    8 +-
 c++/src/connect/ncbi_service.c                     |  302 +-
 c++/src/connect/ncbi_servicep.h                    |    3 +-
 c++/src/connect/ncbi_socket.c                      |   76 +-
 c++/src/connect/ncbi_socketp.h                     |    7 +-
 c++/src/connect/ncbi_strerror.c                    |   10 +-
 c++/src/connect/ncbi_util.c                        |   37 +-
 c++/src/connect/ncbi_version.h                     |    4 +-
 c++/src/connect/server_monitor.cpp                 |   19 +-
 c++/src/connect/services/Makefile.in               |    2 +-
 .../services/Makefile.ncbi_xcache_netcache.lib     |    2 +-
 c++/src/connect/services/Makefile.xconnserv.lib    |    8 +-
 c++/src/connect/services/clparser.cpp              |    5 +-
 c++/src/connect/services/compound_id.cpp           |    8 +-
 c++/src/connect/services/grid_client.cpp           |   68 +-
 c++/src/connect/services/grid_control_thread.cpp   |   24 +-
 c++/src/connect/services/grid_rw_impl.cpp          |   63 +-
 c++/src/connect/services/grid_worker.cpp           |   68 +-
 c++/src/connect/services/grid_worker_app.cpp       |   11 +-
 c++/src/connect/services/grid_worker_impl.hpp      |   62 +-
 c++/src/connect/services/json_over_uttp.cpp        |    4 +-
 c++/src/connect/services/netcache_api.cpp          |  139 +-
 c++/src/connect/services/netcache_api_impl.hpp     |   14 +-
 c++/src/connect/services/netcache_params.cpp       |   10 +-
 c++/src/connect/services/netcache_params.hpp       |   16 +-
 c++/src/connect/services/netcache_rw.cpp           |  151 +-
 c++/src/connect/services/netcache_rw.hpp           |    3 +-
 c++/src/connect/services/neticache_client.cpp      |  154 +-
 c++/src/connect/services/netschedule_api.cpp       |  542 ++-
 c++/src/connect/services/netschedule_api_admin.cpp |    6 +-
 .../connect/services/netschedule_api_executor.cpp  |   74 +-
 .../connect/services/netschedule_api_getjob.cpp    |  461 +++
 .../connect/services/netschedule_api_getjob.hpp    |  128 +
 c++/src/connect/services/netschedule_api_impl.hpp  |  357 +-
 .../connect/services/netschedule_api_reader.cpp    |  274 +-
 .../connect/services/netschedule_api_submitter.cpp |   66 +-
 c++/src/connect/services/netservice_api.cpp        |  152 +-
 c++/src/connect/services/netservice_api_impl.hpp   |   65 +-
 c++/src/connect/services/netservice_params.cpp     |    3 +-
 c++/src/connect/services/netservice_params.hpp     |    6 +-
 c++/src/connect/services/netstorage.cpp            |  281 ++
 c++/src/connect/services/netstorage_direct_nc.cpp  |  133 +-
 c++/src/connect/services/netstorage_direct_nc.hpp  |   13 +-
 c++/src/connect/services/netstorage_rpc.cpp        |  618 ++-
 c++/src/connect/services/netstorage_rpc.hpp        |   55 +-
 c++/src/connect/services/netstorageobjectinfo.cpp  |   82 +-
 c++/src/connect/services/netstorageobjectloc.cpp   |  182 +-
 c++/src/connect/services/ns_job_serializer.cpp     |    2 +-
 c++/src/connect/services/ns_output_parser.cpp      |  457 +--
 c++/src/connect/services/remote_app.cpp            |   53 +-
 c++/src/connect/services/srv_connections.cpp       |   53 +-
 c++/src/connect/services/srv_connections_impl.hpp  |   76 +-
 c++/src/connect/services/timeline.hpp              |  193 -
 c++/src/connect/services/tmp_wn_info.cpp           |  452 +++
 c++/src/connect/services/util.cpp                  |    5 +-
 c++/src/connect/services/wn_commit_thread.cpp      |   61 +-
 c++/src/connect/services/wn_commit_thread.hpp      |   11 +-
 c++/src/connect/services/wn_main_loop.cpp          |  179 +-
 c++/src/connect/services/wn_offline_mode.cpp       |   10 +-
 c++/src/corelib/Makefile.corelib.lib               |    2 +-
 c++/src/corelib/ddumpable.cpp                      |    7 +-
 c++/src/corelib/env_reg.cpp                        |   37 +-
 c++/src/corelib/metareg.cpp                        |   28 +-
 c++/src/corelib/ncbi_autoinit.cpp                  |    2 +-
 c++/src/corelib/ncbi_base64.c                      |   26 +-
 c++/src/corelib/ncbi_config.cpp                    |   14 +-
 c++/src/corelib/ncbi_cookies.cpp                   |   17 +-
 c++/src/corelib/ncbi_message.cpp                   |    2 +-
 c++/src/corelib/ncbi_process.cpp                   |   20 +-
 c++/src/corelib/ncbi_stack_linux.cpp               |    6 +-
 c++/src/corelib/ncbi_system.cpp                    |   12 +-
 c++/src/corelib/ncbi_url.cpp                       |   34 +-
 c++/src/corelib/ncbiapp.cpp                        |   26 +-
 c++/src/corelib/ncbiargs.cpp                       |  151 +-
 c++/src/corelib/ncbiargs_p.hpp                     |    4 +-
 c++/src/corelib/ncbidiag.cpp                       |  138 +-
 c++/src/corelib/ncbidiag_p.cpp                     |    6 +-
 c++/src/corelib/ncbidll.cpp                        |   10 +-
 c++/src/corelib/ncbienv.cpp                        |    2 +-
 c++/src/corelib/ncbiexec.cpp                       |   63 +-
 c++/src/corelib/ncbiexpt.cpp                       |   24 +-
 c++/src/corelib/ncbifile.cpp                       |   91 +-
 c++/src/corelib/ncbimtx.cpp                        |   47 +-
 c++/src/corelib/ncbireg.cpp                        |  279 +-
 c++/src/corelib/ncbistr.cpp                        |  791 ++--
 c++/src/corelib/ncbistre.cpp                       |   22 +-
 c++/src/corelib/ncbitime.cpp                       |  200 +-
 c++/src/corelib/perf_log.cpp                       |    6 +-
 c++/src/corelib/request_ctx.cpp                    |  230 +-
 c++/src/corelib/resource_info.cpp                  |   41 +-
 c++/src/corelib/teamcity_boost.cpp                 |    4 +-
 c++/src/corelib/test_boost.cpp                     |  338 +-
 c++/src/corelib/test_mt.cpp                        |   84 +-
 c++/src/corelib/version.cpp                        |   80 +-
 c++/src/dbapi/blobstream.cpp                       |    6 +-
 c++/src/dbapi/blobstream.hpp                       |    8 +-
 c++/src/dbapi/cache/dbapi_blob_cache.cpp           |   26 +-
 c++/src/dbapi/dbapi.cpp                            |   19 +-
 c++/src/dbapi/driver/Makefile.in                   |    4 +-
 c++/src/dbapi/driver/dbapi_conn_factory.cpp        |    2 +-
 c++/src/dbapi/driver/dbapi_driver_conn_mgr.cpp     |   35 +-
 c++/src/dbapi/driver/dbapi_driver_conn_params.cpp  |   14 +-
 c++/src/dbapi/driver/dbapi_driver_convert.cpp      |   16 +
 c++/src/dbapi/driver/dbapi_driver_utils.cpp        |    7 +-
 c++/src/dbapi/driver/dbapi_impl_cmd.cpp            |   10 +-
 c++/src/dbapi/driver/dbapi_impl_connection.cpp     |   16 +-
 c++/src/dbapi/driver/dbapi_impl_context.cpp        |   36 +-
 c++/src/dbapi/driver/dbapi_object_convert.cpp      |   12 +-
 c++/src/dbapi/driver/dbapi_svc_mapper.cpp          |   29 +-
 c++/src/dbapi/driver/interfaces.cpp                |    4 +-
 c++/src/dbapi/driver/memory_store.cpp              |   25 +-
 c++/src/dbapi/driver/memory_store.hpp              |    3 +-
 c++/src/dbapi/driver/odbc/bcp.cpp                  |   74 +-
 c++/src/dbapi/driver/odbc/connection.cpp           |  125 +-
 c++/src/dbapi/driver/odbc/cursor.cpp               |   49 +-
 c++/src/dbapi/driver/odbc/result.cpp               |   50 +-
 c++/src/dbapi/driver/parameters.cpp                |    4 +-
 c++/src/dbapi/driver/public.cpp                    |   36 +-
 c++/src/dbapi/driver/types.cpp                     |  271 +-
 c++/src/dbapi/driver_mgr.cpp                       |    6 +-
 c++/src/dbapi/rs_impl.cpp                          |   18 +-
 c++/src/dbapi/rsmeta_impl.cpp                      |    8 +-
 c++/src/dbapi/rw_impl.cpp                          |    4 +-
 c++/src/dbapi/rw_impl.hpp                          |    6 +-
 c++/src/dbapi/stmt_impl.cpp                        |    8 +-
 c++/src/dbapi/stmt_impl.hpp                        |   12 +-
 c++/src/dbapi/variant.cpp                          |   94 +-
 c++/src/objects/Makefile.in                        |    2 +-
 c++/src/objects/Makefile.sources                   |    4 +-
 c++/src/objects/biotree/biotree.asn                |    2 +-
 c++/src/objects/blast/blast.asn                    |   84 +-
 c++/src/objects/entrez2/Entrez2_id_list.cpp        |    6 +-
 c++/src/objects/entrez2/entrez2_client.cpp         |  148 +-
 c++/src/objects/general/Dbtag.cpp                  |   22 +-
 c++/src/objects/general/User_field.cpp             |  231 +-
 c++/src/objects/general/User_object.cpp            |  198 +-
 .../genomecoll/GCClient_GetAssemblyReques.cpp      |   30 +-
 c++/src/objects/genomecoll/GC_Sequence.cpp         |    2 +-
 .../objects/genomecoll/Makefile.gencoll_client.lib |    4 +-
 .../genomecoll/Makefile.genome_collection.lib      |    4 +-
 c++/src/objects/genomecoll/gencoll_client.asn      |    8 +-
 .../objects/genomecoll/genomic_collections_cli.cpp |  108 +-
 .../Seq_inst.cpp => id2/ID2_Request_Packet.cpp}    |   51 +-
 c++/src/objects/id2/id2.asn                        |    2 +-
 .../{seq/Seq_inst.cpp => id2/id2_client.cpp}       |   46 +-
 c++/src/objects/macro/Field_type.cpp               |    6 +-
 c++/src/objects/macro/String_constraint.cpp        |   50 +-
 c++/src/objects/macro/macro.asn                    |    5 +-
 c++/src/objects/mmdb/Makefile.sources              |    6 +-
 c++/src/objects/nt_sources.sh                      |    2 +-
 c++/src/objects/seq/Bioseq.cpp                     |    2 +-
 c++/src/objects/seq/Makefile.sources               |    6 +-
 c++/src/objects/seq/Seq_gap.cpp                    |   64 +-
 c++/src/objects/seq/Seq_inst.cpp                   |   29 +-
 c++/src/objects/seq/seq.asn                        |    3 +-
 c++/src/objects/seq/seq_align_mapper_base.cpp      |    2 +-
 c++/src/objects/seq/seq_id_tree.cpp                |    4 +-
 c++/src/objects/seq/seq_loc_mapper_base.cpp        |  102 +-
 c++/src/objects/seq/sofa_map.cpp                   |  130 +-
 c++/src/objects/seqfeat/BioSource.cpp              |  244 +-
 c++/src/objects/seqfeat/Gb_qual.cpp                |  356 +-
 c++/src/objects/seqfeat/Genetic_code_table.cpp     |    7 +-
 c++/src/objects/seqfeat/OrgMod.cpp                 |   85 +-
 c++/src/objects/seqfeat/Org_ref.cpp                |    2 +-
 c++/src/objects/seqfeat/Prot_ref.cpp               |   17 +-
 c++/src/objects/seqfeat/RNA_ref.cpp                |   78 +-
 c++/src/objects/seqfeat/SeqFeatData.cpp            |   87 +-
 c++/src/objects/seqfeat/Seq_feat.cpp               |   83 +-
 c++/src/objects/seqfeat/SubSource.cpp              |  792 ++--
 .../Entrez2_id_list.cpp => seqfeat/Trna_ext.cpp}   |   85 +-
 c++/src/objects/seqfeat/ecnum_ambiguous.inc        |  206 +-
 c++/src/objects/seqfeat/ecnum_ambiguous.txt        |  204 +-
 c++/src/objects/seqfeat/ecnum_deleted.inc          |    4 +-
 c++/src/objects/seqfeat/ecnum_deleted.txt          |    2 +
 c++/src/objects/seqfeat/ecnum_replaced.inc         |   69 +-
 c++/src/objects/seqfeat/ecnum_replaced.txt         |   67 +-
 c++/src/objects/seqfeat/ecnum_specific.inc         |  368 +-
 c++/src/objects/seqfeat/ecnum_specific.txt         |  366 +-
 c++/src/objects/seqfeat/institution_codes.inc      |   66 +-
 c++/src/objects/seqfeat/institution_codes.txt      |   64 +-
 c++/src/objects/seqfeat/seqfeat.asn                |    6 +-
 c++/src/objects/seqloc/Seq_id.cpp                  |   80 +-
 c++/src/objects/seqloc/Seq_loc.cpp                 |   16 +-
 c++/src/objects/seqloc/accguide.inc                |   29 +-
 c++/src/objects/seqloc/accguide.txt                |   27 +-
 c++/src/objects/seqset/Bioseq_set.cpp              |   68 +-
 c++/src/objects/seqtable/SeqTable_multi_data.cpp   |    6 +-
 c++/src/objects/seqtable/seqtable.def              |    3 +
 c++/src/objects/taxon1/cache.cpp                   |   16 +-
 c++/src/objects/taxon1/cache.hpp                   |   18 +-
 c++/src/objects/taxon1/taxon1.cpp                  |  172 +-
 c++/src/objects/taxon1/taxon1.def                  |    3 +
 c++/src/objects/taxon3/Makefile.taxon3.lib         |    2 +-
 c++/src/objects/taxon3/cached_taxon3.cpp           |    4 +-
 c++/src/objects/taxon3/taxon3.cpp                  |    2 +-
 .../objects/trackmgr/Makefile.trackmgrgridcli.lib  |    6 +-
 c++/src/objects/trackmgr/TMgr_IdentityId.cpp       |   10 +-
 c++/src/objects/trackmgr/createtrackset_client.cpp |   77 +
 .../trackmgr/supported_assemblies_client.cpp       |  109 +
 c++/src/objects/trackmgr/trackmgr.asn              |   83 +-
 c++/src/objects/trackmgr/trackset_client.cpp       |   77 +
 c++/src/objects/valerr/ValidErrItem.cpp            |    6 +-
 c++/src/objects/valid/Comment_rule.cpp             |  226 +-
 c++/src/objects/valid/validrules.inc               |   66 +-
 c++/src/objects/valid/validrules.prt               |   64 +-
 c++/src/objmgr/Makefile.objmgr.lib                 |    5 +-
 c++/src/objmgr/annot_collector.cpp                 |  136 +-
 c++/src/objmgr/annot_object.cpp                    |    2 +-
 c++/src/objmgr/bioseq_base_info.cpp                |    4 +-
 c++/src/objmgr/bioseq_handle.cpp                   |    9 +-
 c++/src/objmgr/bioseq_info.cpp                     |   27 +-
 c++/src/objmgr/data_loader.cpp                     |  272 +-
 c++/src/objmgr/data_source.cpp                     |   49 +-
 c++/src/objmgr/gc_assembly_parser.cpp              |   10 +-
 c++/src/objmgr/handle_range_map.cpp                |    2 +-
 c++/src/objmgr/objmgr_exception.cpp                |    4 +-
 c++/src/objmgr/scope.cpp                           |  134 +-
 c++/src/objmgr/scope_impl.cpp                      |  708 ++--
 c++/src/objmgr/scope_info.cpp                      |    2 +-
 c++/src/objmgr/seq_annot_info.cpp                  |   66 +-
 c++/src/objmgr/seq_entry_ci.cpp                    |    2 +-
 c++/src/objmgr/seq_feat_handle.cpp                 |   12 +-
 c++/src/objmgr/seq_id_sort.cpp                     |  164 +
 c++/src/objmgr/seq_loc_cvt.cpp                     |  348 +-
 c++/src/objmgr/seq_loc_mapper.cpp                  |    2 +-
 c++/src/objmgr/seq_map.cpp                         |   11 +-
 c++/src/objmgr/seq_map_ci.cpp                      |  112 +-
 c++/src/objmgr/seq_table_info.cpp                  |    4 +-
 c++/src/objmgr/snp_annot_info.cpp                  |  137 +-
 .../genbank => objmgr}/split_parser.cpp            |   22 +-
 c++/src/objmgr/tse_assigner.cpp                    |    2 +-
 c++/src/objmgr/tse_info.cpp                        |    2 +-
 c++/src/objmgr/tse_split_info.cpp                  |    2 +-
 c++/src/objmgr/util/Makefile.util.lib              |    2 +-
 c++/src/objmgr/util/create_defline.cpp             |  132 +-
 c++/src/objmgr/util/feature.cpp                    |  199 +-
 c++/src/objmgr/util/objutil.cpp                    |   87 +-
 c++/src/objmgr/util/seq_loc_util.cpp               |   11 +-
 c++/src/objmgr/util/seqtitle.cpp                   |    8 +-
 c++/src/objmgr/util/sequence.cpp                   |  209 +-
 c++/src/objtools/Makefile.in                       |    2 +-
 .../align_format/Makefile.align_format.lib         |    6 +-
 .../objtools/align_format/align_format_util.cpp    |  110 +-
 c++/src/objtools/align_format/format_flags.cpp     |   19 +-
 c++/src/objtools/align_format/seqalignfilter.cpp   |    4 +-
 c++/src/objtools/align_format/showalign.cpp        |   62 +-
 c++/src/objtools/align_format/showdefline.cpp      |   11 +-
 c++/src/objtools/align_format/tabular.cpp          |  299 +-
 c++/src/objtools/align_format/taxFormat.cpp        |  966 +++++
 .../unit_test/Makefile.align_format_unit_test.app  |    4 +-
 .../unit_test/aln_printer_unit_test.cpp            |    2 +-
 .../unit_test/data/in_showalign_use_this_gi.asn    |    0
 .../align_format/unit_test/data/protein.fa         |    0
 .../align_format/unit_test/showalign_unit_test.cpp |   10 +-
 .../unit_test/showdefline_unit_test.cpp            |    2 +-
 .../unit_test/tabularinof_unit_test.cpp            |   37 +-
 c++/src/objtools/alnmgr/aln_builders.cpp           |   15 +-
 c++/src/objtools/alnmgr/alnsegments.cpp            |   21 +-
 c++/src/objtools/alnmgr/pairwise_aln.cpp           |   50 +-
 c++/src/objtools/alnmgr/score_builder_base.cpp     |    2 +-
 c++/src/objtools/alnmgr/sparse_aln.cpp             |  191 +-
 c++/src/objtools/alnmgr/sparse_ci.cpp              |   31 +-
 .../blast/blastdb_format/blastdb_dataextract.cpp   |    4 +-
 .../unit_test/seq_writer_unit_test.cpp             |    8 +-
 .../gene_info_reader/demo/gene_info_reader_app.cpp |    4 +-
 c++/src/objtools/blast/seqdb_reader/seqdb.cpp      |    8 +-
 c++/src/objtools/blast/seqdb_reader/seqdbalias.cpp |   10 +-
 .../objtools/blast/seqdb_reader/seqdbcommon.cpp    |   46 +-
 .../objtools/blast/seqdb_reader/seqdbexpert.cpp    |    4 +-
 .../objtools/blast/seqdb_reader/seqdbgilistset.cpp |    8 +-
 .../objtools/blast/seqdb_reader/seqdbgimask.cpp    |    4 +-
 .../objtools/blast/seqdb_reader/seqdbgimask.hpp    |    2 +-
 c++/src/objtools/blast/seqdb_reader/seqdbimpl.cpp  |    4 +-
 c++/src/objtools/blast/seqdb_reader/seqdbimpl.hpp  |    2 +-
 c++/src/objtools/blast/seqdb_reader/seqdbisam.cpp  |    6 +-
 c++/src/objtools/blast/seqdb_reader/seqdbvol.cpp   |   18 +-
 .../blast/seqdb_reader/test/seqdb_perf.cpp         |    6 +-
 .../objtools/blast/seqdb_writer/build-alias-index  |    2 +-
 c++/src/objtools/blast/seqdb_writer/build_db.cpp   |   60 +-
 .../blast/seqdb_writer/multisource_util.cpp        |    9 +-
 c++/src/objtools/blast/seqdb_writer/taxid_set.cpp  |   21 +-
 .../seqdb_writer/unit_test/criteria_unit_test.cpp  |    2 +-
 .../seqdb_writer/unit_test/data/rabbit_mrna.fsa    |    7 +-
 .../unit_test/data/rabbit_taxidmap.txt             |    4 +
 .../seqdb_writer/unit_test/writedb_unit_test.cpp   |  191 +-
 c++/src/objtools/blast/seqdb_writer/writedb.cpp    |    4 +-
 .../blast/seqdb_writer/writedb_convert.cpp         |    6 +-
 .../objtools/blast/seqdb_writer/writedb_gimask.cpp |    4 +-
 .../objtools/blast/seqdb_writer/writedb_gimask.hpp |    2 +-
 .../objtools/blast/seqdb_writer/writedb_impl.cpp   |   16 +-
 .../objtools/blast/seqdb_writer/writedb_impl.hpp   |    2 +-
 .../objtools/blast/seqdb_writer/writedb_isam.cpp   |    4 +-
 .../objtools/blast/seqdb_writer/writedb_volume.cpp |   15 +-
 .../objtools/blast/seqdb_writer/writedb_volume.hpp |    2 +-
 c++/src/objtools/cleanup/Makefile.cleanup.lib      |    2 +-
 c++/src/objtools/cleanup/autogenerated_cleanup.cpp |   50 +-
 c++/src/objtools/cleanup/autogenerated_cleanup.hpp |    4 +-
 c++/src/objtools/cleanup/autogenerated_cleanup.txt |    6 +-
 .../cleanup/autogenerated_extended_cleanup.cpp     |   96 +-
 .../cleanup/autogenerated_extended_cleanup.hpp     |   13 +-
 .../cleanup/autogenerated_extended_cleanup.txt     |   67 +-
 c++/src/objtools/cleanup/cleanup.cpp               | 2533 ++++++++++--
 c++/src/objtools/cleanup/cleanup_utils.cpp         |    4 +-
 c++/src/objtools/cleanup/cleanup_utils.hpp         |    2 +-
 c++/src/objtools/cleanup/newcleanupp.cpp           | 4127 +++++++++++++++-----
 c++/src/objtools/cleanup/newcleanupp.hpp           |  131 +-
 c++/src/objtools/data_loaders/Makefile.in          |    4 +-
 .../data_loaders/genbank/Makefile.ncbi_xreader.lib |    4 +-
 .../data_loaders/genbank/cache/reader_cache.cpp    |  188 +-
 .../data_loaders/genbank/cache/writer_cache.cpp    |   95 +-
 .../objtools/data_loaders/genbank/dispatcher.cpp   |  519 ++-
 c++/src/objtools/data_loaders/genbank/gbloader.cpp |  188 +-
 .../gicache/Makefile.ncbi_xreader_gicache.lib      |    4 +-
 .../data_loaders/genbank/gicache/gicache.c         |  237 +-
 .../data_loaders/genbank/gicache/gicache_cxx.cpp}  |   44 +-
 .../genbank/gicache/reader_gicache.cpp             |    7 +-
 .../data_loaders/genbank/id1/reader_id1.cpp        |   26 +-
 .../objtools/data_loaders/genbank/info_cache.cpp   |    8 +-
 .../objtools/data_loaders/genbank/processors.cpp   |  105 +-
 c++/src/objtools/data_loaders/genbank/reader.cpp   |  277 +-
 .../data_loaders/genbank/reader_id1_base.cpp       |    9 +-
 .../data_loaders/genbank/reader_id2_base.cpp       |  810 +++-
 .../objtools/data_loaders/genbank/reader_snp.cpp   |  125 +-
 .../data_loaders/genbank/request_result.cpp        |  471 ++-
 c++/src/objtools/edit/Makefile.edit.lib            |    4 +-
 c++/src/objtools/edit/autodef.cpp                  |  242 +-
 .../objtools/edit/autodef_available_modifier.cpp   |   11 +-
 c++/src/objtools/edit/autodef_feature_clause.cpp   |  106 +-
 .../objtools/edit/autodef_feature_clause_base.cpp  |  111 +-
 c++/src/objtools/edit/autodef_mod_combo.cpp        |  222 +-
 c++/src/objtools/edit/autodef_options.cpp          |   75 +-
 c++/src/objtools/edit/capitalization_string.cpp    |    5 +-
 c++/src/objtools/edit/cds_fix.cpp                  |   45 +-
 c++/src/objtools/edit/feattable_edit.cpp           |  182 +-
 c++/src/objtools/edit/field_handler.cpp            |    8 +-
 c++/src/objtools/edit/loc_edit.cpp                 |   18 +-
 c++/src/objtools/edit/parse_text_options.cpp       |    2 +-
 c++/src/objtools/edit/publication_edit.cpp         |  156 +
 c++/src/objtools/edit/remote_updater.cpp           |  117 +-
 c++/src/objtools/edit/seq_entry_edit.cpp           |  343 +-
 c++/src/objtools/edit/seqid_guesser.cpp            |    2 +-
 c++/src/objtools/edit/struc_comm_field.cpp         |  193 +-
 c++/src/objtools/format/Makefile.xformat.lib       |    2 +-
 c++/src/objtools/format/accession_item.cpp         |    2 +-
 c++/src/objtools/format/cigar_formatter.cpp        |    2 +-
 c++/src/objtools/format/comment_item.cpp           |   68 +-
 c++/src/objtools/format/context.cpp                |   24 +-
 c++/src/objtools/format/ctrl_items.cpp             |    2 +-
 c++/src/objtools/format/dbsource_item.cpp          |    2 +-
 c++/src/objtools/format/defline_item.cpp           |    2 +-
 c++/src/objtools/format/embl_formatter.cpp         |    2 +-
 c++/src/objtools/format/feature_item.cpp           |  120 +-
 c++/src/objtools/format/flat_file_config.cpp       |    6 +-
 c++/src/objtools/format/flat_file_generator.cpp    |  141 +-
 c++/src/objtools/format/flat_seqloc.cpp            |   66 +-
 c++/src/objtools/format/gather_items.cpp           |   52 +-
 c++/src/objtools/format/gbseq_formatter.cpp        |    2 +-
 c++/src/objtools/format/genbank_formatter.cpp      |   47 +-
 c++/src/objtools/format/genbank_gather.cpp         |   48 +-
 c++/src/objtools/format/gene_finder.cpp            |   27 +-
 c++/src/objtools/format/genome_project_item.cpp    |    2 +-
 c++/src/objtools/format/gff_gather.cpp             |    2 +-
 c++/src/objtools/format/inst_info_map.cpp          |  203 +-
 c++/src/objtools/format/inst_info_map.hpp          |   10 +-
 c++/src/objtools/format/item_formatter.cpp         |    3 +-
 c++/src/objtools/format/keywords_item.cpp          |   14 +-
 c++/src/objtools/format/locus_item.cpp             |   16 +-
 c++/src/objtools/format/primary_item.cpp           |    2 +-
 c++/src/objtools/format/qualifiers.cpp             |   10 +-
 c++/src/objtools/format/reference_item.cpp         |    2 +-
 c++/src/objtools/format/sam_formatter.cpp          |    2 +-
 c++/src/objtools/format/source_item.cpp            |    2 +-
 c++/src/objtools/readers/bed_reader.cpp            |   12 +-
 c++/src/objtools/readers/fasta.cpp                 |   49 +-
 c++/src/objtools/readers/format_guess_ex.cpp       |    2 +-
 c++/src/objtools/readers/gff2_data.cpp             |  181 +-
 c++/src/objtools/readers/gff2_reader.cpp           |   81 +-
 c++/src/objtools/readers/gff3_reader.cpp           |  284 +-
 c++/src/objtools/readers/gff3_sofa.cpp             |    6 +-
 c++/src/objtools/readers/gff_reader.cpp            |    4 +-
 c++/src/objtools/readers/gtf_reader.cpp            |  164 +-
 c++/src/objtools/readers/gvf_reader.cpp            |   15 +-
 c++/src/objtools/readers/idmapper.cpp              |    2 +-
 c++/src/objtools/readers/idmapper_builtin.cpp      |    2 +-
 c++/src/objtools/readers/idmapper_config.cpp       |    7 +-
 c++/src/objtools/readers/microarray_reader.cpp     |    4 +-
 c++/src/objtools/readers/phrap.cpp                 |    7 +-
 c++/src/objtools/readers/read_util.cpp             |   10 +-
 c++/src/objtools/readers/reader_base.cpp           |    4 +-
 c++/src/objtools/readers/readfeat.cpp              |  170 +-
 c++/src/objtools/readers/rm_reader.cpp             |    2 +-
 c++/src/objtools/readers/source_mod_parser.cpp     |   64 +-
 c++/src/objtools/readers/ucscregion_reader.cpp     |    2 +-
 c++/src/objtools/readers/vcf_reader.cpp            |   24 +-
 c++/src/objtools/readers/wiggle_reader.cpp         |   11 +-
 c++/src/serial/Makefile.serial.lib                 |    2 +-
 c++/src/serial/choice.cpp                          |    6 +-
 c++/src/serial/classinfo.cpp                       |    4 +-
 c++/src/serial/datatool/blocktype.cpp              |   12 +-
 c++/src/serial/datatool/choicestr.cpp              |    4 +-
 c++/src/serial/datatool/comments.cpp               |   32 +-
 c++/src/serial/datatool/comments.hpp               |    5 +-
 c++/src/serial/datatool/datatool.cpp               |    6 +-
 c++/src/serial/datatool/enumstr.cpp                |    2 +-
 c++/src/serial/datatool/enumtype.cpp               |   31 +-
 c++/src/serial/datatool/enumtype.hpp               |    2 +-
 c++/src/serial/datatool/filecode.cpp               |    4 +-
 c++/src/serial/datatool/generate.cpp               |    6 +-
 c++/src/serial/datatool/module.cpp                 |    4 +-
 c++/src/serial/datatool/reftype.cpp                |    8 +-
 c++/src/serial/datatool/rpcgen.cpp                 |    4 +-
 c++/src/serial/datatool/statictype.cpp             |   40 +-
 c++/src/serial/datatool/statictype.hpp             |   10 +-
 c++/src/serial/datatool/testdata/res/set.ent.3     |  482 +++
 .../serial/datatool/traversal_spec_file_parser.cpp |   12 +-
 c++/src/serial/datatool/unitype.cpp                |   18 +-
 c++/src/serial/datatool/xsdparser.cpp              |    9 +-
 c++/src/serial/enumerated.cpp                      |    2 +-
 c++/src/serial/member.cpp                          |   15 +-
 c++/src/serial/memberlist.cpp                      |    2 +-
 c++/src/serial/objistrasn.cpp                      |    8 +-
 c++/src/serial/objistrjson.cpp                     |    2 +-
 c++/src/serial/objostr.cpp                         |    8 +-
 c++/src/serial/objostrasn.cpp                      |    4 +-
 c++/src/serial/objostrasnb.cpp                     |   31 +-
 c++/src/serial/objostrjson.cpp                     |    4 +-
 c++/src/serial/objostrxml.cpp                      |    2 +-
 c++/src/serial/objstack.cpp                        |    2 +-
 c++/src/serial/pathhook.cpp                        |    2 +-
 c++/src/serial/rpcbase.cpp                         |   46 +-
 c++/src/util/Makefile.util.lib                     |    4 +-
 c++/src/util/checksum.cpp                          |    4 +-
 c++/src/util/compress/api/archive.cpp              |    6 +-
 c++/src/util/compress/api/compress.cpp             |    7 +-
 c++/src/util/compress/api/streambuf.cpp            |    4 +-
 c++/src/util/compress/api/tar.cpp                  |   13 +-
 c++/src/util/compress/api/zlib.cpp                 |    4 +-
 c++/src/util/creaders/alnread.c                    |  128 +-
 c++/src/util/ddump_viewer.cpp                      |    8 +-
 c++/src/util/dictionary_util.cpp                   |   31 +-
 c++/src/util/file_manifest.cpp                     |  165 +
 c++/src/util/format_guess.cpp                      |  153 +-
 c++/src/util/itree.cpp                             |    4 +-
 c++/src/util/line_reader.cpp                       |  158 +-
 c++/src/util/retry_ctx.cpp                         |   26 +-
 c++/src/util/scheduler.cpp                         |    7 +-
 c++/src/util/sequtil/sequtil_convert_imp.cpp       |  118 +-
 c++/src/util/sequtil/sequtil_convert_imp.hpp       |   25 +-
 c++/src/util/sequtil/sequtil_manip.cpp             |   52 +-
 c++/src/util/sequtil/sequtil_shared.hpp            |    4 +-
 c++/src/util/smalldns.cpp                          |    4 +-
 c++/src/util/strbuffer.cpp                         |   74 +-
 c++/src/util/stream_source.cpp                     |  394 ++
 c++/src/util/strsearch.cpp                         |    8 +-
 c++/src/util/table_printer.cpp                     |    9 +-
 c++/src/util/tables/raw_scoremat.c                 |    8 +-
 c++/src/util/thread_pool.cpp                       |   41 +-
 c++/src/util/transmissionrw.cpp                    |   79 +-
 c++/src/util/utf8.cpp                              |    4 +-
 c++/src/util/util_misc.cpp                         |    5 +-
 c++/src/util/uttp.cpp                              |   10 +-
 1308 files changed, 52084 insertions(+), 54524 deletions(-)

diff --git a/c++/compilers/msvc1000_prj/Makefile.WinMain.app.msvc b/c++/compilers/msvc1000_prj/Makefile.WinMain.app.msvc
deleted file mode 100644
index 3ccfcd0..0000000
--- a/c++/compilers/msvc1000_prj/Makefile.WinMain.app.msvc
+++ /dev/null
@@ -1,11 +0,0 @@
-[Rule]
-Priority  = 127
-
-
-[Linker]
-subSystem = 2
-
-
-[AddToProject]
-SourceFiles = ../../src/gui/winmain
-
diff --git a/c++/compilers/msvc1000_prj/Makefile.wxWidgets.app.msvc b/c++/compilers/msvc1000_prj/Makefile.wxWidgets.app.msvc
deleted file mode 100644
index 1f2ace2..0000000
--- a/c++/compilers/msvc1000_prj/Makefile.wxWidgets.app.msvc
+++ /dev/null
@@ -1,11 +0,0 @@
-[Rule]
-Priority  = 127
-
-
-[Linker]
-subSystem = 2
-
-
-[AddToProject]
-; SourceFiles = ../../src/gui/winmain
-
diff --git a/c++/compilers/msvc1000_prj/build.sh b/c++/compilers/msvc1000_prj/build.sh
deleted file mode 100644
index 3fbb581..0000000
--- a/c++/compilers/msvc1000_prj/build.sh
+++ /dev/null
@@ -1,257 +0,0 @@
-#! /bin/sh
-# $Id: build.sh 411556 2013-08-29 15:52:12Z ivanov $
-# Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
-#
-# Build C++ Toolkit.
-
-
-#---------------- Arguments ----------------
-
-script="$0"
-cfgs="${1:-DebugDLL ReleaseDLL}"
-arch="$2"
-
-
-#---------------- Configuration ----------------
-
-# Configure with Unicode configurations enabled
-
-NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI_UNICODE=1
-export NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI_UNICODE
-#NCBI_CONFIG____ENABLEDUSERREQUESTS__TWEAKVTUNE=1
-#export NCBI_CONFIG____ENABLEDUSERREQUESTS__TWEAKVTUNE
-
-
-#---------------- Global variables ----------------
-
-build_trees='static dll'
-sol_static="ncbi_cpp.sln gui/ncbi_gui.sln"
-sol_dll="ncbi_cpp_dll.sln gui/ncbi_gui_dll.sln"
-timer="date +'%H:%M'"
-
-# TRUE if parallell project build system is enabled in Visual Studio
-is_ppb=false
-need_ppb_check=true
-
-
-
-#-------------- Functions --------------
-
-error()
-{
-    echo "[`basename $script`] ERROR:  $1"
-    exit 1
-}
-
-generate_msvc10_error_check_file()
-{
-    cat <<-EOF >$1
-	/.*--* (Reb|B)uild( All | )started: Project:/ {
-	  expendable = ""
-	}
-
-	/^--* Project:/ {
-	  expendable = ""
-	}
-
-	/EXPENDABLE project/ {
-	  expendable = \$0
-	}
-
-	/(| : |The source )([fatal ]*error [A-Z]*[0-9]* *: |The .* are both configured to produce|.*: error [0-9]*:|: general error |Error executing |ERROR: This project depends)/ {
-	if (!expendable) {
-	  print \$0
-	  exit
-	  }
-	}
-	EOF
-}
-
-generate_simple_log()
-{
-    echo Parallel project build detected! Creating simplified log.
-    echo
-       
-    log=$1
-    tree=$2
-    sol=$3
-    cfg=$4
-
-    # Get solution directory
-    sol_dir=`echo $sol | sed 's%/[^/]*$%%'`
-    if [ $sol_dir = $sol ] ; then
-        sol_dir=''
-    fi 
-
-    # Get built projects
-    projects=`grep '.*--* Build started:' $log | awk '{ sub(/^.* started:/, ""); gsub(/ /,"#"); print $0}'`
-
-    for p in $projects ; do
-        echo "------$p" | awk '{gsub(/[#]/," "); print}'
-        prj_name=`echo $p | awk '{gsub(/[#,]/," "); print $2}'`
-###        cfg=`echo $p | awk '{gsub(/[#,]/," "); print $4}'`
-
-        # Get path for specified project name from solution
-        s=`grep \"$prj_name\" $tree/build/$sol | awk '{gsub(/,/," "); print $4}' | sed -e 's%"%%g' -e 's%\\\%/%g' -e 's%.vcxproj%%'`
-
-        target_dir=`echo $s | sed 's%/[^/]*$%%'`
-        test $target_dir = $s  &&  target_dir=''
-        target_name=`echo $s | sed 's%^.*/%%'`
-
-        # Path to regular logfile for current project
-        prj_log="$tree/build/$sol_dir/$target_dir/$cfg/$prj_name/$target_name.log"
-
-        # Add it to new combined log
-        if test ! -f "$prj_log" ; then
-            # Not all projects have a log file in the ${prj_name} sub-directory
-            prj_log_short="$tree/build/$sol_dir/$target_dir/$cfg/$target_name.log"
-            if test ! -f "$prj_log_short" ; then
-                echo "BUILD_SYSTEM_ERROR: Cannot find log file for this project: $prj_log"
-                echo
-                continue
-            fi
-            prj_log=$prj_log_short
-        fi
-        # Remove 3 first bytes from logfile (EF BB BF) and some garbage from a multi-projects build
-        cat $prj_log | tr -d '\357\273\277' | sed 's/\( *\)1>/\1  /g'
-        echo
-    done
-    grep '.*========== Build:' $log
-    echo
-}
-
-
-#---------------- Main ----------------
-
-# Get build dir
-build_dir=`dirname $script`
-build_dir=`(cd "$build_dir"; pwd)`
-
-if [ ! -d $build_dir ] ; then
-    error "Build directory $build_dir not found"
-    exit 1
-fi
-cd $build_dir
-
-# Configuration to build configure
-cfg_configure='ReleaseDLL'
-out=".build.$$"
-
-# Get directory for build logfiles
-log_dir="$build_dir/../../logs"
-mkdir $log_dir >/dev/null 2>&1
-log_dir=`(cd "$log_dir"; pwd)`
-rm $log_dir/* >/dev/null 2>&1
-
-
-chmod +x $build_dir/build_exec.bat
-rm -f $build_dir/cfgs.log
-
-
-# Configure
-
-for tree in $build_trees ; do
-    sols=`eval echo "$"sol_${tree}""`
-    for sol in $sols ; do
-        if test ! -f "$tree/build/$sol" ; then
-            echo "INFO: Solution not found, skipped."
-            continue
-        fi
-        alias=`echo $sol | sed -e 's|\\\\.*$||g' -e 's|_.*$||g'`
-        start=`eval $timer`
-        echo
-        echo Start time: $start
-        echo "INFO: Configure \"$tree\\$alias\""
-        echo "Command line: " $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg_configure" "-CONFIGURE-" $out
-        $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg_configure" "-CONFIGURE-" $out >/dev/null
-        echo
-        status=$?
-        # Wait a bit to allow compiler to exit and flush logfile
-        sleep 20
-        if $need_ppb_check; then
-            need_ppb_check=false
-            grep '^1>------ Build started:' $out >/dev/null 2>&1  &&  is_ppb=true
-        fi
-        if $is_ppb; then
-            generate_simple_log $out $tree "$sol" $cfg_configure > $out.simple
-            mv $out $cfg.configure.log
-            mv $out.simple $out
-        fi 
-        cat $out
-        cat $out >> ${log_dir}/${tree}_${cfg_configure}.log
-        echo "Build time: $start - `eval $timer`"
-        echo STATUS = $status
-        if [ $status -ne 0 ] ; then
-            echo "FAILED: Configure $tree\\build\\$sol, $cfg_configure"
-        fi
-        rm -f $out >/dev/null 2>&1
-        if [ $status -ne 0 ] ; then
-            exit 3
-        fi
-    done
-done
-
-
-
-# Generate errors check script
-
-check_awk=$build_dir/build_check.awk
-generate_msvc10_error_check_file $check_awk
-
-
-# Build
-
-for tree in $build_trees ; do
-    for cfg in $cfgs ; do
-        if [ $tree = dll ] ; then
-            echo "$cfg" | grep '.*DLL$' >/dev/null  ||  continue
-        fi
-        sols=`eval echo "$"sol_${tree}""`
-        for sol in $sols ; do
-            if test ! -f "$tree/build/$sol" ; then
-                echo "INFO: Solution not found, skipped."
-                continue
-            fi
-            alias=`echo $sol | sed -e 's|\\\\.*$||g' -e 's|_.*$||g'`
-            start=`eval $timer`
-            echo
-            echo Start time: $start
-            echo "$tree,$sol,$cfg" >> $build_dir/cfgs.log
-            echo "INFO: Building \"$tree\\$cfg\\$alias\""
-            echo "Command line: " $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg" "-BUILD-ALL-" $out
-            echo
-            $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg" "-BUILD-ALL-" $out >/dev/null
-            status=$?
-            # Wait a bit to allow compiler to exit and flush logfile
-            sleep 20
-            if $is_ppb; then
-                generate_simple_log $out $tree "$sol" $cfg > $out.simple
-                mv $out $cfg.build.log
-                mv $out.simple $out
-            fi 
-            cat $out
-            cat $out >> ${log_dir}/${tree}_${cfg}.log
-            echo "Build time: $start - `eval $timer`"
-            echo STATUS = $status
-            if [ $status -ne 0 ] ; then
-                # Check on errors (skip expendable projects)
-                failed="1"
-                awk -f $check_awk $out >$out.res 2>/dev/null  &&  test ! -s $out.res  &&  failed="0"
-                if [ "$failed" = "1" ]; then
-                    echo "FAILED: Build $tree\\build\\$sol, $cfg"
-                    echo "FAILED: Build $tree\\build\\$sol, $cfg" > failed.build.log
-                    echo     >> failed.build.log
-                    cat $out >> failed.build.log
-                    cat $tree/build/${sol}_watchers.txt > failed.watchers.log
-                fi
-                rm -f $out $out.res >/dev/null 2>&1
-                if [ "$failed" = "1" ]; then
-                    exit 4
-                fi
-            fi
-            rm -f $out >/dev/null 2>&1
-        done
-    done
-done
-
-exit 0
diff --git a/c++/compilers/msvc1000_prj/build_exec.bat b/c++/compilers/msvc1000_prj/build_exec.bat
deleted file mode 100644
index 296f171..0000000
--- a/c++/compilers/msvc1000_prj/build_exec.bat
+++ /dev/null
@@ -1,50 +0,0 @@
- at ECHO OFF
-REM $Id: build_exec.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Auxiliary script for build.sh to run C++ build for specified project
-REM and configuration. Cygwin cannot run devenv directly inside shell-script.
-REM
-REM ===========================================================================
-
-call msvcvars.bat
-
-if _%1% == _  goto be_abort
-goto be_build
-
-:be_abort
-rem You should specify logfile or you will not see an output
-echo Usage: "%0 <solution> <command> <arch> <cfg> <target> <logfile>"
-exit 1
-
-:be_build
-set arch=Win32
-if _%3_ == _64_ set arch=x64
-
-rem Next command should be executed last! No other code after it, please.
-
-%DEVENV% %1 /%2 "%4|%arch%" /project "%5" /out "%6"
diff --git a/c++/compilers/msvc1000_prj/build_util.sh b/c++/compilers/msvc1000_prj/build_util.sh
deleted file mode 100644
index bc286e8..0000000
--- a/c++/compilers/msvc1000_prj/build_util.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#! /bin/sh
-# $Id: build_util.sh 419782 2013-11-29 14:51:48Z ivanov $
-# Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
-#
-# Utility functions for building C++ Toolkit.
-
-
-#---------------- Arguments ----------------
-
-arg="$1"
-
-script=`basename $0`
-script_dir=`dirname $0`
-script_dir=`(cd "$script_dir"; pwd)`
-
-
-
-#-------------- Functions --------------
-
-error()
-{
-    echo "[$script] ERROR:  $1"
-    exit 1
-}
-
-
-#---------------- Main ----------------
-
-case "$arg" in
-
-  --with-openmp )
-
-      makefile="$script_dir/../../src/build-system/Makefile.mk.in.msvc"
-      if [ ! -f $makefile ] ; then
-          error "$makefile not found"
-          exit 1
-      fi
-      tmp=/tmp/build_util_$$
-      trap "rm -f $tmp $tmp.awk" 0 1 2 15
-
-      cat <<-EOF >$tmp.awk
-	    /^\[Compiler\]/ {
-	       comp = 1
-	    }
-	    /^AdditionalOptions=/ {
-	       if (comp == 1) {
-	          gsub("/openmp","")
-	          gsub("AdditionalOptions=","AdditionalOptions=/openmp ")
-	          gsub("  ", " ")
-	          comp = 0
-	       }
-	    }
-	    /.*/ {
-	       print
-	    }
-	EOF
-      awk -f $tmp.awk $makefile >$tmp || exit 1
-      touch -r $makefile $tmp
-      cp -fp $tmp $makefile  || exit 2
-      ;;
-
-  * )
-      error "Unknown command: $arg"
-      ;;
-esac
-
-exit 0
diff --git a/c++/compilers/msvc1000_prj/check.sh b/c++/compilers/msvc1000_prj/check.sh
deleted file mode 100644
index fe8a58c..0000000
--- a/c++/compilers/msvc1000_prj/check.sh
+++ /dev/null
@@ -1,275 +0,0 @@
-#! /bin/sh
-# $Id: check.sh 471331 2015-06-25 15:57:14Z ivanov $
-# Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
-#
-# Check C++ Toolkit in all previously built configurations
-# (see 'cfgs.log', generated with 'build.sh' script).
-#
-# USAGE:
-#     check.sh {run | concat | concat_err | concat_cfg | load_to_db}
-#
-# Use 'run' command first, than use other commands.
-# For 'concat_cfg' -- use 'run', 'concat' and 'concat_err' commands first.
-
-
-
-########### Arguments
-
-script="$0"
-method="$1"
-
-# Maximum number of parallel running test configurations
-max_tasks=2
-# Sleep timeout between checks on finished 'run' tasks (seconds)
-sleeptime=60
-
-
-########## Functions
-
-Error()
-{
-    echo "[`basename $script`] ERROR:  $1"
-    exit 1
-}
-
-ParseConfig()
-{
-    if [ -z "$1" ] ; then
-        Error "Unknown configuration name"
-    fi
-    x_tree=`echo $1 | sed -e 's/,.*$//'`
-    x_sol=`echo $1 | sed -e 's/^[^,]*,//' -e 's/,.*$//' -e 's/\.sln//' -e 's|\\\|/|g'`
-    x_cfg=`echo $1 | sed -e 's/^.*,//'`
-}
-
-CopyConfigLogs()
-{
-    cat ${tasks_dir[$1]}/check.sh.log >> $res_log
-    cat ${tasks_dir[$1]}/check.sh.log >> \
-        $build_dir/check.sh.${tasks_tree[$1]}_${tasks_cfg[$1]}.log
-}
-
-
-
-########## Main
-
-errcode=0
-
-# Get build directory
-build_dir=`dirname $script`
-build_dir=`(cd "$build_dir"; pwd)`
-timer="date +'%H:%M'"
-
-if [ ! -d $build_dir ] ; then
-    Error "Build directory $build_dir not found"
-fi
-cd $build_dir  ||  Error "Cannot change directory"
-
-res_log="$build_dir/check.sh.log"
-res_concat="$build_dir/check.sh.out"
-res_concat_err="$build_dir/check.sh.out_err"
-
-cfgs="`cat cfgs.log`"
-if [ -z "$cfgs" ] ; then
-    Error "Build some configurations first"
-fi
-
-
-# --- Initialization
-
-case "$method" in
-    run )
-        rm -f "$res_log"
-        rm -f "$build_dir/check.sh.*.log" > /dev/null 2>&1
-        # Init checks
-        $build_dir/../../scripts/common/check/check_make_win_cfg.sh init  || \
-            Error "Check initialization failed"
-        # Init task list
-        i=0
-        while [ $i -lt $max_tasks ] ; do
-            tasks_name[$i]=""
-            tasks_tree[$i]=""
-            tasks_cfg[$i]=""
-            tasks_dir[$i]=""
-            tasks_start[$i]=""
-            i=`expr $i + 1`
-        done
-        ;;
-    clean )
-        # not implemented, 'clean' method is not used on Windows 
-        exit 0
-        ;;
-    concat )
-        cp $res_log $res_concat
-        ;;
-    concat_err )
-        egrep 'ERR \[|TO  -' $res_log > $res_concat_err
-        ;;
-    concat_cfg )
-        rm -f "$build_dir/check.sh.*.out_err" > /dev/null 2>&1
-        ;;
-    load_to_db )
-        ;;
-    * )
-        Error "Invalid method name"
-        ;;
-esac
-
-
-
-# --- Run checks for each previously built configuration
-
-
-for cfg in $cfgs ; do
-
-    ParseConfig $cfg
-    cd $build_dir
-
-    check_name=$x_tree/$x_sol/$x_cfg
-    check_dir="$x_tree/build/${x_sol}.check/$x_cfg"
-    if [ ! -d "$check_dir" ] ; then
-        Error "Check directory \"$check_dir\" not found"
-    fi
-
-    # Special processing for 'run' to allow parallel test runs
-
-    if [ "$method" = "run" ]; then
-
-        while true; do 
-            i=0
-            idx=999
-
-            while [ $i -lt $max_tasks ]; do
-                # Find first free slot
-                if [ -z "${tasks_name[$i]}" ]; then
-                    idx=$i
-                    break
-                fi
-                # Check on finished tasks
-                if [ -f "${tasks_dir[$i]}/check.success" ]; then
-                    idx=$i
-                fi
-                if [ -f "${tasks_dir[$i]}/check.failed" ]; then
-                    idx=$i
-                    errcode=1
-                fi
-                if [ $idx -lt $max_tasks ]; then
-                    CopyConfigLogs $idx
-                    echo `eval $timer`
-                    echo CHECK_$method: finished: ${tasks_name[$idx]} \(${tasks_start[idx]} - `eval $timer`\)
-                    tasks_name[$idx]=""
-                    break 
-                fi
-                i=`expr $i + 1`
-            done
-        
-            if [ $idx -lt $max_tasks ]; then
-               # Run tests for current configuration $cfg
-               tasks_name[$idx]="$x_tree/$x_sol/$x_cfg"
-               tasks_tree[$idx]="$x_tree"
-               tasks_cfg[$idx]="$x_cfg"
-               tasks_dir[$idx]="$check_dir"
-               tasks_start[$idx]=`eval $timer`
-
-               echo ${tasks_start[$idx]}
-               echo CHECK_$method: started : ${tasks_name[$idx]}
-               rm ${tasks_dir[$idx]}/check.success ${tasks_dir[$idx]}/check.failed >/dev/null 2>&1
-
-               ../../scripts/common/check/check_make_win_cfg.sh create "$x_sol" "$x_tree" "$x_cfg"  || \
-                   Error "Creating check script for \"$check_dir\" failed"
-               test -x "${tasks_dir[$idx]}/check.sh"  || \
-                   Error "Cannot find $check_dir/check.sh"
-
-               ${tasks_dir[$idx]}/check.sh run >/dev/null 2>&1 &
-
-               # Move to next configuration
-               break
-            else
-               # All slots busy -- waiting
-               sleep $sleeptime
-            fi
-        done
-
-        continue
-    fi
-
-
-    # All actions except 'run'
-
-    test -x "$check_dir/check.sh"  ||  \
-        Error "Run checks first. $check_dir/check.sh not found."
-
-    echo `eval $timer`
-    echo CHECK_$method: $check_name
-   
-    case "$method" in
-        concat )
-            $check_dir/check.sh concat
-            cat $check_dir/check.sh.out >> $res_concat
-            ;;
-        concat_err )
-            $check_dir/check.sh concat_err
-            cat $check_dir/check.sh.out_err >> $res_concat_err
-            ;;
-        concat_cfg )
-            # Copy log entries
-            egrep 'ERR \[|TO  -' $check_dir/check.sh.log >> $build_dir/check.sh.${x_tree}_${x_cfg}.out_err
-            # See below for copying of failed tests outputs,
-            # it should be printed after log entries for all configurations.
-            ;;
-        load_to_db )
-            $check_dir/check.sh load_to_db
-            ;;
-    esac
-done
-
-
-# --- Waiting unfinished tasks for 'run'
-
-if [ "$method" = "run" ]; then
-    while true; do 
-        i=0
-        idx=999
-        active=false
-
-        while [ $i -lt $max_tasks ]; do
-            if [ -n "${tasks_name[$i]}" ]; then
-                # Check on finished tasks
-                if [ -f "${tasks_dir[$i]}/check.success" ]; then
-                    idx=$i
-                fi
-                if [ -f "${tasks_dir[$i]}/check.failed" ]; then
-                    idx=$i
-                    errcode=1
-                fi
-                if [ $idx -lt $max_tasks ]; then
-                    CopyConfigLogs $idx
-                    echo `eval $timer`
-                    echo CHECK_$method: finished: ${tasks_name[$idx]} \(${tasks_start[$idx]} - `eval $timer`\)
-                    tasks_name[$idx]=""
-                    idx=999
-                else
-                    active=true
-                fi
-            fi
-            i=`expr $i + 1`
-        done
-
-        if $active; then
-           sleep $sleeptime
-        else
-           break
-        fi
-    done
-fi
-
-if [ "$method" = "concat_cfg" ]; then
-    for cfg in $cfgs ; do
-        ParseConfig $cfg
-        cd $build_dir
-        check_dir="$x_tree/build/${x_sol}.check/$x_cfg"
-        cat $check_dir/check.sh.out_err >> $build_dir/check.sh.${x_tree}_${x_cfg}.out_err
-    done
-fi
-
-exit $errcode
diff --git a/c++/compilers/msvc1000_prj/configure.bat b/c++/compilers/msvc1000_prj/configure.bat
deleted file mode 100644
index 21e425a..0000000
--- a/c++/compilers/msvc1000_prj/configure.bat
+++ /dev/null
@@ -1,393 +0,0 @@
- at echo off
-REM $Id: configure.bat 381093 2012-11-19 16:57:46Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Configure MSVC solution and projects
-REM
-REM ===========================================================================
-
-setlocal
-
-set sln_name=ncbi_cpp
-set use_projectlst=scripts/projects/ncbi_cpp.lst
-
-set use_savedcfg=
-set use_gui=no
-set maybe_gui=yes
-set use_debug=yes
-set use_dll=no
-set use_64=no
-set use_staticstd=no
-set use_arch=Win32
-set use_ide=900
-set use_flags=
-set help_req=no
-set srcroot=../..
-
-REM -----------------------------------------------------------------------------
-REM  silently ignored  options
-set noops=
-set noops=%noops% --without-optimization
-set noops=%noops% --with-profiling
-set noops=%noops% --with-tcheck
-set noops=%noops% --with-static
-set noops=%noops% --with-plugin-auto-load
-set noops=%noops% --with-bin-release
-set noops=%noops% --with-mt
-set noops=%noops% --without-exe
-set noops=%noops% --with-runpath
-set noops=%noops% --with-lfs
-set noops=%noops% --with-autodep
-set noops=%noops% --with-build-root
-set noops=%noops% --with-fake-root
-set noops=%noops% --without-suffix
-set noops=%noops% --with-hostspec
-set noops=%noops% --without-version
-set noops=%noops% --with-build-root-sfx
-set noops=%noops% --without-execopy
-set noops=%noops% --with-bincopy
-set noops=%noops% --with-lib-rebuilds
-set noops=%noops% --with-lib-rebuilds
-set noops=%noops% --without-deactivation
-set noops=%noops% --without-makefile-auto-update
-set noops=%noops% --without-flat-makefile
-set noops=%noops% --with-check
-set noops=%noops% --with-check-tools
-set noops=%noops% --with-ncbi-public
-set noops=%noops% --with-strip
-set noops=%noops% --with-pch
-set noops=%noops% --with-caution
-set noops=%noops% --without-caution
-set noops=%noops% --without-ccache
-set noops=%noops% --with-distcc
-set noops=%noops% --without-ncbi-c
-set noops=%noops% --without-sss
-set noops=%noops% --without-utils
-set noops=%noops% --without-sssdb
-set noops=%noops% --with-included-sss
-set noops=%noops% --with-z
-set noops=%noops% --without-z
-set noops=%noops% --with-bz2
-set noops=%noops% --without-bz2
-set noops=%noops% --with-lzo
-set noops=%noops% --without-lzo
-set noops=%noops% --with-pcre
-set noops=%noops% --without-pcre
-set noops=%noops% --with-gnutls
-set noops=%noops% --without-gnutls
-set noops=%noops% --with-openssl
-set noops=%noops% --without-openssl
-set noops=%noops% --without-sybase
-set noops=%noops% --with-sybase-local
-set noops=%noops% --with-sybase-new
-set noops=%noops% --without-ftds
-set noops=%noops% --with-ftds
-set noops=%noops% --without-ftds-renamed
-set noops=%noops% --without-mysql
-set noops=%noops% --with-mysql
-set noops=%noops% --without-opengl
-set noops=%noops% --with-opengl
-set noops=%noops% --without-mesa
-set noops=%noops% --with-mesa
-set noops=%noops% --without-glut
-set noops=%noops% --with-glut
-set noops=%noops% --without-wxwin
-set noops=%noops% --with-wxwin
-set noops=%noops% --without-wxwidgets
-set noops=%noops% --with-wxwidgets
-set noops=%noops% --with-wxwidgets-ucs
-set noops=%noops% --without-wxwidgets-ucs
-set noops=%noops% --without-freetype
-set noops=%noops% --with-freetype
-set noops=%noops% --without-fastcgi
-set noops=%noops% --with-fastcgi
-set noops=%noops% --with-fastcgi
-set noops=%noops% --without-bdb
-set noops=%noops% --with-bdb
-set noops=%noops% --without-sp
-set noops=%noops% --without-orbacus
-set noops=%noops% --with-orbacus
-set noops=%noops% --with-odbc
-set noops=%noops% --with-python
-set noops=%noops% --without-python
-set noops=%noops% --with-boost
-set noops=%noops% --without-boost
-set noops=%noops% --with-boost-tag
-set noops=%noops% --without-boost-tag
-set noops=%noops% --with-sqlite
-set noops=%noops% --without-sqlite
-set noops=%noops% --with-sqlite3
-set noops=%noops% --without-sqlite3
-set noops=%noops% --with-icu
-set noops=%noops% --without-icu
-set noops=%noops% --with-expat
-set noops=%noops% --without-expat
-set noops=%noops% --with-sablot
-set noops=%noops% --without-sablot
-set noops=%noops% --with-libxml
-set noops=%noops% --without-libxml
-set noops=%noops% --with-libxslt
-set noops=%noops% --without-libxslt
-set noops=%noops% --with-xerces
-set noops=%noops% --without-xerces
-set noops=%noops% --with-xalan
-set noops=%noops% --without-xalan
-set noops=%noops% --with-oechem
-set noops=%noops% --without-oechem
-set noops=%noops% --with-sge
-set noops=%noops% --without-sge
-set noops=%noops% --with-muparser
-set noops=%noops% --without-muparser
-set noops=%noops% --with-hdf5
-set noops=%noops% --without-hdf5
-set noops=%noops% --with-gif
-set noops=%noops% --without-gif
-set noops=%noops% --with-jpeg
-set noops=%noops% --without-jpeg \
-set noops=%noops% --with-png
-set noops=%noops% --without-png
-set noops=%noops% --with-tiff
-set noops=%noops% --without-tiff
-set noops=%noops% --with-xpm
-set noops=%noops% --without-xpm
-set noops=%noops% --without-local-lbsm
-set noops=%noops% --without-ncbi-crypt
-set noops=%noops% --without-connext
-set noops=%noops% --without-serial
-set noops=%noops% --without-objects
-set noops=%noops% --without-dbapi
-set noops=%noops% --without-app
-set noops=%noops% --without-ctools
-set noops=%noops% --without-gui
-set noops=%noops% --without-algo
-set noops=%noops% --without-internal
-set noops=%noops% --with-gbench
-set noops=%noops% --without-gbench
-set noops=%noops% --with-x
-
-
-set initial_dir=%CD%
-set script_name=%0
-cd %~p0
-for /f "delims=" %%a in ('cd') do (set script_dir=%%a)
-cd %srcroot%
-for /f "delims=" %%a in ('cd') do (set srcroot=%%a)
-cd %initial_dir%
-
-REM --------------------------------------------------------------------------------
-REM parse arguments
-
-set unknown=
-set ignore_unknown=no
-set dest=
-:PARSEARGS
-if "%1"=="" goto ENDPARSEARGS
-if "%dest%"=="lst"                      (set use_projectlst=%1&  set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="cfg"                      (set use_savedcfg=%~1&   set dest=& goto CONTINUEPARSEARGS)
-if "%1"=="--help"                       (set help_req=yes&       goto CONTINUEPARSEARGS)
-if "%1"=="--with-configure-dialog"      (set use_gui=yes&        goto CONTINUEPARSEARGS)
-if "%1"=="--without-configure-dialog"   (set use_gui=no&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-saved-settings"        (set dest=cfg&           goto CONTINUEPARSEARGS)
-if "%1"=="--without-debug"              (set use_debug=no&       goto CONTINUEPARSEARGS)
-if "%1"=="--with-debug"                 (set use_debug=yes&      goto CONTINUEPARSEARGS)
-if "%1"=="--without-dll"                (set use_dll=no&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-dll"                   (set use_dll=yes&        goto CONTINUEPARSEARGS)
-if "%1"=="--with-64"                    (set use_64=yes&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-static-exe"            (set use_staticstd=yes&  goto CONTINUEPARSEARGS)
-if "%1"=="--with-projects"              (set dest=lst&           goto CONTINUEPARSEARGS)
-if "%1"=="--ignore-unsupported-options" (set ignore_unknown=yes& goto CONTINUEPARSEARGS)
-set unknown=%unknown% %1
-:CONTINUEPARSEARGS
-set maybe_gui=no
-shift
-goto PARSEARGS
-:ENDPARSEARGS
-if "%maybe_gui%"=="yes" (
-  set use_gui=yes
-)
-
-REM --------------------------------------------------------------------------------
-REM check and report unknown options
-
-set invalid_unknown=no
-for %%u in (%unknown%) do (
-  call :CHECKUNKNOWN %%u
-)
-if "%invalid_unknown%"=="yes" exit /b 1
-goto DONEUNKNOWN
-
-:CHECKUNKNOWN
-for %%n in (%noops%) do (
-  if "%1"=="%%n" (
-    echo Ignored:  %1
-    goto :eof
-  )
-)
-for /f "eol=-" %%a in ('echo %1') do goto :eof
-if "%ignore_unknown%"=="no" (
-  echo Unsupported option:  %1
-  set invalid_unknown=yes
-) else (
-  echo Ignored unsupported:  %1
-)
-goto :eof
-:DONEUNKNOWN
-
-REM --------------------------------------------------------------------------------
-REM print usage
-
-:PRINTUSAGE
-if "%help_req%"=="yes" (
-  echo  USAGE:
-  echo    %script_name% [OPTION]...
-  echo  SYNOPSIS:
-  echo    configure NCBI C++ toolkit for MSVC build system.
-  echo  OPTIONS:
-  echo    --help                      -- print Usage
-  echo    --with-configure-dialog     -- use Configuration GUI application
-  echo    --without-configure-dialog  -- do not use Configuration GUI application
-  echo    --with-saved-settings=FILE  -- load configuration settings from FILE
-  echo    --without-debug             -- build non-debug versions of libs and apps
-  echo    --with-debug                -- build debug versions of libs and apps
-  echo    --without-dll               -- build all toolkit libraries as static ones
-  echo    --with-dll                  -- assemble toolkit libraries into DLLs
-  echo                                     where requested
-  echo    --with-64                   -- compile to 64-bit code
-  echo    --with-static-exe           -- use static C++ standard libraries
-  echo    --with-projects=FILE        -- build projects listed in "%srcroot%\FILE"
-  echo             FILE can also be a name of a subdirectory
-  echo             examples:   --with-projects=src/corelib
-  echo                         --with-projects=scripts/projects/ncbi_cpp.lst
-  echo    --ignore-unsupported-options   -- ignore unsupported options
-  exit /b 0
-)
-
-REM --------------------------------------------------------------------------------
-REM identify target MSVC version (based on the script location msvcNNN_prj)
-
-for /f "delims=" %%a in ('echo %script_dir%') do (set msvc_ver=%%~na)
-set msvc_ver=%msvc_ver:msvc=%
-set msvc_ver=%msvc_ver:_prj=%
-if not "%msvc_ver%"=="" (set use_ide=%msvc_ver%)
-
-REM --------------------------------------------------------------------------------
-REM target architecture, solution path, configuration and flags
-
-if "%use_64%"=="yes" (
-  set use_arch=x64
-) else (
-  set use_arch=Win32
-)
-if "%use_dll%"=="yes" (
-  if "%use_debug%"=="yes" (
-    set CONFIGURATION=DebugDLL
-  ) else (
-    set CONFIGURATION=ReleaseDLL
-  )
-) else (
-  if "%use_debug%"=="yes" (
-    if "%use_staticstd%"=="yes" (
-      set CONFIGURATION=DebugMT
-    ) else (
-      set CONFIGURATION=DebugDLL
-    )
-  ) else (
-    if "%use_staticstd%"=="yes" (
-      set CONFIGURATION=ReleaseMT
-    ) else (
-      set CONFIGURATION=ReleaseDLL
-    )
-  )
-)
-if "%use_gui%"=="yes" (
-  set use_flags=%use_flags% -cfg
-)
-if "%use_dll%"=="yes" (
-  set build_results=dll
-  set sln_name=%sln_name%_dll
-  set use_flags=%use_flags% -dll
-) else (
-  set build_results=static
-)
-set use_projectlst=%use_projectlst:/=\%
-
-
-REM --------------------------------------------------------------------------------
-REM prepare and run ptb.bat
-cd %script_dir%
-set PTB_PLATFORM=%use_arch%
-set PTB_FLAGS=%use_flags%
-set PTB_PATH=./static/bin/ReleaseDLL
-set SLN_PATH=%script_dir%\%build_results%\build\%sln_name%.sln
-set TREE_ROOT=%srcroot%
-set BUILD_TREE_ROOT=.
-set PTB_PROJECT_REQ=%use_projectlst%
-
-if "%use_savedcfg%"=="" (
-  set PTB_SAVED_CFG_REQ=
-) else (
-  if exist "%use_savedcfg%" (
-    set PTB_SAVED_CFG_REQ="%use_savedcfg%"
-  ) else (
-    if exist "%initial_dir%\%use_savedcfg%" (
-      set PTB_SAVED_CFG_REQ="%initial_dir%\%use_savedcfg%"
-    ) else (
-      echo ERROR: "%use_savedcfg%" not found
-      exit /b 1
-    )
-  )
-)
-
-call ./ptb.bat
-if errorlevel 1 (
-  cd %initial_dir%
-  exit /b 1
-)
-
-REM --------------------------------------------------------------------------------
-REM generate configure_make.bat
-
-cd %script_dir%
-set mk_cmnd=make.bat build %sln_name% %build_results%
-if "%use_64%"=="yes" (
-  set mk_cmnd=%mk_cmnd% 64
-) else (
-  set mk_cmnd=%mk_cmnd% 32
-)
-set mk_cmnd=%mk_cmnd% %CONFIGURATION%
-echo %mk_cmnd% > configure_make.bat
-
-
-REM ------------------------------------------------------------------------------
-echo To build the solution %SLN_PATH%
-echo execute the following commands:
-echo cd %script_dir%
-echo make
-
-cd %initial_dir%
-endlocal
-exit /b 0
diff --git a/c++/compilers/msvc1000_prj/datatool.bat b/c++/compilers/msvc1000_prj/datatool.bat
deleted file mode 100644
index 17ae74a..0000000
--- a/c++/compilers/msvc1000_prj/datatool.bat
+++ /dev/null
@@ -1,188 +0,0 @@
- at echo off
-REM $Id: datatool.bat 420522 2013-12-03 19:52:45Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Run datatool.exe to generate sources from ASN/DTD/Schema specifications
-REM
-REM DO NOT ATTEMPT to run this bat file manually
-REM
-REM ===========================================================================
-
-set ORIGINAL_ARGS=%*
-
-REM ---------------- begin workaround FOR MSVC2010! ---------------------------------
-set input_asn_path=
-set input_asn_name=
-set input_def_path=
-set subtree=
-set srcroot=
-:PARSEARGS
-if _%1==_ goto ENDPARSEARGS
-if "%dest%"=="inASN"    (set input_asn_path=%~1& set input_asn_name=%~n1& set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="inDEF"    (set input_def_path=%~1& set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="subtree"  (set subtree=%1&     set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="srcroot"  (set srcroot=%1&     set dest=& goto CONTINUEPARSEARGS)
-if "%1"=="-m"           (set dest=inASN&                goto CONTINUEPARSEARGS)
-if "%1"=="-od"          (set dest=inDEF&                goto CONTINUEPARSEARGS)
-if "%1"=="-or"          (set dest=subtree&              goto CONTINUEPARSEARGS)
-if "%1"=="-oR"          (set dest=srcroot&              goto CONTINUEPARSEARGS)
-if "%1"=="-M"           (goto ENDPARSEARGS)
-:CONTINUEPARSEARGS
-shift
-REM echo parsing %1
-goto PARSEARGS
-:ENDPARSEARGS
-set src_subtree=%CD%\%srcroot%src\%subtree%
-set dest_spec=%BUILD_TREE_ROOT%\static\build\%subtree%
-if not exist "%dest_spec%" mkdir "%dest_spec%"
-if not exist "%dest_spec%" set dest_spec=.
-
-set copied_asn=0
-for /f %%a in ('xcopy "%input_asn_path%" "%dest_spec%" /q /d /y') do (set copied_asn=%%a)
-set copied_def=0
-if not exist "%input_def_path%" echo [-] > "%input_def_path%"
-if exist "%input_def_path%" for /f %%a in ('xcopy "%input_def_path%" "%dest_spec%" /q /d /y') do (set copied_def=%%a)
-if not %copied_asn%==0 goto DOGENERATE
-if not %copied_def%==0 goto DOGENERATE
-if not exist "%src_subtree%%input_asn_name%.files"   goto DOGENERATE
-if not exist "%src_subtree%%input_asn_name%__.cpp"   goto DOGENERATE
-if not exist "%src_subtree%%input_asn_name%___.cpp"  goto DOGENERATE
-echo generation NOT needed
-exit /b 0
-:DOGENERATE
-REM ----------------   end workaround --------------------------------------
-
-set DEFDT_LOCATION=\\snowman\win-coremake\App\Ncbi\cppcore\datatool
-
-for %%v in ("%DATATOOL_PATH%" "%TREE_ROOT%" "%BUILD_TREE_ROOT%" "%PTB_PLATFORM%") do (
-  if %%v=="" (
-    echo ERROR: required environment variable is missing
-    echo DO NOT ATTEMPT to run this bat file manually
-    exit /b 1
-  )
-)
-set DEFDT_VERSION_FILE=%TREE_ROOT%\src\build-system\datatool_version.txt
-set PTB_SLN=%BUILD_TREE_ROOT%\static\build\UtilityProjects\PTB.sln
-set DT=datatool.exe
-
-call "%BUILD_TREE_ROOT%\msvcvars.bat"
-
-
-REM -------------------------------------------------------------------------
-REM get DT version: from DEFDT_VERSION_FILE  or from PREBUILT_DATATOOL_EXE
-
-set DEFDT_VERSION=
-if exist "%DEFDT_VERSION_FILE%" (
-  for /f %%a in ('type "%DEFDT_VERSION_FILE%"') do (set DEFDT_VERSION=%%a& goto donedf)
-  :donedf
-  set DEFDT_VERSION=%DEFDT_VERSION: =%
-)
-if exist "%PREBUILT_DATATOOL_EXE%" (
-  set ptbver=
-  for /f "tokens=2" %%a in ('"%PREBUILT_DATATOOL_EXE%" -version') do (set ptbver=%%a& goto donepb)
-  :donepb
-  set ptbver=%ptbver: =%
-  if not "%DEFDT_VERSION%"=="%ptbver%" (
-    echo WARNING: requested %DT% version %ptbver% does not match default one: %DEFDT_VERSION%
-    set DEFDT_VERSION=%ptbver%
-  )
-)
-
-if "%DEFDT_VERSION%"=="" (
-  echo ERROR: DEFDT_VERSION not specified
-  exit /b 1
-)
-for /f "tokens=1-3 delims=." %%a in ('echo %DEFDT_VERSION%') do (set DT_VER=%%a%%b%%c& set DT_VER_MAJOR=%%a)
-
-
-REM -------------------------------------------------------------------------
-REM Identify DATATOOL_EXE
-
-set DT_COPY_HERE=NO
-if "%PREBUILT_DATATOOL_EXE%"=="bootstrap" (
-  set DEF_DT=%DATATOOL_PATH%\%DT%
-) else if not "%PREBUILT_DATATOOL_EXE%"=="" (
-  if exist "%PREBUILT_DATATOOL_EXE%" (
-    set DEF_DT=%PREBUILT_DATATOOL_EXE%
-  ) else (
-    echo ERROR: "%PREBUILT_DATATOOL_EXE%" not found
-    exit /b 1
-  )
-) else (
-  set DEF_DT=%DEFDT_LOCATION%\msvc\%DEFDT_VERSION%\%DT%
-  if not "%COPY_DATATOOL_EXE%"=="NO" (
-    set DT_COPY_HERE=YES
-  )
-)
-if exist "%DEF_DT%" (
-  set DATATOOL_EXE=%DEF_DT%
-) else (
-  echo %DT% not found at %DEF_DT%
-  set DATATOOL_EXE=%DATATOOL_PATH%\%DT%
-  set DT_COPY_HERE=NO
-)
-
-
-REM -------------------------------------------------------------------------
-REM Build DATATOOL_EXE if needed
-
-if not exist "%DATATOOL_EXE%" (
-  if exist "%PTB_SLN%" (
-    echo ******************************************************************************
-    echo Building %DT% locally, please wait
-    echo ******************************************************************************
-    @echo %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "datatool.exe"
-    %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "datatool.exe"
-  ) else (
-    echo ERROR: do not know how to build %DT%
-  )
-) else (
-  echo ******************************************************************************
-  echo Using PREBUILT %DT% at %DATATOOL_EXE%
-  echo ******************************************************************************
-)
-if not exist "%DATATOOL_EXE%" (
-  echo ERROR: "%DATATOOL_EXE%" not found
-  exit /b 1
-)
-
-REM -------------------------------------------------------------------------
-REM Copy datatool from network to the local tree (to make it work faster)
-
-set DT_LOCAL=%BUILD_TREE_ROOT%\static\build\UtilityProjects\%DEFDT_VERSION%_%DT%
-if "%DT_COPY_HERE%"=="YES" (
-  if not exist "%DT_LOCAL%" (
-    xcopy "%DATATOOL_EXE%" "%BUILD_TREE_ROOT%\static\build\UtilityProjects\" /q /d /y >NUL
-    rename "%BUILD_TREE_ROOT%\static\build\UtilityProjects\%DT%" "%DEFDT_VERSION%_%DT%"
-  )
-  set DATATOOL_EXE=%DT_LOCAL%
-)
-
-REM -------------------------------------------------------------------------
-REM Run DATATOOL_EXE
-
-"%DATATOOL_EXE%" %ORIGINAL_ARGS%
diff --git a/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index 26a23bd..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index 3bc6bf8..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-DIALOG-</ProjectName>
-    <ProjectGuid>{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/configure._ b/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/configure._
deleted file mode 100644
index 7d4011f..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp_dll.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/configure_dialog._ b/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index f4e04b9..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp_dll.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/dll/build/all.bat b/c++/compilers/msvc1000_prj/dll/build/all.bat
deleted file mode 100644
index 3add24d..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/all.bat
+++ /dev/null
@@ -1,42 +0,0 @@
- at ECHO OFF
-REM $Id: all.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Build all C++ Toolkit DLL projects
-REM
-REM ===========================================================================
-
-
-CALL all_ncbi.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gui.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gbench.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-:_ABORT_
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/dll/build/all_gbench.bat b/c++/compilers/msvc1000_prj/dll/build/all_gbench.bat
deleted file mode 100644
index 18f4688..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/all_gbench.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_gbench.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build GBENCH
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\gbench"
-msbuild gbench\ncbi_gbench.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\gbench\%CFG%"
-msbuild gbench\ncbi_gbench.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/msvc1000_prj/dll/build/all_gui.bat b/c++/compilers/msvc1000_prj/dll/build/all_gui.bat
deleted file mode 100644
index e8dc582..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/all_gui.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_gui.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build C++ GUI libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\gui"
-msbuild gui\ncbi_gui_dll.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\gui\%CFG%"
-msbuild gui\ncbi_gui_dll.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/msvc1000_prj/dll/build/all_ncbi.bat b/c++/compilers/msvc1000_prj/dll/build/all_ncbi.bat
deleted file mode 100644
index c1c716e..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/all_ncbi.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_ncbi.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\ncbi"
-msbuild ncbi_cpp_dll.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\ncbi\%CFG%"
-msbuild ncbi_cpp_dll.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index 1750e10..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index 200ea03..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-DIALOG-</ProjectName>
-    <ProjectGuid>{6DEFDB58-C014-4026-A166-299146BD9947}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/configure._ b/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/configure._
deleted file mode 100644
index 6be17e9..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/configure._
+++ /dev/null
@@ -1,5 +0,0 @@
-set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=1
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gbench.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/configure_dialog._ b/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/configure_dialog._
deleted file mode 100644
index b6f1b6c..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gbench/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,5 +0,0 @@
-set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=1
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gbench.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/dll/build/gbench/configure_prebuild.bat b/c++/compilers/msvc1000_prj/dll/build/gbench/configure_prebuild.bat
deleted file mode 100644
index 105f57f..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gbench/configure_prebuild.bat
+++ /dev/null
@@ -1,48 +0,0 @@
- at echo off
-REM $Id: configure_prebuild.bat 388573 2013-02-08 18:13:37Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM This script is called by compilers/msvcNNN_prj/ptb.bat
-REM when building CONFIGURE project, before performing any meaningful actions.
-REM
-REM So, this is a good place to put any custom PRE-BUILD operations.
-REM For example, set environment variables.
-REM
-REM ===========================================================================
-
-set initial_dir=%CD%
-set script_name=%~nx0
-cd %~dp0
-for /f "delims=" %%a in ('cd') do (set script_dir=%%a)
-cd %initial_dir%
-
-set cfgs=project_tree_builder.ini.custom
-
-set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=
-if not exist "%script_dir%\%cfgs%" (
-  set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=1
-)
diff --git a/c++/compilers/msvc1000_prj/dll/build/gbench/gbench_install/gbench-install.vcxproj b/c++/compilers/msvc1000_prj/dll/build/gbench/gbench_install/gbench-install.vcxproj
deleted file mode 100644
index e38fc60..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gbench/gbench_install/gbench-install.vcxproj
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{6C23686B-1522-4B44-8D48-7E3176C36247}</ProjectGuid>
-    <RootNamespace>gbench-install</RootNamespace>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">Unicode_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">Unicode_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">Unicode_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">Unicode_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">Unicode_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">Unicode_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">Unicode_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">Unicode_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">VTune_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">VTune_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">VTune_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">VTune_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">VTune_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">VTune_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">VTune_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">VTune_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/msvc1000_prj/dll/build/gbench/ncbi_gbench.sln b/c++/compilers/msvc1000_prj/dll/build/gbench/ncbi_gbench.sln
deleted file mode 100644
index 71b43a8..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gbench/ncbi_gbench.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{6DEFDB58-C014-4026-A166-299146BD9947}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index 8d48b2b..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index c186313..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-DIALOG-</ProjectName>
-    <ProjectGuid>{9BAE6EEC-8C80-44F0-84A9-3379631A8654}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/configure._ b/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/configure._
deleted file mode 100644
index b86cc7e..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/configure_dialog._ b/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/configure_dialog._
deleted file mode 100644
index 78a9181..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gui/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/dll/build/gui/ncbi_gui_dll.sln b/c++/compilers/msvc1000_prj/dll/build/gui/ncbi_gui_dll.sln
deleted file mode 100644
index 11c7705..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/gui/ncbi_gui_dll.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{9BAE6EEC-8C80-44F0-84A9-3379631A8654}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc1000_prj/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcxproj b/c++/compilers/msvc1000_prj/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcxproj
deleted file mode 100644
index b1b4e57..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcxproj
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{6C23686B-1522-4B44-8D48-7E3176C36248}</ProjectGuid>
-    <RootNamespace>gbench-install</RootNamespace>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">Unicode_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">Unicode_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">Unicode_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">Unicode_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">Unicode_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">Unicode_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">Unicode_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">Unicode_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">VTune_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">VTune_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">VTune_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">VTune_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">VTune_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">VTune_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">VTune_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">VTune_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/msvc1000_prj/dll/build/ncbi_cpp_dll.sln b/c++/compilers/msvc1000_prj/dll/build/ncbi_cpp_dll.sln
deleted file mode 100644
index 01365bb..0000000
--- a/c++/compilers/msvc1000_prj/dll/build/ncbi_cpp_dll.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc1000_prj/dll/dll_main.cpp b/c++/compilers/msvc1000_prj/dll/dll_main.cpp
deleted file mode 100644
index 7bd913f..0000000
--- a/c++/compilers/msvc1000_prj/dll/dll_main.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include <ncbi_pch.hpp>
-
-#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-BOOL APIENTRY DllMain( HANDLE hModule, 
-                       DWORD  ul_reason_for_call, 
-                       LPVOID lpReserved
-					 )
-{
-    return TRUE;
-}
-
-
-
-
diff --git a/c++/compilers/msvc1000_prj/dll/third_party_dll_install.mak b/c++/compilers/msvc1000_prj/dll/third_party_dll_install.mak
deleted file mode 100644
index 61fc53f..0000000
--- a/c++/compilers/msvc1000_prj/dll/third_party_dll_install.mak
+++ /dev/null
@@ -1,62 +0,0 @@
-# $Id: third_party_dll_install.mak 463528 2015-03-30 14:10:31Z ucko $
-#################################################################
-
-
-INSTALL          = .\bin
-INSTALL_BINPATH  = $(INSTALL)\$(INTDIR)
-THIRDPARTY_MAKEFILES_DIR =  .
-
-
-META_MAKE = $(THIRDPARTY_MAKEFILES_DIR)\..\third_party_install.meta.mk
-!IF EXIST($(META_MAKE))
-!INCLUDE $(META_MAKE)
-!ELSE
-!ERROR  $(META_MAKE)  not found
-!ENDIF
-
-THIRD_PARTY_LIBS = \
-	install_berkeleydb \
-	install_gnutls     \
-	install_glew       \
-	install_lzo        \
-	install_mssql      \
-	install_mysql      \
-	install_openssl    \
-	install_sqlite     \
-	install_sqlite3    \
-	install_sybase     \
-	install_wxwidgets  \
-	install_wxwindows  \
-	install_xalan      \
-	install_xerces     \
-	install_libxml     \
-	install_libxslt    \
-	install_vdb
-
-CLEAN_THIRD_PARTY_LIBS = \
-	clean_berkeleydb \
-	clean_gnutls     \
-	clean_glew       \
-	clean_lzo        \
-	clean_mssql      \
-	clean_mysql      \
-	clean_openssl    \
-	clean_sqlite     \
-	clean_sqlite3    \
-	clean_sybase     \
-	clean_wxwidgets  \
-	clean_wxwindows  \
-	clean_xalan      \
-	clean_xerces     \
-	clean_libxml     \
-	clean_libxslt    \
-	clean_vdb
-
-all : dirs $(THIRD_PARTY_LIBS)
-
-clean : $(CLEAN_THIRD_PARTY_LIBS)
-
-rebuild : clean all
-
-dirs :
-    @if not exist $(INSTALL_BINPATH) (echo Creating directory $(INSTALL_BINPATH)... & mkdir $(INSTALL_BINPATH))
diff --git a/c++/compilers/msvc1000_prj/dll/third_party_dll_install.vcxproj b/c++/compilers/msvc1000_prj/dll/third_party_dll_install.vcxproj
deleted file mode 100644
index cae1ffc..0000000
--- a/c++/compilers/msvc1000_prj/dll/third_party_dll_install.vcxproj
+++ /dev/null
@@ -1,409 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|Win32">
-      <Configuration>DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|x64">
-      <Configuration>DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|Win32">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|x64">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|Win32">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|x64">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|Win32">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|x64">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|Win32">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|x64">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|Win32">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|x64">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9E4B5381-9B6C-4867-BF8A-F1AAA1FD580F}</ProjectGuid>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="third_party_dll_install.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/msvc1000_prj/dll/third_party_msvcdll_install.vcxproj b/c++/compilers/msvc1000_prj/dll/third_party_msvcdll_install.vcxproj
deleted file mode 100644
index 2ca7a73..0000000
--- a/c++/compilers/msvc1000_prj/dll/third_party_msvcdll_install.vcxproj
+++ /dev/null
@@ -1,409 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|Win32">
-      <Configuration>DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|x64">
-      <Configuration>DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|Win32">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|x64">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|Win32">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|x64">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|Win32">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|x64">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|Win32">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|x64">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|Win32">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|x64">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9E4B5381-9B6C-4867-BF8A-F1AAA1FD581F}</ProjectGuid>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="third_party_dll_install.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/msvc1000_prj/install.sh b/c++/compilers/msvc1000_prj/install.sh
deleted file mode 100644
index 30aa844..0000000
--- a/c++/compilers/msvc1000_prj/install.sh
+++ /dev/null
@@ -1,187 +0,0 @@
-#! /bin/sh
-# $Id: install.sh 441102 2014-07-21 14:40:41Z ivanov $
-# Authors:  Denis Vakatov    (vakatov at ncbi.nlm.nih.gov)
-#           Anton Lavrentiev (lavr at ncbi.nlm.nih.gov)
-#
-# Deploy sources, headers, libraries and executables for the further use
-# by the "external" users' projects
-
-
-# Cmd.-line args  -- source and destination
-script="$0"
-builddir="$1"
-target="$2"
-compiler="${3:-msvc1000}"
-compiler="${compiler}_prj"
-
-# Real number of argument is 2.
-# The 3th argument do not used here (32|64-bit architecture),
-# but is needed for master installation script.
-if test -n "$4" ; then
-  echo "USAGE:  `basename $script` [build_dir] [install_dir]"
-fi
-
-
-error()
-{
-  echo "[`basename $script`] ERROR:  $1"
-  exit 1
-}
-
-
-makedir()
-{
-  test -d "$1"  ||  mkdir $2 "$1"  ||  error "Cannot create \"$1\""
-}
-
-
-echo "[`basename $script`] NCBI C++:  \"$builddir\" to \"$target\"..."
-
-
-# Derive the destination dirs
-docdir="$target"/doc
-scriptdir="$target"/scripts
-incdir="$target"/include
-srcdir="$target"/src
-libdir="$target"/lib
-bindir="$target"/bin
-cldir="$target"/compilers
-logdir="$target"/logs
-tmpdir="$target"/tmp
-
-
-install()
-{
-    test -d "$1"  ||  return;
-    makedir "$2" -p
-    tmp_cwd=`pwd`
-    cd "$1"
-    find . -type f |
-    grep -v '/\.svn/' > "$tmpdir"/flist
-    tar cf - -T "$tmpdir"/flist | (cd "$2" ; tar xf - )
-    cd "$tmp_cwd"
-}
-
-
-
-# Check
-test -d "$builddir"  ||  error "Absent build dir \"$builddir\""
-
-
-# Reset the public directory
-test -d "$target"  &&  find "$target" -type f -exec rm -f {} \; >/dev/null 2>&1
-makedir "$target" -p
-makedir "$tmpdir" -p
-
-
-# Documentation
-echo "[`basename $script`] Installing documentation..."
-install "$builddir/doc" "$docdir"
-
-# Scripts
-echo "[`basename $script`] Installing scripts..."
-install "$builddir/scripts" "$scriptdir"
-
-# Include dir
-echo "[`basename $script`] Installing include files..."
-install "$builddir/include" "$incdir"
-
-# Source dir
-echo "[`basename $script`] Installing source files..."
-install "$builddir/src" "$srcdir"
-
-# Build logs
-echo "[`basename $script`] Installing build logs..."
-install "$builddir/logs" "$logdir"
-
-rm -rf "$tmpdir"
-
-
-# Libraries
-echo "[`basename $script`] Installing libraries..."
-for i in 'Debug' 'Release' ; do
-  for j in '' 'DLL' ; do
-    for b in 'static' 'dll' ; do
-
-      if test -d "$builddir"/compilers/$compiler/$b/lib/$i$j ; then
-        makedir "$libdir/$b/$i$j" -p
-        cd "$builddir"/compilers/$compiler/$b/lib/$i$j
-        cp -p *.lib "$libdir/$b/$i$j"
-      fi
-      if test "$b"=='dll' ; then
-        if test -d "$builddir"/compilers/$compiler/$b/bin/$i$j ; then
-          makedir "$libdir/$b/$i$j" -p
-          cd "$builddir"/compilers/$compiler/$b/bin/$i$j
-          cp -p *.lib *.dll *.exp "$libdir/$b/$i$j"
-        fi
-      fi
-    done
-  done
-done
-
-
-# Executables
-echo "[`basename $script`] Installing executables..."
-makedir "$bindir" -p
-for i in 'DLL' '' ; do
-  if test -d "$builddir"/compilers/$compiler/static/bin/Release$i ; then
-    cd "$builddir"/compilers/$compiler/static/bin/Release$i
-    if ls *.exe >/dev/null 2>&1 ; then
-      cp -p *.exe *.dll *.exp *.manifest "$bindir"
-      break
-    fi
-  fi
-done
-
-
-# Install additional files (scripts and etc) into binary directory
-cp -p "$builddir"/src/app/blast/legacy_blast.pl "$bindir"
-
-
-# Gbench public installation
-echo "[`basename $script`] Installing Gbench..."
-for i in ReleaseDLL DebugDLL; do
-  if test -d "$builddir"/compilers/$compiler/dll/bin/"$i" ; then
-    cp -pr "$builddir"/compilers/$compiler/dll/bin/$i/gbench "$bindir"
-    break
-  fi
-done
-
-
-# Compiler dir (copy all .pdb and configurable files files for debug purposes)
-echo "[`basename $script`] Installing .pdb files..."
-makedir "$cldir" -p
-pdb_files=`find "$builddir/compilers/$compiler" -type f -a \( -name '*.pdb' -o  -name '*.c' -o  -name '*.cpp' \) 2>/dev/null`
-cd "$cldir"
-for pdb in $pdb_files ; do
-  # Do not copy .pdb for executable files to save space
-  exe=`echo $pdb | sed -e 's|\.pdb$|\.exe|'`
-  if test -x "$exe" ; then
-    continue
-  fi
-  rel_dir=`echo $pdb | sed -e "s|$builddir/compilers/||" -e 's|/[^/]*$||'`
-  makedir "$rel_dir" -p
-  cp -pr "$pdb" "$rel_dir"
-done
-
-
-# Compiler dir (other common stuff)
-makedir "$cldir"/$compiler/static -p
-makedir "$cldir"/$compiler/dll -p
-cp -p  "$builddir"/compilers/$compiler/*          "$cldir"/$compiler
-cp -p  "$builddir"/compilers/$compiler/static/*   "$cldir"/$compiler/static
-cp -p  "$builddir"/compilers/$compiler/dll/*      "$cldir"/$compiler/dll
-for b in 'static' 'dll' ; do
-  cp -pr "$builddir"/compilers/$compiler/$b/inc "$cldir"/$compiler/$b
-  for c in 'DebugMT' 'ReleaseMT' 'DebugDLL' 'ReleaseDLL'; do
-    cp -pr "$builddir"/compilers/$compiler/$b/$c "$cldir"/$compiler/$b
-  done 
-done 
-
-# Makefile.*.mk files
-find "$builddir/src" -type f -name 'Makefile.*.mk' -exec cp -pr {} "$srcdir"/build-system/ \;
-
-# Copy info files
-cp -p "$builddir"/*_info "$target"
-
-exit 0
diff --git a/c++/compilers/msvc1000_prj/lock_ptb_config.bat b/c++/compilers/msvc1000_prj/lock_ptb_config.bat
deleted file mode 100644
index 287f5cb..0000000
--- a/c++/compilers/msvc1000_prj/lock_ptb_config.bat
+++ /dev/null
@@ -1,94 +0,0 @@
- at echo off
-REM $Id: lock_ptb_config.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Check platform name and create a lock to prevent
-REM running more than one instance of project_tree_builder.exe at the same time.
-REM
-REM ===========================================================================
-
-set CFG_PLATFORM=__configured_platform
-set CFG_LIST=Win32 x64
-set PTB_RUNNING=__configure.lock
-
-if _%PTB_PLATFORM%==_ (
-  echo PTB_PLATFORM is undefined
-  goto return_error
-)
-if _%1%==_  goto report_usage
-if _%2%==_  goto report_usage
-set MSVC_PRJ=%~2%
-if %1%==ON  goto do_ON
-if %1%==OFF goto do_OFF
-
-
-:report_usage
-echo The script checks MSVC platform name and creates a lock to prevent
-echo running more than one -CONFIGURE- at the same time.
-echo Usage:
-echo    lock_ptb_config ON msvc_prj_folder, or
-echo    lock_ptb_config OFF msvc_prj_folder
-goto return_error
-
-:return_error
-exit /b 1
-
-:do_ON
-for %%c in ( %CFG_LIST% ) do (
-  if exist "%MSVC_PRJ%%CFG_PLATFORM%.%%c" (
-    if not %%c==%PTB_PLATFORM% (
-      echo ******************************************************************************
-      echo Requested platform %PTB_PLATFORM% does not match already configured %%c
-      echo If you believe it is not so, - delete '%MSVC_PRJ%%CFG_PLATFORM%.%%c' file
-      echo ******************************************************************************
-      goto return_error
-    )
-    goto do_ON_lock
-  )
-)
-echo %CFG_PLATFORM% > "%MSVC_PRJ%%CFG_PLATFORM%.%PTB_PLATFORM%"
-
-:do_ON_lock
-if exist "%MSVC_PRJ%%PTB_RUNNING%" (
-  echo ******************************************************************************
-  echo There is another CONFIGURE process running in this tree.
-  echo If you believe it is not so, - delete '%MSVC_PRJ%%PTB_RUNNING%' file
-  echo ******************************************************************************
-  goto return_error
-)
-echo ptb_running > "%MSVC_PRJ%%PTB_RUNNING%"
-goto done
-
-
-:do_OFF
-if exist "%MSVC_PRJ%%PTB_RUNNING%" (
-  del "%MSVC_PRJ%%PTB_RUNNING%"
-)
-goto done
-
-:done
-
diff --git a/c++/compilers/msvc1000_prj/make.bat b/c++/compilers/msvc1000_prj/make.bat
deleted file mode 100644
index 8cdca52..0000000
--- a/c++/compilers/msvc1000_prj/make.bat
+++ /dev/null
@@ -1,220 +0,0 @@
- at ECHO OFF
-REM $Id: make.bat 420640 2013-12-04 16:12:30Z ivanov $
-REM ===========================================================================
-REM
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM
-REM  Please cite the author in any work or product based on this material.
-REM
-REM ===========================================================================
-REM
-REM Author:  Vladimir Ivanov
-REM
-REM Configure/build/check NCBI C++ tree in specified configuration(s)
-REM
-REM     make.bat <configure|build|make|check> <solution> <static|dll> <32|64> [cfgs..]
-REM
-REM     %1% - Configure, build, make (configure and build_ or check build tree.
-REM     %2% - Solution file name without extention (relative path from build directory).
-REM     %3% - Type of used libraries (static, dll).
-REM     %4% - 32/64-bits architerture.
-REM     %5% - Configuration name(s)
-REM           (DebugDLL, DebugMT, ReleaseDLL, ReleaseMT, Unicode_*).
-REM           By default (if not specified) build DebugDLL and ReleaseDLL only.
-REM     ... - Options (--with-openmp)
-REM
-REM ===========================================================================
-
-
-
-rem --- Configuration
-
-set compiler=msvc10
-set default_cfgs=ReleaseDLL DebugDLL
-
-rem Always configure with additional Unicode configurations
-if _%SRV_NAME% == _ set SRV_NAME=%COMPUTERNAME%
-
-call msvcvars.bat > NUL
-set archw=Win32
-if _%arch%_ == _64_ set archw=x64
-
-
-rem --- Required parameters
-
-set cmd=%~1%
-set solution=%~2
-set libdll=%~3
-set arch=%~4
-
-shift
-shift
-shift
-shift
-
-if "%cmd%"      == ""  goto NOARGS
-if "%solution%" == ""  goto USAGE
-if "%libdll%"   == ""  goto USAGE
-if "%arch%"     == ""  goto USAGE
-
-goto PARSEARGS
-
-
-rem --------------------------------------------------------------------------------
-:NOARGS
-
-if exist configure_make.bat (
-  configure_make.bat
-) else (
-  goto USAGE
-)
-
-:USAGE
-
-echo FATAL: Invalid parameters. See script description.
-echo FATAL: Passed arguments: %*
-goto ABORT
-
-
-
-rem --------------------------------------------------------------------------------
-rem Parse arguments
-:PARSEARGS
-
-set with_openmp=
-set cfgs=
-set unknown=
-
-:PARSEARGSLOOP
-if "%1" == "" goto ENDPARSEARGS
-if "%1" == "--with-openmp"       (set with_openmp=%1 & goto CONTINUEPARSEARGS)
-if "%1" == "DebugDLL"            (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "DebugMT"             (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "ReleaseDLL"          (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "ReleaseMT"           (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "Unicode_DebugDLL"    (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "Unicode_DebugMT"     (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "Unicode_ReleaseDLL"  (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS) 
-if "%1" == "Unicode_ReleaseMT"   (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-set unknown=%unknown% %1
-:CONTINUEPARSEARGS
-shift
-goto PARSEARGSLOOP
-
-:ENDPARSEARGS
-
-if not "%unknown%" == "" (
-   echo FATAL: Unknown configuration names or options specified:%unknown%.
-   echo %cmd%
-   goto ABORT
-)
-
-if "%cfgs%" == "" set cfgs=%default_cfgs%
-
-rem -- Check command
-
-if _%cmd% == _configure goto CONFIG
-if _%cmd% == _make      goto CONFIG
-if _%cmd% == _build     goto CFGLOOP
-if _%cmd% == _check     goto CFGLOOP
-echo FATAL: Unknown action name %cmd%. Please correct.
-echo The following action names are recognized: configure, build, make, check.
-goto ABORT
-
-
-rem --------------------------------------------------------------------------------
-rem Configure: always use ReleaseDLL
-:CONFIG
-
-rem --- Process options
-if not "%with_openmp%" == "" (
-   echo INFO: Ebable OpenMP.
-   bash -c "./build_util.sh %with_openmp%; exit $?"
-   if errorlevel 1 goto ABORT
-)
-
-time /t
-echo INFO: Configure "%libdll%\%solution% [ReleaseDLL|%arch%]"
-%DEVENV% %libdll%\build\%solution%.sln /build "ReleaseDLL|%archw%" /project "-CONFIGURE-"
-if errorlevel 1 goto ABORT
-if not _%cmd% == _make goto COMPLETE
-
-
-rem --------------------------------------------------------------------------------
-rem Process all configurations
-:CFGLOOP
-
-for %%c in (%cfgs%) do (
-   time /t
-   if _%cmd% == _build (
-      call :build %%c
-   )
-   if _%cmd% == _check (
-      call :check %%c
-   )
-   if _%cmd% == _make (
-      call :build %%c
-      if errorlevel 1 goto ABORT
-      call :check %%c
-   )
-   if errorlevel 1 goto ABORT
-)
-goto COMPLETE
-
-
-rem --------------------------------------------------------------------------------
-rem Subroutines
-
-:build
-   echo INFO: Building "%libdll%\%solution% [%1|%arch%]"
-   %DEVENV% %libdll%\build\%solution%.sln /build "%1|%archw%" /project "-BUILD-ALL-"
-   exit /b %errorlevel%
-
-:check
-   echo INFO: Checking init
-   bash -c "../../scripts/common/check/check_make_win_cfg.sh init; exit $?"
-   set err=0
-   echo INFO: Create check script for "%libdll%\%solution% [%1|%arch%]"
-   bash -c "../../scripts/common/check/check_make_win_cfg.sh create %solution% %libdll% %1; exit $?"
-   if errorlevel 1 exit /b %errorlevel%
-   echo INFO: Checking "%libdll%\%solution% [%1|%arch%]"
-   SET CHECKSH=%libdll%/build/%solution%.check/%1/check.sh
-   bash -c "%CHECKSH% run; exit $?"
-   if errorlevel 1 set err=1
-   bash -c "cp %CHECKSH%.journal check.sh.%libdll%_%1.journal; cp %CHECKSH%.log check.sh.%libdll%_%1.log"
-   rem Load testsuite results into DB works only if NCBI_AUTOMATED_BUILD is set to 1
-   if _%NCBI_AUTOMATED_BUILD% == _1 (
-      bash -c "%CHECKSH% load_to_db; exit $?"
-      if errorlevel 1 set err=1
-   )
-   copy /y /b check.sh.*.journal check.sh.journal
-   copy /y /b check.sh.*.log     check.sh.log
-   exit /b %err%
-
-
-rem --------------------------------------------------------------------------------
-
-:ABORT
-echo INFO: %cmd% failed.
-exit /b 1
-
-:COMPLETE
-echo INFO: %cmd% complete.
-exit /b 0
-
diff --git a/c++/compilers/msvc1000_prj/make_ncbi.bat b/c++/compilers/msvc1000_prj/make_ncbi.bat
deleted file mode 100644
index 92bbef9..0000000
--- a/c++/compilers/msvc1000_prj/make_ncbi.bat
+++ /dev/null
@@ -1,60 +0,0 @@
- at ECHO OFF
-REM $Id: make_ncbi.bat 419904 2013-12-02 16:48:37Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Configure/build/check NCBI C++ core tree in specified configuration(s)
-REM
-REM     make_ncbi.bat <configure|build|make|check> <static|dll> <32|64> [cfgs..]
-REM
-REM     %1% - Configure, build, check or build and configure (make) build tree.
-REM     %2% - Type of used libraries (static, dll).
-REM     %3% - 32/64-bits architerture.
-REM     %4% - Configuration name(s)
-REM           (DEFAULT, DebugDLL, DebugMT, ReleaseDLL, ReleaseMT, Unicode_*).
-REM           By default build DebugDLL and ReleaseDLL only.
-REM     ... - Options (--with-openmp)
-REM
-REM ===========================================================================
-
-
-set cmd=%~1
-set libdll=%~2
-set arch=%~3
-
-shift
-shift
-shift
-
-goto:%libdll% 2>NUL
-
-:static
- at call make.bat %cmd% ncbi_cpp     %libdll% %arch% %1 %2 %3 %4 %5 %6 %7 %8 %9
-exit %ERRORLEVEL%
-
-:dll
- at call make.bat %cmd% ncbi_cpp_dll %libdll% %arch% %1 %2 %3 %4 %5 %6 %7 %8 %9
-exit %ERRORLEVEL%
diff --git a/c++/compilers/msvc1000_prj/msvcvars.bat b/c++/compilers/msvc1000_prj/msvcvars.bat
deleted file mode 100644
index d7e2e70..0000000
--- a/c++/compilers/msvc1000_prj/msvcvars.bat
+++ /dev/null
@@ -1,14 +0,0 @@
- at echo off
-REM
-REM $Id: msvcvars.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM
-
- at if not "%VSINSTALLDIR%"=="" goto devenv
- at call "%VS100COMNTOOLS%vsvars32.bat"
-
-:devenv
-
-if exist "%VS100COMNTOOLS%..\IDE\VCExpress.*" set DEVENV="%VS100COMNTOOLS%..\IDE\VCExpress"
-if exist "%VS100COMNTOOLS%..\IDE\devenv.*" set DEVENV="%VS100COMNTOOLS%..\IDE\devenv"
-
-:end
diff --git a/c++/compilers/msvc1000_prj/ncbi.rc b/c++/compilers/msvc1000_prj/ncbi.rc
deleted file mode 100644
index 9bcbca1..0000000
--- a/c++/compilers/msvc1000_prj/ncbi.rc
+++ /dev/null
@@ -1 +0,0 @@
-ncbilogo ICON "ncbilogo.ico"
diff --git a/c++/compilers/msvc1000_prj/ncbilogo.ico b/c++/compilers/msvc1000_prj/ncbilogo.ico
deleted file mode 100644
index 44e71d4..0000000
Binary files a/c++/compilers/msvc1000_prj/ncbilogo.ico and /dev/null differ
diff --git a/c++/compilers/msvc1000_prj/ptb.bat b/c++/compilers/msvc1000_prj/ptb.bat
deleted file mode 100644
index f89f820..0000000
--- a/c++/compilers/msvc1000_prj/ptb.bat
+++ /dev/null
@@ -1,275 +0,0 @@
- at echo off
-REM $Id: ptb.bat 388572 2013-02-08 18:11:05Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Run project_tree_builder.exe to generate MSVC solution and project files
-REM
-REM DO NOT ATTEMPT to run this bat file manually
-REM It should be run by CONFIGURE project only
-REM (open a solution and build or rebuild CONFIGURE project)
-REM
-REM ===========================================================================
-
-setlocal
-set DEFPTB_LOCATION=\\snowman\win-coremake\App\Ncbi\cppcore\ptb
-set IDE=1000
-set PTB_EXTRA=
-
-for %%v in ("%PTB_PATH%" "%SLN_PATH%" "%TREE_ROOT%" "%BUILD_TREE_ROOT%" "%PTB_PLATFORM%") do (
-  if %%v=="" (
-    echo ERROR: required environment variable is missing
-    echo DO NOT ATTEMPT to run this bat file manually
-    echo It should be run by CONFIGURE project only
-    exit /b 1
-  )
-)
-set PTBGUI="%TREE_ROOT%\src\build-system\project_tree_builder_gui\bin\ptbgui.jar"
-set DEFPTB_VERSION_FILE=%TREE_ROOT%\src\build-system\ptb_version.txt
-set PTB_INI=%TREE_ROOT%\src\build-system\project_tree_builder.ini
-set PTB_SLN=%BUILD_TREE_ROOT%\static\build\UtilityProjects\PTB.sln
-
-REM --- get solution dir ---
-call :XSLNPATH %SLN_PATH%
-goto DONE
-:XSLNPATH
-set SLN_DIR=%~dp1
-goto :eof
-:DONE
-REM --- call pre-configure script if it exists ---
-if exist "%SLN_DIR%configure_prebuild.bat" (
-  call "%SLN_DIR%configure_prebuild.bat"
-)
-
-call "%BUILD_TREE_ROOT%\msvcvars.bat"
-
-REM -------------------------------------------------------------------------
-REM get PTB version: from DEFPTB_VERSION_FILE  or from PREBUILT_PTB_EXE
-
-set DEFPTB_VERSION=
-if exist "%DEFPTB_VERSION_FILE%" (
-  for /f %%a in ('type "%DEFPTB_VERSION_FILE%"') do (set DEFPTB_VERSION=%%a& goto donedf)
-  :donedf
-  set DEFPTB_VERSION=%DEFPTB_VERSION: =%
-)
-if exist "%PREBUILT_PTB_EXE%" (
-  set ptbver=
-  for /f "tokens=2" %%a in ('"%PREBUILT_PTB_EXE%" -version') do (set ptbver=%%a& goto donepb)
-  :donepb
-  set ptbver=%ptbver: =%
-  if not "%DEFPTB_VERSION%"=="%ptbver%" (
-    echo WARNING: requested PTB version %ptbver% does not match default one: %DEFPTB_VERSION%
-    set DEFPTB_VERSION=%ptbver%
-  )
-)
-
-if "%DEFPTB_VERSION%"=="" (
-  echo ERROR: DEFPTB_VERSION not specified
-  exit /b 1
-)
-for /f "tokens=1-3 delims=." %%a in ('echo %DEFPTB_VERSION%') do (set PTB_VER=%%a%%b%%c& set PTB_VER_MAJOR=%%a)
-
-
-REM -------------------------------------------------------------------------
-REM See if we should and can use Java GUI
-
-set REQ_GUI_CFG=NO
-set USE_GUI_CFG=NO
-for /f "tokens=*" %%i in ('echo %PTB_FLAGS%') do call :PARSE %%i
-goto :endparse
-:PARSE
-if "%1"=="" goto :eof
-if "%1"=="-cfg" (set REQ_GUI_CFG=YES& goto :eof)
-shift
-goto :PARSE
-:endparse
-if "%REQ_GUI_CFG%"=="YES" (
-  if %PTB_VER_MAJOR% GEQ 2 (
-    if exist "%PTBGUI%" (
-      java -version >NUL 2>&1
-      if errorlevel 1 (
-        echo WARNING: Java not found, cannot run configuration GUI
-      ) else (
-        set USE_GUI_CFG=YES
-      )
-    ) else (
-      echo WARNING: "%PTBGUI%" not found
-    )
-  )
-)
-
-
-REM -------------------------------------------------------------------------
-REM See if we should and can use saved settings
-
-set PTB_SAVED_CFG=
-if not "%PTB_SAVED_CFG_REQ%"=="" (
-  if not exist "%PTB_SAVED_CFG_REQ%" (
-    echo ERROR: %PTB_SAVED_CFG_REQ% not found
-    exit /b 1
-  )
-  if %PTB_VER_MAJOR% GEQ 2 (
-    if %PTB_VER% GEQ 220 (
-      set PTB_SAVED_CFG=-args %PTB_SAVED_CFG_REQ%
-REM PTB will read PTB_PROJECT from the saved settings
-      set PTB_PROJECT_REQ=""
-    )
-  )
-)
-
-
-REM -------------------------------------------------------------------------
-REM Identify PTB_EXE
-
-if "%PREBUILT_PTB_EXE%"=="bootstrap" (
-  set DEF_PTB=%PTB_PATH%\project_tree_builder.exe
-) else if not "%PREBUILT_PTB_EXE%"=="" (
-  if exist "%PREBUILT_PTB_EXE%" (
-    set DEF_PTB=%PREBUILT_PTB_EXE%
-  ) else (
-    echo ERROR: "%PREBUILT_PTB_EXE%" not found
-    exit /b 1
-  )
-) else (
-  if %PTB_VER% GEQ 180 (
-    set DEF_PTB=%DEFPTB_LOCATION%\msvc\%DEFPTB_VERSION%\project_tree_builder.exe
-  ) else (
-    if "%PTB_PLATFORM%"=="x64" (
-      set DEF_PTB=%DEFPTB_LOCATION%\msvc9.64\%DEFPTB_VERSION%\project_tree_builder.exe
-    ) else (
-      set DEF_PTB=%DEFPTB_LOCATION%\msvc9\%DEFPTB_VERSION%\project_tree_builder.exe
-    )
-  )
-)
-if exist "%DEF_PTB%" (
-  set PTB_EXE=%DEF_PTB%
-) else (
-  echo project_tree_builder.exe not found at %DEF_PTB%
-  set PTB_EXE=%PTB_PATH%\project_tree_builder.exe
-)
-
-REM -------------------------------------------------------------------------
-REM Misc settings
-
-if %PTB_VER% GEQ 180 (
-  set PTB_EXTRA=%PTB_EXTRA% -ide %IDE% -arch %PTB_PLATFORM%
-)
-if not exist "%PTB_INI%" (
-  echo ERROR: "%PTB_INI%" not found
-  exit /b 1
-)
-set PTB_PROJECT_LST=
-if "%PTB_PROJECT%"=="" (
-  set PTB_PROJECT_LST=%PTB_PROJECT_REQ%
-) else (
-  set PTB_PROJECT_LST=%PTB_PROJECT%
-)
-
-
-REM -------------------------------------------------------------------------
-REM Build PTB_EXE if needed
-
-if not exist "%PTB_EXE%" (
-  echo ******************************************************************************
-  echo Building project tree builder locally, please wait
-  echo ******************************************************************************
-  rem --- @echo msbuild "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /t:"project_tree_builder_exe:Rebuild" /p:Configuration=ReleaseDLL;Platform=%PTB_PLATFORM% /maxcpucount:1
-  rem --- msbuild "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /t:"project_tree_builder_exe:Rebuild" /p:Configuration=ReleaseDLL;Platform=%PTB_PLATFORM% /maxcpucount:1
-  if exist "%PTB_SLN%" (
-    @echo %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-    %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-  ) else (
-    @echo %DEVENV% "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-    %DEVENV% "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-  )
-) else (
-  echo ******************************************************************************
-  echo Using PREBUILT project tree builder at %PTB_EXE%
-  echo ******************************************************************************
-)
-if not exist "%PTB_EXE%" (
-  echo ERROR: "%PTB_EXE%" not found
-  exit /b 1
-)
-"%PTB_EXE%" -version
-if errorlevel 1 (
-  echo ERROR: cannot find working %PTB_EXE%
-  exit /b 1
-)
-
-
-REM -------------------------------------------------------------------------
-REM Run PTB_EXE
-
-call "%BUILD_TREE_ROOT%\lock_ptb_config.bat" ON "%BUILD_TREE_ROOT%\"
-if errorlevel 1 exit /b 1
-
-echo ******************************************************************************
-echo Running -CONFIGURE- please wait
-echo ******************************************************************************
-echo "%PTB_EXE%" %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-if "%USE_GUI_CFG%"=="YES" (
-  java -jar %PTBGUI% "%PTB_EXE%" -i %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-) else (
-  "%PTB_EXE%" %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-)
-if errorlevel 1 (set PTB_RESULT=1) else (set PTB_RESULT=0)
-
-call "%BUILD_TREE_ROOT%\lock_ptb_config.bat" OFF "%BUILD_TREE_ROOT%\"
-
-if "%PTB_RESULT%"=="1" (
-  echo ******************************************************************************
-  echo -CONFIGURE- has failed
-  echo Configuration log was saved at "file://%SLN_PATH%_configuration_log.txt"
-  echo ******************************************************************************
-  if exist "%SLN_PATH%_configuration_log.txt" (
-    if "%DIAG_SILENT_ABORT%"=="" start "" "%SLN_PATH%_configuration_log.txt"
-  )
-  exit /b 1
-) else (
-  echo ******************************************************************************
-  echo -CONFIGURE- has succeeded
-  echo Configuration log was saved at "file://%SLN_PATH%_configuration_log.txt"
-  echo ******************************************************************************
-)
-
-set ALLOBJ="_generate_all_objects.dataspec"
-type "%SLN_PATH%" | %SystemRoot%\system32\find /C %ALLOBJ% >NUL 2>&1
-if not errorlevel 1 (
-  echo ******************************************************************************
-  echo ******************************************************************************
-  echo ==============  Generating objects source code.                 ==============
-  echo ==============  DO NOT RELOAD THE SOLUTION NOW!                 ============== 
-  echo ******************************************************************************
-  echo %DEVENV% "%SLN_PATH%" /build "ReleaseDLL|%PTB_PLATFORM%" /project %ALLOBJ%
-  %DEVENV% "%SLN_PATH%" /build "ReleaseDLL|%PTB_PLATFORM%" /project %ALLOBJ%
-)
-echo -
-echo -
-echo ******************************************************************************
-echo ==============  It is now safe to reload the solution:          ==============
-echo ==============  Please, close it and open again                 ============== 
-echo ******************************************************************************
diff --git a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/PTB.sln b/c++/compilers/msvc1000_prj/static/build/UtilityProjects/PTB.sln
deleted file mode 100644
index 9c3740a..0000000
--- a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/PTB.sln
+++ /dev/null
@@ -1,121 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "_CONFIGURE_DIALOG_.vcxproj", "{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xncbi.lib", "..\corelib\xncbi.lib.vcxproj", "{1EDB6A26-ADB9-4591-B907-505E8D1A8157}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xser.lib", "..\serial\xser.lib.vcxproj", "{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xutil.lib", "..\util\xutil.lib.vcxproj", "{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msbuild_dataobj.lib", "..\build-system\project_tree_builder\msbuild\msbuild_dataobj.lib.vcxproj", "{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9} = {BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datatool.exe", "..\serial\datatool\datatool.exe.vcxproj", "{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "project_tree_builder.exe", "..\build-system\project_tree_builder\project_tree_builder.exe.vcxproj", "{8D5B9C1E-5941-44F8-B017-25F6201E822B}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9} = {BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xregexp.lib", "..\util\xregexp\xregexp.lib.vcxproj", "{E46C5B0B-675C-4C37-B618-02608C379C67}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regexp.lib", "..\util\regexp\regexp.lib.vcxproj", "{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/msvc1000_prj/static/build/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index 30a438f..0000000
--- a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/msvc1000_prj/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index 1d505df..0000000
--- a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-DIALOG-</ProjectName>
-    <ProjectGuid>{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/configure._ b/c++/compilers/msvc1000_prj/static/build/UtilityProjects/configure._
deleted file mode 100644
index 49cbd64..0000000
--- a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/configure_dialog._ b/c++/compilers/msvc1000_prj/static/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index cdd8acd..0000000
--- a/c++/compilers/msvc1000_prj/static/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/static/build/all.bat b/c++/compilers/msvc1000_prj/static/build/all.bat
deleted file mode 100644
index 2df409c..0000000
--- a/c++/compilers/msvc1000_prj/static/build/all.bat
+++ /dev/null
@@ -1,39 +0,0 @@
- at ECHO OFF
-REM $Id: all.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Build all C++ Toolkit STATIC projects
-REM
-REM ===========================================================================
-
-
-CALL all_ncbi.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gui.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-:_ABORT_
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/all_gui.bat b/c++/compilers/msvc1000_prj/static/build/all_gui.bat
deleted file mode 100644
index 3e91577..0000000
--- a/c++/compilers/msvc1000_prj/static/build/all_gui.bat
+++ /dev/null
@@ -1,81 +0,0 @@
- at ECHO OFF
-REM $Id: all_gui.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ GUI core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "static\gui"
-msbuild gui\ncbi_gui.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == Debug GOTO CONTINUE
-IF %CFG% == DebugMT GOTO CONTINUE
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == Release GOTO CONTINUE
-IF %CFG% == ReleaseMT GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       Debug DebugMT DebugDLL Release ReleaseMT ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "static\gui\%CFG%"
-msbuild gui\ncbi_gui.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-REM vcbuild /M2 /time gui\ncbi_gui.sln "%CFG%|Win32"
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
-set CFG=
diff --git a/c++/compilers/msvc1000_prj/static/build/all_ncbi.bat b/c++/compilers/msvc1000_prj/static/build/all_ncbi.bat
deleted file mode 100644
index 50d11e1..0000000
--- a/c++/compilers/msvc1000_prj/static/build/all_ncbi.bat
+++ /dev/null
@@ -1,81 +0,0 @@
- at ECHO OFF
-REM $Id: all_ncbi.bat 196747 2010-07-08 14:00:02Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "static\ncbi"
-msbuild ncbi_cpp.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == Debug GOTO CONTINUE
-IF %CFG% == DebugMT GOTO CONTINUE
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == Release GOTO CONTINUE
-IF %CFG% == ReleaseMT GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       Debug DebugMT DebugDLL Release ReleaseMT ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "static\ncbi\%CFG%"
-msbuild ncbi_cpp.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-REM vcbuild /M2 /time ncbi_cpp.sln "%CFG%|Win32"
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
-set CFG=
diff --git a/c++/compilers/msvc1000_prj/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj b/c++/compilers/msvc1000_prj/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj
deleted file mode 100644
index b332229..0000000
--- a/c++/compilers/msvc1000_prj/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0">
-  <PropertyGroup Label="Globals"><ProjectGuid>{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}</ProjectGuid><Keyword>Win32Proj</Keyword><ProjectName>msbuild_dataobj.lib</ProjectName>
-  </PropertyGroup>
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration"><ConfigurationType>StaticLibrary</ConfigurationType><CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration"><ConfigurationType>StaticLibrary</ConfigurationType><CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
-  <ImportGroup Label="ExtensionSettings"></ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Label="LocalAppDataPlatform"/>
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Label="LocalAppDataPlatform"/>
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros"></PropertyGroup>
-  <PropertyGroup><_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-      <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\..\lib\$(Configuration)\</OutDir>
-      <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-      <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">msbuild_dataobj</TargetName>
-      <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\..\lib\$(Configuration)\</OutDir>
-      <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-      <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">msbuild_dataobj</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <ClCompile>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\..\include\</AdditionalIncludeDirectories>
-      <AdditionalOptions/>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <BrowseInformation>false</BrowseInformation>
-      <BufferSecurityCheck>TRUE</BufferSecurityCheck>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat/>
-      <DisableSpecificWarnings/>
-      <EnableFunctionLevelLinking>TRUE</EnableFunctionLevelLinking>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <IgnoreStandardIncludePath>FALSE</IgnoreStandardIncludePath>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <MinimalRebuild>FALSE</MinimalRebuild>
-      <OmitFramePointers>TRUE</OmitFramePointers>
-      <Optimization>MaxSpeed</Optimization>
-      <PrecompiledHeader></PrecompiledHeader>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)msbuild_dataobj.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>TRUE</RuntimeTypeInfo>
-      <StringPooling>FALSE</StringPooling>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <UndefinePreprocessorDefinitions/>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <Lib>
-      <AdditionalLibraryDirectories/>
-      <AdditionalOptions/>
-      <IgnoreAllDefaultLibraries>FALSE</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries/>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-    </Lib>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories/>
-      <AdditionalOptions/>
-      <PreprocessorDefinitions/>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\..\include\</AdditionalIncludeDirectories>
-      <AdditionalOptions/>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <BrowseInformation>false</BrowseInformation>
-      <BufferSecurityCheck>TRUE</BufferSecurityCheck>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat/>
-      <DisableSpecificWarnings/>
-      <EnableFunctionLevelLinking>TRUE</EnableFunctionLevelLinking>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <IgnoreStandardIncludePath>FALSE</IgnoreStandardIncludePath>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <MinimalRebuild>FALSE</MinimalRebuild>
-      <OmitFramePointers>TRUE</OmitFramePointers>
-      <Optimization>MaxSpeed</Optimization>
-      <PrecompiledHeader></PrecompiledHeader>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)msbuild_dataobj.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>TRUE</RuntimeTypeInfo>
-      <StringPooling>FALSE</StringPooling>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <UndefinePreprocessorDefinitions/>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <Lib>
-      <AdditionalLibraryDirectories/>
-      <AdditionalOptions/>
-      <IgnoreAllDefaultLibraries>FALSE</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries/>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-    </Lib>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories/>
-      <AdditionalOptions/>
-      <PreprocessorDefinitions/>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj__.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj___.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuild Include="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj.xsd">
-      <FileType>Document</FileType>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%( [...]
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Di [...]
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
-  <ImportGroup Label="ExtensionTargets"></ImportGroup>
-</Project>
diff --git a/c++/compilers/msvc1000_prj/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj b/c++/compilers/msvc1000_prj/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj
deleted file mode 100644
index 7ec6f8f..0000000
--- a/c++/compilers/msvc1000_prj/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj
+++ /dev/null
@@ -1,414 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{8D5B9C1E-5941-44F8-B017-25F6201E822B}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\bin\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\bin\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">false</LinkIncremental>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">project_tree_builder</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">project_tree_builder</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <PreBuildEvent>
-      <Command>%40echo EXPENDABLE project
-</Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)project_tree_builder.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Link>
-      <AdditionalOptions>ws2_32.lib dbghelp.lib %(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ProgramDatabaseFile>$(OutDir)project_tree_builder.pdb</ProgramDatabaseFile>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(OutDir)project_tree_builder.lib</ImportLibrary>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <PreBuildEvent>
-      <Command>%40echo EXPENDABLE project
-</Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)project_tree_builder.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Link>
-      <AdditionalOptions>ws2_32.lib dbghelp.lib %(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ProgramDatabaseFile>$(OutDir)project_tree_builder.pdb</ProgramDatabaseFile>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(OutDir)project_tree_builder.lib</ImportLibrary>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\configurable_file.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\file_contents.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project__.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project___.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure_prj_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_makefile.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_masterproject_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_files_collector.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_utils.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_project_context.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_site.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_sln_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_builder_app.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_datatool_generated_src.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_item.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_projects.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_src_resolver.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree_builder.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_utils.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\resolver.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_registry.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\configurable_file.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Configuration.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Configuration_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Configurations.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Configurations_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\File.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\File_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\file_contents.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\FileConfiguration.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\FileConfiguration_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Files.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Files_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Filter.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Filter_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project__.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure_prj_generator.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info_utils.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_makefile.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_masterproject_generator.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_defines.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_files_collector.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_generator.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_utils.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_project_context.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_site.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_sln_generator.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_tools_implement.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_traits.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Platform.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Platform_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Platforms.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Platforms_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_builder_app.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_datatool_generated_src.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_item.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_projects.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_src_resolver.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree_builder.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_utils.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\resolver.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\stl_msvc_usage.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Tool.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Tool_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\VisualStudioProject.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\VisualStudioProject_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.rc" />
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuild Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project.dtd">
-<FileType>Document</FileType>
-<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Directory)%(Fil [...]
-<AdditionalInputs
-         Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
-<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
-
-<FileType>Document</FileType>
-<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Directory)%(Filen [...]
-<AdditionalInputs
-         Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
-<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
-    </CustomBuild>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\corelib\xncbi.lib.vcxproj">
-      <Project>{1edb6a26-adb9-4591-b907-505e8d1a8157}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\serial\xser.lib.vcxproj">
-      <Project>{1f5bcb57-26a5-46c7-b87c-fa74072cf5f6}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\util\regexp\regexp.lib.vcxproj">
-      <Project>{dfde1494-ed69-4c4f-84d3-0d19db1b424c}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\util\xregexp\xregexp.lib.vcxproj">
-      <Project>{e46c5b0b-675c-4c37-b618-02608c379c67}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\util\xutil.lib.vcxproj">
-      <Project>{1dce18cd-4a7e-43b8-b7af-48972efe51e7}</Project>
-    </ProjectReference>
-    <ProjectReference Include="msbuild\msbuild_dataobj.lib.vcxproj">
-      <Project>{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/corelib/xncbi.lib.vcxproj b/c++/compilers/msvc1000_prj/static/build/corelib/xncbi.lib.vcxproj
deleted file mode 100644
index 7e5817c..0000000
--- a/c++/compilers/msvc1000_prj/static/build/corelib/xncbi.lib.vcxproj
+++ /dev/null
@@ -1,508 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{1EDB6A26-ADB9-4591-B907-505E8D1A8157}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">xncbi</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">xncbi</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xncbi.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xncbi.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ddumpable.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\env_reg.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\metareg.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_config.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_os_mswin.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_param.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_process.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_safe_static.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_system.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiapp.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiargs.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiatomic.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbidbg.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbidiag.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbidiag_p.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbidll.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbienv.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiexec.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiexpt.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbifile.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbimempool.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbimtx.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiobj.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbireg.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbistr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbistre.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbithr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbitime.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\obj_store.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\plugin_manager.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\plugin_manager_store.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\rwstreambuf.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\syslog.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\version.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\stream_utils.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_stack.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\request_ctx.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\request_control.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\expr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\guard.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbierror.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\blob_storage.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_signal.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_strings.c">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\resource_info.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\interprocess_lock.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_autoinit.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\perf_log.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_url.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_cookies.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbicfg.c.in">
-      <FileType>Document</FileType>
-      <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
-      <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">CompileAsC</CompileAs>
-    </ClCompile>
-    <None Include="..\..\..\..\..\include\corelib\ncbidiag.inl" />
-    <None Include="..\..\..\..\..\include\corelib\ncbimtx.inl" />
-    <None Include="..\..\..\..\..\include\corelib\ncbiobj.inl" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\include\corelib\ddumpable.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\guard.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\metareg.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\mswin_export.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_bswap.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_config.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_limits.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_limits.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_os_mac.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_os_mswin.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_os_unix.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_param.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_process.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_safe_static.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_system.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_tree.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiapp.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiargs.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiatomic.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbicfg.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbicntr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbidbg.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbidiag.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbidll.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbienv.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiexec.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiexpt.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbifile.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbifloat.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbimisc.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbimtx.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiobj.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbireg.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbistd.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbistl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbistr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbistre.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbithr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbithr_conf.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbitime.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbitype.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiutil.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\obj_store.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\plugin_manager.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\plugin_manager_impl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\plugin_manager_store.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\impl\rwstreambuf.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\syslog.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\test_mt.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\version.hpp" />
-    <ClInclude Include="..\..\..\..\..\src\corelib\ncbiargs_p.hpp" />
-    <ClInclude Include="..\..\..\..\..\src\corelib\ncbidbg_p.hpp" />
-    <ClInclude Include="..\..\..\..\..\src\corelib\ncbidiag_p.hpp" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index 5a3bb6a..0000000
--- a/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index 06098bc..0000000
--- a/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-DIALOG-</ProjectName>
-    <ProjectGuid>{FDC9447A-C7F1-492D-B84F-D54A1E610F16}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/configure._ b/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/configure._
deleted file mode 100644
index 3589c55..0000000
--- a/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/configure_dialog._ b/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/configure_dialog._
deleted file mode 100644
index 4907743..0000000
--- a/c++/compilers/msvc1000_prj/static/build/gui/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/static/build/gui/ncbi_gui.sln b/c++/compilers/msvc1000_prj/static/build/gui/ncbi_gui.sln
deleted file mode 100644
index 669dea4..0000000
--- a/c++/compilers/msvc1000_prj/static/build/gui/ncbi_gui.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{FDC9447A-C7F1-492D-B84F-D54A1E610F16}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc1000_prj/static/build/ncbi_cpp.sln b/c++/compilers/msvc1000_prj/static/build/ncbi_cpp.sln
deleted file mode 100644
index 2c811a3..0000000
--- a/c++/compilers/msvc1000_prj/static/build/ncbi_cpp.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc1000_prj/static/build/serial/datatool/datatool.exe.vcxproj b/c++/compilers/msvc1000_prj/static/build/serial/datatool/datatool.exe.vcxproj
deleted file mode 100644
index 9be3a9f..0000000
--- a/c++/compilers/msvc1000_prj/static/build/serial/datatool/datatool.exe.vcxproj
+++ /dev/null
@@ -1,505 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\bin\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\bin\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">false</LinkIncremental>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">datatool</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">datatool</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)datatool.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Link>
-      <AdditionalOptions>ws2_32.lib dbghelp.lib %(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ProgramDatabaseFile>$(OutDir)datatool.pdb</ProgramDatabaseFile>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(OutDir)datatool.lib</ImportLibrary>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)datatool.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Link>
-      <AdditionalOptions>ws2_32.lib dbghelp.lib %(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ProgramDatabaseFile>$(OutDir)datatool.pdb</ProgramDatabaseFile>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(OutDir)datatool.lib</ImportLibrary>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\alexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\aliasstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\aparser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\blocktype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\choiceptrstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\choicestr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\choicetype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\classstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\code.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\comments.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\datatool.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\dtdaux.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\dtdlexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\dtdparser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\enumstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\enumtype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\exceptions.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\filecode.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\fileutil.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\generate.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\lexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\mcontainer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\module.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\moduleset.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\namespace.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\parser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\ptrstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\reftype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\rpcgen.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\srcutil.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\statictype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\stdstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\stlstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\type.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\typestr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\unitype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\value.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\xsdlexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\xsdparser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\wsdllexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\wsdlparser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\wsdlstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_code_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_merger.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_node.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_pattern_match_callback.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_spec_file_parser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\alexer.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\aliasstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\aparser.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\atoken.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\blocktype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\choiceptrstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\choicestr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\choicetype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\classctx.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\classstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\code.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\comments.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\datatool.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\dtdaux.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\dtdlexer.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\dtdparser.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\enumstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\enumtype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\exceptions.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\filecode.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\fileutil.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\generate.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\lexer.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\mcontainer.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\module.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\moduleset.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\namespace.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\parser.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\ptrstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\reftype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\rpcgen.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\srcutil.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\statictype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\stdstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\stlstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\tokens.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\type.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\typestr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\unitype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\value.hpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\..\..\ncbi.rc" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\corelib\xncbi.lib.vcxproj">
-      <Project>{1edb6a26-adb9-4591-b907-505e8d1a8157}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\util\xutil.lib.vcxproj">
-      <Project>{1dce18cd-4a7e-43b8-b7af-48972efe51e7}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\xser.lib.vcxproj">
-      <Project>{1f5bcb57-26a5-46c7-b87c-fa74072cf5f6}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/serial/xser.lib.vcxproj b/c++/compilers/msvc1000_prj/static/build/serial/xser.lib.vcxproj
deleted file mode 100644
index 68de976..0000000
--- a/c++/compilers/msvc1000_prj/static/build/serial/xser.lib.vcxproj
+++ /dev/null
@@ -1,532 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">xser</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">xser</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xser.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xser.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\src\serial\aliasinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\autoptrinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\choice.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\choiceptr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\classinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\classinfob.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\continfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\delaybuf.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\enumerated.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\exception.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\hookdata.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\hookdatakey.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\item.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\iterator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\member.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\memberid.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\memberlist.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objcopy.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objectinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objectio.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objectiter.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objhook.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistrasn.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistrasnb.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistrxml.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objlist.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostrasn.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostrasnb.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostrxml.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostrjson.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistrjson.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objstack.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\pack_string.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\pathhook.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\ptrinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\serial.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\serializable.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\serialobject.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\stdtypes.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\stltypes.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\typeinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\typemap.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\typeref.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\variant.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\include\serial\aliasinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\asntypes.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\autoptrinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\choice.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\choiceptr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\classinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\classinfob.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\classinfohelper.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\continfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\delaybuf.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\enumerated.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\enumvalues.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\exception.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\hookdata.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\hookdataimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\hookdatakey.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\hookfunc.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\item.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\iterator.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\iteratorbase.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\member.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\memberid.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\memberlist.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objcopy.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\object.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objectinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objectio.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objectiter.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objecttype.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objhook.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistrasn.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistrasnb.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistrimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistrxml.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objlist.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objostr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objostrasn.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objostrasnb.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objostrxml.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objstack.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objstrasnb.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objstrb.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\pack_string.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\pathhook.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\ptrinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\rpcbase.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serial.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialasn.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialasndef.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialbase.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialdef.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serializable.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialutil.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stdtypeinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stdtypes.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stdtypesimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stltypes.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stltypesimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\timetypeinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typeinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typeinfoimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typemap.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typemapimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typemapper.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typeref.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\variant.hpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\..\..\..\include\serial\choice.inl" />
-    <None Include="..\..\..\..\..\include\serial\classinfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\classinfob.inl" />
-    <None Include="..\..\..\..\..\include\serial\continfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\item.inl" />
-    <None Include="..\..\..\..\..\include\serial\iterator.inl" />
-    <None Include="..\..\..\..\..\include\serial\iteratorbase.inl" />
-    <None Include="..\..\..\..\..\include\serial\member.inl" />
-    <None Include="..\..\..\..\..\include\serial\memberid.inl" />
-    <None Include="..\..\..\..\..\include\serial\memberlist.inl" />
-    <None Include="..\..\..\..\..\include\serial\objcopy.inl" />
-    <None Include="..\..\..\..\..\include\serial\object.inl" />
-    <None Include="..\..\..\..\..\include\serial\objectinfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\objectio.inl" />
-    <None Include="..\..\..\..\..\include\serial\objectiter.inl" />
-    <None Include="..\..\..\..\..\include\serial\objistr.inl" />
-    <None Include="..\..\..\..\..\include\serial\objistrasnb.inl" />
-    <None Include="..\..\..\..\..\include\serial\objistrimpl.inl" />
-    <None Include="..\..\..\..\..\include\serial\objistrxml.inl" />
-    <None Include="..\..\..\..\..\include\serial\objlist.inl" />
-    <None Include="..\..\..\..\..\include\serial\objostr.inl" />
-    <None Include="..\..\..\..\..\include\serial\objostrasnb.inl" />
-    <None Include="..\..\..\..\..\include\serial\objostrxml.inl" />
-    <None Include="..\..\..\..\..\include\serial\objstack.inl" />
-    <None Include="..\..\..\..\..\include\serial\objstrasnb.inl" />
-    <None Include="..\..\..\..\..\include\serial\ptrinfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\serial.inl" />
-    <None Include="..\..\..\..\..\include\serial\serialdef.inl" />
-    <None Include="..\..\..\..\..\include\serial\stdtypes.inl" />
-    <None Include="..\..\..\..\..\include\serial\typeinfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\typeinfoimpl.inl" />
-    <None Include="..\..\..\..\..\include\serial\typeref.inl" />
-    <None Include="..\..\..\..\..\include\serial\variant.inl" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/util/regexp/regexp.lib.vcxproj b/c++/compilers/msvc1000_prj/static/build/util/regexp/regexp.lib.vcxproj
deleted file mode 100644
index 4669706..0000000
--- a/c++/compilers/msvc1000_prj/static/build/util/regexp/regexp.lib.vcxproj
+++ /dev/null
@@ -1,362 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <Keyword>Win32Proj</Keyword>
-    <ProjectGuid>{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">regexp</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">regexp</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\; ..\..\..\..\..\..\include\internal\; ..\..\..\..\..\..\include\util\regexp\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <ProgramDataBaseFileName>$(IntDir)regexp.pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <MinimalRebuild>false</MinimalRebuild>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>false</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <CallingConvention>Cdecl</CallingConvention>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-    </ClCompile>
-    <Lib>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ResourceCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\; ..\..\..\..\..\..\include\internal\; ..\..\..\..\..\..\include\util\regexp\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <ProgramDataBaseFileName>$(IntDir)regexp.pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <MinimalRebuild>false</MinimalRebuild>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>false</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <CallingConvention>Cdecl</CallingConvention>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-    </ClCompile>
-    <Lib>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ResourceCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_chartables.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_compile.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_config.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_dfa_exec.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_exec.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_fullinfo.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_get.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_globals.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_info.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_maketables.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_newline.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_ord2utf8.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_refcount.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_study.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_tables.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_try_flipped.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_ucd.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_valid_utf8.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_version.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_xclass.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcreposix.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\..\include\util\regexp\pcre.h" />
-    <ClInclude Include="..\..\..\..\..\..\include\util\regexp\pcreposix.h" />
-    <ClInclude Include="..\..\..\..\..\..\src\util\regexp\pcre_config.h" />
-    <ClInclude Include="..\..\..\..\..\..\src\util\regexp\pcre_internal.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/util/xregexp/xregexp.lib.vcxproj b/c++/compilers/msvc1000_prj/static/build/util/xregexp/xregexp.lib.vcxproj
deleted file mode 100644
index 70997d0..0000000
--- a/c++/compilers/msvc1000_prj/static/build/util/xregexp/xregexp.lib.vcxproj
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <Keyword>Win32Proj</Keyword>
-    <ProjectGuid>{E46C5B0B-675C-4C37-B618-02608C379C67}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">xregexp</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">xregexp</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\; ..\..\..\..\..\..\include\internal\; ..\..\..\..\..\..\include\util\regexp\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <ProgramDataBaseFileName>$(IntDir)xregexp.pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <MinimalRebuild>false</MinimalRebuild>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>false</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <CallingConvention>Cdecl</CallingConvention>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-    </ClCompile>
-    <Lib>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ResourceCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\; ..\..\..\..\..\..\include\internal\; ..\..\..\..\..\..\include\util\regexp\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <ProgramDataBaseFileName>$(IntDir)xregexp.pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <MinimalRebuild>false</MinimalRebuild>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>false</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <CallingConvention>Cdecl</CallingConvention>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-    </ClCompile>
-    <Lib>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ResourceCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\src\util\xregexp\arg_regexp.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\xregexp\mask_regexp.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Use</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Use</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\xregexp\regexp.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Use</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Use</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\..\include\util\xregexp\arg_regexp.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\util\xregexp\mask_regexp.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\util\xregexp\regexp.hpp" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/build/util/xutil.lib.vcxproj b/c++/compilers/msvc1000_prj/static/build/util/xutil.lib.vcxproj
deleted file mode 100644
index 7da67de..0000000
--- a/c++/compilers/msvc1000_prj/static/build/util/xutil.lib.vcxproj
+++ /dev/null
@@ -1,307 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">xutil</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">xutil</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xutil.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xutil.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\src\util\ascii85.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\bytesrc.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\checksum.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\ddump_viewer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\dictionary.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\file_obsolete.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\format_guess.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\itree.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\logrotate.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\md5.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\random_gen.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\smalldns.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\strbuffer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\strsearch.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\thread_nonstop.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\thread_pool.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\unicode.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\utf8.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\util_exception.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\include\util\ascii85.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\bytesrc.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\checksum.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\ddump_viewer.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\dictionary.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\file_obsolete.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\format_guess.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\itree.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\lightstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\linkedset.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\logrotate.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\md5.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\ncbi_table.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\random_gen.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\range.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\range_coll.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\rangemap.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\reader_writer.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\regexp.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\resize_iter.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\resource_pool.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\rwstream.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\smalldns.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\static_map.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\static_set.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\strbuffer.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\strsearch.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\thread_nonstop.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\thread_pool.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\unicode.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\utf8.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\util_exception.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\weakmap.hpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\..\..\..\include\util\checksum.inl" />
-    <None Include="..\..\..\..\..\include\util\itree.inl" />
-    <None Include="..\..\..\..\..\include\util\rangemap.inl" />
-    <None Include="..\..\..\..\..\include\util\strbuffer.inl" />
-    <None Include="..\..\..\..\..\include\util\weakmap.inl" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/static/third_party_msvcstatic_install.vcxproj b/c++/compilers/msvc1000_prj/static/third_party_msvcstatic_install.vcxproj
deleted file mode 100644
index a0b9deb..0000000
--- a/c++/compilers/msvc1000_prj/static/third_party_msvcstatic_install.vcxproj
+++ /dev/null
@@ -1,409 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|Win32">
-      <Configuration>DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|x64">
-      <Configuration>DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|Win32">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|x64">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|Win32">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|x64">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|Win32">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|x64">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|Win32">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|x64">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|Win32">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|x64">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9E4B5381-9B6C-4867-BF8A-F1AAA1FD581E}</ProjectGuid>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="msvc10.64\10"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="third_party_static_install.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/msvc1000_prj/static/third_party_static_install.mak b/c++/compilers/msvc1000_prj/static/third_party_static_install.mak
deleted file mode 100644
index c8794e2..0000000
--- a/c++/compilers/msvc1000_prj/static/third_party_static_install.mak
+++ /dev/null
@@ -1,62 +0,0 @@
-# $Id: third_party_static_install.mak 463528 2015-03-30 14:10:31Z ucko $
-#################################################################
-
-
-INSTALL          = .\bin
-INSTALL_BINPATH  = $(INSTALL)\$(INTDIR)
-THIRDPARTY_MAKEFILES_DIR =  .
-
-
-META_MAKE = $(THIRDPARTY_MAKEFILES_DIR)\..\third_party_install.meta.mk
-!IF EXIST($(META_MAKE))
-!INCLUDE $(META_MAKE)
-!ELSE
-!ERROR  $(META_MAKE)  not found
-!ENDIF
-
-THIRD_PARTY_LIBS = \
-	install_berkeleydb \
-	install_gnutls     \
-	install_glew       \
-	install_lzo        \
-	install_mssql      \
-	install_mysql      \
-	install_openssl    \
-	install_sqlite     \
-	install_sqlite3    \
-	install_sybase     \
-	install_wxwidgets  \
-	install_wxwindows  \
-	install_xalan      \
-	install_xerces     \
-	install_libxml     \
-	install_libxslt    \
-	install_vdb
-
-CLEAN_THIRD_PARTY_LIBS = \
-	clean_berkeleydb \
-	clean_gnutls     \
-	clean_glew       \
-	clean_lzo        \
-	clean_mssql      \
-	clean_mysql      \
-	clean_openssl    \
-	clean_sqlite     \
-	clean_sqlite3    \
-	clean_sybase     \
-	clean_wxwidgets  \
-	clean_wxwindows  \
-	clean_xalan      \
-	clean_xerces     \
-	clean_libxml     \
-	clean_libxslt    \
-	clean_vdb
-
-all : dirs $(THIRD_PARTY_LIBS)
-
-clean : $(CLEAN_THIRD_PARTY_LIBS)
-
-rebuild : clean all
-
-dirs :
-    @if not exist $(INSTALL_BINPATH) (echo Creating directory $(INSTALL_BINPATH)... & mkdir $(INSTALL_BINPATH))
diff --git a/c++/compilers/msvc1000_prj/static/third_party_static_install.vcxproj b/c++/compilers/msvc1000_prj/static/third_party_static_install.vcxproj
deleted file mode 100644
index ae81497..0000000
--- a/c++/compilers/msvc1000_prj/static/third_party_static_install.vcxproj
+++ /dev/null
@@ -1,409 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|Win32">
-      <Configuration>DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|x64">
-      <Configuration>DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|Win32">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|x64">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|Win32">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|x64">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|Win32">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|x64">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|Win32">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|x64">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|Win32">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|x64">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9E4B5381-9B6C-4867-BF8A-F1AAA1FD580E}</ProjectGuid>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="third_party_static_install.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/msvc1000_prj/third_party_install.meta.mk b/c++/compilers/msvc1000_prj/third_party_install.meta.mk
deleted file mode 100644
index 3752e7d..0000000
--- a/c++/compilers/msvc1000_prj/third_party_install.meta.mk
+++ /dev/null
@@ -1,326 +0,0 @@
-# $Id: third_party_install.meta.mk 468588 2015-05-26 17:46:51Z ucko $
-
-#################################################################
-#
-# Third party DLLs installation makefile
-#
-# Author: Andrei Gourianov
-#
-#################################################################
-
-
-# Build configuration name
-INTDIR = $(INTDIR:.\=)
-ALTDIR = $(INTDIR:VTune_=)
-!IF ("$(INTDIR)"=="$(ALTDIR)")
-ALTDIR = $(INTDIR:Unicode_=)
-!ENDIF
-
-# Extensions of files to copy
-EXTENSIONS         = dll pdb manifest
-
-# MSVC DLLs
-#  MSVC_SRC must be defined elsewhere (eg, in command line)
-#MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\msvc71\7.1\bin
-#MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\msvc8\8\bin
-
-MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\$(MSVC_SRC)\bin
-
-
-
-#################################################################
-# Source folders
-#
-# x_BINPATH macros are defined in Makefile.third_party.mk 
-# generated by project_tree_builder
-#
-
-PTB_GENERATED = $(THIRDPARTY_MAKEFILES_DIR)\$(INTDIR)\Makefile.third_party.mk
-!IF EXIST($(PTB_GENERATED))
-!INCLUDE $(PTB_GENERATED)
-!ELSE
-!ERROR  $(PTB_GENERATED)  not found
-!ENDIF
-
-
-BERKELEYDB_SRC = $(BERKELEYDB_BINPATH)\$(INTDIR)
-!IF !EXIST($(BERKELEYDB_SRC))
-BERKELEYDB_SRC = $(BERKELEYDB_BINPATH)\$(ALTDIR)
-!ENDIF
-
-GNUTLS_SRC = $(GNUTLS_BINPATH)\$(INTDIR)
-!IF !EXIST($(GNUTLS_SRC))
-GNUTLS_SRC = $(GNUTLS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-GLEW_SRC = $(GLEW_BINPATH)\$(INTDIR)
-!IF !EXIST($(GLEW_SRC))
-GLEW_SRC = $(GLEW_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LZO_SRC = $(LZO_BINPATH)\$(INTDIR)
-!IF !EXIST($(LZO_SRC))
-LZO_SRC = $(LZO_BINPATH)\$(ALTDIR)
-!ENDIF
-
-MSSQL_SRC = $(MSSQL_BINPATH)\$(INTDIR)
-!IF !EXIST($(MSSQL_SRC))
-MSSQL_SRC = $(MSSQL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-MYSQL_SRC = $(MYSQL_BINPATH)\$(INTDIR)
-!IF !EXIST($(MYSQL_SRC))
-MYSQL_SRC = $(MYSQL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-OPENSSL_SRC = $(OPENSSL_BINPATH)\$(INTDIR)
-!IF !EXIST($(OPENSSL_SRC))
-OPENSSL_SRC = $(OPENSSL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SQLITE_SRC = $(SQLITE_BINPATH)\$(INTDIR)
-!IF !EXIST($(SQLITE_SRC))
-SQLITE_SRC = $(SQLITE_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SQLITE3_SRC = $(SQLITE3_BINPATH)\$(INTDIR)
-!IF !EXIST($(SQLITE3_SRC))
-SQLITE3_SRC = $(SQLITE3_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SYBASE_SRC = $(SYBASE_BINPATH)\$(INTDIR)
-!IF !EXIST($(SYBASE_SRC))
-SYBASE_SRC = $(SYBASE_BINPATH)\$(ALTDIR)
-!ENDIF
-
-WXWIDGETS_SRC = $(WXWIDGETS_BINPATH)\$(INTDIR)
-!IF !EXIST($(WXWIDGETS_SRC))
-WXWIDGETS_SRC = $(WXWIDGETS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-WXWINDOWS_SRC = $(WXWINDOWS_BINPATH)\$(INTDIR)
-!IF !EXIST($(WXWINDOWS_SRC))
-WXWINDOWS_SRC = $(WXWINDOWS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-XALAN_SRC = $(XALAN_BINPATH)\$(INTDIR)
-!IF !EXIST($(XALAN_SRC))
-XALAN_SRC = $(XALAN_BINPATH)\$(ALTDIR)
-!ENDIF
-
-XERCES_SRC = $(XERCES_BINPATH)\$(INTDIR)
-!IF !EXIST($(XERCES_SRC))
-XERCES_SRC = $(XERCES_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LIBXML_SRC = $(LIBXML_BINPATH)\$(INTDIR)
-!IF !EXIST($(LIBXML_SRC))
-LIBXML_SRC = $(LIBXML_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LIBXSLT_SRC = $(LIBXSLT_BINPATH)\$(INTDIR)
-!IF !EXIST($(LIBXSLT_SRC))
-LIBXSLT_SRC = $(LIBXSLT_BINPATH)\$(ALTDIR)
-!ENDIF
-
-VDB_SRC = $(VDB_BINPATH)
-
-
-
-#################################################################
-
-INSTALL_CMD = \
-	@if exist "$*" ( for %%e in ($(EXTENSIONS)) do @( \
-	    if exist "$*\*.%%e" ( \
-	      for /f "delims=" %%i in ('dir /a-d/b "$*\*.%%e"') do @( \
-	        xcopy /Y /D /F "$*\%%i" "$(INSTALL_BINPATH)" ) \
-	    )) \
-	) else (echo WARNING:   "$*" not found)
-
-CLEAN_CMD = \
-	@if exist "$*" ( for %%e in ($(EXTENSIONS)) do @( \
-	    if exist "$*\*.%%e" ( \
-	      for /f "delims=" %%i in ('dir /a-d/b "$*\*.%%e"') do @( \
-	        if exist "$(INSTALL_BINPATH)\%%i" ( \
-	          echo $(INSTALL_BINPATH)\%%i & del /F "$(INSTALL_BINPATH)\%%i" )))) \
-	) else (echo WARNING:   "$*" not found)
-
-
-
-#################################################################
-# Targets
-#
-
-$(BERKELEYDB_SRC).berkeleydb_install :
-	@echo ---- & echo Copying BerkeleyDB DLLs & $(INSTALL_CMD)
-$(BERKELEYDB_SRC).berkeleydb_clean :
-	@echo ---- & echo Deleting BerkeleyDB DLLs & $(CLEAN_CMD)
-install_berkeleydb : $(BERKELEYDB_SRC).berkeleydb_install
-clean_berkeleydb : $(BERKELEYDB_SRC).berkeleydb_clean
-
-
-
-$(GNUTLS_SRC).gnutls_install :
-	@echo ---- & echo Copying GNUTLS DLLs & $(INSTALL_CMD)
-$(GNUTLS_SRC).gnutls_clean :
-	@echo ---- & echo Deleting GNUTLS DLLs & $(CLEAN_CMD)
-install_gnutls : $(GNUTLS_SRC).gnutls_install
-clean_gnutls : $(GNUTLS_SRC).gnutls_clean
-
-
-
-$(GLEW_SRC).glew_install :
-	@echo ---- & echo Copying GLEW DLLs & $(INSTALL_CMD)
-$(GLEW_SRC).glew_clean :
-	@echo ---- & echo Deleting GLEW DLLs & $(CLEAN_CMD)
-install_glew : $(GLEW_SRC).glew_install
-clean_glew : $(GLEW_SRC).glew_clean
-
-
-
-$(LZO_SRC).lzo_install :
-	@echo ---- & echo Copying LZO DLLs & $(INSTALL_CMD)
-$(LZO_SRC).lzo_clean :
-	@echo ---- & echo Deleting LZO DLLs & $(CLEAN_CMD)
-install_lzo : $(LZO_SRC).lzo_install
-clean_lzo : $(LZO_SRC).lzo_clean
-
-
-
-$(MYSQL_SRC).mysql_install :
-	@echo ---- & echo Copying MySQL DLLs & $(INSTALL_CMD)
-$(MYSQL_SRC).mysql_clean :
-	@echo ---- & echo Deleting MySQL DLLs & $(CLEAN_CMD)
-install_mysql : $(MYSQL_SRC).mysql_install
-clean_mysql : $(MYSQL_SRC).mysql_clean
-
-
-
-$(MSSQL_SRC).mssql_install :
-	@echo ---- & echo Copying MSSQL DLLs & $(INSTALL_CMD)
-$(MSSQL_SRC).mssql_clean :
-	@echo ---- & echo Deleting MSSQL DLLs & $(CLEAN_CMD)
-install_mssql : $(MSSQL_SRC).mssql_install
-clean_mssql : $(MSSQL_SRC).mssql_clean
-
-
-
-$(OPENSSL_SRC).openssl_install :
-	@echo ---- & echo Copying OpenSSL DLLs & $(INSTALL_CMD)
-$(OPENSSL_SRC).openssl_clean :
-	@echo ---- & echo Deleting OpenSSL DLLs & $(CLEAN_CMD)
-install_openssl : $(OPENSSL_SRC).openssl_install
-clean_openssl : $(OPENSSL_SRC).openssl_clean
-
-
-
-$(SQLITE_SRC).sqlite_install :
-	@echo ---- & echo Copying SQLite DLLs & $(INSTALL_CMD)
-$(SQLITE_SRC).sqlite_clean :
-	@echo ---- & echo Deleting SQLite DLLs & $(CLEAN_CMD)
-install_sqlite : $(SQLITE_SRC).sqlite_install
-clean_sqlite : $(SQLITE_SRC).sqlite_clean
-
-
-
-$(SQLITE3_SRC).sqlite3_install :
-	@echo ---- & echo Copying SQLite3 DLLs & $(INSTALL_CMD)
-$(SQLITE3_SRC).sqlite3_clean :
-	@echo ---- & echo Deleting SQLite3 DLLs & $(CLEAN_CMD)
-install_sqlite3 : $(SQLITE3_SRC).sqlite3_install
-clean_sqlite3 : $(SQLITE3_SRC).sqlite3_clean
-
-
-
-$(SYBASE_SRC).sybase_install :
-	@echo ---- & echo Copying Sybase DLLs & $(INSTALL_CMD)
-$(SYBASE_SRC).sybase_clean :
-	@echo ---- & echo Deleting Sybase DLLs & $(CLEAN_CMD)
-install_sybase : $(SYBASE_SRC).sybase_install
-clean_sybase : $(SYBASE_SRC).sybase_clean
-
-
-
-$(WXWIDGETS_SRC).wxwidgets_install :
-	@echo ---- & echo Copying wxWidgets DLLs & $(INSTALL_CMD)
-$(WXWIDGETS_SRC).wxwidgets_clean :
-	@echo ---- & echo Deleting wxWidgets DLLs & $(CLEAN_CMD)
-install_wxwidgets : $(WXWIDGETS_SRC).wxwidgets_install
-clean_wxwidgets : $(WXWIDGETS_SRC).wxwidgets_clean
-
-
-
-$(WXWINDOWS_SRC).wxwindows_install :
-	@echo ---- & echo Copying wxWindows DLLs & $(INSTALL_CMD)
-$(WXWINDOWS_SRC).wxwindows_clean :
-	@echo ---- & echo Deleting wxWindows DLLs & $(CLEAN_CMD)
-install_wxwindows : $(WXWINDOWS_SRC).wxwindows_install
-clean_wxwindows : $(WXWINDOWS_SRC).wxwindows_clean
-
-
-
-$(XALAN_SRC).xalan_install :
-	@echo ---- & echo Copying Xalan DLLs & $(INSTALL_CMD)
-$(XALAN_SRC).xalan_clean :
-	@echo ---- & echo Deleting Xalan DLLs & $(CLEAN_CMD)
-install_xalan : $(XALAN_SRC).xalan_install
-clean_xalan : $(XALAN_SRC).xalan_clean
-
-
-
-$(XERCES_SRC).xerces_install :
-	@echo ---- & echo Copying Xerces DLLs & $(INSTALL_CMD)
-$(XERCES_SRC).xerces_clean :
-	@echo ---- & echo Deleting Xerces DLLs & $(CLEAN_CMD)
-install_xerces : $(XERCES_SRC).xerces_install
-clean_xerces : $(XERCES_SRC).xerces_clean
-
-
-
-$(LIBXML_SRC).libxml_install :
-	@echo ---- & echo Copying LIBXML DLLs & $(INSTALL_CMD)
-$(LIBXML_SRC).libxml_clean :
-	@echo ---- & echo Deleting LIBXML DLLs & $(CLEAN_CMD)
-install_libxml : $(LIBXML_SRC).libxml_install
-clean_libxml : $(LIBXML_SRC).libxml_clean
-
-
-
-$(LIBXSLT_SRC).libxslt_install :
-	@echo ---- & echo Copying LIBXSLT DLLs & $(INSTALL_CMD)
-$(LIBXSLT_SRC).libxslt_clean :
-	@echo ---- & echo Deleting LIBXSLT DLLs & $(CLEAN_CMD)
-install_libxslt : $(LIBXSLT_SRC).libxslt_install
-clean_libxslt : $(LIBXSLT_SRC).libxslt_clean
-
-
-VDB_ORIG = $(INSTALL_BINPATH)\ncbi-vdb-md.dll
-VDB_COPY = $(INSTALL_BINPATH)\ncbi-vdb-dll-md.dll
-$(VDB_SRC).vdb_install :
-	@echo ---- & echo Copying VDB DLLs & $(INSTALL_CMD)
-# The trailing * suppresses a spurious prompt, per
-# http://stackoverflow.com/a/26034267/1231
-	@if exist "$(VDB_ORIG)" xcopy /Y /D /F "$(VDB_ORIG)" "$(VDB_COPY)"*
-$(VDB_SRC).vdb_clean :
-	@echo ---- & echo Deleting VDB DLLs & $(CLEAN_CMD)
-	@if exist "$(VDB_COPY)" ( echo $(VDB_COPY) & del /f "$(VDB_COPY)" )
-install_vdb : $(VDB_SRC).vdb_install
-clean_vdb : $(VDB_SRC).vdb_clean
-
-
-
-# -----------------------------------------
-# MSVC RT DLLs are not included into 'all'
-
-msvc_install : dirs $(MSVCRT_SRC).msvc_install
-
-install_msvc : msvc_install
-msvc_clean : $(MSVCRT_SRC).msvc_clean
-clean_msvc : msvc_clean
-msvc_rebuild : msvc_clean msvc_install
-
-$(MSVCRT_SRC).msvc_install :
-	@echo ---- & echo Copying MSVC DLLs & $(INSTALL_CMD)
-$(MSVCRT_SRC).msvc_clean :
-	@echo ---- & echo Deleting MSVC DLLs & $(CLEAN_CMD)
-	
diff --git a/c++/compilers/msvc1000_prj/user/build/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/msvc1000_prj/user/build/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index 2ac33fb..0000000
--- a/c++/compilers/msvc1000_prj/user/build/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/msvc1000_prj/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index 8d84bd0..0000000
--- a/c++/compilers/msvc1000_prj/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>-CONFIGURE-DIALOG-</ProjectName>
-    <ProjectGuid>{EB043EAF-58D4-4179-AC32-538D9059BB8B}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/msvc1000_prj/user/build/UtilityProjects/configure._ b/c++/compilers/msvc1000_prj/user/build/UtilityProjects/configure._
deleted file mode 100644
index 7766ecc..0000000
--- a/c++/compilers/msvc1000_prj/user/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_user.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/user/build/UtilityProjects/configure_dialog._ b/c++/compilers/msvc1000_prj/user/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index a954163..0000000
--- a/c++/compilers/msvc1000_prj/user/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_user.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc1000_prj/user/build/ncbi_user.sln b/c++/compilers/msvc1000_prj/user/build/ncbi_user.sln
deleted file mode 100644
index cddde3e..0000000
--- a/c++/compilers/msvc1000_prj/user/build/ncbi_user.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{EB043EAF-58D4-4179-AC32-538D9059BB8B}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc900_prj/Makefile.WinMain.app.msvc b/c++/compilers/msvc900_prj/Makefile.WinMain.app.msvc
deleted file mode 100644
index 3ccfcd0..0000000
--- a/c++/compilers/msvc900_prj/Makefile.WinMain.app.msvc
+++ /dev/null
@@ -1,11 +0,0 @@
-[Rule]
-Priority  = 127
-
-
-[Linker]
-subSystem = 2
-
-
-[AddToProject]
-SourceFiles = ../../src/gui/winmain
-
diff --git a/c++/compilers/msvc900_prj/Makefile.wxWidgets.app.msvc b/c++/compilers/msvc900_prj/Makefile.wxWidgets.app.msvc
deleted file mode 100644
index 1f2ace2..0000000
--- a/c++/compilers/msvc900_prj/Makefile.wxWidgets.app.msvc
+++ /dev/null
@@ -1,11 +0,0 @@
-[Rule]
-Priority  = 127
-
-
-[Linker]
-subSystem = 2
-
-
-[AddToProject]
-; SourceFiles = ../../src/gui/winmain
-
diff --git a/c++/compilers/msvc900_prj/build.sh b/c++/compilers/msvc900_prj/build.sh
deleted file mode 100644
index 378b61c..0000000
--- a/c++/compilers/msvc900_prj/build.sh
+++ /dev/null
@@ -1,176 +0,0 @@
-#! /bin/sh
-# $Id: build.sh 304959 2011-06-17 18:01:50Z ivanov $
-# Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
-#
-# Build C++ Toolkit.
-
-
-########### Arguments
-
-script="$0"
-cfgs="${1:-DebugDLL ReleaseDLL}"
-arch="$2"
-
-
-########### Global variables
-
-build_trees='static dll'
-###sol_static="ncbi_cpp.sln"
-###sol_dll="ncbi_cpp_dll.sln"
-sol_static="ncbi_cpp.sln gui/ncbi_gui.sln"
-sol_dll="ncbi_cpp_dll.sln gui/ncbi_gui_dll.sln"
-timer="date +'%H:%M'"
-
-
-########## Functions
-
-error()
-{
-    echo "[`basename $script`] ERROR:  $1"
-    exit 1
-}
-
-generate_msvc8_error_check_file() {
-    cat <<-EOF >$1
-	/.*--* (Reb|B)uild( All | )started: Project:/ {
-	  expendable = ""
-	}
-
-	/^EXPENDABLE project/ {
-	  expendable = \$0
-	}
-
-	/(^| : |^The source )([fatal error]* [CDULNKPRJVT]*[0-9]*: |The .* are both configured to produce |Error executing )/ {
-	if (!expendable) {
-	  print \$0
-	  exit
-	  }
-	}
-	EOF
-}
-
-
-########## Main
-
-# Get build dir
-build_dir=`dirname $script`
-build_dir=`(cd "$build_dir"; pwd)`
-
-if [ ! -d $build_dir ] ; then
-    error "Build directory $build_dir not found"
-    exit 1
-fi
-cd $build_dir
-
-for cfg in $cfgs ; do
-    if [ $cfg = Release -o $cfg = Debug ] ; then
-       error "$cfg configuration is not buildable on this platform." 
-    fi
-done
-
-
-# Configuration to build configure
-cfg_configure='ReleaseDLL'
-out=".build.$$"
-
-# Get directory for build logfiles
-log_dir="$build_dir/../../logs"
-mkdir $log_dir >/dev/null 2>&1
-log_dir=`(cd "$log_dir"; pwd)`
-rm $log_dir/* >/dev/null 2>&1
-
-
-chmod +x $build_dir/build_exec.bat
-rm -f $build_dir/cfgs.log
-
-
-# Configure
-
-for tree in $build_trees ; do
-    if [ $tree = dll ] ; then
-        test $cfg_configure != ReleaseDLL -a $cfg_configure != DebugDLL  &&  continue  
-    fi
-    sols=`eval echo "$"sol_${tree}""`
-    for sol in $sols ; do
-        if test ! -f "$tree/build/$sol" ; then
-            echo "INFO: Solution not found, skipped."
-            continue
-        fi
-        alias=`echo $sol | sed -e 's|\\\\.*$||g' -e 's|_.*$||g'`
-        start=`eval $timer`
-        echo Start time: $start
-        echo "INFO: Configure \"$tree\\$alias\""
-        echo "Command line: " $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg_configure" "-CONFIGURE-" $out
-        $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg_configure" "-CONFIGURE-" $out >/dev/null
-        # Wait a bit to allow compiler to exit and flush logfile
-        sleep 20
-        status=$?
-        cat $out
-        cat $out >> ${log_dir}/${tree}_${cfg_configure}.log
-        echo "Build time: $start - `eval $timer`"
-        if [ $status -ne 0 ] ; then
-            echo "FAILED: Configure $tree\\build\\$sol, $cfg_configure"
-        fi
-        rm -f $out >/dev/null 2>&1
-        if [ $status -ne 0 ] ; then
-            exit 3
-        fi
-    done
-done
-
-
-# Generate errors check script
-
-check_awk=$build_dir/build_check.awk
-generate_msvc8_error_check_file $check_awk
-
-
-# Build
-
-for tree in $build_trees ; do
-    for cfg in $cfgs ; do
-        if [ $tree = dll ] ; then
-            test $cfg != ReleaseDLL -a $cfg != DebugDLL  &&  continue  
-        fi
-        sols=`eval echo "$"sol_${tree}""`
-        for sol in $sols ; do
-            if test ! -f "$tree/build/$sol" ; then
-                echo "INFO: Solution not found, skipped."
-                continue
-            fi
-            alias=`echo $sol | sed -e 's|\\\\.*$||g' -e 's|_.*$||g'`
-            start=`eval $timer`
-            echo Start time: $start
-            echo "$tree,$sol,$cfg" >> $build_dir/cfgs.log
-            echo "INFO: Building \"$tree\\$cfg\\$alias\""
-            echo "Command line: " $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg" "-BUILD-ALL-" $out
-            $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg" "-BUILD-ALL-" $out >/dev/null
-            status=$?
-            # Wait a bit to allow compiler to exit and flush logfile
-            sleep 20
-            cat $out
-            cat $out >> ${log_dir}/${tree}_${cfg}.log
-            echo "Build time: $start - `eval $timer`"
-            if [ $status -ne 0 ] ; then
-                # Check on errors (skip expendable projects)
-                failed="1"
-                grep '^==* Build: .* succeeded, .* failed' $out >/dev/null 2>&1  && \
-                    awk -f $check_awk $out >$out.res 2>/dev/null  &&  test ! -s $out.res  &&  failed="0"
-                if [ "$failed" = "1" ]; then
-                    echo "FAILED: Build $tree\\build\\$sol, $cfg"
-                    echo "FAILED: Build $tree\\build\\$sol, $cfg" > failed.build.log
-                    echo     >> failed.build.log
-                    cat $out >> failed.build.log
-                    cat $tree/build/${sol}_watchers.txt > failed.watchers.log
-                fi
-                rm -f $out $out.res >/dev/null 2>&1
-                if [ "$failed" = "1" ]; then
-                    exit 4
-                fi
-            fi
-            rm -f $out >/dev/null 2>&1
-        done
-    done
-done
-
-exit 0
diff --git a/c++/compilers/msvc900_prj/build_exec.bat b/c++/compilers/msvc900_prj/build_exec.bat
deleted file mode 100644
index 8ef8d53..0000000
--- a/c++/compilers/msvc900_prj/build_exec.bat
+++ /dev/null
@@ -1,50 +0,0 @@
- at ECHO OFF
-REM $Id: build_exec.bat 155861 2009-03-26 19:33:46Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Auxiliary script for build.sh to run C++ build for specified project
-REM and configuration. Cygwin cannot run devenv directly inside shell-script.
-REM
-REM ===========================================================================
-
-call msvcvars.bat
-
-if _%1% == _  goto be_abort
-goto be_build
-
-:be_abort
-rem You should specify logfile or you will not see an output
-echo Usage: "%0 <solution> <command> <arch> <cfg> <target> <logfile>"
-exit 1
-
-:be_build
-set arch=Win32
-if _%3_ == _64_ set arch=x64
-
-rem Next command should be executed last! No other code after it, please.
-
-%DEVENV% %1 /%2 "%4|%arch%" /project "%5" /out "%6"
diff --git a/c++/compilers/msvc900_prj/check.sh b/c++/compilers/msvc900_prj/check.sh
deleted file mode 100644
index 2c5f107..0000000
--- a/c++/compilers/msvc900_prj/check.sh
+++ /dev/null
@@ -1,145 +0,0 @@
-#! /bin/sh
-# $Id: check.sh 150030 2009-01-21 15:01:59Z ivanov $
-# Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
-#
-# Check C++ Toolkit in all previously built configurations
-# (see 'cfgs.log', generated with 'build.sh' script).
-#
-# USAGE:
-#     check.sh {run | concat | concat_err | concat_cfg | load_to_db}
-#
-# Use 'run' command first, than use other commands.
-# For 'concat_cfg' -- use 'run', 'concat' and 'concat_err' commands first.
-
-
-########### Arguments
-
-script="$0"
-method="$1"
-
-
-########## Functions
-
-error()
-{
-    echo "[`basename $script`] ERROR:  $1"
-    exit 1
-}
-
-
-########## Main
-
-errcode=0
-
-# Get build directory
-build_dir=`dirname $script`
-build_dir=`(cd "$build_dir"; pwd)`
-
-if [ ! -d $build_dir ] ; then
-    error "Build directory $build_dir not found"
-fi
-cd $build_dir  ||  error "Cannot change directory"
-
-res_log="$build_dir/check.sh.log"
-res_concat="$build_dir/check.sh.out"
-res_concat_err="$build_dir/check.sh.out_err"
-
-cfgs="`cat cfgs.log`"
-if [ -z "$cfgs" ] ; then
-    error "Build some configurations first"
-fi
-
-# Initialization
-
-case "$method" in
-    run )
-        rm -f "$res_log"
-        rm -f "$build_dir/check.sh.*.log" > /dev/null 2>&1
-        # Init checks
-        $build_dir/../../scripts/common/check/check_make_win_cfg.sh init  || \
-            error "Check initialization failed"
-        ;;
-    clean )
-        # not implemented, 'clean' method is not used on Windows 
-        exit 0
-        ;;
-    concat )
-        cp $res_log $res_concat
-        ;;
-    concat_err )
-        egrep 'ERR \[|TO  -' $res_log > $res_concat_err
-        ;;
-    concat_cfg )
-        #rm -f "$build_dir/check.sh.*.out"     > /dev/null 2>&1
-        rm -f "$build_dir/check.sh.*.out_err" > /dev/null 2>&1
-        ;;
-    load_to_db )
-        ;;
-    * )
-        error "Invalid method name"
-        ;;
-esac
-
-
-# Run checks for each previously built configuration
-
-for cfg in $cfgs ; do
-    if [ -z "$cfg" ] ; then
-        error "Unknown configuration name"
-    fi
-    x_tree=`echo $cfg | sed -e 's/,.*$//'`
-    x_sol=`echo $cfg | sed -e 's/^[^,]*,//' -e 's/,.*$//' -e 's/\.sln//' -e 's|\\\|/|g'`
-    x_cfg=`echo $cfg | sed -e 's/^.*,//'`
-    echo CHECK_$method: $x_tree/$x_sol/$x_cfg
-
-    cd $build_dir
-    check_dir="$x_tree/build/${x_sol}.check/$x_cfg"
-    if [ ! -d "$check_dir" ] ; then
-        error "Check directory \"$check_dir\" not found"
-    fi
-    if test "$method" != "run"; then
-        test -x "$check_dir/check.sh"  ||  error "Run checks first. $check_dir/check.sh not found."
-    fi
-
-    # Action
-    
-    case "$method" in
-        run )
-            ../../scripts/common/check/check_make_win_cfg.sh create "$x_sol" "$x_tree" "$x_cfg"  || \
-                error "Creating check script for \"$check_dir\" failed"
-            $check_dir/check.sh run  ||  errcode=$?
-            cat $check_dir/check.sh.log >> $res_log
-            cat $check_dir/check.sh.log >> $build_dir/check.sh.${x_tree}_${x_cfg}.log
-            ;;
-        concat )
-            $check_dir/check.sh concat
-            cat $check_dir/check.sh.out >> $res_concat
-            ;;
-        concat_err )
-            $check_dir/check.sh concat_err
-            cat $check_dir/check.sh.out_err >> $res_concat_err
-            ;;
-        concat_cfg )
-            # Copy log entries
-            egrep 'ERR \[|TO  -' $check_dir/check.sh.log >> $build_dir/check.sh.${x_tree}_${x_cfg}.out_err
-            # see below copying of failed tests outputs
-            ;;
-        load_to_db )
-            $check_dir/check.sh load_to_db
-            ;;
-    esac
-done
-
-if test "$method" = "concat_cfg"; then
-    for cfg in $cfgs ; do
-        x_tree=`echo $cfg | sed -e 's/,.*$//'`
-        x_sol=`echo $cfg | sed -e 's/^[^,]*,//' -e 's/,.*$//' -e 's/\.sln//' -e 's|\\\|/|g'`
-        x_cfg=`echo $cfg | sed -e 's/^.*,//'`
-        cd $build_dir
-        check_dir="$x_tree/build/${x_sol}.check/$x_cfg"
-       #cat $check_dir/check.sh.out     >> $build_dir/check.sh.${x_tree}_${x_cfg}.out
-        cat $check_dir/check.sh.out_err >> $build_dir/check.sh.${x_tree}_${x_cfg}.out_err
-    done
-fi
-
-exit $errcode
diff --git a/c++/compilers/msvc900_prj/configure.bat b/c++/compilers/msvc900_prj/configure.bat
deleted file mode 100644
index 21e425a..0000000
--- a/c++/compilers/msvc900_prj/configure.bat
+++ /dev/null
@@ -1,393 +0,0 @@
- at echo off
-REM $Id: configure.bat 381093 2012-11-19 16:57:46Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Configure MSVC solution and projects
-REM
-REM ===========================================================================
-
-setlocal
-
-set sln_name=ncbi_cpp
-set use_projectlst=scripts/projects/ncbi_cpp.lst
-
-set use_savedcfg=
-set use_gui=no
-set maybe_gui=yes
-set use_debug=yes
-set use_dll=no
-set use_64=no
-set use_staticstd=no
-set use_arch=Win32
-set use_ide=900
-set use_flags=
-set help_req=no
-set srcroot=../..
-
-REM -----------------------------------------------------------------------------
-REM  silently ignored  options
-set noops=
-set noops=%noops% --without-optimization
-set noops=%noops% --with-profiling
-set noops=%noops% --with-tcheck
-set noops=%noops% --with-static
-set noops=%noops% --with-plugin-auto-load
-set noops=%noops% --with-bin-release
-set noops=%noops% --with-mt
-set noops=%noops% --without-exe
-set noops=%noops% --with-runpath
-set noops=%noops% --with-lfs
-set noops=%noops% --with-autodep
-set noops=%noops% --with-build-root
-set noops=%noops% --with-fake-root
-set noops=%noops% --without-suffix
-set noops=%noops% --with-hostspec
-set noops=%noops% --without-version
-set noops=%noops% --with-build-root-sfx
-set noops=%noops% --without-execopy
-set noops=%noops% --with-bincopy
-set noops=%noops% --with-lib-rebuilds
-set noops=%noops% --with-lib-rebuilds
-set noops=%noops% --without-deactivation
-set noops=%noops% --without-makefile-auto-update
-set noops=%noops% --without-flat-makefile
-set noops=%noops% --with-check
-set noops=%noops% --with-check-tools
-set noops=%noops% --with-ncbi-public
-set noops=%noops% --with-strip
-set noops=%noops% --with-pch
-set noops=%noops% --with-caution
-set noops=%noops% --without-caution
-set noops=%noops% --without-ccache
-set noops=%noops% --with-distcc
-set noops=%noops% --without-ncbi-c
-set noops=%noops% --without-sss
-set noops=%noops% --without-utils
-set noops=%noops% --without-sssdb
-set noops=%noops% --with-included-sss
-set noops=%noops% --with-z
-set noops=%noops% --without-z
-set noops=%noops% --with-bz2
-set noops=%noops% --without-bz2
-set noops=%noops% --with-lzo
-set noops=%noops% --without-lzo
-set noops=%noops% --with-pcre
-set noops=%noops% --without-pcre
-set noops=%noops% --with-gnutls
-set noops=%noops% --without-gnutls
-set noops=%noops% --with-openssl
-set noops=%noops% --without-openssl
-set noops=%noops% --without-sybase
-set noops=%noops% --with-sybase-local
-set noops=%noops% --with-sybase-new
-set noops=%noops% --without-ftds
-set noops=%noops% --with-ftds
-set noops=%noops% --without-ftds-renamed
-set noops=%noops% --without-mysql
-set noops=%noops% --with-mysql
-set noops=%noops% --without-opengl
-set noops=%noops% --with-opengl
-set noops=%noops% --without-mesa
-set noops=%noops% --with-mesa
-set noops=%noops% --without-glut
-set noops=%noops% --with-glut
-set noops=%noops% --without-wxwin
-set noops=%noops% --with-wxwin
-set noops=%noops% --without-wxwidgets
-set noops=%noops% --with-wxwidgets
-set noops=%noops% --with-wxwidgets-ucs
-set noops=%noops% --without-wxwidgets-ucs
-set noops=%noops% --without-freetype
-set noops=%noops% --with-freetype
-set noops=%noops% --without-fastcgi
-set noops=%noops% --with-fastcgi
-set noops=%noops% --with-fastcgi
-set noops=%noops% --without-bdb
-set noops=%noops% --with-bdb
-set noops=%noops% --without-sp
-set noops=%noops% --without-orbacus
-set noops=%noops% --with-orbacus
-set noops=%noops% --with-odbc
-set noops=%noops% --with-python
-set noops=%noops% --without-python
-set noops=%noops% --with-boost
-set noops=%noops% --without-boost
-set noops=%noops% --with-boost-tag
-set noops=%noops% --without-boost-tag
-set noops=%noops% --with-sqlite
-set noops=%noops% --without-sqlite
-set noops=%noops% --with-sqlite3
-set noops=%noops% --without-sqlite3
-set noops=%noops% --with-icu
-set noops=%noops% --without-icu
-set noops=%noops% --with-expat
-set noops=%noops% --without-expat
-set noops=%noops% --with-sablot
-set noops=%noops% --without-sablot
-set noops=%noops% --with-libxml
-set noops=%noops% --without-libxml
-set noops=%noops% --with-libxslt
-set noops=%noops% --without-libxslt
-set noops=%noops% --with-xerces
-set noops=%noops% --without-xerces
-set noops=%noops% --with-xalan
-set noops=%noops% --without-xalan
-set noops=%noops% --with-oechem
-set noops=%noops% --without-oechem
-set noops=%noops% --with-sge
-set noops=%noops% --without-sge
-set noops=%noops% --with-muparser
-set noops=%noops% --without-muparser
-set noops=%noops% --with-hdf5
-set noops=%noops% --without-hdf5
-set noops=%noops% --with-gif
-set noops=%noops% --without-gif
-set noops=%noops% --with-jpeg
-set noops=%noops% --without-jpeg \
-set noops=%noops% --with-png
-set noops=%noops% --without-png
-set noops=%noops% --with-tiff
-set noops=%noops% --without-tiff
-set noops=%noops% --with-xpm
-set noops=%noops% --without-xpm
-set noops=%noops% --without-local-lbsm
-set noops=%noops% --without-ncbi-crypt
-set noops=%noops% --without-connext
-set noops=%noops% --without-serial
-set noops=%noops% --without-objects
-set noops=%noops% --without-dbapi
-set noops=%noops% --without-app
-set noops=%noops% --without-ctools
-set noops=%noops% --without-gui
-set noops=%noops% --without-algo
-set noops=%noops% --without-internal
-set noops=%noops% --with-gbench
-set noops=%noops% --without-gbench
-set noops=%noops% --with-x
-
-
-set initial_dir=%CD%
-set script_name=%0
-cd %~p0
-for /f "delims=" %%a in ('cd') do (set script_dir=%%a)
-cd %srcroot%
-for /f "delims=" %%a in ('cd') do (set srcroot=%%a)
-cd %initial_dir%
-
-REM --------------------------------------------------------------------------------
-REM parse arguments
-
-set unknown=
-set ignore_unknown=no
-set dest=
-:PARSEARGS
-if "%1"=="" goto ENDPARSEARGS
-if "%dest%"=="lst"                      (set use_projectlst=%1&  set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="cfg"                      (set use_savedcfg=%~1&   set dest=& goto CONTINUEPARSEARGS)
-if "%1"=="--help"                       (set help_req=yes&       goto CONTINUEPARSEARGS)
-if "%1"=="--with-configure-dialog"      (set use_gui=yes&        goto CONTINUEPARSEARGS)
-if "%1"=="--without-configure-dialog"   (set use_gui=no&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-saved-settings"        (set dest=cfg&           goto CONTINUEPARSEARGS)
-if "%1"=="--without-debug"              (set use_debug=no&       goto CONTINUEPARSEARGS)
-if "%1"=="--with-debug"                 (set use_debug=yes&      goto CONTINUEPARSEARGS)
-if "%1"=="--without-dll"                (set use_dll=no&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-dll"                   (set use_dll=yes&        goto CONTINUEPARSEARGS)
-if "%1"=="--with-64"                    (set use_64=yes&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-static-exe"            (set use_staticstd=yes&  goto CONTINUEPARSEARGS)
-if "%1"=="--with-projects"              (set dest=lst&           goto CONTINUEPARSEARGS)
-if "%1"=="--ignore-unsupported-options" (set ignore_unknown=yes& goto CONTINUEPARSEARGS)
-set unknown=%unknown% %1
-:CONTINUEPARSEARGS
-set maybe_gui=no
-shift
-goto PARSEARGS
-:ENDPARSEARGS
-if "%maybe_gui%"=="yes" (
-  set use_gui=yes
-)
-
-REM --------------------------------------------------------------------------------
-REM check and report unknown options
-
-set invalid_unknown=no
-for %%u in (%unknown%) do (
-  call :CHECKUNKNOWN %%u
-)
-if "%invalid_unknown%"=="yes" exit /b 1
-goto DONEUNKNOWN
-
-:CHECKUNKNOWN
-for %%n in (%noops%) do (
-  if "%1"=="%%n" (
-    echo Ignored:  %1
-    goto :eof
-  )
-)
-for /f "eol=-" %%a in ('echo %1') do goto :eof
-if "%ignore_unknown%"=="no" (
-  echo Unsupported option:  %1
-  set invalid_unknown=yes
-) else (
-  echo Ignored unsupported:  %1
-)
-goto :eof
-:DONEUNKNOWN
-
-REM --------------------------------------------------------------------------------
-REM print usage
-
-:PRINTUSAGE
-if "%help_req%"=="yes" (
-  echo  USAGE:
-  echo    %script_name% [OPTION]...
-  echo  SYNOPSIS:
-  echo    configure NCBI C++ toolkit for MSVC build system.
-  echo  OPTIONS:
-  echo    --help                      -- print Usage
-  echo    --with-configure-dialog     -- use Configuration GUI application
-  echo    --without-configure-dialog  -- do not use Configuration GUI application
-  echo    --with-saved-settings=FILE  -- load configuration settings from FILE
-  echo    --without-debug             -- build non-debug versions of libs and apps
-  echo    --with-debug                -- build debug versions of libs and apps
-  echo    --without-dll               -- build all toolkit libraries as static ones
-  echo    --with-dll                  -- assemble toolkit libraries into DLLs
-  echo                                     where requested
-  echo    --with-64                   -- compile to 64-bit code
-  echo    --with-static-exe           -- use static C++ standard libraries
-  echo    --with-projects=FILE        -- build projects listed in "%srcroot%\FILE"
-  echo             FILE can also be a name of a subdirectory
-  echo             examples:   --with-projects=src/corelib
-  echo                         --with-projects=scripts/projects/ncbi_cpp.lst
-  echo    --ignore-unsupported-options   -- ignore unsupported options
-  exit /b 0
-)
-
-REM --------------------------------------------------------------------------------
-REM identify target MSVC version (based on the script location msvcNNN_prj)
-
-for /f "delims=" %%a in ('echo %script_dir%') do (set msvc_ver=%%~na)
-set msvc_ver=%msvc_ver:msvc=%
-set msvc_ver=%msvc_ver:_prj=%
-if not "%msvc_ver%"=="" (set use_ide=%msvc_ver%)
-
-REM --------------------------------------------------------------------------------
-REM target architecture, solution path, configuration and flags
-
-if "%use_64%"=="yes" (
-  set use_arch=x64
-) else (
-  set use_arch=Win32
-)
-if "%use_dll%"=="yes" (
-  if "%use_debug%"=="yes" (
-    set CONFIGURATION=DebugDLL
-  ) else (
-    set CONFIGURATION=ReleaseDLL
-  )
-) else (
-  if "%use_debug%"=="yes" (
-    if "%use_staticstd%"=="yes" (
-      set CONFIGURATION=DebugMT
-    ) else (
-      set CONFIGURATION=DebugDLL
-    )
-  ) else (
-    if "%use_staticstd%"=="yes" (
-      set CONFIGURATION=ReleaseMT
-    ) else (
-      set CONFIGURATION=ReleaseDLL
-    )
-  )
-)
-if "%use_gui%"=="yes" (
-  set use_flags=%use_flags% -cfg
-)
-if "%use_dll%"=="yes" (
-  set build_results=dll
-  set sln_name=%sln_name%_dll
-  set use_flags=%use_flags% -dll
-) else (
-  set build_results=static
-)
-set use_projectlst=%use_projectlst:/=\%
-
-
-REM --------------------------------------------------------------------------------
-REM prepare and run ptb.bat
-cd %script_dir%
-set PTB_PLATFORM=%use_arch%
-set PTB_FLAGS=%use_flags%
-set PTB_PATH=./static/bin/ReleaseDLL
-set SLN_PATH=%script_dir%\%build_results%\build\%sln_name%.sln
-set TREE_ROOT=%srcroot%
-set BUILD_TREE_ROOT=.
-set PTB_PROJECT_REQ=%use_projectlst%
-
-if "%use_savedcfg%"=="" (
-  set PTB_SAVED_CFG_REQ=
-) else (
-  if exist "%use_savedcfg%" (
-    set PTB_SAVED_CFG_REQ="%use_savedcfg%"
-  ) else (
-    if exist "%initial_dir%\%use_savedcfg%" (
-      set PTB_SAVED_CFG_REQ="%initial_dir%\%use_savedcfg%"
-    ) else (
-      echo ERROR: "%use_savedcfg%" not found
-      exit /b 1
-    )
-  )
-)
-
-call ./ptb.bat
-if errorlevel 1 (
-  cd %initial_dir%
-  exit /b 1
-)
-
-REM --------------------------------------------------------------------------------
-REM generate configure_make.bat
-
-cd %script_dir%
-set mk_cmnd=make.bat build %sln_name% %build_results%
-if "%use_64%"=="yes" (
-  set mk_cmnd=%mk_cmnd% 64
-) else (
-  set mk_cmnd=%mk_cmnd% 32
-)
-set mk_cmnd=%mk_cmnd% %CONFIGURATION%
-echo %mk_cmnd% > configure_make.bat
-
-
-REM ------------------------------------------------------------------------------
-echo To build the solution %SLN_PATH%
-echo execute the following commands:
-echo cd %script_dir%
-echo make
-
-cd %initial_dir%
-endlocal
-exit /b 0
diff --git a/c++/compilers/msvc900_prj/datatool.bat b/c++/compilers/msvc900_prj/datatool.bat
deleted file mode 100644
index d213b91..0000000
--- a/c++/compilers/msvc900_prj/datatool.bat
+++ /dev/null
@@ -1,133 +0,0 @@
- at echo off
-REM $Id: datatool.bat 192507 2010-05-25 13:34:33Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Run datatool.exe to generate sources from ASN/DTD/Schema specifications
-REM
-REM DO NOT ATTEMPT to run this bat file manually
-REM
-REM ===========================================================================
-
-set DEFDT_LOCATION=\\snowman\win-coremake\App\Ncbi\cppcore\datatool
-
-for %%v in ("%DATATOOL_PATH%" "%TREE_ROOT%" "%BUILD_TREE_ROOT%" "%PTB_PLATFORM%") do (
-  if %%v=="" (
-    echo ERROR: required environment variable is missing
-    echo DO NOT ATTEMPT to run this bat file manually
-    exit /b 1
-  )
-)
-set DEFDT_VERSION_FILE=%TREE_ROOT%\src\build-system\datatool_version.txt
-set PTB_SLN=%BUILD_TREE_ROOT%\static\build\UtilityProjects\PTB.sln
-set DT=datatool.exe
-
-call "%BUILD_TREE_ROOT%\msvcvars.bat"
-
-
-REM -------------------------------------------------------------------------
-REM get DT version: from DEFDT_VERSION_FILE  or from PREBUILT_DATATOOL_EXE
-
-set DEFDT_VERSION=
-if exist "%DEFDT_VERSION_FILE%" (
-  for /f %%a in ('type "%DEFDT_VERSION_FILE%"') do (set DEFDT_VERSION=%%a& goto donedf)
-  :donedf
-  set DEFDT_VERSION=%DEFDT_VERSION: =%
-)
-if exist "%PREBUILT_DATATOOL_EXE%" (
-  set ptbver=
-  for /f "tokens=2" %%a in ('"%PREBUILT_DATATOOL_EXE%" -version') do (set ptbver=%%a& goto donepb)
-  :donepb
-  set ptbver=%ptbver: =%
-  if not "%DEFDT_VERSION%"=="%ptbver%" (
-    echo WARNING: requested %DT% version %ptbver% does not match default one: %DEFDT_VERSION%
-    set DEFDT_VERSION=%ptbver%
-  )
-)
-
-if "%DEFDT_VERSION%"=="" (
-  echo ERROR: DEFDT_VERSION not specified
-  exit /b 1
-)
-for /f "tokens=1-3 delims=." %%a in ('echo %DEFDT_VERSION%') do (set DT_VER=%%a%%b%%c& set DT_VER_MAJOR=%%a)
-
-
-REM -------------------------------------------------------------------------
-REM Identify DATATOOL_EXE
-
-if "%PREBUILT_DATATOOL_EXE%"=="bootstrap" (
-  set DEF_DT=%DATATOOL_PATH%\%DT%
-) else if not "%PREBUILT_DATATOOL_EXE%"=="" (
-  if exist "%PREBUILT_DATATOOL_EXE%" (
-    set DEF_DT=%PREBUILT_DATATOOL_EXE%
-  ) else (
-    echo ERROR: "%PREBUILT_DATATOOL_EXE%" not found
-    exit /b 1
-  )
-) else (
-  set DEF_DT=%DEFDT_LOCATION%\msvc\%DEFDT_VERSION%\%DT%
-)
-if exist "%DEF_DT%" (
-  set DATATOOL_EXE=%DEF_DT%
-) else (
-  echo %DT% not found at %DEF_DT%
-  set DATATOOL_EXE=%DATATOOL_PATH%\%DT%
-)
-
-
-REM -------------------------------------------------------------------------
-REM Build DATATOOL_EXE if needed
-
-if not exist "%DATATOOL_EXE%" (
-  if exist "%PTB_SLN%" (
-    echo ******************************************************************************
-    echo Building %DT% locally, please wait
-    echo ******************************************************************************
-    @echo %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "datatool.exe"
-    %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "datatool.exe"
-  ) else (
-    echo ERROR: do not know how to build %DT%
-  )
-) else (
-  echo ******************************************************************************
-  echo Using PREBUILT %DT% at %DATATOOL_EXE%
-  echo ******************************************************************************
-)
-if not exist "%DATATOOL_EXE%" (
-  echo ERROR: "%DATATOOL_EXE%" not found
-  exit /b 1
-)
-"%DATATOOL_EXE%" -version
-if errorlevel 1 (
-  echo ERROR: cannot find working %DT%
-  exit /b 1
-)
-
-
-REM -------------------------------------------------------------------------
-REM Run DATATOOL_EXE
-
-"%DATATOOL_EXE%" %*
diff --git a/c++/compilers/msvc900_prj/dll/build/UtilityProjects/_CONFIGURE_.vcproj b/c++/compilers/msvc900_prj/dll/build/UtilityProjects/_CONFIGURE_.vcproj
deleted file mode 100644
index 0edc646..0000000
--- a/c++/compilers/msvc900_prj/dll/build/UtilityProjects/_CONFIGURE_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-"
-	ProjectGUID="{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Rel [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Rel [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Rel [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Rel [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj b/c++/compilers/msvc900_prj/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
deleted file mode 100644
index 535abc0..0000000
--- a/c++/compilers/msvc900_prj/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-DIALOG-"
-	ProjectGUID="{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure_dialog._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Rel [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Rel [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Rel [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Rel [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/UtilityProjects/configure._ b/c++/compilers/msvc900_prj/dll/build/UtilityProjects/configure._
deleted file mode 100644
index 7d4011f..0000000
--- a/c++/compilers/msvc900_prj/dll/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp_dll.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/dll/build/UtilityProjects/configure_dialog._ b/c++/compilers/msvc900_prj/dll/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index f4e04b9..0000000
--- a/c++/compilers/msvc900_prj/dll/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp_dll.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/dll/build/all.bat b/c++/compilers/msvc900_prj/dll/build/all.bat
deleted file mode 100644
index 024bd38..0000000
--- a/c++/compilers/msvc900_prj/dll/build/all.bat
+++ /dev/null
@@ -1,42 +0,0 @@
- at ECHO OFF
-REM $Id: all.bat 122037 2008-03-13 19:25:53Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Build all C++ Toolkit DLL projects
-REM
-REM ===========================================================================
-
-
-CALL all_ncbi.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gui.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gbench.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-:_ABORT_
\ No newline at end of file
diff --git a/c++/compilers/msvc900_prj/dll/build/all_gbench.bat b/c++/compilers/msvc900_prj/dll/build/all_gbench.bat
deleted file mode 100644
index d4f91e0..0000000
--- a/c++/compilers/msvc900_prj/dll/build/all_gbench.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_gbench.bat 122037 2008-03-13 19:25:53Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build GBENCH
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\gbench"
-msbuild gbench\ncbi_gbench.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\gbench\%CFG%"
-msbuild gbench\ncbi_gbench.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/msvc900_prj/dll/build/all_gui.bat b/c++/compilers/msvc900_prj/dll/build/all_gui.bat
deleted file mode 100644
index 29fa2fd..0000000
--- a/c++/compilers/msvc900_prj/dll/build/all_gui.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_gui.bat 122037 2008-03-13 19:25:53Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build C++ GUI libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\gui"
-msbuild gui\ncbi_gui_dll.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\gui\%CFG%"
-msbuild gui\ncbi_gui_dll.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/msvc900_prj/dll/build/all_ncbi.bat b/c++/compilers/msvc900_prj/dll/build/all_ncbi.bat
deleted file mode 100644
index 81a08c3..0000000
--- a/c++/compilers/msvc900_prj/dll/build/all_ncbi.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_ncbi.bat 122037 2008-03-13 19:25:53Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\ncbi"
-msbuild ncbi_cpp_dll.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\ncbi\%CFG%"
-msbuild ncbi_cpp_dll.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcproj b/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcproj
deleted file mode 100644
index eecc0d9..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-"
-	ProjectGUID="{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\sta [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\sta [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\sta [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\sta [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcproj b/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
deleted file mode 100644
index 3fdf037..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-DIALOG-"
-	ProjectGUID="{6DEFDB58-C014-4026-A166-299146BD9947}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure_dialog._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\sta [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\sta [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\sta [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\sta [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/configure._ b/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/configure._
deleted file mode 100644
index 6be17e9..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/configure._
+++ /dev/null
@@ -1,5 +0,0 @@
-set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=1
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gbench.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/configure_dialog._ b/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/configure_dialog._
deleted file mode 100644
index b6f1b6c..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gbench/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,5 +0,0 @@
-set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=1
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gbench.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/dll/build/gbench/gbench_install/gbench-install.vcproj b/c++/compilers/msvc900_prj/dll/build/gbench/gbench_install/gbench-install.vcproj
deleted file mode 100644
index 6aa3b13..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gbench/gbench_install/gbench-install.vcproj
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="gbench-install"
-	ProjectGUID="{6C23686B-1522-4B44-8D48-7E3176C36247}"
-	RootNamespace="gbench-install"
-	Keyword="MakeFileProj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-		<Platform
-			Name="x64"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="DebugDLL"
-			IntermediateDirectory="DebugDLL"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="DebugDLL"
-			IntermediateDirectory="DebugDLL"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="ReleaseDLL"
-			IntermediateDirectory="ReleaseDLL"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="ReleaseDLL"
-			IntermediateDirectory="ReleaseDLL"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-	        <Configuration
-			Name="Unicode_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak">
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/gbench/ncbi_gbench.sln b/c++/compilers/msvc900_prj/dll/build/gbench/ncbi_gbench.sln
deleted file mode 100644
index 0c6422d..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gbench/ncbi_gbench.sln
+++ /dev/null
@@ -1,39 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcproj", "{6DEFDB58-C014-4026-A166-299146BD9947}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/_CONFIGURE_.vcproj b/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/_CONFIGURE_.vcproj
deleted file mode 100644
index 13a77d7..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/_CONFIGURE_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-"
-	ProjectGUID="{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\st [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\st [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\st [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\st [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcproj b/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
deleted file mode 100644
index 452a5d6..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-DIALOG-"
-	ProjectGUID="{9BAE6EEC-8C80-44F0-84A9-3379631A8654}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure_dialog._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\st [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\st [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\st [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\st [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/configure._ b/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/configure._
deleted file mode 100644
index b86cc7e..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/configure_dialog._ b/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/configure_dialog._
deleted file mode 100644
index 78a9181..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gui/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/dll/build/gui/ncbi_gui_dll.sln b/c++/compilers/msvc900_prj/dll/build/gui/ncbi_gui_dll.sln
deleted file mode 100644
index 1e9a98e..0000000
--- a/c++/compilers/msvc900_prj/dll/build/gui/ncbi_gui_dll.sln
+++ /dev/null
@@ -1,39 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcproj", "{9BAE6EEC-8C80-44F0-84A9-3379631A8654}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc900_prj/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcproj b/c++/compilers/msvc900_prj/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcproj
deleted file mode 100644
index 18a0dfe..0000000
--- a/c++/compilers/msvc900_prj/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcproj
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="gbench-install-internal"
-	ProjectGUID="{6C23686B-1522-4B44-8D48-7E3176C36248}"
-	RootNamespace="gbench-install-internal"
-	Keyword="MakeFileProj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-		<Platform
-			Name="x64"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="DebugDLL"
-			IntermediateDirectory="DebugDLL"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install-internal.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="DebugDLL"
-			IntermediateDirectory="DebugDLL"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install-internal.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="ReleaseDLL"
-			IntermediateDirectory="ReleaseDLL"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install-internal.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="ReleaseDLL"
-			IntermediateDirectory="ReleaseDLL"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install-internal.exe"/>
-		</Configuration>
-	    <Configuration
-			Name="Unicode_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install-internal.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install-internal.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install-internal.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" all IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install-internal.exe"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak">
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/ncbi_cpp_dll.sln b/c++/compilers/msvc900_prj/dll/build/ncbi_cpp_dll.sln
deleted file mode 100644
index aad7bb4..0000000
--- a/c++/compilers/msvc900_prj/dll/build/ncbi_cpp_dll.sln
+++ /dev/null
@@ -1,39 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcproj", "{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/_CONFIGURE_.vcproj b/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/_CONFIGURE_.vcproj
deleted file mode 100644
index 7b400ac..0000000
--- a/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/_CONFIGURE_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-"
-	ProjectGUID="{467825A4-1505-460A-A977-31211AF70A34}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\wrappers.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\static [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\wrappers.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\static [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\wrappers.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\static [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\wrappers.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\static [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/_CONFIGURE_DIALOG_.vcproj b/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
deleted file mode 100644
index 3b626ab..0000000
--- a/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-DIALOG-"
-	ProjectGUID="{6DEFDB58-C014-4026-A166-299146BD9947}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure_dialog._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\wrappers.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\static [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\wrappers.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\static [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\wrappers.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\static [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\wrappers.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\..\static [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/configure._ b/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/configure._
deleted file mode 100644
index 2f6a367..0000000
--- a/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_wrap.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/configure_dialog._ b/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/configure_dialog._
deleted file mode 100644
index 8a1fe1d..0000000
--- a/c++/compilers/msvc900_prj/dll/build/wrappers/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_wrap.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/dll/build/wrappers/wrappers.sln b/c++/compilers/msvc900_prj/dll/build/wrappers/wrappers.sln
deleted file mode 100644
index 7dc31ce..0000000
--- a/c++/compilers/msvc900_prj/dll/build/wrappers/wrappers.sln
+++ /dev/null
@@ -1,27 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcproj", "{467825A4-1505-460A-A977-31211AF70A34}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{467825A4-1505-460A-A977-31211AF70A34}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{467825A4-1505-460A-A977-31211AF70A34}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{467825A4-1505-460A-A977-31211AF70A34}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{467825A4-1505-460A-A977-31211AF70A34}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{467825A4-1505-460A-A977-31211AF70A34}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{467825A4-1505-460A-A977-31211AF70A34}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{467825A4-1505-460A-A977-31211AF70A34}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{467825A4-1505-460A-A977-31211AF70A34}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc900_prj/dll/dll_main.cpp b/c++/compilers/msvc900_prj/dll/dll_main.cpp
deleted file mode 100644
index 7bd913f..0000000
--- a/c++/compilers/msvc900_prj/dll/dll_main.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include <ncbi_pch.hpp>
-
-#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-BOOL APIENTRY DllMain( HANDLE hModule, 
-                       DWORD  ul_reason_for_call, 
-                       LPVOID lpReserved
-					 )
-{
-    return TRUE;
-}
-
-
-
-
diff --git a/c++/compilers/msvc900_prj/dll/third_party_dll_install.mak b/c++/compilers/msvc900_prj/dll/third_party_dll_install.mak
deleted file mode 100644
index 61fc53f..0000000
--- a/c++/compilers/msvc900_prj/dll/third_party_dll_install.mak
+++ /dev/null
@@ -1,62 +0,0 @@
-# $Id: third_party_dll_install.mak 463528 2015-03-30 14:10:31Z ucko $
-#################################################################
-
-
-INSTALL          = .\bin
-INSTALL_BINPATH  = $(INSTALL)\$(INTDIR)
-THIRDPARTY_MAKEFILES_DIR =  .
-
-
-META_MAKE = $(THIRDPARTY_MAKEFILES_DIR)\..\third_party_install.meta.mk
-!IF EXIST($(META_MAKE))
-!INCLUDE $(META_MAKE)
-!ELSE
-!ERROR  $(META_MAKE)  not found
-!ENDIF
-
-THIRD_PARTY_LIBS = \
-	install_berkeleydb \
-	install_gnutls     \
-	install_glew       \
-	install_lzo        \
-	install_mssql      \
-	install_mysql      \
-	install_openssl    \
-	install_sqlite     \
-	install_sqlite3    \
-	install_sybase     \
-	install_wxwidgets  \
-	install_wxwindows  \
-	install_xalan      \
-	install_xerces     \
-	install_libxml     \
-	install_libxslt    \
-	install_vdb
-
-CLEAN_THIRD_PARTY_LIBS = \
-	clean_berkeleydb \
-	clean_gnutls     \
-	clean_glew       \
-	clean_lzo        \
-	clean_mssql      \
-	clean_mysql      \
-	clean_openssl    \
-	clean_sqlite     \
-	clean_sqlite3    \
-	clean_sybase     \
-	clean_wxwidgets  \
-	clean_wxwindows  \
-	clean_xalan      \
-	clean_xerces     \
-	clean_libxml     \
-	clean_libxslt    \
-	clean_vdb
-
-all : dirs $(THIRD_PARTY_LIBS)
-
-clean : $(CLEAN_THIRD_PARTY_LIBS)
-
-rebuild : clean all
-
-dirs :
-    @if not exist $(INSTALL_BINPATH) (echo Creating directory $(INSTALL_BINPATH)... & mkdir $(INSTALL_BINPATH))
diff --git a/c++/compilers/msvc900_prj/dll/third_party_dll_install.vcproj b/c++/compilers/msvc900_prj/dll/third_party_dll_install.vcproj
deleted file mode 100644
index 3c51a9a..0000000
--- a/c++/compilers/msvc900_prj/dll/third_party_dll_install.vcproj
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="third_party_dll_install"
-	ProjectGUID="{9E4B5381-9B6C-4867-BF8A-F1AAA1FD580F}"
-	Keyword="MakeFileProj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-		<Platform
-			Name="x64"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\third_party_dll_install.mak">
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/dll/third_party_msvcdll_install.vcproj b/c++/compilers/msvc900_prj/dll/third_party_msvcdll_install.vcproj
deleted file mode 100644
index 5e3e5ed..0000000
--- a/c++/compilers/msvc900_prj/dll/third_party_msvcdll_install.vcproj
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="third_party_msvcdll_install"
-	ProjectGUID="{9E4B5381-9B6C-4867-BF8A-F1AAA1FD581F}"
-	Keyword="MakeFileProj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-		<Platform
-			Name="x64"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_dll_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\third_party_dll_install.mak">
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/install.sh b/c++/compilers/msvc900_prj/install.sh
deleted file mode 100644
index 1188cfc..0000000
--- a/c++/compilers/msvc900_prj/install.sh
+++ /dev/null
@@ -1,175 +0,0 @@
-#! /bin/sh
-# $Id: install.sh 312890 2011-07-15 18:58:25Z ivanov $
-# Authors:  Denis Vakatov    (vakatov at ncbi.nlm.nih.gov)
-#           Anton Lavrentiev (lavr at ncbi.nlm.nih.gov)
-#
-# Deploy sources, headers, libraries and executables for the further use
-# by the "external" users' projects
-
-
-# Cmd.-line args  -- source and destination
-script="$0"
-builddir="$1"
-target="$2"
-compiler="${3:-msvc900}"
-compiler="${compiler}_prj"
-
-# Real number of argument is 2.
-# The 3th argument do not used here (32|64-bit architecture),
-# but is needed for master installation script.
-if test -n "$4" ; then
-  echo "USAGE:  `basename $script` [build_dir] [install_dir]"
-fi
-
-
-error()
-{
-  echo "[`basename $script`] ERROR:  $1"
-  exit 1
-}
-
-
-makedir()
-{
-  test -d "$1"  ||  mkdir $2 "$1"  ||  error "Cannot create \"$1\""
-}
-
-
-echo "[`basename $script`] NCBI C++:  \"$builddir\" to \"$target\"..."
-
-
-# Derive the destination dirs
-docdir="$target"/doc
-scriptdir="$target"/scripts
-incdir="$target"/include
-srcdir="$target"/src
-libdir="$target"/lib
-bindir="$target"/bin
-cldir="$target"/compilers
-logdir="$target"/logs
-tmpdir="$target"/tmp
-
-
-install()
-{
-    test -d "$1"  ||  return;
-    makedir "$2" -p
-    tmp_cwd=`pwd`
-    cd "$1"
-    find . -type f |
-    grep -v '/\.svn/' > "$tmpdir"/flist
-    tar cf - -T "$tmpdir"/flist | (cd "$2" ; tar xf - )
-    cd "$tmp_cwd"
-}
-
-
-
-# Check
-test -d "$builddir"  ||  error "Absent build dir \"$builddir\""
-
-
-# Reset the public directory
-test -d "$target"  &&  find "$target" -type f -exec rm -f {} \; >/dev/null 2>&1
-makedir "$target" -p
-makedir "$tmpdir" -p
-
-
-# Documentation
-echo "[`basename $script`] Installing documentation..."
-install "$builddir/doc" "$docdir"
-
-# Scripts
-echo "[`basename $script`] Installing scripts..."
-install "$builddir/scripts" "$scriptdir"
-
-# Include dir
-echo "[`basename $script`] Installing include files..."
-install "$builddir/include" "$incdir"
-
-# Source dir
-echo "[`basename $script`] Installing source files..."
-install "$builddir/src" "$srcdir"
-
-# Build logs
-echo "[`basename $script`] Installing build logs..."
-install "$builddir/logs" "$logdir"
-
-rm -rf "$tmpdir"
-
-
-# Libraries
-echo "[`basename $script`] Installing libraries..."
-for i in 'Debug' 'Release' ; do
-  for j in '' 'DLL' ; do
-    for b in 'static' 'dll' ; do
-
-      if test -d "$builddir"/compilers/$compiler/$b/lib/$i$j ; then
-        makedir "$libdir/$b/$i$j" -p
-        cd "$builddir"/compilers/$compiler/$b/lib/$i$j
-        cp -p *.lib "$libdir/$b/$i$j"
-      fi
-      if test "$b"=='dll' ; then
-        if test -d "$builddir"/compilers/$compiler/$b/bin/$i$j ; then
-          makedir "$libdir/$b/$i$j" -p
-          cd "$builddir"/compilers/$compiler/$b/bin/$i$j
-          cp -p *.lib *.dll *.exp "$libdir/$b/$i$j"
-        fi
-      fi
-    done
-  done
-done
-
-
-# Executables
-echo "[`basename $script`] Installing executables..."
-makedir "$bindir" -p
-for i in 'DLL' '' ; do
-  if test -d "$builddir"/compilers/$compiler/static/bin/Release$i ; then
-    cd "$builddir"/compilers/$compiler/static/bin/Release$i
-    if ls *.exe >/dev/null 2>&1 ; then
-      cp -p *.exe *.dll *.exp *.manifest "$bindir"
-      break
-    fi
-  fi
-done
-
-
-# Install additional files (scripts and etc) into binary directory
-cp -p "$builddir"/src/app/blast/legacy_blast.pl "$bindir"
-
-
-# Gbench public installation
-echo "[`basename $script`] Installing Gbench..."
-for i in ReleaseDLL DebugDLL; do
-  if test -d "$builddir"/compilers/$compiler/dll/bin/"$i" ; then
-    cp -pr "$builddir"/compilers/$compiler/dll/bin/$i/gbench "$bindir"
-    break
-  fi
-done
-
-
-# Compiler dir (copy all .pdb and configurable files files for debug purposes)
-echo "[`basename $script`] Installing .pdb files..."
-makedir "$cldir" -p
-pdb_files=`find "$builddir"/compilers -type f -a \( -name '*.pdb' -o  -name '*.c' -o  -name '*.cpp' \) 2>/dev/null`
-cd "$cldir"
-for pdb in $pdb_files ; do
-  rel_dir=`echo $pdb | sed -e "s|$builddir/compilers/||" -e 's|/[^/]*$||'`
-  makedir "$rel_dir" -p
-  cp -pr "$pdb" "$rel_dir"
-done
-
-# Compiler dir (other common stuff)
-makedir "$cldir"/$compiler/static -p
-makedir "$cldir"/$compiler/dll -p
-cp -p "$builddir"/compilers/$compiler/*        "$cldir"/$compiler
-cp -p "$builddir"/compilers/$compiler/static/* "$cldir"/$compiler/static
-cp -p "$builddir"/compilers/$compiler/dll/*    "$cldir"/$compiler/dll
-
-# Makefile.*.mk files
-find "$builddir/src" -type f -name 'Makefile.*.mk' -exec cp -pr {} "$srcdir"/build-system/ \;
-
-# Copy info files
-cp -p "$builddir"/*_info "$target"
-
-exit 0
diff --git a/c++/compilers/msvc900_prj/lock_ptb_config.bat b/c++/compilers/msvc900_prj/lock_ptb_config.bat
deleted file mode 100644
index c46c2d8..0000000
--- a/c++/compilers/msvc900_prj/lock_ptb_config.bat
+++ /dev/null
@@ -1,94 +0,0 @@
- at echo off
-REM $Id: lock_ptb_config.bat 122037 2008-03-13 19:25:53Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Check platform name and create a lock to prevent
-REM running more than one instance of project_tree_builder.exe at the same time.
-REM
-REM ===========================================================================
-
-set CFG_PLATFORM=__configured_platform
-set CFG_LIST=Win32 x64
-set PTB_RUNNING=__configure.lock
-
-if _%PTB_PLATFORM%==_ (
-  echo PTB_PLATFORM is undefined
-  goto return_error
-)
-if _%1%==_  goto report_usage
-if _%2%==_  goto report_usage
-set MSVC_PRJ=%~2%
-if %1%==ON  goto do_ON
-if %1%==OFF goto do_OFF
-
-
-:report_usage
-echo The script checks MSVC platform name and creates a lock to prevent
-echo running more than one -CONFIGURE- at the same time.
-echo Usage:
-echo    lock_ptb_config ON msvc_prj_folder, or
-echo    lock_ptb_config OFF msvc_prj_folder
-goto return_error
-
-:return_error
-exit /b 1
-
-:do_ON
-for %%c in ( %CFG_LIST% ) do (
-  if exist "%MSVC_PRJ%%CFG_PLATFORM%.%%c" (
-    if not %%c==%PTB_PLATFORM% (
-      echo ******************************************************************************
-      echo Requested platform %PTB_PLATFORM% does not match already configured %%c
-      echo If you believe it is not so, - delete '%MSVC_PRJ%%CFG_PLATFORM%.%%c' file
-      echo ******************************************************************************
-      goto return_error
-    )
-    goto do_ON_lock
-  )
-)
-echo %CFG_PLATFORM% > "%MSVC_PRJ%%CFG_PLATFORM%.%PTB_PLATFORM%"
-
-:do_ON_lock
-if exist "%MSVC_PRJ%%PTB_RUNNING%" (
-  echo ******************************************************************************
-  echo There is another CONFIGURE process running in this tree.
-  echo If you believe it is not so, - delete '%MSVC_PRJ%%PTB_RUNNING%' file
-  echo ******************************************************************************
-  goto return_error
-)
-echo ptb_running > "%MSVC_PRJ%%PTB_RUNNING%"
-goto done
-
-
-:do_OFF
-if exist "%MSVC_PRJ%%PTB_RUNNING%" (
-  del "%MSVC_PRJ%%PTB_RUNNING%"
-)
-goto done
-
-:done
-
diff --git a/c++/compilers/msvc900_prj/make.bat b/c++/compilers/msvc900_prj/make.bat
deleted file mode 100644
index a38982e..0000000
--- a/c++/compilers/msvc900_prj/make.bat
+++ /dev/null
@@ -1,192 +0,0 @@
- at ECHO OFF
-REM $Id: make.bat 179314 2009-12-23 15:50:21Z gouriano $
-REM ===========================================================================
-REM
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM
-REM  Please cite the author in any work or product based on this material.
-REM
-REM ===========================================================================
-REM
-REM Author:  Vladimir Ivanov
-REM
-REM Configure/build/check NCBI C++ tree in specified configuration(s)
-REM
-REM     make.bat <configure|build|make|check> <solution> <static|dll> <32|64> [cfgs..]
-REM
-REM     %1% - Configure, build, make (configure and build_ or check build tree.
-REM     %2% - Solution file name without extention (relative path from build directory).
-REM     %3% - Type of used libraries (static, dll).
-REM     %4% - 32/64-bits architerture.
-REM     %5% - Configuration name(s) (ALL, DebugDLL, ReleaseDLL).
-REM           By default build all possible configurations (ALL).
-REM
-REM ===========================================================================
-
-
-call msvcvars.bat > NUL
-
-SET CMD=%1%
-SET SOLUTION=%2%
-SET LIBDLL=%3%
-SET ARCH=%4%
-SET CFG=%5%
-
-SET COMPILER=msvc9
-IF _%SRV_NAME% == _ SET SRV_NAME=%COMPUTERNAME%
-
-IF _%CMD% == _      GOTO NOARGS
-IF _%SOLUTION% == _ GOTO USAGE
-IF _%LIBDLL% == _   GOTO USAGE
-IF _%ARCH% == _     GOTO USAGE
-IF _%CFG% == _      GOTO BUILDALL
-IF _%CFG% == _ALL   GOTO BUILDALL
-GOTO CHECKCMD
-
-:NOARGS
-if exist configure_make.bat (
-  configure_make.bat
-) else (
-  goto USAGE
-)
-
-:USAGE
-
-ECHO FATAL: Invalid parameters. See script description.
-ECHO FATAL: %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
-GOTO ABORT
-
-
-:BUILDALL
-
-CALL %0 %CMD% %SOLUTION% %LIBDLL% %ARCH% ReleaseDLL DebugDLL
-GOTO EXIT
-
-
-:CHECKCMD
-
-SET ARCHW=Win32
-if _%ARCH%_ == _64_ SET ARCHW=x64
-
-IF _%CMD% == _configure GOTO CONFIG
-IF _%CMD% == _make      GOTO CONFIG
-IF _%CMD% == _build     GOTO BUILD
-IF _%CMD% == _check     GOTO CHECK
-
-ECHO The following action names are recognized: configure, build, make, check.
-ECHO FATAL: Unknown action name %CMD%. Please correct.
-GOTO ABORT
-
-
-REM ###########################################################################
-:CONFIG
-
-IF %CFG% == DebugDLL   GOTO CONTCFG
-IF %CFG% == DebugMT    GOTO CONTCFG
-IF %CFG% == ReleaseDLL GOTO CONTCFG
-IF %CFG% == ReleaseMT  GOTO CONTCFG
-ECHO The following configuration names are recognized:
-ECHO     DebugDLL DebugMT ReleaseDLL ReleaseMT
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO ABORT
-:CONTCFG
-TIME /T
-ECHO INFO: Configure "%LIBDLL%\%SOLUTION% [ReleaseDLL|%ARCH%]"
-%DEVENV% %LIBDLL%\build\%SOLUTION%.sln /build "ReleaseDLL|%ARCHW%" /project "-CONFIGURE-"
-IF ERRORLEVEL 1 GOTO ABORT
-IF NOT _%CMD% == _make GOTO COMPLETE
-
-
-REM ###########################################################################
-:BUILD
-
-:ARGLOOPB
-IF %CFG% == DebugDLL   GOTO CONTBLD
-IF %CFG% == DebugMT    GOTO CONTBLD
-IF %CFG% == ReleaseDLL GOTO CONTBLD
-IF %CFG% == ReleaseMT  GOTO CONTBLD
-ECHO The following configuration names are recognized:
-ECHO     DebugDLL DebugMT ReleaseDLL ReleaseMT
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO ABORT
-:CONTBLD
-TIME /T
-ECHO INFO: Building "%LIBDLL%\%SOLUTION% [%CFG%|%ARCH%]"
-%DEVENV% %LIBDLL%\build\%SOLUTION%.sln /build "%CFG%|%ARCHW%" /project "-BUILD-ALL-"
-IF ERRORLEVEL 1 GOTO ABORT
-SHIFT
-IF _%5% == _ GOTO COMPLETE
-SET CFG=%5%
-GOTO ARGLOOPB
-
-
-REM ###########################################################################
-:CHECK
-
-ECHO INFO: Checking init
-bash -c "../../scripts/common/check/check_make_win_cfg.sh init; exit $?"
-SET ERRORLEV=0
-:ARGLOOPC
-IF %CFG% == DebugMT    GOTO CONTCH
-IF %CFG% == DebugDLL   GOTO CONTCH
-IF %CFG% == ReleaseMT  GOTO CONTCH
-IF %CFG% == ReleaseDLL GOTO CONTCH
-ECHO The following configuration names are recognized:
-ECHO     DebugDLL DebugMT ReleaseDLL ReleaseMT
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO ABORT
-:CONTCH
-ECHO INFO: Create check script for "%LIBDLL%\%SOLUTION% [%CFG%|%ARCH%]"
-bash -c "../../scripts/common/check/check_make_win_cfg.sh create %SOLUTION% %LIBDLL% %CFG%"; exit $?"
-IF ERRORLEVEL 1 GOTO ABORT
-ECHO INFO: Checking "%LIBDLL%\%SOLUTION% [%CFG%|%ARCH%]"
-SET CHECKSH=%LIBDLL%/build/%SOLUTION%.check/%CFG%/check.sh
-bash -c "%CHECKSH% run; exit $?"
-IF ERRORLEVEL 1 SET ERRORLEV=1
-bash -c "cp %CHECKSH%.journal check.sh.%LIBDLL%_%CFG%.journal; cp %CHECKSH%.log check.sh.%LIBDLL%_%CFG%.log"
-
-REM Load testsuite results into DB works only if NCBI_AUTOMATED_BUILD is set to 1
-IF .%NCBI_AUTOMATED_BUILD% == .1 GOTO LOADDB
-GOTO NOLOADDB
-:LOADDB
-bash -c "%CHECKSH% load_to_db; exit $?"
-IF ERRORLEVEL 1 SET ERRORLEV=1
-:NOLOADDB
-
-SHIFT
-IF _%5% == _ GOTO CHECKEND
-SET CFG=%5%
-GOTO ARGLOOPC
-:CHECKEND
-COPY /Y /B check.sh.*.journal check.sh.journal
-COPY /Y /B check.sh.*.log     check.sh.log
-IF %ERRORLEV%==0 GOTO COMPLETE
-
-
-REM ###########################################################################
-
-:ABORT
-ECHO INFO: %CMD% failed.
-EXIT /b 1
-
-:COMPLETE
-ECHO INFO: %CMD% complete.
-
-:EXIT
-EXIT /b %ERRORLEVEL%
diff --git a/c++/compilers/msvc900_prj/make_ncbi.bat b/c++/compilers/msvc900_prj/make_ncbi.bat
deleted file mode 100644
index ad0f6d9..0000000
--- a/c++/compilers/msvc900_prj/make_ncbi.bat
+++ /dev/null
@@ -1,51 +0,0 @@
- at ECHO OFF
-REM $Id: make_ncbi.bat 150030 2009-01-21 15:01:59Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Configure/build/check NCBI C++ core tree in specified configuration(s)
-REM
-REM     make_ncbi.bat <configure|build|make|check> <static|dll> <32|64> [cfgs..]
-REM
-REM     %1% - Configure, build, check or build and configure (make) build tree.
-REM     %2% - Type of used libraries (static, dll).
-REM     %3% - This parameter is ignored on MSVC7, should be "32" always.
-REM     %4% - Configuration name(s)
-REM           (ALL, Debug, DebugDLL, DebugMT, Release, ReleaseDLL, ReleaseMT).
-REM           By default build all possible configurations (ALL).
-REM
-REM ===========================================================================
-
-
-IF _%2 == _dll GOTO DLL
-
-:STATIC
- at call make.bat %1 ncbi_cpp %2 %3 %4 %5 %6 %7 %8 %9
-EXIT %ERRORLEVEL%
-
-:DLL
- at call make.bat %1 ncbi_cpp_dll %2 %3 %4 %5 %6 %7 %8 %9
-EXIT %ERRORLEVEL%
diff --git a/c++/compilers/msvc900_prj/msvcvars.bat b/c++/compilers/msvc900_prj/msvcvars.bat
deleted file mode 100644
index 9a87d12..0000000
--- a/c++/compilers/msvc900_prj/msvcvars.bat
+++ /dev/null
@@ -1,14 +0,0 @@
- at echo off
-REM
-REM $Id: msvcvars.bat 122871 2008-03-26 16:11:24Z gouriano $
-REM
-
- at if not "%VSINSTALLDIR%"=="" goto devenv
- at call "%VS90COMNTOOLS%vsvars32.bat"
-
-:devenv
-
-if exist "%VS90COMNTOOLS%..\IDE\VCExpress.*" set DEVENV="%VS90COMNTOOLS%..\IDE\VCExpress"
-if exist "%VS90COMNTOOLS%..\IDE\devenv.*" set DEVENV="%VS90COMNTOOLS%..\IDE\devenv"
-
-:end
diff --git a/c++/compilers/msvc900_prj/ncbi.rc b/c++/compilers/msvc900_prj/ncbi.rc
deleted file mode 100644
index 9bcbca1..0000000
--- a/c++/compilers/msvc900_prj/ncbi.rc
+++ /dev/null
@@ -1 +0,0 @@
-ncbilogo ICON "ncbilogo.ico"
diff --git a/c++/compilers/msvc900_prj/ncbilogo.ico b/c++/compilers/msvc900_prj/ncbilogo.ico
deleted file mode 100644
index 44e71d4..0000000
Binary files a/c++/compilers/msvc900_prj/ncbilogo.ico and /dev/null differ
diff --git a/c++/compilers/msvc900_prj/ptb.bat b/c++/compilers/msvc900_prj/ptb.bat
deleted file mode 100644
index 6cba94f..0000000
--- a/c++/compilers/msvc900_prj/ptb.bat
+++ /dev/null
@@ -1,276 +0,0 @@
- at echo off
-REM $Id: ptb.bat 388572 2013-02-08 18:11:05Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Run project_tree_builder.exe to generate MSVC solution and project files
-REM
-REM DO NOT ATTEMPT to run this bat file manually
-REM It should be run by CONFIGURE project only
-REM (open a solution and build or rebuild CONFIGURE project)
-REM
-REM ===========================================================================
-
-setlocal
-set DEFPTB_LOCATION=\\snowman\win-coremake\App\Ncbi\cppcore\ptb
-set IDE=900
-set PTB_EXTRA=
-
-for %%v in ("%PTB_PATH%" "%SLN_PATH%" "%TREE_ROOT%" "%BUILD_TREE_ROOT%" "%PTB_PLATFORM%") do (
-  if %%v=="" (
-    echo ERROR: required environment variable is missing
-    echo DO NOT ATTEMPT to run this bat file manually
-    echo It should be run by CONFIGURE project only
-    exit /b 1
-  )
-)
-set PTBGUI="%TREE_ROOT%\src\build-system\project_tree_builder_gui\bin\ptbgui.jar"
-set DEFPTB_VERSION_FILE=%TREE_ROOT%\src\build-system\ptb_version.txt
-set PTB_INI=%TREE_ROOT%\src\build-system\project_tree_builder.ini
-set PTB_SLN=%BUILD_TREE_ROOT%\static\build\UtilityProjects\PTB.sln
-
-REM --- get solution dir ---
-call :XSLNPATH %SLN_PATH%
-goto DONE
-:XSLNPATH
-set SLN_DIR=%~dp1
-goto :eof
-:DONE
-REM --- call pre-configure script if it exists ---
-if exist "%SLN_DIR%configure_prebuild.bat" (
-  call "%SLN_DIR%configure_prebuild.bat"
-)
-
-call "%BUILD_TREE_ROOT%\msvcvars.bat"
-
-
-REM -------------------------------------------------------------------------
-REM get PTB version: from DEFPTB_VERSION_FILE  or from PREBUILT_PTB_EXE
-
-set DEFPTB_VERSION=
-if exist "%DEFPTB_VERSION_FILE%" (
-  for /f %%a in ('type "%DEFPTB_VERSION_FILE%"') do (set DEFPTB_VERSION=%%a& goto donedf)
-  :donedf
-  set DEFPTB_VERSION=%DEFPTB_VERSION: =%
-)
-if exist "%PREBUILT_PTB_EXE%" (
-  set ptbver=
-  for /f "tokens=2" %%a in ('"%PREBUILT_PTB_EXE%" -version') do (set ptbver=%%a& goto donepb)
-  :donepb
-  set ptbver=%ptbver: =%
-  if not "%DEFPTB_VERSION%"=="%ptbver%" (
-    echo WARNING: requested PTB version %ptbver% does not match default one: %DEFPTB_VERSION%
-    set DEFPTB_VERSION=%ptbver%
-  )
-)
-
-if "%DEFPTB_VERSION%"=="" (
-  echo ERROR: DEFPTB_VERSION not specified
-  exit /b 1
-)
-for /f "tokens=1-3 delims=." %%a in ('echo %DEFPTB_VERSION%') do (set PTB_VER=%%a%%b%%c& set PTB_VER_MAJOR=%%a)
-
-
-REM -------------------------------------------------------------------------
-REM See if we should and can use Java GUI
-
-set REQ_GUI_CFG=NO
-set USE_GUI_CFG=NO
-for /f "tokens=*" %%i in ('echo %PTB_FLAGS%') do call :PARSE %%i
-goto :endparse
-:PARSE
-if "%1"=="" goto :eof
-if "%1"=="-cfg" (set REQ_GUI_CFG=YES& goto :eof)
-shift
-goto :PARSE
-:endparse
-if "%REQ_GUI_CFG%"=="YES" (
-  if %PTB_VER_MAJOR% GEQ 2 (
-    if exist "%PTBGUI%" (
-      java -version >NUL 2>&1
-      if errorlevel 1 (
-        echo WARNING: Java not found, cannot run configuration GUI
-      ) else (
-        set USE_GUI_CFG=YES
-      )
-    ) else (
-      echo WARNING: "%PTBGUI%" not found
-    )
-  )
-)
-
-
-REM -------------------------------------------------------------------------
-REM See if we should and can use saved settings
-
-set PTB_SAVED_CFG=
-if not "%PTB_SAVED_CFG_REQ%"=="" (
-  if not exist "%PTB_SAVED_CFG_REQ%" (
-    echo ERROR: %PTB_SAVED_CFG_REQ% not found
-    exit /b 1
-  )
-  if %PTB_VER_MAJOR% GEQ 2 (
-    if %PTB_VER% GEQ 220 (
-      set PTB_SAVED_CFG=-args %PTB_SAVED_CFG_REQ%
-REM PTB will read PTB_PROJECT from the saved settings
-      set PTB_PROJECT_REQ=""
-    )
-  )
-)
-
-
-REM -------------------------------------------------------------------------
-REM Identify PTB_EXE
-
-if "%PREBUILT_PTB_EXE%"=="bootstrap" (
-  set DEF_PTB=%PTB_PATH%\project_tree_builder.exe
-) else if not "%PREBUILT_PTB_EXE%"=="" (
-  if exist "%PREBUILT_PTB_EXE%" (
-    set DEF_PTB=%PREBUILT_PTB_EXE%
-  ) else (
-    echo ERROR: "%PREBUILT_PTB_EXE%" not found
-    exit /b 1
-  )
-) else (
-  if %PTB_VER% GEQ 180 (
-    set DEF_PTB=%DEFPTB_LOCATION%\msvc\%DEFPTB_VERSION%\project_tree_builder.exe
-  ) else (
-    if "%PTB_PLATFORM%"=="x64" (
-      set DEF_PTB=%DEFPTB_LOCATION%\msvc9.64\%DEFPTB_VERSION%\project_tree_builder.exe
-    ) else (
-      set DEF_PTB=%DEFPTB_LOCATION%\msvc9\%DEFPTB_VERSION%\project_tree_builder.exe
-    )
-  )
-)
-if exist "%DEF_PTB%" (
-  set PTB_EXE=%DEF_PTB%
-) else (
-  echo project_tree_builder.exe not found at %DEF_PTB%
-  set PTB_EXE=%PTB_PATH%\project_tree_builder.exe
-)
-
-REM -------------------------------------------------------------------------
-REM Misc settings
-
-if %PTB_VER% GEQ 180 (
-  set PTB_EXTRA=%PTB_EXTRA% -ide %IDE% -arch %PTB_PLATFORM%
-)
-if not exist "%PTB_INI%" (
-  echo ERROR: "%PTB_INI%" not found
-  exit /b 1
-)
-set PTB_PROJECT_LST=
-if "%PTB_PROJECT%"=="" (
-  set PTB_PROJECT_LST=%PTB_PROJECT_REQ%
-) else (
-  set PTB_PROJECT_LST=%PTB_PROJECT%
-)
-
-
-REM -------------------------------------------------------------------------
-REM Build PTB_EXE if needed
-
-if not exist "%PTB_EXE%" (
-  echo ******************************************************************************
-  echo Building project tree builder locally, please wait
-  echo ******************************************************************************
-  rem --- @echo msbuild "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /t:"project_tree_builder_exe:Rebuild" /p:Configuration=ReleaseDLL;Platform=%PTB_PLATFORM% /maxcpucount:1
-  rem --- msbuild "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /t:"project_tree_builder_exe:Rebuild" /p:Configuration=ReleaseDLL;Platform=%PTB_PLATFORM% /maxcpucount:1
-  if exist "%PTB_SLN%" (
-    @echo %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-    %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-  ) else (
-    @echo %DEVENV% "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-    %DEVENV% "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-  )
-) else (
-  echo ******************************************************************************
-  echo Using PREBUILT project tree builder at %PTB_EXE%
-  echo ******************************************************************************
-)
-if not exist "%PTB_EXE%" (
-  echo ERROR: "%PTB_EXE%" not found
-  exit /b 1
-)
-"%PTB_EXE%" -version
-if errorlevel 1 (
-  echo ERROR: cannot find working %PTB_EXE%
-  exit /b 1
-)
-
-
-REM -------------------------------------------------------------------------
-REM Run PTB_EXE
-
-call "%BUILD_TREE_ROOT%\lock_ptb_config.bat" ON "%BUILD_TREE_ROOT%\"
-if errorlevel 1 exit /b 1
-
-echo ******************************************************************************
-echo Running -CONFIGURE- please wait
-echo ******************************************************************************
-echo "%PTB_EXE%" %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-if "%USE_GUI_CFG%"=="YES" (
-  java -jar %PTBGUI% "%PTB_EXE%" -i %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-) else (
-  "%PTB_EXE%" %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-)
-if errorlevel 1 (set PTB_RESULT=1) else (set PTB_RESULT=0)
-
-call "%BUILD_TREE_ROOT%\lock_ptb_config.bat" OFF "%BUILD_TREE_ROOT%\"
-
-if "%PTB_RESULT%"=="1" (
-  echo ******************************************************************************
-  echo -CONFIGURE- has failed
-  echo Configuration log was saved at "file://%SLN_PATH%_configuration_log.txt"
-  echo ******************************************************************************
-  if exist "%SLN_PATH%_configuration_log.txt" (
-    if "%DIAG_SILENT_ABORT%"=="" start "" "%SLN_PATH%_configuration_log.txt"
-  )
-  exit /b 1
-) else (
-  echo ******************************************************************************
-  echo -CONFIGURE- has succeeded
-  echo Configuration log was saved at "file://%SLN_PATH%_configuration_log.txt"
-  echo ******************************************************************************
-)
-
-set ALLOBJ="_generate_all_objects.dataspec"
-type "%SLN_PATH%" | %SystemRoot%\system32\find /C %ALLOBJ% >NUL 2>&1
-if not errorlevel 1 (
-  echo ******************************************************************************
-  echo ******************************************************************************
-  echo ==============  Generating objects source code.                 ==============
-  echo ==============  DO NOT RELOAD THE SOLUTION NOW!                 ============== 
-  echo ******************************************************************************
-  echo %DEVENV% "%SLN_PATH%" /build "ReleaseDLL|%PTB_PLATFORM%" /project %ALLOBJ%
-  %DEVENV% "%SLN_PATH%" /build "ReleaseDLL|%PTB_PLATFORM%" /project %ALLOBJ%
-)
-echo -
-echo -
-echo ******************************************************************************
-echo ==============  It is now safe to reload the solution:          ==============
-echo ==============  Please, close it and open again                 ============== 
-echo ******************************************************************************
diff --git a/c++/compilers/msvc900_prj/static/build/UtilityProjects/PTB.sln b/c++/compilers/msvc900_prj/static/build/UtilityProjects/PTB.sln
deleted file mode 100644
index 26fb8c2..0000000
--- a/c++/compilers/msvc900_prj/static/build/UtilityProjects/PTB.sln
+++ /dev/null
@@ -1,132 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "_CONFIGURE_.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "_CONFIGURE_DIALOG_.vcproj", "{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xncbi.lib", "..\corelib\xncbi.lib.vcproj", "{1EDB6A26-ADB9-4591-B907-505E8D1A8157}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xser.lib", "..\serial\xser.lib.vcproj", "{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xutil.lib", "..\util\xutil.lib.vcproj", "{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msbuild_dataobj.lib.vcproj", "..\build-system\project_tree_builder\msbuild\msbuild_dataobj.lib.vcproj", "{C142E94F-1D21-466C-A4EA-1436A2367BC6}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9} = {BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datatool.exe", "..\serial\datatool\datatool.exe.vcproj", "{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}"
-	ProjectSection(ProjectDependencies) = postProject
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157} = {1EDB6A26-ADB9-4591-B907-505E8D1A8157}
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6} = {1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7} = {1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "project_tree_builder.exe", "..\build-system\project_tree_builder\project_tree_builder.exe.vcproj", "{8D5B9C1E-5941-44F8-B017-25F6201E822B}"
-	ProjectSection(ProjectDependencies) = postProject
-		{E46C5B0B-675C-4C37-B618-02608C379C67} = {E46C5B0B-675C-4C37-B618-02608C379C67}
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157} = {1EDB6A26-ADB9-4591-B907-505E8D1A8157}
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6} = {C142E94F-1D21-466C-A4EA-1436A2367BC6}
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6} = {1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C} = {DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9} = {BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7} = {1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xregexp.lib", "..\util\xregexp\xregexp.lib.vcproj", "{E46C5B0B-675C-4C37-B618-02608C379C67}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regexp.lib", "..\util\regexp\regexp.lib.vcproj", "{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{C142E94F-1D21-466C-A4EA-1436A2367BC6}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc900_prj/static/build/UtilityProjects/_CONFIGURE_.vcproj b/c++/compilers/msvc900_prj/static/build/UtilityProjects/_CONFIGURE_.vcproj
deleted file mode 100644
index d535e5a..0000000
--- a/c++/compilers/msvc900_prj/static/build/UtilityProjects/_CONFIGURE_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-"
-	ProjectGUID="{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_bui [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_bui [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_bui [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_bui [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj b/c++/compilers/msvc900_prj/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
deleted file mode 100644
index 49a85e3..0000000
--- a/c++/compilers/msvc900_prj/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-DIALOG-"
-	ProjectGUID="{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure_dialog._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_bui [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_bui [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_bui [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_bui [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/UtilityProjects/configure._ b/c++/compilers/msvc900_prj/static/build/UtilityProjects/configure._
deleted file mode 100644
index 49cbd64..0000000
--- a/c++/compilers/msvc900_prj/static/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/static/build/UtilityProjects/configure_dialog._ b/c++/compilers/msvc900_prj/static/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index cdd8acd..0000000
--- a/c++/compilers/msvc900_prj/static/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/static/build/all.bat b/c++/compilers/msvc900_prj/static/build/all.bat
deleted file mode 100644
index 35b4703..0000000
--- a/c++/compilers/msvc900_prj/static/build/all.bat
+++ /dev/null
@@ -1,39 +0,0 @@
- at ECHO OFF
-REM $Id: all.bat 122037 2008-03-13 19:25:53Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Build all C++ Toolkit STATIC projects
-REM
-REM ===========================================================================
-
-
-CALL all_ncbi.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gui.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-:_ABORT_
\ No newline at end of file
diff --git a/c++/compilers/msvc900_prj/static/build/all_gui.bat b/c++/compilers/msvc900_prj/static/build/all_gui.bat
deleted file mode 100644
index 8e000c0..0000000
--- a/c++/compilers/msvc900_prj/static/build/all_gui.bat
+++ /dev/null
@@ -1,81 +0,0 @@
- at ECHO OFF
-REM $Id: all_gui.bat 122037 2008-03-13 19:25:53Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ GUI core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "static\gui"
-msbuild gui\ncbi_gui.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == Debug GOTO CONTINUE
-IF %CFG% == DebugMT GOTO CONTINUE
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == Release GOTO CONTINUE
-IF %CFG% == ReleaseMT GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       Debug DebugMT DebugDLL Release ReleaseMT ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "static\gui\%CFG%"
-msbuild gui\ncbi_gui.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-REM vcbuild /M2 /time gui\ncbi_gui.sln "%CFG%|Win32"
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
-set CFG=
diff --git a/c++/compilers/msvc900_prj/static/build/all_ncbi.bat b/c++/compilers/msvc900_prj/static/build/all_ncbi.bat
deleted file mode 100644
index 4281c3a..0000000
--- a/c++/compilers/msvc900_prj/static/build/all_ncbi.bat
+++ /dev/null
@@ -1,81 +0,0 @@
- at ECHO OFF
-REM $Id: all_ncbi.bat 122037 2008-03-13 19:25:53Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "static\ncbi"
-msbuild ncbi_cpp.sln /t:"-CONFIGURE-:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == Debug GOTO CONTINUE
-IF %CFG% == DebugMT GOTO CONTINUE
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == Release GOTO CONTINUE
-IF %CFG% == ReleaseMT GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       Debug DebugMT DebugDLL Release ReleaseMT ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "static\ncbi\%CFG%"
-msbuild ncbi_cpp.sln /t:"-BUILD-ALL-" /p:Configuration=%CFG%
-REM vcbuild /M2 /time ncbi_cpp.sln "%CFG%|Win32"
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
-set CFG=
diff --git a/c++/compilers/msvc900_prj/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcproj b/c++/compilers/msvc900_prj/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcproj
deleted file mode 100644
index 335063b..0000000
--- a/c++/compilers/msvc900_prj/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcproj
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="9.00" Name="msbuild_dataobj.lib" Keyword="Win32Proj" ProjectGUID="{C142E94F-1D21-466C-A4EA-1436A2367BC6}">
-  <Platforms>
-    <Platform Name="Win32"/>
-    <Platform Name="x64"/>
-  </Platforms>
-  <Configurations>
-    <Configuration Name="ReleaseDLL|Win32" OutputDirectory="..\..\..\..\lib\$(ConfigurationName)\" IntermediateDirectory="$(ConfigurationName)\" ConfigurationType="4" CharacterSet="2" BuildLogFile="$(IntDir)BuildLog_$(TargetName).htm">
-      <Tool Name="VCCLCompilerTool" Optimization="2" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;" AdditionalIncludeDirectories="..\..\..\..\..\..\..\include\" BasicRuntimeChecks="0" RuntimeLibrary="2" RuntimeTypeInfo="TRUE" ProgramDataBaseFileName="$(IntDir)msbuild_dataobj.pdb" WarningLevel="3" DebugInformationFormat="0" CompileAs="0" UsePrecompiledHeader="0" BrowseInformation="0" MinimalRebuild="FALSE" Detect64BitPortabilityProblems="FALSE" Inlin [...]
-      <Tool Name="VCLinkerTool" OutputFile="" AdditionalDependencies="" LargeAddressAware="" LinkIncremental="" GenerateDebugInformation="" SubSystem="" TargetMachine="" AdditionalLibraryDirectories="" ProgramDatabaseFile="" ImportLibrary="" EnableCOMDATFolding="" OptimizeReferences="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="" FixedBaseAddress=""/>
-      <Tool Name="VCLibrarianTool" OutputFile="$(OutDir)$(ProjectName)" AdditionalLibraryDirectories="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames=""/>
-      <Tool Name="VCCustomBuildTool"/>
-      <Tool Name="VCMIDLTool"/>
-      <Tool Name="VCPostBuildEventTool"/>
-      <Tool Name="VCPreBuildEventTool" CommandLine=""/>
-      <Tool Name="VCPreLinkEventTool"/>
-      <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="" Culture="" AdditionalIncludeDirectories="" AdditionalOptions=""/>
-      <Tool Name="VCWebServiceProxyGeneratorTool"/>
-      <Tool Name="VCXMLDataGeneratorTool"/>
-      <Tool Name="VCManagedWrapperGeneratorTool"/>
-      <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-    </Configuration>
-    <Configuration Name="ReleaseDLL|x64" OutputDirectory="..\..\..\..\lib\$(ConfigurationName)\" IntermediateDirectory="$(ConfigurationName)\" ConfigurationType="4" CharacterSet="2" BuildLogFile="$(IntDir)BuildLog_$(TargetName).htm">
-      <Tool Name="VCCLCompilerTool" Optimization="2" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;" AdditionalIncludeDirectories="..\..\..\..\..\..\..\include\" BasicRuntimeChecks="0" RuntimeLibrary="2" RuntimeTypeInfo="TRUE" ProgramDataBaseFileName="$(IntDir)msbuild_dataobj.pdb" WarningLevel="3" DebugInformationFormat="0" CompileAs="0" UsePrecompiledHeader="0" BrowseInformation="0" MinimalRebuild="FALSE" Detect64BitPortabilityProblems="FALSE" Inlin [...]
-      <Tool Name="VCLinkerTool" OutputFile="" AdditionalDependencies="" LargeAddressAware="" LinkIncremental="" GenerateDebugInformation="" SubSystem="" TargetMachine="" AdditionalLibraryDirectories="" ProgramDatabaseFile="" ImportLibrary="" EnableCOMDATFolding="" OptimizeReferences="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="" FixedBaseAddress=""/>
-      <Tool Name="VCLibrarianTool" OutputFile="$(OutDir)$(ProjectName)" AdditionalLibraryDirectories="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames=""/>
-      <Tool Name="VCCustomBuildTool"/>
-      <Tool Name="VCMIDLTool"/>
-      <Tool Name="VCPostBuildEventTool"/>
-      <Tool Name="VCPreBuildEventTool" CommandLine=""/>
-      <Tool Name="VCPreLinkEventTool"/>
-      <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="" Culture="" AdditionalIncludeDirectories="" AdditionalOptions=""/>
-      <Tool Name="VCWebServiceProxyGeneratorTool"/>
-      <Tool Name="VCXMLDataGeneratorTool"/>
-      <Tool Name="VCManagedWrapperGeneratorTool"/>
-      <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-    </Configuration>
-  </Configurations>
-  <References></References>
-  <Files>
-    <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx">
-      <File RelativePath="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj__.cpp">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH"/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH"/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj___.cpp">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH"/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH"/>
-        </FileConfiguration>
-      </File>
-    </Filter>
-    <Filter Name="Datatool Files" Filter="">
-      <File RelativePath="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj.xsd">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="$(InputDir)$(InputName).def;" CommandLine="set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\msvc900_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "$(InputPath)" -oA -oc "$(InputName)" -od "$ [...]
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="$(InputDir)$(InputName).def;" CommandLine="set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\msvc900_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "$(InputPath)" -oA -oc "$(InputName)" -od "$ [...]
-        </FileConfiguration>
-      </File>
-    </Filter>
-  </Files>
-  <Globals></Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcproj b/c++/compilers/msvc900_prj/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcproj
deleted file mode 100644
index 1676493..0000000
--- a/c++/compilers/msvc900_prj/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcproj
+++ /dev/null
@@ -1,1067 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="project_tree_builder.exe"
-	ProjectGUID="{8D5B9C1E-5941-44F8-B017-25F6201E822B}"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="..\..\..\bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine="@echo EXPENDABLE project&#x0D;&#x0A;"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\project_tree_builder.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions="NDEBUG;"
-				AdditionalIncludeDirectories="..\..\..\..\..\..\include\"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="ws2_32.lib dbghelp.lib"
-				OutputFile="$(OutDir)\$(ProjectName)"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile="$(OutDir)\project_tree_builder.pdb"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)\project_tree_builder.lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="..\..\..\bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine="@echo EXPENDABLE project&#x0D;&#x0A;"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\project_tree_builder.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions="NDEBUG;"
-				AdditionalIncludeDirectories="..\..\..\..\..\..\include\"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="ws2_32.lib dbghelp.lib"
-				OutputFile="$(OutDir)\$(ProjectName)"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile="$(OutDir)\project_tree_builder.pdb"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)\project_tree_builder.lib"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\configurable_file.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\file_contents.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project__.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project___.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure_prj_generator.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_makefile.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_masterproject_generator.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_files_collector.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_generator.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_utils.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_project_context.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_site.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_sln_generator.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_builder_app.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_datatool_generated_src.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_item.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_projects.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_src_resolver.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree_builder.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_utils.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\resolver.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_registry.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inc;xsd"
-			>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\configurable_file.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Configuration.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Configuration_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Configurations.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Configurations_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\File.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\File_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\file_contents.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\FileConfiguration.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\FileConfiguration_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Files.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Files_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Filter.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Filter_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project__.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure_prj_generator.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info_utils.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_makefile.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_masterproject_generator.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_defines.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_files_collector.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_generator.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_utils.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_project_context.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_site.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_sln_generator.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_tools_implement.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_traits.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Platform.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Platform_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Platforms.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Platforms_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_builder_app.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_datatool_generated_src.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_item.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_projects.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_src_resolver.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree_builder.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_utils.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\resolver.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\stl_msvc_usage.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Tool.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\Tool_.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\VisualStudioProject.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\VisualStudioProject_.hpp"
-				>
-			</File>
-			<Filter
-				Name="Private"
-				Filter="h;hpp;hxx;hm;inc;xsd"
-				>
-				<File
-					RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.h"
-					>
-				</File>
-			</Filter>
-		</Filter>
-		<Filter
-			Name="Inline Files"
-			Filter="inl"
-			>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.rc"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Datatool Files"
-			>
-			<File
-				RelativePath="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project.dtd"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-Name="VCCustomBuildTool"
-Description="Using datatool to create a C++ object from ASN/DTD/Schema $(InputPath)"
-CommandLine="set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\msvc900_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "$(InputPath)" -oA -oc "$(InputName)" -od "$(InputDir)$(InputName).def" -odi -ocvs -or build-system\project_tree_builder\ -oR ..\..\..\..\..\.. [...]
-AdditionalDependencies="$(InputDir)$(InputName).def;"
-Outputs="$(InputDir)$(InputName).files;$(InputDir)$(InputName)__.cpp;$(InputDir)$(InputName)___.cpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-Name="VCCustomBuildTool"
-Description="Using datatool to create a C++ object from ASN/DTD/Schema $(InputPath)"
-CommandLine="set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\msvc900_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "$(InputPath)" -oA -oc "$(InputName)" -od "$(InputDir)$(InputName).def" -odi -ocvs -or build-system\project_tree_builder\ -oR ..\..\..\..\..\.. [...]
-AdditionalDependencies="$(InputDir)$(InputName).def;"
-Outputs="$(InputDir)$(InputName).files;$(InputDir)$(InputName)__.cpp;$(InputDir)$(InputName)___.cpp"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/corelib/xncbi.lib.vcproj b/c++/compilers/msvc900_prj/static/build/corelib/xncbi.lib.vcproj
deleted file mode 100644
index e8e3a79..0000000
--- a/c++/compilers/msvc900_prj/static/build/corelib/xncbi.lib.vcproj
+++ /dev/null
@@ -1,1353 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="xncbi.lib"
-	ProjectGUID="{1EDB6A26-ADB9-4591-B907-505E8D1A8157}"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="..\..\lib\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\xncbi.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions=""
-				AdditionalIncludeDirectories=""
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				AdditionalOptions=""
-				OutputFile="$(OutDir)\xncbi.lib"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="..\..\lib\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\xncbi.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions=""
-				AdditionalIncludeDirectories=""
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				AdditionalOptions=""
-				OutputFile="$(OutDir)\xncbi.lib"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ddumpable.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\env_reg.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\metareg.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbi_config.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbi_os_mswin.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbi_param.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbi_process.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbi_safe_static.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbi_system.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbiapp.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbiargs.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbiatomic.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbicfg.c.in"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						CompileAs="1"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						CompileAs="1"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbidbg.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbidiag.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbidiag_p.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbidll.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbienv.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbiexec.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbiexpt.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbifile.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbimempool.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbimtx.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbiobj.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbireg.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbistr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbistre.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbithr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbitime.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\obj_store.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\plugin_manager.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\plugin_manager_store.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\rwstreambuf.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\syslog.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\version.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\stream_utils.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbi_stack.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\request_ctx.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\request_control.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\expr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\corelib\ncbierror.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inc;xsd"
-			>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ddumpable.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\guard.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\metareg.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\mswin_export.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_bswap.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_config.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_limits.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_limits.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_os_mac.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_os_mswin.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_os_unix.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_param.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_process.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_safe_static.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_system.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbi_tree.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbiapp.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbiargs.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbiatomic.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbicfg.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbicntr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbidbg.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbidiag.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbidll.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbienv.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbiexec.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbiexpt.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbifile.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbifloat.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbimisc.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbimtx.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbiobj.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbireg.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbistd.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbistl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbistr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbistre.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbithr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbithr_conf.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbitime.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbitype.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbiutil.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\obj_store.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\plugin_manager.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\plugin_manager_impl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\plugin_manager_store.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\impl\rwstreambuf.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\syslog.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\test_mt.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\version.hpp"
-				>
-			</File>
-			<Filter
-				Name="Private"
-				Filter="h;hpp;hxx;hm;inc;xsd"
-				>
-				<File
-					RelativePath="..\..\..\..\..\src\corelib\ncbiargs_p.hpp"
-					>
-				</File>
-				<File
-					RelativePath="..\..\..\..\..\src\corelib\ncbidbg_p.hpp"
-					>
-				</File>
-				<File
-					RelativePath="..\..\..\..\..\src\corelib\ncbidiag_p.hpp"
-					>
-				</File>
-			</Filter>
-		</Filter>
-		<Filter
-			Name="Inline Files"
-			Filter="inl"
-			>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbidiag.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbimtx.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\corelib\ncbiobj.inl"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/_CONFIGURE_.vcproj b/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/_CONFIGURE_.vcproj
deleted file mode 100644
index f88d301..0000000
--- a/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/_CONFIGURE_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-"
-	ProjectGUID="{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\proj [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\proj [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\proj [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\proj [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcproj b/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
deleted file mode 100644
index a46a2ce..0000000
--- a/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-DIALOG-"
-	ProjectGUID="{FDC9447A-C7F1-492D-B84F-D54A1E610F16}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure_dialog._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\proj [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\proj [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\proj [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\proj [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/configure._ b/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/configure._
deleted file mode 100644
index 3589c55..0000000
--- a/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/configure_dialog._ b/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/configure_dialog._
deleted file mode 100644
index 4907743..0000000
--- a/c++/compilers/msvc900_prj/static/build/gui/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/static/build/gui/ncbi_gui.sln b/c++/compilers/msvc900_prj/static/build/gui/ncbi_gui.sln
deleted file mode 100644
index cc4e9c5..0000000
--- a/c++/compilers/msvc900_prj/static/build/gui/ncbi_gui.sln
+++ /dev/null
@@ -1,39 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcproj", "{FDC9447A-C7F1-492D-B84F-D54A1E610F16}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc900_prj/static/build/ncbi_cpp.sln b/c++/compilers/msvc900_prj/static/build/ncbi_cpp.sln
deleted file mode 100644
index b710476..0000000
--- a/c++/compilers/msvc900_prj/static/build/ncbi_cpp.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcproj", "{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/msvc900_prj/static/build/serial/datatool/datatool.exe.vcproj b/c++/compilers/msvc900_prj/static/build/serial/datatool/datatool.exe.vcproj
deleted file mode 100644
index 62006db..0000000
--- a/c++/compilers/msvc900_prj/static/build/serial/datatool/datatool.exe.vcproj
+++ /dev/null
@@ -1,1458 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="datatool.exe"
-	ProjectGUID="{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="..\..\..\bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\datatool.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions="NDEBUG;"
-				AdditionalIncludeDirectories="..\..\..\..\..\..\include\"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="ws2_32.lib ws2_32.lib dbghelp.lib"
-				OutputFile="$(OutDir)\datatool.exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile="$(OutDir)\datatool.pdb"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)\datatool.lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="..\..\..\bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\datatool.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions="NDEBUG;"
-				AdditionalIncludeDirectories="..\..\..\..\..\..\include\"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="ws2_32.lib ws2_32.lib dbghelp.lib"
-				OutputFile="$(OutDir)\datatool.exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-				GenerateDebugInformation="false"
-				ProgramDatabaseFile="$(OutDir)\datatool.pdb"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)\datatool.lib"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\alexer.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\aliasstr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\aparser.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\blocktype.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\choiceptrstr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\choicestr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\choicetype.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\classstr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\code.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\comments.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\datatool.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\dtdaux.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\dtdlexer.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\dtdparser.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\enumstr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\enumtype.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\exceptions.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\filecode.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\fileutil.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\generate.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\lexer.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\mcontainer.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\module.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\moduleset.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\namespace.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\parser.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\ptrstr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\reftype.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\rpcgen.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\srcutil.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\statictype.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\stdstr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\stlstr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\type.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\typestr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\unitype.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\value.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\xsdlexer.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\xsdparser.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\wsdllexer.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\wsdlparser.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\wsdlstr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\traversal_code_generator.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\traversal_merger.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\traversal_node.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\traversal_pattern_match_callback.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\src\serial\datatool\traversal_spec_file_parser.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inc;xsd"
-			>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\alexer.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\aliasstr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\aparser.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\atoken.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\blocktype.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\choiceptrstr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\choicestr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\choicetype.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\classctx.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\classstr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\code.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\comments.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\datatool.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\dtdaux.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\dtdlexer.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\dtdparser.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\enumstr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\enumtype.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\exceptions.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\filecode.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\fileutil.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\generate.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\lexer.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\mcontainer.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\module.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\moduleset.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\namespace.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\parser.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\ptrstr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\reftype.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\rpcgen.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\srcutil.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\statictype.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\stdstr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\stlstr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\tokens.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\type.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\typestr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\unitype.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\..\include\serial\datatool\value.hpp"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Inline Files"
-			Filter="inl"
-			>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			>
-			<File
-				RelativePath="..\..\..\..\ncbi.rc"
-				>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/serial/xser.lib.vcproj b/c++/compilers/msvc900_prj/static/build/serial/xser.lib.vcproj
deleted file mode 100644
index 7e2f25b..0000000
--- a/c++/compilers/msvc900_prj/static/build/serial/xser.lib.vcproj
+++ /dev/null
@@ -1,1642 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="xser.lib"
-	ProjectGUID="{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="..\..\lib\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\xser.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions=""
-				AdditionalIncludeDirectories=""
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				AdditionalOptions=""
-				OutputFile="$(OutDir)\xser.lib"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="..\..\lib\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\xser.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions=""
-				AdditionalIncludeDirectories=""
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				AdditionalOptions=""
-				OutputFile="$(OutDir)\xser.lib"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\aliasinfo.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\autoptrinfo.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\choice.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\choiceptr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\classinfo.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\classinfob.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\continfo.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\delaybuf.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\enumerated.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\exception.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\hookdata.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\hookdatakey.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\item.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\iterator.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\member.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\memberid.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\memberlist.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objcopy.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objectinfo.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objectio.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objectiter.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objhook.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objistr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objistrasn.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objistrasnb.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objistrxml.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objlist.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objostr.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objostrasn.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objostrasnb.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objostrxml.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objostrjson.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objistrjson.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\objstack.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\pack_string.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\pathhook.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\ptrinfo.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\serial.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\serializable.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\serialobject.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\stdtypes.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\stltypes.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\typeinfo.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\typemap.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\typeref.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\serial\variant.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inc;xsd"
-			>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\aliasinfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\asntypes.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\autoptrinfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\choice.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\choiceptr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\classinfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\classinfob.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\classinfohelper.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\continfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\delaybuf.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\enumerated.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\enumvalues.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\exception.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\hookdata.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\hookdataimpl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\hookdatakey.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\hookfunc.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\item.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\iterator.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\iteratorbase.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\member.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\memberid.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\memberlist.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objcopy.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\object.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objectinfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objectio.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objectiter.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objecttype.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objhook.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistrasn.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistrasnb.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistrimpl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistrxml.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objlist.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objostr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objostrasn.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objostrasnb.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objostrxml.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objstack.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objstrasnb.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objstrb.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\pack_string.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\pathhook.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\ptrinfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\rpcbase.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serial.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serialasn.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serialasndef.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serialbase.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serialdef.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serialimpl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serializable.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serialutil.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\stdtypeinfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\stdtypes.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\stdtypesimpl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\stltypes.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\stltypesimpl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\timetypeinfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typeinfo.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typeinfoimpl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typemap.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typemapimpl.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typemapper.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typeref.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\variant.hpp"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Inline Files"
-			Filter="inl"
-			>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\choice.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\classinfo.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\classinfob.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\continfo.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\item.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\iterator.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\iteratorbase.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\member.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\memberid.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\memberlist.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objcopy.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\object.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objectinfo.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objectio.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objectiter.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistr.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistrasnb.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistrimpl.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objistrxml.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objlist.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objostr.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objostrasnb.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objostrxml.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objstack.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\objstrasnb.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\ptrinfo.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serial.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\serialdef.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\stdtypes.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typeinfo.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typeinfoimpl.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\typeref.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\serial\variant.inl"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/util/regexp/regexp.lib.vcproj b/c++/compilers/msvc900_prj/static/build/util/regexp/regexp.lib.vcproj
deleted file mode 100644
index 79d117a..0000000
--- a/c++/compilers/msvc900_prj/static/build/util/regexp/regexp.lib.vcproj
+++ /dev/null
@@ -1,223 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="9.00" Name="regexp.lib" Keyword="Win32Proj" ProjectGUID="{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}">
-  <Platforms>
-    <Platform Name="Win32"/>
-    <Platform Name="x64"/>
-  </Platforms>
-  <Configurations>
-    <Configuration Name="ReleaseDLL|Win32" OutputDirectory="..\..\..\lib\$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="2">
-      <Tool Name="VCCLCompilerTool" Optimization="2" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;HAVE_CONFIG_H" AdditionalIncludeDirectories="..\..\..\..\..\..\include\, ..\..\..\..\..\..\include\internal\, ..\..\..\..\..\..\include\util\regexp\" BasicRuntimeChecks="0" RuntimeLibrary="2" RuntimeTypeInfo="TRUE" ProgramDataBaseFileName="$(IntDir)\regexp.pdb" WarningLevel="3" DebugInformationFormat="0" CompileAs="0" UsePrecompiledHeader="0" BrowseInfo [...]
-      <Tool Name="VCLinkerTool" OutputFile="" AdditionalDependencies="" LargeAddressAware="" LinkIncremental="" GenerateDebugInformation="" SubSystem="" TargetMachine="" AdditionalLibraryDirectories="" ProgramDatabaseFile="" ImportLibrary="" EnableCOMDATFolding="" OptimizeReferences="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="FALSE" FixedBaseAddress=""/>
-      <Tool Name="VCLibrarianTool" OutputFile="$(OutDir)\$(ProjectName)" AdditionalLibraryDirectories="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="FALSE"/>
-      <Tool Name="VCCustomBuildTool"/>
-      <Tool Name="VCMIDLTool"/>
-      <Tool Name="VCPostBuildEventTool"/>
-      <Tool Name="VCPreBuildEventTool" CommandLine=""/>
-      <Tool Name="VCPreLinkEventTool"/>
-      <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="" Culture="" AdditionalIncludeDirectories="" AdditionalOptions=""/>
-      <Tool Name="VCWebServiceProxyGeneratorTool"/>
-      <Tool Name="VCXMLDataGeneratorTool"/>
-      <Tool Name="VCManagedWrapperGeneratorTool"/>
-      <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-    </Configuration>
-    <Configuration Name="ReleaseDLL|x64" OutputDirectory="..\..\..\lib\$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="2">
-      <Tool Name="VCCLCompilerTool" Optimization="2" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;HAVE_CONFIG_H" AdditionalIncludeDirectories="..\..\..\..\..\..\include\, ..\..\..\..\..\..\include\internal\, ..\..\..\..\..\..\include\util\regexp\" BasicRuntimeChecks="0" RuntimeLibrary="2" RuntimeTypeInfo="TRUE" ProgramDataBaseFileName="$(IntDir)\regexp.pdb" WarningLevel="3" DebugInformationFormat="0" CompileAs="0" UsePrecompiledHeader="0" BrowseInfo [...]
-      <Tool Name="VCLinkerTool" OutputFile="" AdditionalDependencies="" LargeAddressAware="" LinkIncremental="" GenerateDebugInformation="" SubSystem="" TargetMachine="" AdditionalLibraryDirectories="" ProgramDatabaseFile="" ImportLibrary="" EnableCOMDATFolding="" OptimizeReferences="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="FALSE" FixedBaseAddress=""/>
-      <Tool Name="VCLibrarianTool" OutputFile="$(OutDir)\$(ProjectName)" AdditionalLibraryDirectories="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="FALSE"/>
-      <Tool Name="VCCustomBuildTool"/>
-      <Tool Name="VCMIDLTool"/>
-      <Tool Name="VCPostBuildEventTool"/>
-      <Tool Name="VCPreBuildEventTool" CommandLine=""/>
-      <Tool Name="VCPreLinkEventTool"/>
-      <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="" Culture="" AdditionalIncludeDirectories="" AdditionalOptions=""/>
-      <Tool Name="VCWebServiceProxyGeneratorTool"/>
-      <Tool Name="VCXMLDataGeneratorTool"/>
-      <Tool Name="VCManagedWrapperGeneratorTool"/>
-      <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-    </Configuration>
-  </Configurations>
-  <References></References>
-  <Files>
-    <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx">
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_chartables.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_compile.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_config.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_dfa_exec.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_exec.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_fullinfo.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_get.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_globals.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_info.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_maketables.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_newline.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_ord2utf8.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_refcount.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_study.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_tables.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_try_flipped.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_ucd.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_valid_utf8.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_version.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_xclass.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcreposix.c">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0" PrecompiledHeaderThrough=""/>
-        </FileConfiguration>
-      </File>
-    </Filter>
-    <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inc;xsd">
-      <File RelativePath="..\..\..\..\..\..\include\util\regexp\pcre.h"></File>
-      <File RelativePath="..\..\..\..\..\..\include\util\regexp\pcreposix.h"></File>
-      <Filter Name="Private" Filter="h;hpp;hxx;hm;inc;xsd">
-        <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_config.h"></File>
-        <File RelativePath="..\..\..\..\..\..\src\util\regexp\pcre_internal.h"></File>
-      </Filter>
-    </Filter>
-    <Filter Name="Inline Files" Filter="inl"></Filter>
-    <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"></Filter>
-  </Files>
-  <Globals></Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/util/xregexp/xregexp.lib.vcproj b/c++/compilers/msvc900_prj/static/build/util/xregexp/xregexp.lib.vcproj
deleted file mode 100644
index 843f11d..0000000
--- a/c++/compilers/msvc900_prj/static/build/util/xregexp/xregexp.lib.vcproj
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="9.00" Name="xregexp.lib" Keyword="Win32Proj" ProjectGUID="{E46C5B0B-675C-4C37-B618-02608C379C67}">
-  <Platforms>
-    <Platform Name="Win32"/>
-    <Platform Name="x64"/>
-  </Platforms>
-  <Configurations>
-    <Configuration Name="ReleaseDLL|Win32" OutputDirectory="..\..\..\lib\$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="2">
-      <Tool Name="VCCLCompilerTool" Optimization="2" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;" AdditionalIncludeDirectories="..\..\..\..\..\..\include\, ..\..\..\..\..\..\include\internal\, ..\..\..\..\..\..\include\util\regexp\" BasicRuntimeChecks="0" RuntimeLibrary="2" RuntimeTypeInfo="TRUE" ProgramDataBaseFileName="$(IntDir)\xregexp.pdb" WarningLevel="3" DebugInformationFormat="0" CompileAs="0" UsePrecompiledHeader="0" BrowseInformation="0"  [...]
-      <Tool Name="VCLinkerTool" OutputFile="" AdditionalDependencies="" LargeAddressAware="" LinkIncremental="" GenerateDebugInformation="" SubSystem="" TargetMachine="" AdditionalLibraryDirectories="" ProgramDatabaseFile="" ImportLibrary="" EnableCOMDATFolding="" OptimizeReferences="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="FALSE" FixedBaseAddress=""/>
-      <Tool Name="VCLibrarianTool" OutputFile="$(OutDir)\$(ProjectName)" AdditionalLibraryDirectories="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="FALSE"/>
-      <Tool Name="VCCustomBuildTool"/>
-      <Tool Name="VCMIDLTool"/>
-      <Tool Name="VCPostBuildEventTool"/>
-      <Tool Name="VCPreBuildEventTool" CommandLine=""/>
-      <Tool Name="VCPreLinkEventTool"/>
-      <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="" Culture="" AdditionalIncludeDirectories="" AdditionalOptions=""/>
-      <Tool Name="VCWebServiceProxyGeneratorTool"/>
-      <Tool Name="VCXMLDataGeneratorTool"/>
-      <Tool Name="VCManagedWrapperGeneratorTool"/>
-      <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-    </Configuration>
-    <Configuration Name="ReleaseDLL|x64" OutputDirectory="..\..\..\lib\$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="2">
-      <Tool Name="VCCLCompilerTool" Optimization="2" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;" AdditionalIncludeDirectories="..\..\..\..\..\..\include\, ..\..\..\..\..\..\include\internal\, ..\..\..\..\..\..\include\util\regexp\" BasicRuntimeChecks="0" RuntimeLibrary="2" RuntimeTypeInfo="TRUE" ProgramDataBaseFileName="$(IntDir)\xregexp.pdb" WarningLevel="3" DebugInformationFormat="0" CompileAs="0" UsePrecompiledHeader="0" BrowseInformation="0"  [...]
-      <Tool Name="VCLinkerTool" OutputFile="" AdditionalDependencies="" LargeAddressAware="" LinkIncremental="" GenerateDebugInformation="" SubSystem="" TargetMachine="" AdditionalLibraryDirectories="" ProgramDatabaseFile="" ImportLibrary="" EnableCOMDATFolding="" OptimizeReferences="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="FALSE" FixedBaseAddress=""/>
-      <Tool Name="VCLibrarianTool" OutputFile="$(OutDir)\$(ProjectName)" AdditionalLibraryDirectories="" AdditionalOptions="" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="FALSE"/>
-      <Tool Name="VCCustomBuildTool"/>
-      <Tool Name="VCMIDLTool"/>
-      <Tool Name="VCPostBuildEventTool"/>
-      <Tool Name="VCPreBuildEventTool" CommandLine=""/>
-      <Tool Name="VCPreLinkEventTool"/>
-      <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="" Culture="" AdditionalIncludeDirectories="" AdditionalOptions=""/>
-      <Tool Name="VCWebServiceProxyGeneratorTool"/>
-      <Tool Name="VCXMLDataGeneratorTool"/>
-      <Tool Name="VCManagedWrapperGeneratorTool"/>
-      <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-    </Configuration>
-  </Configurations>
-  <References></References>
-  <Files>
-    <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx">
-      <File RelativePath="..\..\..\..\..\..\src\util\xregexp\arg_regexp.cpp">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH" UsePrecompiledHeader="1" PrecompiledHeaderThrough="ncbi_pch.hpp"/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH" UsePrecompiledHeader="1" PrecompiledHeaderThrough="ncbi_pch.hpp"/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\xregexp\mask_regexp.cpp">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH" UsePrecompiledHeader="2" PrecompiledHeaderThrough="ncbi_pch.hpp"/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH" UsePrecompiledHeader="2" PrecompiledHeaderThrough="ncbi_pch.hpp"/>
-        </FileConfiguration>
-      </File>
-      <File RelativePath="..\..\..\..\..\..\src\util\xregexp\regexp.cpp">
-        <FileConfiguration Name="ReleaseDLL|Win32">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH" UsePrecompiledHeader="2" PrecompiledHeaderThrough="ncbi_pch.hpp"/>
-        </FileConfiguration>
-        <FileConfiguration Name="ReleaseDLL|x64">
-          <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="NCBI_USE_PCH" UsePrecompiledHeader="2" PrecompiledHeaderThrough="ncbi_pch.hpp"/>
-        </FileConfiguration>
-      </File>
-    </Filter>
-    <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inc;xsd">
-      <File RelativePath="..\..\..\..\..\..\include\util\xregexp\arg_regexp.hpp"></File>
-      <File RelativePath="..\..\..\..\..\..\include\util\xregexp\mask_regexp.hpp"></File>
-      <File RelativePath="..\..\..\..\..\..\include\util\xregexp\regexp.hpp"></File>
-    </Filter>
-    <Filter Name="Inline Files" Filter="inl"></Filter>
-    <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"></Filter>
-  </Files>
-  <Globals></Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/build/util/xutil.lib.vcproj b/c++/compilers/msvc900_prj/static/build/util/xutil.lib.vcproj
deleted file mode 100644
index 91ad483..0000000
--- a/c++/compilers/msvc900_prj/static/build/util/xutil.lib.vcproj
+++ /dev/null
@@ -1,796 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="xutil.lib"
-	ProjectGUID="{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="..\..\lib\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\xutil.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions=""
-				AdditionalIncludeDirectories=""
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				AdditionalOptions=""
-				OutputFile="$(OutDir)\xutil.lib"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="..\..\lib\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions=""
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="..\..\..\..\..\include\"
-				PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;"
-				IgnoreStandardIncludePath="false"
-				StringPooling="false"
-				MinimalRebuild="false"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="2"
-				ProgramDataBaseFileName="$(IntDir)\xutil.pdb"
-				StructMemberAlignment="0"
-				BufferSecurityCheck="true"
-				EnableFunctionLevelLinking="true"
-				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
-				BrowseInformation="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				CallingConvention="0"
-				CompileAs="0"
-				DisableSpecificWarnings=""
-				UndefinePreprocessorDefinitions=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalOptions=""
-				PreprocessorDefinitions=""
-				AdditionalIncludeDirectories=""
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				AdditionalOptions=""
-				OutputFile="$(OutDir)\xutil.lib"
-				AdditionalLibraryDirectories=""
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="FALSE"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			>
-			<File
-				RelativePath="..\..\..\..\..\src\util\ascii85.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\bytesrc.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\checksum.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\ddump_viewer.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\dictionary.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\file_obsolete.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\format_guess.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\itree.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\logrotate.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\md5.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\random_gen.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						UsePrecompiledHeader="1"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\smalldns.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\strbuffer.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\strsearch.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\thread_nonstop.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\thread_pool.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\unicode.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\utf8.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\src\util\util_exception.cpp"
-				>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="NCBI_USE_PCH"
-						PrecompiledHeaderThrough="ncbi_pch.hpp"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inc;xsd"
-			>
-			<File
-				RelativePath="..\..\..\..\..\include\util\ascii85.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\bytesrc.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\checksum.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\ddump_viewer.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\dictionary.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\file_obsolete.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\format_guess.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\itree.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\lightstr.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\linkedset.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\logrotate.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\md5.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\ncbi_table.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\random_gen.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\range.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\range_coll.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\rangemap.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\reader_writer.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\regexp.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\resize_iter.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\resource_pool.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\rwstream.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\smalldns.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\static_map.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\static_set.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\strbuffer.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\strsearch.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\thread_nonstop.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\thread_pool.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\unicode.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\utf8.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\util_exception.hpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\weakmap.hpp"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Inline Files"
-			Filter="inl"
-			>
-			<File
-				RelativePath="..\..\..\..\..\include\util\checksum.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\itree.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\rangemap.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\strbuffer.inl"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\..\include\util\weakmap.inl"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/third_party_msvcstatic_install.vcproj b/c++/compilers/msvc900_prj/static/third_party_msvcstatic_install.vcproj
deleted file mode 100644
index 2890290..0000000
--- a/c++/compilers/msvc900_prj/static/third_party_msvcstatic_install.vcproj
+++ /dev/null
@@ -1,313 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="third_party_msvcstatic_install"
-	ProjectGUID="{9E4B5381-9B6C-4867-BF8A-F1AAA1FD581E}"
-	Keyword="MakeFileProj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-		<Platform
-			Name="x64"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="DebugMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_install IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_rebuild IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" msvc_clean IntDir="$(IntDir)" MSVC_SRC="msvc9.64\9""
-				Output="dlls-install.exe"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\third_party_static_install.mak">
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/static/third_party_static_install.mak b/c++/compilers/msvc900_prj/static/third_party_static_install.mak
deleted file mode 100644
index c8794e2..0000000
--- a/c++/compilers/msvc900_prj/static/third_party_static_install.mak
+++ /dev/null
@@ -1,62 +0,0 @@
-# $Id: third_party_static_install.mak 463528 2015-03-30 14:10:31Z ucko $
-#################################################################
-
-
-INSTALL          = .\bin
-INSTALL_BINPATH  = $(INSTALL)\$(INTDIR)
-THIRDPARTY_MAKEFILES_DIR =  .
-
-
-META_MAKE = $(THIRDPARTY_MAKEFILES_DIR)\..\third_party_install.meta.mk
-!IF EXIST($(META_MAKE))
-!INCLUDE $(META_MAKE)
-!ELSE
-!ERROR  $(META_MAKE)  not found
-!ENDIF
-
-THIRD_PARTY_LIBS = \
-	install_berkeleydb \
-	install_gnutls     \
-	install_glew       \
-	install_lzo        \
-	install_mssql      \
-	install_mysql      \
-	install_openssl    \
-	install_sqlite     \
-	install_sqlite3    \
-	install_sybase     \
-	install_wxwidgets  \
-	install_wxwindows  \
-	install_xalan      \
-	install_xerces     \
-	install_libxml     \
-	install_libxslt    \
-	install_vdb
-
-CLEAN_THIRD_PARTY_LIBS = \
-	clean_berkeleydb \
-	clean_gnutls     \
-	clean_glew       \
-	clean_lzo        \
-	clean_mssql      \
-	clean_mysql      \
-	clean_openssl    \
-	clean_sqlite     \
-	clean_sqlite3    \
-	clean_sybase     \
-	clean_wxwidgets  \
-	clean_wxwindows  \
-	clean_xalan      \
-	clean_xerces     \
-	clean_libxml     \
-	clean_libxslt    \
-	clean_vdb
-
-all : dirs $(THIRD_PARTY_LIBS)
-
-clean : $(CLEAN_THIRD_PARTY_LIBS)
-
-rebuild : clean all
-
-dirs :
-    @if not exist $(INSTALL_BINPATH) (echo Creating directory $(INSTALL_BINPATH)... & mkdir $(INSTALL_BINPATH))
diff --git a/c++/compilers/msvc900_prj/static/third_party_static_install.vcproj b/c++/compilers/msvc900_prj/static/third_party_static_install.vcproj
deleted file mode 100644
index f9cf9a0..0000000
--- a/c++/compilers/msvc900_prj/static/third_party_static_install.vcproj
+++ /dev/null
@@ -1,313 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="third_party_static_install"
-	ProjectGUID="{9E4B5381-9B6C-4867-BF8A-F1AAA1FD580E}"
-	Keyword="MakeFileProj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-		<Platform
-			Name="x64"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="DebugMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="VTune_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_DebugDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="gbench-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseMT|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseMT|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-		<Configuration
-			Name="Unicode_ReleaseDLL|x64"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="0">
-			<Tool
-				Name="VCNMakeTool"
-				BuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" all IntDir="$(IntDir)""
-				ReBuildCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" rebuild IntDir="$(IntDir)""
-				CleanCommandLine="nmake -f "$(InputDir)\third_party_static_install.mak" clean IntDir="$(IntDir)""
-				Output="dlls-install.exe"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\third_party_static_install.mak">
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/third_party_install.meta.mk b/c++/compilers/msvc900_prj/third_party_install.meta.mk
deleted file mode 100644
index 3752e7d..0000000
--- a/c++/compilers/msvc900_prj/third_party_install.meta.mk
+++ /dev/null
@@ -1,326 +0,0 @@
-# $Id: third_party_install.meta.mk 468588 2015-05-26 17:46:51Z ucko $
-
-#################################################################
-#
-# Third party DLLs installation makefile
-#
-# Author: Andrei Gourianov
-#
-#################################################################
-
-
-# Build configuration name
-INTDIR = $(INTDIR:.\=)
-ALTDIR = $(INTDIR:VTune_=)
-!IF ("$(INTDIR)"=="$(ALTDIR)")
-ALTDIR = $(INTDIR:Unicode_=)
-!ENDIF
-
-# Extensions of files to copy
-EXTENSIONS         = dll pdb manifest
-
-# MSVC DLLs
-#  MSVC_SRC must be defined elsewhere (eg, in command line)
-#MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\msvc71\7.1\bin
-#MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\msvc8\8\bin
-
-MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\$(MSVC_SRC)\bin
-
-
-
-#################################################################
-# Source folders
-#
-# x_BINPATH macros are defined in Makefile.third_party.mk 
-# generated by project_tree_builder
-#
-
-PTB_GENERATED = $(THIRDPARTY_MAKEFILES_DIR)\$(INTDIR)\Makefile.third_party.mk
-!IF EXIST($(PTB_GENERATED))
-!INCLUDE $(PTB_GENERATED)
-!ELSE
-!ERROR  $(PTB_GENERATED)  not found
-!ENDIF
-
-
-BERKELEYDB_SRC = $(BERKELEYDB_BINPATH)\$(INTDIR)
-!IF !EXIST($(BERKELEYDB_SRC))
-BERKELEYDB_SRC = $(BERKELEYDB_BINPATH)\$(ALTDIR)
-!ENDIF
-
-GNUTLS_SRC = $(GNUTLS_BINPATH)\$(INTDIR)
-!IF !EXIST($(GNUTLS_SRC))
-GNUTLS_SRC = $(GNUTLS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-GLEW_SRC = $(GLEW_BINPATH)\$(INTDIR)
-!IF !EXIST($(GLEW_SRC))
-GLEW_SRC = $(GLEW_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LZO_SRC = $(LZO_BINPATH)\$(INTDIR)
-!IF !EXIST($(LZO_SRC))
-LZO_SRC = $(LZO_BINPATH)\$(ALTDIR)
-!ENDIF
-
-MSSQL_SRC = $(MSSQL_BINPATH)\$(INTDIR)
-!IF !EXIST($(MSSQL_SRC))
-MSSQL_SRC = $(MSSQL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-MYSQL_SRC = $(MYSQL_BINPATH)\$(INTDIR)
-!IF !EXIST($(MYSQL_SRC))
-MYSQL_SRC = $(MYSQL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-OPENSSL_SRC = $(OPENSSL_BINPATH)\$(INTDIR)
-!IF !EXIST($(OPENSSL_SRC))
-OPENSSL_SRC = $(OPENSSL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SQLITE_SRC = $(SQLITE_BINPATH)\$(INTDIR)
-!IF !EXIST($(SQLITE_SRC))
-SQLITE_SRC = $(SQLITE_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SQLITE3_SRC = $(SQLITE3_BINPATH)\$(INTDIR)
-!IF !EXIST($(SQLITE3_SRC))
-SQLITE3_SRC = $(SQLITE3_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SYBASE_SRC = $(SYBASE_BINPATH)\$(INTDIR)
-!IF !EXIST($(SYBASE_SRC))
-SYBASE_SRC = $(SYBASE_BINPATH)\$(ALTDIR)
-!ENDIF
-
-WXWIDGETS_SRC = $(WXWIDGETS_BINPATH)\$(INTDIR)
-!IF !EXIST($(WXWIDGETS_SRC))
-WXWIDGETS_SRC = $(WXWIDGETS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-WXWINDOWS_SRC = $(WXWINDOWS_BINPATH)\$(INTDIR)
-!IF !EXIST($(WXWINDOWS_SRC))
-WXWINDOWS_SRC = $(WXWINDOWS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-XALAN_SRC = $(XALAN_BINPATH)\$(INTDIR)
-!IF !EXIST($(XALAN_SRC))
-XALAN_SRC = $(XALAN_BINPATH)\$(ALTDIR)
-!ENDIF
-
-XERCES_SRC = $(XERCES_BINPATH)\$(INTDIR)
-!IF !EXIST($(XERCES_SRC))
-XERCES_SRC = $(XERCES_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LIBXML_SRC = $(LIBXML_BINPATH)\$(INTDIR)
-!IF !EXIST($(LIBXML_SRC))
-LIBXML_SRC = $(LIBXML_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LIBXSLT_SRC = $(LIBXSLT_BINPATH)\$(INTDIR)
-!IF !EXIST($(LIBXSLT_SRC))
-LIBXSLT_SRC = $(LIBXSLT_BINPATH)\$(ALTDIR)
-!ENDIF
-
-VDB_SRC = $(VDB_BINPATH)
-
-
-
-#################################################################
-
-INSTALL_CMD = \
-	@if exist "$*" ( for %%e in ($(EXTENSIONS)) do @( \
-	    if exist "$*\*.%%e" ( \
-	      for /f "delims=" %%i in ('dir /a-d/b "$*\*.%%e"') do @( \
-	        xcopy /Y /D /F "$*\%%i" "$(INSTALL_BINPATH)" ) \
-	    )) \
-	) else (echo WARNING:   "$*" not found)
-
-CLEAN_CMD = \
-	@if exist "$*" ( for %%e in ($(EXTENSIONS)) do @( \
-	    if exist "$*\*.%%e" ( \
-	      for /f "delims=" %%i in ('dir /a-d/b "$*\*.%%e"') do @( \
-	        if exist "$(INSTALL_BINPATH)\%%i" ( \
-	          echo $(INSTALL_BINPATH)\%%i & del /F "$(INSTALL_BINPATH)\%%i" )))) \
-	) else (echo WARNING:   "$*" not found)
-
-
-
-#################################################################
-# Targets
-#
-
-$(BERKELEYDB_SRC).berkeleydb_install :
-	@echo ---- & echo Copying BerkeleyDB DLLs & $(INSTALL_CMD)
-$(BERKELEYDB_SRC).berkeleydb_clean :
-	@echo ---- & echo Deleting BerkeleyDB DLLs & $(CLEAN_CMD)
-install_berkeleydb : $(BERKELEYDB_SRC).berkeleydb_install
-clean_berkeleydb : $(BERKELEYDB_SRC).berkeleydb_clean
-
-
-
-$(GNUTLS_SRC).gnutls_install :
-	@echo ---- & echo Copying GNUTLS DLLs & $(INSTALL_CMD)
-$(GNUTLS_SRC).gnutls_clean :
-	@echo ---- & echo Deleting GNUTLS DLLs & $(CLEAN_CMD)
-install_gnutls : $(GNUTLS_SRC).gnutls_install
-clean_gnutls : $(GNUTLS_SRC).gnutls_clean
-
-
-
-$(GLEW_SRC).glew_install :
-	@echo ---- & echo Copying GLEW DLLs & $(INSTALL_CMD)
-$(GLEW_SRC).glew_clean :
-	@echo ---- & echo Deleting GLEW DLLs & $(CLEAN_CMD)
-install_glew : $(GLEW_SRC).glew_install
-clean_glew : $(GLEW_SRC).glew_clean
-
-
-
-$(LZO_SRC).lzo_install :
-	@echo ---- & echo Copying LZO DLLs & $(INSTALL_CMD)
-$(LZO_SRC).lzo_clean :
-	@echo ---- & echo Deleting LZO DLLs & $(CLEAN_CMD)
-install_lzo : $(LZO_SRC).lzo_install
-clean_lzo : $(LZO_SRC).lzo_clean
-
-
-
-$(MYSQL_SRC).mysql_install :
-	@echo ---- & echo Copying MySQL DLLs & $(INSTALL_CMD)
-$(MYSQL_SRC).mysql_clean :
-	@echo ---- & echo Deleting MySQL DLLs & $(CLEAN_CMD)
-install_mysql : $(MYSQL_SRC).mysql_install
-clean_mysql : $(MYSQL_SRC).mysql_clean
-
-
-
-$(MSSQL_SRC).mssql_install :
-	@echo ---- & echo Copying MSSQL DLLs & $(INSTALL_CMD)
-$(MSSQL_SRC).mssql_clean :
-	@echo ---- & echo Deleting MSSQL DLLs & $(CLEAN_CMD)
-install_mssql : $(MSSQL_SRC).mssql_install
-clean_mssql : $(MSSQL_SRC).mssql_clean
-
-
-
-$(OPENSSL_SRC).openssl_install :
-	@echo ---- & echo Copying OpenSSL DLLs & $(INSTALL_CMD)
-$(OPENSSL_SRC).openssl_clean :
-	@echo ---- & echo Deleting OpenSSL DLLs & $(CLEAN_CMD)
-install_openssl : $(OPENSSL_SRC).openssl_install
-clean_openssl : $(OPENSSL_SRC).openssl_clean
-
-
-
-$(SQLITE_SRC).sqlite_install :
-	@echo ---- & echo Copying SQLite DLLs & $(INSTALL_CMD)
-$(SQLITE_SRC).sqlite_clean :
-	@echo ---- & echo Deleting SQLite DLLs & $(CLEAN_CMD)
-install_sqlite : $(SQLITE_SRC).sqlite_install
-clean_sqlite : $(SQLITE_SRC).sqlite_clean
-
-
-
-$(SQLITE3_SRC).sqlite3_install :
-	@echo ---- & echo Copying SQLite3 DLLs & $(INSTALL_CMD)
-$(SQLITE3_SRC).sqlite3_clean :
-	@echo ---- & echo Deleting SQLite3 DLLs & $(CLEAN_CMD)
-install_sqlite3 : $(SQLITE3_SRC).sqlite3_install
-clean_sqlite3 : $(SQLITE3_SRC).sqlite3_clean
-
-
-
-$(SYBASE_SRC).sybase_install :
-	@echo ---- & echo Copying Sybase DLLs & $(INSTALL_CMD)
-$(SYBASE_SRC).sybase_clean :
-	@echo ---- & echo Deleting Sybase DLLs & $(CLEAN_CMD)
-install_sybase : $(SYBASE_SRC).sybase_install
-clean_sybase : $(SYBASE_SRC).sybase_clean
-
-
-
-$(WXWIDGETS_SRC).wxwidgets_install :
-	@echo ---- & echo Copying wxWidgets DLLs & $(INSTALL_CMD)
-$(WXWIDGETS_SRC).wxwidgets_clean :
-	@echo ---- & echo Deleting wxWidgets DLLs & $(CLEAN_CMD)
-install_wxwidgets : $(WXWIDGETS_SRC).wxwidgets_install
-clean_wxwidgets : $(WXWIDGETS_SRC).wxwidgets_clean
-
-
-
-$(WXWINDOWS_SRC).wxwindows_install :
-	@echo ---- & echo Copying wxWindows DLLs & $(INSTALL_CMD)
-$(WXWINDOWS_SRC).wxwindows_clean :
-	@echo ---- & echo Deleting wxWindows DLLs & $(CLEAN_CMD)
-install_wxwindows : $(WXWINDOWS_SRC).wxwindows_install
-clean_wxwindows : $(WXWINDOWS_SRC).wxwindows_clean
-
-
-
-$(XALAN_SRC).xalan_install :
-	@echo ---- & echo Copying Xalan DLLs & $(INSTALL_CMD)
-$(XALAN_SRC).xalan_clean :
-	@echo ---- & echo Deleting Xalan DLLs & $(CLEAN_CMD)
-install_xalan : $(XALAN_SRC).xalan_install
-clean_xalan : $(XALAN_SRC).xalan_clean
-
-
-
-$(XERCES_SRC).xerces_install :
-	@echo ---- & echo Copying Xerces DLLs & $(INSTALL_CMD)
-$(XERCES_SRC).xerces_clean :
-	@echo ---- & echo Deleting Xerces DLLs & $(CLEAN_CMD)
-install_xerces : $(XERCES_SRC).xerces_install
-clean_xerces : $(XERCES_SRC).xerces_clean
-
-
-
-$(LIBXML_SRC).libxml_install :
-	@echo ---- & echo Copying LIBXML DLLs & $(INSTALL_CMD)
-$(LIBXML_SRC).libxml_clean :
-	@echo ---- & echo Deleting LIBXML DLLs & $(CLEAN_CMD)
-install_libxml : $(LIBXML_SRC).libxml_install
-clean_libxml : $(LIBXML_SRC).libxml_clean
-
-
-
-$(LIBXSLT_SRC).libxslt_install :
-	@echo ---- & echo Copying LIBXSLT DLLs & $(INSTALL_CMD)
-$(LIBXSLT_SRC).libxslt_clean :
-	@echo ---- & echo Deleting LIBXSLT DLLs & $(CLEAN_CMD)
-install_libxslt : $(LIBXSLT_SRC).libxslt_install
-clean_libxslt : $(LIBXSLT_SRC).libxslt_clean
-
-
-VDB_ORIG = $(INSTALL_BINPATH)\ncbi-vdb-md.dll
-VDB_COPY = $(INSTALL_BINPATH)\ncbi-vdb-dll-md.dll
-$(VDB_SRC).vdb_install :
-	@echo ---- & echo Copying VDB DLLs & $(INSTALL_CMD)
-# The trailing * suppresses a spurious prompt, per
-# http://stackoverflow.com/a/26034267/1231
-	@if exist "$(VDB_ORIG)" xcopy /Y /D /F "$(VDB_ORIG)" "$(VDB_COPY)"*
-$(VDB_SRC).vdb_clean :
-	@echo ---- & echo Deleting VDB DLLs & $(CLEAN_CMD)
-	@if exist "$(VDB_COPY)" ( echo $(VDB_COPY) & del /f "$(VDB_COPY)" )
-install_vdb : $(VDB_SRC).vdb_install
-clean_vdb : $(VDB_SRC).vdb_clean
-
-
-
-# -----------------------------------------
-# MSVC RT DLLs are not included into 'all'
-
-msvc_install : dirs $(MSVCRT_SRC).msvc_install
-
-install_msvc : msvc_install
-msvc_clean : $(MSVCRT_SRC).msvc_clean
-clean_msvc : msvc_clean
-msvc_rebuild : msvc_clean msvc_install
-
-$(MSVCRT_SRC).msvc_install :
-	@echo ---- & echo Copying MSVC DLLs & $(INSTALL_CMD)
-$(MSVCRT_SRC).msvc_clean :
-	@echo ---- & echo Deleting MSVC DLLs & $(CLEAN_CMD)
-	
diff --git a/c++/compilers/msvc900_prj/user/build/UtilityProjects/_CONFIGURE_.vcproj b/c++/compilers/msvc900_prj/user/build/UtilityProjects/_CONFIGURE_.vcproj
deleted file mode 100644
index ea14836..0000000
--- a/c++/compilers/msvc900_prj/user/build/UtilityProjects/_CONFIGURE_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-"
-	ProjectGUID="{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_user.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Releas [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_user.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Releas [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_user.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Releas [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_user.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Releas [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj b/c++/compilers/msvc900_prj/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
deleted file mode 100644
index 36b0291..0000000
--- a/c++/compilers/msvc900_prj/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="-CONFIGURE-DIALOG-"
-	ProjectGUID="{EB043EAF-58D4-4179-AC32-538D9059BB8B}"
-	RootNamespace="MasterProject"
-	Keyword="ManagedCProj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="DebugDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="DebugDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="ReleaseDLL|x64"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="10"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Configure"
-			>
-			<File
-				RelativePath="configure_dialog._"
-				>
-				<FileConfiguration
-					Name="DebugDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_user.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Releas [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|Win32"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_user.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Releas [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="DebugDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_user.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Releas [...]
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseDLL|x64"
-					>
-          <Tool Name="VCCustomBuildTool" AdditionalDependencies="" CommandLine="set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..&#xa;set SLN_PATH=$(ProjectDir)..\ncbi_user.sln&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..&#xa;copy /Y $(InputFileName) $(InputName).bat&#xa;call $(InputName).bat&#xa;if errorlevel 1 exit 1&#xa;" Outputs="$(InputPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\Releas [...]
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/c++/compilers/msvc900_prj/user/build/UtilityProjects/configure._ b/c++/compilers/msvc900_prj/user/build/UtilityProjects/configure._
deleted file mode 100644
index 7766ecc..0000000
--- a/c++/compilers/msvc900_prj/user/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_user.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/user/build/UtilityProjects/configure_dialog._ b/c++/compilers/msvc900_prj/user/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index a954163..0000000
--- a/c++/compilers/msvc900_prj/user/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_user.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/msvc900_prj/user/build/ncbi_user.sln b/c++/compilers/msvc900_prj/user/build/ncbi_user.sln
deleted file mode 100644
index 51956ce..0000000
--- a/c++/compilers/msvc900_prj/user/build/ncbi_user.sln
+++ /dev/null
@@ -1,39 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-", "UtilityProjects\_CONFIGURE_.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "-CONFIGURE-DIALOG-", "UtilityProjects\_CONFIGURE_DIALOG_.vcproj", "{EB043EAF-58D4-4179-AC32-538D9059BB8B}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/unix/GCC.sh b/c++/compilers/unix/GCC.sh
index 45fedef..7d0a5e6 100755
--- a/c++/compilers/unix/GCC.sh
+++ b/c++/compilers/unix/GCC.sh
@@ -3,7 +3,7 @@
 # Setup the local working environment for the "configure" script
 #   Compiler:   GCC
 #
-# $Revision: 466369 $  // by Denis Vakatov, NCBI (vakatov at ncbi.nlm.nih.gov)
+# $Revision: 491045 $  // by Denis Vakatov, NCBI (vakatov at ncbi.nlm.nih.gov)
 #############################################################################
 
 
@@ -24,7 +24,10 @@ case "$1" in
   [1-9].*)
      # Look for the specified version in various reasonable places
      # (tuned for NCBI's installations).
-     if /usr/local/gcc-$1/bin/$CXX -dumpversion >/dev/null 2>&1; then
+     if /opt/ncbi/gcc/$1/bin/$CXX -dumpversion >/dev/null 2>&1; then
+       CXX=/opt/ncbi/gcc/$1/bin/$CXX
+       CC=/opt/ncbi/gcc/$1/bin/$CC
+     elif /usr/local/gcc-$1/bin/$CXX -dumpversion >/dev/null 2>&1; then
        CXX=/usr/local/gcc-$1/bin/$CXX
        CC=/usr/local/gcc-$1/bin/$CC
      elif /usr/local/gcc/$1/bin/$CXX -dumpversion >/dev/null 2>&1; then
diff --git a/c++/compilers/unix/ICC.sh b/c++/compilers/unix/ICC.sh
index d9ddafe..385338e 100755
--- a/c++/compilers/unix/ICC.sh
+++ b/c++/compilers/unix/ICC.sh
@@ -5,7 +5,7 @@
 #   OS:         Linux
 #   Processor:  Intel X86(-64)
 #
-# $Revision: 441489 $  // Dmitriy Beloslyudtsev, NCBI (beloslyu at ncbi.nlm.nih.gov)
+# $Revision: 492739 $  // Dmitriy Beloslyudtsev, NCBI (beloslyu at ncbi.nlm.nih.gov)
 #############################################################################
 
 
@@ -38,6 +38,7 @@ case "$1" in
   12*         ) search=$intel_root/Compiler/$1/bin               ;;
   *13.[15]*   ) search=$intel_root/Compiler/13.5.192/bin/$arch   ;;
   13* | 2013  ) search=$intel_root/2013/bin                      ;;
+  15* | 2015  ) search=$intel_root/Compiler/15.0/bin             ;;
   *           ) search=                                          ;;
 esac
 
@@ -69,9 +70,9 @@ if test "$status" -ne 0 ; then
 
 HINT:  if you are at NCBI, try to run the following command:
    sh, bash:
-      . $intel_root/Compiler/13.5.192/bin/iccvars.sh $arch
+      . $intel_root/Compiler/15.0/bin/iccvars.sh $arch
    tcsh:
-      source $intel_root/Compiler/13.5.192/bin/iccvars.csh $arch
+      source $intel_root/Compiler/15.0/bin/iccvars.csh $arch
 
 EOF
     exit 1
diff --git a/c++/compilers/unix/WorkShop.sh b/c++/compilers/unix/WorkShop.sh
deleted file mode 100755
index 6ede89f..0000000
--- a/c++/compilers/unix/WorkShop.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#! /bin/sh
-#############################################################################
-# Setup the local working environment for the "configure" script
-#   Compiler:    WorkShop 5.0, 5.1, 5.2, 5.3, 5.4
-#   OS:          Solaris 2.6 (or higher)
-#   Processors:  Sparc,  Intel
-#
-# $Revision: 388621 $  // by Denis Vakatov, NCBI (vakatov at ncbi.nlm.nih.gov)
-#############################################################################
-
-
-## Path to the compiler
-if test -z "$WS_BIN" ; then
-    WS_BIN="`which CC  2>/dev/null`"
-    if test ! -x "$WS_BIN" ; then
-        WS_BIN="`type CC | sed 's/.* \([^ ]*\)$/\1/'`"
-    fi
-    WS_BIN=`dirname $WS_BIN`
-fi
-
-CC="$WS_BIN/cc"
-CXX="$WS_BIN/CC"
-CCC="$CXX"
-if test ! -x "$CXX" ; then
-    echo "ERROR:  cannot find WorkShop C++ compiler at:"
-    echo "  $CXX"
-    exit 1
-fi
-
-
-## Currently supported version(s)
-CC_version=`$CXX -V 2>&1`
-case "$CC_version" in
- "CC: Sun C++ 5.9"* )
-    NCBI_COMPILER="WorkShop59"
-    ;;
- "CC: Sun C++ 5.10"* )
-    NCBI_COMPILER="WorkShop510"
-    ;;
- "CC: Sun C++ 5.11"* )
-    NCBI_COMPILER="WorkShop511"
-    ;;
- * )
-    echo "ERROR:  unsupported version of WorkShop C++ compiler:"
-    echo "  $CXX -V -->  $CC_version"
-    exit 2
-    ;;
-esac
-
-
-## 32- or 64-bit architecture (64-bit is for SPARC Solaris 2.7 only!)
-case "$1" in
- --help )  HELP="--help" ;;
- 32     )  ARCH="" ;;
- 64     )  ARCH="--with-64" ;;
- * )
-    echo "USAGE: $NCBI_COMPILER.sh {32|64} [build_dir] [--configure-flags] [--help]"
-    exit 3
-    ;;
-esac
-shift
-
-
-## Build directory (optional)
-if test -n "$1" ; then
-  case "$1" in
-   -* | *=* )  BUILD_ROOT="" ;;
-   *        )  BUILD_ROOT="--with-build-root=$1" ; shift ;;
-  esac
-fi
-
-
-## Configure
-export CC CXX CCC
-
-${CONFIG_SHELL-/bin/sh} `dirname $0`/../../configure $HELP $BUILD_ROOT $ARCH "$@"
diff --git a/c++/compilers/unix/WorkShop510.sh b/c++/compilers/unix/WorkShop510.sh
deleted file mode 100755
index 57862d6..0000000
--- a/c++/compilers/unix/WorkShop510.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#! /bin/sh
-#############################################################################
-# Setup the local working environment for the "configure" script
-#   Compiler:    Sun C++ 5.10 (Studio 12 Update 1)
-#   OS:          Solaris
-#   Processors:  Sparc,  Intel
-#
-# $Revision: 164326 $  // by Denis Vakatov, NCBI (vakatov at ncbi.nlm.nih.gov)
-#############################################################################
-
-
-## Compiler location and attributes
-WS_BIN="/netopt/studio12u1/prod/bin"
-export WS_BIN
-
-## Configure using generic script "WorkShop.sh"
-${CONFIG_SHELL-/bin/sh} `dirname $0`/WorkShop.sh "$@"
diff --git a/c++/compilers/unix/WorkShop511.sh b/c++/compilers/unix/WorkShop511.sh
deleted file mode 100755
index 01933be..0000000
--- a/c++/compilers/unix/WorkShop511.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#! /bin/sh
-#############################################################################
-# Setup the local working environment for the "configure" script
-#   Compiler:    Sun C++ 5.11 (Studio 12 Update 2)
-#   OS:          Solaris
-#   Processors:  Sparc,  Intel
-#
-# $Revision: 205281 $  // by Denis Vakatov, NCBI (vakatov at ncbi.nlm.nih.gov)
-#############################################################################
-
-
-## Compiler location and attributes
-WS_BIN="/opt/solstudio12.2/prod/bin"
-export WS_BIN
-
-## Configure using generic script "WorkShop.sh"
-${CONFIG_SHELL-/bin/sh} `dirname $0`/WorkShop.sh "$@"
diff --git a/c++/compilers/unix/WorkShop59.sh b/c++/compilers/unix/WorkShop59.sh
deleted file mode 100755
index 5df2769..0000000
--- a/c++/compilers/unix/WorkShop59.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#! /bin/sh
-#############################################################################
-# Setup the local working environment for the "configure" script
-#   Compiler:    Sun C++ 5.9 (Studio 12)
-#   OS:          Solaris
-#   Processors:  Sparc,  Intel
-#
-# $Revision: 164324 $  // by Denis Vakatov, NCBI (vakatov at ncbi.nlm.nih.gov)
-#############################################################################
-
-
-## Compiler location and attributes
-WS_BIN="/netopt/studio12/SUNWspro/bin"
-export WS_BIN
-
-## Configure using generic script "WorkShop.sh"
-${CONFIG_SHELL-/bin/sh} `dirname $0`/WorkShop.sh "$@"
diff --git a/c++/compilers/unix/cxx_filter.WorkShop.awk b/c++/compilers/unix/cxx_filter.WorkShop.awk
deleted file mode 100644
index bafd679..0000000
--- a/c++/compilers/unix/cxx_filter.WorkShop.awk
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/nawk -f
-
-# $Id: cxx_filter.WorkShop.awk 177837 2009-12-04 20:36:16Z ucko $
-# Author:  Aaron Ucko, NCBI 
-#
-# Filter out redundant warnings issued by Sun C++ 5.x (Studio) compiler.
-
-# Treat multiline messages (with "Where:") as single units; cope with
-# HTML output when run under the GUI.  (Openers stick to following
-# rather than preceding message lines.)
-{
-  if (NR == 1) {
-    message = $0;
-  } else if (/^<[A-Za-z]+>$/) {
-    openers = openers $0 "\n";
-  } else if (/    Where: / || /SUNW-internal-info-sign/ || /^<\/[A-Za-z]+>$/) {
-    message = message "\n" openers $0;
-    openers = "";
-  } else {
-    print_if_interesting();
-    message = openers $0;
-    openers = "";
-  }
-}
-END { if (length(message)) print_if_interesting(); }
-
-
-# Set exit status based on the presence of error messages.
-# (Only the last pipeline stage's status counts.)
-BEGIN { status=0 }
-/^".+", (line [0-9]+(<\/A>)?: )?Error:/      { status=1 }
-/^Fatal Error/                               { status=1 }
-/^ >> Assertion:/                            { status=1 }
-/^Error: /                                   { status=1 }
-/:error:Error:/                              { status=1 }
-/^compiler\([^)]+\) error:/                  { status=1 }
-/^Undefined/                                 { status=1 }
-/^Could not open file /                      { status=1 }
-/: fatal:/                                   { status=1 }
-/: error:/                                   { status=1 }
-/^ >> Signal [0-9]+:/                        { status=1 }
-/: assertion failed/                         { status=1 }
-/: [0-9]+ error/                             { status=1 }
-END { exit status } # This must be the last END block.
-
-
-function print_if_interesting()
-{
-  # Warning counts are almost certainly going to be too high; drop them.
-  if (message ~ /^[0-9]+ Warning\(s\) detected\.$/)
-    return;
-
-  # We only want to suppress warnings; let everything else through.
-  if (message !~ /Warning/) {
-    print message;
-    return;
-  }
-
-  m = message;
-  if (message ~ /<HTML>/) {
-      gsub(/\n/,        " ",  m);
-      gsub(/<[^>]*> */, "",   m); # Strip tags.
-      gsub(/</,      "<",  m); # Expand common entities.
-      gsub(/>/,      ">",  m);
-      gsub(/"/,    "\"", m);
-      gsub(/&/,     "&",  m);
-  }
-
-  if (0 ||
-      m ~ /Warning: ".+" is too large and will not be expanded inline\./ ||
-      m ~ /Warning: ".+" is too large to generate inline, consider writing it yourself\./ ||
-      m ~ /Warning: Comparing different enum types "wx(Alignment|Direction|Stretch)" and "wx(Alignment|Direction|Stretch)"\./ ||
-      m ~ /Warning: Could not find source for ncbi::CTreeIteratorTmpl<ncbi::C(Const)?TreeLevelIterator>::/ ||
-      m ~ /Warning: Could not find source for ncbi::CTypes?IteratorBase<ncbi::CTreeIterator(Tmpl<ncbi::C(Const)?TreeLevelIterator>)?>::/ ||
-      m ~ /Warning: Dereferencing the result of casting from "void\(wxEvtHandler::\*\)\(wx[A-Za-z]+Event&\)" to "void\(wxEvtHandler::\*\)\(wxEvent&\)" is undefined\./ ||
-      m ~ /Warning: Empty declaration \(probably an extra semicolon\)\./ ||
-      m ~ /Warning: Identifier expected instead of "}"\./ ||
-      m ~ /Warning: The last statement should return a value./ ||
-      m ~ /Warning: extra ";" ignored\./ ||
-      m ~ /Where: While instantiating "(__rw)?std::.*(<.*>)?::__((de)?allocate_.*|unLink)\(\)"/ ||
-      m ~ /^".*\/include\/CC\/C?std\/.+", line [0-9]+: Warning: There are two consecutive underbars in ".+"\./ ||
-      m ~ /^".*\/include\/CC\/Cstd\/.*", line [0-9]*: .*should not initialize a non-const reference with a temporary\./ ||
-      m ~ /^".*\/include\/CC\/Cstd\/\.\/fstream", line (277|321|364): .*::rdbuf hides/ ||
-#      m ~ /^".*\/include\/CC\/Cstd\/\.\/ostream", line 331: Warning: The else-branch should return a value/ ||
-#      m ~ /^".*\/include\/CC\/Cstd\/\.\/sstream", line (165|207): .*::rdbuf hides/ ||
-      m ~ /^".*\/include\/CC\/Cstd\/\.\/sstream", line 165: .*::rdbuf hides/ ||
-      m ~ /^".*\/include\/FL\/Fl_.+\.H", line [0-9]+: Warning: Fl_.+ hides the function Fl_.+/ ||
-      m ~ /^".*\/include\/corelib\/hash_impl\/.+", line [0-9]+: Warning: There are two consecutive underbars/ ||
-      m ~ /^".*\/include\/fox\/FX.+\.h", line [0-9]+: Warning: Comparing different enum types "enum" and "enum"\./ ||
-      m ~ /^".*\/include\/fox\/FX.+\.h", line [0-9]+: Warning: FX.+ hides the function FX/ ||
-      m ~ /^".*\/include\/fox\/FXObject\.h".+two consecutive underbars in "__FXMETACLASSINITIALIZER__"\./ ||
-      m ~ /^".*\/include\/html\/jsmenu\.hpp", line [0-9]+: Warning: ncbi::CHTMLPopupMenu::SetAttribute hides the function ncbi::CNCBINode::SetAttribute/ ||
-      m ~ /^".*\/include\/internal\/idx\/idcont.hpp", line [0-9]+: Warning: ncbi::CPmDbIdContainerUid::(Unc|C)ompress hides the virtual function ncbi::CPmDbIdContainer::/ ||
-      m ~ /^".*\/include\/internal\/webenv2\/[a-z]+\.hpp", line [0-9]+: Warning: ncbi::CQ[A-Za-z]+::FromAsn hides the function/ ||
-      m ~ /^".*\/include\/serial\/objostr[a-z]+\.hpp".*hides the function ncbi::CObjectOStream::WriteClassMember/ ||
-      m ~ /^".*\/include\/sybdb\.h".*two consecutive underbars in "db__.*"\./ ||
-      m ~ /^".*\/include\/wx-[0-9.]+\/wx\/.+\.h", line [0-9]+: Warning: wx.+ hides the function wx.+::/ ||
-      m ~ /^".*\/include\/wx-[0-9.]+\/wx\/.+\.h", line [0-9]+: Warning: should not initialize a non-const reference with a temporary\./ ||
-      m ~ /^".*\/include\/wx-[0-9.]+\/wx\/stream\.h", line [0-9]+: Warning: There are two consecutive underbars in "__wx(In|Out)putManip"\./ ||
-      0)
-    return;
-
-  # Default: let it through
-  print message;
-  # if (message ~ /<HTML>/) print "[" m "]";
-}
diff --git a/c++/compilers/unix/cxx_filter.WorkShop.sh b/c++/compilers/unix/cxx_filter.WorkShop.sh
deleted file mode 100755
index 9a0c9a2..0000000
--- a/c++/compilers/unix/cxx_filter.WorkShop.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /bin/sh
-
-# $Id: cxx_filter.WorkShop.sh 154831 2009-03-16 15:27:44Z ucko $
-# Authors:  Denis Vakatov, NCBI; Aaron Ucko, NCBI
-#
-# Filter out redundant warnings issued by Sun C++ 5.x (Studio) compiler.
-# Simplify the output.
-
-# Force locale settings that won't interfere with our use of non-ASCII
-# single-byte characters.
-LC_ALL=C
-export LC_ALL
-
-sed 's/std::basic_string<char, std::char_traits<char>, std::allocator<char>>/std::string/g
-s/std::basic_\([a-z]*stream\)<char, std::char_traits<char>>/std::\1/g
-:level
-s/\(std::[a-z_]*\)<\([^,<>]*\), std::allocator�\2�>/\1<\2>/g
-s/\(std::[a-z_]*\)<\([^,<>]*\), std::less�\2�, std::allocator�\2�>/\1<\2>/g
-s/\(std::[a-z_]*\)<\([^,<>]*\), \([^,<>]*\), std::less�\2�, std::allocator�std::pair�const \2� \3��>/\1<\2� \3>/g
-s/\(std::[a-z_]*\)<\([^,<>]*\), \([^,<>]*�const \2� \([^<>]*\)�\), __rwstd::__select1st�\3� \2�, std::less�\2�, std::allocator�\3�>/\1<\2� [\4]>/g
-:comma
-s/<\([^,<>]*\), \([^<>]*\)>/<\1� \2>/g
-t comma
-s/<\([^<>]*\)>/�\1�/g
-t level
-y/���/<,>/' | nawk -f `dirname $0`/cxx_filter.WorkShop.awk
diff --git a/c++/compilers/unix/cxx_filter.WorkShop59.sh b/c++/compilers/unix/cxx_filter.WorkShop59.sh
deleted file mode 100755
index 11f58fa..0000000
--- a/c++/compilers/unix/cxx_filter.WorkShop59.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/sh
-
-# $Id: cxx_filter.WorkShop59.sh 154831 2009-03-16 15:27:44Z ucko $
-# Authors:  Denis Vakatov, NCBI; Aaron Ucko, NCBI
-#
-# Temporary wrapper for the new central WorkShop redundant warning filter.
-
-exec `dirname $0`/cxx_filter.WorkShop.sh
diff --git a/c++/compilers/unix/psrc b/c++/compilers/unix/psrc
deleted file mode 100644
index 2674cc2..0000000
--- a/c++/compilers/unix/psrc
+++ /dev/null
@@ -1,2 +0,0 @@
-insure++.compiler_default cpp
-insure++.report_file      stderr
diff --git a/c++/compilers/vs2012/Makefile.WinMain.app.msvc b/c++/compilers/vs2012/Makefile.WinMain.app.msvc
deleted file mode 100644
index 3ccfcd0..0000000
--- a/c++/compilers/vs2012/Makefile.WinMain.app.msvc
+++ /dev/null
@@ -1,11 +0,0 @@
-[Rule]
-Priority  = 127
-
-
-[Linker]
-subSystem = 2
-
-
-[AddToProject]
-SourceFiles = ../../src/gui/winmain
-
diff --git a/c++/compilers/vs2012/Makefile.wxWidgets.app.msvc b/c++/compilers/vs2012/Makefile.wxWidgets.app.msvc
deleted file mode 100644
index 1f2ace2..0000000
--- a/c++/compilers/vs2012/Makefile.wxWidgets.app.msvc
+++ /dev/null
@@ -1,11 +0,0 @@
-[Rule]
-Priority  = 127
-
-
-[Linker]
-subSystem = 2
-
-
-[AddToProject]
-; SourceFiles = ../../src/gui/winmain
-
diff --git a/c++/compilers/vs2012/build.sh b/c++/compilers/vs2012/build.sh
deleted file mode 100644
index 9e9cbf4..0000000
--- a/c++/compilers/vs2012/build.sh
+++ /dev/null
@@ -1,257 +0,0 @@
-#! /bin/sh
-# $Id: build.sh 417516 2013-11-07 14:13:14Z ivanov $
-# Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
-#
-# Build C++ Toolkit.
-
-
-#---------------- Arguments ----------------
-
-script="$0"
-cfgs="${1:-DebugDLL ReleaseDLL}"
-arch="$2"
-
-
-#---------------- Configuration ----------------
-
-# Configure with Unicode configurations enabled
-
-NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI_UNICODE=1
-export NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI_UNICODE
-#NCBI_CONFIG____ENABLEDUSERREQUESTS__TWEAKVTUNE=1
-#export NCBI_CONFIG____ENABLEDUSERREQUESTS__TWEAKVTUNE
-
-
-#---------------- Global variables ----------------
-
-build_trees='static dll'
-sol_static="ncbi_cpp.sln gui/ncbi_gui.sln"
-sol_dll="ncbi_cpp_dll.sln gui/ncbi_gui_dll.sln"
-timer="date +'%H:%M'"
-
-# TRUE if parallell project build system is enabled in Visual Studio
-is_ppb=false
-need_ppb_check=true
-
-
-
-#-------------- Functions --------------
-
-error()
-{
-    echo "[`basename $script`] ERROR:  $1"
-    exit 1
-}
-
-generate_vs2012_error_check_file()
-{
-    cat <<-EOF >$1
-	/.*--* (Reb|B)uild( All | )started: Project:/ {
-	  expendable = ""
-	}
-
-	/^--* Project:/ {
-	  expendable = ""
-	}
-
-	/EXPENDABLE project/ {
-	  expendable = \$0
-	}
-
-	/(| : |The source )([fatal ]*error [A-Z]*[0-9]* *: |The .* are both configured to produce|.*: error [0-9]*:|: general error |Error executing |ERROR: This project depends)/ {
-	if (!expendable) {
-	  print \$0
-	  exit
-	  }
-	}
-	EOF
-}
-
-generate_simple_log()
-{
-    echo Parallel project build detected! Creating simplified log.
-    echo
-       
-    log=$1
-    tree=$2
-    sol=$3
-    cfg=$4
-
-    # Get solution directory
-    sol_dir=`echo $sol | sed 's%/[^/]*$%%'`
-    if [ $sol_dir = $sol ] ; then
-        sol_dir=''
-    fi 
-
-    # Get built projects
-    projects=`grep '.*--* Build started:' $log | awk '{ sub(/^.* started:/, ""); gsub(/ /,"#"); print $0}'`
-
-    for p in $projects ; do
-        echo "------$p" | awk '{gsub(/[#]/," "); print}'
-        prj_name=`echo $p | awk '{gsub(/[#,]/," "); print $2}'`
-###        cfg=`echo $p | awk '{gsub(/[#,]/," "); print $4}'`
-
-        # Get path for specified project name from solution
-        s=`grep \"$prj_name\" $tree/build/$sol | awk '{gsub(/,/," "); print $4}' | sed -e 's%"%%g' -e 's%\\\%/%g' -e 's%.vcxproj%%'`
-
-        target_dir=`echo $s | sed 's%/[^/]*$%%'`
-        test $target_dir = $s  &&  target_dir=''
-        target_name=`echo $s | sed 's%^.*/%%'`
-
-        # Path to regular logfile for current project
-        prj_log="$tree/build/$sol_dir/$target_dir/$cfg/$prj_name/$target_name.log"
-
-        # Add it to new combined log
-        if test ! -f "$prj_log" ; then
-            # Not all projects have a log file in the ${prj_name} sub-directory
-            prj_log_short="$tree/build/$sol_dir/$target_dir/$cfg/$target_name.log"
-            if test ! -f "$prj_log_short" ; then
-                echo "BUILD_SYSTEM_ERROR: Cannot find log file for this project: $prj_log"
-                echo
-                continue
-            fi
-            prj_log=$prj_log_short
-        fi
-        # Remove 3 first bytes from logfile (EF BB BF) and some garbage from a multi-projects build
-        cat $prj_log | tr -d '\357\273\277' | sed 's/\( *\)1>/\1  /g'
-        echo
-    done
-    grep '.*========== Build:' $log
-    echo
-}
-
-
-#---------------- Main ----------------
-
-# Get build dir
-build_dir=`dirname $script`
-build_dir=`(cd "$build_dir"; pwd)`
-
-if [ ! -d $build_dir ] ; then
-    error "Build directory $build_dir not found"
-    exit 1
-fi
-cd $build_dir
-
-# Configuration to build configure
-cfg_configure='ReleaseDLL'
-out=".build.$$"
-
-# Get directory for build logfiles
-log_dir="$build_dir/../../logs"
-mkdir $log_dir >/dev/null 2>&1
-log_dir=`(cd "$log_dir"; pwd)`
-rm $log_dir/* >/dev/null 2>&1
-
-
-chmod +x $build_dir/build_exec.bat
-rm -f $build_dir/cfgs.log
-
-
-# Configure
-
-for tree in $build_trees ; do
-    sols=`eval echo "$"sol_${tree}""`
-    for sol in $sols ; do
-        if test ! -f "$tree/build/$sol" ; then
-            echo "INFO: Solution not found, skipped."
-            continue
-        fi
-        alias=`echo $sol | sed -e 's|\\\\.*$||g' -e 's|_.*$||g'`
-        start=`eval $timer`
-        echo
-        echo Start time: $start
-        echo "INFO: Configure \"$tree\\$alias\""
-        echo "Command line: " $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg_configure" "_CONFIGURE_" $out
-        $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg_configure" "_CONFIGURE_" $out >/dev/null
-        echo
-        status=$?
-        # Wait a bit to allow compiler to exit and flush logfile
-        sleep 20
-        if $need_ppb_check; then
-            need_ppb_check=false
-            grep '^1>------ Build started:' $out >/dev/null 2>&1  &&  is_ppb=true
-        fi
-        if $is_ppb; then
-            generate_simple_log $out $tree "$sol" $cfg_configure > $out.simple
-            mv $out $cfg.configure.log
-            mv $out.simple $out
-        fi 
-        cat $out
-        cat $out >> ${log_dir}/${tree}_${cfg_configure}.log
-        echo "Build time: $start - `eval $timer`"
-        echo STATUS = $status
-        if [ $status -ne 0 ] ; then
-            echo "FAILED: Configure $tree\\build\\$sol, $cfg_configure"
-        fi
-        rm -f $out >/dev/null 2>&1
-        if [ $status -ne 0 ] ; then
-            exit 3
-        fi
-    done
-done
-
-
-
-# Generate errors check script
-
-check_awk=$build_dir/build_check.awk
-generate_vs2012_error_check_file $check_awk
-
-
-# Build
-
-for tree in $build_trees ; do
-    for cfg in $cfgs ; do
-        if [ $tree = dll ] ; then
-            echo "$cfg" | grep '.*DLL$' >/dev/null  ||  continue
-        fi
-        sols=`eval echo "$"sol_${tree}""`
-        for sol in $sols ; do
-            if test ! -f "$tree/build/$sol" ; then
-                echo "INFO: Solution not found, skipped."
-                continue
-            fi
-            alias=`echo $sol | sed -e 's|\\\\.*$||g' -e 's|_.*$||g'`
-            start=`eval $timer`
-            echo
-            echo Start time: $start
-            echo "$tree,$sol,$cfg" >> $build_dir/cfgs.log
-            echo "INFO: Building \"$tree\\$cfg\\$alias\""
-            echo "Command line: " $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg" "_BUILD_ALL_" $out
-            echo
-            $build_dir/build_exec.bat "$tree\\build\\$sol" build "$arch" "$cfg" "_BUILD_ALL_" $out >/dev/null
-            status=$?
-            # Wait a bit to allow compiler to exit and flush logfile
-            sleep 20
-            if $is_ppb; then
-                generate_simple_log $out $tree "$sol" $cfg > $out.simple
-                mv $out $cfg.build.log
-                mv $out.simple $out
-            fi 
-            cat $out
-            cat $out >> ${log_dir}/${tree}_${cfg}.log
-            echo "Build time: $start - `eval $timer`"
-            echo STATUS = $status
-            if [ $status -ne 0 ] ; then
-                # Check on errors (skip expendable projects)
-                failed="1"
-                awk -f $check_awk $out >$out.res 2>/dev/null  &&  test ! -s $out.res  &&  failed="0"
-                if [ "$failed" = "1" ]; then
-                    echo "FAILED: Build $tree\\build\\$sol, $cfg"
-                    echo "FAILED: Build $tree\\build\\$sol, $cfg" > failed.build.log
-                    echo     >> failed.build.log
-                    cat $out >> failed.build.log
-                    cat $tree/build/${sol}_watchers.txt > failed.watchers.log
-                fi
-                rm -f $out $out.res >/dev/null 2>&1
-                if [ "$failed" = "1" ]; then
-                    exit 4
-                fi
-            fi
-            rm -f $out >/dev/null 2>&1
-        done
-    done
-done
-
-exit 0
diff --git a/c++/compilers/vs2012/build_exec.bat b/c++/compilers/vs2012/build_exec.bat
deleted file mode 100644
index 764f510..0000000
--- a/c++/compilers/vs2012/build_exec.bat
+++ /dev/null
@@ -1,50 +0,0 @@
- at ECHO OFF
-REM $Id: build_exec.bat 407440 2013-07-22 13:00:11Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Auxiliary script for build.sh to run C++ build for specified project
-REM and configuration. Cygwin cannot run devenv directly inside shell-script.
-REM
-REM ===========================================================================
-
-call msvcvars.bat
-
-if _%1% == _  goto be_abort
-goto be_build
-
-:be_abort
-rem You should specify logfile or you will not see an output
-echo Usage: "%0 <solution> <command> <arch> <cfg> <target> <logfile>"
-exit 1
-
-:be_build
-set arch=Win32
-if _%3_ == _64_ set arch=x64
-
-rem Next command should be executed last! No other code after it, please.
-
-%DEVENV% %1 /%2 "%4|%arch%" /project "%5" /out "%6"
diff --git a/c++/compilers/vs2012/build_util.sh b/c++/compilers/vs2012/build_util.sh
deleted file mode 100644
index bc286e8..0000000
--- a/c++/compilers/vs2012/build_util.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#! /bin/sh
-# $Id: build_util.sh 419782 2013-11-29 14:51:48Z ivanov $
-# Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
-#
-# Utility functions for building C++ Toolkit.
-
-
-#---------------- Arguments ----------------
-
-arg="$1"
-
-script=`basename $0`
-script_dir=`dirname $0`
-script_dir=`(cd "$script_dir"; pwd)`
-
-
-
-#-------------- Functions --------------
-
-error()
-{
-    echo "[$script] ERROR:  $1"
-    exit 1
-}
-
-
-#---------------- Main ----------------
-
-case "$arg" in
-
-  --with-openmp )
-
-      makefile="$script_dir/../../src/build-system/Makefile.mk.in.msvc"
-      if [ ! -f $makefile ] ; then
-          error "$makefile not found"
-          exit 1
-      fi
-      tmp=/tmp/build_util_$$
-      trap "rm -f $tmp $tmp.awk" 0 1 2 15
-
-      cat <<-EOF >$tmp.awk
-	    /^\[Compiler\]/ {
-	       comp = 1
-	    }
-	    /^AdditionalOptions=/ {
-	       if (comp == 1) {
-	          gsub("/openmp","")
-	          gsub("AdditionalOptions=","AdditionalOptions=/openmp ")
-	          gsub("  ", " ")
-	          comp = 0
-	       }
-	    }
-	    /.*/ {
-	       print
-	    }
-	EOF
-      awk -f $tmp.awk $makefile >$tmp || exit 1
-      touch -r $makefile $tmp
-      cp -fp $tmp $makefile  || exit 2
-      ;;
-
-  * )
-      error "Unknown command: $arg"
-      ;;
-esac
-
-exit 0
diff --git a/c++/compilers/vs2012/check.sh b/c++/compilers/vs2012/check.sh
deleted file mode 100644
index f816810..0000000
--- a/c++/compilers/vs2012/check.sh
+++ /dev/null
@@ -1,149 +0,0 @@
-#! /bin/sh
-# $Id: check.sh 417079 2013-11-04 16:46:24Z ivanov $
-# Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
-#
-# Check C++ Toolkit in all previously built configurations
-# (see 'cfgs.log', generated with 'build.sh' script).
-#
-# USAGE:
-#     check.sh {run | concat | concat_err | concat_cfg | load_to_db}
-#
-# Use 'run' command first, than use other commands.
-# For 'concat_cfg' -- use 'run', 'concat' and 'concat_err' commands first.
-
-
-########### Arguments
-
-script="$0"
-method="$1"
-
-
-########## Functions
-
-error()
-{
-    echo "[`basename $script`] ERROR:  $1"
-    exit 1
-}
-
-
-########## Main
-
-errcode=0
-
-# Get build directory
-build_dir=`dirname $script`
-build_dir=`(cd "$build_dir"; pwd)`
-timer="date +'%H:%M'"
-
-if [ ! -d $build_dir ] ; then
-    error "Build directory $build_dir not found"
-fi
-cd $build_dir  ||  error "Cannot change directory"
-
-res_log="$build_dir/check.sh.log"
-res_concat="$build_dir/check.sh.out"
-res_concat_err="$build_dir/check.sh.out_err"
-
-cfgs="`cat cfgs.log`"
-if [ -z "$cfgs" ] ; then
-    error "Build some configurations first"
-fi
-
-# Initialization
-
-case "$method" in
-    run )
-        rm -f "$res_log"
-        rm -f "$build_dir/check.sh.*.log" > /dev/null 2>&1
-        # Init checks
-        $build_dir/../../scripts/common/check/check_make_win_cfg.sh init  || \
-            error "Check initialization failed"
-        ;;
-    clean )
-        # not implemented, 'clean' method is not used on Windows 
-        exit 0
-        ;;
-    concat )
-        cp $res_log $res_concat
-        ;;
-    concat_err )
-        egrep 'ERR \[|TO  -' $res_log > $res_concat_err
-        ;;
-    concat_cfg )
-        #rm -f "$build_dir/check.sh.*.out"     > /dev/null 2>&1
-        rm -f "$build_dir/check.sh.*.out_err" > /dev/null 2>&1
-        ;;
-    load_to_db )
-        ;;
-    * )
-        error "Invalid method name"
-        ;;
-esac
-
-
-# Run checks for each previously built configuration
-
-for cfg in $cfgs ; do
-    if [ -z "$cfg" ] ; then
-        error "Unknown configuration name"
-    fi
-    x_tree=`echo $cfg | sed -e 's/,.*$//'`
-    x_sol=`echo $cfg | sed -e 's/^[^,]*,//' -e 's/,.*$//' -e 's/\.sln//' -e 's|\\\|/|g'`
-    x_cfg=`echo $cfg | sed -e 's/^.*,//'`
-    start=`eval $timer`
-    echo $start
-    echo CHECK_$method: $x_tree/$x_sol/$x_cfg
-
-    cd $build_dir
-    check_dir="$x_tree/build/${x_sol}.check/$x_cfg"
-    if [ ! -d "$check_dir" ] ; then
-        error "Check directory \"$check_dir\" not found"
-    fi
-    if test "$method" != "run"; then
-        test -x "$check_dir/check.sh"  ||  error "Run checks first. $check_dir/check.sh not found."
-    fi
-
-    # Action
-    
-    case "$method" in
-        run )
-            ../../scripts/common/check/check_make_win_cfg.sh create "$x_sol" "$x_tree" "$x_cfg"  || \
-                error "Creating check script for \"$check_dir\" failed"
-            $check_dir/check.sh run  ||  errcode=$?
-            cat $check_dir/check.sh.log >> $res_log
-            cat $check_dir/check.sh.log >> $build_dir/check.sh.${x_tree}_${x_cfg}.log
-            echo "Check time: $start - `eval $timer`"
-            ;;
-        concat )
-            $check_dir/check.sh concat
-            cat $check_dir/check.sh.out >> $res_concat
-            ;;
-        concat_err )
-            $check_dir/check.sh concat_err
-            cat $check_dir/check.sh.out_err >> $res_concat_err
-            ;;
-        concat_cfg )
-            # Copy log entries
-            egrep 'ERR \[|TO  -' $check_dir/check.sh.log >> $build_dir/check.sh.${x_tree}_${x_cfg}.out_err
-            # see below copying of failed tests outputs
-            ;;
-        load_to_db )
-            $check_dir/check.sh load_to_db
-            ;;
-    esac
-done
-
-if test "$method" = "concat_cfg"; then
-    for cfg in $cfgs ; do
-        x_tree=`echo $cfg | sed -e 's/,.*$//'`
-        x_sol=`echo $cfg | sed -e 's/^[^,]*,//' -e 's/,.*$//' -e 's/\.sln//' -e 's|\\\|/|g'`
-        x_cfg=`echo $cfg | sed -e 's/^.*,//'`
-        cd $build_dir
-        check_dir="$x_tree/build/${x_sol}.check/$x_cfg"
-       #cat $check_dir/check.sh.out     >> $build_dir/check.sh.${x_tree}_${x_cfg}.out
-        cat $check_dir/check.sh.out_err >> $build_dir/check.sh.${x_tree}_${x_cfg}.out_err
-    done
-fi
-
-exit $errcode
diff --git a/c++/compilers/vs2012/configure.bat b/c++/compilers/vs2012/configure.bat
deleted file mode 100644
index c62e5ec..0000000
--- a/c++/compilers/vs2012/configure.bat
+++ /dev/null
@@ -1,393 +0,0 @@
- at echo off
-REM $Id: configure.bat 407440 2013-07-22 13:00:11Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Configure MSVC solution and projects
-REM
-REM ===========================================================================
-
-setlocal
-
-set sln_name=ncbi_cpp
-set use_projectlst=scripts/projects/ncbi_cpp.lst
-
-set use_savedcfg=
-set use_gui=no
-set maybe_gui=yes
-set use_debug=yes
-set use_dll=no
-set use_64=no
-set use_staticstd=no
-set use_arch=Win32
-set use_ide=1100
-set use_flags=
-set help_req=no
-set srcroot=../..
-
-REM -----------------------------------------------------------------------------
-REM  silently ignored  options
-set noops=
-set noops=%noops% --without-optimization
-set noops=%noops% --with-profiling
-set noops=%noops% --with-tcheck
-set noops=%noops% --with-static
-set noops=%noops% --with-plugin-auto-load
-set noops=%noops% --with-bin-release
-set noops=%noops% --with-mt
-set noops=%noops% --without-exe
-set noops=%noops% --with-runpath
-set noops=%noops% --with-lfs
-set noops=%noops% --with-autodep
-set noops=%noops% --with-build-root
-set noops=%noops% --with-fake-root
-set noops=%noops% --without-suffix
-set noops=%noops% --with-hostspec
-set noops=%noops% --without-version
-set noops=%noops% --with-build-root-sfx
-set noops=%noops% --without-execopy
-set noops=%noops% --with-bincopy
-set noops=%noops% --with-lib-rebuilds
-set noops=%noops% --with-lib-rebuilds
-set noops=%noops% --without-deactivation
-set noops=%noops% --without-makefile-auto-update
-set noops=%noops% --without-flat-makefile
-set noops=%noops% --with-check
-set noops=%noops% --with-check-tools
-set noops=%noops% --with-ncbi-public
-set noops=%noops% --with-strip
-set noops=%noops% --with-pch
-set noops=%noops% --with-caution
-set noops=%noops% --without-caution
-set noops=%noops% --without-ccache
-set noops=%noops% --with-distcc
-set noops=%noops% --without-ncbi-c
-set noops=%noops% --without-sss
-set noops=%noops% --without-utils
-set noops=%noops% --without-sssdb
-set noops=%noops% --with-included-sss
-set noops=%noops% --with-z
-set noops=%noops% --without-z
-set noops=%noops% --with-bz2
-set noops=%noops% --without-bz2
-set noops=%noops% --with-lzo
-set noops=%noops% --without-lzo
-set noops=%noops% --with-pcre
-set noops=%noops% --without-pcre
-set noops=%noops% --with-gnutls
-set noops=%noops% --without-gnutls
-set noops=%noops% --with-openssl
-set noops=%noops% --without-openssl
-set noops=%noops% --without-sybase
-set noops=%noops% --with-sybase-local
-set noops=%noops% --with-sybase-new
-set noops=%noops% --without-ftds
-set noops=%noops% --with-ftds
-set noops=%noops% --without-ftds-renamed
-set noops=%noops% --without-mysql
-set noops=%noops% --with-mysql
-set noops=%noops% --without-opengl
-set noops=%noops% --with-opengl
-set noops=%noops% --without-mesa
-set noops=%noops% --with-mesa
-set noops=%noops% --without-glut
-set noops=%noops% --with-glut
-set noops=%noops% --without-wxwin
-set noops=%noops% --with-wxwin
-set noops=%noops% --without-wxwidgets
-set noops=%noops% --with-wxwidgets
-set noops=%noops% --with-wxwidgets-ucs
-set noops=%noops% --without-wxwidgets-ucs
-set noops=%noops% --without-freetype
-set noops=%noops% --with-freetype
-set noops=%noops% --without-fastcgi
-set noops=%noops% --with-fastcgi
-set noops=%noops% --with-fastcgi
-set noops=%noops% --without-bdb
-set noops=%noops% --with-bdb
-set noops=%noops% --without-sp
-set noops=%noops% --without-orbacus
-set noops=%noops% --with-orbacus
-set noops=%noops% --with-odbc
-set noops=%noops% --with-python
-set noops=%noops% --without-python
-set noops=%noops% --with-boost
-set noops=%noops% --without-boost
-set noops=%noops% --with-boost-tag
-set noops=%noops% --without-boost-tag
-set noops=%noops% --with-sqlite
-set noops=%noops% --without-sqlite
-set noops=%noops% --with-sqlite3
-set noops=%noops% --without-sqlite3
-set noops=%noops% --with-icu
-set noops=%noops% --without-icu
-set noops=%noops% --with-expat
-set noops=%noops% --without-expat
-set noops=%noops% --with-sablot
-set noops=%noops% --without-sablot
-set noops=%noops% --with-libxml
-set noops=%noops% --without-libxml
-set noops=%noops% --with-libxslt
-set noops=%noops% --without-libxslt
-set noops=%noops% --with-xerces
-set noops=%noops% --without-xerces
-set noops=%noops% --with-xalan
-set noops=%noops% --without-xalan
-set noops=%noops% --with-oechem
-set noops=%noops% --without-oechem
-set noops=%noops% --with-sge
-set noops=%noops% --without-sge
-set noops=%noops% --with-muparser
-set noops=%noops% --without-muparser
-set noops=%noops% --with-hdf5
-set noops=%noops% --without-hdf5
-set noops=%noops% --with-gif
-set noops=%noops% --without-gif
-set noops=%noops% --with-jpeg
-set noops=%noops% --without-jpeg \
-set noops=%noops% --with-png
-set noops=%noops% --without-png
-set noops=%noops% --with-tiff
-set noops=%noops% --without-tiff
-set noops=%noops% --with-xpm
-set noops=%noops% --without-xpm
-set noops=%noops% --without-local-lbsm
-set noops=%noops% --without-ncbi-crypt
-set noops=%noops% --without-connext
-set noops=%noops% --without-serial
-set noops=%noops% --without-objects
-set noops=%noops% --without-dbapi
-set noops=%noops% --without-app
-set noops=%noops% --without-ctools
-set noops=%noops% --without-gui
-set noops=%noops% --without-algo
-set noops=%noops% --without-internal
-set noops=%noops% --with-gbench
-set noops=%noops% --without-gbench
-set noops=%noops% --with-x
-
-
-set initial_dir=%CD%
-set script_name=%0
-cd %~p0
-for /f "delims=" %%a in ('cd') do (set script_dir=%%a)
-cd %srcroot%
-for /f "delims=" %%a in ('cd') do (set srcroot=%%a)
-cd %initial_dir%
-
-REM --------------------------------------------------------------------------------
-REM parse arguments
-
-set unknown=
-set ignore_unknown=no
-set dest=
-:PARSEARGS
-if "%1"=="" goto ENDPARSEARGS
-if "%dest%"=="lst"                      (set use_projectlst=%1&  set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="cfg"                      (set use_savedcfg=%~1&   set dest=& goto CONTINUEPARSEARGS)
-if "%1"=="--help"                       (set help_req=yes&       goto CONTINUEPARSEARGS)
-if "%1"=="--with-configure-dialog"      (set use_gui=yes&        goto CONTINUEPARSEARGS)
-if "%1"=="--without-configure-dialog"   (set use_gui=no&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-saved-settings"        (set dest=cfg&           goto CONTINUEPARSEARGS)
-if "%1"=="--without-debug"              (set use_debug=no&       goto CONTINUEPARSEARGS)
-if "%1"=="--with-debug"                 (set use_debug=yes&      goto CONTINUEPARSEARGS)
-if "%1"=="--without-dll"                (set use_dll=no&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-dll"                   (set use_dll=yes&        goto CONTINUEPARSEARGS)
-if "%1"=="--with-64"                    (set use_64=yes&         goto CONTINUEPARSEARGS)
-if "%1"=="--with-static-exe"            (set use_staticstd=yes&  goto CONTINUEPARSEARGS)
-if "%1"=="--with-projects"              (set dest=lst&           goto CONTINUEPARSEARGS)
-if "%1"=="--ignore-unsupported-options" (set ignore_unknown=yes& goto CONTINUEPARSEARGS)
-set unknown=%unknown% %1
-:CONTINUEPARSEARGS
-set maybe_gui=no
-shift
-goto PARSEARGS
-:ENDPARSEARGS
-if "%maybe_gui%"=="yes" (
-  set use_gui=yes
-)
-
-REM --------------------------------------------------------------------------------
-REM check and report unknown options
-
-set invalid_unknown=no
-for %%u in (%unknown%) do (
-  call :CHECKUNKNOWN %%u
-)
-if "%invalid_unknown%"=="yes" exit /b 1
-goto DONEUNKNOWN
-
-:CHECKUNKNOWN
-for %%n in (%noops%) do (
-  if "%1"=="%%n" (
-    echo Ignored:  %1
-    goto :eof
-  )
-)
-for /f "eol=-" %%a in ('echo %1') do goto :eof
-if "%ignore_unknown%"=="no" (
-  echo Unsupported option:  %1
-  set invalid_unknown=yes
-) else (
-  echo Ignored unsupported:  %1
-)
-goto :eof
-:DONEUNKNOWN
-
-REM --------------------------------------------------------------------------------
-REM print usage
-
-:PRINTUSAGE
-if "%help_req%"=="yes" (
-  echo  USAGE:
-  echo    %script_name% [OPTION]...
-  echo  SYNOPSIS:
-  echo    configure NCBI C++ toolkit for MSVC build system.
-  echo  OPTIONS:
-  echo    --help                      -- print Usage
-  echo    --with-configure-dialog     -- use Configuration GUI application
-  echo    --without-configure-dialog  -- do not use Configuration GUI application
-  echo    --with-saved-settings=FILE  -- load configuration settings from FILE
-  echo    --without-debug             -- build non-debug versions of libs and apps
-  echo    --with-debug                -- build debug versions of libs and apps
-  echo    --without-dll               -- build all toolkit libraries as static ones
-  echo    --with-dll                  -- assemble toolkit libraries into DLLs
-  echo                                     where requested
-  echo    --with-64                   -- compile to 64-bit code
-  echo    --with-static-exe           -- use static C++ standard libraries
-  echo    --with-projects=FILE        -- build projects listed in "%srcroot%\FILE"
-  echo             FILE can also be a name of a subdirectory
-  echo             examples:   --with-projects=src/corelib
-  echo                         --with-projects=scripts/projects/ncbi_cpp.lst
-  echo    --ignore-unsupported-options   -- ignore unsupported options
-  exit /b 0
-)
-
-REM --------------------------------------------------------------------------------
-REM identify target MSVC version (based on the script location msvcNNN_prj)
-
-for /f "delims=" %%a in ('echo %script_dir%') do (set msvc_ver=%%~na)
-set msvc_ver=%msvc_ver:msvc=%
-set msvc_ver=%msvc_ver:_prj=%
-if not "%msvc_ver%"=="" (set use_ide=%msvc_ver%)
-
-REM --------------------------------------------------------------------------------
-REM target architecture, solution path, configuration and flags
-
-if "%use_64%"=="yes" (
-  set use_arch=x64
-) else (
-  set use_arch=Win32
-)
-if "%use_dll%"=="yes" (
-  if "%use_debug%"=="yes" (
-    set CONFIGURATION=DebugDLL
-  ) else (
-    set CONFIGURATION=ReleaseDLL
-  )
-) else (
-  if "%use_debug%"=="yes" (
-    if "%use_staticstd%"=="yes" (
-      set CONFIGURATION=DebugMT
-    ) else (
-      set CONFIGURATION=DebugDLL
-    )
-  ) else (
-    if "%use_staticstd%"=="yes" (
-      set CONFIGURATION=ReleaseMT
-    ) else (
-      set CONFIGURATION=ReleaseDLL
-    )
-  )
-)
-if "%use_gui%"=="yes" (
-  set use_flags=%use_flags% -cfg
-)
-if "%use_dll%"=="yes" (
-  set build_results=dll
-  set sln_name=%sln_name%_dll
-  set use_flags=%use_flags% -dll
-) else (
-  set build_results=static
-)
-set use_projectlst=%use_projectlst:/=\%
-
-
-REM --------------------------------------------------------------------------------
-REM prepare and run ptb.bat
-cd %script_dir%
-set PTB_PLATFORM=%use_arch%
-set PTB_FLAGS=%use_flags%
-set PTB_PATH=./static/bin/ReleaseDLL
-set SLN_PATH=%script_dir%\%build_results%\build\%sln_name%.sln
-set TREE_ROOT=%srcroot%
-set BUILD_TREE_ROOT=.
-set PTB_PROJECT_REQ=%use_projectlst%
-
-if "%use_savedcfg%"=="" (
-  set PTB_SAVED_CFG_REQ=
-) else (
-  if exist "%use_savedcfg%" (
-    set PTB_SAVED_CFG_REQ="%use_savedcfg%"
-  ) else (
-    if exist "%initial_dir%\%use_savedcfg%" (
-      set PTB_SAVED_CFG_REQ="%initial_dir%\%use_savedcfg%"
-    ) else (
-      echo ERROR: "%use_savedcfg%" not found
-      exit /b 1
-    )
-  )
-)
-
-call ./ptb.bat
-if errorlevel 1 (
-  cd %initial_dir%
-  exit /b 1
-)
-
-REM --------------------------------------------------------------------------------
-REM generate configure_make.bat
-
-cd %script_dir%
-set mk_cmnd=make.bat build %sln_name% %build_results%
-if "%use_64%"=="yes" (
-  set mk_cmnd=%mk_cmnd% 64
-) else (
-  set mk_cmnd=%mk_cmnd% 32
-)
-set mk_cmnd=%mk_cmnd% %CONFIGURATION%
-echo %mk_cmnd% > configure_make.bat
-
-
-REM ------------------------------------------------------------------------------
-echo To build the solution %SLN_PATH%
-echo execute the following commands:
-echo cd %script_dir%
-echo make
-
-cd %initial_dir%
-endlocal
-exit /b 0
diff --git a/c++/compilers/vs2012/datatool.bat b/c++/compilers/vs2012/datatool.bat
deleted file mode 100644
index 17ae74a..0000000
--- a/c++/compilers/vs2012/datatool.bat
+++ /dev/null
@@ -1,188 +0,0 @@
- at echo off
-REM $Id: datatool.bat 420522 2013-12-03 19:52:45Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Run datatool.exe to generate sources from ASN/DTD/Schema specifications
-REM
-REM DO NOT ATTEMPT to run this bat file manually
-REM
-REM ===========================================================================
-
-set ORIGINAL_ARGS=%*
-
-REM ---------------- begin workaround FOR MSVC2010! ---------------------------------
-set input_asn_path=
-set input_asn_name=
-set input_def_path=
-set subtree=
-set srcroot=
-:PARSEARGS
-if _%1==_ goto ENDPARSEARGS
-if "%dest%"=="inASN"    (set input_asn_path=%~1& set input_asn_name=%~n1& set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="inDEF"    (set input_def_path=%~1& set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="subtree"  (set subtree=%1&     set dest=& goto CONTINUEPARSEARGS)
-if "%dest%"=="srcroot"  (set srcroot=%1&     set dest=& goto CONTINUEPARSEARGS)
-if "%1"=="-m"           (set dest=inASN&                goto CONTINUEPARSEARGS)
-if "%1"=="-od"          (set dest=inDEF&                goto CONTINUEPARSEARGS)
-if "%1"=="-or"          (set dest=subtree&              goto CONTINUEPARSEARGS)
-if "%1"=="-oR"          (set dest=srcroot&              goto CONTINUEPARSEARGS)
-if "%1"=="-M"           (goto ENDPARSEARGS)
-:CONTINUEPARSEARGS
-shift
-REM echo parsing %1
-goto PARSEARGS
-:ENDPARSEARGS
-set src_subtree=%CD%\%srcroot%src\%subtree%
-set dest_spec=%BUILD_TREE_ROOT%\static\build\%subtree%
-if not exist "%dest_spec%" mkdir "%dest_spec%"
-if not exist "%dest_spec%" set dest_spec=.
-
-set copied_asn=0
-for /f %%a in ('xcopy "%input_asn_path%" "%dest_spec%" /q /d /y') do (set copied_asn=%%a)
-set copied_def=0
-if not exist "%input_def_path%" echo [-] > "%input_def_path%"
-if exist "%input_def_path%" for /f %%a in ('xcopy "%input_def_path%" "%dest_spec%" /q /d /y') do (set copied_def=%%a)
-if not %copied_asn%==0 goto DOGENERATE
-if not %copied_def%==0 goto DOGENERATE
-if not exist "%src_subtree%%input_asn_name%.files"   goto DOGENERATE
-if not exist "%src_subtree%%input_asn_name%__.cpp"   goto DOGENERATE
-if not exist "%src_subtree%%input_asn_name%___.cpp"  goto DOGENERATE
-echo generation NOT needed
-exit /b 0
-:DOGENERATE
-REM ----------------   end workaround --------------------------------------
-
-set DEFDT_LOCATION=\\snowman\win-coremake\App\Ncbi\cppcore\datatool
-
-for %%v in ("%DATATOOL_PATH%" "%TREE_ROOT%" "%BUILD_TREE_ROOT%" "%PTB_PLATFORM%") do (
-  if %%v=="" (
-    echo ERROR: required environment variable is missing
-    echo DO NOT ATTEMPT to run this bat file manually
-    exit /b 1
-  )
-)
-set DEFDT_VERSION_FILE=%TREE_ROOT%\src\build-system\datatool_version.txt
-set PTB_SLN=%BUILD_TREE_ROOT%\static\build\UtilityProjects\PTB.sln
-set DT=datatool.exe
-
-call "%BUILD_TREE_ROOT%\msvcvars.bat"
-
-
-REM -------------------------------------------------------------------------
-REM get DT version: from DEFDT_VERSION_FILE  or from PREBUILT_DATATOOL_EXE
-
-set DEFDT_VERSION=
-if exist "%DEFDT_VERSION_FILE%" (
-  for /f %%a in ('type "%DEFDT_VERSION_FILE%"') do (set DEFDT_VERSION=%%a& goto donedf)
-  :donedf
-  set DEFDT_VERSION=%DEFDT_VERSION: =%
-)
-if exist "%PREBUILT_DATATOOL_EXE%" (
-  set ptbver=
-  for /f "tokens=2" %%a in ('"%PREBUILT_DATATOOL_EXE%" -version') do (set ptbver=%%a& goto donepb)
-  :donepb
-  set ptbver=%ptbver: =%
-  if not "%DEFDT_VERSION%"=="%ptbver%" (
-    echo WARNING: requested %DT% version %ptbver% does not match default one: %DEFDT_VERSION%
-    set DEFDT_VERSION=%ptbver%
-  )
-)
-
-if "%DEFDT_VERSION%"=="" (
-  echo ERROR: DEFDT_VERSION not specified
-  exit /b 1
-)
-for /f "tokens=1-3 delims=." %%a in ('echo %DEFDT_VERSION%') do (set DT_VER=%%a%%b%%c& set DT_VER_MAJOR=%%a)
-
-
-REM -------------------------------------------------------------------------
-REM Identify DATATOOL_EXE
-
-set DT_COPY_HERE=NO
-if "%PREBUILT_DATATOOL_EXE%"=="bootstrap" (
-  set DEF_DT=%DATATOOL_PATH%\%DT%
-) else if not "%PREBUILT_DATATOOL_EXE%"=="" (
-  if exist "%PREBUILT_DATATOOL_EXE%" (
-    set DEF_DT=%PREBUILT_DATATOOL_EXE%
-  ) else (
-    echo ERROR: "%PREBUILT_DATATOOL_EXE%" not found
-    exit /b 1
-  )
-) else (
-  set DEF_DT=%DEFDT_LOCATION%\msvc\%DEFDT_VERSION%\%DT%
-  if not "%COPY_DATATOOL_EXE%"=="NO" (
-    set DT_COPY_HERE=YES
-  )
-)
-if exist "%DEF_DT%" (
-  set DATATOOL_EXE=%DEF_DT%
-) else (
-  echo %DT% not found at %DEF_DT%
-  set DATATOOL_EXE=%DATATOOL_PATH%\%DT%
-  set DT_COPY_HERE=NO
-)
-
-
-REM -------------------------------------------------------------------------
-REM Build DATATOOL_EXE if needed
-
-if not exist "%DATATOOL_EXE%" (
-  if exist "%PTB_SLN%" (
-    echo ******************************************************************************
-    echo Building %DT% locally, please wait
-    echo ******************************************************************************
-    @echo %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "datatool.exe"
-    %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "datatool.exe"
-  ) else (
-    echo ERROR: do not know how to build %DT%
-  )
-) else (
-  echo ******************************************************************************
-  echo Using PREBUILT %DT% at %DATATOOL_EXE%
-  echo ******************************************************************************
-)
-if not exist "%DATATOOL_EXE%" (
-  echo ERROR: "%DATATOOL_EXE%" not found
-  exit /b 1
-)
-
-REM -------------------------------------------------------------------------
-REM Copy datatool from network to the local tree (to make it work faster)
-
-set DT_LOCAL=%BUILD_TREE_ROOT%\static\build\UtilityProjects\%DEFDT_VERSION%_%DT%
-if "%DT_COPY_HERE%"=="YES" (
-  if not exist "%DT_LOCAL%" (
-    xcopy "%DATATOOL_EXE%" "%BUILD_TREE_ROOT%\static\build\UtilityProjects\" /q /d /y >NUL
-    rename "%BUILD_TREE_ROOT%\static\build\UtilityProjects\%DT%" "%DEFDT_VERSION%_%DT%"
-  )
-  set DATATOOL_EXE=%DT_LOCAL%
-)
-
-REM -------------------------------------------------------------------------
-REM Run DATATOOL_EXE
-
-"%DATATOOL_EXE%" %ORIGINAL_ARGS%
diff --git a/c++/compilers/vs2012/dll/build/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/vs2012/dll/build/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index ce24ca6..0000000
--- a/c++/compilers/vs2012/dll/build/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/vs2012/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index f07bcc5..0000000
--- a/c++/compilers/vs2012/dll/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_DIALOG_</ProjectName>
-    <ProjectGuid>{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/dll/build/UtilityProjects/configure._ b/c++/compilers/vs2012/dll/build/UtilityProjects/configure._
deleted file mode 100644
index 7d4011f..0000000
--- a/c++/compilers/vs2012/dll/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp_dll.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/dll/build/UtilityProjects/configure_dialog._ b/c++/compilers/vs2012/dll/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index f4e04b9..0000000
--- a/c++/compilers/vs2012/dll/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp_dll.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/dll/build/all.bat b/c++/compilers/vs2012/dll/build/all.bat
deleted file mode 100644
index 1a9aa89..0000000
--- a/c++/compilers/vs2012/dll/build/all.bat
+++ /dev/null
@@ -1,42 +0,0 @@
- at ECHO OFF
-REM $Id: all.bat 407442 2013-07-22 13:01:32Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Build all C++ Toolkit DLL projects
-REM
-REM ===========================================================================
-
-
-CALL all_ncbi.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gui.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gbench.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-:_ABORT_
\ No newline at end of file
diff --git a/c++/compilers/vs2012/dll/build/all_gbench.bat b/c++/compilers/vs2012/dll/build/all_gbench.bat
deleted file mode 100644
index 181fd77..0000000
--- a/c++/compilers/vs2012/dll/build/all_gbench.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_gbench.bat 417516 2013-11-07 14:13:14Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build GBENCH
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\gbench"
-msbuild gbench\ncbi_gbench.sln /t:"_CONFIGURE_:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\gbench\%CFG%"
-msbuild gbench\ncbi_gbench.sln /t:"_BUILD_ALL_" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/vs2012/dll/build/all_gui.bat b/c++/compilers/vs2012/dll/build/all_gui.bat
deleted file mode 100644
index efff107..0000000
--- a/c++/compilers/vs2012/dll/build/all_gui.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_gui.bat 417516 2013-11-07 14:13:14Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build C++ GUI libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\gui"
-msbuild gui\ncbi_gui_dll.sln /t:"_CONFIGURE_:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\gui\%CFG%"
-msbuild gui\ncbi_gui_dll.sln /t:"_BUILD_ALL_" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/vs2012/dll/build/all_ncbi.bat b/c++/compilers/vs2012/dll/build/all_ncbi.bat
deleted file mode 100644
index fdda668..0000000
--- a/c++/compilers/vs2012/dll/build/all_ncbi.bat
+++ /dev/null
@@ -1,75 +0,0 @@
- at ECHO OFF
-REM $Id: all_ncbi.bat 417516 2013-11-07 14:13:14Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "dll\ncbi"
-msbuild ncbi_cpp_dll.sln /t:"_CONFIGURE_:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugDLL ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "dll\ncbi\%CFG%"
-msbuild ncbi_cpp_dll.sln /t:"_BUILD_ALL_" /p:Configuration=%CFG%
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
diff --git a/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index 26497ef..0000000
--- a/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index 7fbfba4..0000000
--- a/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_DIALOG_</ProjectName>
-    <ProjectGuid>{6DEFDB58-C014-4026-A166-299146BD9947}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gbench.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/configure._ b/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/configure._
deleted file mode 100644
index 6be17e9..0000000
--- a/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/configure._
+++ /dev/null
@@ -1,5 +0,0 @@
-set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=1
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gbench.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/configure_dialog._ b/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/configure_dialog._
deleted file mode 100644
index b6f1b6c..0000000
--- a/c++/compilers/vs2012/dll/build/gbench/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,5 +0,0 @@
-set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=1
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gbench.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/dll/build/gbench/configure_prebuild.bat b/c++/compilers/vs2012/dll/build/gbench/configure_prebuild.bat
deleted file mode 100644
index 6d8c6b0..0000000
--- a/c++/compilers/vs2012/dll/build/gbench/configure_prebuild.bat
+++ /dev/null
@@ -1,48 +0,0 @@
- at echo off
-REM $Id: configure_prebuild.bat 407443 2013-07-22 13:06:06Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM This script is called by compilers/msvcNNN_prj/ptb.bat
-REM when building CONFIGURE project, before performing any meaningful actions.
-REM
-REM So, this is a good place to put any custom PRE-BUILD operations.
-REM For example, set environment variables.
-REM
-REM ===========================================================================
-
-set initial_dir=%CD%
-set script_name=%~nx0
-cd %~dp0
-for /f "delims=" %%a in ('cd') do (set script_dir=%%a)
-cd %initial_dir%
-
-set cfgs=project_tree_builder.ini.custom
-
-set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=
-if not exist "%script_dir%\%cfgs%" (
-  set NCBI_CONFIG____ENABLEDUSERREQUESTS__NCBI-UNICODE=1
-)
diff --git a/c++/compilers/vs2012/dll/build/gbench/gbench_install/gbench-install.vcxproj b/c++/compilers/vs2012/dll/build/gbench/gbench_install/gbench-install.vcxproj
deleted file mode 100644
index 9ad4875..0000000
--- a/c++/compilers/vs2012/dll/build/gbench/gbench_install/gbench-install.vcxproj
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{6C23686B-1522-4B44-8D48-7E3176C36247}</ProjectGuid>
-    <RootNamespace>gbench-install</RootNamespace>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">Unicode_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">Unicode_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">Unicode_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">Unicode_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">Unicode_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">Unicode_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">Unicode_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">Unicode_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">VTune_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">VTune_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">VTune_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">VTune_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">VTune_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">VTune_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">VTune_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">VTune_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak all IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak clean IntDir=$(IntDir) MSVC_SRC="msvc11.64\11"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="..\..\..\..\..\..\src\app\gbench\gbench_install\gbench_install.win32.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/vs2012/dll/build/gbench/ncbi_gbench.sln b/c++/compilers/vs2012/dll/build/gbench/ncbi_gbench.sln
deleted file mode 100644
index a44a77c..0000000
--- a/c++/compilers/vs2012/dll/build/gbench/ncbi_gbench.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_DIALOG_", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{6DEFDB58-C014-4026-A166-299146BD9947}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA58}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{6DEFDB58-C014-4026-A166-299146BD9947}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/vs2012/dll/build/gui/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/vs2012/dll/build/gui/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index bc57302..0000000
--- a/c++/compilers/vs2012/dll/build/gui/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/vs2012/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index 75d5659..0000000
--- a/c++/compilers/vs2012/dll/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_DIALOG_</ProjectName>
-    <ProjectGuid>{9BAE6EEC-8C80-44F0-84A9-3379631A8654}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui_dll.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/dll/build/gui/UtilityProjects/configure._ b/c++/compilers/vs2012/dll/build/gui/UtilityProjects/configure._
deleted file mode 100644
index b86cc7e..0000000
--- a/c++/compilers/vs2012/dll/build/gui/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/dll/build/gui/UtilityProjects/configure_dialog._ b/c++/compilers/vs2012/dll/build/gui/UtilityProjects/configure_dialog._
deleted file mode 100644
index 78a9181..0000000
--- a/c++/compilers/vs2012/dll/build/gui/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -dll -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/dll/build/gui/ncbi_gui_dll.sln b/c++/compilers/vs2012/dll/build/gui/ncbi_gui_dll.sln
deleted file mode 100644
index fd240ae..0000000
--- a/c++/compilers/vs2012/dll/build/gui/ncbi_gui_dll.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_DIALOG_", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{9BAE6EEC-8C80-44F0-84A9-3379631A8654}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA56}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{9BAE6EEC-8C80-44F0-84A9-3379631A8654}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/vs2012/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcxproj b/c++/compilers/vs2012/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcxproj
deleted file mode 100644
index b1b4e57..0000000
--- a/c++/compilers/vs2012/dll/build/internal/gbench/gbench_install_internal/gbench-install-internal.vcxproj
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{6C23686B-1522-4B44-8D48-7E3176C36248}</ProjectGuid>
-    <RootNamespace>gbench-install</RootNamespace>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">Unicode_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">Unicode_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">Unicode_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">Unicode_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">Unicode_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">Unicode_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">Unicode_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">Unicode_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">VTune_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">VTune_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">VTune_DebugDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">VTune_DebugDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">VTune_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">VTune_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">VTune_ReleaseDLL\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">VTune_ReleaseDLL\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak all IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f ..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">gbench-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="..\..\..\..\..\..\..\src\internal\gbench\install\gbench_install_internal.win32.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/vs2012/dll/build/ncbi_cpp_dll.sln b/c++/compilers/vs2012/dll/build/ncbi_cpp_dll.sln
deleted file mode 100644
index 5a9cd63..0000000
--- a/c++/compilers/vs2012/dll/build/ncbi_cpp_dll.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_DIALOG_", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAAC9}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{67EC51FA-3A0D-46B8-8F89-49EE209C8CB8}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/vs2012/dll/dll_main.cpp b/c++/compilers/vs2012/dll/dll_main.cpp
deleted file mode 100644
index 7bd913f..0000000
--- a/c++/compilers/vs2012/dll/dll_main.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include <ncbi_pch.hpp>
-
-#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-BOOL APIENTRY DllMain( HANDLE hModule, 
-                       DWORD  ul_reason_for_call, 
-                       LPVOID lpReserved
-					 )
-{
-    return TRUE;
-}
-
-
-
-
diff --git a/c++/compilers/vs2012/dll/third_party_dll_install.mak b/c++/compilers/vs2012/dll/third_party_dll_install.mak
deleted file mode 100644
index 61fc53f..0000000
--- a/c++/compilers/vs2012/dll/third_party_dll_install.mak
+++ /dev/null
@@ -1,62 +0,0 @@
-# $Id: third_party_dll_install.mak 463528 2015-03-30 14:10:31Z ucko $
-#################################################################
-
-
-INSTALL          = .\bin
-INSTALL_BINPATH  = $(INSTALL)\$(INTDIR)
-THIRDPARTY_MAKEFILES_DIR =  .
-
-
-META_MAKE = $(THIRDPARTY_MAKEFILES_DIR)\..\third_party_install.meta.mk
-!IF EXIST($(META_MAKE))
-!INCLUDE $(META_MAKE)
-!ELSE
-!ERROR  $(META_MAKE)  not found
-!ENDIF
-
-THIRD_PARTY_LIBS = \
-	install_berkeleydb \
-	install_gnutls     \
-	install_glew       \
-	install_lzo        \
-	install_mssql      \
-	install_mysql      \
-	install_openssl    \
-	install_sqlite     \
-	install_sqlite3    \
-	install_sybase     \
-	install_wxwidgets  \
-	install_wxwindows  \
-	install_xalan      \
-	install_xerces     \
-	install_libxml     \
-	install_libxslt    \
-	install_vdb
-
-CLEAN_THIRD_PARTY_LIBS = \
-	clean_berkeleydb \
-	clean_gnutls     \
-	clean_glew       \
-	clean_lzo        \
-	clean_mssql      \
-	clean_mysql      \
-	clean_openssl    \
-	clean_sqlite     \
-	clean_sqlite3    \
-	clean_sybase     \
-	clean_wxwidgets  \
-	clean_wxwindows  \
-	clean_xalan      \
-	clean_xerces     \
-	clean_libxml     \
-	clean_libxslt    \
-	clean_vdb
-
-all : dirs $(THIRD_PARTY_LIBS)
-
-clean : $(CLEAN_THIRD_PARTY_LIBS)
-
-rebuild : clean all
-
-dirs :
-    @if not exist $(INSTALL_BINPATH) (echo Creating directory $(INSTALL_BINPATH)... & mkdir $(INSTALL_BINPATH))
diff --git a/c++/compilers/vs2012/dll/third_party_dll_install.vcxproj b/c++/compilers/vs2012/dll/third_party_dll_install.vcxproj
deleted file mode 100644
index 5da3e02..0000000
--- a/c++/compilers/vs2012/dll/third_party_dll_install.vcxproj
+++ /dev/null
@@ -1,433 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|Win32">
-      <Configuration>DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|x64">
-      <Configuration>DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|Win32">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|x64">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|Win32">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|x64">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|Win32">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|x64">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|Win32">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|x64">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|Win32">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|x64">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9E4B5381-9B6C-4867-BF8A-F1AAA1FD580F}</ProjectGuid>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="third_party_dll_install.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/vs2012/dll/third_party_msvcdll_install.vcxproj b/c++/compilers/vs2012/dll/third_party_msvcdll_install.vcxproj
deleted file mode 100644
index f79a6a3..0000000
--- a/c++/compilers/vs2012/dll/third_party_msvcdll_install.vcxproj
+++ /dev/null
@@ -1,433 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|Win32">
-      <Configuration>DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|x64">
-      <Configuration>DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|Win32">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|x64">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|Win32">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|x64">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|Win32">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|x64">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|Win32">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|x64">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|Win32">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|x64">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9E4B5381-9B6C-4867-BF8A-F1AAA1FD581F}</ProjectGuid>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_dll_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="third_party_dll_install.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/vs2012/install.sh b/c++/compilers/vs2012/install.sh
deleted file mode 100644
index a1844f6..0000000
--- a/c++/compilers/vs2012/install.sh
+++ /dev/null
@@ -1,186 +0,0 @@
-#! /bin/sh
-# $Id: install.sh 441102 2014-07-21 14:40:41Z ivanov $
-# Authors:  Denis Vakatov    (vakatov at ncbi.nlm.nih.gov)
-#           Anton Lavrentiev (lavr at ncbi.nlm.nih.gov)
-#
-# Deploy sources, headers, libraries and executables for the further use
-# by the "external" users' projects
-
-
-# Cmd.-line args  -- source and destination
-script="$0"
-builddir="$1"
-target="$2"
-compiler="${3:-vs2012}"
-
-# Real number of argument is 2.
-# The 3th argument do not used here (32|64-bit architecture),
-# but is needed for master installation script.
-if test -n "$4" ; then
-  echo "USAGE:  `basename $script` [build_dir] [install_dir]"
-fi
-
-
-error()
-{
-  echo "[`basename $script`] ERROR:  $1"
-  exit 1
-}
-
-
-makedir()
-{
-  test -d "$1"  ||  mkdir $2 "$1"  ||  error "Cannot create \"$1\""
-}
-
-
-echo "[`basename $script`] NCBI C++:  \"$builddir\" to \"$target\"..."
-
-
-# Derive the destination dirs
-docdir="$target"/doc
-scriptdir="$target"/scripts
-incdir="$target"/include
-srcdir="$target"/src
-libdir="$target"/lib
-bindir="$target"/bin
-cldir="$target"/compilers
-logdir="$target"/logs
-tmpdir="$target"/tmp
-
-
-install()
-{
-    test -d "$1"  ||  return;
-    makedir "$2" -p
-    tmp_cwd=`pwd`
-    cd "$1"
-    find . -type f |
-    grep -v '/\.svn/' > "$tmpdir"/flist
-    tar cf - -T "$tmpdir"/flist | (cd "$2" ; tar xf - )
-    cd "$tmp_cwd"
-}
-
-
-
-# Check
-test -d "$builddir"  ||  error "Absent build dir \"$builddir\""
-
-
-# Reset the public directory
-test -d "$target"  &&  find "$target" -type f -exec rm -f {} \; >/dev/null 2>&1
-makedir "$target" -p
-makedir "$tmpdir" -p
-
-
-# Documentation
-echo "[`basename $script`] Installing documentation..."
-install "$builddir/doc" "$docdir"
-
-# Scripts
-echo "[`basename $script`] Installing scripts..."
-install "$builddir/scripts" "$scriptdir"
-
-# Include dir
-echo "[`basename $script`] Installing include files..."
-install "$builddir/include" "$incdir"
-
-# Source dir
-echo "[`basename $script`] Installing source files..."
-install "$builddir/src" "$srcdir"
-
-# Build logs
-echo "[`basename $script`] Installing build logs..."
-install "$builddir/logs" "$logdir"
-
-rm -rf "$tmpdir"
-
-
-# Libraries
-echo "[`basename $script`] Installing libraries..."
-for i in 'Debug' 'Release' ; do
-  for j in '' 'DLL' ; do
-    for b in 'static' 'dll' ; do
-
-      if test -d "$builddir"/compilers/$compiler/$b/lib/$i$j ; then
-        makedir "$libdir/$b/$i$j" -p
-        cd "$builddir"/compilers/$compiler/$b/lib/$i$j
-        cp -p *.lib "$libdir/$b/$i$j"
-      fi
-      if test "$b"=='dll' ; then
-        if test -d "$builddir"/compilers/$compiler/$b/bin/$i$j ; then
-          makedir "$libdir/$b/$i$j" -p
-          cd "$builddir"/compilers/$compiler/$b/bin/$i$j
-          cp -p *.lib *.dll *.exp "$libdir/$b/$i$j"
-        fi
-      fi
-    done
-  done
-done
-
-
-# Executables
-echo "[`basename $script`] Installing executables..."
-makedir "$bindir" -p
-for i in 'DLL' '' ; do
-  if test -d "$builddir"/compilers/$compiler/static/bin/Release$i ; then
-    cd "$builddir"/compilers/$compiler/static/bin/Release$i
-    if ls *.exe >/dev/null 2>&1 ; then
-      cp -p *.exe *.dll *.exp *.manifest "$bindir"
-      break
-    fi
-  fi
-done
-
-
-# Install additional files (scripts and etc) into binary directory
-cp -p "$builddir"/src/app/blast/legacy_blast.pl "$bindir"
-
-
-# Gbench public installation
-echo "[`basename $script`] Installing Gbench..."
-for i in ReleaseDLL DebugDLL; do
-  if test -d "$builddir"/compilers/$compiler/dll/bin/"$i" ; then
-    cp -pr "$builddir"/compilers/$compiler/dll/bin/$i/gbench "$bindir"
-    break
-  fi
-done
-
-
-# Compiler dir (copy all .pdb and configurable files files for debug purposes)
-echo "[`basename $script`] Installing .pdb files..."
-makedir "$cldir" -p
-pdb_files=`find "$builddir/compilers/$compiler" -type f -a \( -name '*.pdb' -o  -name '*.c' -o  -name '*.cpp' \) 2>/dev/null`
-cd "$cldir"
-for pdb in $pdb_files ; do
-  # Do not copy .pdb for executable files to save space
-  exe=`echo $pdb | sed -e 's|\.pdb$|\.exe|'`
-  if test -x "$exe" ; then
-    continue
-  fi
-  rel_dir=`echo $pdb | sed -e "s|$builddir/compilers/||" -e 's|/[^/]*$||'`
-  makedir "$rel_dir" -p
-  cp -pr "$pdb" "$rel_dir"
-done
-
-
-# Compiler dir (other common stuff)
-makedir "$cldir"/$compiler/static -p
-makedir "$cldir"/$compiler/dll -p
-cp -p  "$builddir"/compilers/$compiler/*          "$cldir"/$compiler
-cp -p  "$builddir"/compilers/$compiler/static/*   "$cldir"/$compiler/static
-cp -p  "$builddir"/compilers/$compiler/dll/*      "$cldir"/$compiler/dll
-for b in 'static' 'dll' ; do
-  cp -pr "$builddir"/compilers/$compiler/$b/inc "$cldir"/$compiler/$b
-  for c in 'DebugMT' 'ReleaseMT' 'DebugDLL' 'ReleaseDLL'; do
-    cp -pr "$builddir"/compilers/$compiler/$b/$c "$cldir"/$compiler/$b
-  done 
-done 
-
-# Makefile.*.mk files
-find "$builddir/src" -type f -name 'Makefile.*.mk' -exec cp -pr {} "$srcdir"/build-system/ \;
-
-# Copy info files
-cp -p "$builddir"/*_info "$target"
-
-exit 0
diff --git a/c++/compilers/vs2012/lock_ptb_config.bat b/c++/compilers/vs2012/lock_ptb_config.bat
deleted file mode 100644
index c80a95d..0000000
--- a/c++/compilers/vs2012/lock_ptb_config.bat
+++ /dev/null
@@ -1,94 +0,0 @@
- at echo off
-REM $Id: lock_ptb_config.bat 407440 2013-07-22 13:00:11Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Check platform name and create a lock to prevent
-REM running more than one instance of project_tree_builder.exe at the same time.
-REM
-REM ===========================================================================
-
-set CFG_PLATFORM=__configured_platform
-set CFG_LIST=Win32 x64
-set PTB_RUNNING=__configure.lock
-
-if _%PTB_PLATFORM%==_ (
-  echo PTB_PLATFORM is undefined
-  goto return_error
-)
-if _%1%==_  goto report_usage
-if _%2%==_  goto report_usage
-set MSVC_PRJ=%~2%
-if %1%==ON  goto do_ON
-if %1%==OFF goto do_OFF
-
-
-:report_usage
-echo The script checks MSVC platform name and creates a lock to prevent
-echo running more than one -CONFIGURE- at the same time.
-echo Usage:
-echo    lock_ptb_config ON msvc_prj_folder, or
-echo    lock_ptb_config OFF msvc_prj_folder
-goto return_error
-
-:return_error
-exit /b 1
-
-:do_ON
-for %%c in ( %CFG_LIST% ) do (
-  if exist "%MSVC_PRJ%%CFG_PLATFORM%.%%c" (
-    if not %%c==%PTB_PLATFORM% (
-      echo ******************************************************************************
-      echo Requested platform %PTB_PLATFORM% does not match already configured %%c
-      echo If you believe it is not so, - delete '%MSVC_PRJ%%CFG_PLATFORM%.%%c' file
-      echo ******************************************************************************
-      goto return_error
-    )
-    goto do_ON_lock
-  )
-)
-echo %CFG_PLATFORM% > "%MSVC_PRJ%%CFG_PLATFORM%.%PTB_PLATFORM%"
-
-:do_ON_lock
-if exist "%MSVC_PRJ%%PTB_RUNNING%" (
-  echo ******************************************************************************
-  echo There is another CONFIGURE process running in this tree.
-  echo If you believe it is not so, - delete '%MSVC_PRJ%%PTB_RUNNING%' file
-  echo ******************************************************************************
-  goto return_error
-)
-echo ptb_running > "%MSVC_PRJ%%PTB_RUNNING%"
-goto done
-
-
-:do_OFF
-if exist "%MSVC_PRJ%%PTB_RUNNING%" (
-  del "%MSVC_PRJ%%PTB_RUNNING%"
-)
-goto done
-
-:done
-
diff --git a/c++/compilers/vs2012/make.bat b/c++/compilers/vs2012/make.bat
deleted file mode 100644
index 8e76a9f..0000000
--- a/c++/compilers/vs2012/make.bat
+++ /dev/null
@@ -1,220 +0,0 @@
- at ECHO OFF
-REM $Id: make.bat 420640 2013-12-04 16:12:30Z ivanov $
-REM ===========================================================================
-REM
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM
-REM  Please cite the author in any work or product based on this material.
-REM
-REM ===========================================================================
-REM
-REM Author:  Vladimir Ivanov
-REM
-REM Configure/build/check NCBI C++ tree in specified configuration(s)
-REM
-REM     make.bat <configure|build|make|check> <solution> <static|dll> <32|64> [cfgs..]
-REM
-REM     %1% - Configure, build, make (configure and build_ or check build tree.
-REM     %2% - Solution file name without extention (relative path from build directory).
-REM     %3% - Type of used libraries (static, dll).
-REM     %4% - 32/64-bits architerture.
-REM     %5% - Configuration name(s)
-REM           (DebugDLL, DebugMT, ReleaseDLL, ReleaseMT, Unicode_*).
-REM           By default (if not specified) build DebugDLL and ReleaseDLL only.
-REM     ... - Options (--with-openmp)
-REM
-REM ===========================================================================
-
-
-
-rem --- Configuration
-
-set compiler=vs2012
-set default_cfgs=ReleaseDLL DebugDLL
-
-rem Always configure with additional Unicode configurations
-if _%SRV_NAME% == _ set SRV_NAME=%COMPUTERNAME%
-
-call msvcvars.bat > NUL
-set archw=Win32
-if _%arch%_ == _64_ set archw=x64
-
-
-rem --- Required parameters
-
-set cmd=%~1%
-set solution=%~2
-set libdll=%~3
-set arch=%~4
-
-shift
-shift
-shift
-shift
-
-if "%cmd%"      == ""  goto NOARGS
-if "%solution%" == ""  goto USAGE
-if "%libdll%"   == ""  goto USAGE
-if "%arch%"     == ""  goto USAGE
-
-goto PARSEARGS
-
-
-rem --------------------------------------------------------------------------------
-:NOARGS
-
-if exist configure_make.bat (
-  configure_make.bat
-) else (
-  goto USAGE
-)
-
-:USAGE
-
-echo FATAL: Invalid parameters. See script description.
-echo FATAL: Passed arguments: %*
-goto ABORT
-
-
-
-rem --------------------------------------------------------------------------------
-rem Parse arguments
-:PARSEARGS
-
-set with_openmp=
-set cfgs=
-set unknown=
-
-:PARSEARGSLOOP
-if "%1" == "" goto ENDPARSEARGS
-if "%1" == "--with-openmp"       (set with_openmp=%1 & goto CONTINUEPARSEARGS)
-if "%1" == "DebugDLL"            (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "DebugMT"             (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "ReleaseDLL"          (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "ReleaseMT"           (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "Unicode_DebugDLL"    (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "Unicode_DebugMT"     (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-if "%1" == "Unicode_ReleaseDLL"  (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS) 
-if "%1" == "Unicode_ReleaseMT"   (set cfgs=%cfgs% %1 & goto CONTINUEPARSEARGS)
-set unknown=%unknown% %1
-:CONTINUEPARSEARGS
-shift
-goto PARSEARGSLOOP
-
-:ENDPARSEARGS
-
-if not "%unknown%" == "" (
-   echo FATAL: Unknown configuration names or options specified:%unknown%.
-   echo %cmd%
-   goto ABORT
-)
-
-if "%cfgs%" == "" set cfgs=%default_cfgs%
-
-rem -- Check command
-
-if _%cmd% == _configure goto CONFIG
-if _%cmd% == _make      goto CONFIG
-if _%cmd% == _build     goto CFGLOOP
-if _%cmd% == _check     goto CFGLOOP
-echo FATAL: Unknown action name %cmd%. Please correct.
-echo The following action names are recognized: configure, build, make, check.
-goto ABORT
-
-
-rem --------------------------------------------------------------------------------
-rem Configure: always use ReleaseDLL
-:CONFIG
-
-rem --- Process options
-if not "%with_openmp%" == "" (
-   echo INFO: Ebable OpenMP.
-   bash -c "./build_util.sh %with_openmp%; exit $?"
-   if errorlevel 1 goto ABORT
-)
-
-time /t
-echo INFO: Configure "%libdll%\%solution% [ReleaseDLL|%arch%]"
-%DEVENV% %libdll%\build\%solution%.sln /build "ReleaseDLL|%archw%" /project "_CONFIGURE_"
-if errorlevel 1 goto ABORT
-if not _%cmd% == _make goto COMPLETE
-
-
-rem --------------------------------------------------------------------------------
-rem Process all configurations
-:CFGLOOP
-
-for %%c in (%cfgs%) do (
-   time /t
-   if _%cmd% == _build (
-      call :build %%c
-   )
-   if _%cmd% == _check (
-      call :check %%c
-   )
-   if _%cmd% == _make (
-      call :build %%c
-      if errorlevel 1 goto ABORT
-      call :check %%c
-   )
-   if errorlevel 1 goto ABORT
-)
-goto COMPLETE
-
-
-rem --------------------------------------------------------------------------------
-rem Subroutines
-
-:build
-   echo INFO: Building "%libdll%\%solution% [%1|%arch%]"
-   %DEVENV% %libdll%\build\%solution%.sln /build "%1|%archw%" /project "_BUILD_ALL_"
-   exit /b %errorlevel%
-
-:check
-   echo INFO: Checking init
-   bash -c "../../scripts/common/check/check_make_win_cfg.sh init; exit $?"
-   set err=0
-   echo INFO: Create check script for "%libdll%\%solution% [%1|%arch%]"
-   bash -c "../../scripts/common/check/check_make_win_cfg.sh create %solution% %libdll% %1; exit $?"
-   if errorlevel 1 exit /b %errorlevel%
-   echo INFO: Checking "%libdll%\%solution% [%1|%arch%]"
-   SET CHECKSH=%libdll%/build/%solution%.check/%1/check.sh
-   bash -c "%CHECKSH% run; exit $?"
-   if errorlevel 1 set err=1
-   bash -c "cp %CHECKSH%.journal check.sh.%libdll%_%1.journal; cp %CHECKSH%.log check.sh.%libdll%_%1.log"
-   rem Load testsuite results into DB works only if NCBI_AUTOMATED_BUILD is set to 1
-   if _%NCBI_AUTOMATED_BUILD% == _1 (
-      bash -c "%CHECKSH% load_to_db; exit $?"
-      if errorlevel 1 set err=1
-   )
-   copy /y /b check.sh.*.journal check.sh.journal
-   copy /y /b check.sh.*.log     check.sh.log
-   exit /b %err%
-
-
-rem --------------------------------------------------------------------------------
-
-:ABORT
-echo INFO: %cmd% failed.
-exit /b 1
-
-:COMPLETE
-echo INFO: %cmd% complete.
-exit /b 0
-
diff --git a/c++/compilers/vs2012/make_ncbi.bat b/c++/compilers/vs2012/make_ncbi.bat
deleted file mode 100644
index 92bbef9..0000000
--- a/c++/compilers/vs2012/make_ncbi.bat
+++ /dev/null
@@ -1,60 +0,0 @@
- at ECHO OFF
-REM $Id: make_ncbi.bat 419904 2013-12-02 16:48:37Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Configure/build/check NCBI C++ core tree in specified configuration(s)
-REM
-REM     make_ncbi.bat <configure|build|make|check> <static|dll> <32|64> [cfgs..]
-REM
-REM     %1% - Configure, build, check or build and configure (make) build tree.
-REM     %2% - Type of used libraries (static, dll).
-REM     %3% - 32/64-bits architerture.
-REM     %4% - Configuration name(s)
-REM           (DEFAULT, DebugDLL, DebugMT, ReleaseDLL, ReleaseMT, Unicode_*).
-REM           By default build DebugDLL and ReleaseDLL only.
-REM     ... - Options (--with-openmp)
-REM
-REM ===========================================================================
-
-
-set cmd=%~1
-set libdll=%~2
-set arch=%~3
-
-shift
-shift
-shift
-
-goto:%libdll% 2>NUL
-
-:static
- at call make.bat %cmd% ncbi_cpp     %libdll% %arch% %1 %2 %3 %4 %5 %6 %7 %8 %9
-exit %ERRORLEVEL%
-
-:dll
- at call make.bat %cmd% ncbi_cpp_dll %libdll% %arch% %1 %2 %3 %4 %5 %6 %7 %8 %9
-exit %ERRORLEVEL%
diff --git a/c++/compilers/vs2012/msvcvars.bat b/c++/compilers/vs2012/msvcvars.bat
deleted file mode 100644
index 54f1304..0000000
--- a/c++/compilers/vs2012/msvcvars.bat
+++ /dev/null
@@ -1,14 +0,0 @@
- at echo off
-REM
-REM $Id: msvcvars.bat 407440 2013-07-22 13:00:11Z gouriano $
-REM
-
- at if not "%VSINSTALLDIR%"=="" goto devenv
- at call "%VS110COMNTOOLS%vsvars32.bat"
-
-:devenv
-
-if exist "%VS110COMNTOOLS%..\IDE\VCExpress.*" set DEVENV="%VS110COMNTOOLS%..\IDE\VCExpress"
-if exist "%VS110COMNTOOLS%..\IDE\devenv.*" set DEVENV="%VS110COMNTOOLS%..\IDE\devenv"
-
-:end
diff --git a/c++/compilers/vs2012/ncbi.rc b/c++/compilers/vs2012/ncbi.rc
deleted file mode 100644
index 9bcbca1..0000000
--- a/c++/compilers/vs2012/ncbi.rc
+++ /dev/null
@@ -1 +0,0 @@
-ncbilogo ICON "ncbilogo.ico"
diff --git a/c++/compilers/vs2012/ncbilogo.ico b/c++/compilers/vs2012/ncbilogo.ico
deleted file mode 100644
index 44e71d4..0000000
Binary files a/c++/compilers/vs2012/ncbilogo.ico and /dev/null differ
diff --git a/c++/compilers/vs2012/ptb.bat b/c++/compilers/vs2012/ptb.bat
deleted file mode 100644
index cdb7e0a..0000000
--- a/c++/compilers/vs2012/ptb.bat
+++ /dev/null
@@ -1,275 +0,0 @@
- at echo off
-REM $Id: ptb.bat 407440 2013-07-22 13:00:11Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Andrei Gourianov
-REM
-REM Run project_tree_builder.exe to generate MSVC solution and project files
-REM
-REM DO NOT ATTEMPT to run this bat file manually
-REM It should be run by CONFIGURE project only
-REM (open a solution and build or rebuild CONFIGURE project)
-REM
-REM ===========================================================================
-
-setlocal
-set DEFPTB_LOCATION=\\snowman\win-coremake\App\Ncbi\cppcore\ptb
-set IDE=1100
-set PTB_EXTRA=
-
-for %%v in ("%PTB_PATH%" "%SLN_PATH%" "%TREE_ROOT%" "%BUILD_TREE_ROOT%" "%PTB_PLATFORM%") do (
-  if %%v=="" (
-    echo ERROR: required environment variable is missing
-    echo DO NOT ATTEMPT to run this bat file manually
-    echo It should be run by CONFIGURE project only
-    exit /b 1
-  )
-)
-set PTBGUI="%TREE_ROOT%\src\build-system\project_tree_builder_gui\bin\ptbgui.jar"
-set DEFPTB_VERSION_FILE=%TREE_ROOT%\src\build-system\ptb_version.txt
-set PTB_INI=%TREE_ROOT%\src\build-system\project_tree_builder.ini
-set PTB_SLN=%BUILD_TREE_ROOT%\static\build\UtilityProjects\PTB.sln
-
-REM --- get solution dir ---
-call :XSLNPATH %SLN_PATH%
-goto DONE
-:XSLNPATH
-set SLN_DIR=%~dp1
-goto :eof
-:DONE
-REM --- call pre-configure script if it exists ---
-if exist "%SLN_DIR%configure_prebuild.bat" (
-  call "%SLN_DIR%configure_prebuild.bat"
-)
-
-call "%BUILD_TREE_ROOT%\msvcvars.bat"
-
-REM -------------------------------------------------------------------------
-REM get PTB version: from DEFPTB_VERSION_FILE  or from PREBUILT_PTB_EXE
-
-set DEFPTB_VERSION=
-if exist "%DEFPTB_VERSION_FILE%" (
-  for /f %%a in ('type "%DEFPTB_VERSION_FILE%"') do (set DEFPTB_VERSION=%%a& goto donedf)
-  :donedf
-  set DEFPTB_VERSION=%DEFPTB_VERSION: =%
-)
-if exist "%PREBUILT_PTB_EXE%" (
-  set ptbver=
-  for /f "tokens=2" %%a in ('"%PREBUILT_PTB_EXE%" -version') do (set ptbver=%%a& goto donepb)
-  :donepb
-  set ptbver=%ptbver: =%
-  if not "%DEFPTB_VERSION%"=="%ptbver%" (
-    echo WARNING: requested PTB version %ptbver% does not match default one: %DEFPTB_VERSION%
-    set DEFPTB_VERSION=%ptbver%
-  )
-)
-
-if "%DEFPTB_VERSION%"=="" (
-  echo ERROR: DEFPTB_VERSION not specified
-  exit /b 1
-)
-for /f "tokens=1-3 delims=." %%a in ('echo %DEFPTB_VERSION%') do (set PTB_VER=%%a%%b%%c& set PTB_VER_MAJOR=%%a)
-
-
-REM -------------------------------------------------------------------------
-REM See if we should and can use Java GUI
-
-set REQ_GUI_CFG=NO
-set USE_GUI_CFG=NO
-for /f "tokens=*" %%i in ('echo %PTB_FLAGS%') do call :PARSE %%i
-goto :endparse
-:PARSE
-if "%1"=="" goto :eof
-if "%1"=="-cfg" (set REQ_GUI_CFG=YES& goto :eof)
-shift
-goto :PARSE
-:endparse
-if "%REQ_GUI_CFG%"=="YES" (
-  if %PTB_VER_MAJOR% GEQ 2 (
-    if exist "%PTBGUI%" (
-      java -version >NUL 2>&1
-      if errorlevel 1 (
-        echo WARNING: Java not found, cannot run configuration GUI
-      ) else (
-        set USE_GUI_CFG=YES
-      )
-    ) else (
-      echo WARNING: "%PTBGUI%" not found
-    )
-  )
-)
-
-
-REM -------------------------------------------------------------------------
-REM See if we should and can use saved settings
-
-set PTB_SAVED_CFG=
-if not "%PTB_SAVED_CFG_REQ%"=="" (
-  if not exist "%PTB_SAVED_CFG_REQ%" (
-    echo ERROR: %PTB_SAVED_CFG_REQ% not found
-    exit /b 1
-  )
-  if %PTB_VER_MAJOR% GEQ 2 (
-    if %PTB_VER% GEQ 220 (
-      set PTB_SAVED_CFG=-args %PTB_SAVED_CFG_REQ%
-REM PTB will read PTB_PROJECT from the saved settings
-      set PTB_PROJECT_REQ=""
-    )
-  )
-)
-
-
-REM -------------------------------------------------------------------------
-REM Identify PTB_EXE
-
-if "%PREBUILT_PTB_EXE%"=="bootstrap" (
-  set DEF_PTB=%PTB_PATH%\project_tree_builder.exe
-) else if not "%PREBUILT_PTB_EXE%"=="" (
-  if exist "%PREBUILT_PTB_EXE%" (
-    set DEF_PTB=%PREBUILT_PTB_EXE%
-  ) else (
-    echo ERROR: "%PREBUILT_PTB_EXE%" not found
-    exit /b 1
-  )
-) else (
-  if %PTB_VER% GEQ 180 (
-    set DEF_PTB=%DEFPTB_LOCATION%\msvc\%DEFPTB_VERSION%\project_tree_builder.exe
-  ) else (
-    if "%PTB_PLATFORM%"=="x64" (
-      set DEF_PTB=%DEFPTB_LOCATION%\msvc9.64\%DEFPTB_VERSION%\project_tree_builder.exe
-    ) else (
-      set DEF_PTB=%DEFPTB_LOCATION%\msvc9\%DEFPTB_VERSION%\project_tree_builder.exe
-    )
-  )
-)
-if exist "%DEF_PTB%" (
-  set PTB_EXE=%DEF_PTB%
-) else (
-  echo project_tree_builder.exe not found at %DEF_PTB%
-  set PTB_EXE=%PTB_PATH%\project_tree_builder.exe
-)
-
-REM -------------------------------------------------------------------------
-REM Misc settings
-
-if %PTB_VER% GEQ 180 (
-  set PTB_EXTRA=%PTB_EXTRA% -ide %IDE% -arch %PTB_PLATFORM%
-)
-if not exist "%PTB_INI%" (
-  echo ERROR: "%PTB_INI%" not found
-  exit /b 1
-)
-set PTB_PROJECT_LST=
-if "%PTB_PROJECT%"=="" (
-  set PTB_PROJECT_LST=%PTB_PROJECT_REQ%
-) else (
-  set PTB_PROJECT_LST=%PTB_PROJECT%
-)
-
-
-REM -------------------------------------------------------------------------
-REM Build PTB_EXE if needed
-
-if not exist "%PTB_EXE%" (
-  echo ******************************************************************************
-  echo Building project tree builder locally, please wait
-  echo ******************************************************************************
-  rem --- @echo msbuild "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /t:"project_tree_builder_exe:Rebuild" /p:Configuration=ReleaseDLL;Platform=%PTB_PLATFORM% /maxcpucount:1
-  rem --- msbuild "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /t:"project_tree_builder_exe:Rebuild" /p:Configuration=ReleaseDLL;Platform=%PTB_PLATFORM% /maxcpucount:1
-  if exist "%PTB_SLN%" (
-    @echo %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-    %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-  ) else (
-    @echo %DEVENV% "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-    %DEVENV% "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
-  )
-) else (
-  echo ******************************************************************************
-  echo Using PREBUILT project tree builder at %PTB_EXE%
-  echo ******************************************************************************
-)
-if not exist "%PTB_EXE%" (
-  echo ERROR: "%PTB_EXE%" not found
-  exit /b 1
-)
-"%PTB_EXE%" -version
-if errorlevel 1 (
-  echo ERROR: cannot find working %PTB_EXE%
-  exit /b 1
-)
-
-
-REM -------------------------------------------------------------------------
-REM Run PTB_EXE
-
-call "%BUILD_TREE_ROOT%\lock_ptb_config.bat" ON "%BUILD_TREE_ROOT%\"
-if errorlevel 1 exit /b 1
-
-echo ******************************************************************************
-echo Running -CONFIGURE- please wait
-echo ******************************************************************************
-echo "%PTB_EXE%" %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-if "%USE_GUI_CFG%"=="YES" (
-  java -jar %PTBGUI% "%PTB_EXE%" -i %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-) else (
-  "%PTB_EXE%" %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT_LST% "%SLN_PATH%"
-)
-if errorlevel 1 (set PTB_RESULT=1) else (set PTB_RESULT=0)
-
-call "%BUILD_TREE_ROOT%\lock_ptb_config.bat" OFF "%BUILD_TREE_ROOT%\"
-
-if "%PTB_RESULT%"=="1" (
-  echo ******************************************************************************
-  echo -CONFIGURE- has failed
-  echo Configuration log was saved at "file://%SLN_PATH%_configuration_log.txt"
-  echo ******************************************************************************
-  if exist "%SLN_PATH%_configuration_log.txt" (
-    if "%DIAG_SILENT_ABORT%"=="" start "" "%SLN_PATH%_configuration_log.txt"
-  )
-  exit /b 1
-) else (
-  echo ******************************************************************************
-  echo -CONFIGURE- has succeeded
-  echo Configuration log was saved at "file://%SLN_PATH%_configuration_log.txt"
-  echo ******************************************************************************
-)
-
-set ALLOBJ="_generate_all_objects.dataspec"
-type "%SLN_PATH%" | %SystemRoot%\system32\find /C %ALLOBJ% >NUL 2>&1
-if not errorlevel 1 (
-  echo ******************************************************************************
-  echo ******************************************************************************
-  echo ==============  Generating objects source code.                 ==============
-  echo ==============  DO NOT RELOAD THE SOLUTION NOW!                 ============== 
-  echo ******************************************************************************
-  echo %DEVENV% "%SLN_PATH%" /build "ReleaseDLL|%PTB_PLATFORM%" /project %ALLOBJ%
-  %DEVENV% "%SLN_PATH%" /build "ReleaseDLL|%PTB_PLATFORM%" /project %ALLOBJ%
-)
-echo -
-echo -
-echo ******************************************************************************
-echo ==============  It is now safe to reload the solution:          ==============
-echo ==============  Please, close it and open again                 ============== 
-echo ******************************************************************************
diff --git a/c++/compilers/vs2012/static/build/UtilityProjects/PTB.sln b/c++/compilers/vs2012/static/build/UtilityProjects/PTB.sln
deleted file mode 100644
index 1855e72..0000000
--- a/c++/compilers/vs2012/static/build/UtilityProjects/PTB.sln
+++ /dev/null
@@ -1,79 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_", "_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_DIALOG_", "_CONFIGURE_DIALOG_.vcxproj", "{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xncbi.lib", "..\corelib\xncbi.lib.vcxproj", "{1EDB6A26-ADB9-4591-B907-505E8D1A8157}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xser.lib", "..\serial\xser.lib.vcxproj", "{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xutil.lib", "..\util\xutil.lib.vcxproj", "{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msbuild_dataobj.lib", "..\build-system\project_tree_builder\msbuild\msbuild_dataobj.lib.vcxproj", "{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9} = {BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datatool.exe", "..\serial\datatool\datatool.exe.vcxproj", "{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "project_tree_builder.exe", "..\build-system\project_tree_builder\project_tree_builder.exe.vcxproj", "{8D5B9C1E-5941-44F8-B017-25F6201E822B}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9} = {BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xregexp.lib", "..\util\xregexp\xregexp.lib.vcxproj", "{E46C5B0B-675C-4C37-B618-02608C379C67}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regexp.lib", "..\util\regexp\regexp.lib.vcxproj", "{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1EDB6A26-ADB9-4591-B907-505E8D1A8157}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8D5B9C1E-5941-44F8-B017-25F6201E822B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E46C5B0B-675C-4C37-B618-02608C379C67}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/vs2012/static/build/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/vs2012/static/build/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index 7a5fc57..0000000
--- a/c++/compilers/vs2012/static/build/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/vs2012/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index edae969..0000000
--- a/c++/compilers/vs2012/static/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_DIALOG_</ProjectName>
-    <ProjectGuid>{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_cpp.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/UtilityProjects/configure._ b/c++/compilers/vs2012/static/build/UtilityProjects/configure._
deleted file mode 100644
index 49cbd64..0000000
--- a/c++/compilers/vs2012/static/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/static/build/UtilityProjects/configure_dialog._ b/c++/compilers/vs2012/static/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index cdd8acd..0000000
--- a/c++/compilers/vs2012/static/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_cpp.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/static/build/all.bat b/c++/compilers/vs2012/static/build/all.bat
deleted file mode 100644
index 403d679..0000000
--- a/c++/compilers/vs2012/static/build/all.bat
+++ /dev/null
@@ -1,39 +0,0 @@
- at ECHO OFF
-REM $Id: all.bat 407453 2013-07-22 13:13:33Z gouriano $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Vladimir Ivanov
-REM
-REM Build all C++ Toolkit STATIC projects
-REM
-REM ===========================================================================
-
-
-CALL all_ncbi.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-IF ERRORLEVEL 1 GOTO _ABORT_
-
-CALL all_gui.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-:_ABORT_
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/all_gui.bat b/c++/compilers/vs2012/static/build/all_gui.bat
deleted file mode 100644
index 14cdd7f..0000000
--- a/c++/compilers/vs2012/static/build/all_gui.bat
+++ /dev/null
@@ -1,79 +0,0 @@
- at ECHO OFF
-REM $Id: all_gui.bat 417516 2013-11-07 14:13:14Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ GUI core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "static\gui"
-msbuild gui\ncbi_gui.sln /t:"_CONFIGURE_:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugMT GOTO CONTINUE
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseMT GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugMT DebugDLL ReleaseMT ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "static\gui\%CFG%"
-msbuild gui\ncbi_gui.sln /t:"_BUILD_ALL_" /p:Configuration=%CFG%
-REM vcbuild /M2 /time gui\ncbi_gui.sln "%CFG%|Win32"
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
-set CFG=
diff --git a/c++/compilers/vs2012/static/build/all_ncbi.bat b/c++/compilers/vs2012/static/build/all_ncbi.bat
deleted file mode 100644
index 3dca24a..0000000
--- a/c++/compilers/vs2012/static/build/all_ncbi.bat
+++ /dev/null
@@ -1,79 +0,0 @@
- at ECHO OFF
-REM $Id: all_ncbi.bat 417516 2013-11-07 14:13:14Z ivanov $
-REM ===========================================================================
-REM 
-REM                            PUBLIC DOMAIN NOTICE
-REM               National Center for Biotechnology Information
-REM 
-REM  This software/database is a "United States Government Work" under the
-REM  terms of the United States Copyright Act.  It was written as part of
-REM  the author's official duties as a United States Government employee and
-REM  thus cannot be copyrighted.  This software/database is freely available
-REM  to the public for use. The National Library of Medicine and the U.S.
-REM  Government have not placed any restriction on its use or reproduction.
-REM 
-REM  Although all reasonable efforts have been taken to ensure the accuracy
-REM  and reliability of the software and data, the NLM and the U.S.
-REM  Government do not and cannot warrant the performance or results that
-REM  may be obtained by using this software or data. The NLM and the U.S.
-REM  Government disclaim all warranties, express or implied, including
-REM  warranties of performance, merchantability or fitness for any particular
-REM  purpose.
-REM 
-REM  Please cite the author in any work or product based on this material.
-REM  
-REM ===========================================================================
-REM 
-REM Author:  Anton Lavrentiev
-REM
-REM Build NCBI C++ core libraries, tests and samples
-REM
-REM ===========================================================================
-
-call "..\..\msvcvars.bat"
-
-IF _%1% == _    GOTO BUILDALL
-IF _%1% == _ALL GOTO BUILDALL
-GOTO CONFIG
-
-:BUILDALL
-CALL %0 DebugDLL ReleaseDLL
-GOTO EXIT
-
-:CONFIG
-TIME /T
-ECHO INFO: Configure "static\ncbi"
-msbuild ncbi_cpp.sln /t:"_CONFIGURE_:Rebuild" /p:Configuration=ReleaseDLL
-IF ERRORLEVEL 1 GOTO ABORT
-
-SET CFG=%1%
-
-:ARGLOOP
-IF %CFG% == DebugMT GOTO CONTINUE
-IF %CFG% == DebugDLL GOTO CONTINUE
-IF %CFG% == ReleaseMT GOTO CONTINUE
-IF %CFG% == ReleaseDLL GOTO CONTINUE
-ECHO INFO: The following configuration names are recognized:
-ECHO       DebugMT DebugDLL ReleaseMT ReleaseDLL
-ECHO FATAL: Unknown configuration name %CFG%. Please correct.
-GOTO EXIT
-
-:CONTINUE
-TIME /T
-ECHO INFO: Building "static\ncbi\%CFG%"
-msbuild ncbi_cpp.sln /t:"_BUILD_ALL_" /p:Configuration=%CFG%
-REM vcbuild /M2 /time ncbi_cpp.sln "%CFG%|Win32"
-IF ERRORLEVEL 1 GOTO ABORT
-
-SHIFT
-IF _%1% == _ GOTO COMPLETE
-SET CFG=%1%
-GOTO ARGLOOP
-
-:ABORT
-ECHO INFO: Build failed.
-GOTO EXIT
-:COMPLETE
-ECHO INFO: Build complete.
-:EXIT
-set CFG=
diff --git a/c++/compilers/vs2012/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj b/c++/compilers/vs2012/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj
deleted file mode 100644
index a6b711f..0000000
--- a/c++/compilers/vs2012/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0">
-  <PropertyGroup Label="Globals"><ProjectGuid>{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}</ProjectGuid><Keyword>Win32Proj</Keyword><ProjectName>msbuild_dataobj.lib</ProjectName>
-  </PropertyGroup>
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration"><ConfigurationType>StaticLibrary</ConfigurationType><CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration"><ConfigurationType>StaticLibrary</ConfigurationType><CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
-  <ImportGroup Label="ExtensionSettings"></ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Label="LocalAppDataPlatform"/>
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Label="LocalAppDataPlatform"/>
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros"></PropertyGroup>
-  <PropertyGroup><_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-      <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\..\lib\$(Configuration)\</OutDir>
-      <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-      <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">msbuild_dataobj</TargetName>
-      <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\..\lib\$(Configuration)\</OutDir>
-      <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-      <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">msbuild_dataobj</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <ClCompile>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\..\include\</AdditionalIncludeDirectories>
-      <AdditionalOptions/>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <BrowseInformation>false</BrowseInformation>
-      <BufferSecurityCheck>TRUE</BufferSecurityCheck>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat/>
-      <DisableSpecificWarnings/>
-      <EnableFunctionLevelLinking>TRUE</EnableFunctionLevelLinking>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <IgnoreStandardIncludePath>FALSE</IgnoreStandardIncludePath>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <MinimalRebuild>FALSE</MinimalRebuild>
-      <OmitFramePointers>TRUE</OmitFramePointers>
-      <Optimization>MaxSpeed</Optimization>
-      <PrecompiledHeader></PrecompiledHeader>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)msbuild_dataobj.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>TRUE</RuntimeTypeInfo>
-      <StringPooling>FALSE</StringPooling>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <UndefinePreprocessorDefinitions/>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <Lib>
-      <AdditionalLibraryDirectories/>
-      <AdditionalOptions/>
-      <IgnoreAllDefaultLibraries>FALSE</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries/>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-    </Lib>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories/>
-      <AdditionalOptions/>
-      <PreprocessorDefinitions/>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\..\include\</AdditionalIncludeDirectories>
-      <AdditionalOptions/>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <BrowseInformation>false</BrowseInformation>
-      <BufferSecurityCheck>TRUE</BufferSecurityCheck>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat/>
-      <DisableSpecificWarnings/>
-      <EnableFunctionLevelLinking>TRUE</EnableFunctionLevelLinking>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <IgnoreStandardIncludePath>FALSE</IgnoreStandardIncludePath>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <MinimalRebuild>FALSE</MinimalRebuild>
-      <OmitFramePointers>TRUE</OmitFramePointers>
-      <Optimization>MaxSpeed</Optimization>
-      <PrecompiledHeader></PrecompiledHeader>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)msbuild_dataobj.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>TRUE</RuntimeTypeInfo>
-      <StringPooling>FALSE</StringPooling>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <UndefinePreprocessorDefinitions/>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <Lib>
-      <AdditionalLibraryDirectories/>
-      <AdditionalOptions/>
-      <IgnoreAllDefaultLibraries>FALSE</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries/>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-    </Lib>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories/>
-      <AdditionalOptions/>
-      <PreprocessorDefinitions/>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj__.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj___.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuild Include="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj.xsd">
-      <FileType>Document</FileType>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%( [...]
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Di [...]
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
-  <ImportGroup Label="ExtensionTargets"></ImportGroup>
-</Project>
diff --git a/c++/compilers/vs2012/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj b/c++/compilers/vs2012/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj
deleted file mode 100644
index eb84850..0000000
--- a/c++/compilers/vs2012/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj
+++ /dev/null
@@ -1,416 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{8D5B9C1E-5941-44F8-B017-25F6201E822B}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\bin\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\bin\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">false</LinkIncremental>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">project_tree_builder</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">project_tree_builder</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <PreBuildEvent>
-      <Command>%40echo EXPENDABLE project
-</Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)project_tree_builder.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Link>
-      <AdditionalOptions>ws2_32.lib dbghelp.lib %(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ProgramDatabaseFile>$(OutDir)project_tree_builder.pdb</ProgramDatabaseFile>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(OutDir)project_tree_builder.lib</ImportLibrary>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <PreBuildEvent>
-      <Command>%40echo EXPENDABLE project
-</Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)project_tree_builder.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Link>
-      <AdditionalOptions>ws2_32.lib dbghelp.lib %(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ProgramDatabaseFile>$(OutDir)project_tree_builder.pdb</ProgramDatabaseFile>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(OutDir)project_tree_builder.lib</ImportLibrary>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\configurable_file.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\file_contents.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project__.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project___.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure_prj_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_makefile.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_masterproject_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_files_collector.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_utils.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_project_context.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_site.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_sln_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_builder_app.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_datatool_generated_src.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_item.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_projects.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_src_resolver.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree_builder.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_utils.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\resolver.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_registry.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\configurable_file.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Configuration.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Configuration_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Configurations.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Configurations_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\File.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\File_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\file_contents.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\FileConfiguration.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\FileConfiguration_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Files.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Files_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Filter.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Filter_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project__.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_configure_prj_generator.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_dlls_info_utils.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_makefile.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_masterproject_generator.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_defines.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_files_collector.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_generator.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_prj_utils.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_project_context.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_site.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_sln_generator.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_tools_implement.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc_traits.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Platform.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Platform_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Platforms.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Platforms_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_builder_app.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_datatool_generated_src.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_item.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_projects.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_src_resolver.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_tree_builder.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\proj_utils.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\resolver.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\stl_msvc_usage.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Tool.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\Tool_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\VisualStudioProject.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\VisualStudioProject_.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\..\..\..\..\src\build-system\project_tree_builder\ptb_gui.rc" />
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuild Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project.dtd">
-<FileType>Document</FileType>
-<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Directory)%(Fil [...]
-<AdditionalInputs
-         Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
-<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
-
-<FileType>Document</FileType>
-<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Directory)%(Filen [...]
-<AdditionalInputs
-         Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
-<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
-    </CustomBuild>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\corelib\xncbi.lib.vcxproj">
-      <Project>{1edb6a26-adb9-4591-b907-505e8d1a8157}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\serial\xser.lib.vcxproj">
-      <Project>{1f5bcb57-26a5-46c7-b87c-fa74072cf5f6}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\util\regexp\regexp.lib.vcxproj">
-      <Project>{dfde1494-ed69-4c4f-84d3-0d19db1b424c}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\util\xregexp\xregexp.lib.vcxproj">
-      <Project>{e46c5b0b-675c-4c37-b618-02608c379c67}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\util\xutil.lib.vcxproj">
-      <Project>{1dce18cd-4a7e-43b8-b7af-48972efe51e7}</Project>
-    </ProjectReference>
-    <ProjectReference Include="msbuild\msbuild_dataobj.lib.vcxproj">
-      <Project>{FCA4C590-AB16-40F4-8C05-C41EF2A0F2FB}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/corelib/xncbi.lib.vcxproj b/c++/compilers/vs2012/static/build/corelib/xncbi.lib.vcxproj
deleted file mode 100644
index de4c078..0000000
--- a/c++/compilers/vs2012/static/build/corelib/xncbi.lib.vcxproj
+++ /dev/null
@@ -1,450 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{1EDB6A26-ADB9-4591-B907-505E8D1A8157}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">xncbi</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">xncbi</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xncbi.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xncbi.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ddumpable.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\env_reg.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\metareg.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_config.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_os_mswin.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_param.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_process.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_safe_static.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_system.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiapp.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiargs.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiatomic.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbidbg.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbidiag.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbidiag_p.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbidll.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbienv.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiexec.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiexpt.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbifile.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbimempool.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbimtx.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbiobj.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbireg.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbistr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbistre.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbithr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbitime.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\obj_store.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\plugin_manager.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\plugin_manager_store.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\rwstreambuf.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\syslog.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\version.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\stream_utils.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbi_stack.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\request_ctx.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\request_control.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\expr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbierror.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\src\corelib\ncbicfg.c.in">
-      <FileType>Document</FileType>
-      <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
-      <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">CompileAsC</CompileAs>
-    </ClCompile>
-    <None Include="..\..\..\..\..\include\corelib\ncbidiag.inl" />
-    <None Include="..\..\..\..\..\include\corelib\ncbimtx.inl" />
-    <None Include="..\..\..\..\..\include\corelib\ncbiobj.inl" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\include\corelib\ddumpable.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\guard.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\metareg.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\mswin_export.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_bswap.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_config.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_limits.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_limits.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_os_mac.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_os_mswin.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_os_unix.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_param.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_process.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_safe_static.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_system.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbi_tree.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiapp.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiargs.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiatomic.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbicfg.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbicntr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbidbg.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbidiag.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbidll.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbienv.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiexec.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiexpt.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbifile.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbifloat.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbimisc.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbimtx.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiobj.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbireg.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbistd.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbistl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbistr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbistre.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbithr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbithr_conf.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbitime.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbitype.h" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\ncbiutil.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\obj_store.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\plugin_manager.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\plugin_manager_impl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\plugin_manager_store.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\impl\rwstreambuf.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\syslog.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\test_mt.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\corelib\version.hpp" />
-    <ClInclude Include="..\..\..\..\..\src\corelib\ncbiargs_p.hpp" />
-    <ClInclude Include="..\..\..\..\..\src\corelib\ncbidbg_p.hpp" />
-    <ClInclude Include="..\..\..\..\..\src\corelib\ncbidiag_p.hpp" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/gui/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/vs2012/static/build/gui/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index b8ea021..0000000
--- a/c++/compilers/vs2012/static/build/gui/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/vs2012/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index 2125434..0000000
--- a/c++/compilers/vs2012/static/build/gui/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_DIALOG_</ProjectName>
-    <ProjectGuid>{FDC9447A-C7F1-492D-B84F-D54A1E610F16}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_gui.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/gui/UtilityProjects/configure._ b/c++/compilers/vs2012/static/build/gui/UtilityProjects/configure._
deleted file mode 100644
index 3589c55..0000000
--- a/c++/compilers/vs2012/static/build/gui/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/static/build/gui/UtilityProjects/configure_dialog._ b/c++/compilers/vs2012/static/build/gui/UtilityProjects/configure_dialog._
deleted file mode 100644
index 4907743..0000000
--- a/c++/compilers/vs2012/static/build/gui/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_gui.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/static/build/gui/ncbi_gui.sln b/c++/compilers/vs2012/static/build/gui/ncbi_gui.sln
deleted file mode 100644
index d1c733f..0000000
--- a/c++/compilers/vs2012/static/build/gui/ncbi_gui.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_DIALOG_", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{FDC9447A-C7F1-492D-B84F-D54A1E610F16}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAAA7E}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{FDC9447A-C7F1-492D-B84F-D54A1E610F16}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/vs2012/static/build/ncbi_cpp.sln b/c++/compilers/vs2012/static/build/ncbi_cpp.sln
deleted file mode 100644
index a63626e..0000000
--- a/c++/compilers/vs2012/static/build/ncbi_cpp.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_DIALOG_", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{E7DBEF6D-5DA9-4B0D-9375-C3F26659827B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA105}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/vs2012/static/build/serial/datatool/datatool.exe.vcxproj b/c++/compilers/vs2012/static/build/serial/datatool/datatool.exe.vcxproj
deleted file mode 100644
index efc887a..0000000
--- a/c++/compilers/vs2012/static/build/serial/datatool/datatool.exe.vcxproj
+++ /dev/null
@@ -1,507 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{BB57FAAE-2EFE-46A0-8157-8879C5AC76C9}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\bin\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\bin\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">false</LinkIncremental>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">datatool</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">datatool</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)datatool.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Link>
-      <AdditionalOptions>ws2_32.lib dbghelp.lib %(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ProgramDatabaseFile>$(OutDir)datatool.pdb</ProgramDatabaseFile>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(OutDir)datatool.lib</ImportLibrary>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)datatool.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Link>
-      <AdditionalOptions>ws2_32.lib dbghelp.lib %(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ProgramDatabaseFile>$(OutDir)datatool.pdb</ProgramDatabaseFile>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(OutDir)datatool.lib</ImportLibrary>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\alexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\aliasstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\aparser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\blocktype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\choiceptrstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\choicestr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\choicetype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\classstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\code.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\comments.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\datatool.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\dtdaux.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\dtdlexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\dtdparser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\enumstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\enumtype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\exceptions.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\filecode.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\fileutil.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\generate.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\lexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\mcontainer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\module.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\moduleset.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\namespace.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\parser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\ptrstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\reftype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\rpcgen.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\srcutil.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\statictype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\stdstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\stlstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\type.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\typestr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\unitype.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\value.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\xsdlexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\xsdparser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\wsdllexer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\wsdlparser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\wsdlstr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_code_generator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_merger.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_node.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_pattern_match_callback.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\serial\datatool\traversal_spec_file_parser.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\alexer.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\aliasstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\aparser.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\atoken.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\blocktype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\choiceptrstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\choicestr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\choicetype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\classctx.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\classstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\code.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\comments.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\datatool.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\dtdaux.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\dtdlexer.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\dtdparser.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\enumstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\enumtype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\exceptions.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\filecode.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\fileutil.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\generate.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\lexer.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\mcontainer.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\module.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\moduleset.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\namespace.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\parser.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\ptrstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\reftype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\rpcgen.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\srcutil.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\statictype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\stdstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\stlstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\tokens.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\type.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\typestr.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\unitype.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\serial\datatool\value.hpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\..\..\ncbi.rc" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\corelib\xncbi.lib.vcxproj">
-      <Project>{1edb6a26-adb9-4591-b907-505e8d1a8157}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\util\xutil.lib.vcxproj">
-      <Project>{1dce18cd-4a7e-43b8-b7af-48972efe51e7}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\xser.lib.vcxproj">
-      <Project>{1f5bcb57-26a5-46c7-b87c-fa74072cf5f6}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/serial/xser.lib.vcxproj b/c++/compilers/vs2012/static/build/serial/xser.lib.vcxproj
deleted file mode 100644
index 9359709..0000000
--- a/c++/compilers/vs2012/static/build/serial/xser.lib.vcxproj
+++ /dev/null
@@ -1,534 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{1F5BCB57-26A5-46C7-B87C-FA74072CF5F6}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">xser</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">xser</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xser.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xser.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\src\serial\aliasinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\autoptrinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\choice.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\choiceptr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\classinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\classinfob.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\continfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\delaybuf.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\enumerated.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\exception.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\hookdata.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\hookdatakey.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\item.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\iterator.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\member.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\memberid.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\memberlist.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objcopy.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objectinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objectio.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objectiter.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objhook.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistrasn.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistrasnb.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistrxml.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objlist.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostr.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostrasn.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostrasnb.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostrxml.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objostrjson.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objistrjson.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\objstack.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\pack_string.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\pathhook.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\ptrinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\serial.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\serializable.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\serialobject.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\stdtypes.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\stltypes.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\typeinfo.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\typemap.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\typeref.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\serial\variant.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\include\serial\aliasinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\asntypes.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\autoptrinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\choice.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\choiceptr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\classinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\classinfob.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\classinfohelper.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\continfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\delaybuf.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\enumerated.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\enumvalues.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\exception.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\hookdata.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\hookdataimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\hookdatakey.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\hookfunc.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\item.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\iterator.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\iteratorbase.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\member.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\memberid.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\memberlist.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objcopy.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\object.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objectinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objectio.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objectiter.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objecttype.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objhook.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistrasn.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistrasnb.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistrimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objistrxml.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objlist.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objostr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objostrasn.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objostrasnb.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objostrxml.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objstack.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objstrasnb.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\objstrb.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\pack_string.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\pathhook.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\ptrinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\rpcbase.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serial.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialasn.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialasndef.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialbase.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialdef.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serializable.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\serialutil.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stdtypeinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stdtypes.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stdtypesimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stltypes.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\stltypesimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\timetypeinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typeinfo.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typeinfoimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typemap.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typemapimpl.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typemapper.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\typeref.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\serial\variant.hpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\..\..\..\include\serial\choice.inl" />
-    <None Include="..\..\..\..\..\include\serial\classinfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\classinfob.inl" />
-    <None Include="..\..\..\..\..\include\serial\continfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\item.inl" />
-    <None Include="..\..\..\..\..\include\serial\iterator.inl" />
-    <None Include="..\..\..\..\..\include\serial\iteratorbase.inl" />
-    <None Include="..\..\..\..\..\include\serial\member.inl" />
-    <None Include="..\..\..\..\..\include\serial\memberid.inl" />
-    <None Include="..\..\..\..\..\include\serial\memberlist.inl" />
-    <None Include="..\..\..\..\..\include\serial\objcopy.inl" />
-    <None Include="..\..\..\..\..\include\serial\object.inl" />
-    <None Include="..\..\..\..\..\include\serial\objectinfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\objectio.inl" />
-    <None Include="..\..\..\..\..\include\serial\objectiter.inl" />
-    <None Include="..\..\..\..\..\include\serial\objistr.inl" />
-    <None Include="..\..\..\..\..\include\serial\objistrasnb.inl" />
-    <None Include="..\..\..\..\..\include\serial\objistrimpl.inl" />
-    <None Include="..\..\..\..\..\include\serial\objistrxml.inl" />
-    <None Include="..\..\..\..\..\include\serial\objlist.inl" />
-    <None Include="..\..\..\..\..\include\serial\objostr.inl" />
-    <None Include="..\..\..\..\..\include\serial\objostrasnb.inl" />
-    <None Include="..\..\..\..\..\include\serial\objostrxml.inl" />
-    <None Include="..\..\..\..\..\include\serial\objstack.inl" />
-    <None Include="..\..\..\..\..\include\serial\objstrasnb.inl" />
-    <None Include="..\..\..\..\..\include\serial\ptrinfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\serial.inl" />
-    <None Include="..\..\..\..\..\include\serial\serialdef.inl" />
-    <None Include="..\..\..\..\..\include\serial\stdtypes.inl" />
-    <None Include="..\..\..\..\..\include\serial\typeinfo.inl" />
-    <None Include="..\..\..\..\..\include\serial\typeinfoimpl.inl" />
-    <None Include="..\..\..\..\..\include\serial\typeref.inl" />
-    <None Include="..\..\..\..\..\include\serial\variant.inl" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/util/regexp/regexp.lib.vcxproj b/c++/compilers/vs2012/static/build/util/regexp/regexp.lib.vcxproj
deleted file mode 100644
index d3da09b..0000000
--- a/c++/compilers/vs2012/static/build/util/regexp/regexp.lib.vcxproj
+++ /dev/null
@@ -1,364 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <Keyword>Win32Proj</Keyword>
-    <ProjectGuid>{DFDE1494-ED69-4C4F-84D3-0D19DB1B424C}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">regexp</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">regexp</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\; ..\..\..\..\..\..\include\internal\; ..\..\..\..\..\..\include\util\regexp\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <ProgramDataBaseFileName>$(IntDir)regexp.pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <MinimalRebuild>false</MinimalRebuild>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>false</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <CallingConvention>Cdecl</CallingConvention>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-    </ClCompile>
-    <Lib>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ResourceCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\; ..\..\..\..\..\..\include\internal\; ..\..\..\..\..\..\include\util\regexp\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <ProgramDataBaseFileName>$(IntDir)regexp.pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <MinimalRebuild>false</MinimalRebuild>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>false</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <CallingConvention>Cdecl</CallingConvention>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-    </ClCompile>
-    <Lib>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ResourceCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_chartables.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_compile.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_config.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_dfa_exec.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_exec.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_fullinfo.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_get.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_globals.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_info.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_maketables.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_newline.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_ord2utf8.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_refcount.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_study.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_tables.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_try_flipped.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_ucd.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_valid_utf8.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_version.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcre_xclass.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\regexp\pcreposix.c">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-      </PrecompiledHeaderFile>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-      </PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\..\include\util\regexp\pcre.h" />
-    <ClInclude Include="..\..\..\..\..\..\include\util\regexp\pcreposix.h" />
-    <ClInclude Include="..\..\..\..\..\..\src\util\regexp\pcre_config.h" />
-    <ClInclude Include="..\..\..\..\..\..\src\util\regexp\pcre_internal.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/util/xregexp/xregexp.lib.vcxproj b/c++/compilers/vs2012/static/build/util/xregexp/xregexp.lib.vcxproj
deleted file mode 100644
index 16432b6..0000000
--- a/c++/compilers/vs2012/static/build/util/xregexp/xregexp.lib.vcxproj
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <Keyword>Win32Proj</Keyword>
-    <ProjectGuid>{E46C5B0B-675C-4C37-B618-02608C379C67}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">xregexp</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">xregexp</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\; ..\..\..\..\..\..\include\internal\; ..\..\..\..\..\..\include\util\regexp\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <ProgramDataBaseFileName>$(IntDir)xregexp.pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <MinimalRebuild>false</MinimalRebuild>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>false</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <CallingConvention>Cdecl</CallingConvention>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-    </ClCompile>
-    <Lib>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ResourceCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\..\..\..\..\include\; ..\..\..\..\..\..\include\internal\; ..\..\..\..\..\..\include\util\regexp\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <ProgramDataBaseFileName>$(IntDir)xregexp.pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <MinimalRebuild>false</MinimalRebuild>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <OmitFramePointers>true</OmitFramePointers>
-      <StringPooling>false</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <CallingConvention>Cdecl</CallingConvention>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-    </ClCompile>
-    <Lib>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ResourceCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\..\src\util\xregexp\arg_regexp.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\xregexp\mask_regexp.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Use</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Use</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\..\src\util\xregexp\regexp.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Use</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Use</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\..\include\util\xregexp\arg_regexp.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\util\xregexp\mask_regexp.hpp" />
-    <ClInclude Include="..\..\..\..\..\..\include\util\xregexp\regexp.hpp" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/build/util/xutil.lib.vcxproj b/c++/compilers/vs2012/static/build/util/xutil.lib.vcxproj
deleted file mode 100644
index d8844d1..0000000
--- a/c++/compilers/vs2012/static/build/util/xutil.lib.vcxproj
+++ /dev/null
@@ -1,309 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{1DCE18CD-4A7E-43B8-B7AF-48972EFE51E7}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">..\..\lib\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">xutil</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">xutil</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xutil.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <OmitFramePointers>true</OmitFramePointers>
-      <AdditionalIncludeDirectories>..\..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <StringPooling>false</StringPooling>
-      <MinimalRebuild>false</MinimalRebuild>
-      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <ProgramDataBaseFileName>$(IntDir)xutil.pdb</ProgramDataBaseFileName>
-      <StructMemberAlignment>Default</StructMemberAlignment>
-      <BufferSecurityCheck>true</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <BrowseInformation>
-      </BrowseInformation>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <CallingConvention>Cdecl</CallingConvention>
-      <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <UndefinePreprocessorDefinitions>%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Lib>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>FALSE;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\..\..\src\util\ascii85.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\bytesrc.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\checksum.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\ddump_viewer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\dictionary.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\file_obsolete.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\format_guess.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\itree.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\logrotate.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\md5.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\random_gen.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\smalldns.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\strbuffer.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\strsearch.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\thread_nonstop.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\thread_pool.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\unicode.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\utf8.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\..\src\util\util_exception.cpp">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">ncbi_pch.hpp</PrecompiledHeaderFile>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">NCBI_USE_PCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">ncbi_pch.hpp</PrecompiledHeaderFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\..\..\include\util\ascii85.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\bytesrc.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\checksum.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\ddump_viewer.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\dictionary.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\file_obsolete.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\format_guess.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\itree.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\lightstr.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\linkedset.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\logrotate.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\md5.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\ncbi_table.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\random_gen.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\range.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\range_coll.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\rangemap.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\reader_writer.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\regexp.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\resize_iter.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\resource_pool.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\rwstream.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\smalldns.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\static_map.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\static_set.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\strbuffer.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\strsearch.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\thread_nonstop.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\thread_pool.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\unicode.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\utf8.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\util_exception.hpp" />
-    <ClInclude Include="..\..\..\..\..\include\util\weakmap.hpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\..\..\..\include\util\checksum.inl" />
-    <None Include="..\..\..\..\..\include\util\itree.inl" />
-    <None Include="..\..\..\..\..\include\util\rangemap.inl" />
-    <None Include="..\..\..\..\..\include\util\strbuffer.inl" />
-    <None Include="..\..\..\..\..\include\util\weakmap.inl" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/static/third_party_msvcstatic_install.vcxproj b/c++/compilers/vs2012/static/third_party_msvcstatic_install.vcxproj
deleted file mode 100644
index b5f0816..0000000
--- a/c++/compilers/vs2012/static/third_party_msvcstatic_install.vcxproj
+++ /dev/null
@@ -1,433 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|Win32">
-      <Configuration>DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|x64">
-      <Configuration>DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|Win32">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|x64">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|Win32">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|x64">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|Win32">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|x64">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|Win32">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|x64">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|Win32">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|x64">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9E4B5381-9B6C-4867-BF8A-F1AAA1FD581E}</ProjectGuid>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_install IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_rebuild IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" msvc_clean IntDir=$(IntDir) MSVC_SRC="vs2012.64"</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="third_party_static_install.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/vs2012/static/third_party_static_install.mak b/c++/compilers/vs2012/static/third_party_static_install.mak
deleted file mode 100644
index c8794e2..0000000
--- a/c++/compilers/vs2012/static/third_party_static_install.mak
+++ /dev/null
@@ -1,62 +0,0 @@
-# $Id: third_party_static_install.mak 463528 2015-03-30 14:10:31Z ucko $
-#################################################################
-
-
-INSTALL          = .\bin
-INSTALL_BINPATH  = $(INSTALL)\$(INTDIR)
-THIRDPARTY_MAKEFILES_DIR =  .
-
-
-META_MAKE = $(THIRDPARTY_MAKEFILES_DIR)\..\third_party_install.meta.mk
-!IF EXIST($(META_MAKE))
-!INCLUDE $(META_MAKE)
-!ELSE
-!ERROR  $(META_MAKE)  not found
-!ENDIF
-
-THIRD_PARTY_LIBS = \
-	install_berkeleydb \
-	install_gnutls     \
-	install_glew       \
-	install_lzo        \
-	install_mssql      \
-	install_mysql      \
-	install_openssl    \
-	install_sqlite     \
-	install_sqlite3    \
-	install_sybase     \
-	install_wxwidgets  \
-	install_wxwindows  \
-	install_xalan      \
-	install_xerces     \
-	install_libxml     \
-	install_libxslt    \
-	install_vdb
-
-CLEAN_THIRD_PARTY_LIBS = \
-	clean_berkeleydb \
-	clean_gnutls     \
-	clean_glew       \
-	clean_lzo        \
-	clean_mssql      \
-	clean_mysql      \
-	clean_openssl    \
-	clean_sqlite     \
-	clean_sqlite3    \
-	clean_sybase     \
-	clean_wxwidgets  \
-	clean_wxwindows  \
-	clean_xalan      \
-	clean_xerces     \
-	clean_libxml     \
-	clean_libxslt    \
-	clean_vdb
-
-all : dirs $(THIRD_PARTY_LIBS)
-
-clean : $(CLEAN_THIRD_PARTY_LIBS)
-
-rebuild : clean all
-
-dirs :
-    @if not exist $(INSTALL_BINPATH) (echo Creating directory $(INSTALL_BINPATH)... & mkdir $(INSTALL_BINPATH))
diff --git a/c++/compilers/vs2012/static/third_party_static_install.vcxproj b/c++/compilers/vs2012/static/third_party_static_install.vcxproj
deleted file mode 100644
index 2577c5f..0000000
--- a/c++/compilers/vs2012/static/third_party_static_install.vcxproj
+++ /dev/null
@@ -1,433 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|Win32">
-      <Configuration>DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugMT|x64">
-      <Configuration>DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|Win32">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseMT|x64">
-      <Configuration>ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|Win32">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugDLL|x64">
-      <Configuration>Unicode_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|Win32">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_DebugMT|x64">
-      <Configuration>Unicode_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|Win32">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseDLL|x64">
-      <Configuration>Unicode_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|Win32">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Unicode_ReleaseMT|x64">
-      <Configuration>Unicode_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|Win32">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugDLL|x64">
-      <Configuration>VTune_DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|Win32">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_DebugMT|x64">
-      <Configuration>VTune_DebugMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|Win32">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseDLL|x64">
-      <Configuration>VTune_ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|Win32">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="VTune_ReleaseMT|x64">
-      <Configuration>VTune_ReleaseMT</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9E4B5381-9B6C-4867-BF8A-F1AAA1FD580E}</ProjectGuid>
-    <Keyword>MakeFileProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="Configuration">
-    <ConfigurationType>Makefile</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Unicode_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugMT|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|Win32'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_DebugDLL|x64'">gbench-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseMT|x64'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|Win32'">dlls-install.exe</NMakeOutput>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">$(Configuration)\</IntDir>
-    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" all IntDir=$(IntDir)</NMakeBuildCommandLine>
-    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">nmake -f "$(ProjectDir)\third_party_static_install.mak" rebuild IntDir=$(IntDir)</NMakeReBuildCommandLine>
-    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">call "$(ProjectDir)..\msvcvars.bat" & nmake -f "$(ProjectDir)\third_party_static_install.mak" clean IntDir=$(IntDir)</NMakeCleanCommandLine>
-    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='VTune_ReleaseDLL|x64'">dlls-install.exe</NMakeOutput>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="third_party_static_install.mak" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/c++/compilers/vs2012/third_party_install.meta.mk b/c++/compilers/vs2012/third_party_install.meta.mk
deleted file mode 100644
index 3752e7d..0000000
--- a/c++/compilers/vs2012/third_party_install.meta.mk
+++ /dev/null
@@ -1,326 +0,0 @@
-# $Id: third_party_install.meta.mk 468588 2015-05-26 17:46:51Z ucko $
-
-#################################################################
-#
-# Third party DLLs installation makefile
-#
-# Author: Andrei Gourianov
-#
-#################################################################
-
-
-# Build configuration name
-INTDIR = $(INTDIR:.\=)
-ALTDIR = $(INTDIR:VTune_=)
-!IF ("$(INTDIR)"=="$(ALTDIR)")
-ALTDIR = $(INTDIR:Unicode_=)
-!ENDIF
-
-# Extensions of files to copy
-EXTENSIONS         = dll pdb manifest
-
-# MSVC DLLs
-#  MSVC_SRC must be defined elsewhere (eg, in command line)
-#MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\msvc71\7.1\bin
-#MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\msvc8\8\bin
-
-MSVCRT_SRC = \\snowman\win-coremake\Lib\ThirdParty\msvc\$(MSVC_SRC)\bin
-
-
-
-#################################################################
-# Source folders
-#
-# x_BINPATH macros are defined in Makefile.third_party.mk 
-# generated by project_tree_builder
-#
-
-PTB_GENERATED = $(THIRDPARTY_MAKEFILES_DIR)\$(INTDIR)\Makefile.third_party.mk
-!IF EXIST($(PTB_GENERATED))
-!INCLUDE $(PTB_GENERATED)
-!ELSE
-!ERROR  $(PTB_GENERATED)  not found
-!ENDIF
-
-
-BERKELEYDB_SRC = $(BERKELEYDB_BINPATH)\$(INTDIR)
-!IF !EXIST($(BERKELEYDB_SRC))
-BERKELEYDB_SRC = $(BERKELEYDB_BINPATH)\$(ALTDIR)
-!ENDIF
-
-GNUTLS_SRC = $(GNUTLS_BINPATH)\$(INTDIR)
-!IF !EXIST($(GNUTLS_SRC))
-GNUTLS_SRC = $(GNUTLS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-GLEW_SRC = $(GLEW_BINPATH)\$(INTDIR)
-!IF !EXIST($(GLEW_SRC))
-GLEW_SRC = $(GLEW_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LZO_SRC = $(LZO_BINPATH)\$(INTDIR)
-!IF !EXIST($(LZO_SRC))
-LZO_SRC = $(LZO_BINPATH)\$(ALTDIR)
-!ENDIF
-
-MSSQL_SRC = $(MSSQL_BINPATH)\$(INTDIR)
-!IF !EXIST($(MSSQL_SRC))
-MSSQL_SRC = $(MSSQL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-MYSQL_SRC = $(MYSQL_BINPATH)\$(INTDIR)
-!IF !EXIST($(MYSQL_SRC))
-MYSQL_SRC = $(MYSQL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-OPENSSL_SRC = $(OPENSSL_BINPATH)\$(INTDIR)
-!IF !EXIST($(OPENSSL_SRC))
-OPENSSL_SRC = $(OPENSSL_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SQLITE_SRC = $(SQLITE_BINPATH)\$(INTDIR)
-!IF !EXIST($(SQLITE_SRC))
-SQLITE_SRC = $(SQLITE_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SQLITE3_SRC = $(SQLITE3_BINPATH)\$(INTDIR)
-!IF !EXIST($(SQLITE3_SRC))
-SQLITE3_SRC = $(SQLITE3_BINPATH)\$(ALTDIR)
-!ENDIF
-
-SYBASE_SRC = $(SYBASE_BINPATH)\$(INTDIR)
-!IF !EXIST($(SYBASE_SRC))
-SYBASE_SRC = $(SYBASE_BINPATH)\$(ALTDIR)
-!ENDIF
-
-WXWIDGETS_SRC = $(WXWIDGETS_BINPATH)\$(INTDIR)
-!IF !EXIST($(WXWIDGETS_SRC))
-WXWIDGETS_SRC = $(WXWIDGETS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-WXWINDOWS_SRC = $(WXWINDOWS_BINPATH)\$(INTDIR)
-!IF !EXIST($(WXWINDOWS_SRC))
-WXWINDOWS_SRC = $(WXWINDOWS_BINPATH)\$(ALTDIR)
-!ENDIF
-
-XALAN_SRC = $(XALAN_BINPATH)\$(INTDIR)
-!IF !EXIST($(XALAN_SRC))
-XALAN_SRC = $(XALAN_BINPATH)\$(ALTDIR)
-!ENDIF
-
-XERCES_SRC = $(XERCES_BINPATH)\$(INTDIR)
-!IF !EXIST($(XERCES_SRC))
-XERCES_SRC = $(XERCES_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LIBXML_SRC = $(LIBXML_BINPATH)\$(INTDIR)
-!IF !EXIST($(LIBXML_SRC))
-LIBXML_SRC = $(LIBXML_BINPATH)\$(ALTDIR)
-!ENDIF
-
-LIBXSLT_SRC = $(LIBXSLT_BINPATH)\$(INTDIR)
-!IF !EXIST($(LIBXSLT_SRC))
-LIBXSLT_SRC = $(LIBXSLT_BINPATH)\$(ALTDIR)
-!ENDIF
-
-VDB_SRC = $(VDB_BINPATH)
-
-
-
-#################################################################
-
-INSTALL_CMD = \
-	@if exist "$*" ( for %%e in ($(EXTENSIONS)) do @( \
-	    if exist "$*\*.%%e" ( \
-	      for /f "delims=" %%i in ('dir /a-d/b "$*\*.%%e"') do @( \
-	        xcopy /Y /D /F "$*\%%i" "$(INSTALL_BINPATH)" ) \
-	    )) \
-	) else (echo WARNING:   "$*" not found)
-
-CLEAN_CMD = \
-	@if exist "$*" ( for %%e in ($(EXTENSIONS)) do @( \
-	    if exist "$*\*.%%e" ( \
-	      for /f "delims=" %%i in ('dir /a-d/b "$*\*.%%e"') do @( \
-	        if exist "$(INSTALL_BINPATH)\%%i" ( \
-	          echo $(INSTALL_BINPATH)\%%i & del /F "$(INSTALL_BINPATH)\%%i" )))) \
-	) else (echo WARNING:   "$*" not found)
-
-
-
-#################################################################
-# Targets
-#
-
-$(BERKELEYDB_SRC).berkeleydb_install :
-	@echo ---- & echo Copying BerkeleyDB DLLs & $(INSTALL_CMD)
-$(BERKELEYDB_SRC).berkeleydb_clean :
-	@echo ---- & echo Deleting BerkeleyDB DLLs & $(CLEAN_CMD)
-install_berkeleydb : $(BERKELEYDB_SRC).berkeleydb_install
-clean_berkeleydb : $(BERKELEYDB_SRC).berkeleydb_clean
-
-
-
-$(GNUTLS_SRC).gnutls_install :
-	@echo ---- & echo Copying GNUTLS DLLs & $(INSTALL_CMD)
-$(GNUTLS_SRC).gnutls_clean :
-	@echo ---- & echo Deleting GNUTLS DLLs & $(CLEAN_CMD)
-install_gnutls : $(GNUTLS_SRC).gnutls_install
-clean_gnutls : $(GNUTLS_SRC).gnutls_clean
-
-
-
-$(GLEW_SRC).glew_install :
-	@echo ---- & echo Copying GLEW DLLs & $(INSTALL_CMD)
-$(GLEW_SRC).glew_clean :
-	@echo ---- & echo Deleting GLEW DLLs & $(CLEAN_CMD)
-install_glew : $(GLEW_SRC).glew_install
-clean_glew : $(GLEW_SRC).glew_clean
-
-
-
-$(LZO_SRC).lzo_install :
-	@echo ---- & echo Copying LZO DLLs & $(INSTALL_CMD)
-$(LZO_SRC).lzo_clean :
-	@echo ---- & echo Deleting LZO DLLs & $(CLEAN_CMD)
-install_lzo : $(LZO_SRC).lzo_install
-clean_lzo : $(LZO_SRC).lzo_clean
-
-
-
-$(MYSQL_SRC).mysql_install :
-	@echo ---- & echo Copying MySQL DLLs & $(INSTALL_CMD)
-$(MYSQL_SRC).mysql_clean :
-	@echo ---- & echo Deleting MySQL DLLs & $(CLEAN_CMD)
-install_mysql : $(MYSQL_SRC).mysql_install
-clean_mysql : $(MYSQL_SRC).mysql_clean
-
-
-
-$(MSSQL_SRC).mssql_install :
-	@echo ---- & echo Copying MSSQL DLLs & $(INSTALL_CMD)
-$(MSSQL_SRC).mssql_clean :
-	@echo ---- & echo Deleting MSSQL DLLs & $(CLEAN_CMD)
-install_mssql : $(MSSQL_SRC).mssql_install
-clean_mssql : $(MSSQL_SRC).mssql_clean
-
-
-
-$(OPENSSL_SRC).openssl_install :
-	@echo ---- & echo Copying OpenSSL DLLs & $(INSTALL_CMD)
-$(OPENSSL_SRC).openssl_clean :
-	@echo ---- & echo Deleting OpenSSL DLLs & $(CLEAN_CMD)
-install_openssl : $(OPENSSL_SRC).openssl_install
-clean_openssl : $(OPENSSL_SRC).openssl_clean
-
-
-
-$(SQLITE_SRC).sqlite_install :
-	@echo ---- & echo Copying SQLite DLLs & $(INSTALL_CMD)
-$(SQLITE_SRC).sqlite_clean :
-	@echo ---- & echo Deleting SQLite DLLs & $(CLEAN_CMD)
-install_sqlite : $(SQLITE_SRC).sqlite_install
-clean_sqlite : $(SQLITE_SRC).sqlite_clean
-
-
-
-$(SQLITE3_SRC).sqlite3_install :
-	@echo ---- & echo Copying SQLite3 DLLs & $(INSTALL_CMD)
-$(SQLITE3_SRC).sqlite3_clean :
-	@echo ---- & echo Deleting SQLite3 DLLs & $(CLEAN_CMD)
-install_sqlite3 : $(SQLITE3_SRC).sqlite3_install
-clean_sqlite3 : $(SQLITE3_SRC).sqlite3_clean
-
-
-
-$(SYBASE_SRC).sybase_install :
-	@echo ---- & echo Copying Sybase DLLs & $(INSTALL_CMD)
-$(SYBASE_SRC).sybase_clean :
-	@echo ---- & echo Deleting Sybase DLLs & $(CLEAN_CMD)
-install_sybase : $(SYBASE_SRC).sybase_install
-clean_sybase : $(SYBASE_SRC).sybase_clean
-
-
-
-$(WXWIDGETS_SRC).wxwidgets_install :
-	@echo ---- & echo Copying wxWidgets DLLs & $(INSTALL_CMD)
-$(WXWIDGETS_SRC).wxwidgets_clean :
-	@echo ---- & echo Deleting wxWidgets DLLs & $(CLEAN_CMD)
-install_wxwidgets : $(WXWIDGETS_SRC).wxwidgets_install
-clean_wxwidgets : $(WXWIDGETS_SRC).wxwidgets_clean
-
-
-
-$(WXWINDOWS_SRC).wxwindows_install :
-	@echo ---- & echo Copying wxWindows DLLs & $(INSTALL_CMD)
-$(WXWINDOWS_SRC).wxwindows_clean :
-	@echo ---- & echo Deleting wxWindows DLLs & $(CLEAN_CMD)
-install_wxwindows : $(WXWINDOWS_SRC).wxwindows_install
-clean_wxwindows : $(WXWINDOWS_SRC).wxwindows_clean
-
-
-
-$(XALAN_SRC).xalan_install :
-	@echo ---- & echo Copying Xalan DLLs & $(INSTALL_CMD)
-$(XALAN_SRC).xalan_clean :
-	@echo ---- & echo Deleting Xalan DLLs & $(CLEAN_CMD)
-install_xalan : $(XALAN_SRC).xalan_install
-clean_xalan : $(XALAN_SRC).xalan_clean
-
-
-
-$(XERCES_SRC).xerces_install :
-	@echo ---- & echo Copying Xerces DLLs & $(INSTALL_CMD)
-$(XERCES_SRC).xerces_clean :
-	@echo ---- & echo Deleting Xerces DLLs & $(CLEAN_CMD)
-install_xerces : $(XERCES_SRC).xerces_install
-clean_xerces : $(XERCES_SRC).xerces_clean
-
-
-
-$(LIBXML_SRC).libxml_install :
-	@echo ---- & echo Copying LIBXML DLLs & $(INSTALL_CMD)
-$(LIBXML_SRC).libxml_clean :
-	@echo ---- & echo Deleting LIBXML DLLs & $(CLEAN_CMD)
-install_libxml : $(LIBXML_SRC).libxml_install
-clean_libxml : $(LIBXML_SRC).libxml_clean
-
-
-
-$(LIBXSLT_SRC).libxslt_install :
-	@echo ---- & echo Copying LIBXSLT DLLs & $(INSTALL_CMD)
-$(LIBXSLT_SRC).libxslt_clean :
-	@echo ---- & echo Deleting LIBXSLT DLLs & $(CLEAN_CMD)
-install_libxslt : $(LIBXSLT_SRC).libxslt_install
-clean_libxslt : $(LIBXSLT_SRC).libxslt_clean
-
-
-VDB_ORIG = $(INSTALL_BINPATH)\ncbi-vdb-md.dll
-VDB_COPY = $(INSTALL_BINPATH)\ncbi-vdb-dll-md.dll
-$(VDB_SRC).vdb_install :
-	@echo ---- & echo Copying VDB DLLs & $(INSTALL_CMD)
-# The trailing * suppresses a spurious prompt, per
-# http://stackoverflow.com/a/26034267/1231
-	@if exist "$(VDB_ORIG)" xcopy /Y /D /F "$(VDB_ORIG)" "$(VDB_COPY)"*
-$(VDB_SRC).vdb_clean :
-	@echo ---- & echo Deleting VDB DLLs & $(CLEAN_CMD)
-	@if exist "$(VDB_COPY)" ( echo $(VDB_COPY) & del /f "$(VDB_COPY)" )
-install_vdb : $(VDB_SRC).vdb_install
-clean_vdb : $(VDB_SRC).vdb_clean
-
-
-
-# -----------------------------------------
-# MSVC RT DLLs are not included into 'all'
-
-msvc_install : dirs $(MSVCRT_SRC).msvc_install
-
-install_msvc : msvc_install
-msvc_clean : $(MSVCRT_SRC).msvc_clean
-clean_msvc : msvc_clean
-msvc_rebuild : msvc_clean msvc_install
-
-$(MSVCRT_SRC).msvc_install :
-	@echo ---- & echo Copying MSVC DLLs & $(INSTALL_CMD)
-$(MSVCRT_SRC).msvc_clean :
-	@echo ---- & echo Deleting MSVC DLLs & $(CLEAN_CMD)
-	
diff --git a/c++/compilers/vs2012/user/build/UtilityProjects/_CONFIGURE_.vcxproj b/c++/compilers/vs2012/user/build/UtilityProjects/_CONFIGURE_.vcxproj
deleted file mode 100644
index dad1373..0000000
--- a/c++/compilers/vs2012/user/build/UtilityProjects/_CONFIGURE_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_</ProjectName>
-    <ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj b/c++/compilers/vs2012/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
deleted file mode 100644
index e460c2a..0000000
--- a/c++/compilers/vs2012/user/build/UtilityProjects/_CONFIGURE_DIALOG_.vcxproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="DebugDLL|Win32">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="DebugDLL|x64">
-      <Configuration>DebugDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|Win32">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseDLL|x64">
-      <Configuration>ReleaseDLL</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>_CONFIGURE_DIALOG_</ProjectName>
-    <ProjectGuid>{EB043EAF-58D4-4179-AC32-538D9059BB8B}</ProjectGuid>
-    <RootNamespace>MasterProject</RootNamespace>
-    <Keyword>ManagedCProj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
-    <ConfigurationType>Utility</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">$(Configuration)\$(TargetName)\</IntDir>
-<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">_CONFIGURE_DIALOG_</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="configure_dialog._">
-      <FileType>Document</FileType>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Configure solution : $(SolutionName)</Message>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set PTB_PATH=$(ProjectDir)..\..\..\static\bin\ReleaseDLL
-set TREE_ROOT=$(ProjectDir)..\..\..\..\..
-set SLN_PATH=$(ProjectDir)..\ncbi_user.sln
-set PTB_PLATFORM=$(Platform)
-set BUILD_TREE_ROOT=$(ProjectDir)..\..\..
-copy /Y %(Filename)%(Extension) %(Filename).bat
-call %(Filename).bat
-if errorlevel 1 exit 1
-</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(FullPath).aanofile.out;$(ProjectDir)..\..\..\static\bin\ReleaseDLL\project_tree_builder.exe;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Configure solution : $(SolutionName)</Message>
-    </CustomBuild>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/c++/compilers/vs2012/user/build/UtilityProjects/configure._ b/c++/compilers/vs2012/user/build/UtilityProjects/configure._
deleted file mode 100644
index 7766ecc..0000000
--- a/c++/compilers/vs2012/user/build/UtilityProjects/configure._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS=
-set PTB_PROJECT_REQ=scripts\projects\ncbi_user.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/user/build/UtilityProjects/configure_dialog._ b/c++/compilers/vs2012/user/build/UtilityProjects/configure_dialog._
deleted file mode 100644
index a954163..0000000
--- a/c++/compilers/vs2012/user/build/UtilityProjects/configure_dialog._
+++ /dev/null
@@ -1,4 +0,0 @@
-set PTB_FLAGS= -cfg
-set PTB_PROJECT_REQ=scripts\projects\ncbi_user.lst
-call "%BUILD_TREE_ROOT%\ptb.bat"
-if errorlevel 1 exit 1
diff --git a/c++/compilers/vs2012/user/build/ncbi_user.sln b/c++/compilers/vs2012/user/build/ncbi_user.sln
deleted file mode 100644
index e92c97a..0000000
--- a/c++/compilers/vs2012/user/build/ncbi_user.sln
+++ /dev/null
@@ -1,35 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_", "UtilityProjects\_CONFIGURE_.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_CONFIGURE_DIALOG_", "UtilityProjects\_CONFIGURE_DIALOG_.vcxproj", "{EB043EAF-58D4-4179-AC32-538D9059BB8B}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		DebugDLL|Win32 = DebugDLL|Win32
-		DebugDLL|x64 = DebugDLL|x64
-		ReleaseDLL|Win32 = ReleaseDLL|Win32
-		ReleaseDLL|x64 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{8BC9CEB8-8B4A-11D0-8D11-AAAAAAAAA108}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.DebugDLL|x64.Build.0 = DebugDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
-		{EB043EAF-58D4-4179-AC32-538D9059BB8B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/c++/compilers/vs2013/check.sh b/c++/compilers/vs2013/check.sh
index be6bf90..bf41274 100644
--- a/c++/compilers/vs2013/check.sh
+++ b/c++/compilers/vs2013/check.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $Id: check.sh 473888 2015-07-23 12:02:15Z ivanov $
+# $Id: check.sh 473467 2015-07-20 18:27:15Z ivanov $
 # Author:  Vladimir Ivanov (ivanov at ncbi.nlm.nih.gov)
 #
 # Check C++ Toolkit in all previously built configurations
diff --git a/c++/compilers/vs2013/make.bat b/c++/compilers/vs2013/make.bat
index 9a59b37..8ebc67e 100644
--- a/c++/compilers/vs2013/make.bat
+++ b/c++/compilers/vs2013/make.bat
@@ -1,5 +1,5 @@
 @ECHO OFF
-REM $Id: make.bat 485601 2015-11-24 13:12:30Z ivanov $
+REM $Id: make.bat 485599 2015-11-24 13:11:05Z ivanov $
 REM ===========================================================================
 REM
 REM                            PUBLIC DOMAIN NOTICE
diff --git a/c++/compilers/vs2013/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj b/c++/compilers/vs2013/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj
index 643f9e2..3c1645b 100644
--- a/c++/compilers/vs2013/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj
+++ b/c++/compilers/vs2013/static/build/build-system/project_tree_builder/msbuild/msbuild_dataobj.lib.vcxproj
@@ -135,11 +135,11 @@
     <CustomBuild Include="..\..\..\..\..\..\..\src\build-system\project_tree_builder\msbuild\msbuild_dataobj.xsd">
       <FileType>Document</FileType>
       <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%( [...]
+      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\vs2013&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Direct [...]
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
       <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
       <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Di [...]
+      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\..\vs2013&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Director [...]
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
       <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
     </CustomBuild>
diff --git a/c++/compilers/vs2013/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj b/c++/compilers/vs2013/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj
index 4bedd93..1fd920c 100644
--- a/c++/compilers/vs2013/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj
+++ b/c++/compilers/vs2013/static/build/build-system/project_tree_builder/project_tree_builder.exe.vcxproj
@@ -377,14 +377,14 @@
     <CustomBuild Include="..\..\..\..\..\..\src\build-system\project_tree_builder\msvc71_project.dtd">
 <FileType>Document</FileType>
 <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Directory)%(Fil [...]
+<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\vs2013&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Directory)%(Filename) [...]
 <AdditionalInputs
          Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
 <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
 
 <FileType>Document</FileType>
 <Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">Using datatool to create a C++ object from ASN/DTD/Schema %(FullPath)</Message>
-<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\msvc1000_prj&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Directory)%(Filen [...]
+<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">set DATATOOL_PATH=$(ProjectDir)..\..\..\..\static\bin\ReleaseDLL&#xa;set TREE_ROOT=$(ProjectDir)..\..\..\..\..\..&#xa;set PTB_PLATFORM=$(PlatformName)&#xa;set BUILD_TREE_ROOT=$(ProjectDir)..\..\..\..\..\vs2013&#xa;call "%BUILD_TREE_ROOT%\datatool.bat" -oex "" -pch ncbi_pch.hpp -m "%(FullPath)" -oA -oc "%(Filename)" -od "%(RootDir)%(Directory)%(Filename).d [...]
 <AdditionalInputs
          Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).def;</AdditionalInputs>
 <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">%(RootDir)%(Directory)%(Filename).files;%(RootDir)%(Directory)%(Filename)__.cpp;%(RootDir)%(Directory)%(Filename)___.cpp</Outputs>
diff --git a/c++/compilers/vs2013/third_party_install.meta.mk b/c++/compilers/vs2013/third_party_install.meta.mk
index 3752e7d..33d3d2c 100644
--- a/c++/compilers/vs2013/third_party_install.meta.mk
+++ b/c++/compilers/vs2013/third_party_install.meta.mk
@@ -1,4 +1,4 @@
-# $Id: third_party_install.meta.mk 468588 2015-05-26 17:46:51Z ucko $
+# $Id: third_party_install.meta.mk 489461 2016-01-13 14:40:24Z ucko $
 
 #################################################################
 #
@@ -88,9 +88,13 @@ SQLITE3_SRC = $(SQLITE3_BINPATH)\$(INTDIR)
 SQLITE3_SRC = $(SQLITE3_BINPATH)\$(ALTDIR)
 !ENDIF
 
-SYBASE_SRC = $(SYBASE_BINPATH)\$(INTDIR)
+# SYBASE_SRC = $(SYBASE_BINPATH)\$(INTDIR)
+# !IF !EXIST($(SYBASE_SRC))
+# SYBASE_SRC = $(SYBASE_BINPATH)\$(ALTDIR)
+# !ENDIF
+SYBASE_SRC = $(SYBASE_BINPATH)\$(INTDIR:Debug=Release)
 !IF !EXIST($(SYBASE_SRC))
-SYBASE_SRC = $(SYBASE_BINPATH)\$(ALTDIR)
+SYBASE_SRC = $(SYBASE_BINPATH)\$(ALTDIR:Debug=Release)
 !ENDIF
 
 WXWIDGETS_SRC = $(WXWIDGETS_BINPATH)\$(INTDIR)
diff --git a/c++/compilers/xCode/Application.applescript b/c++/compilers/xCode/Application.applescript
deleted file mode 100644
index 8416e4c..0000000
--- a/c++/compilers/xCode/Application.applescript
+++ /dev/null
@@ -1,748 +0,0 @@
-(*  $Id: Application.applescript 449199 2014-10-14 16:10:59Z serovav $
- * ===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Author:  Vlad Lebedev
- *
- * File Description:
- * Main Application Script
- *
- *)
-
-
-(* ==== Globals ==== *)
-global AllLibraries
-global AllConsoleTools
-global AllApplications
-global ToolkitSource
-global ProjBuilderLib
-
-global TheNCBIPath, TheFLTKPath, TheBDBPath, ThePCREPath, TheOUTPath
-global libTypeDLL, guiLibs, zeroLink, fixContinue, xcodeTarget, projFile
-
-
-(* ==== 3rd party libarary properties ==== *)
-global libScriptTmpDir
-global libScriptPID
-property libScriptWasRun : false
-property libScriptRunning : false
-
-
-(* ==== Properties ==== *)
-property allPaths : {"pathNCBI", "pathFLTK", "pathBDB", "pathPCRE", "pathOUT"}
-property libDataSource : null
-property toolDataSource : null
-property appDataSource : null
-property curDataSource : null
-
-(* Loading of library scripts *)
-on launched theObject
-	my loadScripts()
-	tell ToolkitSource to Initialize()
-	
-	-- Load User Defaults	
-	repeat with p in allPaths
-		try
-			set tmp to contents of default entry (p as string) of user defaults
-			set contents of text field (p as string) of tab view item "tab1" of tab view "theTab" of window "Main" to tmp
-		on error
-			set homePath to the POSIX path of (path to home folder) as string
-			
-			if (p as string) is equal to "pathNCBI" then set contents of text field (p as string) of tab view item "tab1" of tab view "theTab" of window "Main" to homePath & "c++"
-			if (p as string) is equal to "pathOUT" then set contents of text field (p as string) of tab view item "tab1" of tab view "theTab" of window "Main" to homePath & "out"
-		end try
-		
-	end repeat
-	
-	load nib "InstallLibsPanel"
-	show window "Main"
-end launched
-
-
-on pathToScripts()
-	set appPath to (path to me from user domain) as text
-	return (appPath & "Contents:Resources:Scripts:") as text
-end pathToScripts
-
-on loadScript(scriptName)
-	return load script file (my pathToScripts() & scriptName & ".scpt")
-end loadScript
-
-on loadScripts()
-	set tootkitLib to my loadScript("Libraries")
-	set projLib to my loadScript("ProjBuilder")
-	
-	set ToolkitSource to ToolkitSource of tootkitLib
-	set ProjBuilderLib to ProjBuilder of projLib
-end loadScripts
-
-(* Additional Application Setup *)
-(* Quit Application after main window is closed *)
-on should quit after last window closed theObject
-	return true
-end should quit after last window closed
-
-
-
-(* When the NIB (resourses are loaded *)
-on awake from nib theObject
-	if name of theObject is "Main" then
-		tell theObject
-			-- Set the drawer up with some initial values.
-			set leading offset of drawer "Drawer" to 20
-			set trailing offset of drawer "Drawer" to 20
-		end tell
-	end if
-end awake from nib
-
-
-(* Actual work starts here *)
-on clicked theObject
-	if name of theObject is "theLibsTable" then
-		set curDataSource to libDataSource
-		x_SaveTableData(libDataSource, AllLibraries)
-	else if name of theObject is "theToolsTable" then
-		set curDataSource to toolDataSource
-		x_SaveTableData(toolDataSource, AllConsoleTools)
-	else if name of theObject is "theAppsTable" then
-		set curDataSource to appDataSource
-		x_SaveTableData(appDataSource, AllApplications)
-	end if
-	
-	if name of theObject is "selectAll" then
-		x_SelectAll(true)
-	else if name of theObject is "deselectAll" then
-		x_SelectAll(false)
-	end if
-	
-	if name of theObject is "otherLibs" then -- install 3rd party libs
-		-- first, be sure the C++ Toolkit path is set correctly
-		set TheNCBIPath to contents of text field "pathNCBI" of tab view item "tab1" of tab view "theTab" of window "Main"
-		if x_NoSuchPath(TheNCBIPath & "/include/ncbiconf.h") then
-			x_ShowAlert("NCBI C++ Toolkit was not found at " & TheNCBIPath)
-			return
-		end if
-		
-		set homePath to the POSIX path of (path to home folder) as string
-		set contents of text field "tmp_dir" of window "install_libs" to homePath & "tmp"
-		set contents of text field "ins_dir" of window "install_libs" to homePath & "sw"
-		display panel window "install_libs" attached to window "Main"
-	end if
-	
-	if name of theObject is "close" then
-		if libScriptWasRun then
-			set new_insdir to contents of text field "ins_dir" of window "install_libs"
-			set contents of text field "pathFLTK" of tab view item "tab1" of tab view "theTab" of window "Main" to new_insdir
-			set contents of text field "pathBDB" of tab view item "tab1" of tab view "theTab" of window "Main" to new_insdir
-			set contents of text field "pathPCRE" of tab view item "tab1" of tab view "theTab" of window "Main" to new_insdir
-		end if
-		close panel window "install_libs"
-	end if
-	
-	if name of theObject is "guiOpt" then
-		set checked to content of theObject
-		repeat with library in AllLibraries
-			if gui of library is true then set req of library to checked
-		end repeat
-		repeat with tool in AllConsoleTools
-			if gui of tool is true and checked is false then set req of tool to false -- uncheck only
-		end repeat
-		repeat with the_app in AllApplications
-			if gui of the_app is true and checked is false then set req of the_app to false -- uncheck only
-		end repeat
-		
-		--if libDataSource is not null then set update views of libDataSource to true
-		--x_SaveTableData(libDataSource, AllLibraries)
-		--x_SaveTableData(toolDataSource, AllConsoleTools)
-		--x_SaveTableData(appDataSource, AllApplications)
-		my x_ReloadTable(libDataSource, AllLibraries)
-		my x_ReloadTable(toolDataSource, AllConsoleTools)
-		my x_ReloadTable(appDataSource, AllApplications)
-	end if
-	
-	
-	if name of theObject is "do_it" then
-		if libScriptRunning then -- cancel
-			set enabled of button "do_it" of window "install_libs" to false -- prevent double kill
-			do shell script "kill " & libScriptPID
-		else
-			x_Install3rdPartyLibs() -- launch new script in the background
-		end if
-	end if
-	
-	tell window "Main"
-		(* Handle Generate button *)
-		if theObject is equal to button "generate" then
-			my x_AddtoLog("Log started: " & (current date) as text)
-			
-			set msg to my ValidatePaths() -- Validate paths and set globals
-			if msg is "" then
-				tell progress indicator "progressBar" to start
-				set maximum value of progress indicator "progressBar" to (my x_GetTargetCount()) + 1
-				
-				try
-					tell ProjBuilderLib to Initialize()
-					my CreateProject() -- do the job
-				on error errMsg
-					log errMsg
-					display dialog "Generation failed with the following message: " & return & return & errMsg buttons {"OK"} default button 1
-				end try
-				
-				tell progress indicator "progressBar" to stop
-			else
-				my x_ShowAlert(msg)
-			end if
-		end if
-		
-		(* Help button pressed *)
-		if theObject is equal to button "helpButton" then
-			open location "http://www.ncbi.nlm.nih.gov/toolkit/doc/book/"
-		end if
-		
-		(* Handle Paths *)
-		tell tab view item "tab1" of tab view "theTab"
-			if theObject is equal to button "ChooseNCBI" then
-				my ChooseFolder("Select NCBI C++ Toolkit location", "pathNCBI")
-			end if
-			
-			if theObject is equal to button "ChooseBDB" then
-				my ChooseFolder("Select Berkley DB installation", "pathBDB")
-			end if
-			
-			
-			if theObject is equal to button "ChooseFLTK" then
-				my ChooseFolder("Select FLTK installation", "pathFLTK")
-			end if
-			
-			if theObject is equal to button "ChoosePCRE" then
-				my ChooseFolder("Select PCRE and Image libraries (GIF, TIFF & PNG) installation", "pathPCRE")
-			end if
-			
-			if theObject is equal to button "ChooseOUT" then
-				my ChooseFolder("Select where the project file will be created", "pathOUT")
-			end if
-			
-		end tell
-	end tell
-end clicked
-
-
-(* Called right before application will quit *)
-on will quit theObject
-	try
-		-- Save User Defaults	
-		repeat with p in allPaths
-			set thePath to the contents of text field (p as string) of tab view item "tab1" of tab view "theTab" of window "Main"
-			make new default entry at end of default entries of user defaults with properties {name:p, contents:thePath}
-			set contents of default entry (p as string) of user defaults to thePath
-		end repeat
-	end try
-end will quit
-
-
-
-on selected tab view item theObject tab view item tabViewItem
-	if name of tabViewItem is "tab2" then
-		set libTable to table view "theLibsTable" of scroll view "theLibsTable" of split view "theSplitter" of tab view item "tab2" of theObject
-		set toolTable to table view "theToolsTable" of scroll view "theToolsTable" of split view "theSplitter" of tab view item "tab2" of theObject
-		set appTable to table view "theAppsTable" of scroll view "theAppsTable" of split view "theSplitter" of tab view item "tab2" of theObject
-		
-		-- Here we will add the data columns to the data source of the contacts table view
-		if libDataSource is null then
-			set libDataSource to make new data source at the end of the data sources with properties {name:"libs"}
-			make new data column at the end of data columns of libDataSource with properties {name:"use"}
-			make new data column at the end of data columns of libDataSource with properties {name:"name"}
-			set data source of libTable to libDataSource
-			my x_ReloadTable(libDataSource, AllLibraries)
-		end if
-		
-		if toolDataSource is null then
-			set toolDataSource to make new data source at the end of the data sources with properties {name:"tools"}
-			make new data column at the end of data columns of toolDataSource with properties {name:"use"}
-			make new data column at the end of data columns of toolDataSource with properties {name:"name"}
-			make new data column at the end of data columns of toolDataSource with properties {name:"path"}
-			set data source of toolTable to toolDataSource
-			my x_ReloadTable(toolDataSource, AllConsoleTools)
-		end if
-		
-		if appDataSource is null then
-			set appDataSource to make new data source at the end of the data sources with properties {name:"apps"}
-			make new data column at the end of data columns of appDataSource with properties {name:"use"}
-			make new data column at the end of data columns of appDataSource with properties {name:"name"}
-			make new data column at the end of data columns of appDataSource with properties {name:"path"}
-			set data source of appTable to appDataSource
-			my x_ReloadTable(appDataSource, AllApplications)
-		end if
-	end if
-end selected tab view item
-
-
-on idle theObject
-	if libScriptRunning then
-		log "Checking status..."
-		try
-			set msg to do shell script "tail " & libScriptTmpDir & "/log.txt"
-			set thetext to "Last few lines of " & libScriptTmpDir & "/log.txt:" & return & msg
-			set contents of text view "status" of scroll view "status" of window "install_libs" to thetext
-			set stat to do shell script "ps -p " & libScriptPID & " | grep " & libScriptPID
-		on error
-			tell progress indicator "progress" of window "install_libs" to stop
-			set libScriptRunning to false
-			set enabled of button "close" of window "install_libs" to true
-			set title of button "do_it" of window "install_libs" to "Install third-party libraries"
-			set enabled of button "do_it" of window "install_libs" to true
-		end try
-	end if
-	return 3
-end idle
-
-on cell value theObject row theRow table column tableColumn
-	(*Add your script here.*)
-end cell value
-
-on number of rows theObject
-	(*Add your script here.*)
-end number of rows
-
-
-(** calculate the total number of targets **)
-on x_GetTargetCount()
-	set total to 0
-	repeat with library in AllLibraries
-		if req of library is true then set total to total + 1
-		--repeat with lib in libs of library
-		--set total to total + 1
-		--end repeat
-	end repeat
-	
-	repeat with tool in AllConsoleTools
-		if req of tool is true then set total to total + 1
-	end repeat
-	
-	repeat with theApp in AllApplications
-		if req of theApp is true then set total to total + 1
-	end repeat
-	
-	return total
-end x_GetTargetCount
-
-
-(* Launch shell script to install third party libraries *)
-on x_Install3rdPartyLibs()
-	set libScriptTmpDir to contents of text field "tmp_dir" of window "install_libs"
-	if x_NoSuchPath(libScriptTmpDir) then
-		display dialog "Temporary directory was not found at:" & return & libScriptTmpDir buttons {"OK"} default button 1 with icon caution
-		return
-	end if
-	
-	set libScriptRunning to true
-	set libScriptWasRun to true
-	tell progress indicator "progress" of window "install_libs" to start
-	try
-		set libScriptPID to "0"
-		set toolkit_dir to contents of text field "pathNCBI" of tab view item "tab1" of tab view "theTab" of window "Main"
-		set libScriptTmpDir to contents of text field "tmp_dir" of window "install_libs"
-		set ins_dir to contents of text field "ins_dir" of window "install_libs"
-		set theScript to toolkit_dir & "/compilers/xCode/thirdpartylibs.sh"
-		
-		set theScript to theScript & " " & toolkit_dir -- first argument
-		set theScript to theScript & " " & libScriptTmpDir -- second argument
-		set theScript to theScript & " " & ins_dir -- third argument
-		if content of button "download_it" of window "install_libs" then
-			set theScript to theScript & " download" -- optional download flag
-		end if
-		set theScript to theScript & " > " & libScriptTmpDir & "/log.txt 2>&1 & echo $!" -- to log file
-		
-		set title of button "do_it" of window "install_libs" to "Cancel"
-		set enabled of button "close" of window "install_libs" to false
-		log theScript
-		set libScriptPID to do shell script theScript -- start background process
-		log "Launched PID: " & libScriptPID
-	end try
-end x_Install3rdPartyLibs
-
-
-(* Select a directory with given title *)
-on ChooseFolder(theTitle, textField)
-	tell open panel
-		set title to theTitle
-		set prompt to "Choose"
-		set treat packages as directories to true
-		set can choose directories to true
-		set can choose files to false
-		set allows multiple selection to false
-	end tell
-	
-	set theResult to display open panel in directory "~" with file name ""
-	if theResult is 1 then
-		set pathNames to (path names of open panel as list)
-		set thePath to the first item of pathNames
-		log thePath
-		set contents of text field textField of tab view item "tab1" of tab view "theTab" of window "Main" to thePath
-	end if
-	
-end ChooseFolder
-
-
-on x_ReloadTable(theDS, thePack)
-	if theDS is null then return
-	
-	set update views of theDS to false
-	delete every data row in theDS
-	
-	repeat with p in thePack
-		set theDataRow to make new data row at the end of the data rows of theDS
-		set contents of data cell "use" of theDataRow to req of p
-		set contents of data cell "name" of theDataRow to name of p
-		if theDS is not equal to libDataSource then set contents of data cell "path" of theDataRow to path of p
-	end repeat
-	
-	set update views of theDS to true
-end x_ReloadTable
-
-
-(* Append to log entry *)
-on x_AddtoLog(txt)
-	tell window "Main"
-		set tmp to contents of text view "logView" of scroll view "scrollView" of drawer "Drawer"
-		set contents of text view "logView" of scroll view "scrollView" of drawer "Drawer" to txt & return & tmp
-	end tell
-	log txt
-end x_AddtoLog
-
-
-(* Actual work happends here *)
-on CreateProject()
-	repeat with library in AllLibraries -- ncbi_core : {name:"ncbi_core", libs:{xncbi, xcompress, tables, sequtil, creaders, xutil, xregexp, xconnect, xser}}
-		if req of library is true then -- selected to be build
-			set src_files to {}
-			set hdr_files to {}
-			repeat with lib in libs of library
-				set src_files to src_files & my GetSourceFiles(lib)
-				set hdr_files to hdr_files & my GetHeaderFiles(lib)
-				x_AddtoLog("Processing: " & name of lib)
-			end repeat
-			
-			x_IncrementProgressBar()
-			--if name of library = "ncbi_core" then --then --or name of lib = "xser" or name of lib = "xutil" or name of lib = "access" then
-			tell ProjBuilderLib to MakeNewLibraryTarget(library, src_files, hdr_files)
-			--end if
-		end if -- req is true
-	end repeat
-	
-	--repeat with toolBundle in AllConsoleTools
-	repeat with tool in AllConsoleTools --toolBundle
-		if req of tool is true then -- selected to be build
-			set src_files to my GetSourceFiles(tool)
-			set hdr_files to hdr_files & my GetHeaderFiles(lib)
-			x_AddtoLog("Processing: " & name of tool)
-			x_IncrementProgressBar()
-			tell ProjBuilderLib to MakeNewToolTarget(tool, src_files, hdr_files)
-		end if
-	end repeat
-	--end repeat
-	
-	--repeat with appBundle in AllApplications
-	repeat with theApp in AllApplications --appBundle
-		if req of theApp is true then -- selected to be build
-			set src_files to my GetSourceFiles(theApp)
-			set hdr_files to my GetHeaderFiles(lib)
-			x_AddtoLog("Processing: " & name of theApp)
-			x_IncrementProgressBar()
-			tell ProjBuilderLib to MakeNewAppTarget(theApp, src_files, hdr_files)
-		end if
-	end repeat
-	--end repeat
-	
-	x_AddtoLog("Saving project file")
-	tell ProjBuilderLib to SaveProjectFile()
-	
-	x_IncrementProgressBar()
-	x_AddtoLog("Opening generated project: " & TheOUTPath & "/" & projFile)
-	do shell script "open " & TheOUTPath & "/" & projFile -- Open Project
-	x_AddtoLog("Done")
-	
-	tell application "Xcode"
-		set ver to version
-	end tell
-	if ver � "1.5" then
-		if content of button "buildProj" of window "Main" is true then -- build the new project
-			x_AddtoLog("Building")
-			tell application "Xcode"
-				activate
-				tell application "System Events" -- it's a little hack, but it's work
-					keystroke "b" using command down
-				end tell
-			end tell
-			--tell application "Xcode" to build project "NCBI" -- not yet implemented in xCode 1.2
-		end if
-	else
-		my x_ShowAlert("xCode version 1.5 or greater is required. Please visit  www.apple.com/developer  to download the latest version.")
-	end if
-	
-end CreateProject
-
-
-on x_IncrementProgressBar()
-	tell window "Main"
-		tell progress indicator "progressBar" to increment by 1
-	end tell
-end x_IncrementProgressBar
-
-
-
-(* Retriece a list of source files based on library info *)
-on GetSourceFiles(lib)
-	set fullSourcePath to TheNCBIPath & "/src/"
-	set incfileList to {}
-	set excfileList to {}
-	set src_files to {}
-	
-	try -- Try to get main path
-		set fullSourcePath to fullSourcePath & x_Replace((path of lib), ":", "/") & "/"
-	end try
-	
-	try -- Try to get the included file list
-		set incfileList to inc of lib
-		repeat with F in incfileList
-			set src_files to src_files & (fullSourcePath & F)
-		end repeat
-		return src_files -- done
-	end try
-	
-	
-	try -- Try to get the excluded file list
-		set excfileList to exc of lib
-	end try
-	
-	-- Get everything in this path
-	set src_files to x_GetFolderContent(fullSourcePath, excfileList)
-	
-	if name of lib is "xncbi" then copy TheOUTPath & "/cfg/ncbicfg.c" to the end of src_files
-	return src_files
-end GetSourceFiles
-
-
-(* Retriece a list of header files based on library info *)
-on GetHeaderFiles(lib)
-	set fullHeaderPath1 to TheNCBIPath & "/include/"
-	set fullHeaderPath2 to TheNCBIPath & "/src/"
-	set endsList to {".h", ".hpp"}
-	set hdr_files to {}
-	
-	try -- Try to get main path
-		set fullHeaderPath1 to fullHeaderPath1 & x_Replace((path of lib), ":", "/") & "/"
-		set fullHeaderPath2 to fullHeaderPath2 & x_Replace((path of lib), ":", "/") & "/"
-	end try
-	
-	try -- get headers from the include folder
-		set fileList to list folder (fullHeaderPath1 as POSIX file) without invisibles
-		set fileList to EndsWith(fileList, endsList, "_.hpp")
-		repeat with F in fileList
-			copy fullHeaderPath1 & F to the end of hdr_files
-		end repeat
-	end try
-	
-	try -- get headers from the src folder
-		set fileList to list folder (fullHeaderPath2 as POSIX file) without invisibles
-		set fileList to EndsWith(fileList, endsList, "_.hpp")
-		repeat with F in fileList
-			copy fullHeaderPath2 & F to the end of hdr_files
-		end repeat
-	end try
-	
-	return hdr_files
-end GetHeaderFiles
-
-
-(* Returns a content of a foder, with *.c *.c.in and *.cpp files, excluding "excfileList"  and full path *)
-on x_GetFolderContent(folderName, excfileList)
-	set fileList to list folder (folderName as POSIX file) without invisibles
-	set fileList to my ExcludeFiles(fileList, excfileList)
-	set endsList to {".c", ".cpp", ".c.in"}
-	
-	set fileList to EndsWith(fileList, endsList, "_.cpp")
-	
-	set filesWithPath to {}
-	repeat with F in fileList
-		copy folderName & F to the end of filesWithPath
-	end repeat
-	return filesWithPath
-end x_GetFolderContent
-
-(* Returns a new list with items "allFiles" excluding "excFiles" *)
-on ExcludeFiles(allFiles, excFiles)
-	set newList to {}
-	repeat with F in allFiles
-		if excFiles does not contain F then
-			copy F to the end of newList
-		end if
-	end repeat
-	return newList
-end ExcludeFiles
-
-
-(*  Replace all occurances of "old" in the aString with "new" *)
-on x_Replace(aString, old, new)
-	set OldDelims to AppleScript's text item delimiters
-	set AppleScript's text item delimiters to old
-	set newText to text items of aString
-	set AppleScript's text item delimiters to new
-	set finalText to newText as text
-	set AppleScript's text item delimiters to OldDelims
-	
-	return finalText
-end x_Replace
-
-
-(* Return a subset of "aList" with items ending with "suffix" *)
-on EndsWith(aList, suffixList, exclude)
-	set newList to {}
-	repeat with F in aList
-		repeat with S in suffixList
-			if (F ends with S) and (F does not end with exclude) then
-				copy (F as string) to end of newList
-			end if
-		end repeat
-	end repeat
-	return newList
-end EndsWith
-
-
-(* Performs a validation of paths and names before generating a project *)
-on ValidatePaths()
-	tell tab view item "tab1" of tab view "theTab" of window "Main"
-		set TheNCBIPath to contents of text field "pathNCBI"
-		set TheFLTKPath to contents of text field "pathFLTK"
-		set TheBDBPath to contents of text field "pathBDB"
-		set ThePCREPath to contents of text field "pathPCRE"
-		set TheOUTPath to contents of text field "pathOUT"
-	end tell
-	
-	set ncbiPath to x_Replace(TheNCBIPath, "/", ":")
-	
-	if TheNCBIPath is "" or TheFLTKPath is "" or TheBDBPath is "" or ThePCREPath is "" or TheOUTPath is "" then
-		return "Path(s) could not be empty"
-	end if
-	
-	-- check paths"
-	if x_NoSuchPath(TheNCBIPath & "/include/ncbiconf.h") then
-		return "NCBI C++ Toolkit was not found at " & TheNCBIPath
-	end if
-	
-	if x_NoSuchPath(ThePCREPath & "/include/tiff.h") then
-		return "Lib TIFF installation was not found at " & ThePCREPath
-	end if
-	
-	--if x_NoSuchPath(ThePCREPath & "/include/jpeglib.h") then
-	--	return "Lib JPEG installation was not found at " & ThePCREPath
-	--end if
-	
-	if x_NoSuchPath(ThePCREPath & "/include/png.h") then
-		return "Lib PNG installation was not found at " & ThePCREPath
-	end if
-	
-	if x_NoSuchPath(ThePCREPath & "/include/gif_lib.h") then
-		--return "Lib GIF installation was not found at " & ThePCREPath
-	end if
-	
-	if x_NoSuchPath(TheBDBPath & "/include/db.h") then
-		return "Berkeley DB installation was not found at " & TheBDBPath
-	end if
-	
-	if x_NoSuchPath(TheFLTKPath & "/include/FL/Fl.H") then
-		return "FLTK installation was not found at " & TheFLTKPath
-	end if
-	
-	if x_NoSuchPath(TheOUTPath) then
-		do shell script "mkdir " & TheOUTPath
-		x_AddtoLog("The Output folder was created at: " & TheOUTPath)
-		--return "The Output folder was not found at: " & TheOUTPath
-	end if
-	
-	-- create (or re-create) the cfg directory
-	if x_NoSuchPath(TheOUTPath & "/cfg") then
-		do shell script "mkdir " & TheOUTPath & "/cfg"
-		set lib_dir to TheOUTPath & "/lib"
-		set lib_dir to x_Replace(lib_dir, "/", "\\/")
-		set ncbicfg to "sed 's/@ncbi_runpath@/" & lib_dir & "/' <" & TheNCBIPath & "/src/corelib/ncbicfg.c.in >" & TheOUTPath & "/cfg/ncbicfg.c"
-		
-		do shell script ncbicfg
-	end if
-	
-	set libTypeDLL to true --content of button "libType" of window "Main" -- DLL or Static
-	set guiLibs to content of button "guiOpt" of window "Main" -- CPU specific optimization
-	set zeroLink to false --content of button "zeroLink" of window "Main" -- Use Zero Link
-	set fixContinue to content of button "fixCont" of window "Main" -- Use Fix & Continue
-	set xcodeTarget to current row of matrix "xcodeTar" of window "Main" -- Debug / Release
-	
-	
-	set projFile to "NCBI.xcodeproj"
-	
-	return "" -- no errors found
-end ValidatePaths
-
-
-(* Checks if path/file exists *)
-on x_NoSuchPath(thePath)
-	set posix_path to thePath as POSIX file
-	try
-		info for posix_path
-		return false
-	on error
-		return true
-	end try
-end x_NoSuchPath
-
-
-(* Display a message box *)
-on x_ShowAlert(msg)
-	log msg
-	display dialog msg buttons {"OK"} default button 1 attached to window "Main" with icon caution
-end x_ShowAlert
-
-
-on x_SelectAll(theBool)
-	if curDataSource is not null then
-		repeat with d in data rows of curDataSource
-			set contents of data cell "use" of d to theBool
-		end repeat
-		
-		x_SaveTableData(libDataSource, AllLibraries)
-		x_SaveTableData(toolDataSource, AllConsoleTools)
-		x_SaveTableData(appDataSource, AllApplications)
-	end if
-end x_SelectAll
-
-
-on x_SaveTableData(theDS, thePack)
-	if theDS is null then return
-	set c to 1
-	repeat with p in thePack
-		set theDataRow to item c of the data rows of theDS
-		set req of p to contents of data cell "use" of theDataRow
-		
-		set c to c + 1
-	end repeat
-end x_SaveTableData
diff --git a/c++/compilers/xCode/English.lproj/InfoPlist.strings b/c++/compilers/xCode/English.lproj/InfoPlist.strings
deleted file mode 100644
index 827edd4..0000000
Binary files a/c++/compilers/xCode/English.lproj/InfoPlist.strings and /dev/null differ
diff --git a/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/classes.nib b/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/classes.nib
deleted file mode 100644
index b9b4b09..0000000
--- a/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/classes.nib
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-    IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }); 
-    IBVersion = 1; 
-}
\ No newline at end of file
diff --git a/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/data.dependency b/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/data.dependency
deleted file mode 100644
index 82ceab4..0000000
--- a/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/data.dependency
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IBPaletteDependency</key>
-	<array>
-		<string>ASKPalette</string>
-	</array>
-</dict>
-</plist>
diff --git a/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/info.nib b/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/info.nib
deleted file mode 100644
index 3ba3109..0000000
--- a/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/info.nib
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IBDocumentLocation</key>
-	<string>56 169 356 240 0 0 1600 1002 </string>
-	<key>IBFramework Version</key>
-	<string>364.0</string>
-	<key>IBOpenObjects</key>
-	<array>
-		<integer>5</integer>
-	</array>
-	<key>IBSystem Version</key>
-	<string>7U16</string>
-</dict>
-</plist>
diff --git a/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/keyedobjects.nib b/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/keyedobjects.nib
deleted file mode 100644
index b1e8b72..0000000
Binary files a/c++/compilers/xCode/English.lproj/InstallLibsPanel.nib/keyedobjects.nib and /dev/null differ
diff --git a/c++/compilers/xCode/English.lproj/MainMenu.nib/classes.nib b/c++/compilers/xCode/English.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index cbaf739..0000000
--- a/c++/compilers/xCode/English.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IBClasses</key>
-	<array>
-		<dict>
-			<key>CLASS</key>
-			<string>FirstResponder</string>
-			<key>LANGUAGE</key>
-			<string>ObjC</string>
-			<key>SUPERCLASS</key>
-			<string>NSObject</string>
-		</dict>
-	</array>
-	<key>IBVersion</key>
-	<string>1</string>
-</dict>
-</plist>
diff --git a/c++/compilers/xCode/English.lproj/MainMenu.nib/info.nib b/c++/compilers/xCode/English.lproj/MainMenu.nib/info.nib
deleted file mode 100644
index e97db4b..0000000
--- a/c++/compilers/xCode/English.lproj/MainMenu.nib/info.nib
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IBFramework Version</key>
-	<string>677</string>
-	<key>IBLastKnownRelativeProjectPath</key>
-	<string>../xCode.xcodeproj</string>
-	<key>IBOldestOS</key>
-	<integer>3</integer>
-	<key>IBOpenObjects</key>
-	<array>
-		<integer>2</integer>
-		<integer>29</integer>
-	</array>
-	<key>IBSystem Version</key>
-	<string>9L31a</string>
-	<key>targetFramework</key>
-	<string>IBCocoaFramework</string>
-</dict>
-</plist>
diff --git a/c++/compilers/xCode/English.lproj/MainMenu.nib/keyedobjects.nib b/c++/compilers/xCode/English.lproj/MainMenu.nib/keyedobjects.nib
deleted file mode 100644
index 18c92a9..0000000
Binary files a/c++/compilers/xCode/English.lproj/MainMenu.nib/keyedobjects.nib and /dev/null differ
diff --git a/c++/compilers/xCode/English.lproj/locversion.plist b/c++/compilers/xCode/English.lproj/locversion.plist
deleted file mode 100644
index 7457564..0000000
--- a/c++/compilers/xCode/English.lproj/locversion.plist
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>LprojCompatibleVersion</key>
-	<string>10</string>
-	<key>LprojLocale</key>
-	<string>en</string>
-	<key>LprojRevisionLevel</key>
-	<string>1</string>
-	<key>LprojVersion</key>
-	<string>10</string>
-</dict>
-</plist>
diff --git a/c++/compilers/xCode/Info-Xcode.plist b/c++/compilers/xCode/Info-Xcode.plist
deleted file mode 100644
index 6d5095b..0000000
--- a/c++/compilers/xCode/Info-Xcode.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
-	<key>CFBundleExecutable</key>
-	<string>NCBI Xcode Project Builder</string>
-	<key>CFBundleIconFile</key>
-	<string>cpp</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>2.0</string>
-	<key>NSAppleScriptEnabled</key>
-	<string>YES</string>
-	<key>NSMainNibFile</key>
-	<string>MainMenu</string>
-	<key>NSPrincipalClass</key>
-	<string>NSApplication</string>
-</dict>
-</plist>
diff --git a/c++/compilers/xCode/Libraries.applescript b/c++/compilers/xCode/Libraries.applescript
deleted file mode 100644
index f0df229..0000000
--- a/c++/compilers/xCode/Libraries.applescript
+++ /dev/null
@@ -1,442 +0,0 @@
-(*  $Id: Libraries.applescript 173049 2009-10-14 14:51:10Z kans $
- * ===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Author:  Vlad Lebedev
- *
- * File Description:
- * C++ Toolkit Libraries info Script
- *
- *)
-
-
-global AllLibraries -- All libbaries to build
-global AllTests -- All tests to build
-global AllConsoleTools -- All console tools (tests and demos) to build
-global AllApplications -- All GUI applications to build
-
-(* Libraries for linking (note the extra space before the lib name! )*)
-property Z_LIBS : "z"
-property IMG_LIBS : " png jpeg tiff z"
-property BDB_LIBS : " db"
-property FI_LIBS : " png jpeg tiff z fltk_images fltk_gl fltk"
-
-(*
-Library definition rules:
-name: Name of the library to build
-path: source path relative to the source root (users:lebedev:c++:src:)
-inc: include only listed files
-exc: include all but listed files
-bundle: compile as a loadable mach-o bundle (like GBench plugin)
-dep: a list of dependancies
-fworks: a list of Frameworks to link
-asn1: true if source is generated from ASN1 files. Will add a shell script build phase and a datatool dependency
-asn1Name: an ASN file name, if different from directory name
-req: true  if required for a default build
-*)
-
-
-
-(* Libraries definitions *)
--- Core
-property xncbi : {name:"xncbi", path:"corelib", exc:{"test_boost.cpp", "test_mt.cpp", "ncbi_os_mswin.cpp", "ncbicfg.c.in", "ncbi_stack_default.cpp", "ncbi_stack_linux.cpp", "ncbi_stack_solaris.cpp", "ncbi_stack_win32.cpp", "ncbiatomic_workshop.c"}}
-property xcgi : {name:"xcgi", path:"cgi", exc:{"fcgi_run.cpp", "fcgibuf.cpp"}}
-property dbapi : {name:"dbapi", path:"dbapi"}
-property dbapi_cache : {name:"dbapi_cache", path:"dbapi:cache"}
-property dbapi_driver : {name:"dbapi_driver", path:"dbapi:driver"}
-property xhtml : {name:"xhtml", path:"html", exc:{"nodemap.cpp"}}
-property xconnect : {name:"xconnect", path:"connect", exc:{"ncbi_lbsm_ipc.c", "ncbi_lbsm.c", "ncbi_lbsmd.c"}}
---property cserial : {name:"cserial", path:"serial", inc:{"asntypes.cpp", "serialasn.cpp"}}
-property xser : {name:"xser", path:"serial", exc:{"asntypes.cpp", "object.cpp", "objstrb.cpp", "rtti.cpp", "serialasn.cpp"}}
-property xutil : {name:"xutil", path:"util"}
-property bdb : {name:"bdb", path:"db:bdb", exc:{"bdb_query_bison.tab.c", "bdb_query_lexer.cpp", "bdb_blobcache.cpp", "bdb_result_store.cpp"}}
-property xcache_bdb : {name:"xcache_bdb", path:"db:bdb", inc:{"bdb_blobcache.cpp"}}
-property xcache_netcache : {name:"xcache_netcache", path:"connect:services"}
-property regexp : {name:"regexp", path:"util:regexp", exc:{"dftables.c", "pcredemo.c", "pcregrep.c", "pcretest.c"}}
-property xregexp : {name:"xregexp", path:"util:xregexp"}
-property xqueryparse : {name:"xqueryparse", path:"util:qparse", exc:{"query_parser_bison.tab.c"}}
-property ximage : {name:"ximage", path:"util:image"}
-property xcompress : {name:"xcompress", path:"util:compress"}
-property xbz2 : {name:"xbz2", path:"util:compress:bzip2", inc:{"blocksort.c", "compress.c", "huffman.c", "decompress.c", "crctable.c", "randtable.c", "bzlib.c"}}
-property tables : {name:"tables", path:"util:tables", inc:{"raw_scoremat.c"}}
-property sequtil : {name:"sequtil", path:"util:sequtil"}
-property creaders : {name:"creaders", path:"util:creaders"}
--- Algo
-property xalgoalign : {name:"xalgoalign", path:"algo:align"}
-property xalgosplign : {name:"xalgosplign", path:"algo:align:splign"}
-property xalgoprosplign : {name:"xalgosplign", path:"algo:align:prosplign", inc:{"prosplign.cpp", "scoring.cpp", "PSeq.cpp", "NSeq.cpp", "Ali.cpp", "AliSeqAlign.cpp", "Info.cpp", "nucprot.cpp", "intron.cpp", "AlignInfo.cpp", "compartments.cpp"}}
-property xalgocontig_assembly : {name:"xalgocontig_assembly", path:"algo:align:contig_assembly"}
-property xalgoalignnw : {name:"xalgoalignnw", path:"algo:align:nw"}
-property xalgoaligutil : {name:"xalgoaligutil", path:"algo:align:util"}
-property xalgoseq : {name:"xalgoseq", path:"algo:sequence"}
-property xalgoseqqa : {name:"xalgoseqqa", path:"algo:seqqa"}
-property blast : {name:"blast", path:"algo:blast:core"}
-property blast_composition : {name:"blast_composition", path:"algo:blast:composition_adjustment"}
-property xblast : {name:"xblast", path:"algo:blast:api"}
-property xblast_dbindex : {name:"xblast_dbindex", path:"algo:blast:dbindex"}
-property xalgognomon : {name:"xalgognomon", path:"algo:gnomon", inc:{"gnomon__.cpp", "gnomon___.cpp", "gnomon_engine.cpp", "gnomon_objmgr.cpp", "score.cpp", "gnomon_model.cpp", "parse.cpp", "hmm.cpp", "gnomon_seq.cpp", "id_handler.cpp", "asn1.cpp"}, asn1:true}
-property xalgowinmask : {name:"xalgowinmask", path:"algo:winmask"}
-property xalgodustmask : {name:"xalgodustmask", path:"algo:dustmask"}
-property xalgophytree : {name:"xalgophytree", path:"algo:phy_tree"}
-property fastme : {name:"fastme", path:"algo:phy_tree:fastme"}
-
--- Objects
-property access : {name:"access", path:"objects:access", inc:{"access__.cpp", "access___.cpp"}, asn1:true}
-property biblio : {name:"biblio", path:"objects:biblio", inc:{"biblio__.cpp", "biblio___.cpp", "label_util.cpp"}, asn1:true}
-property biotree : {name:"biotree", path:"objects:biotree", inc:{"biotree__.cpp", "biotree___.cpp"}, asn1:true}
-property xnetblast : {name:"xnetblast", path:"objects:blast", inc:{"blast__.cpp", "blast___.cpp", "names.cpp"}, asn1:true}
-property xnetblastcli : {name:"xnetblastcli", path:"objects:blast", inc:{"blastclient.cpp", "blastclient_.cpp"}, asn1:true}
-property blastdb : {name:"blastdb", path:"objects:blastdb", inc:{"blastdb__.cpp", "blastdb___.cpp"}, asn1:true}
-property blastxml : {name:"blastxml", path:"objects:blastxml", inc:{"blastxml__.cpp", "blastxml___.cpp"}, asn1:true}
-property cdd : {name:"cdd", path:"objects:cdd", inc:{"cdd__.cpp", "cdd___.cpp"}, asn1:true}
-property cn3d : {name:"cn3d", path:"objects:cn3d", inc:{"cn3d__.cpp", "cn3d___.cpp"}, asn1:true}
-property docsum : {name:"docsum", path:"objects:docsum", inc:{"docsum__.cpp", "docsum___.cpp"}, asn1:true}
-property entrez2 : {name:"entrez2", path:"objects:entrez2", inc:{"entrez2__.cpp", "entrez2___.cpp"}, asn1:true}
-property entrez2cli : {name:"entrez2cli", path:"objects:entrez2", inc:{"entrez2_client.cpp", "entrez2_client_.cpp"}, asn1:true}
-property entrezgene : {name:"entrezgene", path:"objects:entrezgene", inc:{"entrezgene__.cpp", "entrezgene___.cpp"}, asn1:true}
-property featdef : {name:"featdef", path:"objects:featdef", inc:{"featdef__.cpp", "featdef___.cpp"}, asn1:true}
-property gbseq : {name:"gbseq", path:"objects:gbseq", inc:{"gbseq__.cpp", "gbseq___.cpp"}, asn1:true}
-property general : {name:"general", path:"objects:general", inc:{"general__.cpp", "general___.cpp", "uoconv.cpp"}, asn1:true}
-property id1 : {name:"id1", path:"objects:id1", inc:{"id1__.cpp", "id1___.cpp"}, asn1:true}
-property id1cli : {name:"id1cli", path:"objects:id1", inc:{"id1_client.cpp", "id1_client_.cpp"}, asn1:true}
-property id2 : {name:"id2", path:"objects:id2", inc:{"id2__.cpp", "id2___.cpp"}, asn1:true}
-property id2cli : {name:"id2cli", path:"objects:id2", inc:{"id2_client.cpp", "id2_client_.cpp"}, asn1:true}
-property insdseq : {name:"insdseq", path:"objects:insdseq", inc:{"insdseq__.cpp", "insdseq___.cpp"}, asn1:true}
-property medlars : {name:"medlars", path:"objects:medlars", inc:{"medlars__.cpp", "medlars___.cpp"}, asn1:true}
-property medline : {name:"medline", path:"objects:medline", inc:{"medline__.cpp", "medline___.cpp"}, asn1:true}
-property mim : {name:"mim", path:"objects:mim", inc:{"mim__.cpp", "mim___.cpp"}, asn1:true}
-property mla : {name:"mla", path:"objects:mla", inc:{"mla__.cpp", "mla___.cpp"}, asn1:true}
-property mlacli : {name:"mlacli", path:"objects:mla", inc:{"mla_client.cpp", "mla_client_.cpp"}, asn1:true}
-property mmdb1 : {name:"mmdb1", path:"objects:mmdb1", inc:{"mmdb1__.cpp", "mmdb1___.cpp"}, asn1:true}
-property mmdb2 : {name:"mmdb2", path:"objects:mmdb2", inc:{"mmdb2__.cpp", "mmdb2___.cpp"}, asn1:true}
-property mmdb3 : {name:"mmdb3", path:"objects:mmdb3", inc:{"mmdb3__.cpp", "mmdb3___.cpp"}, asn1:true}
-property ncbimime : {name:"ncbimime", path:"objects:ncbimime", inc:{"ncbimime__.cpp", "ncbimime___.cpp"}, asn1:true}
-property objprt : {name:"objprt", path:"objects:objprt", inc:{"objprt__.cpp", "objprt___.cpp"}, asn1:true}
-property omssa : {name:"omssa", path:"objects:omssa", inc:{"omssa__.cpp", "omssa___.cpp"}, asn1:true}
-property pcassay : {name:"pcassay", path:"objects:pcassay", inc:{"pcassay__.cpp", "pcassay___.cpp"}, asn1:true}
-property pcsubstance : {name:"pcsubstance", path:"objects:pcsubstance", inc:{"pcsubstance__.cpp", "pcsubstance___.cpp"}, asn1:true}
-property proj : {name:"proj", path:"objects:proj", inc:{"proj__.cpp", "proj___.cpp"}, asn1:true}
-property pub : {name:"pub", path:"objects:pub", inc:{"pub__.cpp", "pub___.cpp"}, asn1:true}
-property pubmed : {name:"pubmed", path:"objects:pubmed", inc:{"pubmed__.cpp", "pubmed___.cpp"}, asn1:true}
-property scoremat : {name:"scoremat", path:"objects:scoremat", inc:{"scoremat__.cpp", "scoremat___.cpp"}, asn1:true}
-property seq : {name:"seq", path:"objects:seq", inc:{"seq__.cpp", "seq___.cpp", "seqport_util.cpp", "seq_id_tree.cpp", "seq_id_handle.cpp", "seq_id_mapper.cpp", "seq_loc_mapper_base.cpp", "seq_align_mapper_base.cpp", "seqlocinfo.cpp"}, asn1:true}
-property seqalign : {name:"seqalign", path:"objects:seqalign", inc:{"seqalign__.cpp", "seqalign___.cpp"}, asn1:true}
-property seqblock : {name:"seqblock", path:"objects:seqblock", inc:{"seqblock__.cpp", "seqblock___.cpp"}, asn1:true}
-property seqfeat : {name:"seqfeat", path:"objects:seqfeat", inc:{"seqfeat__.cpp", "seqfeat___.cpp"}, asn1:true}
-property seqloc : {name:"seqloc", path:"objects:seqloc", inc:{"seqloc__.cpp", "seqloc___.cpp"}, asn1:true}
-property seqres : {name:"seqres", path:"objects:seqres", inc:{"seqres__.cpp", "seqres___.cpp"}, asn1:true}
-property seqset : {name:"seqset", path:"objects:seqset", inc:{"seqset__.cpp", "seqset___.cpp", "gb_release_file.cpp"}, asn1:true}
-property seqcode : {name:"seqcode", path:"objects:seqcode", inc:{"seqcode__.cpp", "seqcode___.cpp"}, asn1:true}
-property seqsplit : {name:"seqsplit", path:"objects:seqsplit", inc:{"seqsplit__.cpp", "seqsplit___.cpp"}, asn1:true}
-property seqtest : {name:"seqtest", path:"objects:seqtest", inc:{"seqtest__.cpp", "seqtest___.cpp"}, asn1:true}
-property seqedit : {name:"seqedit", path:"objects:seqedit", inc:{"seqedit__.cpp", "seqedit___.cpp"}, asn1:true}
-property seqtable : {name:"seqtable", path:"objects:seqtable", inc:{"seqtable__.cpp", "seqtable___.cpp"}, asn1:true}
-property submit : {name:"submit", path:"objects:submit", inc:{"submit__.cpp", "submit___.cpp"}, asn1:true}
-property taxon1 : {name:"taxon1", path:"objects:taxon1", inc:{"taxon1__.cpp", "taxon1___.cpp", "taxon1.cpp", "cache.cpp", "utils.cpp", "ctreecont.cpp"}, asn1:true}
-property taxon3 : {name:"taxon3", path:"objects:taxon3", inc:{"taxon3__.cpp", "taxon3___.cpp", "taxon3.cpp"}, asn1:true}
-property tinyseq : {name:"tinyseq", path:"objects:tinyseq", inc:{"tinyseq__.cpp", "tinyseq___.cpp"}, asn1:true}
-property valerr : {name:"valerr", path:"objects:valerr", inc:{"valerr__.cpp", "valerr___.cpp"}, asn1:true}
-property valid : {name:"valid", path:"objects:valid", inc:{"valid__.cpp", "valid___.cpp"}, asn1:true}
-
-(* ObjTools libs*)
-property xobjmgr : {name:"xobjmgr", path:"objmgr"}
-property xobjutil : {name:"xobjutil", path:"objmgr:util"}
-property id2_split : {name:"id2_split", path:"objmgr:split", exc:{"split_cache.cpp"}}
-property xalnmgr : {name:"xalnmgr", path:"objtools:alnmgr", exc:{"diag_rng_coll.cpp"}}
-property xcddalignview : {name:"xcddalignview", path:"objtools:cddalignview"}
-property lds : {name:"lds", path:"objtools:lds"}
---property lds_admin : {name:"lds_admin", path:"objtools:lds:admin"}
-property xvalidate : {name:"xvalidate", path:"objtools:validator"}
-property xobjmanip : {name:"xobjmanip", path:"objtools:manip"}
-property xobjread : {name:"xobjread", path:"objtools:readers"}
-property xobjedit : {name:"xobjedit", path:"objtools:edit"}
-property seqdb : {name:"seqdb", path:"objtools:blast:seqdb_reader"}
-property xformat : {name:"xformat", path:"objtools:format"}
-property xblastformat : {name:"xblastformat", path:"objtools:blast_format"}
-property blast_services : {name:"blast_services", path:"objtools:blast:services"}
-property xobjsimple : {name:"xobjsimple", path:"objtools:simple"}
-property xobjcleanup : {name:"xobjcleanup", path:"objtools:cleanup"}
-
-
-(* loaders and readers *)
-property xloader_lds : {name:"xloader_lds", path:"objtools:data_loaders:lds"}
-property xloader_table : {name:"xloader_table", path:"objtools:data_loaders:table"}
-property xloader_trace : {name:"xloader_trace", path:"objtools:data_loaders:trace"}
-property xloader_genbank : {name:"xloader_genbank", path:"objtools:data_loaders:genbank", inc:{"gbloader.cpp", "gbload_util.cpp"}}
-property xloader_blastdb : {name:"xloader_blastdb", path:"objtools:data_loaders:blastdb"}
-property xloader_cdd : {name:"xloader_cdd", path:"objtools:data_loaders:cdd"}
-
-property xreader : {name:"xreader", path:"objtools:data_loaders:genbank", exc:{"gbloader.cpp", "gbload_util.cpp"}}
-property xreader_id1 : {name:"xreader_id1", path:"objtools:data_loaders:genbank:id1"}
-property xreader_id2 : {name:"xreader_id1", path:"objtools:data_loaders:genbank:id2"}
-property xreader_cache : {name:"xreader_cache", path:"objtools:data_loaders:genbank:cache"}
-property xreader_pubseqos : {name:"xreader_pubseqos", path:"objtools:data_loaders:genbank:pubseq"}
-property xobjwrite : {name:"xobjwrite", path:"objtools:writers"}
-
-
-(* GUI Libraries *)
-property gui__core : {name:"gui__core", path:"gui:core", exc:{"ProjectAnnot.cpp", "ProjectDescr.cpp", "ProjectFolder.cpp", "ProjectItem.cpp"}}
---property gui_objects : {name:"gui_objects", path:"gui:objects", inc:{"gui_objects.cpp"}}
-property gui_objects : {name:"gui_objects", path:"gui:objects", inc:{"gbench_svc_cli.cpp", "gbench_svc_cli_.cpp", "gui_objects__.cpp", "gui_objects___.cpp"}, asn1:true, asn1Name:"gui_objects"}
-property gui_project : {name:"gui_project", path:"gui:objects", inc:{"gui_project__.cpp", "gui_project___.cpp"}, asn1:true, asn1Name:"gui_project"}
-property data_handle : {name:"data_handle", path:"gui:objects", inc:{"data_handle__.cpp", "data_handle___.cpp"}, asn1:true, asn1Name:"data_handle"}
-property gbench_svc : {name:"gbench_svc", path:"gui:objects", inc:{"gbench_svc__.cpp", "gbench_svc___.cpp"}, asn1:true, asn1Name:"gbench_svc"}
-property gbench_svc_cli : {name:"gbench_svc_cli", path:"gui:objects", inc:{"gbench_svc_cli.cpp", "gbench_svc_cli_.cpp"}}
-
-property gui__utils : {name:"gui__utils", path:"gui:utils"}
-property gui_objutils : {name:"gui_objutils", path:"gui:objutils", exc:{"fingp_seqfeat.cpp", "fingp_seqalign.cpp", "fingp_seqgraph.cpp", "fingp_seqid.cpp", "fingp_seqloc.cpp", "conv_seq_loc.cpp"}}
-property gui__config : {name:"gui__config", path:"gui:config"}
-property gui_opengl : {name:"gui_opengl", path:"gui:opengl"}
-property gui__graph : {name:"gui__graph", path:"gui:graph"}
-property gui_print : {name:"gui_print", path:"gui:print"}
-property gui__services : {name:"gui__services", path:"gui:services"}
-
-property gui_dlg_entry_form : {name:"gui_dlg_entry_form", path:"gui:dialogs:entry_form"}
---property gui_dlg_multi_col : {name:"gui_dlg_multi_col", path:"gui:dialogs:col"}
-property gui_dlg_registry : {name:"gui_dlg_registry", path:"gui:dialogs:registry"}
---property gui_dlg_progress : {name:"gui_dlg_progress", path:"gui:dialogs:progress"}
---property gui_dlg_featedit : {name:"gui_dlg_featedit", path:"gui:dialogs:edit:feature", inc:{"gui_dlg_seq_feat_edit__.cpp", "gui_dlg_seq_feat_edit___.cpp", "seq_feat_edit_dlg.cpp", "edit_form_browser.cpp", "edit_form_bin.cpp", "edit_form_widget.cpp", "seq_feat_edit_handler.cpp", "edit_form_builder.cpp", "edit_form_content.cpp", "edit_form_ds.cpp", "edit_form_rc.cpp", "seq_feat_location.cpp", "seq_feat_remove_dlg.cpp", "feature_editor.cpp", "edit_resource_file.cpp", "edit_table_model.cpp [...]
---property gui_dlg_featedit : {name:"gui_dlg_featedit", path:"gui:dialogs:edit:feature", exc:{"EditFormGroup.cpp", "EditFormGroup_.cpp", "EditFormInput.cpp", "EditFormInput_.cpp", "EditFormValue.cpp", "EditFormValue_.cpp", "NCBI_GUI_EditForm_module.cpp", "edit_form_builder.cpp", "edit_form_bin.cpp"}, asn1:true, asn1Name:"gui_dlg_seq_feat_edit"}
-property gui_dlg_edit : {name:"gui_dlg_edit", path:"gui:dialogs:edit"}
---property gui_dlg_feat_search : {name:"gui_dlg_feat_search", path:"gui:dialogs:feat_search"}
-property gui_dlg_seq_goto : {name:"gui_dlg_seq_goto", path:"gui:dialogs:seq_goto"}
-
-(* Widgets *)
-property w_fltable : {name:"w_fltable", path:"gui:widgets:Fl_Table"}
-property w_flu : {name:"w_flu", path:"gui:widgets:FLU"}
-property w_fltk : {name:"w_fltk", path:"gui:widgets:fl"}
-property w_gl : {name:"w_gl", path:"gui:widgets:gl"}
-property w_seq : {name:"w_seq", path:"gui:widgets:seq"}
-property w_snp : {name:"w_snp", path:"gui:widgets:snp"}
-property w_snp_filter : {name:"w_snp_filter", path:"gui:widgets:snp:filter"}
-property w_data : {name:"w_data", path:"gui:widgets:data"}
-property w_aln_data : {name:"w_aln_data", path:"gui:widgets:aln_data", exc:{"Sparse_align.cpp", "NCBI_Seqalign_ext_module.cpp", "Sparse_align_.cpp", "Sparse_score.cpp", "Sparse_score_.cpp", "Sparse_seg.cpp", "Sparse_seg_.cpp", "Sparse_seg_ext.cpp", "Sparse_seg_ext_.cpp"}}
---property seqalign_ext : {name:"seqalign_ext", path:"gui:widgets:aln_data", inc:{"seqalign_ext__.cpp", "seqalign_ext___.cpp"}, asn1:true, asn1Name:"seqalign_ext"}
-property w_seq_graphic : {name:"w_seq_graphic", path:"gui:widgets:seq_graphic"}
-property w_seq_text : {name:"w_seq_text", path:"gui:widgets:seq_text"}
-property w_hit_matrix : {name:"w_hit_matrix", path:"gui:widgets:hit_matrix", exc:{"hit_clustering.cpp"}}
-property w_aln_crossaln : {name:"w_aln_crossaln", path:"gui:widgets:aln_crossaln"}
-property w_aln_multi : {name:"w_aln_multi", path:"gui:widgets:aln_multiple"}
-property w_aln_table : {name:"w_aln_table", path:"gui:widgets:aln_table"}
-property w_taxtree : {name:"w_taxtree", path:"gui:widgets:tax_tree"}
---property w_taxplot3d : {name:"w_taxplot3d", path:"gui:widgets:taxplot3d"}
-property w_workspace : {name:"w_workspace", path:"gui:widgets:workspace"}
-property w_phylo_tree : {name:"w_phylo_tree", path:"gui:widgets:phylo_tree"}
-property w_object_list : {name:"w_object_list", path:"gui:widgets:object_list"}
-property w_serial_browse : {name:"w_serial_browse", path:"gui:widgets:serial_browse"}
-property w_feat_table : {name:"w_feat_table", path:"gui:widgets:feat_table"}
-property w_config : {name:"w_config", path:"gui:widgets:config"}
-property w_controls : {name:"w_controls", path:"gui:widgets:controls"}
-
-
-(* GUI Plugins *)
-property gui_doc_basic : {name:"gui_doc_basic", path:"gui:plugins:doc:basic"}
-property gui_doc_table : {name:"gui_doc_table", path:"gui:plugins:doc:table"}
--- algo
-property gui_algo_align : {name:"gui_algo_align", path:"gui:plugins:algo:align"}
-property gui_algo_validator : {name:"gui_algo_validator", path:"gui:plugins:algo:validator"}
-property gui_algo_basic : {name:"gui_algo_basic", path:"gui:plugins:algo:basic"}
-property gui_algo_cn3d : {name:"gui_algo_cn3d", path:"gui:plugins:algo:cn3d"}
-property gui_algo_external : {name:"gui_algo_external", path:"gui:plugins:algo:external"}
-property gui_algo_external_out : {name:"gui_algo_external_out", path:"gui:plugins:algo:basic"}
-property gui_algo_gnomon : {name:"gui_algo_gnomon", path:"gui:plugins:algo:gnomon"}
-property gui_algo_linkout : {name:"gui_algo_linkout", path:"gui:plugins:algo:linkout"}
-property gui_algo_phylo : {name:"gui_algo_phylo", path:"gui:plugins:algo:phylo"}
-property gui_algo_webpage : {name:"gui_algo_webpage", path:"gui:plugins:algo:web_page"}
-property gui_ncbi_init : {name:"gui_ncbi_init", path:"gui:plugins:algo:init"}
--- view
-property gui_view_align : {name:"gui_view_align", path:"gui:plugins:view:align"}
-property gui_view_graphic : {name:"gui_view_graphic", path:"gui:plugins:view:graphic"}
-property gui_view_phylo_tree : {name:"gui_view_phylo_tree", path:"gui:plugins:view:phylo_tree"}
-property gui_view_table : {name:"gui_view_table", path:"gui:plugins:view:table"}
---property gui_view_taxplot : {name:"gui_view_taxplot", path:"gui:plugins:view:taxplot"}
-property gui_view_text : {name:"gui_view_text", path:"gui:plugins:view:text"}
-property gui_view_validator : {name:"gui_view_validator", path:"gui:plugins:view:validator"}
-
-
-(*****************************************************************************************)
--- Organize everything into convinient packs --
-(*****************************************************************************************)
-property ncbi_core : {name:"ncbi_core", libs:{xncbi, xcompress, xbz2, tables, sequtil, creaders, regexp, xqueryparse, xregexp, xutil, xconnect, xser}, dep:Z_LIBS, fworks:"CoreServices", req:true, gui:false}
-property ncbi_web : {name:"ncbi_web", libs:{xhtml, xcgi}, dep:"ncbi_core", req:true, gui:false}
-property ncbi_bdb : {name:"ncbi_bdb", libs:{bdb}, dep:"ncbi_core" & BDB_LIBS, req:true, gui:false}
-property ncbi_xcache_bdb : {name:"ncbi_xcache_bdb", libs:{xcache_bdb}, dep:"ncbi_core ncbi_bdb db", req:true, gui:false}
-property ncbi_xcache_netcache : {name:"ncbi_xcache_netcache", libs:{xcache_netcache}, dep:"ncbi_core", req:true, gui:false}
-property ncbi_image : {name:"ncbi_image", libs:{ximage}, dep:"ncbi_core" & IMG_LIBS, req:true, gui:false}
-property ncbi_dbapi_driver : {name:"ncbi_dbapi_driver", libs:{dbapi_driver}, dep:"ncbi_core", req:true, gui:false}
-property ncbi_dbapi : {name:"ncbi_dbapi", libs:{dbapi, dbapi_cache}, dep:"ncbi_core ncbi_dbapi_driver", req:true, gui:false}
-property ncbi_general : {name:"ncbi_general", libs:{general}, dep:"ncbi_core", req:true, gui:false}
-property ncbi_algo : {name:"ncbi_algo", libs:{xalgoalign, xalgosplign, xalgoprosplign, xalgocontig_assembly, xalgoalignnw, xalgoaligutil, xalgoseq, xalgoseqqa, blast, blast_composition, xblast, xblast_dbindex, xalgognomon, xalgowinmask, xalgodustmask, xalgophytree, fastme}, dep:"ncbi_core ncbi_seq ncbi_misc ncbi_general ncbi_seqext ncbi_xobjsimple ncbi_pub", req:true, gui:false}
-property ncbi_misc : {name:"ncbi_misc", libs:{access, biotree, docsum, entrez2, entrez2cli, insdseq, entrezgene, featdef, gbseq, mim, objprt, tinyseq, proj, omssa, pcassay, pcsubstance}, dep:"ncbi_core ncbi_general ncbi_seq ncbi_pub", req:true, gui:false}
-property ncbi_pub : {name:"ncbi_pub", libs:{biblio, medline, medlars, mla, mlacli, pub, pubmed}, dep:"ncbi_core ncbi_general", req:true, gui:false}
-property ncbi_seq : {name:"ncbi_seq", libs:{seq, seqset, seqcode, submit, scoremat, xnetblast, xnetblastcli, blastdb, blastxml, taxon1, taxon3, seqtest, seqedit, seqtable, seqres, seqloc, seqfeat, seqblock, seqalign}, dep:"ncbi_core ncbi_general ncbi_pub", fworks:"Carbon", req:true, gui:false}
-property ncbi_mmdb : {name:"ncbi_mmdb", libs:{cdd, cn3d, ncbimime, mmdb1, mmdb2, mmdb3}, dep:"ncbi_core ncbi_general ncbi_pub ncbi_seq", req:true, gui:false}
-property ncbi_seqext : {name:"ncbi_seqext", libs:{xalnmgr, xobjmgr, xobjread, xobjwrite, xobjutil, xobjmanip, xformat, seqdb, id1, id1cli, id2, id2cli, id2_split, seqsplit, xobjedit, xobjcleanup}, dep:"ncbi_core ncbi_general ncbi_pub ncbi_misc ncbi_seq ncbi_dbapi_driver ncbi_dbapi ncbi_web", fworks:"Carbon", req:true, gui:false}
-property ncbi_validator : {name:"ncbi_validator", libs:{xvalidate, valerr, valid}, dep:"ncbi_core ncbi_general ncbi_pub ncbi_seq ncbi_seqext ncbi_misc", req:true, gui:false}
-property ncbi_lds : {name:"ncbi_lds", libs:{lds}, dep:"ncbi_core ncbi_xcache_bdb ncbi_bdb ncbi_general ncbi_seq ncbi_seqext ncbi_pub ncbi_misc db", req:true, gui:false}
-property ncbi_xreader : {name:"ncbi_xreader", libs:{xreader}, dep:"ncbi_core ncbi_general ncbi_pub ncbi_seq ncbi_seqext ncbi_misc", req:true, gui:false}
-property ncbi_xreader_id1 : {name:"ncbi_xreader_id1", libs:{xreader_id1}, dep:"ncbi_core ncbi_general ncbi_pub ncbi_misc ncbi_seq ncbi_seqext ncbi_xreader", req:true, gui:false}
-property ncbi_xreader_id2 : {name:"ncbi_xreader_id2", libs:{xreader_id2}, dep:"ncbi_core ncbi_general ncbi_pub ncbi_misc ncbi_seq ncbi_seqext ncbi_xreader", req:true, gui:false}
-property ncbi_xreader_cache : {name:"ncbi_xreader_cache", libs:{xreader_cache}, dep:"ncbi_core ncbi_xreader ncbi_pub ncbi_seq ncbi_seqext ncbi_misc ncbi_general", req:true, gui:false}
-property ncbi_xreader_pubseqos : {name:"ncbi_xreader_pubseqos", libs:{xreader_pubseqos}, dep:"ncbi_core ncbi_dbapi ncbi_dbapi_driver ncbi_pub ncbi_seq ncbi_seqext ncbi_xreader ncbi_misc ncbi_general", req:true, gui:false}
-property ncbi_xloader_cdd : {name:"ncbi_xloader_cdd", libs:{xloader_cdd}, dep:"ncbi_core ncbi_pub ncbi_seq ncbi_seqext ncbi_xreader ncbi_xreader_id1 ncbi_xreader_id2 ncbi_xreader_pubseqos ncbi_xreader_cache ncbi_misc ncbi_general", req:true, gui:false}
-property ncbi_xloader_genbank : {name:"ncbi_xloader_genbank", libs:{xloader_genbank}, dep:"ncbi_core ncbi_pub ncbi_seq ncbi_seqext ncbi_xreader ncbi_xreader_id1 ncbi_xreader_id2 ncbi_xreader_pubseqos ncbi_xreader_cache ncbi_misc ncbi_general", req:true, gui:false}
-property ncbi_xloader_blastdb : {name:"ncbi_xloader_blastdb", libs:{xloader_blastdb, blast_services}, dep:"ncbi_core ncbi_pub ncbi_seq ncbi_seqext ncbi_misc ncbi_general ncbi_algo", req:true, gui:false}
-property ncbi_xloader_lds : {name:"ncbi_xloader_lds", libs:{xloader_lds}, dep:"ncbi_xcache_bdb ncbi_bdb ncbi_core ncbi_general ncbi_lds ncbi_pub ncbi_seq ncbi_seqext ncbi_misc db", req:true, gui:false}
-property ncbi_xloader_trace : {name:"ncbi_xloader_trace", libs:{xloader_trace}, dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_misc ncbi_pub", req:true, gui:false}
-property ncbi_xobjsimple : {name:"ncbi_xobjsimple", libs:{xobjsimple}, dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_xloader_genbank ncbi_pub ncbi_misc ncbi_xreader ncbi_xreader_cache ncbi_xreader_id1 ncbi_xreader_id2", req:true, gui:false}
-
--- GUI
-property gui_utils : {name:"gui_utils", libs:{gui__utils, gui_objutils, gui_opengl, gui_print}, dep:"ncbi_core ncbi_seq ncbi_pub ncbi_seqext ncbi_algo ncbi_image ncbi_general ncbi_misc ncbi_validator" & FI_LIBS, fworks:"Carbon OpenGL", req:true, gui:true}
-property gui_config : {name:"gui_config", libs:{gui__config}, dep:"gui_utils ncbi_core ncbi_misc ncbi_general ncbi_seq ncbi_seqext ncbi_algo ncbi_pub ncbi_validator ncbi_image" & FI_LIBS, req:true, gui:true}
-property gui_graph : {name:"gui_graph", libs:{gui__graph}, dep:"gui_utils ncbi_core ncbi_validator ncbi_seqext ncbi_algo ncbi_image ncbi_pub ncbi_general ncbi_seq ncbi_misc" & FI_LIBS, fworks:"OpenGL", req:true, gui:true}
-property gui_widgets : {name:"gui_widgets", libs:{w_aln_data, w_workspace, w_fltk, w_gl, w_flu, w_fltable, w_config, w_controls, w_data, w_serial_browse, w_object_list}, dep:"gui_config gui_utils ncbi_image ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_algo ncbi_pub ncbi_misc ncbi_validator" & FI_LIBS, fworks:"Carbon OpenGL", req:true, gui:true}
-property gui_dialogs : {name:"gui_dialogs", libs:{gui_dlg_entry_form, gui_dlg_edit, gui_dlg_seq_goto}, dep:"ncbi_image gui_widgets gui_config gui_utils ncbi_core ncbi_general ncbi_seq ncbi_pub ncbi_seqext ncbi_algo ncbi_pub ncbi_misc ncbi_validator" & FI_LIBS, fworks:"Carbon OpenGL", req:true, gui:true} -- gui_dlg_registry
-property gui_core : {name:"gui_core", libs:{gui__core, gui_objects}, dep:"ncbi_image gui_config gui_dialogs gui_utils gui_widgets ncbi_core ncbi_web ncbi_general ncbi_seq ncbi_seqext ncbi_algo ncbi_pub ncbi_misc ncbi_validator" & FI_LIBS, req:true, gui:true}
-property gui_widgets_misc : {name:"gui_widgets_misc", libs:{w_phylo_tree, w_snp, w_snp_filter}, dep:"ncbi_validator ncbi_algo ncbi_core ncbi_image ncbi_seq ncbi_seqext ncbi_general ncbi_misc gui_utils gui_graph gui_widgets gui_config ncbi_pub ncbi_misc" & FI_LIBS, fworks:"OpenGL", req:true, gui:true}
-property gui_widgets_seq : {name:"gui_widgets_seq", libs:{w_seq_graphic, w_taxtree, w_seq, w_feat_table, w_seq_text}, dep:"ncbi_image ncbi_algo ncbi_core ncbi_seq ncbi_seqext ncbi_general gui_graph gui_config gui_utils gui_widgets gui_widgets_misc ncbi_pub ncbi_misc ncbi_validator" & FI_LIBS, fworks:"OpenGL", req:true, gui:true}
-property gui_widgets_aln : {name:"gui_widgets_aln", libs:{w_aln_crossaln, w_aln_multi, w_hit_matrix, w_aln_table}, dep:"ncbi_image ncbi_core ncbi_seq ncbi_seqext ncbi_general ncbi_algo gui_config gui_utils gui_graph gui_dialogs gui_widgets gui_widgets_seq ncbi_pub ncbi_misc ncbi_validator gui_widgets_misc" & FI_LIBS, fworks:"OpenGL", req:true, gui:true} --gui_core
-property gui_services : {name:"gui_services", libs:{gui__services}, dep:"gui_core gui_config gui_utils gui_widgets gui_widgets_seq ncbi_core ncbi_general ncbi_misc ncbi_seq ncbi_seqext ncbi_pub ncbi_misc ncbi_validator ncbi_image gui_graph gui_widgets_misc ncbi_algo gui_dialogs" & FI_LIBS, req:true, gui:true}
-
--- PLUG-INS
-property algo_align : {name:"algo_align", libs:{gui_algo_align}, dep:"gui_core gui_dialogs gui_utils gui_widgets gui_widgets_seq ncbi_algo ncbi_core ncbi_general ncbi_misc ncbi_seq ncbi_seqext ncbi_xcache_bdb ncbi_bdb ncbi_xloader_genbank ncbi_pub ncbi_misc ncbi_validator ncbi_image db gui_config" & FI_LIBS, bundle:true, req:true, gui:true}
-property algo_basic : {name:"algo_basic", libs:{gui_algo_basic}, dep:"gui_core gui_dialogs gui_utils gui_widgets gui_widgets_seq ncbi_algo ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_misc ncbi_xloader_cdd ncbi_xloader_genbank ncbi_pub ncbi_misc ncbi_validator ncbi_image gui_graph gui_widgets_misc ncbi_algo gui_dialogs gui_config" & FI_LIBS, bundle:true, req:true, gui:true}
-
-property algo_cn3d : {name:"algo_cn3d", libs:{gui_algo_cn3d}, dep:"gui_core gui_utils ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_algo ncbi_mmdb ncbi_xloader_genbank ncbi_pub ncbi_misc gui_dialogs gui_widgets gui_widgets_misc ncbi_validator ncbi_image gui_config" & FI_LIBS, bundle:true, req:true, gui:true}
-property algo_external : {name:"algo_external", libs:{gui_algo_external}, dep:"gui_core gui_utils gui_widgets ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_algo ncbi_web ncbi_xloader_genbank gui_utils ncbi_mmdb ncbi_pub ncbi_misc gui_dialogs gui_widgets_misc ncbi_validator ncbi_image gui_config" & FI_LIBS, bundle:true, req:true, gui:true}
-property algo_gnomon : {name:"algo_gnomon", libs:{gui_algo_gnomon}, dep:"gui_core gui_dialogs gui_utils gui_widgets gui_widgets_seq ncbi_algo ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_xloader_genbank ncbi_misc ncbi_pub ncbi_image ncbi_validator gui_config" & FI_LIBS, bundle:true, req:true, gui:true}
-property algo_init : {name:"algo_init", libs:{gui_ncbi_init}, dep:"gui_core gui_utils ncbi_xcache_bdb gui_dialogs gui_widgets gui_widgets_seq ncbi_bdb ncbi_core ncbi_lds ncbi_seq ncbi_seqext ncbi_algo ncbi_misc ncbi_xloader_genbank ncbi_xloader_lds ncbi_xreader ncbi_xreader_id1 ncbi_xreader_id2 ncbi_xreader_pubseqos ncbi_xreader_cache ncbi_xcache_netcache db ncbi_validator ncbi_pub ncbi_general ncbi_image gui_config" & FI_LIBS, bundle:true, req:true, gui:true}
-property algo_linkout : {name:"algo_linkout", libs:{gui_algo_linkout}, dep:"gui_core gui_utils ncbi_core ncbi_general ncbi_web ncbi_seq ncbi_seqext ncbi_algo ncbi_validator gui_dialogs gui_config gui_widgets ncbi_pub ncbi_misc gui_widgets_misc ncbi_image" & FI_LIBS, bundle:true, req:true, gui:true}
-property algo_phylo : {name:"algo_phylo", libs:{gui_algo_phylo}, dep:"gui_core gui_utils ncbi_algo ncbi_core ncbi_seq ncbi_misc ncbi_seqext gui_dialogs ncbi_validator ncbi_image gui_config ncbi_pub ncbi_general gui_widgets" & FI_LIBS, bundle:true, req:true, gui:true}
-property algo_webpage : {name:"algo_webpage", libs:{gui_algo_webpage}, dep:"gui_core gui_utils ncbi_algo ncbi_core ncbi_seq ncbi_misc ncbi_seqext gui_dialogs gui_config gui_widgets ncbi_validator ncbi_image ncbi_general ncbi_pub" & FI_LIBS, bundle:true, req:true, gui:true}
-property algo_validator : {name:"algo_validator", libs:{gui_algo_validator}, dep:"gui_core gui_utils ncbi_core ncbi_seq ncbi_seqext ncbi_algo ncbi_validator ncbi_misc gui_dialogs gui_config gui_widgets ncbi_validator ncbi_image ncbi_general ncbi_pub" & FI_LIBS, bundle:true, req:true, gui:true}
-property dload_basic : {name:"dload_basic", libs:{gui_doc_basic}, dep:"gui_core gui_dialogs gui_utils gui_widgets gui_widgets_seq gui_services ncbi_algo ncbi_xloader_genbank ncbi_xloader_lds ncbi_xcache_bdb ncbi_bdb ncbi_core ncbi_lds ncbi_general ncbi_misc ncbi_seq ncbi_seqext ncbi_pub db gui_graph ncbi_xreader ncbi_xreader_cache ncbi_xreader_id1 ncbi_xreader_id2 gui_widgets_misc ncbi_misc gui_dialogs gui_config gui_widgets ncbi_validator ncbi_image" & FI_LIBS, bundle:true, req:true, gui:true}
-property dload_table : {name:"dload_table", libs:{gui_doc_table}, dep:"gui_core gui_dialogs gui_utils gui_widgets ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_algo ncbi_validator ncbi_misc ncbi_image ncbi_pub gui_config" & FI_LIBS, bundle:true, req:true, gui:true}
-property view_align : {name:"view_align", libs:{gui_view_align}, dep:"ncbi_core ncbi_seq ncbi_seqext gui_core gui_utils gui_widgets gui_widgets_aln gui_config ncbi_validator ncbi_image ncbi_algo gui_widgets_misc gui_graph ncbi_misc ncbi_general ncbi_pub gui_dialogs gui_widgets_seq" & FI_LIBS, bundle:true, req:true, gui:true}
-property view_graphic : {name:"view_graphic", libs:{gui_view_graphic}, dep:"ncbi_core ncbi_seq ncbi_seqext gui_core gui_utils gui_dialogs gui_widgets gui_widgets_seq gui_config ncbi_validator ncbi_image ncbi_algo gui_widgets_misc gui_graph ncbi_misc ncbi_general ncbi_pub" & FI_LIBS, bundle:true, req:true, gui:true}
-property view_phylotree : {name:"view_phylotree", libs:{gui_view_phylo_tree}, dep:"ncbi_core ncbi_algo ncbi_misc ncbi_seq ncbi_seqext gui_core gui_utils gui_widgets gui_widgets_misc gui_config ncbi_validator ncbi_image ncbi_algo gui_widgets_misc gui_graph ncbi_misc ncbi_general ncbi_pub gui_widgets gui_dialogs" & FI_LIBS, bundle:true, req:true, gui:true}
-property view_table : {name:"view_table", libs:{gui_view_table}, dep:"ncbi_core ncbi_seq ncbi_seqext ncbi_general gui_core gui_utils gui_widgets gui_widgets_aln gui_widgets_seq gui_dialogs gui_config ncbi_validator ncbi_image ncbi_algo gui_widgets_misc gui_graph ncbi_misc ncbi_general ncbi_pub" & FI_LIBS, bundle:true, req:true, gui:true}
---property view_taxplot : {name:"view_taxplot", libs:{gui_view_taxplot}, dep:"ncbi_core ncbi_seq ncbi_seqext ncbi_general gui_core gui_utils gui_widgets gui_widgets_misc gui_dialogs gui_config ncbi_validator ncbi_image ncbi_algo gui_widgets_misc gui_graph ncbi_misc ncbi_general ncbi_pub" & FI_LIBS, bundle:true, req:true, gui:true}
-property view_text : {name:"view_text", libs:{gui_view_text}, dep:"ncbi_core ncbi_pub ncbi_seq ncbi_seqext ncbi_general gui_core gui_utils gui_widgets gui_widgets_seq gui_dialogs gui_config ncbi_validator ncbi_image ncbi_algo gui_widgets_misc gui_graph ncbi_misc ncbi_pub" & FI_LIBS, bundle:true, req:true, gui:true}
-property view_validator : {name:"view_validator", libs:{gui_view_validator}, dep:"ncbi_core ncbi_seq ncbi_validator gui_core gui_utils gui_widgets gui_dialogs gui_config ncbi_seqext ncbi_validator ncbi_image ncbi_algo gui_widgets_misc gui_graph ncbi_misc ncbi_general ncbi_pub" & FI_LIBS, bundle:true, req:true, gui:true}
-
-
-
-(* ====================================================================================================== *)
--- Optional Console Tools
-property test_ncbi_tree : {name:"test_ncbi_tree", path:"corelib:test", inc:{"test_ncbi_tree.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbiutil : {name:"test_ncbiutil", path:"corelib:test", inc:{"test_ncbiutil.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_plugins : {name:"test_plugins", path:"corelib:test", inc:{"test_plugins.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbitime : {name:"test_ncbitime", path:"corelib:test", inc:{"test_ncbitime.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbithr : {name:"test_ncbithr", path:"corelib:test", inc:{"test_ncbithr.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbistr : {name:"test_ncbistr", path:"corelib:test", inc:{"test_ncbistr.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbifile : {name:"test_ncbifile", path:"corelib:test", inc:{"test_ncbifile.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbiexpt : {name:"test_ncbiexpt", path:"corelib:test", inc:{"test_ncbiexpt.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbiexec : {name:"test_ncbiexec", path:"corelib:test", inc:{"test_ncbiexec.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbi_system : {name:"test_ncbi_system", path:"corelib:test", inc:{"test_ncbi_system.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbi_process : {name:"test_ncbi_process", path:"corelib:test", inc:{"test_ncbi_process.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbi_os_unix : {name:"test_ncbi_os_unix", path:"corelib:test", inc:{"test_ncbi_os_unix.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property test_ncbi_limits : {name:"test_ncbi_limits", path:"corelib:test", inc:{"test_ncbi_limits.cpp"}, dep:"ncbi_core", req:false, gui:false}
-property coretest : {name:"coretest", path:"corelib:test", inc:{"coretest.cpp"}, dep:"ncbi_core", req:false, gui:false}
--- object manager
-property test_objmgr : {name:"test_objmgr", path:"objmgr:test", inc:{"test_objmgr.cpp", "test_helper.cpp"}, dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext", req:false, gui:false}
-property test_objmgr_basic : {name:"test_objmgr_basic", path:"objmgr:test", inc:{"test_objmgr_basic.cpp"}, dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext", req:false, gui:false}
-property test_validator : {name:"test_validator", path:"objtools:validator:test", inc:{"test_validator.cpp"}, dep:"ncbi_core ncbi_bdb ncbi_general ncbi_seq ncbi_seqext ncbi_xreader_id1 ncbi_lds ncbi_xreader ncbi_xloader_genbank ncbi_xloader_lds ncbi_xloader_blastdb ncbi_xreader_id2 ncbi_xreader_cache ncbi_misc ncbi_pub ncbi_validator ncbi_seq ncbi_seqext ncbi_validator", req:true, gui:false}
-property test_basic_cleanup : {name:"test_basic_cleanup", path:"objtools:cleanup:test", inc:{"test_basic_cleanup.cpp"}, dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_xreader_id2 ncbi_xreader_cache ncbi_misc ncbi_pub ncbi_validator ncbi_seq", req:true, gui:false}
--- App
-property asn2flat : {name:"asn2flat", path:"app:asn2flat", dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_misc ncbi_xloader_genbank", req:false, gui:false}
-property asn2asn : {name:"asn2asn", path:"app:asn2asn", inc:{"asn2asn.cpp"}, dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext", req:false, gui:false}
-property gi2taxid : {name:"gi2taxid", path:"app:gi2taxid", dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext", req:false, gui:false}
-property ini2reg : {name:"ini2reg", path:"gui:app:ini2reg", inc:{"ini2reg.cpp"}, dep:"ncbi_core ncbi_general gui_utils ncbi_seq ncbi_seqext ncbi_algo ncbi_pub ncbi_misc ncbi_validator ncbi_image" & FI_LIBS, req:true, gui:true}
-property omssacl : {name:"omssacl", path:"algo:ms:omssa", inc:{"omssacl.cpp"}, dep:"ncbi_core ncbi_general ncbi_misc ncbi_seq ncbi_pub ncbi_seqext ncbi_algo", req:false, gui:false}
-property omssamerge : {name:"omssamerge", path:"algo:ms:omssa", inc:{"omssamerge.cpp"}, dep:"ncbi_core ncbi_general ncbi_misc ncbi_seq ncbi_pub ncbi_seqext ncbi_algo", req:false, gui:false}
-
-property id1_fetch : {name:"id1_fetch", path:"app:id1_fetch", inc:{"id1_fetch.cpp"}, dep:"ncbi_core ncbi_general ncbi_misc ncbi_seq ncbi_seqext ncbi_xloader_genbank", req:false, gui:false}
-property id1_fetch_simple : {name:"id1_fetch_simple", path:"app:id1_fetch", inc:{"id1_fetch_simple.cpp"}, dep:"ncbi_core ncbi_general ncbi_misc ncbi_seq ncbi_seqext", req:false, gui:false}
-property objmgr_demo : {name:"objmgr_demo", path:"app:objmgr:demo", dep:"ncbi_core ncbi_bdb ncbi_general ncbi_seq ncbi_seqext ncbi_xreader_id1 ncbi_lds ncbi_xreader ncbi_xloader_genbank ncbi_xloader_lds ncbi_xloader_blastdb", req:false, gui:false}
-property blast_client : {name:"blast_client", path:"app:blast_client", dep:"ncbi_core ncbi_general ncbi_seq ncbi_seqext ncbi_algo ncbi_lds ncbi_xloader_genbank", req:false, gui:false}
-
-property streamtest : {name:"streamtest", path:"app:streamtest", dep:"ncbi_core ncbi_general ncbi_pub ncbi_seq ncbi_seqext ncbi_algo ncbi_xloader_genbank", req:true, gui:false}
-
-property datatool : {name:"datatool", path:"serial:datatool", dep:"ncbi_core", req:true, gui:false}
-
-
--- Tests
-
-(* GUI Applications *)
-(* Demo GUI Applications *)
-property demo_seqgraphic : {name:"demo_seqgraphic", path:"gui:widgets:seq_graphic:demo", dep:"ncbi_core ncbi_xloader_genbank ncbi_seq ncbi_general ncbi_pub ncbi_misc ncbi_seqext gui_core gui_utils gui_dialogs gui_widgets gui_widgets_misc gui_widgets_seq gui_widgets_seq gui_config ncbi_xreader ncbi_xloader_genbank ncbi_xloader_lds ncbi_xloader_blastdb ncbi_xreader_id1 ncbi_xreader_id2 ncbi_xreader_cache ncbi_algo ncbi_image gui_graph ncbi_validator" & FI_LIBS, fworks:"Carbon", req:true, g [...]
-property demo_crossaln : {name:"demo_crossaln", path:"gui:widgets:aln_crossaln:demo", dep:"ncbi_core ncbi_xloader_genbank ncbi_seq ncbi_pub ncbi_general ncbi_misc ncbi_seqext gui_core gui_utils gui_dialogs gui_widgets gui_widgets_misc gui_widgets_seq gui_widgets_seq gui_config ncbi_xreader ncbi_xloader_genbank ncbi_xloader_lds ncbi_xloader_blastdb ncbi_xreader_id1 ncbi_xreader_id2 ncbi_xreader_cache ncbi_algo ncbi_image gui_graph ncbi_validator gui_widgets_aln" & FI_LIBS, fworks:"Carbon" [...]
-property demo_seqtext : {name:"demo_seqtext", path:"gui:widgets:seq_text:demo", dep:"ncbi_core ncbi_xloader_genbank ncbi_seq ncbi_seqext gui_core gui_utils gui_dialogs gui_widgets gui_widgets_seq gui_config" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-
-property demo_hitmatrix : {name:"demo_hitmatrix", path:"gui:widgets:hit_matrix:demo", dep:"ncbi_core ncbi_seq ncbi_seqext gui_core gui_utils gui_dialogs gui_widgets gui_widgets_aln gui_config ncbi_xloader_genbank" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_workspace : {name:"demo_workspace", path:"gui:widgets:workspace:demo", inc:{"demo_workspace.cpp"}, dep:"ncbi_core gui_core gui_utils gui_dialogs gui_widgets" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_win_manager : {name:"demo_win_manager", path:"gui:widgets:workspace:demo", inc:{"demo_win_manager.cpp"}, dep:"ncbi_core gui_core gui_utils gui_dialogs gui_widgets" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_phylo_tree : {name:"demo_phylo_tree", path:"gui:widgets:phylo_tree:demo", dep:"ncbi_core gui_core gui_utils gui_dialogs gui_widgets gui_widgets_misc" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_serial_browse : {name:"demo_serial_browse", path:"gui:widgets:serial_browse:demo", dep:"ncbi_core ncbi_seq gui_core gui_utils gui_dialogs gui_widgets gui_widgets_seq" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_tooltip : {name:"demo_tooltip", path:"gui:widgets:fl:demo", inc:{"tt_demo.cpp", "tt_demo_ui.cpp", "tt_window.cpp"}, dep:"ncbi_core gui_core gui_utils gui_dialogs gui_widgets" & FI_LIBS, fworks:"Carbon OpenGL", req:false, gui:true}
-property demo_treebrowser : {name:"demo_treebrowser", path:"gui:widgets:fl:demo", inc:{"test_treebrowser.cpp"}, dep:"ncbi_core gui_core gui_utils gui_dialogs gui_widgets" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_table : {name:"demo_table", path:"gui:widgets:fl:demo", inc:{"table_demo.cpp", "table_demo_ui.cpp"}, dep:"ncbi_core gui_core gui_utils gui_dialogs gui_widgets" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_taxtree : {name:"demo_taxtree", path:"gui:widgets:tax_tree:demo", dep:"ncbi_core ncbi_seq ncbi_seqext ncbi_misc gui_core gui_utils gui_dialogs gui_widgets gui_widgets_seq ncbi_xloader_genbank" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_font : {name:"demo_font", path:"gui:opengl:demo", inc:{"font_demo.cpp", "font_demo_ui.cpp", "font_window.cpp"}, dep:"ncbi_core gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon OpenGL", req:false, gui:true}
-property demo_gl3d : {name:"demo_gl3d", path:"gui:opengl:demo", inc:{"gl3d_demo.cpp", "gl3d_demo_ui.cpp", "gl3d_window.cpp"}, dep:"ncbi_core gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon OpenGL", req:false, gui:true}
-property demo_spline : {name:"demo_spline", path:"gui:opengl:demo", inc:{"spline_demo.cpp", "spline_demo_ui.cpp", "spline_window.cpp"}, dep:"ncbi_core gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon OpenGL", req:false, gui:true}
-property demo_tex : {name:"demo_texture", path:"gui:opengl:demo", inc:{"tex_demo.cpp", "tex_demo_ui.cpp", "tex_window.cpp"}, dep:"ncbi_core ncbi_image gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon OpenGL", req:false, gui:true}
-property demo_tex_font : {name:"demo_texture_fonts", path:"gui:opengl:demo", inc:{"tex_font_demo.cpp", "tex_font_demo_ui.cpp", "tex_font_window.cpp"}, dep:"ncbi_core ncbi_image gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon OpenGL", req:false, gui:true}
-property demo_gltest : {name:"demo_gltest", path:"gui:opengl:test", dep:"ncbi_core ncbi_image gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_wcontrols : {name:"demo_wcontrols", path:"gui:widgets:controls:demo", exc:{"demo_wizard.cpp"}, dep:"ncbi_core ncbi_image gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-property demo_wizard : {name:"demo_wizard", path:"gui:widgets:controls:demo", inc:{"demo_wizard.cpp"}, dep:"ncbi_core ncbi_image gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon", req:false, gui:true}
-
-property gbench : {name:"Genome Workbench", path:"gui:app:gbench", dep:"ncbi_core ncbi_xcache_netcache ncbi_general ncbi_seq ncbi_seqext gui_core gui_utils gui_dialogs gui_services gui_widgets gui_widgets_aln gui_widgets_misc gui_config gui_widgets_seq ncbi_validator ncbi_image ncbi_algo gui_graph ncbi_misc ncbi_pub" & FI_LIBS, fworks:"Carbon", gbench:true, req:true, gui:true}
-
-property gbench_plugin_scan : {name:"gbench_plugin_scan", path:"gui:app:gbench_plugin_scan", dep:"ncbi_core ncbi_seq ncbi_seqext ncbi_algo gui_core gui_utils gui_dialogs ncbi_image ncbi_validator gui_config gui_widgets ncbi_misc ncbi_general ncbi_pub" & FI_LIBS, req:true, gui:true}
-property gbench_monitor : {name:"gbench_monitor", path:"gui:app:gbench_monitor", dep:"ncbi_core ncbi_xcache_netcache", req:true, gui:true}
-property gbench_feedback_agent : {name:"gbench_feedback_agent", path:"gui:app:gbench_feedback_agent", dep:"gui_dialogs ncbi_image ncbi_pub ncbi_validator ncbi_seq ncbi_seqext ncbi_algo gui_config ncbi_misc ncbi_core ncbi_general gui_core gui_utils gui_widgets" & FI_LIBS, fworks:"Carbon", req:true, gui:true}
-(* ====================================================================================================== *)
-
-
-
--- All Libraries to build
-property allLibs : {ncbi_core, ncbi_web, ncbi_bdb, ncbi_xcache_bdb, ncbi_xcache_netcache, ncbi_image, ncbi_dbapi_driver, ncbi_dbapi, ncbi_general, ncbi_pub, ncbi_seq, ncbi_mmdb, ncbi_misc, ncbi_seqext, ncbi_validator, ncbi_lds, ncbi_xreader, ncbi_xreader_id1, ncbi_xreader_id2, ncbi_xreader_cache, ncbi_xreader_pubseqos, ncbi_xloader_cdd, ncbi_xloader_genbank, ncbi_xloader_lds, ncbi_xloader_trace, ncbi_xobjsimple, ncbi_algo, ncbi_xloader_blastdb, gui_utils, gui_config, gui_graph, gui_widge [...]
-
---property allLibs : {ncbi_dbapi_driver}
--- Tools packs
-property allCTools : {datatool, gbench_plugin_scan, gbench_feedback_agent, gbench_monitor, test_ncbi_tree, test_plugins, test_ncbitime, test_ncbithr, test_ncbistr, test_ncbifile, test_ncbiexpt, test_ncbiexec, test_ncbi_system, test_ncbi_process, test_ncbi_os_unix, test_ncbi_limits, test_objmgr_basic, test_objmgr, test_validator, test_basic_cleanup, coretest, gi2taxid, asn2flat, asn2asn, id1_fetch, id1_fetch_simple, objmgr_demo, ini2reg, omssacl, omssamerge, streamtest}
---property allCTools : {tests}
-
-
--- Application packs
-property allApps : {gbench, demo_seqgraphic, demo_crossaln, demo_seqtext, demo_hitmatrix, demo_workspace, demo_win_manager, demo_phylo_tree, demo_serial_browse, demo_tooltip, demo_treebrowser, demo_table, demo_taxtree, demo_font, demo_gl3d, demo_spline, demo_tex, demo_tex_font, demo_gltest, demo_wcontrols, demo_wizard}
---property allApps : {gui_demos}
-
-
-
-script ToolkitSource
-	on Initialize()
-		set AllLibraries to allLibs
-		set AllConsoleTools to allCTools
-		set AllApplications to allApps
-	end Initialize
-	
-end script
diff --git a/c++/compilers/xCode/ProjBuilder.applescript b/c++/compilers/xCode/ProjBuilder.applescript
deleted file mode 100644
index 98b2d88..0000000
--- a/c++/compilers/xCode/ProjBuilder.applescript
+++ /dev/null
@@ -1,658 +0,0 @@
-(*  $Id: ProjBuilder.applescript 168971 2009-08-24 10:53:56Z lebedev $
- * ===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Author:  Vlad Lebedev
- *
- * File Description:
- * xCode Project Generator Script
- *
- * Know issues:
- * 1) Script build phase should be changed for "gui_project". Use better sed command-line options.
- *)
-
-property upper_alphabet : "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-property ret : "
-" -- For some reason standard return does not work.
-
-(* Project starts here *)
-global newProject
-
-(* external globals *)
-global TheNCBIPath, TheFLTKPath, TheBDBPath, ThePCREPath, TheOUTPath
-global libTypeDLL, guiLibs, zeroLink, fixContinue, xcodeTarget, projFile
-
-(**)
-
-(* Hold keys and values for object dictionary of the project *)
-global objValues
-global objKeys
-
-(* file count: file indexes and references will use this number*)
-global refFileCount
-
-(* all targets go here, as a dependencie for master target: Build All *)
-global allDepList, libDepList, appDepList
-
-(* Build settings: You could target older versions of Mac OS X with this settings*)
-property buildSettings10_1 : {|MACOSX_DEPLOYMENT_TARGET|:"10.1", |SDKROOT|:"/Developer/SDKs/MacOSX10.1.5.sdk"}
-property buildSettings10_2 : {|MACOSX_DEPLOYMENT_TARGET|:"10.2", |SDKROOT|:"/Developer/SDKs/MacOSX10.2.8.sdk"}
-
-(* Build settings for the project *)
-
-property buildSettingsCommon : {|GCC_MODEL_CPU|:"|none|", |GCC_MODEL_TUNING|:"|none|", |FRAMEWORK_SEARCH_PATHS|:"/System/Library/Frameworks/CoreServices.framework/Frameworks", |LIBRARY_SEARCH_PATHS|:"", |GCC_ALTIVEC_EXTENSIONS|:"NO", |PREBINDING|:"NO", |HEADER_SEARCH_PATHS|:"", |ZERO_LINK|:"NO", |GCC_PRECOMPILE_PREFIX_HEADER|:"YES", |OTHER_CPLUSPLUSFLAGS|:"", |GCC_PREFIX_HEADER|:"", |STRIP_INSTALLED_PRODUCT|:"NO", |DEAD_CODE_STRIPPING|:"YES", |OBJROOT|:""}
-property buildSettingsDebug : buildSettingsCommon & {|COPY_PHASE_STRIP|:"NO", |DEBUGGING_SYMBOLS|:"YES", |GCC_DYNAMIC_NO_PIC|:"NO", |GCC_ENABLE_FIX_AND_CONTINUE|:"NO", |GCC_OPTIMIZATION_LEVEL|:"0", |OPTIMIZATION_CFLAGS|:"-O0", |GCC_PREPROCESSOR_DEFINITIONS|:"NCBI_DLL_BUILD NCBI_XCODE_BUILD _DEBUG _MT HAVE_CONFIG_H"}
-property buildSettingsRelease : buildSettingsCommon & {|COPY_PHASE_STRIP|:"YES", |GCC_ENABLE_FIX_AND_CONTINUE|:"NO", |DEPLOYMENT_POSTPROCESSING|:"YES", |GCC_PREPROCESSOR_DEFINITIONS|:"NCBI_DLL_BUILD NCBI_XCODE_BUILD _MT NDEBUG HAVE_CONFIG_H"}
-
-(* Build styles for the project *)
-property buildStyleDebug : {isa:"PBXBuildStyle", |name|:"Debug", |buildRules|:{}, |buildSettings|:buildSettingsDebug}
-property buildStyleRelease : {isa:"PBXBuildStyle", |name|:"Release", |buildRules|:{}, |buildSettings|:buildSettingsRelease}
-property projectBuildStyles : {}
-
-
-(* Root Objects, project and main group *)
-property rootObject : {isa:"PBXProject", |hasScannedForEncodings|:"1", |mainGroup|:"MAINGROUP", |targets|:{}, |buildSettings|:{|name|:"NCBI", |GCC_GENERATE_DEBUGGING_SYMBOLS|:"NO"}, |buildStyles|:{}}
-property mainGroup : {isa:"PBXGroup", children:{"HEADERS", "SOURCES", "FRAMEWORKS"}, |name|:"NCBI C++ Toolkit", |refType|:"4"}
-property emptyProject : {|rootObject|:"ROOT_OBJECT", |archiveVersion|:"1", |objectVersion|:"39", objects:{}}
-
-(* Convinience Groups *)
-property headers : {isa:"PBXGroup", children:{}, |name|:"Headers", |refType|:"4"}
-property sources : {isa:"PBXGroup", children:{}, |name|:"Sources", |refType|:"4"}
-property fworks : {isa:"PBXGroup", children:{}, |name|:"External Frameworks", |refType|:"4"}
-
-(* Empty templates for the variouse things in the project *)
-property toolProduct : {isa:"PBXExecutableFileReference", |explicitFileType|:"compiled.mach-o.executable", |refType|:"3"}
-property libProduct : {isa:"PBXLibraryReference", |explicitFileType|:"compiled.mach-o.dylib", |refType|:"3"}
-property appProduct : {isa:"PBXFileReference", |explicitFileType|:"wrapper.application", |refType|:"3"}
-
-
-
-
-script ProjBuilder
-	on Initialize()
-		
-		set libraryPath to ""
-		set headerPath to TheNCBIPath & "/include/util/regexp" -- for local pcre library
-		set headerPath to headerPath & " " & TheNCBIPath & "/include"
-		
-		set pack to {TheFLTKPath, TheBDBPath, ThePCREPath}
-		
-		repeat with p in pack -- add all paths to headers
-			set headerPath to headerPath & " " & p & "/include"
-			set libraryPath to libraryPath & " " & p & "/lib"
-		end repeat
-		
-		set libraryPath to libraryPath & " " & TheOUTPath & "/lib"
-		
-		set |HEADER_SEARCH_PATHS| of buildSettingsDebug to headerPath
-		set |HEADER_SEARCH_PATHS| of buildSettingsRelease to headerPath
-		
-		set |LIBRARY_SEARCH_PATHS| of buildSettingsDebug to libraryPath
-		set |LIBRARY_SEARCH_PATHS| of buildSettingsRelease to libraryPath
-		
-		set PCH to x_Replace(TheNCBIPath, ":", "/") & "/include/ncbi_pch.hpp"
-		set |GCC_PREFIX_HEADER| of buildSettingsDebug to PCH
-		set |GCC_PREFIX_HEADER| of buildSettingsRelease to PCH
-		
-		(* no-permissive flag for GCC *)
-		set |OTHER_CPLUSPLUSFLAGS| of buildSettingsDebug to "-fno-permissive"
-		set |OTHER_CPLUSPLUSFLAGS| of buildSettingsDebug to "-fno-permissive"
-		
-		(* Output directories and intermidiate files (works staring xCode 1.5) *)
-		set |OBJROOT| of buildSettingsDebug to TheOUTPath
-		set |OBJROOT| of buildSettingsRelease to TheOUTPath
-		
-		(* Set other options *)
-		if zeroLink then
-			set |ZERO_LINK| of buildSettingsDebug to "YES"
-		end if
-		
-		if fixContinue then
-			set |GCC_ENABLE_FIX_AND_CONTINUE| of buildSettingsDebug to "YES"
-		end if
-		
-		
-		set newProject to emptyProject
-		set objValues to {}
-		set objKeys to {}
-		
-		set refFileCount to 1
-		set allDepList to {}
-		set libDepList to {}
-		set appDepList to {}
-		
-		if xcodeTarget is 1 then
-			copy "BUILDSTYLE__Development" to the end of projectBuildStyles
-			copy "BUILDSTYLE__Deployment" to the end of projectBuildStyles
-		else
-			copy "BUILDSTYLE__Deployment" to the end of projectBuildStyles
-		end if
-		
-		
-		set |buildStyles| of rootObject to projectBuildStyles
-		
-		addPair(mainGroup, "MAINGROUP")
-		
-		addPair(buildStyleRelease, "BUILDSTYLE__Deployment")
-		if xcodeTarget is 1 then
-			set |GCC_GENERATE_DEBUGGING_SYMBOLS| of |buildSettings| of rootObject to "YES"
-			--property rootObject : {isa:"PBXProject", |hasScannedForEncodings|:"1", |mainGroup|:"MAINGROUP", |targets|:{}, |buildSettings|:{|name|:"NCBI"}, |buildStyles|:{}}
-			addPair(buildStyleDebug, "BUILDSTYLE__Development")
-		end if
-		
-		
-		set |objectVersion| of newProject to "42"
-		
-		
-		log "Done initialize ProjBuilder"
-	end Initialize
-	
-	
-	on MakeNewTarget(target_info, src_files, hdr_files, aTarget, aProduct, aType)
-		set tgName to name of target_info
-		set fullTargetName to tgName
-		if aType is equal to 0 then set fullTargetName to "lib" & tgName -- Library
-		set targetName to "TARGET__" & tgName
-		set targetProxy to "PROXY__" & tgName
-		set buildPhaseName to "BUILDPHASE__" & tgName
-		set prodRefName to "PRODUCT__" & tgName
-		set depName to "DEPENDENCE__" & tgName
-		set tgNameH to tgName & "H"
-		
-		set targetDepList to {} -- dependencies for this target
-		try -- set dependencies (if any)
-			set depString to dep of target_info
-			set depList to x_Str2List(depString)
-			
-			repeat with d in depList
-				if d is "datatool" then copy "DEPENDENCE__" & d to the end of targetDepList
-			end repeat
-		end try
-		
-		copy depName to the end of allDepList -- store a dependency for use in master target: Build All
-		if aType is equal to 0 then copy depName to the end of libDepList -- Library
-		if aType is equal to 1 then copy depName to the end of appDepList -- Application
-		--if aType equals 2 then copy depName to the end of testDepList -- Tests
-		
-		-- Add to proper lists
-		copy targetName to the end of |targets| of rootObject
-		copy tgName to the end of children of sources
-		copy tgNameH to the end of children of headers
-		
-		set libDepend to {isa:"PBXTargetDependency", |target|:targetName} --, |targetProxy|:targetProxy}
-		--set aProxy to {isa:"PBXContainerItemProxy", |proxyType|:"1", |containerPortal|:"ROOT_OBJECT", |remoteInfo|:fullTargetName} --|remoteGlobalIDString|:targetName}
-		
-		set buildFileRefs to {}
-		set libFileRefs to {}
-		-- Add Source Files
-		repeat with F in src_files
-			set nameRef to "FILE" & refFileCount
-			set nameBuild to "REF_FILE" & refFileCount
-			
-			set filePath to F --"/" & x_Replace(f, ":", "/") -- f will contain something like "users:vlad:c++:src:corelib:ncbicore.cpp"
-			set fileName to x_FileNameFromPath(F)
-			
-			--set first_char to first character of fileName
-			--considering case
-			--set valid_idx to offset of first_char in upper_alphabet
-			--end considering
-			
-			--if valid_idx is 0 then -- no capital first letters!
-			if fileName ends with ".cpp" then
-				set fileType to "sourcecode.cpp.cpp"
-			else
-				set fileType to "sourcecode.c.c"
-			end if
-			
-			set fileRef to {isa:"PBXFileReference", |lastKnownFileType|:fileType, |name|:fileName, |path|:filePath, |sourceTree|:"<absolute>"}
-			set fileBuild to {isa:"PBXBuildFile", |fileRef|:nameRef}
-			
-			addPair(fileRef, nameRef)
-			addPair(fileBuild, nameBuild)
-			copy nameBuild to the end of buildFileRefs
-			copy nameRef to the end of libFileRefs
-			
-			set refFileCount to refFileCount + 1
-			--end if
-			--if refFileCount = 3 then exit repeat
-			--log f
-		end repeat
-		
-		
-		-- Add Header Files
-		set hdrFileRefs to {}
-		repeat with F in hdr_files
-			set nameRef to "FILE" & refFileCount
-			set filePath to F
-			set fileName to x_FileNameFromPath(F)
-			if fileName ends with ".hpp" then
-				set fileType to "sourcecode.hpp.hpp"
-			else
-				set fileType to "sourcecode.h.h"
-			end if
-			
-			set fileRef to {isa:"PBXFileReference", |lastKnownFileType|:fileType, |name|:fileName, |path|:filePath, |sourceTree|:"<absolute>"}
-			addPair(fileRef, nameRef)
-			copy nameRef to the end of hdrFileRefs
-			set refFileCount to refFileCount + 1
-		end repeat
-		
-		set libGroup to {isa:"PBXGroup", |name|:tgName, children:libFileRefs, |refType|:"4"}
-		set hdrGroup to {isa:"PBXGroup", |name|:tgName, children:hdrFileRefs, |refType|:"4"}
-		
-		set aBuildPhase to {isa:"PBXSourcesBuildPhase", |files|:buildFileRefs}
-		
-		set |productReference| of aTarget to prodRefName
-		set dependencies of aTarget to targetDepList
-		
-		-- Go through the lis of libraries and chech ASN1 dependency. Add a script phase and generate a datatool dep for each one of it.
-		try -- generated from ASN?
-			set subLibs to the libs of target_info
-			set needDatatoolDep to false
-			set ASNPaths to {}
-			set ASNNames to {}
-			
-			repeat with theSubLib in subLibs
-				try
-					set asn1 to asn1 of theSubLib
-					set needDatatoolDep to true
-					set oneAsnPath to path of theSubLib
-					--set oneAsnName to last word of oneAsnPath
-					set oneAsnName to do shell script "ruby -e \"s='" & oneAsnPath & "'; puts s.split(':')[1]\""
-					try
-						set oneAsnName to asn1Name of theSubLib -- have a special ASN name?
-					end try
-					
-					copy oneAsnPath to the end of ASNPaths -- store all paths to asn files
-					copy oneAsnName to the end of ASNNames -- store all names of asn files; Use either folder name or ASN1Name if provided
-				end try
-			end repeat
-			
-			if needDatatoolDep then -- add dependency to a data tool (when asn1 is true for at least sublibrary)
-				copy "DEPENDENCE__datatool" to the end of dependencies of aTarget
-				
-				set shellScript to x_GenerateDatatoolScript(ASNPaths, ASNNames)
-				--log shellScript
-				
-				-- Now add a new script build phase to regenerate dataobjects
-				set scriptPhaseName to "SCRIPTPHASE__" & tgName
-				set aScriptPhase to {isa:"PBXShellScriptBuildPhase", |files|:{}, |inputPaths|:{}, |outputPaths|:{}, |shellPath|:"/bin/sh", |shellScript|:shellScript}
-				
-				copy scriptPhaseName to the beginning of |buildPhases| of aTarget -- shell script phase goes first (before compiling)
-				addPair(aScriptPhase, scriptPhaseName)
-			end if
-		end try
-		
-		
-		(* Create a shell script phase to copy GBENCH Resources here *)
-		try
-			set tmp to gbench of target_info
-			set shellScript to x_CopyGBENCHResourses()
-			set scriptPhaseName to "SCRIPTPHASE__" & tgName
-			set aScriptPhase to {isa:"PBXShellScriptBuildPhase", |files|:{}, |inputPaths|:{}, |outputPaths|:{}, |shellPath|:"/bin/sh", |shellScript|:shellScript}
-			
-			copy scriptPhaseName to the end of |buildPhases| of aTarget -- shell script phase goes first (before compiling)
-			addPair(aScriptPhase, scriptPhaseName)
-		end try -- Create a GBENCH Resources
-		
-		
-		(* Create a shell script phase to add resource fork for gbench_feedback app *)
-		if tgName is "gbench_feedback_agent" then
-			set shellScript to "cd \"$TARGET_BUILD_DIR\"" & ret & "$SYSTEM_DEVELOPER_TOOLS/Rez -t APPL " & TheFLTKPath & "/include/FL/mac.r -o $EXECUTABLE_NAME"
-			set scriptPhaseName to "SCRIPTPHASE__" & tgName
-			set aScriptPhase to {isa:"PBXShellScriptBuildPhase", |files|:{}, |inputPaths|:{}, |outputPaths|:{}, |shellPath|:"/bin/sh", |shellScript|:shellScript}
-			copy scriptPhaseName to the end of |buildPhases| of aTarget -- shell script phase goes first (before compiling)
-			addPair(aScriptPhase, scriptPhaseName)
-		end if -- Create a Resources Fork
-		
-		
-		-- add to main object list
-		addPair(aTarget, targetName)
-		--addPair(aProxy, targetProxy)
-		addPair(libDepend, depName)
-		addPair(aProduct, prodRefName)
-		addPair(aBuildPhase, buildPhaseName)
-		
-		addPair(libGroup, tgName)
-		addPair(hdrGroup, tgNameH)
-	end MakeNewTarget
-	
-	
-	on MakeNewLibraryTarget(lib_info, src_files, hdr_files)
-		set libName to name of lib_info
-		set targetName to "TARGET__" & libName
-		set buildPhaseName to "BUILDPHASE__" & libName
-		
-		set installPath to TheOUTPath & "/lib" --"/Users/lebedev/Projects/tmp3"
-		set linkerFlags to "" --  -flat_namespace -undefined suppress" -- warning -- additional liker flags (like -lxncbi)
-		set symRoot to TheOUTPath & "/lib"
-		
-		-- build DLLs by default
-		set libraryStyle to "DYNAMIC"
-		set fullLibName to "lib" & libName
-		set libProdType to "com.apple.product-type.library.dynamic"
-		
-		set isBundle to false
-		try -- are we building a loadable module?
-			if bundle of lib_info then set libraryStyle to "DYNAMIC" --"BUNDLE"
-			set linkerFlags to "" -- do not suppress undefined symbols. Bundles should be fully resolved
-			--set linkerFlags to "-framework Carbon -framework AGL -framework OpenGL"
-			set symRoot to TheOUTPath & "/bin/$(CONFIGURATION)/Genome Workbench.app/Contents/MacOS/plugins"
-			set isBundle to true
-		end try
-		
-		if libTypeDLL is false and isBundle is false then -- build as static			
-			set libraryStyle to "STATIC"
-			set fullLibName to libName
-			set libProdType to "com.apple.product-type.library.static"
-		end if
-		
-		
-		set linkerFlags to linkerFlags & x_CreateLinkerFlags(lib_info) -- additional liker flags (like -lxncbi)
-		
-		set buildSettings to {|LIB_COMPATIBILITY_VERSION|:"1", |DYLIB_CURRENT_VERSION|:"1", |INSTALL_PATH|:installPath, |LIBRARY_STYLE|:libraryStyle, |PRODUCT_NAME|:fullLibName, |OTHER_LDFLAGS|:linkerFlags, |SYMROOT|:symRoot, |TARGET_BUILD_DIR|:symRoot}
-		set libTarget to {isa:"PBXNativeTarget", |buildPhases|:{buildPhaseName}, |buildSettings|:buildSettings, |name|:fullLibName, |productReference|:"", |productType|:libProdType, dependencies:{}}
-		
-		my MakeNewTarget(lib_info, src_files, hdr_files, libTarget, libProduct, 0) -- 0 is library
-	end MakeNewLibraryTarget
-	
-	
-	on MakeNewToolTarget(tool_info, src_files, hdr_files)
-		set toolName to name of tool_info
-		set targetName to "TARGET__" & toolName
-		set buildPhaseName to "BUILDPHASE__" & toolName
-		set fullToolName to toolName -- "app_" & toolName
-		
-		set linkerFlags to x_CreateLinkerFlags(tool_info) -- additional liker flags (like -lxncbi)
-		
-		set symRoot to TheOUTPath & "/bin"
-		set buildSettings to {|PRODUCT_NAME|:fullToolName, |OTHER_LDFLAGS|:linkerFlags, |SYMROOT|:symRoot}
-		if toolName is "gbench_plugin_scan" or toolName is "gbench_monitor" or toolName is "gbench_feedback_agent" or toolName is "gbench_cache_agent" then
-			set symRoot to TheOUTPath & "/bin/$(CONFIGURATION)/Genome Workbench.app/Contents/MacOS"
-			set |SYMROOT| of buildSettings to symRoot
-			set buildSettings to buildSettings & {|TARGET_BUILD_DIR|:symRoot}
-		end if
-		set toolTarget to {isa:"PBXNativeTarget", |buildPhases|:{buildPhaseName}, |buildSettings|:buildSettings, |name|:fullToolName, |productReference|:"", |productType|:"com.apple.product-type.tool", dependencies:{}}
-		
-		my MakeNewTarget(tool_info, src_files, hdr_files, toolTarget, toolProduct, 2) -- is a tool
-	end MakeNewToolTarget
-	
-	
-	
-	on MakeNewAppTarget(app_info, src_files, hdr_files)
-		set appName to name of app_info
-		set targetName to "TARGET__" & appName
-		set buildPhaseName to "BUILDPHASE__" & appName
-		--set fullAppName to "app_" & appName
-		
-		set linkerFlags to x_CreateLinkerFlags(app_info) -- additional liker flags (like -lxncbi)
-		
-		set symRoot to TheOUTPath & "/bin"
-		set buildSettings to {|PRODUCT_NAME|:appName, |OTHER_LDFLAGS|:linkerFlags, |REZ_EXECUTABLE|:"YES", |INFOPLIST_FILE|:"", |SYMROOT|:symRoot, |KEEP_PRIVATE_EXTERNS|:"YES", |GENERATE_MASTER_OBJECT_FILE|:"YES"}
-		set appTarget to {isa:"PBXNativeTarget", |buildPhases|:{buildPhaseName}, |buildSettings|:buildSettings, |name|:appName, |productReference|:"", |productType|:"com.apple.product-type.application", dependencies:{}}
-		
-		my MakeNewTarget(app_info, src_files, hdr_files, appTarget, appProduct, 1) -- 1 is application
-	end MakeNewAppTarget
-	
-	
-	
-	
-	(* Save everything *)
-	on SaveProjectFile()
-		(* Genome Workbench Disk Image *)
-		(* Add a shell script only target to create a standalone disk image for distribution *)
-		set shellScript to do shell script "cat " & TheNCBIPath & "/compilers/xCode/diskimage.tmpl"
-		
-		copy "TARGET__GBENCH_DISK" to the end of |targets| of rootObject
-		set aScriptPhase to {isa:"PBXShellScriptBuildPhase", |files|:{}, |inputPaths|:{}, |outputPaths|:{}, |runOnlyForDeploymentPostprocessing|:1, |shellPath|:"/bin/sh", |shellScript|:shellScript}
-		
-		set theTarget to {isa:"PBXAggregateTarget", |buildPhases|:{}, |buildSettings|:{|PRODUCT_NAME|:"Genome Workbench Disk Image", |none|:""}, dependencies:{}, |name|:"Genome Workbench Disk Image"}
-		copy "SCRIPTPHASE__GBENCH_DISK" to the beginning of |buildPhases| of theTarget
-		addPair(aScriptPhase, "SCRIPTPHASE__GBENCH_DISK")
-		addPair(theTarget, "TARGET__GBENCH_DISK")
-		addPair({isa:"PBXTargetDependency", |target|:"TARGET__GBENCH_DISK"}, "DEPENDENCE__GBENCH_DISK")
-		copy "DEPENDENCE__GBENCH_DISK" to the end of allDepList
-		
-		
-		(* Target: Build Everything *)
-		copy "TARGET__BUILD_APP" to the beginning of |targets| of rootObject
-		addPair({isa:"PBXAggregateTarget", |buildPhases|:{}, |buildSettings|:{|PRODUCT_NAME|:"Build All Applications", |none|:""}, dependencies:appDepList, |name|:"Build All Applications"}, "TARGET__BUILD_APP")
-		copy "TARGET__BUILD_LIB" to the beginning of |targets| of rootObject
-		addPair({isa:"PBXAggregateTarget", |buildPhases|:{}, |buildSettings|:{|PRODUCT_NAME|:"Build All Libraries", |none|:""}, dependencies:libDepList, |name|:"Build All Libraries"}, "TARGET__BUILD_LIB")
-		copy "TARGET__BUILD_ALL" to the beginning of |targets| of rootObject
-		addPair({isa:"PBXAggregateTarget", |buildPhases|:{}, |buildSettings|:{|PRODUCT_NAME|:"Build All", |none|:""}, dependencies:allDepList, |name|:"Build All"}, "TARGET__BUILD_ALL")
-		
-		
-		(* add frameworks*)
-		-- Carbon
-		copy "FW_CARBON" to the end of children of fworks
-		addPair({isa:"PBXFileReference", |lastKnownFileType|:"wrapper.framework", |name|:"Carbon.framework", |path|:"/System/Library/Frameworks/Carbon.framework", |refType|:"0", |sourceTree|:"<absolute>"}, "FW_CARBON")
-		-- OpenGL
-		copy "FW_OpenGL" to the end of children of fworks
-		addPair({isa:"PBXFileReference", |lastKnownFileType|:"wrapper.framework", |name|:"OpenGL.framework", |path|:"/System/Library/Frameworks/OpenGL.framework", |refType|:"0", |sourceTree|:"<absolute>"}, "FW_OpenGL")
-		copy "FW_CORESERVICES" to the end of children of fworks
-		addPair({isa:"PBXFileReference", |lastKnownFileType|:"wrapper.framework", |name|:"CoreServices.framework", |path|:"/System/Library/Frameworks/CoreServices.framework", |refType|:"0", |sourceTree|:"<absolute>"}, "FW_CORESERVICES")
-		
-		(* Add ROOT objects and groups *)
-		addPair(rootObject, "ROOT_OBJECT")
-		addPair(headers, "HEADERS")
-		addPair(sources, "SOURCES")
-		addPair(fworks, "FRAMEWORKS")
-		
-		
-		(* Create a record from two lists *)
-		set objects of newProject to CreateRecordFromList(objValues, objKeys)
-		
-		
-		
-		try -- create some folders
-			set shScript to "if test ! -d " & TheOUTPath & "/" & projFile & " ; then mkdir " & TheOUTPath & "/" & projFile & " ; fi"
-			do shell script shScript
-		end try
-		
-		set fullProjName to (TheOUTPath & "/" & projFile & "/project.pbxproj") as string
-		(* Call NSDictionary method to save data as XML property list *)
-		--call method "writeToFile:atomically:" of newProject with parameters {"/Users/lebedev/111.txt", "YES"}
-		--call method "writeToFile:atomically:" of newProject with parameters {"/Users/lebedev/!test.xcode/project.pbxproj", "YES"}
-		
-		call method "writeToFile:atomically:" of newProject with parameters {fullProjName, "YES"}
-		(*set the_file to open for access "users:lebedev:111.txt"
-		set hhh to read the_file as string
-		log hhh
-		close access the_file*)
-	end SaveProjectFile
-	
-	
-	(* Convinience method *)
-	on addPair(aObj, aKey)
-		copy aObj to the end of objValues
-		copy aKey to the end of objKeys
-	end addPair
-	
-	(* Workaround the AppleScript lack of variable property labels *)
-	on CreateRecordFromList(objs, keys)
-		return call method "dictionaryWithObjects:forKeys:" of class "NSDictionary" with parameters {objs, keys}
-	end CreateRecordFromList
-	
-	(*  Replace all occurances of "old" in the aString with "new" *)
-	on x_Replace(aString, old, new)
-		set OldDelims to AppleScript's text item delimiters
-		set AppleScript's text item delimiters to old
-		set newText to text items of aString
-		set AppleScript's text item delimiters to new
-		set finalText to newText as text
-		set AppleScript's text item delimiters to OldDelims
-		
-		return finalText
-	end x_Replace
-	
-	
-	(* convert a space-separated "aString" to a list *)
-	on x_Str2List(aString)
-		set OldDelims to AppleScript's text item delimiters
-		set AppleScript's text item delimiters to " "
-		set aList to every text item in aString
-		set AppleScript's text item delimiters to OldDelims
-		return aList
-	end x_Str2List
-	
-	
-	(* Get file name and extension from the full file path *)
-	on x_FileNameFromPath(fileNameWithPath)
-		set OldDelims to AppleScript's text item delimiters
-		set AppleScript's text item delimiters to "/"
-		set partsList to text items of fileNameWithPath
-		set AppleScript's text item delimiters to OldDelims
-		return the last item of partsList as string
-	end x_FileNameFromPath
-	
-	
-	(* Create a linker flags string based on dependencies and libs to link *)
-	on x_CreateLinkerFlags(info)
-		set linkFlags to ""
-		try -- set dependencies (if any)
-			set depString to dep of info
-			set depList to x_Str2List(depString)
-			
-			repeat with d in depList
-				set linkFlags to linkFlags & " -l" & d
-			end repeat
-		end try
-		
-		try -- set libraries to link (if any)
-			set libList to lib2link of info
-			repeat with d in libList
-				set linkFlags to linkFlags & " -l" & d
-			end repeat
-		end try
-		
-		try -- set frameworks
-			set fwString to fworks of info
-			set fwList to x_Str2List(fwString)
-			repeat with d in fwList
-				set linkFlags to linkFlags & " -framework " & d
-			end repeat
-		end try
-		return linkFlags
-	end x_CreateLinkerFlags
-	
-	
-	(* Creates a shell script to regenerate ASN files *)
-	on x_GenerateDatatoolScript(thePaths, theNames)
-		set theScript to "echo Updating $PRODUCT_NAME" & ret
-		set theScript to theScript & "" & ret
-		set idx to 1
-		repeat with aPath in thePaths
-			set asnName to item idx of theNames
-			set posixPath to x_Replace(aPath, ":", "/")
-			
-			set fullPath to TheNCBIPath & "/src/" & posixPath
-			
-			set theScript to theScript & "echo Working in: " & fullPath & ret
-			set theScript to theScript & "cd " & fullPath & ret
-			
-			set theScript to theScript & "if ! test -e " & asnName & ".files || find . -newer " & asnName & ".files | grep '.asn'; then" & ret
-			set theScript to theScript & "  m=\"" & asnName & "\"" & ret
-			
-			set theScript to theScript & "  echo Running Datatool" & ret
-			if asnName is "gui_project" or asnName is "data_handle" or asnName is "plugin" or asnName is "gbench_svc" or asnName is "seqalign_ext" then -- Should use sed properly here (but how?)
-				set theScript to theScript & "  M=\"$(grep ^MODULE_IMPORT $m.module | sed 's/^.*= *//' | sed 's/\\([/a-z0-9_]*\\)/\\1.asn/g')\"" & ret
-			else
-				set theScript to theScript & "  M=\"\"" & ret
-				set theScript to theScript & "  if test -e $m.module; then" & ret
-				set theScript to theScript & "    M=\"$(grep ^MODULE_IMPORT $m.module | sed 's/^.*= *//' | sed 's/\\(objects[/a-z0-9]*\\)/\\1.asn/g')\"" & ret
-				set theScript to theScript & "  fi" & ret
-			end if
-			
-			set theScript to theScript & "  " & TheOUTPath & "/bin/$CONFIGURATION/datatool -oR " & TheNCBIPath
-			
-			set theScript to theScript & " -opm " & TheNCBIPath & "/src  -m \"$m.asn\" -M \"$M\" -oA -of \"$m.files\" -or \"" & posixPath & "\" -oc \"$m\" -oex '' -ocvs -odi -od \"$m.def\"" & ret
-			set theScript to theScript & "else" & ret
-			set theScript to theScript & "  echo ASN files are up to date" & ret
-			set theScript to theScript & "fi" & ret & ret
-			
-			set idx to idx + 1
-		end repeat
-		
-		return theScript
-	end x_GenerateDatatoolScript
-	
-	
-	(* Creates a shell script to copy some additional files into GBENCH package *)
-	(* Can be replaced with Copy Files Build phase *)
-	on x_CopyGBENCHResourses()
-		set theScript to ""
-		set theScript to theScript & "echo Running GBench Plugin Scan" & ret
-		set theScript to theScript & "if test ! -e " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/plugins/plugin-cache ; then" & ret
-		set theScript to theScript & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/gbench_plugin_scan " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/plugins" & ret
-		set theScript to theScript & "fi" & ret
-		
-		set theScript to theScript & "echo Copying GBench resources" & ret
-		
-		-- Create etc directory
-		set theScript to theScript & "if test ! -d " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/etc ; then" & ret
-		set theScript to theScript & "  mkdir " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/etc" & ret
-		set theScript to theScript & "fi" & ret
-		
-		-- Create Resources directory
-		set theScript to theScript & "if test ! -d " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/Resources ; then" & ret
-		set theScript to theScript & "  mkdir " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/Resources" & ret
-		set theScript to theScript & "fi" & ret
-		
-		-- Create share directory
-		set theScript to theScript & "if test ! -d " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/share/gbench ; then" & ret
-		set theScript to theScript & "  mkdir " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/share" & ret
-		set theScript to theScript & "  mkdir " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/share/gbench" & ret
-		set theScript to theScript & "fi" & ret
-		
-		-- Create executables directory
-		--set theScript to theScript & "if test ! -d " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/executables ; then" & ret
-		--set theScript to theScript & "  mkdir " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/executables" & ret
-		--set theScript to theScript & "fi" & ret
-		
-		--set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/plugins/algo/executables/* " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/executables" & ret
-		
-		-- copy png images
-		set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/res/share/gbench/* " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/share/gbench" & ret
-		
-		-- copy Info.plist file
-		set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/res/share/gbench/Info.plist " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents" & ret
-		
-		-- copy Icon file
-		set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/res/share/gbench/gbench.icns " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/Resources/Genome\\ Workbench.icns" & ret
-		
-		set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/res/share/gbench/gbench_workspace.icns " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/Resources/gbench_workspace.icns" & ret
-		set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/res/share/gbench/gbench_project.icns " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/Resources/gbench_project.icns" & ret
-		
-		----set theScript to theScript & "cp -r " & TheNCBIPath & "/src/gui/plugins/algo/executables " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/executables" & ret
-		set theScript to theScript & "rm -rf " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/etc/*" & ret
-		set theScript to theScript & "cp -r " & TheNCBIPath & "/src/gui/res/etc/* " & TheOUTPath & "/bin/$CONFIGURATION/Genome\\ Workbench.app/Contents/MacOS/etc" & ret
-		--set theScript to theScript & "cp -r " & TheNCBIPath & "/src/gui/gbench/patterns/ " & TheOUTPath & "/bin/Genome\\ Workbench.app/Contents/MacOS/etc/patterns" & ret
-		--set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/gbench/news.ini " & TheOUTPath & "/bin/Genome\\ Workbench.app/Contents/MacOS/etc" & ret
-		--set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/gbench/gbench.ini " & TheOUTPath & "/bin/Genome\\ Workbench.app/Contents/MacOS/etc" & ret
-		--set theScript to theScript & "cp " & TheNCBIPath & "/src/gui/gbench/algo_urls " & TheOUTPath & "/bin/Genome\\ Workbench.app/Contents/MacOS/etc" & ret
-		
-		return theScript
-	end x_CopyGBENCHResourses
-end script
diff --git a/c++/compilers/xCode/cpp.icns b/c++/compilers/xCode/cpp.icns
deleted file mode 100644
index 195633b..0000000
Binary files a/c++/compilers/xCode/cpp.icns and /dev/null differ
diff --git a/c++/compilers/xCode/diskimage.tmpl b/c++/compilers/xCode/diskimage.tmpl
deleted file mode 100644
index 821f99d..0000000
--- a/c++/compilers/xCode/diskimage.tmpl
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh
-EXEC_PATH='@executable_path'
-
-if test -e gbench.dmg; then
-  echo Genome Workbench image already exists
-  exit 0
-fi
-
-pwd
-mkdir tmp
-cp -r bin/$CONFIGURATION/Genome\ Workbench.app  tmp
-
-echo Adding custom Icon
-cp tmp/Genome\ Workbench.app/Contents/MacOS/share/gbench/VolumeIcon.icns tmp/.VolumeIcon.icns
-
-cd tmp/Genome\ Workbench.app/Contents/MacOS
-
-echo Copy 3-rd party dylibs
-cp `otool -L Genome\ Workbench | awk '/(netopt)|(sw)/ {print $1}' ` .
-echo Copy NCBI dylibs
-cp ../../../../lib/* .
-
-chmod +w *
-
-echo Patch dylibs
-for i in `find . -name \*.dylib`; do
-     for j in `otool -L $i | awk '/(netopt)|(sw)|(Users)/ {print $1}'`; do
-         if ! test -e `basename $j`; then
-            echo Adding more libs: `basename $j`
-   		   cp $j .
-   		   chmod +w `basename $j`
-   		fi
-
-         install_name_tool -id $EXEC_PATH/`basename $j` $i
-         install_name_tool -change $j $EXEC_PATH/`basename $j` $i
-     done
-done
-
-echo Patch Genome Workbench
-for j in `otool -L 'Genome Workbench' | awk '/(netopt)|(sw)|(Users)/ {print $1}'`; do
-        install_name_tool -change $j $EXEC_PATH/`basename $j` 'Genome Workbench'
-done
-
-
-
-EXECS1="
- gbench_plugin_scan
- gbench_cache_agent"
-for exe in $EXECS1; do
-	echo Patching: $exe
-	for j in `otool -L $exe | awk '/(netopt)|(sw)|(Users)/ {print $1}'`; do
-	        install_name_tool -change $j $EXEC_PATH/`basename $j` $exe
-	done	
-done
-
-cd bin
-EXECS2="
- gbench_monitor
- gbench_feedback_agent"
-for exe in $EXECS2; do
-	echo Patching: $exe
-	for j in `otool -L $exe | awk '/(netopt)|(sw)|(Users)/ {print $1}'`; do
-	        install_name_tool -change $j $EXEC_PATH/`basename $j` $exe
-	done	
-done
-
-
-
-cd ../../../../../
-echo Creating disk image
-hdiutil create -srcfolder tmp  -volname GBENCH gbench.dmg
-
-
-
-rm -r tmp
-exit 0
diff --git a/c++/compilers/xCode/main.m b/c++/compilers/xCode/main.m
deleted file mode 100644
index a18d37d..0000000
--- a/c++/compilers/xCode/main.m
+++ /dev/null
@@ -1,40 +0,0 @@
-/*  $Id: main.m 103491 2007-05-04 17:18:18Z kazimird $
- * ===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Author:  Vlad Lebedev
- *
- * File Description:
- * Main startup file for AppleScript studio (xCode generated - do not modify)
- *
- */
-
-extern void ASKInitialize();
-extern int NSApplicationMain(int argc, const char *argv[]);
-
-int main(int argc, const char *argv[])
-{
-    ASKInitialize();
-    return NSApplicationMain(argc, argv);
-}
diff --git a/c++/compilers/xCode/thirdpartylibs.sh b/c++/compilers/xCode/thirdpartylibs.sh
deleted file mode 100755
index e9c7b66..0000000
--- a/c++/compilers/xCode/thirdpartylibs.sh
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/bin/sh
-
-if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
-  echo "Usage:"
-  echo "   thirdpartylib <NCBI C++ Toolkit directory> <Temporary working directory> <Installation directory>"
-  echo ""
-  echo "   example:"
-  echo "     thirdpartylib /Users/vlad/c++ /Users/vlad/tmp /Users/vlad/sw"
-  exit -1
-else
-  NCBICPP=$1
-  TEMP=$2
-  DEST=$3
-fi
-
-if [ -f $TEMP ]; then
-  echo "Temporary directory does not exist"
-  exit -1
-fi
-
-# jpegsrc.v6b*http://www.ijg.org/files
-
-LIBS="
- giflib-4.1.4*http://superb-east.dl.sourceforge.net/sourceforge/libungif
- libpng-1.2.8-config*superb-east.dl.sourceforge.net/sourceforge/libpng
- tiff-3.7.1*ftp://ftp.remotesensing.org/libtiff/old
- sqlite-2.8.16*http://www.sqlite.org
- db-4.4.20.NC*http://downloads.sleepycat.com
- fltk-1.1.6-source*http://superb-east.dl.sourceforge.net/sourceforge/fltk"
-
-
-cd $TEMP
-if [ "$4" = "download" ]; then
-	for lib in $LIBS; do
-		name=`echo $lib | awk -F* '{ print $1 }'` 
-		url=`echo $lib | awk -F* '{ print $2 }'` 
-
-		filename=$name".tar.gz"
-		fullurl=$url"/"$filename
-		echo Downloading: $filename from $url
-		`curl --disable-epsv -o $TEMP/$filename $fullurl`
-		if [ "$?" != "0" ]; then  
-			echo Could not download $filename
-			exit -1 
-		fi
-		echo $filename downloaded successfully
-	done
-	echo All libraries downloaded!
-fi 
-
-
-cd $TEMP
-for lib in $LIBS; do
-	name=`echo $lib | awk -F* '{ print $1 }'` 
-	filename=$name".tar.gz"
-	echo Processing $filename
-	
-	conf="--prefix="$DEST
-	echo Unpacking $filename
-	tar -xzvf $filename
-	
-	# Apply NCBI patches to FLTK
-	if [ $name = "fltk-1.1.6-source" ]; then
-		name="fltk-1.1.6"
-		cd $name
-		echo "Applying patch: level 5"
-		patch -p1 <$NCBICPP/src/gui/patches/fltk/fltk-1.1.6-ncbi5.patch
-		
-		conf="--prefix="$DEST" --enable-debug --enable-shared --enable-threads --disable-localpng --disable-localjpeg --disable-localzlib"
-		CPPFLAGS="-I$DEST/include"
-		LDFLAGS="-L$DEST/lib -lstdc++"
-		CFLAGS=$CPPFLAGS
-		CXXFLAGS="$CPPFLAGS $LDFLAGS"
-		export CPPFLAGS LDFLAGS CFLAGS CXXFLAGS
-		cd $TEMP
-	fi
-	
-	if [ $name = "giflib-4.1.4" ]; then
-		conf="--prefix="$DEST" --with-x=no"
-	fi
-    
-    if [ $name = "jpegsrc.v6b" ]; then
-        name="jpeg-6b"
-		conf="--prefix="$DEST" --enable-shared"
-    fi
-
-	
-	echo Configuring in $name
-	if [ $name = "db-4.4.20.NC" ]; then
-		cd $name/build_unix
-		../dist/configure $conf
-    else
-		cd $name
-		./configure $conf
-	fi
-	
-	echo Make and Install in $name
-	make
-    
-    # libjpeg makefiles are a little bit broken on Mac OS X. 
-    # a simple make install does not work. Copy everything manually.
-    if [ $name = "jpeg-6b" ]; then
-      cp jconfig.h $DEST/include
-      cp jmorecfg.h $DEST/include
-      cp jpeglib.h $DEST/include
-      cp libjpeg.a $DEST/lib
-      ranlib $DEST/lib/libjpeg.a 
-    else
-	  make install
-    fi
-    
-	if [ "$?" != "0" ]; then  
-		echo Error installing $filename. Check the log output.
-		exit -1 
-	fi
-	cd $TEMP
-done
-
-echo "All libraries were successfully installed"
-exit 0
diff --git a/c++/compilers/xCode/xCode.xcodeproj/project.pbxproj b/c++/compilers/xCode/xCode.xcodeproj/project.pbxproj
deleted file mode 100644
index 345aac8..0000000
--- a/c++/compilers/xCode/xCode.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,369 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 42;
-	objects = {
-
-/* Begin PBXAppleScriptBuildPhase section */
-		F06FD25009E54D9000F67958 /* AppleScript */ = {
-			isa = PBXAppleScriptBuildPhase;
-			buildActionMask = 2147483647;
-			contextName = "";
-			files = (
-				F06FD25109E54D9000F67958 /* Libraries.applescript in AppleScript */,
-				F06FD25209E54D9000F67958 /* ProjBuilder.applescript in AppleScript */,
-				F06FD25309E54D9000F67958 /* Application.applescript in AppleScript */,
-			);
-			isSharedContext = 0;
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXAppleScriptBuildPhase section */
-
-/* Begin PBXBuildFile section */
-		F030E3D8103C3342001B307A /* cpp.icns in Resources */ = {isa = PBXBuildFile; fileRef = F030E3D7103C3342001B307A /* cpp.icns */; };
-		F06FD25109E54D9000F67958 /* Libraries.applescript in AppleScript */ = {isa = PBXBuildFile; fileRef = F0F4E06A0652773A008D56E6 /* Libraries.applescript */; settings = {ATTRIBUTES = (Debug, ); }; };
-		F06FD25209E54D9000F67958 /* ProjBuilder.applescript in AppleScript */ = {isa = PBXBuildFile; fileRef = F0056E3B0653CFB000CFCECD /* ProjBuilder.applescript */; settings = {ATTRIBUTES = (Debug, ); }; };
-		F06FD25309E54D9000F67958 /* Application.applescript in AppleScript */ = {isa = PBXBuildFile; fileRef = F0F2A05306899A9200D57C93 /* Application.applescript */; settings = {ATTRIBUTES = (Debug, ); }; };
-		F06FD25509E54D9000F67958 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
-		F06FD25609E54D9000F67958 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
-		F06FD25709E54D9000F67958 /* InstallLibsPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = F018F27307F19F3500903A2C /* InstallLibsPanel.nib */; };
-		F06FD25909E54D9000F67958 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
-		F06FD25B09E54D9000F67958 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
-		F06FD25C09E54D9000F67958 /* AppleScriptKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA206CF1015C4E2903C91932 /* AppleScriptKit.framework */; };
-		F06FD26909E54E5000F67958 /* Info-Xcode.plist in Resources */ = {isa = PBXBuildFile; fileRef = F06FD26809E54E5000F67958 /* Info-Xcode.plist */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
-		089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
-		1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
-		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
-		29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
-		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
-		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
-		DA206CF1015C4E2903C91932 /* AppleScriptKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppleScriptKit.framework; path = /System/Library/Frameworks/AppleScriptKit.framework; sourceTree = "<absolute>"; };
-		DA206CF4015C4E8B03C91932 /* AppleScriptKit.asdictionary */ = {isa = PBXFileReference; lastKnownFileType = archive.asdictionary; name = AppleScriptKit.asdictionary; path = /System/Library/Frameworks/AppleScriptKit.framework/Versions/A/Resources/AppleScriptKit.asdictionary; sourceTree = "<absolute>"; };
-		F0056E3B0653CFB000CFCECD /* ProjBuilder.applescript */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.applescript; path = ProjBuilder.applescript; sourceTree = "<group>"; };
-		F018F27407F19F3500903A2C /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/InstallLibsPanel.nib; sourceTree = "<group>"; };
-		F030E3D7103C3342001B307A /* cpp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = cpp.icns; sourceTree = "<group>"; };
-		F06FD25E09E54D9000F67958 /* NCBI Xcode Project Builder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "NCBI Xcode Project Builder.app"; sourceTree = BUILT_PRODUCTS_DIR; };
-		F06FD26809E54E5000F67958 /* Info-Xcode.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "Info-Xcode.plist"; sourceTree = "<group>"; };
-		F0F2A05306899A9200D57C93 /* Application.applescript */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.applescript; path = Application.applescript; sourceTree = "<group>"; };
-		F0F4E06A0652773A008D56E6 /* Libraries.applescript */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.applescript; path = Libraries.applescript; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		F06FD25A09E54D9000F67958 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				F06FD25B09E54D9000F67958 /* Cocoa.framework in Frameworks */,
-				F06FD25C09E54D9000F67958 /* AppleScriptKit.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		080E96DDFE201D6D7F000001 /* Scripts */ = {
-			isa = PBXGroup;
-			children = (
-				F0F2A05306899A9200D57C93 /* Application.applescript */,
-				F0F4E06A0652773A008D56E6 /* Libraries.applescript */,
-				F0056E3B0653CFB000CFCECD /* ProjBuilder.applescript */,
-			);
-			name = Scripts;
-			sourceTree = "<group>";
-		};
-		1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
-				DA206CF1015C4E2903C91932 /* AppleScriptKit.framework */,
-			);
-			name = "Linked Frameworks";
-			sourceTree = "<group>";
-		};
-		1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				29B97325FDCFA39411CA2CEA /* Foundation.framework */,
-				29B97324FDCFA39411CA2CEA /* AppKit.framework */,
-			);
-			name = "Other Frameworks";
-			sourceTree = "<group>";
-		};
-		19C28FACFE9D520D11CA2CBB /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				F06FD26809E54E5000F67958 /* Info-Xcode.plist */,
-				F06FD25E09E54D9000F67958 /* NCBI Xcode Project Builder.app */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		29B97314FDCFA39411CA2CEA /* Application */ = {
-			isa = PBXGroup;
-			children = (
-				080E96DDFE201D6D7F000001 /* Scripts */,
-				29B97317FDCFA39411CA2CEA /* Resources */,
-				29B97315FDCFA39411CA2CEA /* Other Sources */,
-				29B97323FDCFA39411CA2CEA /* Frameworks */,
-				19C28FACFE9D520D11CA2CBB /* Products */,
-			);
-			name = Application;
-			sourceTree = "<group>";
-		};
-		29B97315FDCFA39411CA2CEA /* Other Sources */ = {
-			isa = PBXGroup;
-			children = (
-				29B97316FDCFA39411CA2CEA /* main.m */,
-			);
-			name = "Other Sources";
-			sourceTree = "<group>";
-		};
-		29B97317FDCFA39411CA2CEA /* Resources */ = {
-			isa = PBXGroup;
-			children = (
-				F030E3D7103C3342001B307A /* cpp.icns */,
-				F018F27307F19F3500903A2C /* InstallLibsPanel.nib */,
-				29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
-				089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
-				DA206CF4015C4E8B03C91932 /* AppleScriptKit.asdictionary */,
-			);
-			name = Resources;
-			sourceTree = "<group>";
-		};
-		29B97323FDCFA39411CA2CEA /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
-				1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-		F06FD24F09E54D9000F67958 /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
-		F06FD24E09E54D9000F67958 /* Xcode Project Generator */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = F0BB06D71031C2AE00B9525E /* Build configuration list for PBXNativeTarget "Xcode Project Generator" */;
-			buildPhases = (
-				F06FD24F09E54D9000F67958 /* Headers */,
-				F06FD25009E54D9000F67958 /* AppleScript */,
-				F06FD25409E54D9000F67958 /* Resources */,
-				F06FD25809E54D9000F67958 /* Sources */,
-				F06FD25A09E54D9000F67958 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = "Xcode Project Generator";
-			productInstallPath = "$(HOME)/Applications";
-			productName = Application;
-			productReference = F06FD25E09E54D9000F67958 /* NCBI Xcode Project Builder.app */;
-			productType = "com.apple.product-type.application";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		29B97313FDCFA39411CA2CEA /* Project object */ = {
-			isa = PBXProject;
-			buildConfigurationList = F0BB06D61031C2AE00B9525E /* Build configuration list for PBXProject "xCode" */;
-			compatibilityVersion = "Xcode 2.4";
-			hasScannedForEncodings = 1;
-			mainGroup = 29B97314FDCFA39411CA2CEA /* Application */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				F06FD24E09E54D9000F67958 /* Xcode Project Generator */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-		F06FD25409E54D9000F67958 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				F06FD25509E54D9000F67958 /* MainMenu.nib in Resources */,
-				F06FD25609E54D9000F67958 /* InfoPlist.strings in Resources */,
-				F06FD25709E54D9000F67958 /* InstallLibsPanel.nib in Resources */,
-				F06FD26909E54E5000F67958 /* Info-Xcode.plist in Resources */,
-				F030E3D8103C3342001B307A /* cpp.icns in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		F06FD25809E54D9000F67958 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				F06FD25909E54D9000F67958 /* main.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
-		089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
-			isa = PBXVariantGroup;
-			children = (
-				089C165DFE840E0CC02AAC07 /* English */,
-			);
-			name = InfoPlist.strings;
-			sourceTree = "<group>";
-		};
-		29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
-			isa = PBXVariantGroup;
-			children = (
-				29B97319FDCFA39411CA2CEA /* English */,
-			);
-			name = MainMenu.nib;
-			sourceTree = "<group>";
-		};
-		F018F27307F19F3500903A2C /* InstallLibsPanel.nib */ = {
-			isa = PBXVariantGroup;
-			children = (
-				F018F27407F19F3500903A2C /* English */,
-			);
-			name = InstallLibsPanel.nib;
-			sourceTree = "<group>";
-		};
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
-		F0BB06D01031C2AE00B9525E /* Development */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-			};
-			name = Development;
-		};
-		F0BB06D11031C2AE00B9525E /* Deployment */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-			};
-			name = Deployment;
-		};
-		F0BB06D21031C2AE00B9525E /* Default */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-			};
-			name = Default;
-		};
-		F0BB06D31031C2AE00B9525E /* Development */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-				FRAMEWORK_SEARCH_PATHS = "";
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
-				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-				GCC_MODEL_CPU = G4;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				HEADER_SEARCH_PATHS = "";
-				INFOPLIST_FILE = "Info-Xcode.plist";
-				INSTALL_PATH = "$(HOME)/Applications";
-				LIBRARY_SEARCH_PATHS = "";
-				OTHER_CFLAGS = "";
-				OTHER_LDFLAGS = "";
-				PRODUCT_NAME = "NCBI Xcode Project Builder";
-				SECTORDER_FLAGS = "";
-				WARNING_CFLAGS = (
-					"-Wmost",
-					"-Wno-four-char-constants",
-					"-Wno-unknown-pragmas",
-				);
-				WRAPPER_EXTENSION = app;
-				ZERO_LINK = YES;
-			};
-			name = Development;
-		};
-		F0BB06D41031C2AE00B9525E /* Deployment */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = YES;
-				FRAMEWORK_SEARCH_PATHS = "";
-				GCC_ENABLE_FIX_AND_CONTINUE = NO;
-				HEADER_SEARCH_PATHS = "";
-				INFOPLIST_FILE = "Info-Xcode.plist";
-				INSTALL_PATH = "$(HOME)/Applications";
-				LIBRARY_SEARCH_PATHS = "";
-				OTHER_CFLAGS = "";
-				OTHER_LDFLAGS = "";
-				OTHER_OSAFLAGS = "-x";
-				PRODUCT_NAME = "NCBI Xcode Project Builder";
-				SECTORDER_FLAGS = "";
-				WARNING_CFLAGS = (
-					"-Wmost",
-					"-Wno-four-char-constants",
-					"-Wno-unknown-pragmas",
-				);
-				WRAPPER_EXTENSION = app;
-				ZERO_LINK = NO;
-			};
-			name = Deployment;
-		};
-		F0BB06D51031C2AE00B9525E /* Default */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				FRAMEWORK_SEARCH_PATHS = "";
-				HEADER_SEARCH_PATHS = "";
-				INFOPLIST_FILE = "Info-Xcode.plist";
-				INSTALL_PATH = "$(HOME)/Applications";
-				LIBRARY_SEARCH_PATHS = "";
-				OTHER_CFLAGS = "";
-				OTHER_LDFLAGS = "";
-				PRODUCT_NAME = "NCBI Xcode Project Builder";
-				SECTORDER_FLAGS = "";
-				WARNING_CFLAGS = (
-					"-Wmost",
-					"-Wno-four-char-constants",
-					"-Wno-unknown-pragmas",
-				);
-				WRAPPER_EXTENSION = app;
-			};
-			name = Default;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		F0BB06D61031C2AE00B9525E /* Build configuration list for PBXProject "xCode" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				F0BB06D01031C2AE00B9525E /* Development */,
-				F0BB06D11031C2AE00B9525E /* Deployment */,
-				F0BB06D21031C2AE00B9525E /* Default */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Default;
-		};
-		F0BB06D71031C2AE00B9525E /* Build configuration list for PBXNativeTarget "Xcode Project Generator" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				F0BB06D31031C2AE00B9525E /* Development */,
-				F0BB06D41031C2AE00B9525E /* Deployment */,
-				F0BB06D51031C2AE00B9525E /* Default */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Default;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
diff --git a/c++/compilers/xcode30_prj/configure b/c++/compilers/xcode30_prj/configure
index 1e467fc..6ea67b6 100755
--- a/c++/compilers/xcode30_prj/configure
+++ b/c++/compilers/xcode30_prj/configure
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $Id: configure 470941 2015-06-22 02:15:08Z ucko $
+# $Id: configure 474742 2015-07-31 13:01:07Z gouriano $
 # Author:  Andrei Gourianov, NCBI (gouriano at ncbi.nlm.nih.gov)
 
 #-----------------------------------------------------------------------------
@@ -335,6 +335,7 @@ else
     fi
   fi
 fi
+conf="$CONFIGURATION"
 if test "$use_gui" = "yes"; then
   PTB_FLAGS="$PTB_FLAGS -cfg"
 fi
diff --git a/c++/compilers/xcode30_prj/copyutl.sh b/c++/compilers/xcode30_prj/copyutl.sh
new file mode 100755
index 0000000..432cfb6
--- /dev/null
+++ b/c++/compilers/xcode30_prj/copyutl.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+# $Id: copyutl.sh 471605 2015-06-29 18:57:23Z gouriano $
+# ===========================================================================
+# 
+#                            PUBLIC DOMAIN NOTICE
+#               National Center for Biotechnology Information
+# 
+#  This software/database is a "United States Government Work" under the
+#  terms of the United States Copyright Act.  It was written as part of
+#  the author's official duties as a United States Government employee and
+#  thus cannot be copyrighted.  This software/database is freely available
+#  to the public for use. The National Library of Medicine and the U.S.
+#  Government have not placed any restriction on its use or reproduction.
+# 
+#  Although all reasonable efforts have been taken to ensure the accuracy
+#  and reliability of the software and data, the NLM and the U.S.
+#  Government do not and cannot warrant the performance or results that
+#  may be obtained by using this software or data. The NLM and the U.S.
+#  Government disclaim all warranties, express or implied, including
+#  warranties of performance, merchantability or fitness for any particular
+#  purpose.
+# 
+#  Please cite the author in any work or product based on this material.
+#  
+# ===========================================================================
+# 
+# Author:  Andrei Gourianov, NCBI (gouriano at ncbi.nlm.nih.gov)
+#
+# Copy binaries into bin directory
+#
+# DO NOT ATTEMPT to run this script manually
+# ===========================================================================
+
+for v in "$BUILD_TREE_BIN" "$BUILD_TREE_ROOT"; do
+  if test "$v" = ""; then
+    echo ERROR: required environment variable is missing
+    echo DO NOT ATTEMPT to run this script manually
+    exit 1
+  fi
+done
+
+test -d "${PROJECT_DIR}/../${BUILD_TREE_BIN}" || mkdir -p "${PROJECT_DIR}/../${BUILD_TREE_BIN}"
+cp -f -p -R ${PROJECT_DIR}/${BUILD_TREE_BIN}/* "${PROJECT_DIR}/../${BUILD_TREE_BIN}"
+exit 0
diff --git a/c++/compilers/xcode30_prj/datatool.sh b/c++/compilers/xcode30_prj/datatool.sh
index bc9f5f0..ee141bc 100755
--- a/c++/compilers/xcode30_prj/datatool.sh
+++ b/c++/compilers/xcode30_prj/datatool.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: datatool.sh 472266 2015-07-08 17:20:47Z ivanov $
+# $Id: datatool.sh 471603 2015-06-29 18:48:10Z ucko $
 # ===========================================================================
 # 
 #                            PUBLIC DOMAIN NOTICE
diff --git a/c++/compilers/xcode30_prj/ptb.sh b/c++/compilers/xcode30_prj/ptb.sh
index de829e8..d8e8cba 100755
--- a/c++/compilers/xcode30_prj/ptb.sh
+++ b/c++/compilers/xcode30_prj/ptb.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: ptb.sh 472266 2015-07-08 17:20:47Z ivanov $
+# $Id: ptb.sh 471603 2015-06-29 18:48:10Z ucko $
 # ===========================================================================
 # 
 #                            PUBLIC DOMAIN NOTICE
diff --git a/c++/compilers/xcode30_prj/static/UtilityProjects/PTB.xcodeproj/project.pbxproj b/c++/compilers/xcode30_prj/static/UtilityProjects/PTB.xcodeproj/project.pbxproj
index e4747eb..3b6a417 100644
--- a/c++/compilers/xcode30_prj/static/UtilityProjects/PTB.xcodeproj/project.pbxproj
+++ b/c++/compilers/xcode30_prj/static/UtilityProjects/PTB.xcodeproj/project.pbxproj
@@ -2526,7 +2526,7 @@
         <key>shellPath</key>
         <string>/bin/sh</string>
         <key>shellScript</key>
-        <string>export BUILD_TREE_ROOT=../..&#xa;export BUILD_TREE_BIN=bin/${CONFIGURATION}&#xa;"$BUILD_TREE_ROOT/copybin.sh"</string>
+        <string>export BUILD_TREE_ROOT=../..&#xa;export BUILD_TREE_BIN=bin/${CONFIGURATION}&#xa;"$BUILD_TREE_ROOT/copybin.sh"&#xa;"$BUILD_TREE_ROOT/copyutl.sh"</string>
         <key>showEnvVarsInLog</key>
         <string>0</string>
       </dict>
@@ -4441,7 +4441,7 @@
         <key>shellPath</key>
         <string>/bin/sh</string>
         <key>shellScript</key>
-        <string>export BUILD_TREE_ROOT=../..&#xa;export BUILD_TREE_BIN=bin/${CONFIGURATION}&#xa;"$BUILD_TREE_ROOT/copybin.sh"</string>
+        <string>export BUILD_TREE_ROOT=../..&#xa;export BUILD_TREE_BIN=bin/${CONFIGURATION}&#xa;"$BUILD_TREE_ROOT/copybin.sh"&#xa;"$BUILD_TREE_ROOT/copyutl.sh"</string>
         <key>showEnvVarsInLog</key>
         <string>0</string>
       </dict>
@@ -9327,7 +9327,7 @@
         <key>shellPath</key>
         <string>/bin/sh</string>
         <key>shellScript</key>
-        <string>export BUILD_TREE_ROOT=../..&#xa;export BUILD_TREE_BIN=bin/${CONFIGURATION}&#xa;"$BUILD_TREE_ROOT/copybin.sh"</string>
+        <string>export BUILD_TREE_ROOT=../..&#xa;export BUILD_TREE_BIN=bin/${CONFIGURATION}&#xa;"$BUILD_TREE_ROOT/copybin.sh"&#xa;"$BUILD_TREE_ROOT/copyutl.sh"</string>
         <key>showEnvVarsInLog</key>
         <string>0</string>
       </dict>
diff --git a/c++/compilers/xcode30_prj/xcodebuild.sh b/c++/compilers/xcode30_prj/xcodebuild.sh
index dda44c0..66e2606 100755
--- a/c++/compilers/xcode30_prj/xcodebuild.sh
+++ b/c++/compilers/xcode30_prj/xcodebuild.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: xcodebuild.sh 472266 2015-07-08 17:20:47Z ivanov $
+# $Id: xcodebuild.sh 471603 2015-06-29 18:48:10Z ucko $
 # Simple wrapper for xcodebuild that favors older SDK versions so as
 # to yield more portable binaries.
 
diff --git a/c++/include/algo/blast/api/bl2seq.hpp b/c++/include/algo/blast/api/bl2seq.hpp
index d7ce49b..28b8d00 100644
--- a/c++/include/algo/blast/api/bl2seq.hpp
+++ b/c++/include/algo/blast/api/bl2seq.hpp
@@ -1,4 +1,4 @@
-/*  $Id: bl2seq.hpp 478803 2015-09-14 15:44:45Z ivanov $
+/*  $Id: bl2seq.hpp 478658 2015-09-11 14:30:02Z madden $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/blast_advprot_options.hpp b/c++/include/algo/blast/api/blast_advprot_options.hpp
index 2c9383d..fa7408a 100644
--- a/c++/include/algo/blast/api/blast_advprot_options.hpp
+++ b/c++/include/algo/blast/api/blast_advprot_options.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___ADVPROT_OPTIONS__HPP
 #define ALGO_BLAST_API___ADVPROT_OPTIONS__HPP
 
-/*  $Id: blast_advprot_options.hpp 474219 2015-07-27 17:07:23Z ivanov $
+/*  $Id: blast_advprot_options.hpp 472241 2015-07-08 15:24:13Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/blast_options_builder.hpp b/c++/include/algo/blast/api/blast_options_builder.hpp
index 0a96ffd..54541cf 100644
--- a/c++/include/algo/blast/api/blast_options_builder.hpp
+++ b/c++/include/algo/blast/api/blast_options_builder.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___BLAST_OPTIONS_BUILDER__HPP
 #define ALGO_BLAST_API___BLAST_OPTIONS_BUILDER__HPP
 
-/*  $Id: blast_options_builder.hpp 482051 2015-10-20 14:16:32Z ivanov $
+/*  $Id: blast_options_builder.hpp 481634 2015-10-14 15:21:43Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/blast_options_handle.hpp b/c++/include/algo/blast/api/blast_options_handle.hpp
index a746b90..6529720 100644
--- a/c++/include/algo/blast/api/blast_options_handle.hpp
+++ b/c++/include/algo/blast/api/blast_options_handle.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___BLAST_OPTIONS_HANDLE__HPP
 #define ALGO_BLAST_API___BLAST_OPTIONS_HANDLE__HPP
 
-/*  $Id: blast_options_handle.hpp 474219 2015-07-27 17:07:23Z ivanov $
+/*  $Id: blast_options_handle.hpp 472241 2015-07-08 15:24:13Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/blast_prot_options.hpp b/c++/include/algo/blast/api/blast_prot_options.hpp
index 5e27b4c..558ee63 100644
--- a/c++/include/algo/blast/api/blast_prot_options.hpp
+++ b/c++/include/algo/blast/api/blast_prot_options.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___BLAST_PROT_OPTIONS__HPP
 #define ALGO_BLAST_API___BLAST_PROT_OPTIONS__HPP
 
-/*  $Id: blast_prot_options.hpp 474219 2015-07-27 17:07:23Z ivanov $
+/*  $Id: blast_prot_options.hpp 472241 2015-07-08 15:24:13Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/blast_results.hpp b/c++/include/algo/blast/api/blast_results.hpp
index d0e3543..8e4262f 100644
--- a/c++/include/algo/blast/api/blast_results.hpp
+++ b/c++/include/algo/blast/api/blast_results.hpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_results.hpp 438020 2014-06-12 12:13:19Z fongah2 $
+/*  $Id: blast_results.hpp 480884 2015-10-05 17:23:10Z jianye $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -200,6 +200,13 @@ public:
         return m_Alignment;
     }
 
+    /// Only intended to be used if you need to edit the seqlign. Otherwise
+    ///use GetSeqAlign()
+    CRef<objects::CSeq_align_set> SetSeqAlign() 
+    {
+        return m_Alignment;
+    }
+
     /// Return true if there are any alignments for this query
     bool HasAlignments() const;
 
diff --git a/c++/include/algo/blast/api/blast_seqinfosrc.hpp b/c++/include/algo/blast/api/blast_seqinfosrc.hpp
index 5671710..f7aa39d 100644
--- a/c++/include/algo/blast/api/blast_seqinfosrc.hpp
+++ b/c++/include/algo/blast/api/blast_seqinfosrc.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API__BLAST_SEQINFOSRC__HPP
 #define ALGO_BLAST_API__BLAST_SEQINFOSRC__HPP
 
-/*  $Id: blast_seqinfosrc.hpp 170794 2009-09-16 18:53:03Z maning $
+/*  $Id: blast_seqinfosrc.hpp 499810 2016-04-28 15:43:25Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -100,6 +100,11 @@ public:
                           const vector<TSeqRange>& target_ranges,
                           TMaskedSubjRegions& retval) const = 0;
 
+    /// Return true if the implementation can return anything besides a seq-loc
+    /// for the entire sequence.  If in doubt, the implementation must
+    /// return true.
+    virtual bool CanReturnPartialSequence() const = 0;
+
     /// Allow implementations to provide a facility to release memory
     virtual void GarbageCollect() {};
 };
diff --git a/c++/include/algo/blast/api/local_db_adapter.hpp b/c++/include/algo/blast/api/local_db_adapter.hpp
index 54d9830..a525ccb 100644
--- a/c++/include/algo/blast/api/local_db_adapter.hpp
+++ b/c++/include/algo/blast/api/local_db_adapter.hpp
@@ -1,4 +1,4 @@
-/* $Id: local_db_adapter.hpp 478802 2015-09-14 15:44:22Z ivanov $
+/* $Id: local_db_adapter.hpp 478540 2015-09-10 12:56:25Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE                          
diff --git a/c++/include/algo/blast/api/psiblast_options.hpp b/c++/include/algo/blast/api/psiblast_options.hpp
index d77baeb..88251b8 100644
--- a/c++/include/algo/blast/api/psiblast_options.hpp
+++ b/c++/include/algo/blast/api/psiblast_options.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___PSIBLAST_OPTIONS__HPP
 #define ALGO_BLAST_API___PSIBLAST_OPTIONS__HPP
 
-/*  $Id: psiblast_options.hpp 474219 2015-07-27 17:07:23Z ivanov $
+/*  $Id: psiblast_options.hpp 472241 2015-07-08 15:24:13Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/remote_blast.hpp b/c++/include/algo/blast/api/remote_blast.hpp
index 23f24d8..fb58a12 100644
--- a/c++/include/algo/blast/api/remote_blast.hpp
+++ b/c++/include/algo/blast/api/remote_blast.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___REMOTE_BLAST__HPP
 #define ALGO_BLAST_API___REMOTE_BLAST__HPP
 
-/*  $Id: remote_blast.hpp 482051 2015-10-20 14:16:32Z ivanov $
+/*  $Id: remote_blast.hpp 495288 2016-03-16 14:51:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -485,6 +485,8 @@ public:
     // For Psiblast
     unsigned int GetPsiNumberOfIterations(void);
 
+    bool IsErrMsgArchive(void);
+
 private:
 
     bool x_HasRetrievedSubjects() const {
diff --git a/c++/include/algo/blast/api/search_strategy.hpp b/c++/include/algo/blast/api/search_strategy.hpp
index 9ac6ddb..a34691e 100644
--- a/c++/include/algo/blast/api/search_strategy.hpp
+++ b/c++/include/algo/blast/api/search_strategy.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___SEARCH_STRATEGY__HPP
 #define ALGO_BLAST_API___SEARCH_STRATEGY__HPP
 
-/*  $Id: search_strategy.hpp 482051 2015-10-20 14:16:32Z ivanov $
+/*  $Id: search_strategy.hpp 481634 2015-10-14 15:21:43Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/seqinfosrc_seqdb.hpp b/c++/include/algo/blast/api/seqinfosrc_seqdb.hpp
index 7accb8e..827ffe2 100644
--- a/c++/include/algo/blast/api/seqinfosrc_seqdb.hpp
+++ b/c++/include/algo/blast/api/seqinfosrc_seqdb.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API__SEQINFOSRC_SEQDB__HPP
 #define ALGO_BLAST_API__SEQINFOSRC_SEQDB__HPP
 
-/*  $Id: seqinfosrc_seqdb.hpp 170794 2009-09-16 18:53:03Z maning $
+/*  $Id: seqinfosrc_seqdb.hpp 499810 2016-04-28 15:43:25Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -108,6 +108,11 @@ public:
                           const vector<TSeqRange> & target_ranges,
                           TMaskedSubjRegions& retval) const;
 
+    /// Return true if the implementation can return anything besides a seq-loc
+    /// for the entire sequence.  If in doubt, the implementation must
+    /// return true.
+    virtual bool CanReturnPartialSequence() const {return false;}
+
     /// Invoke CSeqDB's garbage collector
     virtual void GarbageCollect();
 
diff --git a/c++/include/algo/blast/api/seqinfosrc_seqvec.hpp b/c++/include/algo/blast/api/seqinfosrc_seqvec.hpp
index 73df6f4..023db11 100644
--- a/c++/include/algo/blast/api/seqinfosrc_seqvec.hpp
+++ b/c++/include/algo/blast/api/seqinfosrc_seqvec.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API__SEQINFOSRC_SEQVEC__HPP
 #define ALGO_BLAST_API__SEQINFOSRC_SEQVEC__HPP
 
-/*  $Id: seqinfosrc_seqvec.hpp 198648 2010-07-28 20:04:32Z camacho $
+/*  $Id: seqinfosrc_seqvec.hpp 499810 2016-04-28 15:43:25Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -96,6 +96,11 @@ public:
     virtual bool GetMasks(Uint4 index, 
                           const vector<TSeqRange>& target_ranges,
                           TMaskedSubjRegions& retval) const;
+
+    /// Return true if the implementation can return anything besides a seq-loc
+    /// for the entire sequence.  If in doubt, the implementation must
+    /// return true.
+    virtual bool CanReturnPartialSequence() const {return true;}
 private:
     TSeqLocVector m_SeqVec; ///< Vector of subject sequence locations to get 
                             /// information from
diff --git a/c++/include/algo/blast/api/seqsrc_multiseq.hpp b/c++/include/algo/blast/api/seqsrc_multiseq.hpp
index 3d07be5..4964d78 100644
--- a/c++/include/algo/blast/api/seqsrc_multiseq.hpp
+++ b/c++/include/algo/blast/api/seqsrc_multiseq.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___SEQSRC_MULTISEQ__HPP
 #define ALGO_BLAST_API___SEQSRC_MULTISEQ__HPP
 
-/*  $Id: seqsrc_multiseq.hpp 478802 2015-09-14 15:44:22Z ivanov $
+/*  $Id: seqsrc_multiseq.hpp 478540 2015-09-10 12:56:25Z madden $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/tblastn_options.hpp b/c++/include/algo/blast/api/tblastn_options.hpp
index 4576635..2b74b8a 100644
--- a/c++/include/algo/blast/api/tblastn_options.hpp
+++ b/c++/include/algo/blast/api/tblastn_options.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API___TBLASTN_OPTIONS__HPP
 #define ALGO_BLAST_API___TBLASTN_OPTIONS__HPP
 
-/*  $Id: tblastn_options.hpp 474219 2015-07-27 17:07:23Z ivanov $
+/*  $Id: tblastn_options.hpp 472241 2015-07-08 15:24:13Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/api/uniform_search.hpp b/c++/include/algo/blast/api/uniform_search.hpp
index 40b449d..ae3fec4 100644
--- a/c++/include/algo/blast/api/uniform_search.hpp
+++ b/c++/include/algo/blast/api/uniform_search.hpp
@@ -1,4 +1,4 @@
-/* $Id: uniform_search.hpp 482051 2015-10-20 14:16:32Z ivanov $
+/* $Id: uniform_search.hpp 481634 2015-10-14 15:21:43Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE                          
diff --git a/c++/include/algo/blast/blastinput/blast_args.hpp b/c++/include/algo/blast/blastinput/blast_args.hpp
index d84202c..23584ef 100644
--- a/c++/include/algo/blast/blastinput/blast_args.hpp
+++ b/c++/include/algo/blast/blastinput/blast_args.hpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_args.hpp 485060 2015-11-18 16:07:34Z ivanov $
+/*  $Id: blast_args.hpp 484853 2015-11-16 18:32:26Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/blastinput/blast_input_aux.hpp b/c++/include/algo/blast/blastinput/blast_input_aux.hpp
index 27890a7..8e94033 100644
--- a/c++/include/algo/blast/blastinput/blast_input_aux.hpp
+++ b/c++/include/algo/blast/blastinput/blast_input_aux.hpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_input_aux.hpp 483791 2015-11-04 11:12:47Z ivanov $
+/*  $Id: blast_input_aux.hpp 483345 2015-10-30 14:04:13Z boratyng $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/blastinput/cmdline_flags.hpp b/c++/include/algo/blast/blastinput/cmdline_flags.hpp
index dfa0480..cf8e59c 100644
--- a/c++/include/algo/blast/blastinput/cmdline_flags.hpp
+++ b/c++/include/algo/blast/blastinput/cmdline_flags.hpp
@@ -1,4 +1,4 @@
-/*  $Id: cmdline_flags.hpp 483791 2015-11-04 11:12:47Z ivanov $
+/*  $Id: cmdline_flags.hpp 499246 2016-04-25 11:32:24Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -292,6 +292,10 @@ NCBI_BLASTINPUT_EXPORT extern const string kArgGLOrigin;
 NCBI_BLASTINPUT_EXPORT extern const string kArgGLDomainSystem;
 /// Arugment to specify if Igblast alignment should restrict to V seg
 NCBI_BLASTINPUT_EXPORT extern const string kArgGLFocusV;
+/// Arugment to specify if Igblast alignment should be extends at 5' end
+NCBI_BLASTINPUT_EXPORT extern const string kArgExtendAlign;
+///Argument to specify minimal required V length
+NCBI_BLASTINPUT_EXPORT extern const string kArgMinVLength;
 /// Arugment to specify if Igblast alignment should be translated to protein
 NCBI_BLASTINPUT_EXPORT extern const string kArgTranslate;
 ///Arugment to specify if Igblast min D gene match
diff --git a/c++/include/algo/blast/blastinput/deltablast_args.hpp b/c++/include/algo/blast/blastinput/deltablast_args.hpp
index acd71d6..88c98c6 100644
--- a/c++/include/algo/blast/blastinput/deltablast_args.hpp
+++ b/c++/include/algo/blast/blastinput/deltablast_args.hpp
@@ -1,4 +1,4 @@
-/*  $Id: deltablast_args.hpp 483793 2015-11-04 11:13:41Z ivanov $
+/*  $Id: deltablast_args.hpp 483573 2015-11-02 17:48:31Z boratyng $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/blastinput/psiblast_args.hpp b/c++/include/algo/blast/blastinput/psiblast_args.hpp
index 451bda0..5dd8ed6 100644
--- a/c++/include/algo/blast/blastinput/psiblast_args.hpp
+++ b/c++/include/algo/blast/blastinput/psiblast_args.hpp
@@ -1,4 +1,4 @@
-/*  $Id: psiblast_args.hpp 483791 2015-11-04 11:12:47Z ivanov $
+/*  $Id: psiblast_args.hpp 483345 2015-10-30 14:04:13Z boratyng $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/composition_adjustment/composition_adjustment.h b/c++/include/algo/blast/composition_adjustment/composition_adjustment.h
index 541ae1d..1178c33 100644
--- a/c++/include/algo/blast/composition_adjustment/composition_adjustment.h
+++ b/c++/include/algo/blast/composition_adjustment/composition_adjustment.h
@@ -1,4 +1,4 @@
-/* $Id: composition_adjustment.h 138123 2008-08-21 19:28:07Z camacho $
+/* $Id: composition_adjustment.h 500367 2016-05-04 12:06:01Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -43,8 +43,8 @@ extern "C" {
 
 /* Some characters in the NCBIstdaa alphabet, including ambiguity
    characters, selenocysteine and the stop character. */
-enum { eGapChar = 0, eBchar = 2,  eDchar = 4,  eEchar = 5, eIchar = 9,
-       eLchar = 11,  eNchar = 13, eQchar = 15, eXchar = 21,
+enum { eGapChar = 0, eBchar = 2, eCchar = 3,  eDchar = 4,  eEchar = 5,
+       eIchar = 9, eLchar = 11,  eNchar = 13, eQchar = 15, eXchar = 21,
        eZchar = 23,  eSelenocysteine = 24, eStopChar = 25,
        eOchar = 26,  eJchar = 27};
 
diff --git a/c++/include/algo/blast/core/blast_kappa.h b/c++/include/algo/blast/core/blast_kappa.h
index d7e244f..a7d5d5c 100644
--- a/c++/include/algo/blast/core/blast_kappa.h
+++ b/c++/include/algo/blast/core/blast_kappa.h
@@ -1,4 +1,4 @@
-/* $Id: blast_kappa.h 416292 2013-10-25 14:12:59Z camacho $
+/* $Id: blast_kappa.h 496008 2016-03-23 11:29:15Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -47,8 +47,10 @@ extern "C" {
 #endif
 
 /** Top level routine to recompute alignments for each
- *  match found by the gapped BLAST algorithm
- *  A linked list of alignments is returned (param hitList); the alignments 
+ *  match found by the gapped BLAST algorithm (single-thread prototype)
+ *  This prototype is an adapter to the multi-thread prototype with
+ *  num_threads set to 1.
+ *  A linked list of alignments is returned (param hitList); the alignments
  *  are sorted according to the lowest E-value of the best alignment for each
  *  matching sequence; alignments for the same matching sequence
  *  are in the list consecutively regardless of the E-value of the
@@ -91,6 +93,53 @@ Blast_RedoAlignmentCore(EBlastProgramType program_number,
                   const PSIBlastOptions* psiOptions,
                   BlastHSPResults* results);
 
+/** Top level routine to recompute alignments for each
+ *  match found by the gapped BLAST algorithm (multi-thread prototype)
+ *  A linked list of alignments is returned (param hitList); the alignments
+ *  are sorted according to the lowest E-value of the best alignment for each
+ *  matching sequence; alignments for the same matching sequence
+ *  are in the list consecutively regardless of the E-value of the
+ *  secondary alignments. Ties in sorted order are much rarer than
+ *  for the standard BLAST method, but are broken deterministically
+ *  based on the index of the matching sequences in the database.
+ * @param program_number the type of blast search being performed [in]
+ * @param num_threads number of OpenMP threads to be used [in]
+ * @param queryBlk query sequence [in]
+ * @param query_info query information [in]
+ * @param sbp (Karlin-Altschul) information for search [in]
+ * @param subjectBlk subject sequence [in]
+ * @param seqSrc used to fetch database/match sequences [in]
+ * @param db_genetic_code Genetic code to use if database sequences are
+ *                        translated, and there is no other guidance on
+ *                        which genetic code to use [in]
+ * @param thisMatch hit for further processing [in]
+ * @param hsp_stream used to fetch hits for further processing [in]
+ * @param scoringParams parameters used for scoring (matrix, gap costs etc.) [in]
+ * @param extendParams parameters used for extension [in]
+ * @param hitParams parameters used for saving hits [in]
+ * @param psiOptions options related to psi-blast [in]
+ * @param results All HSP results from previous stages of the search [in] [out]
+ * @return 0 on success, otherwise failure.
+*/
+
+NCBI_XBLAST_EXPORT
+Int2
+Blast_RedoAlignmentCore_MT(EBlastProgramType program_number,
+                  Uint4 num_threads,
+                  BLAST_SequenceBlk* queryBlk,
+                  const BlastQueryInfo* query_info,
+                  BlastScoreBlk* sbp,
+                  BLAST_SequenceBlk* subjectBlk,
+                  const BlastSeqSrc* seqSrc,
+                  Int4 db_genetic_code,
+                  BlastHSPList* thisMatch,
+                  BlastHSPStream* hsp_stream,
+                  BlastScoringParameters* scoringParams,
+                  const BlastExtensionParameters* extendParams,
+                  const BlastHitSavingParameters* hitParams,
+                  const PSIBlastOptions* psiOptions,
+                  BlastHSPResults* results);
+
 #ifdef __cplusplus
 
 }
diff --git a/c++/include/algo/blast/core/blast_stat.h b/c++/include/algo/blast/core/blast_stat.h
index 84f4a16..0b554f0 100644
--- a/c++/include/algo/blast/core/blast_stat.h
+++ b/c++/include/algo/blast/core/blast_stat.h
@@ -1,4 +1,4 @@
-/*  $Id: blast_stat.h 458581 2015-02-06 15:18:12Z boratyng $
+/*  $Id: blast_stat.h 496008 2016-03-23 11:29:15Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -81,7 +81,7 @@ typedef struct Blast_KarlinBlk {
 */
 typedef struct erfc_table {
       double eps;
-      double a;  
+      double a;
       double b;
       Int4   N;
       double h;
@@ -108,7 +108,7 @@ typedef struct Blast_GumbelBlk {
       Int8 db_length;    /**< total length of database */
 
       Boolean filled;    /**< flag indicate the values of gbp are prepared */
-      
+
    } Blast_GumbelBlk;
 
 
@@ -175,7 +175,7 @@ SPsiBlastScoreMatrixFree(SPsiBlastScoreMatrix* matrix);
 /** Structure used for scoring calculations.
 */
 typedef struct BlastScoreBlk {
-   Boolean     protein_alphabet; /**< TRUE if alphabet_code is for a 
+   Boolean     protein_alphabet; /**< TRUE if alphabet_code is for a
 protein alphabet (e.g., ncbistdaa etc.), FALSE for nt. alphabets. */
    Uint1    alphabet_code; /**< NCBI alphabet code. */
    Int2     alphabet_size;  /**< size of alphabet. */
@@ -188,8 +188,8 @@ protein alphabet (e.g., ncbistdaa etc.), FALSE for nt. alphabets. */
                                          position specific (i.e.: PSI-BLAST) */
    Boolean  matrix_only_scoring;  /**< Score ungapped/gapped alignment only
                                        using the matrix parameters and
-                                       with raw scores. Ignore 
-                                       penalty/reward and do not report 
+                                       with raw scores. Ignore
+                                       penalty/reward and do not report
                                        Karlin-Altschul stats.  This is used
                                        by the rmblastn program. -RMH- */
    Boolean complexity_adjusted_scoring; /**< Use cross_match-like complexity
@@ -228,6 +228,24 @@ typedef struct SCompressedAlphabet {
     Uint1* compress_table;  /**< translation table (AA->compressed)*/
 } SCompressedAlphabet;
 
+/** Deallocates SBlastScoreMatrix structure
+ * @param matrix structure to deallocate [in]
+ * @return NULL
+ */
+NCBI_XBLAST_EXPORT
+SBlastScoreMatrix*
+SBlastScoreMatrixFree(SBlastScoreMatrix* matrix);
+
+/** Allocates a new SBlastScoreMatrix structure of the specified dimensions.
+ * @param ncols number of columns [in]
+ * @param nrows number of rows [in]
+ * @return NULL in case of memory allocation failure, else new
+ * SBlastScoreMatrix structure
+ */
+NCBI_XBLAST_EXPORT
+SBlastScoreMatrix*
+SBlastScoreMatrixNew(size_t ncols, size_t nrows);
+
 /** Allocate a new compressed alphabet and score matrix
  * @param sbp Current score matrix information [in]
  * @param compressed_alphabet_size Desired size of compressed
@@ -238,7 +256,7 @@ typedef struct SCompressedAlphabet {
 NCBI_XBLAST_EXPORT
 SCompressedAlphabet*
 SCompressedAlphabetNew(BlastScoreBlk *sbp,
-                       Int4 compressed_alphabet_size, 
+                       Int4 compressed_alphabet_size,
                        double scale_factor);
 
 /** Free a compressed alphabet and score matrix
@@ -249,7 +267,7 @@ NCBI_XBLAST_EXPORT
 SCompressedAlphabet*
 SCompressedAlphabetFree(SCompressedAlphabet *alphabet);
 
-/** 
+/**
 Stores the letter frequency of a sequence or database.
 */
 typedef struct Blast_ResFreq {
@@ -258,7 +276,7 @@ typedef struct Blast_ResFreq {
     double* prob0;            /**< probs, zero offset. */
 } Blast_ResFreq;
 
-/** 
+/**
  * Check that score blk is valid, returns zero if it is.
  * @param sbp ScoreBlk to check [in]
  * @return zero if valid
@@ -301,18 +319,18 @@ Int2 BLAST_ScoreSetAmbigRes (BlastScoreBlk* sbp, char ambiguous_res);
  * @param query Buffer containing (concatenated) query sequence [in]
  * @param query_info Information about offsets of concatenated queries [in]
  * @param blast_message returns queries that could not be processed [out]
- * @return 0 if ungapped Karlin-Altschul parameters could be calculated for 
- *        all of the query sequence's contexts; 1 if any of the contexts 
+ * @return 0 if ungapped Karlin-Altschul parameters could be calculated for
+ *        all of the query sequence's contexts; 1 if any of the contexts
  *        failed (but all others will be populated).
  */
 NCBI_XBLAST_EXPORT
 Int2
-Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program, 
-                              BlastScoreBlk* sbp, Uint1* query, 
+Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program,
+                              BlastScoreBlk* sbp, Uint1* query,
                               const BlastQueryInfo* query_info,
                               Blast_Message* *blast_message);
 
-/** This function fills in the BlastScoreBlk structure.  
+/** This function fills in the BlastScoreBlk structure.
  * Tasks are:
  * -read in the matrix
  * -set maxscore
@@ -322,7 +340,7 @@ Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program,
 */
 NCBI_XBLAST_EXPORT
 Int2 Blast_ScoreBlkMatrixFill (BlastScoreBlk* sbp, GET_MATRIX_PATH get_path);
- 
+
 /** Callocs a Blast_KarlinBlk
  * @return pointer to the Blast_KarlinBlk
 */
@@ -334,7 +352,7 @@ Blast_KarlinBlk* Blast_KarlinBlkNew (void);
  * @param kbp_to Karlin block to copy values to [in] [out]
  * @param kbp_from Karlin block to copy values from [in]
  * @return 0 on success; -1 if either argument is NULL on input.
- */ 
+ */
 NCBI_XBLAST_EXPORT
 Int2 Blast_KarlinBlkCopy(Blast_KarlinBlk* kbp_to, Blast_KarlinBlk* kbp_from);
 
@@ -346,7 +364,7 @@ Int2 Blast_KarlinBlkCopy(Blast_KarlinBlk* kbp_to, Blast_KarlinBlk* kbp_from);
 NCBI_XBLAST_EXPORT
 Blast_KarlinBlk* Blast_KarlinBlkFree(Blast_KarlinBlk* kbp);
 
-/** Fills in lambda, H, and K values, as calculated by Stephen Altschul 
+/** Fills in lambda, H, and K values, as calculated by Stephen Altschul
  *  in Methods in Enzy. (vol 266, page 474).
  * @param kbp object to be filled in [in|out]
  * @param gap_open cost of gap existence [in]
@@ -356,13 +374,13 @@ Blast_KarlinBlk* Blast_KarlinBlkFree(Blast_KarlinBlk* kbp);
  * @return zero on success
  */
 NCBI_XBLAST_EXPORT
-Int2 Blast_KarlinBlkGappedCalc (Blast_KarlinBlk* kbp, Int4 gap_open, 
+Int2 Blast_KarlinBlkGappedCalc (Blast_KarlinBlk* kbp, Int4 gap_open,
      Int4 gap_extend, const char* matrix_name, Blast_Message** error_return);
 
 /** Retrieves Karlin-Altschul parameters from precomputed tables, given the
- * substitution and gap scores. Gap cost values greater than any of those 
+ * substitution and gap scores. Gap cost values greater than any of those
  * listed in the tables ("greater" meaning that both values are greater than or
- * equal, and at least one is strictly greater), are treated as infinite, and 
+ * equal, and at least one is strictly greater), are treated as infinite, and
  * parameters values are copied from the ungapped Karlin block.
  * @param kbp Allocated Karlin block to fill [in] [out]
  * @param gap_open Gap openening (existence) cost [in]
@@ -376,7 +394,7 @@ Int2 Blast_KarlinBlkGappedCalc (Blast_KarlinBlk* kbp, Int4 gap_open,
  */
 NCBI_XBLAST_EXPORT
 Int2
-Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open, 
+Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open,
                               Int4 gap_extend, Int4 reward, Int4 penalty,
                               Blast_KarlinBlk* kbp_ungap,
                               Boolean* round_down,
@@ -386,7 +404,7 @@ Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open,
 /** Calculates the Karlin-Altschul parameters assuming standard residue
  * compositions for the query and subject sequences. It populates the kbp_ideal
  * field of its sbp argument. This is used if the query is translated and the
- * calculated (real) Karlin parameters are bad, as they're calculated for 
+ * calculated (real) Karlin parameters are bad, as they're calculated for
  * non-coding regions.
  * @param sbp ScoreBlk used to calculate "ideal" values. [in|out]
  * @return 0 on success, 1 on failure
@@ -417,7 +435,7 @@ Int2 Blast_KarlinBlkGappedLoadFromTables(Blast_KarlinBlk* kbp, Int4 gap_open, In
  * @return zero on success
  */
 NCBI_XBLAST_EXPORT
-Int2 Blast_GumbelBlkCalc (Blast_GumbelBlk* gbp, Int4 gap_open, 
+Int2 Blast_GumbelBlkCalc (Blast_GumbelBlk* gbp, Int4 gap_open,
      Int4 gap_extend, const char* matrix_name, Blast_Message** error_return);
 
 /** Attempts to fill GumbelBlk for given gap opening, extensions etc.
@@ -431,10 +449,10 @@ Int2 Blast_GumbelBlkCalc (Blast_GumbelBlk* gbp, Int4 gap_open,
  *           2 if matrix found, but open, extend etc. values not supported.
 */
 NCBI_XBLAST_EXPORT
-Int2 Blast_GumbelBlkLoadFromTables(Blast_GumbelBlk* gbp, Int4 gap_open, 
+Int2 Blast_GumbelBlkLoadFromTables(Blast_GumbelBlk* gbp, Int4 gap_open,
      Int4 gap_extend, const char* matrix_name);
 
-/** Prints a messages about the allowed matrices, BlastKarlinBlkGappedFill should return 1 before this is called. 
+/** Prints a messages about the allowed matrices, BlastKarlinBlkGappedFill should return 1 before this is called.
  * @param matrix the matrix to print a message about [in]
  * @param standard_only, If true, include only the standad blosum and pam
  * matrices [in]
@@ -443,8 +461,8 @@ Int2 Blast_GumbelBlkLoadFromTables(Blast_GumbelBlk* gbp, Int4 gap_open,
 NCBI_XBLAST_EXPORT
 char* BLAST_PrintMatrixMessage(const char *matrix, Boolean standard_only);
 
-/** Prints a messages about the allowed open etc values for the given matrix, 
- * BlastKarlinBlkGappedFill should return 2 before this is called. 
+/** Prints a messages about the allowed open etc values for the given matrix,
+ * BlastKarlinBlkGappedFill should return 2 before this is called.
  * @param matrix name of the matrix [in]
  * @param gap_open gap existence cost [in]
  * @param gap_extend cost to extend a gap by one [in]
@@ -458,7 +476,7 @@ NCBI_XBLAST_EXPORT
 double
 Blast_KarlinLambdaNR(Blast_ScoreFreq* sfp, double initialLambdaGuess);
 
-/** Calculates the Expect value based upon the search space and some Karlin-Altschul 
+/** Calculates the Expect value based upon the search space and some Karlin-Altschul
  * parameters.  It is "simple" as it does not use sum-statistics.
  * @param S the score of the alignment. [in]
  * @param kbp the Karlin-Altschul parameters. [in]
@@ -495,20 +513,20 @@ Int4 BLAST_SpougeEtoS (double E, Blast_KarlinBlk* kbp, Blast_GumbelBlk* gbp, Int
  * If given a database P-value, this routine will return a database
  * E-value; if given a pairwise P-value, it will return a pairwise
  * E-value.
- *  
+ *
  * In the context of a database search, the available P-value is often
  * a pairwise P-value, whereas the desired E-value is a database
  * E-value.  When this it the case, the value returned by this routine
  * should be multiplied by the effective length of the database and
  * divided by the effective length of the subject.
- * 
+ *
  * @param p the P-value to be converted [in] @return the corresponding
  * expect value.
  */
 NCBI_XBLAST_EXPORT double BLAST_KarlinPtoE(double p);
 
 /** Convert an E-value to a P-value.
- * 
+ *
  * E-values and P-values may either represent statistics of a database
  * search or represent statistics on the two sequences being compared.
  * If given a database E-value, this routine will return a database
@@ -556,7 +574,7 @@ double BLAST_GapDecayDivisor(double decayrate, unsigned nsegs );
  * @param gap_decay_rate Gap decay rate to use, if dodecay is set [in]
  */
 NCBI_XBLAST_EXPORT
-Int2 BLAST_Cutoffs (Int4 *S, double* E, Blast_KarlinBlk* kbp, 
+Int2 BLAST_Cutoffs (Int4 *S, double* E, Blast_KarlinBlk* kbp,
                     Int8 searchsp, Boolean dodecay, double gap_decay_rate);
 
 /** Calculates the e-value for alignments with "small" gaps (typically
@@ -570,9 +588,9 @@ Int2 BLAST_Cutoffs (Int4 *S, double* E, Blast_KarlinBlk* kbp,
  * @param subject_length effective len of the subject seq [in]
  * @param searchsp_eff effective size of the search space [in]
  * @param weight_divisor a divisor used to weight the e-value
- *    when multiple collections of alignments are being considered by 
+ *    when multiple collections of alignments are being considered by
  *    the calling routine [in]
- * @return the expect value 
+ * @return the expect value
  */
 NCBI_XBLAST_EXPORT
 double BLAST_SmallGapSumE (Int4 start_points, Int2 num,  double xsum,
@@ -627,11 +645,11 @@ double BLAST_LargeGapSumE (Int2 num,  double xsum,
                            Int8 searchsp_eff, double weight_divisor );
 
 /** Extract the recommended gap existence and extension values.
- * Only to be used with protein matrices. 
+ * Only to be used with protein matrices.
  * @param  matrixName name of the matrix [in]
  * @param gap_existence returns recommended existence cost [in|out]
  * @param gap_extension returns recommended extension cost [in|out]
- * @return zero on success 
+ * @return zero on success
  */
 NCBI_XBLAST_EXPORT
 Int2 BLAST_GetProteinGapExistenceExtendParams(const char* matrixName,
@@ -644,7 +662,7 @@ Int2 BLAST_GetProteinGapExistenceExtendParams(const char* matrixName,
  * @param penalty mismatch score [in]
  * @param gap_existence returns recommended existence cost [in|out]
  * @param gap_extension returns recommended extension cost [in|out]
- * @return zero on success 
+ * @return zero on success
  */
 NCBI_XBLAST_EXPORT
 Int2 BLAST_GetNucleotideGapExistenceExtendParams(Int4 reward,
@@ -656,7 +674,7 @@ Int2 BLAST_GetNucleotideGapExistenceExtendParams(Int4 reward,
  * Only to be used with blastn searches.
  * @param reward match score [in]
  * @param penalty mismatch score [in]
- * @return TRUE on success 
+ * @return TRUE on success
  */
 NCBI_XBLAST_EXPORT
 Boolean BLAST_CheckRewardPenaltyScores(Int4 reward, Int4 penalty);
@@ -673,10 +691,10 @@ Boolean BLAST_CheckRewardPenaltyScores(Int4 reward, Int4 penalty);
 */
 NCBI_XBLAST_EXPORT
 void BLAST_GetAlphaBeta (const char* matrixName, double *alpha,
-                         double *beta, Boolean gapped, Int4 gap_open, 
+                         double *beta, Boolean gapped, Int4 gap_open,
                          Int4 gap_extend, const Blast_KarlinBlk* kbp_ungapped);
 
-/** Extract the alpha and beta settings for these substitution and gap scores. 
+/** Extract the alpha and beta settings for these substitution and gap scores.
  * If substitution or gap costs are not found in the tables, assume an ungapped
  * search. Then alpha is computed using the formula Alpha = Lambda/H, and beta
  * is equal to 0 except for some special cases.
@@ -684,25 +702,25 @@ void BLAST_GetAlphaBeta (const char* matrixName, double *alpha,
  * @param penalty Mismatch penalty score [in]
  * @param gap_open Gap opening (existence) cost [in]
  * @param gap_extend Gap extension cost [in]
- * @param kbp Karlin block containing already computed Lambda, K and H 
+ * @param kbp Karlin block containing already computed Lambda, K and H
  *            parameters.
  * @param gapped_calculation Is this a gapped search? [in]
  * @param alpha Alpha parameter for this scoring system [out]
  * @param beta Beta parameter for this scoring system [out]
  */
 NCBI_XBLAST_EXPORT
-Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open, 
+Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open,
                             Int4 gap_extend, Blast_KarlinBlk* kbp,
                             Boolean gapped_calculation,
                             double *alpha, double *beta);
 
 /** Rescale the PSSM, using composition-based statistics, for use
  *  with RPS BLAST. This function produces a PSSM for a single RPS DB
- *  sequence (of size db_seq_length) and incorporates information from 
+ *  sequence (of size db_seq_length) and incorporates information from
  *  the RPS blast query. Each individual database sequence must call this
  *  function to retrieve its own PSSM. The matrix is returned (and must
- *  be freed elsewhere). posMatrix is the portion of the complete 
- *  concatenated PSSM that is specific to this DB sequence 
+ *  be freed elsewhere). posMatrix is the portion of the complete
+ *  concatenated PSSM that is specific to this DB sequence
  * @todo revise to use existing code
  * @param scalingFactor used to rescale Lambda [in]
  * @param rps_query_length length of query sequence [in]
@@ -710,41 +728,41 @@ Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open,
  * @param db_seq_length Length of the database sequence [in]
  * @param posMatrix matrix (actual) values to be used [in]
  * @param sbp Structure with score matrix parameters [in][out]
- * @return rescaled pssm 
+ * @return rescaled pssm
  */
 NCBI_XBLAST_EXPORT
-Int4 ** RPSRescalePssm(double scalingFactor, Int4 rps_query_length, 
-                   const Uint1 * rps_query_seq, Int4 db_seq_length, 
+Int4 ** RPSRescalePssm(double scalingFactor, Int4 rps_query_length,
+                   const Uint1 * rps_query_seq, Int4 db_seq_length,
                    Int4 **posMatrix, BlastScoreBlk *sbp);
 
 
-/** 
+/**
  * Computes the adjustment to the lengths of the query and database sequences
- * that is used to compensate for edge effects when computing evalues. 
+ * that is used to compensate for edge effects when computing evalues.
  *
  * The length adjustment is an integer-valued approximation to the fixed
  * point of the function
  *
- *    f(ell) = beta + 
+ *    f(ell) = beta +
  *               (alpha/lambda) * (log K + log((m - ell)*(n - N ell)))
  *
  * where m is the query length n is the length of the database and N is the
  * number of sequences in the database. The values beta, alpha, lambda and
  * K are statistical, Karlin-Altschul parameters.
- * 
- * The value of the length adjustment computed by this routine, A, 
+ *
+ * The value of the length adjustment computed by this routine, A,
  * will always be an integer smaller than the fixed point of
  * f(ell). Usually, it will be the largest such integer.  However, the
- * computed length adjustment, A, will also be so small that 
+ * computed length adjustment, A, will also be so small that
  *
  *    K * (m - A) * (n - N * A) > MAX(m,n).
  *
  * Moreover, an iterative method is used to compute A, and under
- * unusual circumstances the iterative method may not converge. 
+ * unusual circumstances the iterative method may not converge.
  *
  * @param K      the statistical parameter K [in]
  * @param logK   the natural logarithm of K [in]
- * @param alpha_d_lambda    the ratio of the statistical parameters 
+ * @param alpha_d_lambda    the ratio of the statistical parameters
  *                          alpha and lambda (for ungapped alignments, the
  *                          value 1/H should be used) [in]
  * @param beta              the statistical parameter beta (for ungapped
@@ -801,7 +819,7 @@ NCBI_XBLAST_EXPORT
 Blast_ScoreFreq*
 Blast_ScoreFreqNew(Int4 score_min, Int4 score_max);
 
-/** Deallocates the score frequencies structure 
+/** Deallocates the score frequencies structure
  * @param sfp the structure to deallocate [in]
  * @return NULL
  */
@@ -809,7 +827,7 @@ NCBI_XBLAST_EXPORT
 Blast_ScoreFreq*
 Blast_ScoreFreqFree(Blast_ScoreFreq* sfp);
 
-/** Fills a buffer with the 'standard' alphabet 
+/** Fills a buffer with the 'standard' alphabet
  * (given by STD_AMINO_ACID_FREQS[index].ch).
  *
  * @param alphabet_code specifies alphabet [in]
@@ -819,7 +837,7 @@ Blast_ScoreFreqFree(Blast_ScoreFreq* sfp);
  */
 NCBI_XBLAST_EXPORT
 Int2
-Blast_GetStdAlphabet(Uint1 alphabet_code, Uint1* residues, 
+Blast_GetStdAlphabet(Uint1 alphabet_code, Uint1* residues,
                      Uint4 residue_size);
 
 /** Computes the parameters lambda, H K for use in calculating the
@@ -857,13 +875,13 @@ Blast_FillResidueProbability(const Uint1* sequence, Int4 length, double * resPro
 NCBI_XBLAST_EXPORT
 Int2 BlastScoreBlkNuclMatrixCreate(BlastScoreBlk* sbp);
 
-/** Returns a pointer to the static compiled in version of the 
+/** Returns a pointer to the static compiled in version of the
  * matrix.  If name is NULL or the matrix is not compiled in
  * NULL is returned.
  * @param name matrix name [in]
  * @return pointer to matrix or NULL if not supported.
  */
-NCBI_XBLAST_EXPORT 
+NCBI_XBLAST_EXPORT
 SNCBIPackedScoreMatrix* BlastScoreBlkGetCompiledInMatrix(const char* name);
 
 #ifdef __cplusplus
diff --git a/c++/include/algo/blast/format/blast_format.hpp b/c++/include/algo/blast/format/blast_format.hpp
index 0142ae1..bc8bb46 100644
--- a/c++/include/algo/blast/format/blast_format.hpp
+++ b/c++/include/algo/blast/format/blast_format.hpp
@@ -1,4 +1,4 @@
-/* $Id: blast_format.hpp 481977 2015-10-19 17:00:20Z ivanov $
+/* $Id: blast_format.hpp 495288 2016-03-16 14:51:11Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -53,6 +53,7 @@ Author: Jason Papadopoulos
 #include <algo/blast/api/local_db_adapter.hpp>
 #include <algo/blast/api/blast_seqinfosrc.hpp>
 #include <algo/blast/format/sam.hpp>
+#include <objects/blast/blast__.hpp>
 
 BEGIN_NCBI_SCOPE
 
@@ -233,7 +234,8 @@ public:
     void WriteArchive(blast::IQueryFactory& queries,
                            blast::CBlastOptionsHandle& options_handle,
                            const blast::CSearchResultSet& results,
-                           unsigned int num_iters = 0);
+                           unsigned int num_iters = 0,
+                           const list<CRef<objects::CBlast4_error> >& msg = list<CRef<objects::CBlast4_error> > () );
 
     /// Writes out the pssm and results as an "archive" format
     /// @param pssm 	psiblast pssm
@@ -243,7 +245,8 @@ public:
     void WriteArchive(objects::CPssmWithParameters & pssm,
                       blast::CBlastOptionsHandle& options_handle,
                       const blast::CSearchResultSet& results,
-                      unsigned int num_iters = 0);
+                      unsigned int num_iters = 0,
+                      const list<CRef<objects::CBlast4_error> > & msg = list<CRef<objects::CBlast4_error> >());
 
     /// Print the footer of the blast report
     /// @param options Options used for performing the blast search [in]
@@ -273,6 +276,9 @@ public:
 
     /// Set Alignment Length
     void SetLineLength(size_t len) {m_LineLength = len;}
+
+    static void PrintArchive(CRef<objects::CBlast4_archive> archive,
+            					  CNcbiOstream& out);
 private:
     /// Format type
     blast::CFormattingArgs::EOutputFormat m_FormatType;
diff --git a/c++/include/algo/blast/format/blastfmtutil.hpp b/c++/include/algo/blast/format/blastfmtutil.hpp
index d776781..0ac6b13 100644
--- a/c++/include/algo/blast/format/blastfmtutil.hpp
+++ b/c++/include/algo/blast/format/blastfmtutil.hpp
@@ -1,4 +1,4 @@
-/*  $Id: blastfmtutil.hpp 482732 2015-10-26 16:31:57Z ivanov $
+/*  $Id: blastfmtutil.hpp 479455 2015-09-21 14:39:54Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/format/blastxml2_format.hpp b/c++/include/algo/blast/format/blastxml2_format.hpp
index 322c690..7754295 100644
--- a/c++/include/algo/blast/format/blastxml2_format.hpp
+++ b/c++/include/algo/blast/format/blastxml2_format.hpp
@@ -1,4 +1,4 @@
-/* $Id: blastxml2_format.hpp 482725 2015-10-26 16:29:00Z ivanov $
+/* $Id: blastxml2_format.hpp 477681 2015-09-01 13:59:06Z fongah2 $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/format/data4xml2format.hpp b/c++/include/algo/blast/format/data4xml2format.hpp
index 5c7e588..26c63f8 100644
--- a/c++/include/algo/blast/format/data4xml2format.hpp
+++ b/c++/include/algo/blast/format/data4xml2format.hpp
@@ -1,4 +1,4 @@
-/* $Id: data4xml2format.hpp 482740 2015-10-26 16:34:54Z ivanov $
+/* $Id: data4xml2format.hpp 481924 2015-10-19 13:58:31Z fongah2 $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/algo/blast/igblast/igblast.hpp b/c++/include/algo/blast/igblast/igblast.hpp
index 357df71..0700193 100644
--- a/c++/include/algo/blast/igblast/igblast.hpp
+++ b/c++/include/algo/blast/igblast/igblast.hpp
@@ -1,4 +1,4 @@
-/*  $Id: igblast.hpp 425386 2014-01-28 19:44:58Z jianye $
+/*  $Id: igblast.hpp 499246 2016-04-25 11:32:24Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,6 +77,8 @@ public:
     int  m_NumAlign[3];              // number of VDJ alignments to show
     bool m_FocusV;                   // should alignment restrict to V
     bool m_Translate;                // should translation be displayed
+    bool m_ExtendAlign;
+    int m_MinVLength;
 };
 
 class CIgAnnotation : public CObject
@@ -97,6 +99,8 @@ public:
     int m_DomainInfo_S[10];          // The (start) and (end offset) for FWR1, 
                                      // CDR1, FWR2, CDR2, FWR3, CDR3 domains on topV sequence
 
+    int m_JDomain[2];                // CDr3 start and stop 
+
     /// Constructor
     CIgAnnotation() 
         : m_MinusStrand (false) 
@@ -106,6 +110,7 @@ public:
         for (int i=0; i<3; i++) m_FrameInfo[i] = -1;
         for (int i=0; i<12; i++) m_DomainInfo[i] = -1;
         for (int i=0; i<10; i++) m_DomainInfo_S[i] = -1;
+        for (int i=0; i<2; i++) m_JDomain[i] = -1;
     }
 
 };
@@ -139,6 +144,14 @@ public:
         }
         return -1;
     }
+    int GetJDomain(const string& sid) {
+        if (m_JDomainInfo.find(sid) != m_JDomainInfo.end()) {
+            return m_JDomainInfo[sid];
+        }
+        return -1;
+
+    }
+
 
     const string GetDJChainType(const string sid) {
         if (m_DJChainType.find(sid) != m_DJChainType.end()) {
@@ -152,7 +165,8 @@ private:
     vector<int> m_DomainData;
     map<string, string> m_DomainChainType;
     map<string, int> m_FrameOffset;
-    map<string, string> m_DJChainType;
+    map<string, string> m_DJChainType;    
+    map<string, int>  m_JDomainInfo; 
 };
 
 class CIgBlastResults : public CSearchResults 
@@ -204,14 +218,16 @@ public:
     CIgBlast(CRef<CBlastQueryVector> query_factory,
              CRef<CLocalDbAdapter> blastdb,
              CRef<CBlastOptionsHandle> options,
-             CConstRef<CIgBlastOptions> ig_options)
+             CConstRef<CIgBlastOptions> ig_options,
+             CRef<CScope> scope)
        : m_IsLocal(true),
          m_NumThreads(1),
          m_Query(query_factory),
          m_LocalDb(blastdb),
          m_Options(options),
          m_IgOptions(ig_options),
-         m_AnnotationInfo(ig_options) { }
+         m_AnnotationInfo(ig_options),
+        m_Scope(scope) { }
 
     /// Remote Igblast search API
     /// @param query_factory  Concatenated query sequences [in]
@@ -224,7 +240,8 @@ public:
              CRef<IQueryFactory>   subjects,
              CRef<CBlastOptionsHandle> options,
              CConstRef<CIgBlastOptions> ig_options,
-             string entrez_query)
+             string entrez_query,
+             CRef<CScope> scope)
        : m_IsLocal(false),
          m_NumThreads(1),
          m_Query(query_factory),
@@ -233,7 +250,8 @@ public:
          m_Options(options),
          m_IgOptions(ig_options),
          m_AnnotationInfo(ig_options),
-         m_EntrezQuery(entrez_query){ }
+         m_EntrezQuery(entrez_query),
+         m_Scope(scope){ }
 
     /// Destructor
     ~CIgBlast() {};
@@ -258,6 +276,7 @@ private:
     CConstRef<CIgBlastOptions> m_IgOptions;
     CIgAnnotationInfo m_AnnotationInfo;
     string m_EntrezQuery;
+    CRef<CScope> m_Scope;
 
     /// Prohibit copy constructor
     CIgBlast(const CIgBlast& rhs);
@@ -333,6 +352,10 @@ private:
                      int q_ve,
                      int iq,
                      bool va_or_vd_as_heavy_chain);
+
+    void x_ExtendAlign(CRef<CSearchResultSet> & results);
+    void x_ScreenV(CRef<CSearchResultSet> & results);
+    void x_FillJDomain(CRef<CSeq_align> & align, CRef <CIgAnnotation> & annot);
     
 };
 
diff --git a/c++/include/algo/dustmask/symdust.hpp b/c++/include/algo/dustmask/symdust.hpp
index 158164b..45f5702 100644
--- a/c++/include/algo/dustmask/symdust.hpp
+++ b/c++/include/algo/dustmask/symdust.hpp
@@ -1,4 +1,4 @@
-/*  $Id: symdust.hpp 464803 2015-04-14 16:29:37Z vakatov $
+/*  $Id: symdust.hpp 486434 2015-12-04 14:20:02Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -40,6 +40,7 @@
 #include <objects/seqloc/Seq_loc.hpp>
 #include <objects/seqloc/Packed_seqint.hpp>
 #include <objmgr/seq_vector.hpp>
+#include <util/random_gen.hpp>
 
 #include <iostream>
 #include <vector>
@@ -71,16 +72,18 @@ class NCBI_XALGODUSTMASK_EXPORT CSymDustMasker
                 \param r base letter in IOPACNA encoding
                 \return the same letter in NCBI2NA encoding
              */
-            Uint1 operator()( Uint1 r ) const
+            Uint1 operator()( Uint1 r )
             {
                 switch( r )
                 {
                     case 67: return 1;
                     case 71: return 2;
                     case 84: return 3;
+                    case 78: return (m_Random.GetRand() & 0x3);
                     default: return 0;
                 }
             }
+            CRandom m_Random;
         };
 
         typedef objects::CSeqVector seq_t;          /**<\internal Sequence type. */
diff --git a/c++/include/cgi/cgi_serial.hpp b/c++/include/cgi/cgi_serial.hpp
index 391bc02..056012f 100644
--- a/c++/include/cgi/cgi_serial.hpp
+++ b/c++/include/cgi/cgi_serial.hpp
@@ -1,7 +1,7 @@
 #ifndef CGI___CGI_SERIAL__HPP
 #define CGI___CGI_SERIAL__HPP
 
-/*  $Id: cgi_serial.hpp 440371 2014-07-11 18:51:32Z kazimird $
+/*  $Id: cgi_serial.hpp 484889 2015-11-16 21:56:43Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -26,7 +26,7 @@
  *
  * ===========================================================================
  *
- * Author:  Maxim Didneko
+ * Author:  Maxim Didenko
  *
  */
 
@@ -189,15 +189,16 @@ CNcbiIstream& ReadMap(CNcbiIstream& is, TMap& cont)
     typedef CContElemConverter<typename TMap::key_type>    TKeyConverter;
     typedef CContElemConverter<typename TMap::mapped_type> TValueConverter;
 
-    string str = ReadStringFromStream(is);
+    string input = ReadStringFromStream(is);
 
-    vector<string> pairs;
-    NStr::Tokenize(str, "&", pairs);
+    vector<CTempString> pairs;
+    NStr::Split(input, "&", pairs,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     cont.clear();
-    ITERATE(vector<string>, it, pairs) {
-        string key;
-        string value;
+    ITERATE(vector<CTempString>, it, pairs) {
+        CTempString key;
+        CTempString value;
         NStr::SplitInTwo(*it, "=", key, value);
         cont.insert(typename TMap::value_type(
                     TKeyConverter::FromString(NStr::URLDecode(key)),
@@ -235,14 +236,15 @@ CNcbiIstream& ReadContainer(CNcbiIstream& is, TCont& cont)
 {
     typedef CContElemConverter<typename TCont::value_type> TValueConverter;
 
-    string str = ReadStringFromStream(is);
+    string input = ReadStringFromStream(is);
 
-    vector<string> vstrings;
-    NStr::Tokenize(str, "&", vstrings);
+    vector<CTempString> strings;
+    NStr::Split(input, "&", strings,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     cont.clear();
-    ITERATE(vector<string>, it, vstrings) {
-        cont.push_back( TValueConverter::FromString(NStr::URLDecode(*it)));
+    ITERATE(vector<CTempString>, it, strings) {
+        cont.push_back(TValueConverter::FromString(NStr::URLDecode(*it)));
     }
 
     return is;
diff --git a/c++/include/cgi/cgi_session.hpp b/c++/include/cgi/cgi_session.hpp
index 5854c36..667dc00 100644
--- a/c++/include/cgi/cgi_session.hpp
+++ b/c++/include/cgi/cgi_session.hpp
@@ -1,7 +1,7 @@
 #ifndef CGI___SESSION__HPP
 #define CGI___SESSION__HPP
 
-/*  $Id: cgi_session.hpp 381205 2012-11-20 14:56:14Z grichenk $
+/*  $Id: cgi_session.hpp 497377 2016-04-06 13:21:42Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -211,7 +211,7 @@ public:
 private:
     const CCgiRequest& m_Request;
     ICgiSessionStorage* m_Impl;
-    auto_ptr<ICgiSessionStorage> m_ImplGuard;
+    unique_ptr<ICgiSessionStorage> m_ImplGuard;
     ECookieSupport m_CookieSupport;
 
     string m_SessionId;
@@ -220,7 +220,7 @@ private:
     string m_SessionCookieDomain;
     string m_SessionCookiePath;
     CTime m_SessionCookieExpTime;
-    auto_ptr<CCgiCookie> m_SessionCookie;
+    unique_ptr<CCgiCookie> m_SessionCookie;
     EStatus m_Status;
 
     void x_Load() const;
diff --git a/c++/include/cgi/cgiapp.hpp b/c++/include/cgi/cgiapp.hpp
index 4514004..c5679fb 100644
--- a/c++/include/cgi/cgiapp.hpp
+++ b/c++/include/cgi/cgiapp.hpp
@@ -1,7 +1,7 @@
 #ifndef CGI___CGIAPP__HPP
 #define CGI___CGIAPP__HPP
 
-/*  $Id: cgiapp.hpp 439566 2014-07-01 15:57:12Z grichenk $
+/*  $Id: cgiapp.hpp 497377 2016-04-06 13:21:42Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -143,8 +143,6 @@ public:
     ///  Optional parameters
     virtual ICgiSessionStorage* GetSessionStorage(CCgiSessionParameters& params) const;
 
-
-
 private:
     virtual ICache* GetCacheStorage() const;
     virtual bool IsCachingNeeded(const CCgiRequest& request) const;
@@ -307,14 +305,14 @@ private:
     // Check if HEAD request has been served.
     bool x_DoneHeadRequest(void) const;
 
-    auto_ptr<CNcbiResource>   m_Resource;
-    auto_ptr<CCgiContext>     m_Context;
-    auto_ptr<ICache>          m_Cache;
+    unique_ptr<CNcbiResource>   m_Resource;
+    unique_ptr<CCgiContext>     m_Context;
+    unique_ptr<ICache>          m_Cache;
 
     typedef map<string, CDiagFactory*> TDiagFactoryMap;
     TDiagFactoryMap           m_DiagFactories;
 
-    auto_ptr<CCookieAffinity> m_Caf;         // Cookie affinity service pointer
+    unique_ptr<CCookieAffinity> m_Caf;         // Cookie affinity service pointer
     char*                     m_HostIP;      // Cookie affinity host IP buffer
 
     unsigned int              m_Iteration;   // (always 0 for plain CGI)
@@ -327,11 +325,11 @@ private:
     mutable bool              m_ArgContextSync;
 
     /// Parsed cmd.-line args (cmdline + CGI)
-    mutable auto_ptr<CArgs>   m_CgiArgs;
+    mutable unique_ptr<CArgs>   m_CgiArgs;
 
     /// Wrappers for cin and cout
-    auto_ptr<CNcbiIstream>    m_InputStream;
-    auto_ptr<CNcbiOstream>    m_OutputStream;
+    unique_ptr<CNcbiIstream>    m_InputStream;
+    unique_ptr<CNcbiOstream>    m_OutputStream;
     bool                      m_OutputBroken;
 
     string m_RID;
@@ -398,6 +396,38 @@ protected:
 };
 
 
+/////////////////////////////////////////////////////////////////////////////
+//  CCgiStreamWrapper::
+//
+//    CGI stream with special processing.
+//
+
+class CCgiStreamWrapperWriter;
+
+class CCgiStreamWrapper : public CWStream
+{
+public:
+    enum EStreamMode {
+        eNormal,         // normal output - write all data as-is
+        eBlockWrites,    // block all writes after HEAD request
+        eChunkedWrites,  // chunked output mode
+    };
+
+    CCgiStreamWrapper(CNcbiOstream& out);
+
+    typedef map<string, string, PNocase> TTrailer;
+
+    // Access to writer's methods.
+    EStreamMode GetWriterMode(void);
+    void SetWriterMode(EStreamMode mode);
+    void SetCacheStream(CNcbiOstream& stream);
+    void FinishChunkedTransfer(const TTrailer* trailer);
+    void AbortChunkedTransfer(void);
+
+private:
+    CCgiStreamWrapperWriter* m_Writer;
+};
+
 
 /////////////////////////////////////////////////////////////////////////////
 //  Tracking Environment
diff --git a/c++/include/cgi/error_codes.hpp b/c++/include/cgi/error_codes.hpp
index fd235c2..2bc5509 100644
--- a/c++/include/cgi/error_codes.hpp
+++ b/c++/include/cgi/error_codes.hpp
@@ -1,7 +1,7 @@
 #ifndef CGI___ERROR_CODES__HPP
 #define CGI___ERROR_CODES__HPP
 
-/*  $Id: error_codes.hpp 460217 2015-02-25 18:00:11Z grichenk $
+/*  $Id: error_codes.hpp 492269 2016-02-16 15:24:58Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -42,8 +42,8 @@ BEGIN_NCBI_SCOPE
 
 
 NCBI_DEFINE_ERRCODE_X(Cgi_API,         501, 10);
-NCBI_DEFINE_ERRCODE_X(Cgi_Application, 502, 14);
-NCBI_DEFINE_ERRCODE_X(Cgi_Response,    503,  5);
+NCBI_DEFINE_ERRCODE_X(Cgi_Application, 502, 16);
+NCBI_DEFINE_ERRCODE_X(Cgi_Response,    503,  7);
 NCBI_DEFINE_ERRCODE_X(Cgi_Resourse,    504,  1);
 NCBI_DEFINE_ERRCODE_X(Cgi_Fast,        505,  9);
 
diff --git a/c++/include/cgi/ncbicgi.hpp b/c++/include/cgi/ncbicgi.hpp
index 355e99b..fe18bbd 100644
--- a/c++/include/cgi/ncbicgi.hpp
+++ b/c++/include/cgi/ncbicgi.hpp
@@ -1,7 +1,7 @@
 #ifndef CGI___NCBICGI__HPP
 #define CGI___NCBICGI__HPP
 
-/*  $Id: ncbicgi.hpp 443709 2014-08-18 18:58:59Z grichenk $
+/*  $Id: ncbicgi.hpp 497377 2016-04-06 13:21:42Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -417,16 +417,16 @@ private:
         SData(const string& value, const string& filename,
               unsigned int position, const string& type)
             : m_Value(value), m_Filename(filename), m_ContentType(type),
-              m_Position(position), m_Reader(NULL) { }
+              m_Position(position) { }
         SData(const SData& data)
             : m_Value(data.m_Value), m_Filename(data.m_Filename),
               m_ContentType(data.m_ContentType),
-              m_Position(data.m_Position), m_Reader(NULL)
+              m_Position(data.m_Position)
             { _ASSERT( !data.m_Reader.get() ); }
 
         string            m_Value, m_Filename, m_ContentType;
         unsigned int      m_Position;
-        auto_ptr<IReader> m_Reader;
+        unique_ptr<IReader> m_Reader;
     };
 
 public:
@@ -760,14 +760,19 @@ public:
     /// Get a set of entries(decoded) received from the client.
     /// Also includes "indexes" if "indexes_as_entries" in the
     /// constructor was TRUE (default).
+    /// NOTE: In the "fParseInputOnDemand" mode not all of the entries
+    ///       may be loaded at the time of the call.
     const TCgiEntries& GetEntries(void) const;
     TCgiEntries& GetEntries(void);
 
     /// Get entry value by name
     ///
-    /// NOTE:  There can be more than one entry with the same name;
-    ///        only one of these entry will be returned.
-    /// To get all matches, use GetEntries() and "multimap::" member functions.
+    /// NOTE 1: There can be more than one entry with the same name;
+    ///         only one of these entry will be returned. To get all matches
+    ///         use GetEntries() and "multimap::" member functions.
+    /// NOTE 2: In the "fParseInputOnDemand" mode not all of the entries
+    ///         may be loaded at the time of the call, so -- use
+    ///         GetPossiblyUnparsedEntry() instead.
     const CCgiEntry& GetEntry(const string& name, bool* is_found = 0) const;
 
     /// Get next entry when parsing input on demand.
@@ -796,9 +801,12 @@ public:
     TCgiIndexes& GetIndexes(void);
 
     enum ESessionCreateMode {
-        eCreateIfNotExist,     ///< If Session does not exist the new one will be created    
-        eDontCreateIfNotExist, ///< If Session does not exist the exception will be thrown
-        eDontLoad              ///< Do not try to load or create session
+        /// If Session does not exist the new one will be created    
+        eCreateIfNotExist,
+        /// If Session does not exist the exception will be thrown
+        eDontCreateIfNotExist,
+        ///< Do not try to load or create session
+        eDontLoad
     };
 
     /// Get session
@@ -882,9 +890,9 @@ public:
 private:
     /// set of environment variables
     const CNcbiEnvironment*    m_Env;
-    auto_ptr<CNcbiEnvironment> m_OwnEnv;
+    unique_ptr<CNcbiEnvironment> m_OwnEnv;
     /// Original request content or NULL if fSaveRequestContent is not set
-    auto_ptr<string>           m_Content;
+    unique_ptr<string>           m_Content;
     /// set of the request FORM-like entries(already retrieved; cached)
     TCgiEntries m_Entries;
     /// set of the request ISINDEX-like indexes(already retrieved; cached)
@@ -920,8 +928,8 @@ private:
     /// Set client-ip property for logging
     void x_SetClientIpProperty(TFlags flags) const;
 
-    /// Set the HitID property of CRequestContext.
-    void x_SetPageHitId(TFlags flags);
+    /// Set the properties of CRequestContext (HitId, Dtab etc.).
+    void x_InitRequestContext(TFlags flags);
 
     /// prohibit default initialization and assignment
     CCgiRequest(const CCgiRequest&);
@@ -929,7 +937,7 @@ private:
 
     string x_RetrieveSessionId() const;
 
-    mutable auto_ptr<CTrackingEnvHolder> m_TrackingEnvHolder;
+    mutable unique_ptr<CTrackingEnvHolder> m_TrackingEnvHolder;
     CCgiSession* m_Session;
     CCgiEntryReaderContext* m_EntryReaderContext;
 
@@ -1108,7 +1116,7 @@ void CCgiEntry::x_ForceComplete() const
     _ASSERT(m_Data->m_Reader.get());
     _ASSERT(m_Data->m_Value.empty());
     SData& data = const_cast<SData&>(*m_Data);
-    auto_ptr<IReader> reader(data.m_Reader.release());
+    unique_ptr<IReader> reader(data.m_Reader.release());
     g_ExtractReaderContents(*reader, data.m_Value);
 }
 
diff --git a/c++/include/cgi/ncbicgir.hpp b/c++/include/cgi/ncbicgir.hpp
index 13f1344..ce94d9e 100644
--- a/c++/include/cgi/ncbicgir.hpp
+++ b/c++/include/cgi/ncbicgir.hpp
@@ -1,7 +1,7 @@
 #ifndef CGI___NCBICGIR__HPP
 #define CGI___NCBICGIR__HPP
 
-/*  $Id: ncbicgir.hpp 483517 2015-11-02 14:43:32Z ivanov $
+/*  $Id: ncbicgir.hpp 492270 2016-02-16 15:25:22Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -208,6 +208,42 @@ public:
     /// Set retry headers from the context.
     void SetRetryContext(const CRetryContext& ctx);
 
+    void SetCgiRequest(const CCgiRequest& request);
+
+    /// Check/change chunked transfer encoding status. This flag is used only
+    /// if CGI_CHUNKED_TRANSFER is not set.
+    bool GetChunkedTransferEnabled(void) const;
+    void SetChunkedTransferEnabled(bool value);
+
+    static size_t GetChunkSize(void);
+
+    /// Finish chunked transfer, append zero chunk and trailers, if any.
+    /// All trailers must be set before calling this method.
+    void FinishChunkedTransfer(void);
+    /// Abort chunked transfer, block any writes to the output stream.
+    void AbortChunkedTransfer(void);
+
+    /// Check if trailer can be sent: chunked transfer must be enabled
+    /// and the request's TE header must include 'trailers'.
+    /// All trailer getters/setters are no-op if this condition is false.
+    /// This will always return false after FinishChunkedTransfer() has been
+    /// called.
+    bool CanSendTrailer(void) const;
+    /// Prepare to send trailer. This must be called before WriteHeader()
+    /// to allow the trailer value to be set later.
+    /// Some fields are not allowed to be sent as trailers - see RFC7230:
+    /// https://tools.ietf.org/html/rfc7230#section-4.1.2
+    void AddTrailer(const string& name);
+    /// Remove trailer. Must be called before WriteHeader().
+    void RemoveTrailer(const string& name);
+    /// Check if trailer has been added and its value can be set.
+    bool   HaveTrailer(const string& name) const;
+    /// Get current trailer value.
+    string GetTrailerValue(const string& name) const;
+    /// Set trailer value. The trailer should have been added using
+    /// AddTrailer().
+    void SetTrailerValue(const string& name, const string& value);
+
 public:
     void x_SetSession(const CCgiSession& session);
 
@@ -235,6 +271,7 @@ protected:
     bool           m_BetweenParts;      // Did we already print the boundary?
     string         m_Boundary;          // Multipart boundary
     TMap           m_HeaderValues;      // Header lines in alphabetical order
+    TMap           m_TrailerValues;     // Trailer lines (for chunked transfers)
     CCgiCookies    m_Cookies;           // Cookies
     CNcbiOstream*  m_Output;            // Default output stream
     int            m_OutputFD;          // Output file descriptor, if available
@@ -251,6 +288,8 @@ private:
     void x_RestoreOutputExceptions(void);
     bool x_ValidateHeader(const string& name, const string& value) const;
 
+    static bool x_ClientSupportsChunkedTransfer(const CNcbiEnvironment& env);
+
     const CCgiSession*   m_Session;
     auto_ptr<CCgiCookie> m_TrackingCookie;
     bool                 m_DisableTrackingCookie;
@@ -263,11 +302,14 @@ private:
     typedef NCBI_PARAM_TYPE(CGI, ExceptionAfterHEAD) TCGI_ExceptionAfterHEAD;
     TCGI_ExceptionAfterHEAD m_ExceptionAfterHEAD;
 
+    const CCgiRequest* m_Request;
+    bool m_ChunkedTransfer;
+    mutable auto_ptr<bool> m_TrailerEnabled;
+
     friend class CCgiContext; // to set m_JQuery_Callback
+    friend class CCgiApplication; // need x_ClientSupportsChunkedTransfer()
 
     string m_JQuery_Callback;
-
-    mutable auto_ptr<CCgiStreamWrapper> m_OutputWrapper;
 };
 
 
@@ -366,6 +408,11 @@ inline bool CCgiResponse::IsHeaderWritten(void) const
     return m_HeaderWritten;
 }
 
+inline void CCgiResponse::SetCgiRequest(const CCgiRequest& request)
+{
+    m_Request = &request;
+}
+
 inline void CCgiResponse::x_SetSession(const CCgiSession& session)
 {
     m_Session = &session;
diff --git a/c++/include/common/boost_skew_guard.hpp b/c++/include/common/boost_skew_guard.hpp
new file mode 100644
index 0000000..2ae8807
--- /dev/null
+++ b/c++/include/common/boost_skew_guard.hpp
@@ -0,0 +1,62 @@
+#ifndef COMMON___BOOST_SKEW_GUARD__HPP
+#define COMMON___BOOST_SKEW_GUARD__HPP
+
+/*  $Id: boost_skew_guard.hpp 477547 2015-08-31 15:59:25Z ucko $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Author:  Aaron Ucko
+ *
+ */
+
+/// @file boost_skew_guard.hpp
+/// Help catch Boost accidental version skew.
+
+#include <ncbiconf.h>
+
+#ifdef NCBI_EXPECTED_BOOST_VERSION
+#  if defined(BOOST_STATIC_ASSERT_HPP) && !defined(BOOST_STATIC_ASSERT_MSG)
+// Evidently pulled in by <boost/static_assert.hpp> itself (by way of our
+// <boost/config.hpp> wrapper); break the cycle as cleanly as possible
+// without losing the ability to call BOOST_STATIC_ASSERT_MSG here.
+#    undef BOOST_STATIC_ASSERT_HPP
+#    define STATIC_ASSERTION_FAILURE STATIC_ASSERTION_FAILURE_
+#    define static_assert_test       static_assert_test_
+#  endif
+#  include <corelib/ncbistl.hpp>
+#  include <boost/static_assert.hpp>
+#  include <boost/version.hpp>
+BEGIN_LOCAL_NAMESPACE;
+BOOST_STATIC_ASSERT_MSG(BOOST_VERSION == NCBI_EXPECTED_BOOST_VERSION,
+    "Boost version skew detected; please remember to use $(BOOST_INCLUDE)!"
+    " (Expected " NCBI_AS_STRING(NCBI_EXPECTED_BOOST_VERSION)
+    ", but got " NCBI_AS_STRING(BOOST_VERSION) ".)");
+END_LOCAL_NAMESPACE;
+#  ifdef STATIC_ASSERTION_FAILURE
+#    undef STATIC_ASSERTION_FAILURE
+#    undef static_assert_test
+#  endif
+#endif
+
+#endif  /* COMMON___BOOST_SKEW_GUARD__HPP */
diff --git a/c++/include/common/config/ncbiconf_msvc.h b/c++/include/common/config/ncbiconf_msvc.h
index 0a40159..c5d805a 100644
--- a/c++/include/common/config/ncbiconf_msvc.h
+++ b/c++/include/common/config/ncbiconf_msvc.h
@@ -1,4 +1,4 @@
-/* $Id: ncbiconf_msvc.h 457074 2015-01-20 16:19:10Z ucko $
+/* $Id: ncbiconf_msvc.h 487459 2015-12-17 18:57:21Z ucko $
  * By Denis Vakatov, NCBI (vakatov at ncbi.nlm.nih.gov)
  *
  * MS-Win 32/64, MSVC++ 6.0/.NET
@@ -48,6 +48,7 @@
 #define SIZEOF_LONG         4
 #define SIZEOF_LONG_DOUBLE  8
 #define SIZEOF_SHORT        2
+#define SIZEOF_WCHAR_T      2
 
 #define STDC_HEADERS     1
 
@@ -56,6 +57,7 @@
 #define HAVE_IOSTREAM    1
 #define HAVE_IOSTREAM_H  1
 #define HAVE_LIMITS      1
+#define HAVE_LIMITS_H    1
 #define HAVE_STRSTREA_H  1
 #define HAVE_STRSTREAM   1
 #define HAVE_SYS_STAT_H  1
@@ -88,6 +90,7 @@ typedef __int64 ssize_t;
 #  define SIZEOF_SIZE_T       8
 #  define SIZEOF_VOIDP        8
 #  define NCBI_PLATFORM_BITS  64
+#  define NCBI_SQLCOLATTRIBUTE_SQLLEN 1
 #else
 #  define HOST         "i386-pc-win32"
 #  define HOST_OS      "win32"
@@ -100,14 +103,20 @@ typedef   int   ssize_t;
 
 #define HAVE_LIBKRB5                    1
 
-/* FreeTDS v0.63 */
+/* FreeTDS */
 
+#define HAVE_ALARM                      1
 #define HAVE_ATOLL                      1
 #define HAVE_ERRNO_H                    1
+#define HAVE_FSTAT                      1
 #define HAVE_GETHOSTNAME                1
 #define HAVE_INT64                      1
+#define HAVE_LOCALE_H                   1
 #define HAVE_MALLOC_H                   1
 #define HAVE_MEMORY_H                   1
+#define HAVE_PUTENV                     1
+#define HAVE_SQLLEN                     1
+#define HAVE_SQLSETPOSIROW              1
 #define HAVE_STDLIB_H                   1
 #define HAVE_STRING_H                   1
 
diff --git a/c++/include/common/config/ncbiconf_universal.h b/c++/include/common/config/ncbiconf_universal.h
index 4d3a563..e901d26 100644
--- a/c++/include/common/config/ncbiconf_universal.h
+++ b/c++/include/common/config/ncbiconf_universal.h
@@ -1,7 +1,7 @@
 #ifndef NCBICONF_UNIVERSAL_H
 #define NCBICONF_UNIVERSAL_H
 
-/*  $Id: ncbiconf_universal.h 258390 2011-03-20 02:24:33Z ucko $
+/*  $Id: ncbiconf_universal.h 487459 2015-12-17 18:57:21Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -56,6 +56,7 @@
 #  endif
 #  define SIZEOF_LONG_LONG     8
 #  define SIZEOF_SHORT         2
+#  define SIZEOF_WCHAR_T       4
 /* Define these macros to literal constants rather than calculating them,
  * to avoid redefinition warnings when using some third-party libraries. */
 #  if LONG_BIT == 64
diff --git a/c++/include/common/config/ncbiconf_xcode.h b/c++/include/common/config/ncbiconf_xcode.h
index 65e171a..3252246 100644
--- a/c++/include/common/config/ncbiconf_xcode.h
+++ b/c++/include/common/config/ncbiconf_xcode.h
@@ -1,4 +1,4 @@
-/* $Id: ncbiconf_xcode.h 457074 2015-01-20 16:19:10Z ucko $
+/* $Id: ncbiconf_xcode.h 487685 2015-12-19 23:48:10Z ucko $
  * By Vlad Lebedev, NCBI (lebedev at ncbi.nlm.nih.gov)
  *
  * Mac OS X - xCode Build
@@ -110,6 +110,9 @@
 /* Define to 1 if necessary to get FIONBIO (e.g., on Solaris) */
 /* #undef BSD_COMP */
 
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
+
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #define HAVE_ARPA_INET_H 1
 
@@ -177,6 +180,9 @@
 /* Define to 1 if you have the `fseeko' function. */
 #define HAVE_FSEEKO 1
 
+/* Define to 1 if you have the `fstat' function. */
+#define HAVE_FSTAT 1
+
 /* Define to 1 if you have the <fstream> header file. */
 #define HAVE_FSTREAM 1
 
@@ -215,6 +221,9 @@
 /* Define to 1 if you have the `getlogin_r' function */
 #define HAVE_GETLOGIN_R 1
 
+/* Define to 1 if you have the `getopt' function. */
+#define HAVE_GETOPT 1
+
 /* Define to 1 if you have the `getnameinfo' function. */
 #define HAVE_GETNAMEINFO 1
 
@@ -285,6 +294,9 @@
 /* Define to 1 if FreeTDS libraries are available. */
 /* #undef HAVE_LIBFTDS */
 
+/* Define to 1 if you have the <libgen.h> header file. */
+#define HAVE_LIBGEN_H 1
+
 /* Define to 1 if you have libglut. */
 /* #undef HAVE_LIBGLUT */
 
@@ -349,6 +361,12 @@
 /* Define to 1 if you have the <limits> header file. */
 #define HAVE_LIMITS 1
 
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
 /* Define to 1 if you have the `localtime_r' function. */
 #define HAVE_LOCALTIME_R 1
 
@@ -409,12 +427,18 @@
 /* Define to 1 if you have the `pthread_atfork' function. */
 /* #undef HAVE_PTHREAD_ATFORK */
 
+/* Define to 1 if you have the `pthread_condattr_setclock' function. */
+/* #undef HAVE_PTHREAD_CONDATTR_SETCLOCK */
+
 /* Define to 1 if pthread mutexes are available. */
 #define HAVE_PTHREAD_MUTEX 1
 
 /* Define to 1 if you have the `pthread_setconcurrency' function. */
 #define HAVE_PTHREAD_SETCONCURRENCY 1
 
+/* Define to 1 if you have the `putenv' function. */
+#define HAVE_PUTENV 1
+
 /* Define to 1 if Python 2.3 libraries are available. */
 /* #undef HAVE_PYTHON23 */
 
@@ -444,12 +468,18 @@
 /* Define to 1 if you have `union semun'. */
 #define HAVE_SEMUN 1
 
+/* Define to 1 if you have the `setenv' function. */
+#define HAVE_SETENV 1
+
 /* Define to 1 if you have the <signal.h> header file. */
 #define HAVE_SIGNAL_H 1
 
 /* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */
 #define HAVE_SIN_LEN 1
 
+/* Define to 1 if you have the `socketpair' function. */
+#define HAVE_SOCKETPAIR 1
+
 /* Define to 1 if the system has the type `socklen_t'. */
 #define HAVE_SOCKLEN_T 1
 
@@ -459,12 +489,18 @@
 /* Define to 1 if the system has the type `SQLLEN'. */
 #define HAVE_SQLLEN 1
 
+/* Define to 1 if the system has the type `SQLSETPOSIROW'. */
+#define HAVE_SQLSETPOSIROW 1
+
 /* Define to 1 if you have the `statfs' function. */
 #define HAVE_STATFS 1
 
 /* Define to 1 if you have the `statvfs' function. */
 #define HAVE_STATVFS 1
 
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #define HAVE_STDINT_H 1
 
@@ -495,6 +531,9 @@
 /* Define to 1 if you have the `strndup' function. */
 /* #undef HAVE_STRNDUP */
 
+/* Define to 1 if you have the `strsep' function. */
+#undef HAVE_STRSEP
+
 /* Define to 1 if you have the <strstream> header file. */
 #define HAVE_STRSTREAM 1
 
@@ -577,6 +616,9 @@
 /* Define to 1 if you have the `utimes' function. */
 #define HAVE_UTIMES 1
 
+/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
+/* #undef HAVE_VALGRIND_MEMCHECK_H */
+
 /* Define to 1 if you have the `vasprintf' function. */
 #define HAVE_VASPRINTF 1
 
@@ -654,7 +696,7 @@
 #define NCBI_RESTRICT_CXX __restrict__
 
 /* Define to 1 if SQLColAttribute's last argument is an SQLLEN * */
-/* #undef NCBI_SQLCOLATTRIBUTE_SQLLEN */
+#define NCBI_SQLCOLATTRIBUTE_SQLLEN 1
 
 /* Define to whatever syntax your compiler supports for declaring thread-local
    variables, or leave undefined if it doesn't. */
diff --git a/c++/include/common/ncbi_export.h b/c++/include/common/ncbi_export.h
index 40c84ef..f4cc8b3 100644
--- a/c++/include/common/ncbi_export.h
+++ b/c++/include/common/ncbi_export.h
@@ -1,7 +1,7 @@
 #ifndef COMMON___NCBI_EXPORT__H
 #define COMMON___NCBI_EXPORT__H
 
-/*  $Id: ncbi_export.h 461904 2015-03-13 15:31:15Z kachalos $
+/*  $Id: ncbi_export.h 480275 2015-09-29 15:35:34Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1436,6 +1436,15 @@
 #endif
 
 
+/* Export specifier for library ncbi_id2proc_wgs
+ */
+#ifdef NCBI_ID2PROC_WGS_EXPORTS
+#  define NCBI_ID2PROC_WGS_EXPORT NCBI_DLL_EXPORT
+#else
+#  define NCBI_ID2PROC_WGS_EXPORT NCBI_DLL_IMPORT
+#endif
+
+
 
 /* STATIC LIBRARIES SECTION */
 /* This section is for static-only libraries */
diff --git a/c++/include/common/ncbi_package_ver.h b/c++/include/common/ncbi_package_ver.h
index c5a4d4c..ef342a3 100644
--- a/c++/include/common/ncbi_package_ver.h
+++ b/c++/include/common/ncbi_package_ver.h
@@ -7,7 +7,7 @@
 #define NCBI_PACKAGE                       1
 #define NCBI_PACKAGE_NAME                  "blast"
 #define NCBI_PACKAGE_VERSION_MAJOR         2
-#define NCBI_PACKAGE_VERSION_MINOR         3
+#define NCBI_PACKAGE_VERSION_MINOR         4
 #define NCBI_PACKAGE_VERSION_PATCH         0
 #define NCBI_PACKAGE_CONFIG                ""
 
diff --git a/c++/include/common/ncbi_source_ver.h b/c++/include/common/ncbi_source_ver.h
index ecf53ff..c0b214e 100644
--- a/c++/include/common/ncbi_source_ver.h
+++ b/c++/include/common/ncbi_source_ver.h
@@ -1,4 +1,4 @@
-/*  $Id: ncbi_source_ver.h 472591 2015-07-11 04:03:06Z syncbot $
+/*  $Id: ncbi_source_ver.h 498533 2016-04-16 04:03:05Z syncbot $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -24,5 +24,5 @@
  * ===========================================================================
  */
 
-#define NCBI_PRODUCTION_VER 20150711
-#define NCBI_DEVELOPMENT_VER 20150604
+#define NCBI_PRODUCTION_VER 20160416
+#define NCBI_DEVELOPMENT_VER 20160127
diff --git a/c++/include/common/ncbiconf_impl.h b/c++/include/common/ncbiconf_impl.h
index 954f54b..bdd3d14 100644
--- a/c++/include/common/ncbiconf_impl.h
+++ b/c++/include/common/ncbiconf_impl.h
@@ -1,7 +1,7 @@
 #ifndef COMMON___NCBICONF_IMPL__H
 #define COMMON___NCBICONF_IMPL__H
 
-/* $Id: ncbiconf_impl.h 457074 2015-01-20 16:19:10Z ucko $
+/* $Id: ncbiconf_impl.h 469886 2015-06-09 18:23:33Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -128,8 +128,9 @@
 #endif
 
 #ifdef __cplusplus
-#  if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) \
-      || defined(__GXX_EXPERIMENTAL_CPP0X__)
+#  if __cplusplus >= 201103L  ||  defined(__GXX_EXPERIMENTAL_CXX0X__) \
+      ||  defined(__GXX_EXPERIMENTAL_CPP0X__)  \
+      ||  (defined(NCBI_COMPILER_MSVC)  &&  _MSC_VER >= 1800)
 #    define NCBI_HAVE_CXX11 1
 #  endif
 #  if defined(NCBI_HAVE_CXX11) \
@@ -137,7 +138,7 @@
 #    define HAVE_IS_SORTED 1
 #    define HAVE_NULLPTR 1
 #  endif
-#  if defined(NCBI_HAVE_CXX11) /* or recent MSVC too? */
+#  if defined(NCBI_HAVE_CXX11)
 #    if !defined(NCBI_COMPILER_ICC)  ||  NCBI_COMPILER_VERSION >= 1400
        /* Exclude ICC 13.x and below, which don't support using "enum class"
         * in conjunction with switch. */
diff --git a/c++/include/connect/ncbi_buffer.h b/c++/include/connect/ncbi_buffer.h
index 8ecea35..d9443a1 100644
--- a/c++/include/connect/ncbi_buffer.h
+++ b/c++/include/connect/ncbi_buffer.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_BUFFER__H
 #define CONNECT___NCBI_BUFFER__H
 
-/* $Id: ncbi_buffer.h 463881 2015-04-01 21:51:06Z lavr $
+/* $Id: ncbi_buffer.h 482179 2015-10-21 15:02:35Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -159,8 +159,6 @@ extern NCBI_XCONNECT_EXPORT /*bool*/int BUF_Write
  );
 
 
-#define BUF_PushBack  BUF_Pushback
-
 /*!
  * Write the data to the very beginning of "*pBuf" (to be read first).
  * On error (failed memory allocation), return zero value.
diff --git a/c++/include/connect/ncbi_conn_exception.hpp b/c++/include/connect/ncbi_conn_exception.hpp
index a986b49..179e142 100644
--- a/c++/include/connect/ncbi_conn_exception.hpp
+++ b/c++/include/connect/ncbi_conn_exception.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_CONN_EXCEPTION__HPP
 #define CONNECT___NCBI_CONN_EXCEPTION__HPP
 
-/* $Id: ncbi_conn_exception.hpp 403423 2013-06-14 15:37:50Z lavr $
+/* $Id: ncbi_conn_exception.hpp 487716 2015-12-21 16:13:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,7 +77,7 @@ public:
         eUnknown      = eIO_Unknown
     };
     virtual const char* GetErrCodeString(void) const;
-    NCBI_EXCEPTION_DEFAULT(CIO_Exception, CException);
+    NCBI_EXCEPTION_DEFAULT(CIO_Exception, CConnException);
 };
 
 
diff --git a/c++/include/connect/ncbi_conn_reader_writer.hpp b/c++/include/connect/ncbi_conn_reader_writer.hpp
index 379810b..70c7749 100644
--- a/c++/include/connect/ncbi_conn_reader_writer.hpp
+++ b/c++/include/connect/ncbi_conn_reader_writer.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_CONN_READER_WRITER__HPP
 #define CONNECT___NCBI_CONN_READER_WRITER__HPP
 
-/* $Id: ncbi_conn_reader_writer.hpp 463881 2015-04-01 21:51:06Z lavr $
+/* $Id: ncbi_conn_reader_writer.hpp 477207 2015-08-27 13:37:22Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -51,7 +51,8 @@ class NCBI_XCONNECT_EXPORT CSocketReaderWriter : public    IReaderWriter,
                                                  protected CConnIniter
 {
 public:
-    CSocketReaderWriter(CSocket* sock, EOwnership if_to_own = eNoOwnership);
+    CSocketReaderWriter(CSocket* sock, EOwnership if_to_own = eNoOwnership,
+            EIO_WriteMethod write_method = eIO_WritePersist);
 
     virtual ERW_Result Read(void*   buf,
                             size_t  count,
@@ -75,6 +76,7 @@ protected:
     ERW_Result         x_Result(EIO_Status status);
 
     AutoPtr<CSocket>   m_Sock;
+    const EIO_WriteMethod m_WriteMethod;
 
 private:
     CSocketReaderWriter(const CSocketReaderWriter&);
@@ -84,8 +86,10 @@ private:
 
 
 inline CSocketReaderWriter::CSocketReaderWriter(CSocket*   sock,
-                                                EOwnership if_to_own)
-    : m_Sock(sock, if_to_own)
+                                                EOwnership if_to_own,
+                                                EIO_WriteMethod write_method)
+    : m_Sock(sock, if_to_own),
+      m_WriteMethod(write_method)
 {
 }
 
@@ -105,7 +109,7 @@ inline ERW_Result CSocketReaderWriter::Write(const void* buf,
                                              size_t*     n_written)
 {
     return m_Sock
-        ? x_Result(m_Sock->Write(buf, count, n_written))
+        ? x_Result(m_Sock->Write(buf, count, n_written, m_WriteMethod))
         : eRW_Error;
 }
 
diff --git a/c++/include/connect/ncbi_conn_stream.hpp b/c++/include/connect/ncbi_conn_stream.hpp
index 3ced550..3f31147 100644
--- a/c++/include/connect/ncbi_conn_stream.hpp
+++ b/c++/include/connect/ncbi_conn_stream.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_CONN_STREAM__HPP
 #define CONNECT___NCBI_CONN_STREAM__HPP
 
-/* $Id: ncbi_conn_stream.hpp 464976 2015-04-15 18:27:40Z lavr $
+/* $Id: ncbi_conn_stream.hpp 475395 2015-08-07 14:35:49Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -475,7 +475,7 @@ public:
 struct SHTTP_StatusData {
     int    code;
     string text;
-    SHTTP_StatusData(void) : code(0), text(kEmptyStr) { }
+    SHTTP_StatusData(void) : code(0) { }
 };
 
 
@@ -566,6 +566,8 @@ public:
      size_t              buf_size     = kConn_DefaultBufSize
      );
 
+    ~CConn_HttpStream();
+
     /// Flush the stream and fetch the response (w/o extracting any user data)
     EIO_Status    Fetch(const STimeout* timeout = kDefaultTimeout);
 
@@ -635,6 +637,8 @@ public:
      const STimeout*       timeout  = kDefaultTimeout,
      size_t                buf_size = kConn_DefaultBufSize);
 
+    ~CConn_ServiceStream();
+
     /// Flush the stream and fetch the response (w/o extracting any user data)
     EIO_Status    Fetch(const STimeout* timeout = kDefaultTimeout);
 
diff --git a/c++/include/connect/ncbi_connection.h b/c++/include/connect/ncbi_connection.h
index 7174839..bb4081e 100644
--- a/c++/include/connect/ncbi_connection.h
+++ b/c++/include/connect/ncbi_connection.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_CONNECTION__H
 #define CONNECT___NCBI_CONNECTION__H
 
-/* $Id: ncbi_connection.h 463881 2015-04-01 21:51:06Z lavr $
+/* $Id: ncbi_connection.h 471572 2015-06-29 16:05:55Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -439,6 +439,33 @@ extern NCBI_XCONNECT_EXPORT TCONN_Flags CONN_GetFlags
  );
 
 
+/** Associate an arbitraty user data pointer with the connection.
+ * The pointer is not used by the connection itself but is retrievable with
+ * CONN_GetUserData() from the user's code as long as the CONN handle remains
+ * valid.  Successive calls to CONN_SetUserData() replace the pointer value.
+ * @return
+ *  eIO_Success on success, other error code on error.
+ * @sa
+ *  CONN_Create, CONN_GetUserData
+ */
+extern NCBI_XCONNECT_EXPORT EIO_Status CONN_SetUserData
+(CONN  conn,  /**< [in]  connection handle */
+ void* data   /**< [in]  user data pointer */
+ );
+
+
+/** Get current value of the user's data pointer last associated with the
+ * connection, or NULL (if CONN is NULL or no pointer is currently set).
+ * @return
+ *  Current value of the user pointer.
+ * @sa
+ *  CONN_Create, CONN_SetUserData
+ */
+extern NCBI_XCONNECT_EXPORT void* CONN_GetUserData
+(CONN conn  /**< [in]  connection handle */
+ );
+
+
 #ifdef __cplusplus
 }  /* extern "C" */
 #endif
diff --git a/c++/include/connect/ncbi_connutil.h b/c++/include/connect/ncbi_connutil.h
index 9ab4a94..5ad9a00 100644
--- a/c++/include/connect/ncbi_connutil.h
+++ b/c++/include/connect/ncbi_connutil.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_CONNUTIL__H
 #define CONNECT___NCBI_CONNUTIL__H
 
-/* $Id: ncbi_connutil.h 464990 2015-04-15 19:48:15Z lavr $
+/* $Id: ncbi_connutil.h 500351 2016-05-04 09:45:13Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -108,12 +108,13 @@ typedef enum {
     eReqMethod_Post,         /*  2 */
     eReqMethod_Head,         /*  3 */
     eReqMethod_Connect,      /*  4 */
-    /* HTTP/1.1, not yet supported */
+    /* HTTP/1.1 */
     eReqMethod_v1  = 8,
     eReqMethod_Put = 16,     /* 16 */
-    eReqMethod_Trace,        /* 17 */
-    eReqMethod_Delete,       /* 18 */
-    eReqMethod_Options       /* 19 */
+    eReqMethod_Patch,        /* 17 */
+    eReqMethod_Trace,        /* 18 */
+    eReqMethod_Delete,       /* 19 */
+    eReqMethod_Options       /* 20 */
 } EReqMethod;
 
 typedef unsigned TReqMethod; /* EReqMethod or (EReqMethod | eReqMethod_v1) */
@@ -237,9 +238,6 @@ typedef struct {  /* NCBI_FAKE_WARNING: ICC */
 #define REG_CONN_HTTP_PUSH_AUTH   "HTTP_PUSH_AUTH"
 #define DEF_CONN_HTTP_PUSH_AUTH   ""
 
-#define REG_CONN_PROXY_HOST       "PROXY_HOST"
-#define DEF_CONN_PROXY_HOST       ""
-
 #define REG_CONN_TIMEOUT          "TIMEOUT"
 #define DEF_CONN_TIMEOUT          30.0
 
@@ -268,6 +266,7 @@ typedef struct {  /* NCBI_FAKE_WARNING: ICC */
 #define REG_CONN_SERVICE_NAME     "SERVICE_NAME"
 #define REG_CONN_LOCAL_ENABLE     "LOCAL_ENABLE"
 #define REG_CONN_LBSMD_DISABLE    "LBSMD_DISABLE"
+#define REG_CONN_LBOS_ENABLE      "LBOS_ENABLE"
 #define REG_CONN_DISPD_DISABLE    "DISPD_DISABLE"
 
 /* Local service dispatcher */
@@ -342,8 +341,8 @@ extern NCBI_XCONNECT_EXPORT int/*bool*/ ConnNetInfo_Boolean
  *  svc               SERVICE_NAME      no search/no value without service
  *
  * A value of the field NAME is first looked up in the environment variable
- * of the form service_CONN_<NAME>; then in the current corelib registry,
- * in the section 'service' by using key CONN_<NAME>; then in the environment
+ * of the form <service>_CONN_<NAME>; then in the current corelib registry, in
+ * the section 'service' by using the CONN_<NAME> key; then in the environment
  * variable again, but using the name CONN_<NAME>; and finally in the default
  * registry section (DEF_CONN_REG_SECTION), using just <NAME>. If service
  * is NULL or empty then the first 2 steps in the above lookup are skipped.
diff --git a/c++/include/connect/ncbi_core_cxx.hpp b/c++/include/connect/ncbi_core_cxx.hpp
index 45f4c94..026ad45 100644
--- a/c++/include/connect/ncbi_core_cxx.hpp
+++ b/c++/include/connect/ncbi_core_cxx.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_CORE_CXX__H
 #define CONNECT___NCBI_CORE_CXX__H
 
-/* $Id: ncbi_core_cxx.hpp 373831 2012-09-04 16:35:10Z lavr $
+/* $Id: ncbi_core_cxx.hpp 470048 2015-06-10 19:03:03Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -106,7 +106,7 @@ typedef unsigned int TConnectInitFlags;  ///< Bitwise OR of EConnectInitFlag
 /// @note  MUST be called in MT applications to make CONNECT MT-safe, or
 ///        CConnIniter must be used as a base-class.
 /// @param reg
-///  Registry to use (CNcbiApplication's registry if NULL)
+///  Registry to use (none if NULL)
 /// @param lock
 ///  Lock to use (new lock will get created if NULL)
 /// @param flag
@@ -124,7 +124,7 @@ extern NCBI_XCONNECT_EXPORT void CONNECT_Init
 ///
 /// Helper hook-up class that installs default logging/registry/locking (but
 /// only if they have not yet been installed explicitly by user) as if by
-/// calling CONNECT_Init() automagically.
+/// calling CONNECT_Init(&CNcbiApplication::GetConfig()) automagically.
 /// @note  Derive your CONNECT-dependent classes from this class for MT safety.
 /// @sa
 ///  CONNECT_Init
diff --git a/c++/include/connect/ncbi_http_connector.h b/c++/include/connect/ncbi_http_connector.h
index d0ad7fb..1464cae 100644
--- a/c++/include/connect/ncbi_http_connector.h
+++ b/c++/include/connect/ncbi_http_connector.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___HTTP_CONNECTOR__H
 #define CONNECT___HTTP_CONNECTOR__H
 
-/* $Id: ncbi_http_connector.h 468400 2015-05-22 15:00:30Z lavr $
+/* $Id: ncbi_http_connector.h 500355 2016-05-04 09:47:56Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -59,6 +59,8 @@ extern "C" {
 /** HTTP connector flags.
  *
  * @var fHTTP_Flushable
+ *
+ *    HTTP/1.0 or when fHTTP_WriteThru is not set:
  *       by default all data written to the connection are kept until read
  *       begins (even though CONN_Flush() might have been called in between the
  *       writes);  with this flag set, CONN_Flush() will result the data to be
@@ -67,12 +69,22 @@ extern "C" {
  *       assures that the connector sends at least an HTTP header on "CLOSE"
  *       and re-"CONNECT", even if no data for HTTP body have been written.
  *
+ *    HTTP/1.1 and when fHTTP_WriteThru is set:
+ *       CONN_Flush() attempts to send all pending data down to server.
+ *
  * @var fHTTP_KeepHeader
  *       Do not strip HTTP header (i.e. everything up to the first "\r\n\r\n",
  *       including the "\r\n\r\n") from the CGI script's response (including
  *       any server error, which then is made available for reading as well)
  *       *NOTE* this flag disables automatic authorization and redirection.
  *
+ * @var fHTTP_WriteThru
+ *       Valid only with HTTP/1.1:  Connection to the server is made upon a
+ *       first CONN_Write(), or CONN_Flush() if fHTTP_Flushable is set, or
+ *       CONN_Wait(eIO_Write), and each CONN_Write() forms a chunk of HTTP
+ *       data to be sent to the server.  Reading / waiting for read from the
+ *       connector finalizes the body and, if reading, fetches the response.
+ *
  * @var fHCC_UrlDecodeInput
  *       Assume the response body as single-part, URL-encoded;  perform the
  *       URL-decoding on read, and deliver decoded data to the user.  Obsolete.
@@ -93,7 +105,7 @@ extern "C" {
  *       Do not attempt any auto-retries in case of failing connections
  *       (this flag effectively means having SConnNetInfo::max_try set to 1).
 
- * @var fHTTP_InsecureRedirect
+ * @var fHTTP_UnsafeRedirects
  *       For security reasons the following redirects comprise security risk,
  *       and thus, are prohibited:  switching from https to http, and/or
  *       re-POSTing data (regardless of the transport, either http or https);
@@ -114,11 +126,13 @@ enum EHTTP_Flag {
     fHTTP_UrlDecodeInput  = 0x10,      URL-decode response body
     fHTTP_UrlEncodeOutput = 0x20,      URL-encode all output data
     fHTTP_UrlCodec        = 0x30,      fHTTP_UrlDecodeInput | ...EncodeOutput*/
+    fHTTP_PushAuth        = 0x10, /**< HTTP/1.1 pushes out auth if present   */
+    fHTTP_WriteThru       = 0x20, /**< HTTP/1.1 writes through (chunked)     */
     fHTTP_NoUpread        = 0x40, /**< Do not use SOCK_SetReadOnWrite()      */
     fHTTP_DropUnread      = 0x80, /**< Each microsession drops unread data   */
     fHTTP_NoAutoRetry     = 0x100,/**< No auto-retries allowed               */
     fHTTP_NoAutomagicSID  = 0x200,/**< Do not add NCBI SID automagically     */
-    fHTTP_InsecureRedirect= 0x400,/**< Any redirect will be honored          */
+    fHTTP_UnsafeRedirects = 0x400,/**< Any redirect will be honored          */
     fHTTP_AdjustOnRedirect= 0x800,/**< Call adjust routine for redirects, too*/
     fHTTP_SuppressMessages= 0x1000/**< Most annoying ones reduced to traces  */
 };
@@ -126,17 +140,17 @@ typedef unsigned int THTTP_Flags; /**< Bitwise OR of EHTTP_Flag              */
 NCBI_HTTP_CONNECTOR_DEPRECATED
 /** DEPRECATED, do not use! */
 typedef enum {
-    fHCC_AutoReconnect    = fHTTP_AutoReconnect,
-    fHCC_SureFlush        = fHTTP_Flushable,
-    fHCC_KeepHeader       = fHTTP_KeepHeader,
+    /*fHCC_AutoReconnect    = fHTTP_AutoReconnect,*/
+    /*fHCC_SureFlush        = fHTTP_Flushable,    */
+    /*fHCC_KeepHeader       = fHTTP_KeepHeader,   */
     fHCC_UrlEncodeArgs    = 0x8,  /**< NB: Error-prone semantics, do not use!*/
     fHCC_UrlDecodeInput   = 0x10, /**< Obsolete, may not work, do not use!   */
     fHCC_UrlEncodeOutput  = 0x20, /**< Obsolete, may not work, do not use!   */
-    fHCC_UrlCodec         = 0x30, /**< fHCC_UrlDecodeInput | ...EncodeOutput */
-    fHCC_DropUnread       = fHTTP_DropUnread,
-    fHCC_NoUpread         = fHTTP_NoUpread,
-    fHCC_Flushable        = fHTTP_Flushable,
-    fHCC_NoAutoRetry      = fHTTP_NoAutoRetry
+    fHCC_UrlCodec         = 0x30  /**< fHCC_UrlDecodeInput | ...EncodeOutput */
+    /*fHCC_DropUnread       = fHTTP_DropUnread,   */
+    /*fHCC_NoUpread         = fHTTP_NoUpread,     */
+    /*fHCC_Flushable        = fHTTP_Flushable,    */
+    /*fHCC_NoAutoRetry      = fHTTP_NoAutoRetry   */
 } EHCC_Flag;
 NCBI_HTTP_CONNECTOR_DEPRECATED
 typedef unsigned int THCC_Flags;  /**< bitwise OR of EHCC_Flag, deprecated   */
@@ -221,22 +235,24 @@ typedef void        (*FHTTP_Cleanup)
  *
  * If "net_info" does not explicitly specify an HTTP request method (i.e. it
  * has it as "eReqMethod_Any"), then the actual method sent to the HTTP server
- * depends on whether any data have been written to the connection with
- * CONN_Write():  the presense of pending data will cause a POST request (with
+ * depends on whether any data has been written to the connection with
+ * CONN_Write():  the presence of pending data will cause a POST request (with
  * a "Content-Length:" tag supplied automatically and reflecting the total
  * pending data size), and GET request method will result in the absence of any
  * data.  An explicit value for the request method will cause the specified
  * request to be used regardless of pending data, and will flag an error if any
  * data will have to be sent with a GET (per the standard).
  *
- * In order to workaround some HTTP communication features, this code does:
+ * When not using HTTP/1.1's fHTTP_WriteThru mode, in order to work around
+ * some HTTP communication features, this code does:
+ *
  *  1. Accumulate all output data in an internal memory buffer until the
  *     first CONN_Read() (including peek) or CONN_Wait(on read) is attempted
  *     (also see fHTTP_Flushable flag below).
  *  2. On the first CONN_Read() or CONN_Wait(on read), compose and send the
  *     whole HTTP request as:
  *        @verbatim
- *        {POST|GET} <net_info->path>?<net_info->args> HTTP/1.0\r\n
+ *        METHOD <net_info->path>?<net_info->args> HTTP/1.0\r\n
  *        <user_header\r\n>
  *        Content-Length: <accumulated_data_length>\r\n
  *        \r\n
@@ -266,6 +282,10 @@ typedef void        (*FHTTP_Cleanup)
  *     new data generated in response to the latest request.  The behavior can
  *     be changed by the fHTTP_DropUnread flag.
  *
+ *  When fHTTP_WriteThru is set with HTTP/1.1, writing to the connector begins
+ *  upon any write operations, and reading from the connector causes the
+ *  request body to finalize and response to be fetched from the server.
+ *
  *  @note
  *     If "fHTTP_AutoReconnect" is set in "flags", then the connector makes an
  *     automatic reconnect to the same URL with just the same parameters for
diff --git a/c++/include/connect/ncbi_http_session.hpp b/c++/include/connect/ncbi_http_session.hpp
index 5bb0a62..bbd6cc5 100644
--- a/c++/include/connect/ncbi_http_session.hpp
+++ b/c++/include/connect/ncbi_http_session.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_HTTP_SESSION__HPP
 #define CONNECT___NCBI_HTTP_SESSION__HPP
 
-/* $Id: ncbi_http_session.hpp 465171 2015-04-17 15:05:33Z grichenk $
+/* $Id: ncbi_http_session.hpp 492271 2016-02-16 15:25:30Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -85,7 +85,7 @@ CHttpResponse g_HttpGet(const CUrl&         url,
 NCBI_XCONNECT_EXPORT
 CHttpResponse g_HttpPost(const CUrl&     url,
                          CTempString     data,
-                         CTempString     content_type = kEmptyStr,
+                         CTempString     content_type = CTempString(),
                          const CTimeout& timeout = CTimeout(CTimeout::eDefault),
                          THttpRetries    retries = null);
 
@@ -96,10 +96,31 @@ NCBI_XCONNECT_EXPORT
 CHttpResponse g_HttpPost(const CUrl&         url,
                          const CHttpHeaders& headers,
                          CTempString         data,
-                         CTempString         content_type = kEmptyStr,
+                         CTempString         content_type = CTempString(),
                          const CTimeout&     timeout = CTimeout(CTimeout::eDefault),
                          THttpRetries        retries = null);
 
+/// Shortcut for PUT request. Each request uses a separate session,
+/// no data like cookies is shared between multiple requests.
+/// @sa CHttpSession::Put()
+NCBI_XCONNECT_EXPORT
+CHttpResponse g_HttpPut(const CUrl&     url,
+                        CTempString     data,
+                        CTempString     content_type = CTempString(),
+                        const CTimeout& timeout = CTimeout(CTimeout::eDefault),
+                        THttpRetries    retries = null);
+
+/// Shortcut for PUT request with custom headers. Each request uses a separate
+/// session, no data like cookies is shared between multiple requests.
+/// @sa CHttpSession::Put()
+NCBI_XCONNECT_EXPORT
+CHttpResponse g_HttpPut(const CUrl&         url,
+                        const CHttpHeaders& headers,
+                        CTempString         data,
+                        CTempString         content_type = CTempString(),
+                        const CTimeout&     timeout = CTimeout(CTimeout::eDefault),
+                        THttpRetries        retries = null);
+
 class CHttpSession;
 
 
@@ -128,6 +149,10 @@ public:
     /// The class should not be used explicitly - all conversions are automatic.
     class CHeaderNameConverter {
     public:
+        CHeaderNameConverter(const char* name)
+            : m_Name(name) {}
+        CHeaderNameConverter(const string& name)
+            : m_Name(name) {}
         CHeaderNameConverter(CTempString name)
             : m_Name(name) {}
         CHeaderNameConverter(CHttpHeaders::EHeaderName name)
@@ -222,10 +247,10 @@ class NCBI_XCONNECT_EXPORT CFormDataProvider_Base : public CObject
 public:
     /// Get content type. Returns empty string by default, indicating
     /// no Content-Type header should be used for the part.
-    virtual string GetContentType(void) const { return kEmptyStr; }
+    virtual string GetContentType(void) const { return string(); }
 
     /// Get optional filename to be shown in Content-Disposition header.
-    virtual string GetFileName(void) const { return kEmptyStr; }
+    virtual string GetFileName(void) const { return string(); }
 
     /// Write user data to the stream.
     virtual void WriteData(CNcbiOstream& out) const = 0;
@@ -260,7 +285,7 @@ public:
     ///   content type. Not used when sending eFormUrlEncoded content.
     void AddEntry(CTempString entry_name,
                   CTempString value,
-                  CTempString content_type = kEmptyStr);
+                  CTempString content_type = CTempString());
 
     /// Add file entry. The form content type is automatically set to
     /// eMultipartFormData and can not be changed later.
@@ -277,7 +302,7 @@ public:
     ///   protocol assumes it to be 'application/octet-stream'.
     void AddFile(CTempString entry_name,
                  CTempString file_name,
-                 CTempString content_type = kEmptyStr);
+                 CTempString content_type = CTempString());
 
     /// Add custom data provider. The data written by the provider is
     /// properly prefixed with Content-Disposition, boundary, Content-Type etc.
@@ -511,7 +536,8 @@ public:
     enum ERequestMethod {
         eHead = eReqMethod_Head,
         eGet  = eReqMethod_Get,
-        ePost = eReqMethod_Post
+        ePost = eReqMethod_Post,
+        ePut  = eReqMethod_Put
     };
 
     /// Initialize request. This does not open connection to the server.
@@ -540,15 +566,41 @@ public:
     /// @sa NewRequest() CHttpRequest
     CHttpResponse Post(const CUrl&     url,
                        CTempString     data,
-                       CTempString     content_type = kEmptyStr,
+                       CTempString     content_type = CTempString(),
                        const CTimeout& timeout = CTimeout(CTimeout::eDefault),
                        THttpRetries    retries = null);
 
+    /// Shortcut for PUT requests.
+    /// @param url
+    ///   URL to send request to.
+    /// @param data
+    ///   Data to be sent with the request. The data is sent as-is,
+    ///   any required encoding must be performed by the caller.
+    /// @param content_type
+    ///   Content-type. If empty, application/x-www-form-urlencoded
+    ///   is used.
+    /// @sa NewRequest() CHttpRequest
+    CHttpResponse Put(const CUrl&     url,
+                      CTempString     data,
+                      CTempString     content_type = CTempString(),
+                      const CTimeout& timeout = CTimeout(CTimeout::eDefault),
+                      THttpRetries    retries = null);
+
     /// Get all stored cookies.
     const CHttpCookies& Cookies(void) const { return m_Cookies; }
     /// Get all stored cookies, non-const.
     CHttpCookies& Cookies(void) { return m_Cookies; }
 
+    /// HTTP protocol version.
+    enum EProtocol {
+        eHTTP_10, ///< HTTP/1.0
+        eHTTP_11  ///< HTTP/1.1
+    };
+
+    /// Get protocol version.
+    EProtocol GetProtocol(void) const { return m_Protocol; }
+    void SetProtocol(EProtocol protocol) { m_Protocol = protocol; }
+
     /// Get flags passed to CConn_HttpStream.
     /// @sa SetHttpFlags
     THTTP_Flags GetHttpFlags(void) const { return m_HttpFlags; }
@@ -570,6 +622,7 @@ private:
     // Get a single 'Cookie' header line for the url.
     string x_GetCookies(const CUrl& url) const;
 
+    EProtocol    m_Protocol;
     THTTP_Flags  m_HttpFlags;
     CHttpCookies m_Cookies;
 };
diff --git a/c++/include/connect/ncbi_lbos.hpp b/c++/include/connect/ncbi_lbos.hpp
new file mode 100755
index 0000000..060b443
--- /dev/null
+++ b/c++/include/connect/ncbi_lbos.hpp
@@ -0,0 +1,257 @@
+#ifndef CONNECT___NCBI_LBOS__HPP
+#define CONNECT___NCBI_LBOS__HPP
+/*
+* ===========================================================================
+*
+*                            PUBLIC DOMAIN NOTICE
+*               National Center for Biotechnology Information
+*
+*  This software/database is a "United States Government Work" under the
+*  terms of the United States Copyright Act.  It was written as part of
+*  the author's official duties as a United States Government employee and
+*  thus cannot be copyrighted.  This software/database is freely available
+*  to the public for use. The National Library of Medicine and the U.S.
+*  Government have not placed any restriction on its use or reproduction.
+*
+*  Although all reasonable efforts have been taken to ensure the accuracy
+*  and reliability of the software and data, the NLM and the U.S.
+*  Government do not and cannot warrant the performance or results that
+*  may be obtained by using this software or data. The NLM and the U.S.
+*  Government disclaim all warranties, express or implied, including
+*  warranties of performance, merchantability or fitness for any particular
+*  purpose.
+*
+*  Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* Authors:  Dmitriy Elisov
+* @file
+* File Description:
+*   A client for service discovery API based on LBOS. 
+*   LBOS is a client for ZooKeeper cloud-based DB. 
+*   LBOS allows to announce, deannounce and resolve services.
+*/
+
+#include <corelib/ncbiexpt.hpp>
+
+BEGIN_NCBI_SCOPE
+
+
+class NCBI_XNCBI_EXPORT LBOS
+{
+public:
+    /** Announce server.
+    *
+    * @param [in] service
+    *  Name of service as it will appear in ZK. For services this means that the
+    *  name should start with '/'.
+    * @param [in] version
+    *  Any non-null non-empty string that will help to identify the version
+    *  of service. A good idea is to use [semantic versioning]
+    *  (http://semver.org/) like "4.7.2"
+    * @param [in] host
+    *  Optional parameter. Set to "" (empty string) to use host from 
+    *  healthcheck_url to make sure that server and healthcheck actually reside 
+    *  on the same machine (it can be important when you specify hostname that 
+    *  can be resolved to multiple IPs, and LBOS ends up registering server 
+    *  on one host and healthcheck on another)
+    * @param [in] port
+    *  Port for the service. Can differ from healthcheck port.
+    * @param [in] healthcheck_url
+    *  Full absolute URL starting with "http://" or "https://". Must include 
+    *  hostname or IP (and port, if necessary)
+    * @note
+    *  If you want to announce a server that is on the same machine that
+    *  announces it (i.e., if server announces itself), you can write
+    *  "0.0.0.0" for IP in both "host" and "healthcheck_url". You still have to
+    *  provide port, even if you write "0.0.0.0".
+    * @return
+    *  Returns nothing if announcement was successful. Otherwise, throws an
+    *  exception.
+    * @exception CLBOSException
+    * @sa AnnounceFromRegistry(), Deannounce(), DeannounceAll(), CLBOSException
+    */
+    static void 
+        Announce(const string&   service,
+                 const string&   version,
+                 const string&   host,
+                 unsigned short  port,
+                 const string&   healthcheck_url);
+                                  
+
+   /** Modification of Announce() that gets all the needed parameters from 
+    * registry.
+    *
+    * @param [in] registry_section
+    *  Name of section in registry where to look for 
+    *  announcement parameters. Please check documentation for Announce() to
+    *  to see requirements for the arguments.
+    *  Parameters are:
+    *  service, version, host, port, health
+    *  Example:
+    *  --------------
+    *  [LBOS_ANNOUNCEMENT]
+    *  service=MYSERVICE
+    *  version=1.0.0
+    *  host=0.0.0.0
+    *  port=8080
+    *  health=http://0.0.0.0:8080/health
+    *
+    * @return
+    *  Returns nothing if announcement was successful. Otherwise, throws an
+    *  exception.
+    * @exception CLBOSException
+    * @sa Announce(), Deannounce(), DeannounceAll(), CLBOSException
+    */
+    static void AnnounceFromRegistry(string  registry_section);
+
+
+    /** Deannounce service.
+    * @param [in] service
+    *  Name of service to be de-announced.
+    * @param [in] version
+    *  Version of service to be de-announced.
+    * @param [in] host
+    *  IP or hostname of service to be de-announced. Provide empty string
+    *  (NOT "0.0.0.0") to use local host address.
+    * @param [in] port
+    *  Port of service to be de-announced.
+    * @return
+    *  Returns nothing if de-announcement was successful. Otherwise, throws an
+    *  exception.
+    * @exception CLBOSException
+    * @sa Announce(), DeannounceAll(), CLBOSException
+    */
+    static void Deannounce(const string&  service,
+                           const string&  version,
+                           const string&  host,
+                           unsigned short port);
+
+
+    /** Deannounce all servers that were announced during runtime.
+    * @note
+    *  There is no guarantee that all servers were de-announced successfully
+    *  after this function returned. There is a guarantee that de-announcement
+    *  request was sent to LBOS for each server that was announced by the 
+    *  running application during runtime.
+    * @return
+    *  Returns nothing, never throws.
+    * @sa Announce(), Deannounce()
+    */
+    static void DeannounceAll(void);
+
+
+    /** Show default version of a service in ZooKeeper configuration. 
+    *  Does no change anything in ZooKeeper or LBOS configuration.
+    * @param service[in]
+    *  Name of service for which to ask default version.
+    * @return
+    *  Current default version.
+    * @exception CLBOSException
+    *  If no record for the service was found, the exception will contain 
+    *  e_LBOSNotFound code.
+    */
+    static
+    string ServiceVersionGet(const string&  service,
+                             bool* existed = NULL);
+
+
+    /** Set default version for a service in ZooKeeper configuration.
+    * @param[in] service
+    *  Name of service for which to change the default version.
+    * @param new_version[out]
+    *  Version that will be used by default for specified service.
+    * @return
+    *  Version before request.
+    */
+    static
+    string ServiceVersionSet(const string&  service,
+                             const string&  new_version,
+                             bool* existed = NULL);
+
+
+    /** Remove service from ZooKeeper configuration. Default
+    *   version will be empty.
+    * @param[in] service
+    *  Name of service to delete from ZooKeeper configuration.
+    * @return
+    *  Version before request 
+    */
+    static
+    string ServiceVersionDelete(const string&  service,
+                                bool* existed = NULL);
+};
+
+
+/** CLBOSException is thrown if a request to LBOS fails for any
+ * reason. CLBOSException has overloaded "what()" method that returns
+ * message from LBOS (if there is one), which should contain status code and 
+ * status message. If announcement failed not because of LBOS, but because of 
+ * bad arguments, memory error, etc., status code is a non-HTTP status code. 
+ * To get its meaning you can call CLBOSException::GetErrCodeString(void) to 
+ * see human language description of the exception.
+ */
+class NCBI_XNCBI_EXPORT CLBOSException : public CException
+{
+public:
+    typedef int TErrCode;
+    enum EErrCode {
+        e_LBOSNoLBOS          = 0,  /**< LBOS was not found                  */
+        e_LBOSDNSResolveError = 1,  /**< Local address not resolved          */
+        e_LBOSInvalidArgs     = 2,  /**< Arguments not valid                 */
+        e_LBOSNotFound        = 3,  /**< For de-announcement only. Did not
+                                         find such server to deannounce      */
+        e_LBOSOff             = 4,  /**< LBOS client is off for any of the 
+                                         two reasons: either it is not 
+                                         enabled in registry, or no LBOS 
+                                         working LBOS instance was found at
+                                         initialization                      */
+        e_LBOSMemAllocError   = 5,  /**< Memory allocation error             */
+        e_LBOSCorruptOutput   = 6,  /**< LBOS returned unexpected output     */
+        e_LBOSBadRequest      = 7,  /**< LBOS returned "400 Bad Request"     */
+        e_LBOSUnknown         = 8,  /**< No information about this error
+                                         code meaning                        */
+        e_LBOSServerError     = 9   /**< LBOS returned "500 Internal Server 
+                                         Error"                              */
+    };
+
+    CLBOSException(const CDiagCompileInfo& info,
+                   const CException* prev_exception, EErrCode err_code,
+                   const string& message, unsigned short status_code,
+                   EDiagSev severity = eDiag_Error);
+
+    CLBOSException(const CDiagCompileInfo& info, 
+                   const CException* prev_exception, 
+                   const CExceptionArgs<EErrCode>& args, 
+                   const string& message,
+                   unsigned short status_code);
+    virtual ~CLBOSException(void) throw();
+    
+    /** Get original status code and status message from LBOS in a string */
+    virtual const char* what() const throw();
+
+    /** Translate from the error code value to its string representation
+    *  (only for internal errors; real LBOS
+    *  errors will not be processed) */
+    virtual const char* GetErrCodeString(void) const;
+
+    /** Translate from numerical HTTP status code to LBOS-specific
+     * error code */
+    static EErrCode s_HTTPCodeToEnum(unsigned short http_code);
+
+    unsigned short GetStatusCode(void) const;
+    virtual const char* GetType(void) const;
+    TErrCode GetErrCode(void) const;
+    NCBI_EXCEPTION_DEFAULT_THROW(CLBOSException)
+protected:
+    CLBOSException(void);
+    virtual const CException* x_Clone(void) const;
+private:
+    unsigned short m_StatusCode;
+    string m_Message;
+};
+
+END_NCBI_SCOPE
+
+#endif /* CONNECT___NCBI_LBOS__HPP */
diff --git a/c++/include/connect/ncbi_pipe.hpp b/c++/include/connect/ncbi_pipe.hpp
index 0d85f02..b40b3d7 100644
--- a/c++/include/connect/ncbi_pipe.hpp
+++ b/c++/include/connect/ncbi_pipe.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_PIPE__HPP
 #define CONNECT___NCBI_PIPE__HPP
 
-/* $Id: ncbi_pipe.hpp 458676 2015-02-09 12:35:49Z lavr $
+/* $Id: ncbi_pipe.hpp 482816 2015-10-26 21:18:02Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -79,7 +79,7 @@ public:
     /// @note@  Flags pertaining to the same stdio handle processed in the
     ///         order of their appearance in the definition below.
     ///
-    /// Default is 0 
+    /// Default is 0:
     ///    fStdIn_Open | fStdOut_Open | fStdErr_Close | fCloseOnClose.
     enum ECreateFlag {
         fStdIn_Open      =     0, ///< Do     open child's stdin (default).
@@ -210,11 +210,11 @@ public:
 
     /// Close pipe.
     ///
-    /// Wait for the spawned child process to terminate and then close
-    /// the associated pipe.
+    /// Sever communication channel with the spawned child process, and then
+    /// wait for the process to terminate.
     ///
     /// @note A CPipe opened with OpenSelf() always closes with eIO_Success,
-    /// and *exitcode returned as 0 (yet the current process continues to run).
+    /// and *exitcode returns as 0 (yet the current process continues to run).
     ///
     /// @param exitcode
     ///   Pointer to store the exit code at, if the child process terminated
@@ -222,13 +222,13 @@ public:
     /// @return
     ///   Completion status.
     ///   The returned status eIO_Timeout means that child process is still 
-    ///   running and the pipe was not yet closed.  Any other return status
-    ///   means that the pipe is not suitable for further I/O until reopened.
+    ///   running (yet the communication with it has been severed).  Any other
+    ///   return status means that the pipe is not suitable for further I/O
+    ///   until reopened.
     ///
     ///   eIO_Closed  - pipe was already closed;
-    ///   eIO_Timeout - the eIO_Close timeout expired, child process
-    ///                 is still running and the pipe has not yet closed
-    ///                 (return only if fKeepOnClose create flag was set);
+    ///   eIO_Timeout - the eIO_Close timeout expired, child process is still
+    ///                 running (return only if fKeepOnClose was set);
     ///   eIO_Success - pipe was successfully closed.  The running status of
     ///                 the child process depends on the flags:
     ///       fKeepOnClose  - process has terminated with "exitcode";
@@ -236,7 +236,7 @@ public:
     ///                       or is still running otherwise;
     ///       fKillOnClose  - process has self-terminated if "exitcode" != -1,
     ///                       or has been forcibly terminated otherwise;
-    ///   Otherwise   - an error was detected;
+    ///   Otherwise   - an error was detected.
     /// @sa
     ///   Open, OpenSelf, fKeepOnClose, fCloseOnClose, fKillOnClose, fNewGroup
     EIO_Status Close(int* exitcode = 0);
@@ -260,7 +260,7 @@ public:
     ///   Return eIO_InvalidArg otherwise.
     /// @sa
     ///   Read
-    EIO_Status     SetReadHandle(EChildIOHandle from_handle);
+    EIO_Status SetReadHandle(EChildIOHandle from_handle);
 
     /// Get standard output handle to read data from.
     ///
@@ -383,7 +383,7 @@ public:
     TProcessHandle GetProcessHandle(void) const;
 
 
-    /// Callback interface for ExecWait method
+    /// Callback interface for ExecWait()
     ///
     /// @sa ExecWait
     class NCBI_XCONNECT_EXPORT IProcessWatcher
diff --git a/c++/include/connect/ncbi_service.h b/c++/include/connect/ncbi_service.h
index d367094..e7df611 100644
--- a/c++/include/connect/ncbi_service.h
+++ b/c++/include/connect/ncbi_service.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_SERVICE__H
 #define CONNECT___NCBI_SERVICE__H
 
-/* $Id: ncbi_service.h 451379 2014-11-06 15:07:53Z lavr $
+/* $Id: ncbi_service.h 472260 2015-07-08 16:43:43Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -103,18 +103,20 @@ typedef unsigned short TSERV_TypeOnly;  /**<Server type only, w/o specials   */
  * @param preferred_host
  *  Preferred host to use the service at, nbo.
  * @param net_info
- *  Connection information (NULL prevents use of the network dispatching).
- * @note If "net_info" is NULL, only LOCAL/LBSMD mappers will be consulted.
- *       If "net_info" is not NULL, LOCAL/LBSMD are consulted first,
- *       and then DISPD is consulted last (using the connection information
- *       provided) but only if mapping with LOCAL/LBSMD (if any occurred) has
- *       failed.
- * @note The registry section [CONN], keys LOCAL_DISABLE, LBSMD_DISABLE, and
- *       DISPD_DISABLE (which can be overridden by the environment variables
- *       CONN_LOCAL_DISABLE, CONN_LBSMD_DISABLE, and CONN_DISPD_DISABLE,
- *       respectively) can be used to skip the corresponding service mappers.
- *       This scheme permits to use any combination of the service mappers
- *       (local/lbsmd/network-based).
+ *  Connection information (NULL prevents use of the network dispatching via
+ *  DISPD, still allowing use of LBOS).
+ * @note If "net_info" is NULL, only LOCAL/LBSMD/LBOS mappers will be
+ *       consulted. If "net_info" is not NULL, LOCAL/LBSMD/LBOS are consulted
+ *       first, and then DISPD is consulted last (using the connection
+ *       information provided) but only if mapping with LOCAL/LBSMD/LBOS (if
+ *       any occurred) has failed.
+ * @note The registry section [CONN], keys LOCAL_DISABLE, LBSMD_DISABLE,
+ *       LBOS_DISABLE, and DISPD_DISABLE (which can be overridden by the
+ *       environment variables CONN_LOCAL_DISABLE, CONN_LBSMD_DISABLE,
+ *       CONN_LBOS_DISABLE, and CONN_DISPD_DISABLE, respectively) can
+ *       be used to skip the corresponding service mappers. This scheme
+ *       permits to use any combination of the service mappers
+ *       (local/lbsmd/lbos/network-based).
  * @note If "net_info" is not NULL then a non-zero value of
  *       "net_info->stateless" forces "types" to get the "fSERV_StatelessOnly"
  *       bit set implicitly.
@@ -238,7 +240,8 @@ extern NCBI_XCONNECT_EXPORT SSERV_InfoCPtr SERV_GetNextInfo
  * @param preferred_host
  *  Preferred host to use the service at, nbo.
  * @param net_info
- *  Connection information (NULL disables network dispatching).
+ *  Connection information (NULL disables network dispatching via
+ *  DISPD, still allowing use of LBOS).
  * @param skip[]
  *  An array of servers NOT to select, see SERV_OpenEx() for notes.
  * @param n_skip
diff --git a/c++/include/connect/ncbi_socket.h b/c++/include/connect/ncbi_socket.h
index b27c371..e542e12 100644
--- a/c++/include/connect/ncbi_socket.h
+++ b/c++/include/connect/ncbi_socket.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_SOCKET__H
 #define CONNECT___NCBI_SOCKET__H
 
-/* $Id: ncbi_socket.h 464049 2015-04-03 14:32:14Z lavr $
+/* $Id: ncbi_socket.h 482179 2015-10-21 15:02:35Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1038,8 +1038,6 @@ extern NCBI_XCONNECT_EXPORT EIO_Status SOCK_ReadLine
  );
 
 
-#define SOCK_PushBack  SOCK_Pushback
-
 /** Push the specified data back to the socket input queue (in the socket's
  * internal read buffer). These can be any data, not necessarily the data
  * previously read from the socket.
diff --git a/c++/include/connect/ncbi_util.h b/c++/include/connect/ncbi_util.h
index 7fd08e3..323f3da 100644
--- a/c++/include/connect/ncbi_util.h
+++ b/c++/include/connect/ncbi_util.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_UTIL__H
 #define CONNECT___NCBI_UTIL__H
 
-/* $Id: ncbi_util.h 459572 2015-02-19 18:21:38Z lavr $
+/* $Id: ncbi_util.h 488838 2016-01-06 13:45:11Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -367,7 +367,6 @@ extern NCBI_XCONNECT_EXPORT void CORE_SetREG(REG rg);
 extern NCBI_XCONNECT_EXPORT REG  CORE_GetREG(void);
 
 
-
 /******************************************************************************
  *  Auxiliary API
  */
@@ -390,6 +389,11 @@ typedef enum {
     eNcbiRequestID_SID        /**< NCBI Session ID */
 } ENcbiRequestID;
 
+
+/** NCBI request "DTab-Local" header  */
+extern NCBI_XCONNECT_EXPORT char* CORE_GetNcbiRequestDtab;
+
+
 /** Obtain current NCBI request ID (if known, per thread).
  * @return
  *  Return NULL when the ID cannot be determined or an error has occurred;
diff --git a/c++/include/connect/server_monitor.hpp b/c++/include/connect/server_monitor.hpp
index d77de06..543b967 100644
--- a/c++/include/connect/server_monitor.hpp
+++ b/c++/include/connect/server_monitor.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT___SERVER_MONITOR__HPP
 #define CONNECT___SERVER_MONITOR__HPP
 
-/* $Id: server_monitor.hpp 143268 2008-10-16 18:18:32Z lavr $
+/* $Id: server_monitor.hpp 475146 2015-08-05 15:18:50Z vakatov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -48,6 +48,7 @@ BEGIN_NCBI_SCOPE
 struct IServer_Monitor
 {
     virtual ~IServer_Monitor() {}
+
     /// Check if monitoring is active
     virtual bool IsActive() = 0;
     /// Send message
@@ -56,6 +57,8 @@ struct IServer_Monitor
     virtual void Send(const string& str) = 0;
 };
 
+
+
 /// Server monitor
 ///
 class NCBI_XCONNECT_EXPORT CServer_Monitor : public IServer_Monitor
@@ -74,16 +77,9 @@ public:
 
     /// @name IServer_Monitor interface
     /// @{
-
-    virtual bool IsActive() 
-        { return IsMonitorActive(); };
-    /// Send message
-    virtual void Send(const char* msg, size_t length) 
-        { SendMessage(msg, length); }
-    /// Send message
-    virtual void Send(const string& str)
-        { SendString(str); }
-
+    virtual bool IsActive();
+    virtual void Send(const char* msg, size_t length);
+    virtual void Send(const string& str);
     ///@}
 
 private:
diff --git a/c++/include/connect/services/grid_client.hpp b/c++/include/connect/services/grid_client.hpp
index abffe55..2f0b11f 100644
--- a/c++/include/connect/services/grid_client.hpp
+++ b/c++/include/connect/services/grid_client.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES_GRID__GRID_CLIENT__HPP
 #define CONNECT_SERVICES_GRID__GRID_CLIENT__HPP
 
-/*  $Id: grid_client.hpp 470125 2015-06-11 14:18:05Z ivanov $
+/*  $Id: grid_client.hpp 492603 2016-02-18 19:27:56Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -202,9 +202,6 @@ public:
 
     /// Get a job interim message
     ///
-    /// @param data_key
-    ///     Blob key
-    ///
     string GetProgressMessage();
 
     /// Set a job's input This string will be sent to
@@ -214,7 +211,7 @@ public:
     /// To send a large data use GetOStream method. Don't call this
     /// method after GetOStream method is called.
     ///
-    void SetJobInput(const string& input) {m_Job.input = input;}
+    void SetJobInput(const string& input);
 
     /// Get a stream where a client can write an input
     /// data for the remote job
@@ -238,6 +235,12 @@ public:
     ///
     CNetScheduleAPI::EJobStatus SubmitAndWait(unsigned wait_time);
 
+    /// Wait for job to finish its execution (done/failed/canceled).
+    /// @sa CNetScheduleAPI
+    ///
+    CNetScheduleAPI::EJobStatus WaitForJob(const string& job_key,
+            unsigned wait_time);
+
     CNetScheduleJob& GetJob() {return m_Job;}
 
     /// Get a job submitter
@@ -266,13 +269,6 @@ public:
     ///
     void CancelJob(const string& job_key);
 
-    /// Remove a data blob from the storage
-    ///
-    /// @param data_key
-    ///     Blob key
-    ///
-    void RemoveDataBlob(const string& data_key);
-
     CNetScheduleSubmitter GetNetScheduleSubmitter()
     {
         return m_NetScheduleSubmitter;
@@ -282,7 +278,11 @@ public:
     size_t GetMaxServerInputSize();
 
 private:
+    friend class CGridJobBatchSubmitter;
+
     void Init(ECleanUp cleanup, EProgressMsg progress_msg);
+    void RemoveDataBlob(const string&);
+    void UseNextSubHitID();
 
     CNetScheduleSubmitter m_NetScheduleSubmitter;
     CNetCacheAPI m_NetCacheAPI;
@@ -295,8 +295,9 @@ private:
 
     void x_ProlongBlobLifetime(const string& blob_key, unsigned ttl);
     bool x_ProlongJobFieldLifetime(const string& job_field, unsigned ttl);
-    void x_RenewAllJobBlobs(time_t job_exptime);
-    bool x_CleanUpAllJobBlobs(CNetScheduleAPI::EJobStatus status);
+    void x_RenewAllJobBlobs(unsigned ttl);
+    CNetScheduleAPI::EJobStatus x_CheckAllJobBlobs(
+            CNetScheduleAPI::EJobStatus status, time_t job_exptime);
     void x_GetJobDetails();
 
     size_t       m_BlobSize;
diff --git a/c++/include/connect/services/grid_rw_impl.hpp b/c++/include/connect/services/grid_rw_impl.hpp
index fdab53f..efa4950 100644
--- a/c++/include/connect/services/grid_rw_impl.hpp
+++ b/c++/include/connect/services/grid_rw_impl.hpp
@@ -2,7 +2,7 @@
 #define _GRID_RW_IMPL_HPP_
 
 
-/*  $Id: grid_rw_impl.hpp 304778 2011-06-16 16:14:34Z kazimird $
+/*  $Id: grid_rw_impl.hpp 489744 2016-01-15 16:50:24Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -93,10 +93,14 @@ public:
 
     virtual ERW_Result PendingCount(size_t* count);
 
+protected:
+    enum EType { eNetCache, eEmbedded, eEmpty, eRaw };
+    static EType x_GetDataType(string& data);
+
 private:
     CNetCacheAPI m_Storage;
     auto_ptr<IReader> m_NetCacheReader;
-    const string& m_Data;
+    string m_Data;
     size_t m_BytesToRead;
 };
 
diff --git a/c++/include/connect/services/grid_worker.hpp b/c++/include/connect/services/grid_worker.hpp
index bf3a0b2..f70b9f9 100644
--- a/c++/include/connect/services/grid_worker.hpp
+++ b/c++/include/connect/services/grid_worker.hpp
@@ -2,7 +2,7 @@
 #define CONNECT_SERVICES__GRID_WORKER_HPP
 
 
-/*  $Id: grid_worker.hpp 455687 2015-01-02 17:47:12Z kazimird $
+/*  $Id: grid_worker.hpp 492323 2016-02-16 19:37:01Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -232,7 +232,8 @@ class NCBI_XCONNECT_EXPORT CWorkerNodeJobContext
 
     /// Put progress message
     ///
-    void PutProgressMessage(const string& msg, bool send_immediately = false);
+    void PutProgressMessage(const string& msg, bool send_immediately = false,
+            bool overwrite = true);
 
     /// Get a stream where a job can write its result
     ///
@@ -423,10 +424,6 @@ public:
 
     virtual string GetAppName() const {return GetJobVersion();}
 
-    virtual string GetAppVersion() const {return GetJobVersion();}
-
-    virtual string GetAppBuildDate() const {return __DATE__;}
-
     /// Get the Idle task
     ///
     virtual IWorkerNodeIdleTask* GetIdleTask() { return NULL; }
@@ -445,94 +442,57 @@ public:
         return new TWorkerNodeJob(*m_WorkerNodeInitContext);
     }
 
-private:
+    virtual string GetJobVersion() const { return m_JobVersion; }
+    virtual string GetAppName()    const { return m_AppName; }
+
+protected:
     const IWorkerNodeInitContext* m_WorkerNodeInitContext;
-};
 
-#define NCBI_DECLARE_WORKERNODE_FACTORY(TWorkerNodeJob, Version)         \
-class TWorkerNodeJob##Factory : public CSimpleJobFactory<TWorkerNodeJob> \
-{                                                                        \
-public:                                                                  \
-    virtual string GetJobVersion() const                                 \
-    {                                                                    \
-        return #TWorkerNodeJob " version " NCBI_AS_STRING(Version);      \
-    }                                                                    \
-    virtual string GetAppName() const                                    \
-    {                                                                    \
-        return #TWorkerNodeJob;                                          \
-    }                                                                    \
-    virtual string GetAppVersion() const                                 \
-    {                                                                    \
-        return NCBI_AS_STRING(Version);                                  \
-    }                                                                    \
-}
+private:
+    static const char* const m_JobVersion;
+    static const char* const m_AppName;
+};
 
 template <typename TWorkerNodeJob, typename TWorkerNodeIdleTask>
-class CSimpleJobFactoryEx : public IWorkerNodeJobFactory
+class CSimpleJobFactoryEx : public CSimpleJobFactory<TWorkerNodeJob>
 {
 public:
     virtual void Init(const IWorkerNodeInitContext& context)
     {
-        m_WorkerNodeInitContext = &context;
+        this->m_WorkerNodeInitContext = &context;
         try {
-            m_IdleTask.reset(new TWorkerNodeIdleTask(*m_WorkerNodeInitContext));
+            m_IdleTask.reset(new TWorkerNodeIdleTask(context));
         } catch (exception& ex) {
             LOG_POST_XX(ConnServ_WorkerNode, 16,
                         "Error during Idle task construction: " << ex.what());
             throw;
         }
     }
-    virtual IWorkerNodeJob* CreateInstance(void)
-    {
-        return new TWorkerNodeJob(*m_WorkerNodeInitContext);
-    }
     virtual IWorkerNodeIdleTask* GetIdleTask() { return m_IdleTask.get(); }
 
 private:
-    const IWorkerNodeInitContext* m_WorkerNodeInitContext;
     auto_ptr<TWorkerNodeIdleTask> m_IdleTask;
 };
 
-#define NCBI_DECLARE_WORKERNODE_FACTORY_EX(                              \
-        TWorkerNodeJob,TWorkerNodeIdleTask, Version)                     \
-class TWorkerNodeJob##FactoryEx                                          \
-    : public CSimpleJobFactoryEx<TWorkerNodeJob, TWorkerNodeIdleTask>    \
-{                                                                        \
-public:                                                                  \
-    virtual string GetJobVersion() const                                 \
-    {                                                                    \
-        return #TWorkerNodeJob " version " NCBI_AS_STRING(Version);      \
-    }                                                                    \
-    virtual string GetAppName() const                                    \
-    {                                                                    \
-        return #TWorkerNodeJob;                                          \
-    }                                                                    \
-    virtual string GetAppVersion() const                                 \
-    {                                                                    \
-        return NCBI_AS_STRING(Version);                                  \
-    }                                                                    \
-}
-
-#define NCBI_DECLARE_WORKERNODE_FACTORY_PKG_VER_EX(                      \
-        TWorkerNodeJob, TWorkerNodeIdleTask)                             \
-class TWorkerNodeJob##FactoryEx                                          \
-    : public CSimpleJobFactoryEx<TWorkerNodeJob, TWorkerNodeIdleTask>    \
-{                                                                        \
-public:                                                                  \
-    virtual string GetJobVersion() const                                 \
-    {                                                                    \
-        return GRID_APP_VERSION_INFO;                                    \
-    }                                                                    \
-    virtual string GetAppName() const                                    \
-    {                                                                    \
-        return GRID_APP_NAME;                                            \
-    }                                                                    \
-    virtual string GetAppVersion() const                                 \
-    {                                                                    \
-        return GRID_APP_VERSION;                                         \
-    }                                                                    \
-}
+#define NCBI_DECLARE_WORKERNODE_FACTORY_IMPL(TWorkerNodeJob, Version)       \
+BEGIN_NCBI_SCOPE                                                            \
+template <>                                                                 \
+const char* const CSimpleJobFactory<TWorkerNodeJob>::m_JobVersion =         \
+    #TWorkerNodeJob " version " NCBI_AS_STRING(Version);                    \
+template <>                                                                 \
+const char* const CSimpleJobFactory<TWorkerNodeJob>::m_AppName =            \
+    #TWorkerNodeJob;                                                        \
+END_NCBI_SCOPE
+
+#define NCBI_DECLARE_WORKERNODE_FACTORY(TWorkerNodeJob, Version)            \
+typedef CSimpleJobFactory<TWorkerNodeJob> TWorkerNodeJob##Factory;          \
+    NCBI_DECLARE_WORKERNODE_FACTORY_IMPL(TWorkerNodeJob, Version)
 
+#define NCBI_DECLARE_WORKERNODE_FACTORY_EX(                                 \
+        TWorkerNodeJob, TWorkerNodeIdleTask, Version)                       \
+typedef CSimpleJobFactoryEx<TWorkerNodeJob, TWorkerNodeIdleTask>            \
+        TWorkerNodeJob##FactoryEx;                                          \
+    NCBI_DECLARE_WORKERNODE_FACTORY_IMPL(TWorkerNodeJob, Version)
 
 /// Jobs watcher interface
 class NCBI_XCONNECT_EXPORT IWorkerNodeJobWatcher
@@ -582,7 +542,7 @@ class NCBI_XCONNECT_EXPORT CGridWorkerNode
 #ifdef NCBI_OS_UNIX
             ESwitch daemonize = eDefault,
 #endif
-            string procinfo_file_name = kEmptyStr);
+            string procinfo_file_name = string());
 
     void RequestShutdown();
 
@@ -617,8 +577,7 @@ class NCBI_XCONNECT_EXPORT CGridWorkerNode
     const string& GetClientName() const;
 
     string GetAppName() const;
-    string GetAppVersion() const;
-    string GetBuildDate() const;
+    const CVersion& GetAppVersion() const;
 
     const string& GetServiceName() const;
 
@@ -674,6 +633,4 @@ public:
 
 END_NCBI_SCOPE
 
-#define WN_BUILD_DATE __DATE__ " " __TIME__
-
 #endif //CONNECT_SERVICES__GRID_WOKER_HPP
diff --git a/c++/include/connect/services/grid_worker_app.hpp b/c++/include/connect/services/grid_worker_app.hpp
index 7b8a1e0..1ccaac1 100644
--- a/c++/include/connect/services/grid_worker_app.hpp
+++ b/c++/include/connect/services/grid_worker_app.hpp
@@ -2,7 +2,7 @@
 #define CONNECT_SERVICES__GRID_WORKER_APP_HPP
 
 
-/*  $Id: grid_worker_app.hpp 469237 2015-06-02 18:26:13Z sadyrovr $
+/*  $Id: grid_worker_app.hpp 492325 2016-02-16 19:37:51Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -119,10 +119,12 @@ class CGridWorkerNodeApp_Listener : public IGridWorkerNodeApp_Listener
 class NCBI_XCONNECT_EXPORT CGridWorkerApp : public CNcbiApplication
 {
 public:
-    CGridWorkerApp(IWorkerNodeJobFactory* job_factory);
+    CGridWorkerApp(IWorkerNodeJobFactory* job_factory,
+                   const SBuildInfo& build_info = SBuildInfo());
 
     CGridWorkerApp(IWorkerNodeJobFactory* job_factory,
-                   const CVersionInfo& version_info);
+                   const CVersionInfo& version_info,
+                   const SBuildInfo& build_info = SBuildInfo());
 
     /// Register a listener of events of this class.
     ///
@@ -179,50 +181,38 @@ inline void CGridWorkerApp::SetListener(IGridWorkerNodeApp_Listener* listener)
 #endif
 #endif
 
-
-// To allow use the NCBI_WORKERNODE_XXX convenience macros with
-// a class derived from CGridWorkerApp
-#if !defined(NCBI_WORKERNODE_CLASS)
-#  define NCBI_WORKERNODE_CLASS  CGridWorkerApp
+#ifdef NCBI_BUILD_TAG
+#   define GRID_WORKER_APP_BUILD_TAG NCBI_AS_STRING(NCBI_BUILD_TAG)
+#else
+#   define GRID_WORKER_APP_BUILD_TAG kEmptyStr
 #endif
 
-
-#define NCBI_WORKERNODE_MAIN(TWorkerNodeJob, Version)                       \
-    NCBI_DECLARE_WORKERNODE_FACTORY(TWorkerNodeJob, Version);               \
+#define NCBI_WORKERNODE_MAIN_IMPL(TFactory, Version, SetListener)           \
     int main(int argc, const char* argv[])                                  \
     {                                                                       \
         GetDiagContext().SetOldPostFormat(false);                           \
-        NCBI_WORKERNODE_CLASS app(new TWorkerNodeJob##Factory,                     \
-            CVersionInfo(#Version));                                        \
+        CGridWorkerApp app(new TFactory, CVersionInfo(#Version),            \
+            SBuildInfo(__DATE__ " " __TIME__,  GRID_WORKER_APP_BUILD_TAG)); \
+        SetListener;                                                        \
         return app.AppMain(argc, argv, NULL, eDS_ToStdlog,                  \
                 NcbiEmptyCStr, GRID_WORKER_APP_NAME);                       \
     }
 
+#define NCBI_WORKERNODE_MAIN(TWorkerNodeJob, Version)                       \
+    NCBI_DECLARE_WORKERNODE_FACTORY(TWorkerNodeJob, Version);               \
+    NCBI_WORKERNODE_MAIN_IMPL(TWorkerNodeJob##Factory, Version, )
+
 #define NCBI_WORKERNODE_MAIN_WITH_LISTENER(TWorkerNodeJob, Version,         \
                                            ListenerClass)                   \
     NCBI_DECLARE_WORKERNODE_FACTORY(TWorkerNodeJob, Version);               \
-    int main(int argc, const char* argv[])                                  \
-    {                                                                       \
-        GetDiagContext().SetOldPostFormat(false);                           \
-        NCBI_WORKERNODE_CLASS app(new TWorkerNodeJob##Factory,              \
-            CVersionInfo(#Version));                                        \
-        app.SetListener(new ListenerClass);                                 \
-        return app.AppMain(argc, argv, NULL, eDS_ToStdlog,                  \
-                NcbiEmptyCStr, GRID_WORKER_APP_NAME);                       \
-    }
+    NCBI_WORKERNODE_MAIN_IMPL(TWorkerNodeJob##Factory, Version,             \
+            app.SetListener(new ListenerClass))
 
 #define NCBI_WORKERNODE_MAIN_EX(TWorkerNodeJob,                             \
         TWorkerNodeIdleTask, Version)                                       \
     NCBI_DECLARE_WORKERNODE_FACTORY_EX(TWorkerNodeJob,                      \
             TWorkerNodeIdleTask, Version);                                  \
-    int main(int argc, const char* argv[])                                  \
-    {                                                                       \
-        GetDiagContext().SetOldPostFormat(false);                           \
-        NCBI_WORKERNODE_CLASS app(new TWorkerNodeJob##FactoryEx,            \
-            CVersionInfo(#Version));                                        \
-        return app.AppMain(argc, argv, NULL, eDS_ToStdlog,                  \
-                NcbiEmptyCStr, GRID_WORKER_APP_NAME);                       \
-    }
+    NCBI_WORKERNODE_MAIN_IMPL(TWorkerNodeJob##FactoryEx, Version, )
 
 #define NCBI_GRID_PKG_WORKER_NODE_MAIN(TWorkerNodeJob,                      \
         TWorkerNodeJobFactoryClass, ListenerClass)                          \
@@ -230,7 +220,7 @@ inline void CGridWorkerApp::SetListener(IGridWorkerNodeApp_Listener* listener)
     {                                                                       \
         GRID_APP_CHECK_VERSION_ARGS();                                      \
         GetDiagContext().SetOldPostFormat(false);                           \
-        NCBI_WORKERNODE_CLASS app(new TWorkerNodeJobFactoryClass);          \
+        CGridWorkerApp app(new TWorkerNodeJobFactoryClass);                 \
         app.SetListener(new ListenerClass);                                 \
         return app.AppMain(argc, argv, NULL, eDS_ToStdlog,                  \
                 NcbiEmptyCStr, GRID_WORKER_APP_NAME);                       \
diff --git a/c++/include/connect/services/netstorage_admin.hpp b/c++/include/connect/services/impl/neticache_client_int.hpp
similarity index 62%
copy from c++/include/connect/services/netstorage_admin.hpp
copy to c++/include/connect/services/impl/neticache_client_int.hpp
index f7c57b7..bbadd85 100644
--- a/c++/include/connect/services/netstorage_admin.hpp
+++ b/c++/include/connect/services/impl/neticache_client_int.hpp
@@ -1,7 +1,7 @@
-#ifndef CONNECT_SERVICES___NETSTORAGE_ADMIN__HPP
-#define CONNECT_SERVICES___NETSTORAGE_ADMIN__HPP
+#ifndef CONNECT_SERVICES_IMPL__NETICACHE_CLIENT_INT__HPP
+#define CONNECT_SERVICES_IMPL__NETICACHE_CLIENT_INT__HPP
 
-/*  $Id: netstorage_admin.hpp 405800 2013-07-08 20:41:50Z kazimird $
+/*  $Id: neticache_client_int.hpp 498373 2016-04-15 17:20:10Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -26,37 +26,39 @@
  *
  * ===========================================================================
  *
- * Author:  Dmitry Kazimirov
+ * Author: Rafael Sadyrov
  *
  * File Description:
- *   NetStorage administrative API declarations.
+ *   Internal declarations for NetCache ICache client API.
  *
  */
 
-#include "netstorage.hpp"
-#include "netservice_api.hpp"
 
 BEGIN_NCBI_SCOPE
 
-/// @internal
-struct SNetStorageAdminImpl;
 
-/// @internal
-class NCBI_XCONNECT_EXPORT CNetStorageAdmin
+struct NCBI_NET_CACHE_EXPORT CNetICacheClientExt : CNetICacheClient
 {
-    NCBI_NET_COMPONENT(NetStorageAdmin);
+    CNetICacheClientExt() : CNetICacheClient(eVoid) {}
+    CNetICacheClientExt(TInstance api)
+        : CNetICacheClient(api)
+    {
+        if (api) SetFlags(fBestReliability);
+    }
 
-    CNetStorageAdmin(CNetStorage::TInstance netstorage_impl);
+    CNetICacheClientExt& operator=(TInstance api)
+    {
+        CNetICacheClient::operator=(api);
+        if (api) SetFlags(fBestReliability);
+        return *this;
+    }
 
-    CNetService GetService();
-
-    CJsonNode MkNetStorageRequest(const string& request_type);
-
-    CJsonNode ExchangeJson(const CJsonNode& request,
-            CNetServer::TInstance server_to_use = NULL,
-            CNetServerConnection* conn = NULL);
+    void ProlongBlobLifetime(const string&, const CTimeout&,
+            const CNamedParameterList* optional = NULL);
 };
 
+
 END_NCBI_SCOPE
 
-#endif  /* CONNECT_SERVICES___NETSTORAGE_ADMIN__HPP */
+
+#endif
diff --git a/c++/include/connect/services/impl/netschedule_api_int.hpp b/c++/include/connect/services/impl/netschedule_api_int.hpp
new file mode 100644
index 0000000..5fd4ab4
--- /dev/null
+++ b/c++/include/connect/services/impl/netschedule_api_int.hpp
@@ -0,0 +1,312 @@
+#ifndef CONNECT_SERVICES_IMPL__NETSCHEDULE_API_INT__HPP
+#define CONNECT_SERVICES_IMPL__NETSCHEDULE_API_INT__HPP
+
+/*  $Id: netschedule_api_int.hpp 492596 2016-02-18 19:25:31Z ivanov $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors: Dmitry Kazimirov, Rafael Sadyrov
+ *
+ * File Description:
+ *   Internal declarations for NetSchedule client API.
+ *
+ */
+
+
+BEGIN_NCBI_SCOPE
+
+
+const unsigned int kNetScheduleMaxDBDataSize = 2048;
+
+const unsigned int kNetScheduleMaxDBErrSize = 4096;
+
+
+NCBI_DECLARE_INTERFACE_VERSION(SNetScheduleAPIImpl, "xnetschedule_api", 1,0, 0);
+
+extern NCBI_XCONNECT_EXPORT const char* const kNetScheduleAPIDriverName;
+
+extern NCBI_XCONNECT_EXPORT
+void g_AppendClientIPSessionIDHitID(string& cmd);
+
+extern NCBI_XCONNECT_EXPORT
+int g_ParseNSOutput(const string& attr_string, const char* const* attr_names,
+        string* attr_values, int attr_count);
+
+void NCBI_XCONNECT_EXPORT NCBI_EntryPoint_xnetscheduleapi(
+     CPluginManager<SNetScheduleAPIImpl>::TDriverInfoList&   info_list,
+     CPluginManager<SNetScheduleAPIImpl>::EEntryPointRequest method);
+
+class NCBI_XCONNECT_EXPORT CNetScheduleNotificationHandler
+{
+public:
+    CNetScheduleNotificationHandler();
+
+    bool ReceiveNotification(string* server_host = NULL);
+
+    bool WaitForNotification(const CDeadline& deadline,
+                             string*          server_host = NULL);
+
+    unsigned short GetPort() const {return m_UDPPort;}
+
+    const string& GetMessage() const {return m_Message;}
+
+    void PrintPortNumber();
+
+// Submitter methods.
+public:
+    void SubmitJob(CNetScheduleSubmitter::TInstance submitter,
+            CNetScheduleJob& job,
+            unsigned wait_time,
+            CNetServer* server = NULL);
+
+    bool CheckJobStatusNotification(const string& job_id,
+            CNetScheduleAPI::EJobStatus* job_status,
+            int* last_event_index = NULL);
+
+    // This method requires calling SubmitJob prior with wait_time set
+    CNetScheduleAPI::EJobStatus WaitForJobCompletion(CNetScheduleJob& job,
+            CDeadline& deadline, CNetScheduleAPI ns_api,
+            time_t* job_exptime = NULL);
+
+    bool RequestJobWatching(CNetScheduleAPI::TInstance ns_api,
+            const string& job_id,
+            const CDeadline& deadline,
+            CNetScheduleAPI::EJobStatus* job_status,
+            int* last_event_index);
+
+    enum EJobStatusMask {
+        fJSM_Pending        = 1 << CNetScheduleAPI::ePending,
+        fJSM_Running        = 1 << CNetScheduleAPI::eRunning,
+        fJSM_Canceled       = 1 << CNetScheduleAPI::eCanceled,
+        fJSM_Failed         = 1 << CNetScheduleAPI::eFailed,
+        fJSM_Done           = 1 << CNetScheduleAPI::eDone,
+        fJSM_Reading        = 1 << CNetScheduleAPI::eReading,
+        fJSM_Confirmed      = 1 << CNetScheduleAPI::eConfirmed,
+        fJSM_ReadFailed     = 1 << CNetScheduleAPI::eReadFailed,
+        fJSM_Deleted        = 1 << CNetScheduleAPI::eDeleted
+    };
+    typedef int TJobStatusMask;
+
+    CNetScheduleAPI::EJobStatus WaitForJobEvent(
+            const string& job_key,
+            CDeadline& deadline,
+            CNetScheduleAPI ns_api,
+            TJobStatusMask status_mask,
+            int last_event_index = kMax_Int,
+            int *new_event_index = NULL);
+
+// Worker node methods.
+public:
+    static string MkBaseGETCmd(
+        CNetScheduleExecutor::EJobAffinityPreference affinity_preference,
+        const string& affinity_list);
+    void CmdAppendTimeoutGroupAndClientInfo(string& cmd,
+            const CDeadline* deadline, const string& job_group);
+    bool RequestJob(CNetScheduleExecutor::TInstance executor,
+                    CNetScheduleJob& job,
+                    const string& cmd);
+    bool CheckRequestJobNotification(CNetScheduleExecutor::TInstance executor,
+                                     CNetServer* server);
+
+protected:
+    CDatagramSocket m_UDPSocket;
+    unsigned short m_UDPPort;
+
+    char m_Buffer[1024];
+    string m_Message;
+};
+
+struct NCBI_XCONNECT_EXPORT CNetScheduleAPIExt : CNetScheduleAPI
+{
+    CNetScheduleAPIExt() {}
+    CNetScheduleAPIExt(TInstance api) : CNetScheduleAPI(api) {}
+    CNetScheduleAPIExt& operator=(TInstance api)
+    {
+        CNetScheduleAPI::operator=(api);
+        return *this;
+    }
+    void AddToClientNode(const string& data);
+    void UpdateAuthString();
+    void UseOldStyleAuth();
+    void SetEventHandler(INetEventHandler* event_handler);
+    CCompoundIDPool GetCompoundIDPool();
+
+    /// Extract one of the servers comprising this service
+    /// as a separate NetSchedule API object.
+    CNetScheduleAPI GetServer(CNetServer::TInstance server);
+
+    // These allow empty values, too (unlike Set* counterparts)
+    void ReSetClientNode(const string&);
+    void ReSetClientSession(const string&);
+
+    // Create workernode-compatible API
+    static TInstance CreateWnCompat(const string&, const string&);
+
+    // Create API with no auto config loading (from server)
+    static TInstance CreateNoCfgLoad(const string&, const string&, const string&);
+};
+
+struct SNetScheduleAdminImpl;
+
+class NCBI_XCONNECT_EXPORT CNetScheduleAdmin
+{
+    NCBI_NET_COMPONENT(NetScheduleAdmin);
+
+    /// Status map, shows number of jobs in each status
+    typedef map<string, unsigned> TStatusMap;
+
+    /// Returns statuses for a given affinity token
+    /// @param status_map
+    ///    Status map (status to job count)
+    /// @param affinity_token
+    ///    Affinity token (optional)
+    /// @param job_group
+    ///    Only jobs belonging to the specified group (optional)
+    void StatusSnapshot(TStatusMap& status_map,
+            const string& affinity_token = kEmptyStr,
+            const string& job_group = kEmptyStr);
+
+    /// Create an instance of the given queue class.
+    /// @param qname
+    ///    Name of the queue to create
+    /// @param qclass
+    ///    Parameter set described in config file in a qclass_<qname> section.
+    /// @param description
+    ///    Brief free text description of the queue.
+    void CreateQueue(
+        const string& qname,
+        const string& qclass,
+        const string& description = kEmptyStr);
+
+    /// Delete queue
+    /// Applicable only to queues, created through CreateQueue method
+    /// @param qname
+    ///    Name of the queue to delete.
+    void DeleteQueue(const string& qname);
+
+
+    /// Shutdown level
+    ///
+    enum EShutdownLevel {
+        eNoShutdown = 0,    ///< No Shutdown was requested
+        eNormalShutdown,    ///< Normal shutdown was requested
+        eShutdownImmediate, ///< Urgent shutdown was requested
+        eDie,               ///< A serious error occurred, the server shuts down
+        eDrain              ///< Wait for all server data to expire.
+    };
+
+    /// Enable server drain mode.
+    ///
+    void SwitchToDrainMode(ESwitch on_off);
+
+    /// Shutdown the server daemon.
+    ///
+    void ShutdownServer(EShutdownLevel level = eNormalShutdown);
+
+    /// Cancel all jobs in the queue (optionally with particular statuses).
+    ///
+    /// @param job_statuses
+    ///    Optional comma-separated list of job statuses
+    void CancelAllJobs(const string& job_statuses = kEmptyStr);
+
+    void DumpJob(CNcbiOstream& out, const string& job_key);
+    CNetServerMultilineCmdOutput DumpJob(const string& job_key);
+
+    void ReloadServerConfig();
+
+    //////////////////////////////////////////////////////
+    /// Print version string
+    void PrintServerVersion(CNcbiOstream& output_stream);
+
+    struct SWorkerNodeInfo {
+        string name;
+        string prog;
+        string host;
+        unsigned short port;
+        CTime last_access;
+    };
+
+    void GetWorkerNodes(list<SWorkerNodeInfo>& worker_nodes);
+
+    void PrintConf(CNcbiOstream& output_stream);
+
+    enum EStatisticsOptions
+    {
+        eStatisticsAll,
+        eStatisticsBrief,
+        eStatisticsClients
+    };
+
+    void PrintServerStatistics(CNcbiOstream& output_stream,
+        EStatisticsOptions opt = eStatisticsBrief);
+
+    void PrintHealth(CNcbiOstream& output_stream);
+
+    // Two versions of DumpQueue to keep the code compile compatible
+    void DumpQueue(CNcbiOstream& output_stream,
+        const string& start_after_job = kEmptyStr,
+        size_t job_count = 0,
+        const string& job_statuses = kEmptyStr,
+        const string& job_group = kEmptyStr);
+    void DumpQueue(CNcbiOstream& output_stream,
+        const string& start_after_job,
+        size_t job_count,
+        CNetScheduleAPI::EJobStatus status,
+        const string& job_group = kEmptyStr);
+
+    typedef map<string, string> TQueueInfo;
+    // Get information on a particular queue of a particular server.
+    void GetQueueInfo(CNetServer server, const string& queue_name,
+            TQueueInfo& queue_info);
+    // The same as above, but for any random server in the service.
+    void GetQueueInfo(const string& queue_name, TQueueInfo& queue_info);
+    // Return information on the current queue.
+    void GetQueueInfo(CNetServer server, TQueueInfo& queue_info);
+    // The same as above, but for any random server in the service.
+    void GetQueueInfo(TQueueInfo& queue_info);
+    void PrintQueueInfo(const string& queue_name, CNcbiOstream& output_stream);
+
+    struct SServerQueueList {
+        CNetServer server;
+        list<string> queues;
+
+        SServerQueueList(SNetServerImpl* server_impl) : server(server_impl) {}
+    };
+
+    typedef list<SServerQueueList> TQueueList;
+
+    void GetQueueList(TQueueList& result);
+};
+
+// XXX: Workaround for VAR-1651
+// Return a JSON object where each key is a worker node
+// session and the value is a JSON object containing
+// status information reported by the worker node itself.
+NCBI_XCONNECT_EXPORT
+CJsonNode g_GetWorkerNodeInfo(CNetScheduleAPI api);
+
+END_NCBI_SCOPE
+
+
+#endif
diff --git a/c++/include/connect/services/impl/netstorage_impl.hpp b/c++/include/connect/services/impl/netstorage_impl.hpp
new file mode 100644
index 0000000..c36c070
--- /dev/null
+++ b/c++/include/connect/services/impl/netstorage_impl.hpp
@@ -0,0 +1,266 @@
+#ifndef CONNECT_SERVICES_IMPL__NETSTORAGE_IMPL__HPP
+#define CONNECT_SERVICES_IMPL__NETSTORAGE_IMPL__HPP
+
+/*  $Id: netstorage_impl.hpp 499844 2016-04-28 16:13:26Z ivanov $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Author:  Dmitry Kazimirov
+ *
+ * File Description:
+ *   NetStorage implementation declarations.
+ *
+ */
+
+#include <corelib/ncbi_url.hpp>
+#include <connect/services/netcache_api_expt.hpp>
+#include <connect/services/netstorage.hpp>
+
+#include <algorithm>
+
+BEGIN_NCBI_SCOPE
+
+/// @internal
+struct NCBI_XCONNECT_EXPORT SNetStorageObjectImpl :
+    public CObject,
+    public IReader,
+    public IEmbeddedStreamWriter
+{
+    /* IReader methods */
+    virtual ERW_Result Read(void* buf, size_t count, size_t* bytes_read) = 0;
+    virtual ERW_Result PendingCount(size_t* count);
+
+    /* IEmbeddedStreamWriter methods */
+    virtual ERW_Result Write(const void* buf, size_t count,
+            size_t* bytes_written) = 0;
+    virtual ERW_Result Flush();
+    virtual void Close() = 0;
+    virtual void Abort();
+
+    /* More overridable methods */
+    virtual IReader& GetReader();
+    virtual IEmbeddedStreamWriter& GetWriter();
+
+    virtual string GetLoc() = 0;
+    virtual void Read(string* data);
+    virtual bool Eof() = 0;
+    virtual Uint8 GetSize() = 0;
+    virtual list<string> GetAttributeList() const = 0;
+    virtual string GetAttribute(const string& attr_name) const = 0;
+    virtual void SetAttribute(const string& attr_name,
+            const string& attr_value) = 0;
+    virtual CNetStorageObjectInfo GetInfo() = 0;
+    virtual void SetExpiration(const CTimeout&) = 0;
+
+    virtual string FileTrack_Path() = 0;
+};
+
+/// @internal
+struct NCBI_XCONNECT_EXPORT SNetStorage
+{
+    struct SConfig;
+    struct SLimits;
+
+    static SNetStorageImpl* CreateImpl(const SConfig&, TNetStorageFlags);
+    static SNetStorageByKeyImpl* CreateByKeyImpl(const SConfig&, TNetStorageFlags);
+};
+
+/// @internal
+struct NCBI_XCONNECT_EXPORT SNetStorage::SConfig
+{
+    enum EDefaultStorage {
+        eUndefined,
+        eNetStorage,
+        eNetCache,
+        eNoCreate,
+    };
+
+    enum EErrMode {
+        eThrow,
+        eLog,
+        eIgnore,
+    };
+
+    string service;
+    string nc_service;
+    string app_domain;
+    string client_name;
+    string metadata;
+    EDefaultStorage default_storage;
+    EErrMode err_mode;
+
+    SConfig() : default_storage(eUndefined), err_mode(eLog) {}
+    void ParseArg(const string&, const string&);
+    void Validate(const string&);
+
+    static SConfig Build(const string& init_string)
+    {
+        return BuildImpl<SConfig>(init_string);
+    }
+
+protected:
+    template <class TConfig>
+    static TConfig BuildImpl(const string& init_string)
+    {
+        CUrlArgs url_parser(init_string);
+        TConfig cfg;
+
+        ITERATE(CUrlArgs::TArgs, field, url_parser.GetArgs()) {
+            if (!field->name.empty() && !field->value.empty()) {
+                cfg.ParseArg(field->name, field->value);
+            }
+        }
+
+        cfg.Validate(init_string);
+        return cfg;
+    }
+
+private:
+    static EDefaultStorage GetDefaultStorage(const string&);
+    static EErrMode GetErrMode(const string&);
+};
+
+/// @internal
+struct NCBI_XCONNECT_EXPORT SNetStorage::SLimits
+{
+    struct SNamespace
+    {
+        static string   Name()          { return "Namespace"; }
+        static size_t   MaxLength()     { return 32; }
+        static bool     IsValid(char c) { return isalnum(c) || c == '_'; };
+    };
+
+    struct SUserKey
+    {
+        static string   Name()          { return "User key"; }
+        static size_t   MaxLength()     { return 256; }
+        static bool     IsValid(char c) { return ::isprint(c); };
+    };
+
+    struct SAttrName
+    {
+        static string   Name()          { return "Attribute name"; }
+        static size_t   MaxLength()     { return 64; }
+        static bool     IsValid(char c) { return isalnum(c) || c == '_'; };
+    };
+
+    struct SAttrValue
+    {
+        static string   Name()          { return "Attribute value"; }
+        static size_t   MaxLength()     { return 900; }
+        static bool     IsValid(char c) { return true; };
+    };
+
+    struct SClientName
+    {
+        static string   Name()          { return "Client name"; }
+        static size_t   MaxLength()     { return 256; }
+        static bool     IsValid(char c) { return ::isprint(c); };
+    };
+
+    struct SUserNamespace
+    {
+        static string   Name()          { return "User namespace"; }
+        static size_t   MaxLength()     { return 64; }
+        static bool     IsValid(char c) { return isalnum(c) || c == '_'; };
+    };
+
+    struct SUserName
+    {
+        static string   Name()          { return "User name"; }
+        static size_t   MaxLength()     { return 64; }
+        static bool     IsValid(char c) { return isalnum(c) || c == '_'; };
+    };
+
+    template <class TValue>
+    static void Check(const string& value)
+    {
+        if (value.length() > TValue::MaxLength()) {
+            ThrowTooLong(TValue::Name(), TValue::MaxLength());
+        }
+
+        if (!all_of(value.begin(), value.end(), TValue::IsValid)) {
+            ThrowIllegalChars(TValue::Name(), value);
+        }
+    }
+
+private:
+    static void ThrowTooLong(const string&, size_t);
+    static void ThrowIllegalChars(const string&, const string&);
+};
+
+/// @internal
+struct NCBI_XCONNECT_EXPORT SNetStorageImpl : public CObject
+{
+    typedef SNetStorage::SConfig TConfig;
+
+    virtual CNetStorageObject Create(TNetStorageFlags flags = 0) = 0;
+    virtual CNetStorageObject Open(const string& object_loc) = 0;
+    virtual string Relocate(const string& object_loc,
+            TNetStorageFlags flags) = 0;
+    virtual bool Exists(const string& object_loc) = 0;
+    virtual ENetStorageRemoveResult Remove(const string& object_loc) = 0;
+#ifdef NCBI_GRID_XSITE_CONN_SUPPORT
+    virtual void AllowXSiteConnections() {}
+#endif
+};
+
+/// @internal
+struct NCBI_XCONNECT_EXPORT SNetStorageByKeyImpl : public CObject
+{
+    typedef SNetStorage::SConfig TConfig;
+
+    virtual CNetStorageObject Open(const string& unique_key,
+            TNetStorageFlags flags = 0) = 0;
+    virtual string Relocate(const string& unique_key,
+            TNetStorageFlags flags, TNetStorageFlags old_flags = 0) = 0;
+    virtual bool Exists(const string& key, TNetStorageFlags flags = 0) = 0;
+    virtual ENetStorageRemoveResult Remove(const string& key,
+            TNetStorageFlags flags = 0) = 0;
+#ifdef NCBI_GRID_XSITE_CONN_SUPPORT
+    virtual void AllowXSiteConnections() {}
+#endif
+};
+
+#define NETSTORAGE_CONVERT_NETCACHEEXCEPTION(message) \
+    catch (CNetCacheException& e) { \
+        g_ThrowNetStorageException(DIAG_COMPILE_INFO, e, FORMAT(message)); \
+    }
+NCBI_XCONNECT_EXPORT
+void g_ThrowNetStorageException(const CDiagCompileInfo& compile_info,
+        const CNetCacheException& prev_exception, const string& message);
+
+NCBI_XCONNECT_EXPORT
+CNetStorageObjectInfo g_CreateNetStorageObjectInfo(const string& object_loc,
+        ENetStorageObjectLocation location,
+        const CNetStorageObjectLoc* object_loc_struct,
+        Uint8 file_size, CJsonNode::TInstance storage_specific_info);
+
+NCBI_XCONNECT_EXPORT
+CNetStorageObjectInfo g_CreateNetStorageObjectInfo(
+        const CJsonNode& object_info_node);
+
+END_NCBI_SCOPE
+
+#endif  /* CONNECT_SERVICES_IMPL__NETSTORAGE_IMPL__HPP */
diff --git a/c++/include/connect/services/impl/netstorage_int.hpp b/c++/include/connect/services/impl/netstorage_int.hpp
new file mode 100644
index 0000000..c06cc35
--- /dev/null
+++ b/c++/include/connect/services/impl/netstorage_int.hpp
@@ -0,0 +1,289 @@
+#ifndef CONNECT_SERVICES_IMPL__NETSTORAGE_INT__HPP
+#define CONNECT_SERVICES_IMPL__NETSTORAGE_INT__HPP
+
+/*  $Id: netstorage_int.hpp 499028 2016-04-21 15:25:58Z ivanov $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Author:  Dmitry Kazimirov
+ *
+ * File Description:
+ *   NetStorage implementation declarations.
+ *
+ */
+
+#include <connect/services/compound_id.hpp>
+#include <connect/services/netservice_api.hpp>
+
+BEGIN_NCBI_SCOPE
+
+/// @internal
+template <TNetStorageFlags MASK>
+class CNetStorageFlagsSubset
+{
+    typedef CNetStorageFlagsSubset TSelf;
+public:
+    CNetStorageFlagsSubset(TNetStorageFlags flags) : m_Flags(flags & MASK) {}
+    TSelf& operator &=(TSelf flag) { m_Flags &= flag; return *this; }
+    TSelf& operator |=(TSelf flag) { m_Flags |= flag; return *this; }
+    TSelf& operator ^=(TSelf flag) { m_Flags ^= flag; return *this; }
+    operator TNetStorageFlags() const { return m_Flags; }
+
+private:
+    TNetStorageFlags m_Flags;
+};
+
+typedef CNetStorageFlagsSubset<fNST_AnyLoc> TNetStorageLocFlags;
+typedef CNetStorageFlagsSubset<fNST_AnyAttr> TNetStorageAttrFlags;
+
+/// @internal
+class NCBI_XCONNECT_EXPORT CNetStorageObjectLoc
+{
+public:
+    enum EFileTrackSite {
+        eFileTrack_ProdSite = 0,
+        eFileTrack_DevSite,
+        eFileTrack_QASite,
+        eNumberOfFileTrackSites
+    };
+
+    CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
+            TNetStorageAttrFlags flags,
+            const string& app_domain,
+            Uint8 random_number,
+            EFileTrackSite ft_site);
+    CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
+            TNetStorageAttrFlags flags,
+            const string& app_domain,
+            const string& unique_key,
+            EFileTrackSite ft_site);
+    CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
+            const string& object_loc);
+    CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
+            const string& object_loc, TNetStorageAttrFlags flags);
+
+    void SetObjectID(Uint8 object_id)
+    {
+        m_LocatorFlags &= ~(TLocatorFlags) fLF_NoMetaData;
+        m_LocatorFlags |= fLF_HasObjectID;
+        m_ObjectID = object_id;
+        if ((m_LocatorFlags & fLF_HasUserKey) == 0) {
+            m_ShortUniqueKey = MakeShortUniqueKey();
+            m_UniqueKey = MakeUniqueKey();
+        }
+        m_Dirty = true;
+    }
+
+    void SetServiceName(const string& service_name)
+    {
+        if (service_name.empty() ||
+                strchr(service_name.c_str(), ':') != NULL)
+            ClearLocatorFlags(fLF_NetStorageService);
+        else {
+            m_ServiceName = service_name;
+            SetLocatorFlags(fLF_NetStorageService);
+        }
+        m_Dirty = true;
+    }
+
+    bool HasServiceName() const {return m_LocatorFlags & fLF_NetStorageService;}
+
+    string GetServiceName() const {return m_ServiceName;}
+
+    ENetStorageObjectLocation GetLocation() const {return m_Location;}
+
+    bool IsMetaDataDisabled() const
+    {
+        return (m_LocatorFlags & fLF_NoMetaData) != 0;
+    }
+
+    CTime GetCreationTime() const {return CTime(m_Timestamp);}
+
+    bool HasUserKey() const {return (m_LocatorFlags & fLF_HasUserKey) != 0;}
+
+    // These are intended to be used together
+    string GetAppDomain() const {return m_AppDomain;}
+    string GetShortUniqueKey() const {return m_ShortUniqueKey;}
+
+    // This contains both of the above
+    string GetUniqueKey() const {return m_UniqueKey;}
+
+    void SetLocation_NetCache(const string& service_name,
+        bool allow_xsite_conn);
+
+    string GetNCServiceName() const {return m_NCServiceName;}
+
+    bool IsXSiteProxyAllowed() const
+    {
+        return (m_NCFlags & fNCF_AllowXSiteConn) != 0;
+    }
+
+    void SetLocation_FileTrack(EFileTrackSite ft_site);
+    EFileTrackSite GetFileTrackSite() const;
+
+    string GetLocator() const
+    {
+        if (m_Dirty)
+            x_Pack();
+        return m_Locator;
+    }
+
+    TNetStorageAttrFlags GetStorageAttrFlags() const;
+
+    // Serialize to a JSON object.
+    void ToJSON(CJsonNode& root) const;
+    CJsonNode ToJSON() const;
+
+private:
+    enum ELocatorFlags {
+        fLF_NetStorageService   = (1 << 0),
+        fLF_NoMetaData          = (1 << 1),
+        fLF_HasObjectID         = (1 << 2),
+        fLF_HasUserKey          = (1 << 3),
+        fLF_Movable             = (1 << 4),
+        fLF_Cacheable           = (1 << 5),
+        fLF_DevEnv              = (1 << 6),
+        fLF_QAEnv               = (1 << 7),
+
+        eLF_AttrFlags = (
+                fLF_NoMetaData |
+                fLF_Movable |
+                fLF_Cacheable),
+        eLF_FieldFlags = (
+                fLF_NetStorageService |
+                fLF_HasObjectID |
+                fLF_HasUserKey |
+                fLF_DevEnv |
+                fLF_QAEnv)
+    };
+    typedef unsigned TLocatorFlags;
+
+    enum ENetCacheFlags {
+        fNCF_AllowXSiteConn     = (1 << 0),
+    };
+    typedef unsigned TNetCacheFlags;
+
+    void Parse(const string& object_loc);
+    string MakeShortUniqueKey() const;
+    string MakeUniqueKey() const { return m_AppDomain + '-' + m_ShortUniqueKey; }
+
+    void x_Pack() const;
+    void SetLocatorFlags(TLocatorFlags flags) {m_LocatorFlags |= flags;}
+    void ClearLocatorFlags(TLocatorFlags flags) {m_LocatorFlags &= ~flags;}
+
+    static TLocatorFlags x_StorageFlagsToLocatorFlags(
+            TNetStorageAttrFlags storage_flags,
+            EFileTrackSite ft_site = eFileTrack_ProdSite);
+
+    mutable CCompoundIDPool m_CompoundIDPool;
+
+    TLocatorFlags m_LocatorFlags;
+
+    Uint8 m_ObjectID;
+
+    string m_ServiceName;
+    string m_LocationCode;
+    ENetStorageObjectLocation m_Location;
+
+    string m_AppDomain;
+
+    Int8 m_Timestamp;
+    Uint8 m_Random;
+
+    // Either user key or key composed of timestamp, random value and object ID.
+    string m_ShortUniqueKey;
+    // The same as above plus app domain
+    string m_UniqueKey;
+
+    TNetCacheFlags m_NCFlags;
+    string m_NCServiceName;
+
+    mutable bool m_Dirty;
+
+    mutable string m_Locator;
+};
+
+/// @internal
+class CNetStorageServerError
+{
+public:
+    enum EErrCode {
+        eInvalidArgument                    = 1001,
+        eMandatoryFieldsMissed              = 1002,
+        eHelloRequired                      = 1003,
+        eInvalidMessageType                 = 1004,
+        eInvalidIncomingMessage             = 1005,
+        ePrivileges                         = 1006,
+        eInvalidMessageHeader               = 1007,
+        eShuttingDown                       = 1008,
+        eMessageAfterBye                    = 1009,
+        eStorageError                       = 1010,
+        eWriteError                         = 1011,
+        eReadError                          = 1012,
+        eInternalError                      = 1013,
+        eNetStorageObjectNotFound           = 1014,
+        eNetStorageAttributeNotFound        = 1015,
+        eNetStorageAttributeValueNotFound   = 1016,
+        eNetStorageClientNotFound           = 1017,
+        eNetStorageObjectExpired            = 1018,
+        eDatabaseError                      = 1019,
+        eInvalidConfig                      = 1020,
+        eRemoteObjectNotFound               = 1021,
+
+        // Meta info involving operation requested while the service
+        // is not configured for meta or HELLO metadata option conflict
+        eInvalidMetaInfoRequest             = 1022,
+        eUnknownError                       = 1023
+    };
+};
+
+/// @internal
+struct SNetStorageAdminImpl;
+
+/// @internal
+class NCBI_XCONNECT_EXPORT CNetStorageAdmin
+{
+    NCBI_NET_COMPONENT(NetStorageAdmin);
+
+    CNetStorageAdmin(CNetStorage::TInstance netstorage_impl);
+
+    CNetService GetService();
+
+    CJsonNode MkNetStorageRequest(const string& request_type);
+
+    CJsonNode ExchangeJson(const CJsonNode& request,
+            CNetServer::TInstance server_to_use = NULL,
+            CNetServerConnection* conn = NULL);
+};
+
+#ifdef NCBI_GRID_XSITE_CONN_SUPPORT
+/// @internal
+NCBI_XCONNECT_EXPORT
+void g_AllowXSiteConnections(CNetStorage&);
+void g_AllowXSiteConnections(CNetStorageByKey&);
+#endif
+
+END_NCBI_SCOPE
+
+#endif  /* CONNECT_SERVICES_IMPL__NETSTORAGE_INT__HPP */
diff --git a/c++/include/connect/services/json_over_uttp.hpp b/c++/include/connect/services/json_over_uttp.hpp
index f3e8e02..ca96bd8 100644
--- a/c++/include/connect/services/json_over_uttp.hpp
+++ b/c++/include/connect/services/json_over_uttp.hpp
@@ -1,7 +1,7 @@
 #ifndef JSON_OVER_UTTP__HPP
 #define JSON_OVER_UTTP__HPP
 
-/*  $Id: json_over_uttp.hpp 401489 2013-05-30 17:12:37Z kazimird $
+/*  $Id: json_over_uttp.hpp 495785 2016-03-21 16:50:59Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -252,7 +252,7 @@ class NCBI_XCONNECT_EXPORT CJsonNode
 
     /// Provided that this is a string node, return
     /// the string value of this node.
-    const string& AsString() const;
+    const string AsString() const;
 
     /// Provided that this is a numeric node (that is, either
     /// an integer or a floating point node), return the value
diff --git a/c++/include/connect/services/netcache_api.hpp b/c++/include/connect/services/netcache_api.hpp
index c9e0a57..c04730b 100644
--- a/c++/include/connect/services/netcache_api.hpp
+++ b/c++/include/connect/services/netcache_api.hpp
@@ -1,7 +1,7 @@
 #ifndef CONN___NETCACHE_API__HPP
 #define CONN___NETCACHE_API__HPP
 
-/*  $Id: netcache_api.hpp 458433 2015-02-04 21:48:50Z kazimird $
+/*  $Id: netcache_api.hpp 481318 2015-10-08 15:54:01Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -108,10 +108,10 @@ BEGIN_NCBI_SCOPE
 /// @see CNetCacheAPI::TUseCompoundID
 #define nc_use_compound_id CNetCacheAPI::TUseCompoundID()
 
-/// When looking for an ICache blob, use only the most likely server
-/// to hold the blob; do not query other servers.
-/// @see CNetCacheAPI::TSingleServer
-#define nc_single_server CNetCacheAPI::TSingleServer()
+/// Whether to run a request through all NetCache servers in the
+/// ICache service in an attempt to find the blob.
+/// @see CNetCacheAPI::TTryAllServers
+#define nc_try_all_servers CNetCacheAPI::TTryAllServers()
 
 /// In ICache mode, override the name of the cache specified
 /// in the CNetICacheClient constructor.
@@ -221,7 +221,7 @@ class NCBI_XCONNECT_EXPORT CNetCacheAPI
         eNPT_MaxBlobAge,
         eNPT_ActualBlobAgePtr,
         eNPT_UseCompoundID,
-        eNPT_SingleServer,
+        eNPT_TryAllServers,
         eNPT_CacheName,
     };
 
@@ -574,13 +574,13 @@ class NCBI_XCONNECT_EXPORT CNetCacheAPI
     /// @see nc_use_compound_id
     typedef CNamedParameter<bool, eNPT_UseCompoundID> TUseCompoundID;
 
-    /// Named parameter type to define whether to use only the most
-    /// likely server when looking for an ICache blob.
+    /// Named parameter type to define whether to run a request through all
+    /// NetCache servers in the ICache service in an attempt to find the blob.
     /// This type of parameter can be defined through the
-    /// nc_single_server macro substitution, for example:
-    ///     nc_single_server = true
-    /// @see nc_single_server
-    typedef CNamedParameter<bool, eNPT_SingleServer> TSingleServer;
+    /// nc_try_all_servers macro substitution, for example:
+    ///     nc_try_all_servers = true
+    /// @see nc_try_all_servers
+    typedef CNamedParameter<bool, eNPT_TryAllServers> TTryAllServers;
 
     /// In ICache mode, override the name of the cache specified
     /// in the CNetICacheClient constructor.
diff --git a/c++/include/connect/services/netcache_api_expt.hpp b/c++/include/connect/services/netcache_api_expt.hpp
index 4c87b57..d51e58a 100644
--- a/c++/include/connect/services/netcache_api_expt.hpp
+++ b/c++/include/connect/services/netcache_api_expt.hpp
@@ -1,7 +1,7 @@
 #ifndef CONN___NETCACHE_API_EXPT__HPP
 #define CONN___NETCACHE_API_EXPT__HPP
 
-/*  $Id: netcache_api_expt.hpp 422615 2013-12-23 19:18:45Z kazimird $
+/*  $Id: netcache_api_expt.hpp 490874 2016-01-29 14:28:07Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -50,7 +50,7 @@ BEGIN_NCBI_SCOPE
 
 /// NetCache internal exception
 ///
-class CNetCacheException : public CNetServiceException
+class NCBI_XCONNECT_EXPORT CNetCacheException : public CNetServiceException
 {
 public:
     typedef CNetServiceException TParent;
@@ -97,7 +97,7 @@ public:
 /// Exception thrown when the requested blob is
 /// older than the requested age.
 ///
-class CNetCacheBlobTooOldException : public CNetCacheException
+class NCBI_XCONNECT_EXPORT CNetCacheBlobTooOldException : public CNetCacheException
 {
 public:
     typedef CNetCacheException TParent;
diff --git a/c++/include/connect/services/netcomponent.hpp b/c++/include/connect/services/netcomponent.hpp
index 7f47535..cab81b6 100644
--- a/c++/include/connect/services/netcomponent.hpp
+++ b/c++/include/connect/services/netcomponent.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES__NET_OBJECT_HPP
 #define CONNECT_SERVICES__NET_OBJECT_HPP
 
-/*  $Id: netcomponent.hpp 458824 2015-02-10 17:42:48Z sadyrovr $
+/*  $Id: netcomponent.hpp 485042 2015-11-18 14:41:49Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -73,22 +73,21 @@ public:
     }
 };
 
+#define NCBI_NET_COMPONENT_DEF(Class, Impl)                                 \
+    protected:                                                              \
+    CRef<Impl, CNetComponentCounterLocker<Impl> > m_Impl;                   \
+    public:                                                                 \
+    typedef Impl* TInstance;                                                \
+    Class(EVoid)                        {}                                  \
+    Class(Impl* impl) : m_Impl(impl)    {}                                  \
+    Class& operator =(Impl* impl)       { m_Impl = impl; return *this; }    \
+    operator Impl*()                    { return m_Impl.GetPointer(); }     \
+    operator const Impl*() const        { return m_Impl.GetPointer(); }     \
+    Impl* operator ->()                 { return m_Impl.GetPointer(); }     \
+    const Impl* operator ->() const     { return m_Impl.GetPointer(); }
 
 #define NCBI_NET_COMPONENT_IMPL(component) \
-    protected: \
-    CRef<S##component##Impl, \
-        CNetComponentCounterLocker<S##component##Impl> > m_Impl; \
-    public: \
-    typedef S##component##Impl* TInstance; \
-    C##component(S##component##Impl* impl) : m_Impl(impl) {} \
-    C##component& operator =(S##component##Impl* impl) \
-        {m_Impl = impl; return *this;} \
-    operator S##component##Impl*() {return m_Impl.GetPointer();} \
-    operator const S##component##Impl*() const {return m_Impl.GetPointer();} \
-    S##component##Impl* operator ->() {return m_Impl.GetPointer();} \
-    const S##component##Impl* operator ->() const \
-        {return m_Impl.GetPointer();} \
-    C##component(EVoid /* create_void */) {}
+    NCBI_NET_COMPONENT_DEF(C##component, S##component##Impl)
 
 #define NCBI_NET_COMPONENT(component) \
     NCBI_NET_COMPONENT_IMPL(component) \
diff --git a/c++/include/connect/services/neticache_client.hpp b/c++/include/connect/services/neticache_client.hpp
index b5bb9bc..ec135b7 100644
--- a/c++/include/connect/services/neticache_client.hpp
+++ b/c++/include/connect/services/neticache_client.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES___NETICACHE_CLIENT__HPP
 #define CONNECT_SERVICES___NETICACHE_CLIENT__HPP
 
-/*  $Id: neticache_client.hpp 458824 2015-02-10 17:42:48Z sadyrovr $
+/*  $Id: neticache_client.hpp 486447 2015-12-04 15:37:50Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -39,6 +39,8 @@
 
 #include "netcache_api.hpp"
 
+#include <list>
+
 #include <connect/ncbi_core_cxx.hpp>
 
 #include <util/resource_pool.hpp>
@@ -90,6 +92,9 @@ class NCBI_NET_CACHE_EXPORT CNetICacheClient : public ICache
     CNetICacheClient(CConfig* config = NULL,
                      const string& driver_name = kEmptyStr);
 
+    CNetICacheClient(const IRegistry& reg,
+                     const string& conf_section = kEmptyStr);
+
     CNetICacheClient(const string& host,
                      unsigned short port,
                      const string& cache_name,
@@ -140,6 +145,20 @@ class NCBI_NET_CACHE_EXPORT CNetICacheClient : public ICache
                               int            version,
                               const string&  subkey,
                               string*        owner);
+
+    /// Returns a list of subkeys for a given key
+    ///
+    list<string> GetSubkeyList(const string& key);
+
+    /// @warning
+    ///    This method DOES NOT follow ICache::Read() interface
+    ///    on returning values/throwing exceptions.
+    ///
+    /// @return
+    ///    FALSE if BLOB has not been fully read
+    ///
+    /// @throw
+    ///    If any error occurs (e.g. BLOB doesn't exist or expired).
     virtual bool Read(const string& key,
                       int           version,
                       const string& subkey,
@@ -344,4 +363,6 @@ void Cache_RegisterDriver_NetCache(void);
 
 END_NCBI_SCOPE
 
+#include "impl/neticache_client_int.hpp"
+
 #endif  /* CONNECT_SERVICES___NETICACHE_CLIENT__HPP */
diff --git a/c++/include/connect/services/netschedule_api.hpp b/c++/include/connect/services/netschedule_api.hpp
index d36fb5a..300402f 100644
--- a/c++/include/connect/services/netschedule_api.hpp
+++ b/c++/include/connect/services/netschedule_api.hpp
@@ -1,7 +1,7 @@
 #ifndef CONN___NETSCHEDULE_API__HPP
 #define CONN___NETSCHEDULE_API__HPP
 
-/*  $Id: netschedule_api.hpp 470759 2015-06-18 17:19:51Z ivanov $
+/*  $Id: netschedule_api.hpp 492595 2016-02-18 19:25:07Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -48,13 +48,6 @@
 BEGIN_NCBI_SCOPE
 
 
-/// @internal
-const unsigned int kNetScheduleMaxDBDataSize = 2048;
-
-/// @internal
-const unsigned int kNetScheduleMaxDBErrSize = 4096;
-
-
 /// Defines whether the job queue is paused, and if so, defines
 /// the pause mode set by the administrator.
 enum ENetScheduleQueuePauseMode {
@@ -300,34 +293,6 @@ class NCBI_XCONNECT_EXPORT CNetScheduleAPI
     static ENetScheduleWarningType ExtractWarningType(string& warn_msg);
     static const char* WarningTypeToString(
             ENetScheduleWarningType warning_type);
-
-    /// @internal
-    void UpdateAuthString();
-
-    /// This method is for use by the grid_cli utility only.
-    /// @internal
-    void EnableWorkerNodeCompatMode();
-
-    /// This method is for use by the grid_cli utility only.
-    /// @internal
-    void UseOldStyleAuth();
-
-    /// Extract one of the servers comprising this service
-    /// as a separate NetSchedule API object.
-    /// This method is for use by the grid_cli utility only.
-    /// @internal
-    CNetScheduleAPI GetServer(CNetServer::TInstance server);
-
-    /// This method is for use by the grid_cli utility only.
-    /// @internal
-    void SetEventHandler(INetEventHandler* event_handler);
-
-    /// This method is for use by worker nodes.
-    /// @internal
-    void SetAuthParam(const string& param_name, const string& param_value);
-
-    /// @internal
-    CCompoundIDPool GetCompoundIDPool();
 };
 
 
@@ -507,6 +472,23 @@ class NCBI_XCONNECT_EXPORT CNetScheduleSubmitter
     CNetScheduleAPI:: EJobStatus SubmitJobAndWait(CNetScheduleJob& job,
                                                   unsigned       wait_time);
 
+    /// Wait for job to finish its execution (done/failed/canceled).
+    /// This function should be used if we expect that job execution
+    /// infrastructure is capable of finishing job in the specified
+    /// time frame. This method can save a lot of round trips with the
+    /// NetSchedule server (comparing to series of GetStatus calls).
+    ///
+    /// @param job_id
+    ///    NetSchedule job key.
+    /// @param wait_time
+    ///    Time in seconds function waits for the job to finish.
+    /// @return job status
+    ///    Returns current job status,
+    ///    could be any status (e.g. if job does not finish in wait_time).
+    ///
+    CNetScheduleAPI::EJobStatus WaitForJob(const string& job_id,
+            unsigned wait_time);
+
     /// Cancel job
     ///
     /// @param job_key
@@ -861,272 +843,11 @@ class NCBI_XCONNECT_EXPORT CNetScheduleJobReader
     void InterruptReading();
 };
 
-////////////////////////////////////////////////////////////////////////////////
-////
-
-struct SNetScheduleAdminImpl;
-
-class NCBI_XCONNECT_EXPORT CNetScheduleAdmin
-{
-    NCBI_NET_COMPONENT(NetScheduleAdmin);
-
-    /// Status map, shows number of jobs in each status
-    typedef map<string, unsigned> TStatusMap;
-
-    /// Returns statuses for a given affinity token
-    /// @param status_map
-    ///    Status map (status to job count)
-    /// @param affinity_token
-    ///    Affinity token (optional)
-    /// @param job_group
-    ///    Only jobs belonging to the specified group (optional)
-    void StatusSnapshot(TStatusMap& status_map,
-            const string& affinity_token = kEmptyStr,
-            const string& job_group = kEmptyStr);
-
-    /// Create an instance of the given queue class.
-    /// @param qname
-    ///    Name of the queue to create
-    /// @param qclass
-    ///    Parameter set described in config file in a qclass_<qname> section.
-    /// @param description
-    ///    Brief free text description of the queue.
-    void CreateQueue(
-        const string& qname,
-        const string& qclass,
-        const string& description = kEmptyStr);
-
-    /// Delete queue
-    /// Applicable only to queues, created through CreateQueue method
-    /// @param qname
-    ///    Name of the queue to delete.
-    void DeleteQueue(const string& qname);
-
-
-    /// Shutdown level
-    ///
-    enum EShutdownLevel {
-        eNoShutdown = 0,    ///< No Shutdown was requested
-        eNormalShutdown,    ///< Normal shutdown was requested
-        eShutdownImmediate, ///< Urgent shutdown was requested
-        eDie,               ///< A serious error occurred, the server shuts down
-        eDrain              ///< Wait for all server data to expire.
-    };
-
-    /// Enable server drain mode.
-    ///
-    void SwitchToDrainMode(ESwitch on_off);
-
-    /// Shutdown the server daemon.
-    ///
-    void ShutdownServer(EShutdownLevel level = eNormalShutdown);
-
-    /// Cancel all jobs in the queue (optionally with particular statuses).
-    ///
-    /// @param job_statuses
-    ///    Optional comma-separated list of job statuses
-    void CancelAllJobs(const string& job_statuses = kEmptyStr);
-
-    void DumpJob(CNcbiOstream& out, const string& job_key);
-    CNetServerMultilineCmdOutput DumpJob(const string& job_key);
-
-    void ReloadServerConfig();
-
-    //////////////////////////////////////////////////////
-    /// Print version string
-    void PrintServerVersion(CNcbiOstream& output_stream);
-
-    struct SWorkerNodeInfo {
-        string name;
-        string prog;
-        string host;
-        unsigned short port;
-        CTime last_access;
-    };
-
-    void GetWorkerNodes(list<SWorkerNodeInfo>& worker_nodes);
-
-    void PrintConf(CNcbiOstream& output_stream);
-
-    enum EStatisticsOptions
-    {
-        eStatisticsAll,
-        eStatisticsBrief,
-        eStatisticsClients
-    };
-
-    void PrintServerStatistics(CNcbiOstream& output_stream,
-        EStatisticsOptions opt = eStatisticsBrief);
-
-    void PrintHealth(CNcbiOstream& output_stream);
-
-    // Two versions of DumpQueue to keep the code compile compatible
-    void DumpQueue(CNcbiOstream& output_stream,
-        const string& start_after_job = kEmptyStr,
-        size_t job_count = 0,
-        const string& job_statuses = kEmptyStr,
-        const string& job_group = kEmptyStr);
-    void DumpQueue(CNcbiOstream& output_stream,
-        const string& start_after_job,
-        size_t job_count,
-        CNetScheduleAPI::EJobStatus status,
-        const string& job_group = kEmptyStr);
-
-    typedef map<string, string> TQueueInfo;
-    // Get information on a particular queue of a particular server.
-    void GetQueueInfo(CNetServer server, const string& queue_name,
-            TQueueInfo& queue_info);
-    // The same as above, but for any random server in the service.
-    void GetQueueInfo(const string& queue_name, TQueueInfo& queue_info);
-    // Return information on the current queue.
-    void GetQueueInfo(CNetServer server, TQueueInfo& queue_info);
-    // The same as above, but for any random server in the service.
-    void GetQueueInfo(TQueueInfo& queue_info);
-    void PrintQueueInfo(const string& queue_name, CNcbiOstream& output_stream);
-
-    struct SServerQueueList {
-        CNetServer server;
-        list<string> queues;
-
-        SServerQueueList(SNetServerImpl* server_impl) : server(server_impl) {}
-    };
-
-    typedef list<SServerQueueList> TQueueList;
-
-    void GetQueueList(TQueueList& result);
-};
-
-
-NCBI_DECLARE_INTERFACE_VERSION(SNetScheduleAPIImpl, "xnetschedule_api", 1,0, 0);
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-/// @internal
-extern NCBI_XCONNECT_EXPORT const char* const kNetScheduleAPIDriverName;
-
-/// @internal
-extern NCBI_XCONNECT_EXPORT
-void g_AppendClientIPAndSessionID(string& cmd,
-        const string* default_session = NULL);
-
-/// @internal
-extern NCBI_XCONNECT_EXPORT
-void g_AppendHitID(string& cmd);
-
-/// @internal
-extern NCBI_XCONNECT_EXPORT
-void g_AppendClientIPSessionIDHitID(string& cmd,
-        const string* default_session = NULL);
-
-/// @internal
-extern NCBI_XCONNECT_EXPORT
-int g_ParseNSOutput(const string& attr_string, const char* const* attr_names,
-        string* attr_values, int attr_count);
-
-/// @internal
-void NCBI_XCONNECT_EXPORT NCBI_EntryPoint_xnetscheduleapi(
-     CPluginManager<SNetScheduleAPIImpl>::TDriverInfoList&   info_list,
-     CPluginManager<SNetScheduleAPIImpl>::EEntryPointRequest method);
-
-/// @internal
-class NCBI_XCONNECT_EXPORT CNetScheduleNotificationHandler
-{
-public:
-    CNetScheduleNotificationHandler();
-
-    bool ReceiveNotification(string* server_host = NULL);
-
-    bool WaitForNotification(const CDeadline& deadline,
-                             string*          server_host = NULL);
-
-    unsigned short GetPort() const {return m_UDPPort;}
-
-    const string& GetMessage() const {return m_Message;}
-
-    void PrintPortNumber();
-
-// Submitter methods.
-public:
-    void SubmitJob(CNetScheduleSubmitter::TInstance submitter,
-            CNetScheduleJob& job,
-            unsigned wait_time,
-            CNetServer* server = NULL);
-
-    bool CheckJobStatusNotification(const string& job_id,
-            CNetScheduleAPI::EJobStatus* job_status,
-            int* last_event_index = NULL);
-
-    // This method requires calling SubmitJob prior with wait_time set
-    CNetScheduleAPI::EJobStatus WaitForJobCompletion(CNetScheduleJob& job,
-            CDeadline& deadline, CNetScheduleAPI ns_api);
-
-    bool RequestJobWatching(CNetScheduleAPI::TInstance ns_api,
-            const string& job_id,
-            const CDeadline& deadline,
-            CNetScheduleAPI::EJobStatus* job_status,
-            int* last_event_index);
-
-    enum EJobStatusMask {
-        fJSM_Pending        = 1 << CNetScheduleAPI::ePending,
-        fJSM_Running        = 1 << CNetScheduleAPI::eRunning,
-        fJSM_Canceled       = 1 << CNetScheduleAPI::eCanceled,
-        fJSM_Failed         = 1 << CNetScheduleAPI::eFailed,
-        fJSM_Done           = 1 << CNetScheduleAPI::eDone,
-        fJSM_Reading        = 1 << CNetScheduleAPI::eReading,
-        fJSM_Confirmed      = 1 << CNetScheduleAPI::eConfirmed,
-        fJSM_ReadFailed     = 1 << CNetScheduleAPI::eReadFailed,
-        fJSM_Deleted        = 1 << CNetScheduleAPI::eDeleted
-    };
-    typedef int TJobStatusMask;
-
-    CNetScheduleAPI::EJobStatus WaitForJobEvent(
-            const string& job_key,
-            CDeadline& deadline,
-            CNetScheduleAPI ns_api,
-            TJobStatusMask status_mask,
-            int last_event_index = kMax_Int,
-            int *new_event_index = NULL);
-
-// Worker node methods.
-public:
-    static string MkBaseGETCmd(
-        CNetScheduleExecutor::EJobAffinityPreference affinity_preference,
-        const string& affinity_list);
-    void CmdAppendTimeoutGroupAndClientInfo(string& cmd,
-            const CDeadline* deadline, const string& job_group);
-    bool RequestJob(CNetScheduleExecutor::TInstance executor,
-                    CNetScheduleJob& job,
-                    const string& cmd);
-    bool CheckRequestJobNotification(CNetScheduleExecutor::TInstance executor,
-                                     CNetServer* server);
-
-protected:
-    CDatagramSocket m_UDPSocket;
-    unsigned short m_UDPPort;
-
-    char m_Buffer[1024];
-    string m_Message;
-};
-
-/// @internal
-inline unsigned s_GetRemainingSeconds(const CDeadline& deadline)
-{
-    unsigned sec;
-    unsigned nanosec;
-
-    deadline.GetRemainingTime().GetNano(&sec, &nanosec);
-
-    if (nanosec > 0)
-        ++sec;
-
-    return sec;
-}
-
 /* @} */
 
 
 END_NCBI_SCOPE
 
+#include "impl/netschedule_api_int.hpp"
 
 #endif  /* CONN___NETSCHEDULE_API__HPP */
diff --git a/c++/include/connect/services/netservice_api.hpp b/c++/include/connect/services/netservice_api.hpp
index 02fae88..4644f78 100644
--- a/c++/include/connect/services/netservice_api.hpp
+++ b/c++/include/connect/services/netservice_api.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES___NETSERVICE_API__HPP
 #define CONNECT_SERVICES___NETSERVICE_API__HPP
 
-/*  $Id: netservice_api.hpp 456051 2015-01-07 17:38:03Z kazimird $
+/*  $Id: netservice_api.hpp 484796 2015-11-16 14:47:31Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -70,8 +70,6 @@ class NCBI_XCONNECT_EXPORT CNetServerPool
 {
     NCBI_NET_COMPONENT(NetServerPool);
 
-    const string& GetClientName() const;
-
     void StickToServer(const string& host, unsigned short port);
 
     void SetCommunicationTimeout(const STimeout& to);
@@ -102,7 +100,6 @@ class NCBI_XCONNECT_EXPORT CNetService
 
     CNetServer GetServer(unsigned host, unsigned short port);
     CNetServer GetServer(const string& host, unsigned short port);
-    CNetServer GetServer(const SServerAddress& server_address);
 
     CNetServiceIterator Iterate(EIterationMode mode = eSortByLoad);
     CNetServiceIterator Iterate(CNetServer::TInstance priority_server);
@@ -136,29 +133,21 @@ class NCBI_XCONNECT_EXPORT CNetService
         ECmdOutputStyle output_style,
         CNetService::EIterationMode = CNetService::eSortByLoad);
 
+    CNetService Clone(const string& name);
+
 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT
     void AllowXSiteConnections();
     bool IsUsingXSiteProxy();
 #endif
 };
 
-inline CNetServer CNetService::GetServer(const string& host,
-        unsigned short port)
-{
-    return GetServer(SServerAddress(host, port));
-}
-
-inline CNetServer CNetService::GetServer(unsigned host, unsigned short port)
-{
-    return GetServer(SServerAddress(host, port));
-}
-
 /// This class is for use by the grid_cli utility only.
 /// @internal
 class NCBI_XCONNECT_EXPORT INetEventHandler : public CObject
 {
 public:
-    virtual void OnWarning(const string& warn_msg, CNetServer server) = 0;
+    virtual bool OnError(CException::TErrCode) { return false; }
+    virtual void OnWarning(const string&, CNetServer) {}
 };
 
 /// This class is for use by the grid_cli utility only.
diff --git a/c++/include/connect/services/netstorage.hpp b/c++/include/connect/services/netstorage.hpp
index 1932dda..d6ee656 100644
--- a/c++/include/connect/services/netstorage.hpp
+++ b/c++/include/connect/services/netstorage.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES__NETSTORAGE__HPP
 #define CONNECT_SERVICES__NETSTORAGE__HPP
 
-/*  $Id: netstorage.hpp 463989 2015-04-02 19:01:11Z sadyrovr $
+/*  $Id: netstorage.hpp 494456 2016-03-07 17:46:55Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -38,6 +38,7 @@
 
 #include "json_over_uttp.hpp"
 #include "srv_connections.hpp"
+#include "netservice_api_expt.hpp"
 
 #include <corelib/ncbitime.hpp>
 
@@ -60,7 +61,7 @@ class  CNetStorageObjectLoc;            ///< @internal
 /// Exception class for use by CNetStorage, CNetStorageByKey,
 /// and CNetStorageObject
 ///
-class NCBI_XCONNECT_EXPORT CNetStorageException : public CException
+class NCBI_XCONNECT_EXPORT CNetStorageException : public CNetServiceException
 {
 public:
     enum EErrCode {
@@ -70,10 +71,12 @@ public:
         eIOError,       ///< I/O error encountered while performing an op
         eServerError,   ///< NetStorage server error
         eTimeout,       ///< Timeout encountered while performing an op
-        eExpired        ///< Object has expired on server
+        eExpired,       ///< Object has expired on server
+        eNotSupported,  ///< Feature is not supported
+        eUnknown        ///< Unknown error
     };
     virtual const char* GetErrCodeString() const;
-    NCBI_EXCEPTION_DEFAULT(CNetStorageException, CException);
+    NCBI_EXCEPTION_DEFAULT(CNetStorageException, CNetServiceException);
 };
 
 /// Enumeration that indicates the current location of the object.
@@ -115,11 +118,6 @@ class NCBI_XCONNECT_EXPORT CNetStorageObjectInfo
     /// @note Valid only if GetLocation() != eNFL_NotFound.
     CJsonNode GetStorageSpecificInfo() const;
 
-    /// If the object is stored on a network file system,
-    /// return the pathname of the file. Otherwise, throw
-    /// an exception.
-    string GetNFSPathname() const;
-
     /// Pack the whole structure in a single JSON object.
     CJsonNode ToJSON();
 };
@@ -317,9 +315,28 @@ class NCBI_XCONNECT_EXPORT CNetStorageObject
     /// @see CNetStorageObjectInfo
     ///
     CNetStorageObjectInfo GetInfo(void);
+
+    /// Updates expiration on the object.
+    ///
+    /// @param ttl
+    ///  Expiration timeout, may be infinite
+    /// 
+    /// @throw If the underlying storage does not support expiration,
+    /// a CNetStorageException will be thrown.
+    ///
+    void SetExpiration(const CTimeout& ttl);
 };
 
 
+/// Result returned by Remove() methods
+///
+/// @see CNetStorage::Remove(), CNetStorageByKey::Remove()
+///
+enum ENetStorageRemoveResult
+{
+    eNSTRR_NotFound,    ///< Removing failed due to object not found
+    eNSTRR_Removed      ///< Object has been removed successfully
+};
 
 
 /////////////////////////////////////////////////////////////////////////////
@@ -411,13 +428,12 @@ class NCBI_XCONNECT_EXPORT CNetStorage
     ///
     bool Exists(const string& object_loc);
 
-    /// Remove the object addressed by 'object_loc'. If the object is
-    /// cached, an attempt is made to purge it from the cache as well.
+    /// Remove the object addressed by 'object_loc'.
     ///
     /// @param object_loc
     ///  File to remove
     ///
-    void Remove(const string& object_loc);
+    ENetStorageRemoveResult Remove(const string& object_loc);
 
     /// @deprecated To change flags use Relocate(object_loc, flags) instead.
     NCBI_DEPRECATED
@@ -452,9 +468,7 @@ class NCBI_XCONNECT_EXPORT CNetStorageByKey
     ///  * client     - Application name.
     ///  * nst        - NetStorage server address or LBSM service name
     ///                 pointing to a group of NetStorage servers.
-    ///  * nc         - NetCache service name or server address.
-    ///  * cache      - Synonym for "namespace".
-    ///  Example: "client=MyApp&nst=NST_Test&nc=NC_MyApp_TEST&namespace=myapp"
+    ///  Example: "client=MyApp&nst=NST_Test&namespace=myapp"
     ///
     /// @param default_flags
     ///  Default storage preferences for objects created by this object.
@@ -507,7 +521,7 @@ class NCBI_XCONNECT_EXPORT CNetStorageByKey
     /// @param flags
     ///  Combination of flags that hints on the current object location
     ///
-    void Remove(const string& key, TNetStorageFlags flags = 0);
+    ENetStorageRemoveResult Remove(const string& key, TNetStorageFlags flags = 0);
 };
 
 
@@ -515,6 +529,6 @@ class NCBI_XCONNECT_EXPORT CNetStorageByKey
 
 END_NCBI_SCOPE
 
-#include "netstorage_impl.hpp"
+#include "impl/netstorage_int.hpp"
 
 #endif  /* CONNECT_SERVICES__NETSTORAGE__HPP */
diff --git a/c++/include/connect/services/netstorage_admin.hpp b/c++/include/connect/services/netstorage_ft.hpp
similarity index 62%
rename from c++/include/connect/services/netstorage_admin.hpp
rename to c++/include/connect/services/netstorage_ft.hpp
index f7c57b7..dd077bc 100644
--- a/c++/include/connect/services/netstorage_admin.hpp
+++ b/c++/include/connect/services/netstorage_ft.hpp
@@ -1,7 +1,7 @@
-#ifndef CONNECT_SERVICES___NETSTORAGE_ADMIN__HPP
-#define CONNECT_SERVICES___NETSTORAGE_ADMIN__HPP
+#ifndef CONNECT_SERVICES__NETSTORAGE_FT__HPP
+#define CONNECT_SERVICES__NETSTORAGE_FT__HPP
 
-/*  $Id: netstorage_admin.hpp 405800 2013-07-08 20:41:50Z kazimird $
+/*  $Id: netstorage_ft.hpp 493320 2016-02-25 19:43:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -26,37 +26,42 @@
  *
  * ===========================================================================
  *
- * Author:  Dmitry Kazimirov
+ * Authors: Rafael Sadyrov
  *
  * File Description:
- *   NetStorage administrative API declarations.
+ *   A NetStorage API for FileTrack objects.
  *
  */
 
+
 #include "netstorage.hpp"
-#include "netservice_api.hpp"
+
 
 BEGIN_NCBI_SCOPE
 
-/// @internal
-struct SNetStorageAdminImpl;
 
-/// @internal
-class NCBI_XCONNECT_EXPORT CNetStorageAdmin
+/// Represents file path of underlying FileTrack object.
+/// File path is locked in constructor and held for up to 20 minues (FT default).
+///
+class NCBI_XCONNECT_EXPORT CNetStorageObject_FileTrack_Path
 {
-    NCBI_NET_COMPONENT(NetStorageAdmin);
-
-    CNetStorageAdmin(CNetStorage::TInstance netstorage_impl);
+public:
+    /// Locks file path if object resides in FileTrack.
+    ///
+    /// @throw CNetStorageException
+    ///     Throws an exception if object does not reside in FileTrack,
+    //      or there is an error.
+    CNetStorageObject_FileTrack_Path(CNetStorageObject object);
 
-    CNetService GetService();
+    /// Get file path.
+    operator string() const { return m_Path; }
 
-    CJsonNode MkNetStorageRequest(const string& request_type);
-
-    CJsonNode ExchangeJson(const CJsonNode& request,
-            CNetServer::TInstance server_to_use = NULL,
-            CNetServerConnection* conn = NULL);
+private:
+    const string m_Path;
 };
 
+
 END_NCBI_SCOPE
 
-#endif  /* CONNECT_SERVICES___NETSTORAGE_ADMIN__HPP */
+
+#endif
diff --git a/c++/include/connect/services/netstorage_impl.hpp b/c++/include/connect/services/netstorage_impl.hpp
index 032f298..161571e 100644
--- a/c++/include/connect/services/netstorage_impl.hpp
+++ b/c++/include/connect/services/netstorage_impl.hpp
@@ -1,7 +1,7 @@
-#ifndef CONNECT_SERVICES___NETSTORAGE_IMPL__HPP
-#define CONNECT_SERVICES___NETSTORAGE_IMPL__HPP
+#ifndef CONNECT_SERVICES__NETSTORAGE_IMPL__HPP
+#define CONNECT_SERVICES__NETSTORAGE_IMPL__HPP
 
-/*  $Id: netstorage_impl.hpp 463378 2015-03-26 21:17:57Z lavr $
+/*  $Id: netstorage_impl.hpp 482927 2015-10-27 15:29:36Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -26,473 +26,15 @@
  *
  * ===========================================================================
  *
- * Author:  Dmitry Kazimirov
- *
- * File Description:
- *   NetStorage implementation declarations.
+ * Author: Rafael Sadyrov   
  *
  */
 
-#include "netstorage.hpp"
-#include "compound_id.hpp"
-#include "netcache_api.hpp"
-
-#include <corelib/rwstream.hpp>
-#include <connect/services/neticache_client.hpp>
-
-BEGIN_NCBI_SCOPE
-
-/// @internal
-struct NCBI_XCONNECT_EXPORT SNetStorageObjectImpl :
-    public CObject,
-    public IReader,
-    public IEmbeddedStreamWriter
-{
-    /* IReader methods */
-    virtual ERW_Result Read(void* buf, size_t count, size_t* bytes_read) = 0;
-    virtual ERW_Result PendingCount(size_t* count);
-
-    /* IEmbeddedStreamWriter methods */
-    virtual ERW_Result Write(const void* buf, size_t count,
-            size_t* bytes_written) = 0;
-    virtual ERW_Result Flush();
-    virtual void Close() = 0;
-    virtual void Abort();
-
-    /* More overridable methods */
-    virtual IReader& GetReader();
-    virtual IEmbeddedStreamWriter& GetWriter();
-
-    virtual string GetLoc() = 0;
-    virtual void Read(string* data);
-    virtual bool Eof() = 0;
-    virtual Uint8 GetSize() = 0;
-    virtual list<string> GetAttributeList() const = 0;
-    virtual string GetAttribute(const string& attr_name) const = 0;
-    virtual void SetAttribute(const string& attr_name,
-            const string& attr_value) = 0;
-    virtual CNetStorageObjectInfo GetInfo() = 0;
-};
-
-struct NCBI_XCONNECT_EXPORT SNetStorageObjectRWStream : public CRWStream
-{
-    SNetStorageObjectRWStream(SNetStorageObjectImpl* nst_object) :
-        CRWStream(nst_object, nst_object, /*buf_size*/ 0, /*buf*/ NULL,
-                  CRWStreambuf::fLeakExceptions),
-        m_NetStorageObject(nst_object)
-    {
-    }
-
-    virtual ~SNetStorageObjectRWStream();
-
-    CNetStorageObject m_NetStorageObject;
-};
-
-inline string CNetStorageObject::GetLoc()
-{
-    return m_Impl->GetLoc();
-}
-
-inline size_t CNetStorageObject::Read(void* buffer, size_t buf_size)
-{
-    size_t bytes_read;
-    m_Impl->Read(buffer, buf_size, &bytes_read);
-    return bytes_read;
-}
-
-inline void CNetStorageObject::Read(string* data)
-{
-    m_Impl->Read(data);
-}
-
-inline IReader& CNetStorageObject::GetReader()
-{
-    return m_Impl->GetReader();
-}
-
-inline bool CNetStorageObject::Eof()
-{
-    return m_Impl->Eof();
-}
-
-inline void CNetStorageObject::Write(const void* buffer, size_t buf_size)
-{
-    m_Impl->Write(buffer, buf_size, NULL);
-}
-
-inline void CNetStorageObject::Write(const string& data)
-{
-    m_Impl->Write(data.data(), data.length(), NULL);
-}
-
-inline IEmbeddedStreamWriter& CNetStorageObject::GetWriter()
-{
-    return m_Impl->GetWriter();
-}
-
-inline CNcbiIostream* CNetStorageObject::GetRWStream()
-{
-    return new SNetStorageObjectRWStream(m_Impl);
-}
-
-inline Uint8 CNetStorageObject::GetSize()
-{
-    return m_Impl->GetSize();
-}
-
-inline CNetStorageObject::TAttributeList CNetStorageObject::GetAttributeList() const
-{
-    return m_Impl->GetAttributeList();
-}
-
-inline string CNetStorageObject::GetAttribute(const string& attr_name) const
-{
-    return m_Impl->GetAttribute(attr_name);
-}
-
-inline void CNetStorageObject::SetAttribute(const string& attr_name,
-        const string& attr_value)
-{
-    m_Impl->SetAttribute(attr_name, attr_value);
-}
-
-inline CNetStorageObjectInfo CNetStorageObject::GetInfo()
-{
-    return m_Impl->GetInfo();
-}
-
-inline void CNetStorageObject::Close()
-{
-    m_Impl->Close();
-}
-
-/// @internal
-struct NCBI_XCONNECT_EXPORT SNetStorageImpl : public CObject
-{
-    virtual CNetStorageObject Create(TNetStorageFlags flags = 0) = 0;
-    virtual CNetStorageObject Open(const string& object_loc) = 0;
-    virtual string Relocate(const string& object_loc,
-            TNetStorageFlags flags) = 0;
-    virtual bool Exists(const string& object_loc) = 0;
-    virtual void Remove(const string& object_loc) = 0;
-};
-
-inline CNetStorageObject CNetStorage::Create(TNetStorageFlags flags)
-{
-    return m_Impl->Create(flags);
-}
-
-inline CNetStorageObject CNetStorage::Open(const string& object_loc)
-{
-    return m_Impl->Open(object_loc);
-}
-
-inline CNetStorageObject CNetStorage::Open(const string& object_loc,
-        TNetStorageFlags /*flags*/)
-{
-    return m_Impl->Open(object_loc);
-}
-
-inline string CNetStorage::Relocate(const string& object_loc,
-        TNetStorageFlags flags)
-{
-    return m_Impl->Relocate(object_loc, flags);
-}
-
-inline bool CNetStorage::Exists(const string& object_loc)
-{
-    return m_Impl->Exists(object_loc);
-}
-
-inline void CNetStorage::Remove(const string& object_loc)
-{
-    m_Impl->Remove(object_loc);
-}
-
-/// @internal
-struct NCBI_XCONNECT_EXPORT SNetStorageByKeyImpl : public CObject
-{
-    virtual CNetStorageObject Open(const string& unique_key,
-            TNetStorageFlags flags = 0) = 0;
-    virtual string Relocate(const string& unique_key,
-            TNetStorageFlags flags, TNetStorageFlags old_flags = 0) = 0;
-    virtual bool Exists(const string& key, TNetStorageFlags flags = 0) = 0;
-    virtual void Remove(const string& key, TNetStorageFlags flags = 0) = 0;
-};
-
-inline CNetStorageObject CNetStorageByKey::Open(const string& unique_key,
-        TNetStorageFlags flags)
-{
-    return m_Impl->Open(unique_key, flags);
-}
-
-inline string CNetStorageByKey::Relocate(const string& unique_key,
-        TNetStorageFlags flags, TNetStorageFlags old_flags)
-{
-    return m_Impl->Relocate(unique_key, flags, old_flags);
-}
-
-inline bool CNetStorageByKey::Exists(const string& key, TNetStorageFlags flags)
-{
-    return m_Impl->Exists(key, flags);
-}
-
-inline void CNetStorageByKey::Remove(const string& key, TNetStorageFlags flags)
-{
-    m_Impl->Remove(key, flags);
-}
-
-/// @internal
-template <TNetStorageFlags MASK>
-class CNetStorageFlagsSubset
-{
-    typedef CNetStorageFlagsSubset TSelf;
-public:
-    CNetStorageFlagsSubset(TNetStorageFlags flags) : m_Flags(flags & MASK) {}
-    TSelf& operator &=(TSelf flag) { m_Flags &= flag; return *this; }
-    TSelf& operator |=(TSelf flag) { m_Flags |= flag; return *this; }
-    TSelf& operator ^=(TSelf flag) { m_Flags ^= flag; return *this; }
-    operator TNetStorageFlags() const { return m_Flags; }
-
-private:
-    TNetStorageFlags m_Flags;
-};
-
-typedef CNetStorageFlagsSubset<fNST_AnyLoc> TNetStorageLocFlags;
-typedef CNetStorageFlagsSubset<fNST_AnyAttr> TNetStorageAttrFlags;
-
-/// @internal
-class NCBI_XCONNECT_EXPORT CNetStorageObjectLoc
-{
-public:
-    CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
-            TNetStorageAttrFlags flags,
-            const string& app_domain,
-            Uint8 random_number,
-            const char* ft_site_name);
-    CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
-            TNetStorageAttrFlags flags,
-            const string& app_domain,
-            const string& unique_key,
-            const char* ft_site_name);
-    CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
-            const string& object_loc);
-    CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
-            const string& object_loc, TNetStorageAttrFlags flags);
-
-    void SetObjectID(Uint8 object_id)
-    {
-        m_LocatorFlags &= ~(TLocatorFlags) fLF_NoMetaData;
-        m_LocatorFlags |= fLF_HasObjectID;
-        m_ObjectID = object_id;
-        if ((m_LocatorFlags & fLF_HasUserKey) == 0)
-            x_SetUniqueKeyFromRandom();
-        m_Dirty = true;
-    }
-
-    Uint8 GetObjectID() const {return m_ObjectID;}
-
-    void SetServiceName(const string& service_name)
-    {
-        if (service_name.empty() ||
-                strchr(service_name.c_str(), ':') != NULL)
-            ClearLocatorFlags(fLF_NetStorageService);
-        else {
-            m_ServiceName = service_name;
-            SetLocatorFlags(fLF_NetStorageService);
-        }
-        m_Dirty = true;
-    }
-
-    string GetServiceName() const {return m_ServiceName;}
-
-    ENetStorageObjectLocation GetLocation() const {return m_Location;}
-
-    bool IsMovable() const {return (m_LocatorFlags & fLF_Movable) != 0;}
-    bool IsCacheable() const {return (m_LocatorFlags & fLF_Cacheable) != 0;}
-    bool IsMetaDataDisabled() const
-    {
-        return (m_LocatorFlags & fLF_NoMetaData) != 0;
-    }
-
-    Int8 GetTimestamp() const {return m_Timestamp;}
-    CTime GetCreationTime() const {return CTime(m_Timestamp);}
-    Uint8 GetRandom() const {return m_Random;}
-
-    bool HasUserKey() const {return (m_LocatorFlags & fLF_HasUserKey) != 0;}
-    string GetAppDomain() const {return m_AppDomain;}
-    string GetUserKey() const {return m_UserKey;}
-
-    string GetICacheKey() const {return m_ICacheKey;}
-    string GetUniqueKey() const {return m_UniqueKey;}
-
-    void SetCacheChunkSize(size_t cache_chunk_size)
-    {
-        m_CacheChunkSize = cache_chunk_size;
-        m_Dirty = true;
-    }
-
-    Uint8 GetCacheChunkSize() const {return m_CacheChunkSize;}
-
-    void SetLocation_NetCache(const string& service_name,
-        Uint4 server_ip, unsigned short server_port,
-        bool allow_xsite_conn);
-
-    string GetNCServiceName() const {return m_NCServiceName;}
-    Uint4 GetNetCacheIP() const {return m_NetCacheIP;}
-    Uint2 GetNetCachePort() const {return m_NetCachePort;}
-
-    bool IsXSiteProxyAllowed() const
-    {
-        return (m_NCFlags & fNCF_AllowXSiteConn) != 0;
-    }
-
-    void SetLocation_FileTrack(const char* ft_site_name);
-
-    string GetFileTrackURL();
-
-    string GetLocator() const
-    {
-        if (m_Dirty)
-            x_Pack();
-        return m_Locator;
-    }
-
-    TNetStorageAttrFlags GetStorageAttrFlags() const;
-
-    // Serialize to a JSON object.
-    void ToJSON(CJsonNode& root) const;
-    CJsonNode ToJSON() const;
-
-private:
-    enum ELocatorFlags {
-        fLF_NetStorageService   = (1 << 0),
-        fLF_NoMetaData          = (1 << 1),
-        fLF_HasObjectID         = (1 << 2),
-        fLF_HasUserKey          = (1 << 3),
-        fLF_Movable             = (1 << 4),
-        fLF_Cacheable           = (1 << 5),
-        fLF_DevEnv              = (1 << 6),
-        fLF_QAEnv               = (1 << 7),
-
-        eLF_AttrFlags = (
-                fLF_NoMetaData |
-                fLF_Movable |
-                fLF_Cacheable),
-        eLF_FieldFlags = (
-                fLF_NetStorageService |
-                fLF_HasObjectID |
-                fLF_HasUserKey |
-                fLF_DevEnv |
-                fLF_QAEnv)
-    };
-    typedef unsigned TLocatorFlags;
-
-    enum ENetCacheFlags {
-        fNCF_AllowXSiteConn     = (1 << 0),
-        fNCF_ServerSpecified    = (1 << 1),
-    };
-    typedef unsigned TNetCacheFlags;
-
-    void Parse(const string& object_loc);
-    void x_SetFileTrackSite(const char* ft_site_name);
-    void x_SetUniqueKeyFromRandom();
-    void x_SetUniqueKeyFromUserDefinedKey();
-
-    void x_Pack() const;
-    void SetLocatorFlags(TLocatorFlags flags) {m_LocatorFlags |= flags;}
-    void ClearLocatorFlags(TLocatorFlags flags) {m_LocatorFlags &= ~flags;}
-
-    TLocatorFlags x_StorageFlagsToLocatorFlags(
-            TNetStorageAttrFlags storage_flags);
-
-    mutable CCompoundIDPool m_CompoundIDPool;
-
-    TLocatorFlags m_LocatorFlags;
-
-    Uint8 m_ObjectID;
-
-    string m_ServiceName;
-    string m_LocationCode;
-    ENetStorageObjectLocation m_Location;
-
-    string m_AppDomain;
-
-    Int8 m_Timestamp;
-    Uint8 m_Random;
-
-    string m_UserKey;
-
-    // Either "m_Timestamp-m_Random[-m_ObjectID]" or m_UserKey.
-    string m_ICacheKey;
-    // "m_AppDomain-m_ICacheKey"
-    string m_UniqueKey;
-
-    Uint8 m_CacheChunkSize;
-
-    TNetCacheFlags m_NCFlags;
-    string m_NCServiceName;
-    Uint4 m_NetCacheIP;
-    Uint2 m_NetCachePort;
-
-    mutable bool m_Dirty;
-
-    mutable string m_Locator;
-};
-
-/// @internal
-class NCBI_XCONNECT_EXPORT CDNCNetStorage
-{
-public:
-    static CNetStorageObject Create(CNetCacheAPI::TInstance nc_api);
-    static CNetStorageObject Open(CNetCacheAPI::TInstance nc_api,
-        const string& blob_key);
-};
-
-/// @internal
-class CNetStorageServerError
-{
-public:
-    enum EErrCode {
-        eInvalidArgument                    = 1001,
-        eMandatoryFieldsMissed              = 1002,
-        eHelloRequired                      = 1003,
-        eInvalidMessageType                 = 1004,
-        eInvalidIncomingMessage             = 1005,
-        ePrivileges                         = 1006,
-        eInvalidMessageHeader               = 1007,
-        eShuttingDown                       = 1008,
-        eMessageAfterBye                    = 1009,
-        eStorageError                       = 1010,
-        eWriteError                         = 1011,
-        eReadError                          = 1012,
-        eInternalError                      = 1013,
-        eNetStorageObjectNotFound           = 1014,
-        eNetStorageAttributeNotFound        = 1015,
-        eNetStorageAttributeValueNotFound   = 1016,
-        eNetStorageClientNotFound           = 1017,
-        eNetStorageObjectExpired            = 1018,
-        eDatabaseError                      = 1019,
-        eInvalidConfig                      = 1020,
-        eRemoteObjectNotFound               = 1021,
-
-        // Meta info involving operation requested while the service
-        // is not configured for meta or HELLO metadata option conflict
-        eInvalidMetaInfoRequest             = 1022,
-        eUnknownError                       = 1023
-    };
-};
-
-NCBI_XCONNECT_EXPORT
-CNetStorageObjectInfo g_CreateNetStorageObjectInfo(const string& object_loc,
-        ENetStorageObjectLocation location,
-        const CNetStorageObjectLoc* object_loc_struct,
-        Uint8 file_size, CJsonNode::TInstance storage_specific_info);
-
-NCBI_XCONNECT_EXPORT
-CNetStorageObjectInfo g_CreateNetStorageObjectInfo(const string& object_loc,
-        const CJsonNode& object_info_node);
+#ifdef __GNUC__
+#  warning "Header <connect/services/netstorage_impl.hpp> is internal; please use <connect/services/netstorage.hpp> instead!"
+#endif // __GNUC__ 
 
-END_NCBI_SCOPE
+#include <connect/services/impl/netstorage_impl.hpp>
+#include <connect/services/impl/netstorage_int.hpp>
 
-#endif  /* CONNECT_SERVICES___NETSTORAGE_IMPL__HPP */
+#endif  /* CONNECT_SERVICES__NETSTORAGE_IMPL__HPP */
diff --git a/c++/include/connect/services/ns_output_parser.hpp b/c++/include/connect/services/ns_output_parser.hpp
index a3b2902..4635ce1 100644
--- a/c++/include/connect/services/ns_output_parser.hpp
+++ b/c++/include/connect/services/ns_output_parser.hpp
@@ -1,4 +1,4 @@
-/*  $Id: ns_output_parser.hpp 435870 2014-05-21 15:11:19Z kazimird $
+/*  $Id: ns_output_parser.hpp 479861 2015-09-23 21:07:21Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -80,40 +80,6 @@ private:
     const char* m_Ch;
 };
 
-enum ENetScheduleStatTopic {
-    eNetScheduleStatJobGroups,
-    eNetScheduleStatClients,
-    eNetScheduleStatNotifications,
-    eNetScheduleStatAffinities,
-    eNumberOfNetStheduleStatTopics
-};
-
-extern NCBI_XCONNECT_EXPORT
-string g_GetNetScheduleStatCommand(ENetScheduleStatTopic topic);
-
-extern NCBI_XCONNECT_EXPORT
-CJsonNode g_GenericStatToJson(CNetServer server,
-        ENetScheduleStatTopic topic, bool verbose);
-
-extern NCBI_XCONNECT_EXPORT
-bool g_FixMisplacedPID(CJsonNode& stat_info, CTempString& executable_path,
-        const char* pid_key);
-
-extern NCBI_XCONNECT_EXPORT
-CJsonNode g_LegacyStatToJson(CNetServer server, bool verbose);
-
-extern NCBI_XCONNECT_EXPORT
-CJsonNode g_QueueInfoToJson(CNetScheduleAPI ns_api,
-        const string& queue_name, CNetService::EServiceType service_type);
-
-extern NCBI_XCONNECT_EXPORT
-CJsonNode g_QueueClassInfoToJson(CNetScheduleAPI ns_api,
-        CNetService::EServiceType service_type);
-
-extern NCBI_XCONNECT_EXPORT
-CJsonNode g_ReconfAndReturnJson(CNetScheduleAPI ns_api,
-        CNetService::EServiceType service_type);
-
 class NCBI_XCONNECT_EXPORT CAttrListParser
 {
 public:
@@ -144,61 +110,6 @@ private:
     const char* m_EOL;
 };
 
-class NCBI_XCONNECT_EXPORT IJobInfoProcessor
-{
-public:
-    virtual void ProcessJobMeta(const CNetScheduleKey& key) = 0;
-
-    virtual void BeginJobEvent(const CTempString& event_header) = 0;
-    virtual void ProcessJobEventField(const CTempString& attr_name,
-            const string& attr_value) = 0;
-    virtual void ProcessJobEventField(const CTempString& attr_name) = 0;
-
-    virtual void ProcessInputOutput(const string& data,
-            const CTempString& input_or_output) = 0;
-
-    virtual void ProcessJobInfoField(const CTempString& field_name,
-            const CTempString& field_value) = 0;
-
-    virtual void ProcessRawLine(const string& line) = 0;
-
-    virtual ~IJobInfoProcessor() {}
-};
-
-class NCBI_XCONNECT_EXPORT CJobInfoToJSON : public IJobInfoProcessor
-{
-public:
-    CJobInfoToJSON() : m_JobInfo(CJsonNode::NewObjectNode()) {}
-
-    virtual void ProcessJobMeta(const CNetScheduleKey& key);
-
-    virtual void BeginJobEvent(const CTempString& event_header);
-    virtual void ProcessJobEventField(const CTempString& attr_name,
-            const string& attr_value);
-    virtual void ProcessJobEventField(const CTempString& attr_name);
-
-    virtual void ProcessInputOutput(const string& data,
-            const CTempString& input_or_output);
-
-    virtual void ProcessJobInfoField(const CTempString& field_name,
-        const CTempString& field_value);
-
-    virtual void ProcessRawLine(const string& line);
-
-    CJsonNode GetRootNode() const {return m_JobInfo;}
-
-private:
-    CJsonNode m_JobInfo;
-    CJsonNode m_JobEvents;
-    CJsonNode m_CurrentEvent;
-    CJsonNode m_UnparsableLines;
-};
-
-extern NCBI_XCONNECT_EXPORT
-void g_ProcessJobInfo(CNetScheduleAPI ns_api, const string& job_key,
-        IJobInfoProcessor* processor, bool verbose,
-        CCompoundIDPool::TInstance id_pool = NULL);
-
 END_NCBI_SCOPE
 
 #endif // CONNECT__SERVICES__NS_OUTPUT_PARSER__HPP
diff --git a/c++/include/connect/services/remote_app.hpp b/c++/include/connect/services/remote_app.hpp
index fcadf7a..01f9ae6 100644
--- a/c++/include/connect/services/remote_app.hpp
+++ b/c++/include/connect/services/remote_app.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES__REMOTE_APP_MB_HPP
 #define CONNECT_SERVICES__REMOTE_APP_MB_HPP
 
-/*  $Id: remote_app.hpp 389759 2013-02-20 19:57:59Z kazimird $
+/*  $Id: remote_app.hpp 478906 2015-09-14 20:38:33Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -70,6 +70,9 @@ public:
         EStdOutErrStorageType* type = NULL);
     void Reset();
 
+protected:
+    static int x_GetTypeAndName(CNcbiIstream& istream, string& name);
+
 private:
     CNetCacheAPI m_Storage;
     auto_ptr<CNcbiIstream> m_IStream;
@@ -155,7 +158,7 @@ public:
     /// Serialize a request to a given stream. After call to this method the instance
     /// cleans itself an it can be reused.
     void Send(CNcbiOstream& os);
-    void Deserialize(CNcbiIstream& is);
+    void Deserialize(CNcbiIstream& is) { x_Deserialize(is); }
 
     void Reset();
 
@@ -168,6 +171,9 @@ protected:
     void x_CreateWDir();
     void x_RemoveWDir();
 
+    typedef map<string, string> TStoredFiles;
+    void x_Deserialize(CNcbiIstream& is, TStoredFiles* files = NULL);
+
 private:
     static CAtomicCounter sm_DirCounter;
 
@@ -189,8 +195,6 @@ private:
     EStdOutErrStorageType m_StorageType;
     bool m_ExlusiveMode;
     size_t m_MaxInlineSize;
-
-    bool x_CopyLocalFile(const string& old_fname, string& new_fname);
 };
 
 /// Remote Application Result (both client side and application executor side)
diff --git a/c++/include/connect/services/srv_connections.hpp b/c++/include/connect/services/srv_connections.hpp
index 0d2abe4..ae45427 100644
--- a/c++/include/connect/services/srv_connections.hpp
+++ b/c++/include/connect/services/srv_connections.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES__SERVER_CONN_HPP_1
 #define CONNECT_SERVICES__SERVER_CONN_HPP_1
 
-/*  $Id: srv_connections.hpp 477824 2015-09-02 12:20:47Z ivanov $
+/*  $Id: srv_connections.hpp 485565 2015-11-23 19:43:31Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -46,92 +46,7 @@ struct SNetServerImpl;                      ///< @internal
 struct SNetServerConnectionImpl;            ///< @internal
 struct SNetServerInfoImpl;                  ///< @internal
 struct SNetServerMultilineCmdOutputImpl;    ///< @internal
-
-// A host:port pair.
-struct SServerAddress {
-    SServerAddress(unsigned h, unsigned short p) : host(h), port(p), name(h) {}
-    SServerAddress(const string &n, unsigned short p)
-        : host(g_NetService_gethostbyname(n)), port(p), name(n, host) {}
-
-    bool operator ==(const SServerAddress& h) const
-    {
-        return host == h.host && port == h.port;
-    }
-
-    bool operator <(const SServerAddress& right) const
-    {
-        int cmp = int(host) - int(right.host);
-        return cmp < 0 || (cmp == 0 && port < right.port);
-    }
-
-    string AsString() const
-    {
-        string address(name.get(host));
-        address += ':';
-        address += NStr::UIntToString(port);
-
-        return address;
-    }
-
-    unsigned host;
-    unsigned short port;
-
-private:
-    struct SName
-    {
-        SName() : host(0) {}
-        SName(unsigned h) : host(h) {}
-        SName(const string &n, unsigned h) : name(n), host(h) {}
-
-        string get(unsigned h)
-        {
-            // Name was not looked up yet or host changed
-            if (name.empty() || host != h) {
-                host = h;
-                name = g_NetService_gethostnamebyaddr(h);
-            }
-
-            return name;
-        }
-
-        string name;
-        unsigned host;
-    };
-
-    mutable SName name;
-};
-
-///////////////////////////////////////////////////////////////////////////
-//
-class INetServerProperties : public CObject
-{
-};
-
-class CNetServerConnection;
-class CNetServer;
-
-class INetServerConnectionListener : public CObject
-{
-public:
-    virtual CRef<INetServerProperties> AllocServerProperties() = 0;
-
-    CConfig* PreInit(CObject* api_impl, CConfig* config, string* section);
-
-// Event handlers.
-public:
-    virtual CConfig* OnPreInit(CObject* api_impl,
-        CConfig* config, string* config_section) { return NULL; }
-    virtual void OnInit(CObject* api_impl,
-        CConfig* config, const string& config_section) = 0;
-    virtual void OnConnected(CNetServerConnection& connection) = 0;
-    virtual void OnError(const string& err_msg, CNetServer& server) = 0;
-    virtual void OnWarning(const string& warn_msg, CNetServer& server) = 0;
-
-    string GetClientName() const { return m_ClientName; }
-
-protected:
-    string m_ClientName;
-};
+class INetServerConnectionListener;         ///< @internal
 
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/c++/include/corelib/ddumpable.hpp b/c++/include/corelib/ddumpable.hpp
index 9ca5ecc..9b43b9f 100644
--- a/c++/include/corelib/ddumpable.hpp
+++ b/c++/include/corelib/ddumpable.hpp
@@ -1,7 +1,7 @@
 #ifndef DDUMPABLE__HPP
 #define DDUMPABLE__HPP
 
-/*  $Id: ddumpable.hpp 362689 2012-05-10 14:06:40Z ucko $
+/*  $Id: ddumpable.hpp 493118 2016-02-24 15:43:33Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -155,6 +155,8 @@ public:
     // Function that does the dump - to be overloaded
     virtual void DebugDump(CDebugDumpContext ddc, unsigned int depth) const = 0;
 
+    void DumpToConsole(void) const;
+
 private:
     static bool sm_DumpEnabled;
 };
diff --git a/c++/include/corelib/env_reg.hpp b/c++/include/corelib/env_reg.hpp
index 5cb1123..8a15694 100644
--- a/c++/include/corelib/env_reg.hpp
+++ b/c++/include/corelib/env_reg.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___ENV_REG__HPP
 #define CORELIB___ENV_REG__HPP
 
-/*  $Id: env_reg.hpp 478279 2015-09-08 14:33:16Z ivanov $
+/*  $Id: env_reg.hpp 485231 2015-11-19 16:21:27Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -125,6 +125,7 @@ protected:
     bool x_Set(const string& section, const string& name,
                const string& value, TFlags flags,
                const string& comment);
+    bool x_Unset(const string& section, const string& name, TFlags flags);
     bool x_SetComment(const string& comment, const string& section,
                       const string& name, TFlags flags);
 
diff --git a/c++/include/corelib/error_codes.hpp b/c++/include/corelib/error_codes.hpp
index 7a3ac56..880a428 100644
--- a/c++/include/corelib/error_codes.hpp
+++ b/c++/include/corelib/error_codes.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___ERROR_CODES__HPP
 #define CORELIB___ERROR_CODES__HPP
 
-/*  $Id: error_codes.hpp 477851 2015-09-02 13:13:23Z ivanov $
+/*  $Id: error_codes.hpp 473240 2015-07-17 16:27:42Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/corelib/impl/listener_stack.hpp b/c++/include/corelib/impl/listener_stack.hpp
index 9f5b288..215cc86 100644
--- a/c++/include/corelib/impl/listener_stack.hpp
+++ b/c++/include/corelib/impl/listener_stack.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___LISTENER_STACK__HPP
 #define CORELIB___LISTENER_STACK__HPP
 
-/*  $Id: listener_stack.hpp 477854 2015-09-02 13:14:24Z ivanov $
+/*  $Id: listener_stack.hpp 473683 2015-07-21 19:07:58Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/corelib/impl/ncbi_atomic_defs.h b/c++/include/corelib/impl/ncbi_atomic_defs.h
index f0b6b2b..ae46601 100644
--- a/c++/include/corelib/impl/ncbi_atomic_defs.h
+++ b/c++/include/corelib/impl/ncbi_atomic_defs.h
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBI_ATOMIC_DEFS__HPP
 #define CORELIB___NCBI_ATOMIC_DEFS__HPP
 
-/*  $Id: ncbi_atomic_defs.h 471769 2015-07-01 13:53:07Z ivanov $
+/*  $Id: ncbi_atomic_defs.h 471651 2015-06-30 12:52:35Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/corelib/impl/stringutf8_deprecated.hpp b/c++/include/corelib/impl/stringutf8_deprecated.hpp
index 0f9b32d..4956d98 100644
--- a/c++/include/corelib/impl/stringutf8_deprecated.hpp
+++ b/c++/include/corelib/impl/stringutf8_deprecated.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___STRINGUTF8_DEPRECATED__HPP
 #define CORELIB___STRINGUTF8_DEPRECATED__HPP
 
-/*  $Id: stringutf8_deprecated.hpp 455122 2014-12-23 13:35:10Z gouriano $
+/*  $Id: stringutf8_deprecated.hpp 480130 2015-09-28 12:57:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -104,10 +104,10 @@ public:
     /// @param validate
     ///   Verify the character encoding of the source
     /// @deprecated  Use utility class CUtf8 instead
-    CStringUTF8_DEPRECATED(const CTempString& src);
+    CStringUTF8_DEPRECATED(const CTempString src);
     CStringUTF8_DEPRECATED(const char* src );
     CStringUTF8_DEPRECATED(const string& src);
-    CStringUTF8_DEPRECATED(const CTempString& src,
+    CStringUTF8_DEPRECATED(const CTempString src,
                   EEncoding encoding,
                   EValidate validate = eNoValidate);
     CStringUTF8_DEPRECATED(const char* src,
@@ -239,9 +239,9 @@ public:
     /// @param validate
     ///   Verify the character encoding of the source
     /// @deprecated  Use utility class CUtf8 instead
-    CStringUTF8_DEPRECATED& Assign(const CTempString& src,
-                        EEncoding          encoding,
-                        EValidate          validate = eNoValidate);
+    CStringUTF8_DEPRECATED& Assign(const CTempString src,
+                        EEncoding        encoding,
+                        EValidate        validate = eNoValidate);
 
     /// Assign Unicode C++ string
     ///
@@ -312,7 +312,7 @@ public:
     /// @param validate
     ///   Verify the character encoding of the source
     /// @deprecated  Use utility class CUtf8 instead
-    CStringUTF8_DEPRECATED& Append(const CTempString& src,
+    CStringUTF8_DEPRECATED& Append(const CTempString src,
                         EEncoding encoding,
                         EValidate validate = eNoValidate);
 
@@ -396,7 +396,7 @@ public:
     ///   Number of symbols (code points)
     /// @deprecated  Use utility class CUtf8 instead
 #if  STRINGUTF8_OBSOLETE_STATIC
-    static SIZE_TYPE GetSymbolCount(const CTempString& src);
+    static SIZE_TYPE GetSymbolCount(const CTempString src);
 #endif
 
     /// Get the number of valid UTF-8 symbols (code points) in the buffer
@@ -420,7 +420,7 @@ public:
     ///   Number of valid symbols (no exception thrown)
     /// @deprecated  Use utility class CUtf8 instead
 #if  STRINGUTF8_OBSOLETE_STATIC
-    static SIZE_TYPE GetValidSymbolCount(const CTempString& src);
+    static SIZE_TYPE GetValidSymbolCount(const CTempString src);
 #endif
     
     /// Get the number of valid UTF-8 bytes (code units) in the buffer
@@ -444,7 +444,7 @@ public:
     ///   Number of valid bytes (no exception thrown)
     /// @deprecated  Use utility class CUtf8 instead
 #if  STRINGUTF8_OBSOLETE_STATIC
-    static SIZE_TYPE GetValidBytesCount(const CTempString& src);
+    static SIZE_TYPE GetValidBytesCount(const CTempString src);
 #endif
 
     /// Check that the character encoding of the string is valid UTF-8
@@ -516,14 +516,14 @@ public:
     template <typename TChar> 
     static  
     basic_string<TChar> AsBasicString(
-        const CTempString& src,
+        const CTempString src,
         const TChar* substitute_on_error,
         EValidate validate = eNoValidate);
 
     /// Conversion to Unicode string with any base type we need
     /// @deprecated  Use utility class CUtf8 instead
     template <typename TChar> 
-    static basic_string<TChar> AsBasicString(const CTempString& src);
+    static basic_string<TChar> AsBasicString(const CTempString src);
 
     /// Guess the encoding of the C/C++ string
     ///
@@ -534,7 +534,7 @@ public:
     ///   Encoding
     /// @deprecated  Use utility class CUtf8 instead
 #if  STRINGUTF8_OBSOLETE_STATIC
-    static EEncoding GuessEncoding(const CTempString& src);
+    static EEncoding GuessEncoding(const CTempString src);
 #endif
     /// Check the encoding of the C/C++ string
     ///
@@ -548,7 +548,7 @@ public:
     ///   Boolean result: encoding is same or compatible
     /// @deprecated  Use utility class CUtf8 instead
 #if  STRINGUTF8_OBSOLETE_STATIC
-    static bool MatchEncoding(const CTempString& src, EEncoding encoding);
+    static bool MatchEncoding(const CTempString src, EEncoding encoding);
 #endif
 
     /// Give Encoding name as string
@@ -577,7 +577,7 @@ public:
     ///   EEncoding enum
     /// @deprecated  Use utility class CUtf8 instead
 #if  STRINGUTF8_OBSOLETE_STATIC
-    static EEncoding StringToEncoding(const CTempString& str);
+    static EEncoding StringToEncoding(const CTempString str);
 #endif
     
     /// Convert encoded character into UTF16
@@ -661,7 +661,7 @@ public:
     /// @deprecated  Use utility class CUtf8 instead
 #if  STRINGUTF8_OBSOLETE_STATIC
     static CTempString TruncateSpaces_Unsafe
-    (const CTempString& str, NStr::ETrunc side = NStr::eTrunc_Both);
+    (const CTempString str, NStr::ETrunc side = NStr::eTrunc_Both);
 #endif
 
     /// Truncate spaces in the string
@@ -675,7 +675,7 @@ public:
     ///   IsWhiteSpace, TruncateSpacesInPlace, TruncateSpaces_Unsafe
     /// @deprecated  Use utility class CUtf8 instead
 #if  STRINGUTF8_OBSOLETE_STATIC
-    static CStringUTF8_DEPRECATED TruncateSpaces(const CTempString& str,
+    static CStringUTF8_DEPRECATED TruncateSpaces(const CTempString str,
                                       NStr::ETrunc side = NStr::eTrunc_Both);
 #endif
 
@@ -712,7 +712,7 @@ private:
     /// Convert Unicode code point into UTF8 and append
     void   x_AppendChar(TUnicodeSymbol ch);
     /// Convert coded character sequence into UTF8 and append
-    void   x_Append(const CTempString& src,
+    void   x_Append(const CTempString src,
                     EEncoding encoding,
                     EValidate validate = eNoValidate);
 
@@ -728,7 +728,7 @@ private:
 
     template <typename TChar> static
     basic_string<TChar> x_AsBasicString
-    (const CTempString& src,
+    (const CTempString src,
      const TChar* substitute_on_error, EValidate validate);
 
     template <typename TIterator> static
diff --git a/c++/include/corelib/impl/stringutf8_deprecated.inl b/c++/include/corelib/impl/stringutf8_deprecated.inl
index 70d69db..ad77027 100644
--- a/c++/include/corelib/impl/stringutf8_deprecated.inl
+++ b/c++/include/corelib/impl/stringutf8_deprecated.inl
@@ -1,7 +1,7 @@
 #ifndef CORELIB___STRINGUTF8_DEPRECATED__INL
 #define CORELIB___STRINGUTF8_DEPRECATED__INL
 
-/*  $Id: stringutf8_deprecated.inl 455122 2014-12-23 13:35:10Z gouriano $
+/*  $Id: stringutf8_deprecated.inl 480130 2015-09-28 12:57:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -69,13 +69,13 @@ inline CStringUTF8_DEPRECATED& CStringUTF8_DEPRECATED::operator+= (const CString
 }
 
 template <typename TChar> inline
-basic_string<TChar> CStringUTF8_DEPRECATED::AsBasicString(const CTempString& src) {
+basic_string<TChar> CStringUTF8_DEPRECATED::AsBasicString(const CTempString src) {
     return CUtf8::AsBasicString<TChar>(src,nullptr,CUtf8::eNoValidate);
 }
 
 #if !defined(__EXPORT_CTOR_STRINGUTF8__)
 
-inline CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(const CTempString& src) {
+inline CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(const CTempString src) {
     assign( CUtf8::AsUTF8(src, eEncoding_ISO8859_1, CUtf8::eNoValidate));
 }
 inline CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(const char* src ) {
@@ -88,7 +88,7 @@ inline CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(const string& src) {
 
 inline
 CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(
-    const CTempString& src, EEncoding encoding,EValidate validate) {
+    const CTempString src, EEncoding encoding,EValidate validate) {
     assign( CUtf8::AsUTF8(src, encoding, validate == CStringUTF8_DEPRECATED::eValidate ? CUtf8::eValidate : CUtf8::eNoValidate));
 }
 inline
@@ -174,7 +174,7 @@ inline TStringUCS2 CStringUTF8_DEPRECATED::AsUCS2(const TCharUCS2* substitute_on
 }
 #if  STRINGUTF8_OBSOLETE_STATIC
 inline
-CStringUTF8_DEPRECATED CStringUTF8_DEPRECATED::TruncateSpaces(const CTempString& str,
+CStringUTF8_DEPRECATED CStringUTF8_DEPRECATED::TruncateSpaces(const CTempString str,
                                     NStr::ETrunc side)
 {
     CStringUTF8_DEPRECATED res;
@@ -263,7 +263,7 @@ inline CStringUTF8_DEPRECATED& CStringUTF8_DEPRECATED::operator+= (const wchar_t
 }
 #endif
 inline CStringUTF8_DEPRECATED& CStringUTF8_DEPRECATED::Assign(
-    const CTempString& src, EEncoding encoding, EValidate validate) {
+    const CTempString src, EEncoding encoding, EValidate validate) {
     assign( CUtf8::AsUTF8(src, encoding, validate == CStringUTF8_DEPRECATED::eValidate ? CUtf8::eValidate : CUtf8::eNoValidate));
     return *this;
 }
@@ -337,7 +337,7 @@ inline CStringUTF8_DEPRECATED& CStringUTF8_DEPRECATED::Assign(char ch, EEncoding
     return *this;
 }
 inline  CStringUTF8_DEPRECATED& CStringUTF8_DEPRECATED::Append(
-    const CTempString& src, EEncoding encoding, EValidate validate) {
+    const CTempString src, EEncoding encoding, EValidate validate) {
     append( CUtf8::AsUTF8( src, encoding, validate == CStringUTF8_DEPRECATED::eValidate ? CUtf8::eValidate : CUtf8::eNoValidate));
     return *this;
 }
@@ -434,7 +434,7 @@ inline TUnicodeSymbol CStringUTF8_DEPRECATED::Decode(string::const_iterator& src
 
 #if  STRINGUTF8_OBSOLETE_STATIC
 inline
-SIZE_TYPE CStringUTF8_DEPRECATED::GetSymbolCount(const CTempString& src)
+SIZE_TYPE CStringUTF8_DEPRECATED::GetSymbolCount(const CTempString src)
 {
     return CUtf8::GetSymbolCount(src);
 }
@@ -446,7 +446,7 @@ SIZE_TYPE CStringUTF8_DEPRECATED::GetValidSymbolCount(const char* src, SIZE_TYPE
     return CUtf8::GetValidSymbolCount(CTempString(src, buf_size));
 }
 inline
-SIZE_TYPE CStringUTF8_DEPRECATED::GetValidSymbolCount(const CTempString& src)
+SIZE_TYPE CStringUTF8_DEPRECATED::GetValidSymbolCount(const CTempString src)
 {
     return CUtf8::GetValidSymbolCount(src);
 }
@@ -458,7 +458,7 @@ SIZE_TYPE CStringUTF8_DEPRECATED::GetValidBytesCount(const char* src, SIZE_TYPE
     return CUtf8::GetValidBytesCount(CTempString(src,buf_size));
 }
 inline
-SIZE_TYPE CStringUTF8_DEPRECATED::GetValidBytesCount(const CTempString& src)
+SIZE_TYPE CStringUTF8_DEPRECATED::GetValidBytesCount(const CTempString src)
 {
     return CUtf8::GetValidBytesCount(src);
 }
@@ -471,14 +471,14 @@ string CStringUTF8_DEPRECATED::AsSingleByteString(EEncoding encoding,
 }
 #if  STRINGUTF8_OBSOLETE_STATIC
 inline
-EEncoding CStringUTF8_DEPRECATED::GuessEncoding( const CTempString& src)
+EEncoding CStringUTF8_DEPRECATED::GuessEncoding(const CTempString src)
 {
     return CUtf8::GuessEncoding(src);
 }
 #endif
 #if  STRINGUTF8_OBSOLETE_STATIC
 inline
-bool CStringUTF8_DEPRECATED::MatchEncoding( const CTempString& src, EEncoding encoding)
+bool CStringUTF8_DEPRECATED::MatchEncoding(const CTempString src, EEncoding encoding)
 {
     return CUtf8::MatchEncoding(src,encoding);
 }
@@ -488,7 +488,7 @@ string CStringUTF8_DEPRECATED::EncodingToString(EEncoding encoding)
     return CUtf8::EncodingToString(encoding);
 }
 inline
-EEncoding CStringUTF8_DEPRECATED::StringToEncoding(const CTempString& str)
+EEncoding CStringUTF8_DEPRECATED::StringToEncoding(const CTempString str)
 {
     return CUtf8::StringToEncoding(str);
 }
@@ -532,7 +532,7 @@ CStringUTF8_DEPRECATED& CStringUTF8_DEPRECATED::TruncateSpacesInPlace(NStr::ETru
 }
 #if  STRINGUTF8_OBSOLETE_STATIC
 inline
-CTempString CStringUTF8_DEPRECATED::TruncateSpaces_Unsafe(const CTempString& str, NStr::ETrunc side)
+CTempString CStringUTF8_DEPRECATED::TruncateSpaces_Unsafe(const CTempString str, NStr::ETrunc side)
 {
     return CUtf8::TruncateSpaces_Unsafe(str,side);
 }
@@ -548,7 +548,7 @@ void   CStringUTF8_DEPRECATED::x_AppendChar(TUnicodeSymbol ch)
     CUtf8::x_AppendChar(*this, ch);
 }
 inline
-void   CStringUTF8_DEPRECATED::x_Append(const CTempString& src,
+void   CStringUTF8_DEPRECATED::x_Append(const CTempString src,
                 EEncoding encoding, EValidate validate)
 {
     CUtf8::x_Append(*this, src, encoding, (CUtf8::EValidate)validate);
@@ -578,34 +578,34 @@ basic_string<TChar> CStringUTF8_DEPRECATED::AsBasicString(
 }
 template <typename TChar> inline
 basic_string<TChar> CStringUTF8_DEPRECATED::AsBasicString(
-    const CTempString& str, const TChar* substitute_on_error, EValidate validate)
+    const CTempString str, const TChar* substitute_on_error, EValidate validate)
 {
     return CNotImplemented<TChar>::Cannot_convert_to_nonUnicode_string();
 }
 template <> inline
 basic_string<TUnicodeSymbol> CStringUTF8_DEPRECATED::AsBasicString(
-    const CTempString& str, const TUnicodeSymbol* substitute_on_error, EValidate validate)
+    const CTempString str, const TUnicodeSymbol* substitute_on_error, EValidate validate)
 {
     return CUtf8::x_AsBasicString(str,substitute_on_error, (CUtf8::EValidate)validate);
 }
 #if NCBITOOLKIT_USE_LONG_UCS4
 template <> inline
 basic_string<TCharUCS4> CStringUTF8_DEPRECATED::AsBasicString(
-    const CTempString& str, const TCharUCS4* substitute_on_error, EValidate validate)
+    const CTempString str, const TCharUCS4* substitute_on_error, EValidate validate)
 {
     return CUtf8::x_AsBasicString(str,substitute_on_error, (CUtf8::EValidate)validate);
 }
 #endif
 template <> inline
 basic_string<TCharUCS2> CStringUTF8_DEPRECATED::AsBasicString(
-    const CTempString& str, const TCharUCS2* substitute_on_error, EValidate validate)
+    const CTempString str, const TCharUCS2* substitute_on_error, EValidate validate)
 {
     return CUtf8::x_AsBasicString(str,substitute_on_error, (CUtf8::EValidate)validate);
 }
 #if defined(HAVE_WSTRING)
 template <> inline
 basic_string<wchar_t> CStringUTF8_DEPRECATED::AsBasicString(
-    const CTempString& str, const wchar_t* substitute_on_error, EValidate validate)
+    const CTempString str, const wchar_t* substitute_on_error, EValidate validate)
 {
     return CUtf8::x_AsBasicString(str,substitute_on_error, (CUtf8::EValidate)validate);
 }
diff --git a/c++/include/corelib/metareg.hpp b/c++/include/corelib/metareg.hpp
index 98cf380..5c9e1f0 100644
--- a/c++/include/corelib/metareg.hpp
+++ b/c++/include/corelib/metareg.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___METAREG__HPP
 #define CORELIB___METAREG__HPP
 
-/*  $Id: metareg.hpp 458676 2015-02-09 12:35:49Z lavr $
+/*  $Id: metareg.hpp 487768 2015-12-21 20:05:25Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -146,9 +146,9 @@ public:
     static       TSearchPath& SetSearchPath(void);
 
     /// Clears path and substitutes the default search path.  If the
-    /// environment NCBI_CONFIG_PATH is set, the default is to look there
-    /// exclusively; otherwise, the default list contains the following
-    /// directories in order:
+    /// environment variable NCBI_CONFIG_PATH is set, the default is to
+    /// look there exclusively; otherwise, the default list contains the
+    /// following directories in order:
     ///    - The current working directory.
     ///    - The user's home directory.
     ///    - The directory, if any, given by the environment variable "NCBI".
@@ -158,6 +158,12 @@ public:
     ///      (Requires use of CNcbiApplication.)
     /// The first two directories are skipped if the environment variable
     /// NCBI_DONT_USE_LOCAL_CONFIG is set.
+    ///
+    /// @note NCBI_CONFIG_PATH may contain multiple directories,
+    /// delimited by semicolons on Windows and either colons or
+    /// semicolons on other platforms.  An empty element anywhere in
+    /// the path designates the default list that would take effect
+    /// in the absence of NCBI_CONFIG_PATH, as detailed above.    
     static void GetDefaultSearchPath(TSearchPath& path);
 
     /// Yield the path to a registry with the given name if available,
diff --git a/c++/include/corelib/ncbi_autoinit.hpp b/c++/include/corelib/ncbi_autoinit.hpp
index b8a5464..ec803f0 100644
--- a/c++/include/corelib/ncbi_autoinit.hpp
+++ b/c++/include/corelib/ncbi_autoinit.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBI_AUTOINIT__HPP
 #define NCBI_AUTOINIT__HPP
 
-/*  $Id: ncbi_autoinit.hpp 478278 2015-09-08 14:32:54Z ivanov $
+/*  $Id: ncbi_autoinit.hpp 474964 2015-08-03 18:22:34Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/corelib/ncbi_bswap.hpp b/c++/include/corelib/ncbi_bswap.hpp
index f67b182..e552d90 100644
--- a/c++/include/corelib/ncbi_bswap.hpp
+++ b/c++/include/corelib/ncbi_bswap.hpp
@@ -1,6 +1,6 @@
 #ifndef CORELIB___NCBI_BSWAP__HPP
 #define CORELIB___NCBI_BSWAP__HPP
-/* $Id: ncbi_bswap.hpp 151706 2009-02-06 15:52:44Z ucko $
+/* $Id: ncbi_bswap.hpp 488254 2015-12-29 13:56:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -96,11 +96,9 @@ inline
 Int2 CByteSwap::GetInt2(const unsigned char* ptr)
 {
 #ifdef WORDS_BIGENDIAN
-    Int2 ret = (Int2(ptr[1]) << 8) | 
-               (Int2(ptr[0]));
+    Int2 ret = (Int2)( (Int2(ptr[1]) << 8) | (Int2(ptr[0])) );
 #else
-    Int2 ret = (Int2(ptr[0]) << 8) | 
-               (Int2(ptr[1]));
+    Int2 ret = (Int2)( (Int2(ptr[0]) << 8) | (Int2(ptr[1])) );
 #endif
 
     return ret;
diff --git a/c++/include/corelib/ncbi_config.hpp b/c++/include/corelib/ncbi_config.hpp
index ba9ce06..9260ffa 100644
--- a/c++/include/corelib/ncbi_config.hpp
+++ b/c++/include/corelib/ncbi_config.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBI_CONFIG__HPP
 #define CORELIB___NCBI_CONFIG__HPP
 
-/*  $Id: ncbi_config.hpp 449355 2014-10-15 20:21:49Z kazimird $
+/*  $Id: ncbi_config.hpp 492407 2016-02-17 15:08:33Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -220,6 +220,23 @@ public:
     ///     Reconstructed tree (caller is responsible for deletion)
     static TParamTree* ConvertRegToTree(const IRegistry&  reg);
 
+    /// Overloading of getters for generic programming
+    string Get(const string& d, const string& p, EErrAction e, const string& v,
+            const list<string>* s = NULL)
+    { return GetString(d, p, e, v, s); }
+
+    int Get(const string& d, const string& p, EErrAction e, int v,
+            const list<string>* s = NULL)
+    { return GetInt(d, p, e, v, s); }
+
+    bool Get(const string& d, const string& p, EErrAction e, bool v,
+            const list<string>* s = NULL)
+    { return GetBool(d, p, e, v, s); }
+
+    double Get(const string& d, const string& p, EErrAction e, double v,
+            const list<string>* s = NULL)
+    { return GetDouble(d, p, e, v, s); }
+
 private:
     CConfig(const CConfig&);
     CConfig& operator=(const CConfig&);
diff --git a/c++/include/corelib/ncbi_limits.h b/c++/include/corelib/ncbi_limits.h
index d333a06..6d0a588 100644
--- a/c++/include/corelib/ncbi_limits.h
+++ b/c++/include/corelib/ncbi_limits.h
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBI_LIMITS__H
 #define CORELIB___NCBI_LIMITS__H
 
-/*  $Id: ncbi_limits.h 409229 2013-08-06 15:49:29Z vakatov $
+/*  $Id: ncbi_limits.h 472658 2015-07-13 16:12:40Z vakatov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -97,8 +97,8 @@
 /* (BEGIN C++ interface) */
 
 /* [C++]  built-in integer types */
-const signed   char   kMin_Char   = CHAR_MIN;
-const signed   char   kMax_Char   = CHAR_MAX;
+const          char   kMin_Char   = CHAR_MIN;
+const          char   kMax_Char   = CHAR_MAX;
 const signed   char   kMin_SChar  = SCHAR_MIN;
 const signed   char   kMax_SChar  = SCHAR_MAX;
 const unsigned char   kMax_UChar  = UCHAR_MAX;
diff --git a/c++/include/corelib/ncbi_message.hpp b/c++/include/corelib/ncbi_message.hpp
index 8451e8a..efc6f04 100644
--- a/c++/include/corelib/ncbi_message.hpp
+++ b/c++/include/corelib/ncbi_message.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBI_MESSAGE__HPP
 #define CORELIB___NCBI_MESSAGE__HPP
 
-/*  $Id: ncbi_message.hpp 477857 2015-09-02 13:15:07Z ivanov $
+/*  $Id: ncbi_message.hpp 473941 2015-07-23 17:05:00Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/corelib/ncbi_os_mswin.hpp b/c++/include/corelib/ncbi_os_mswin.hpp
index 8a9d3a6..8c7599f 100644
--- a/c++/include/corelib/ncbi_os_mswin.hpp
+++ b/c++/include/corelib/ncbi_os_mswin.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBI_OS_MSWIN__HPP
 #define CORELIB___NCBI_OS_MSWIN__HPP
 
-/*  $Id: ncbi_os_mswin.hpp 477856 2015-09-02 13:14:44Z ivanov $
+/*  $Id: ncbi_os_mswin.hpp 473801 2015-07-22 17:33:35Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/corelib/ncbi_process.hpp b/c++/include/corelib/ncbi_process.hpp
index 81c3de8..4682eab 100644
--- a/c++/include/corelib/ncbi_process.hpp
+++ b/c++/include/corelib/ncbi_process.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBI_PROCESS__HPP
 #define CORELIB___NCBI_PROCESS__HPP
 
-/*  $Id: ncbi_process.hpp 465029 2015-04-16 13:28:52Z sadyrovr $
+/*  $Id: ncbi_process.hpp 486692 2015-12-09 12:49:29Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -472,11 +472,34 @@ private:
 class NCBI_XNCBI_EXPORT CPIDGuard
 {
 public:
-    /// If "filename" contains no path, make it relative to "dir"
-    /// (which defaults to /tmp on Unix and %HOME% on Windows).
+    /// Create/check PID file.
+    ///
+    /// If the file already exists and identifies a live process,
+    /// throws CPIDGuardException.
+    /// @filename
+    ///   Name of the file to store PID. 
+    ///   If "filename" contains path, it should be absolute
+    ///   and points to an existing directory.
+    ///   If "filename" contains no path, that $TMPDIR will be used on Unix,
+    ///   and %HOME% on Windows to store it.
+    CPIDGuard(const string& filename);
+
+    /// Create/check PID file.
+    ///
     /// If the file already exists and identifies a live process,
     /// throws CPIDGuardException.
-    CPIDGuard(const string& filename, const string& dir = kEmptyStr);
+    ///
+    /// @filename
+    ///   Name of the file to store PID. 
+    ///   If should not include any path, relative or absolute.
+    /// @dir
+    ///   An absolute path to the existing directory on the file system
+    ///   to store PID file "filename".
+    ///   If "dir" is empty and "filename" contains no path,
+    ///   that $TMPDIR will be used on Unix, and %HOME% on Windows to store it.
+    /// @deprecated
+    NCBI_DEPRECATED
+    CPIDGuard(const string& filename, const string& dir);
 
     /// Destructor.
     ///
diff --git a/c++/include/corelib/ncbi_safe_static.hpp b/c++/include/corelib/ncbi_safe_static.hpp
index 742630f..7831f79 100644
--- a/c++/include/corelib/ncbi_safe_static.hpp
+++ b/c++/include/corelib/ncbi_safe_static.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBI_SAFE_STATIC__HPP
 #define NCBI_SAFE_STATIC__HPP
 
-/*  $Id: ncbi_safe_static.hpp 441144 2014-07-21 18:45:59Z vasilche $
+/*  $Id: ncbi_safe_static.hpp 488881 2016-01-06 16:49:31Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -134,7 +134,7 @@ protected:
     {}
 
     /// Pointer to the data
-    void* m_Ptr;
+    const void* m_Ptr;
 
     DECLARE_CLASS_STATIC_MUTEX(sm_Mutex);
 
@@ -243,6 +243,7 @@ public:
     // classes. To do this there are two different versions of the following
     // methods.
     static void s_AddReference(void*) {}
+    static void s_AddReference(const void*) {}
     static void s_AddReference(CObject* ptr)
     {
         if (ptr) ptr->AddReference();
@@ -251,10 +252,18 @@ public:
     {
         if (ptr) delete static_cast<T*>(ptr);
     }
+    static void s_RemoveReference(const void* ptr)
+    {
+        if (ptr) delete const_cast<T*>(static_cast<const T*>(ptr));
+    }
     static void s_RemoveReference(CObject* ptr)
     {
         if (ptr) ptr->RemoveReference();
     }
+    static void s_RemoveReference(const CObject* ptr)
+    {
+        if (ptr) ptr->RemoveReference();
+    }
 };
 
 
@@ -390,7 +399,7 @@ public:
         if ( !m_Ptr ) {
             x_Init();
         }
-        return *static_cast<T*>(m_Ptr);
+        return *static_cast<T*>(const_cast<void*>(m_Ptr));
     }
 
     T* operator-> (void) { return &Get(); }
@@ -428,7 +437,7 @@ private:
                                CMutexGuard& guard)
     {
         TThisType* this_ptr = static_cast<TThisType*>(safe_static);
-        if ( T* ptr = static_cast<T*>(this_ptr->m_Ptr) ) {
+        if ( T* ptr = static_cast<T*>(const_cast<void*>(this_ptr->m_Ptr)) ) {
             TCallbacks callbacks = this_ptr->m_Callbacks;
             this_ptr->m_Ptr = 0;
             guard.Release();
@@ -441,6 +450,36 @@ private:
 };
 
 
+/// Safe static callbacks version allowing initial value of type V
+// to be set through template argument.
+template<class T, class V, V value>
+class CSafeStaticInit_Callbacks : public CSafeStatic_Callbacks<T>
+{
+public:
+    T* Create(void) {
+        return new T(value);
+    }
+};
+
+
+/// Declare CSafeStatic<const type>, initialize it with 'init_value' of the same type.
+#define SAFE_CONST_STATIC(type, init_value) \
+    SAFE_CONST_STATIC_EX(type, type, init_value)
+
+/// Declare CSafeStatic<const type>, initialize it with 'init_value' of type
+/// 'init_value_type'.
+#define SAFE_CONST_STATIC_EX(type, init_value_type, init_value) \
+    CSafeStatic< const type, \
+    CSafeStaticInit_Callbacks<const type, init_value_type, init_value> >
+
+/// Declare CSafeStatic<const string>, initialize it with 'const char* value'.
+#define SAFE_CONST_STATIC_STRING(var, value) \
+    char SAFE_CONST_STATIC_STRING_##var[] = value; \
+    SAFE_CONST_STATIC_EX(std::string, const char*, \
+    SAFE_CONST_STATIC_STRING_##var) var
+
+
+
 /////////////////////////////////////////////////////////////////////////////
 ///
 ///  CSafeStaticPtr<>::
@@ -476,7 +515,7 @@ public:
         if ( !m_Ptr ) {
             x_Init();
         }
-        return *static_cast<T*> (m_Ptr);
+        return *static_cast<T*>(const_cast<void*>(m_Ptr));
     }
     /// Get the existing object or create a new one using the provided
     /// FUserCreate object.
@@ -488,7 +527,7 @@ public:
         if ( !m_Ptr ) {
             x_Init(user_create);
         }
-        return *static_cast<T*> (m_Ptr);
+        return *static_cast<T*>(const_cast<void*>(m_Ptr));
     }
 
     T* operator -> (void) { return &Get(); }
@@ -512,7 +551,7 @@ private:
                                CMutexGuard& guard)
     {
         CSafeStaticPtr<T>* this_ptr = static_cast<CSafeStaticPtr<T>*>(safe_static);
-        if ( T* ptr = static_cast<T*>(this_ptr->m_Ptr) ) {
+        if ( T* ptr = static_cast<T*>(const_cast<void*>(this_ptr->m_Ptr)) ) {
             CSafeStaticPtr_Base::FUserCleanup user_cleanup = this_ptr->m_UserCleanup;
             this_ptr->m_Ptr = 0;
             guard.Release();
@@ -560,7 +599,7 @@ public:
         if ( !m_Ptr ) {
             x_Init();
         }
-        return *static_cast<T*>(m_Ptr);
+        return *static_cast<T*>(const_cast<void*>(m_Ptr));
     }
     /// Get the existing object or create a new one using the provided
     /// FUserCreate object.
@@ -572,7 +611,7 @@ public:
         if ( !m_Ptr ) {
             x_Init(user_create);
         }
-        return *static_cast<T*>(m_Ptr);
+        return *static_cast<T*>(const_cast<void*>(m_Ptr));
     }
 
     T* operator -> (void) { return &Get(); }
@@ -595,7 +634,7 @@ private:
                                CMutexGuard& guard)
     {
         CSafeStaticRef<T>* this_ptr = static_cast<CSafeStaticRef<T>*>(safe_static);
-        if ( T* ptr = static_cast<T*>(this_ptr->m_Ptr) ) {
+        if ( T* ptr = static_cast<T*>(const_cast<void*>(this_ptr->m_Ptr)) ) {
             CSafeStaticPtr_Base::FUserCleanup user_cleanup = this_ptr->m_UserCleanup;
             this_ptr->m_Ptr = 0;
             guard.Release();
diff --git a/c++/include/corelib/ncbi_url.hpp b/c++/include/corelib/ncbi_url.hpp
index 3eccf73..58025f2 100644
--- a/c++/include/corelib/ncbi_url.hpp
+++ b/c++/include/corelib/ncbi_url.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBI_URL__HPP
 #define CORELIB___NCBI_URL__HPP
 
-/*  $Id: ncbi_url.hpp 442459 2014-08-04 15:36:07Z grichenk $
+/*  $Id: ncbi_url.hpp 470591 2015-06-17 14:55:49Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -599,6 +599,7 @@ CUrlArgs::iterator CUrlArgs::FindNext(const iterator& iter)
     return x_Find(iter->name, iter);
 }
 
+/* @} */
 
 END_NCBI_SCOPE
 
diff --git a/c++/include/corelib/ncbiapp.hpp b/c++/include/corelib/ncbiapp.hpp
index 572b482..8d86fa4 100644
--- a/c++/include/corelib/ncbiapp.hpp
+++ b/c++/include/corelib/ncbiapp.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBIAPP__HPP
 #define CORELIB___NCBIAPP__HPP
 
-/*  $Id: ncbiapp.hpp 450653 2014-10-29 13:14:43Z vasilche $
+/*  $Id: ncbiapp.hpp 497376 2016-04-06 13:21:22Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -144,7 +144,7 @@ public:
     /// Register the application instance, and reset important
     /// application-specific settings to empty values that will
     /// be set later.
-    CNcbiApplication(void);
+    CNcbiApplication(const SBuildInfo& build_info = SBuildInfo());
 
     /// Destructor.
     ///
@@ -430,6 +430,7 @@ protected:
     ///   "-version-full" will not work as expected.
     /// @sa GetVersion
     void SetVersion(const CVersionInfo& version);
+    void SetVersion(const CVersionInfo& version, const SBuildInfo& build_info);
 
     /// Set version data for the program.
     ///
@@ -580,12 +581,12 @@ private:
 
     static CNcbiApplication*   m_Instance;   ///< Current app. instance
     CRef<CVersion>             m_Version;    ///< Program version
-    auto_ptr<CNcbiEnvironment> m_Environ;    ///< Cached application env.
+    unique_ptr<CNcbiEnvironment> m_Environ;    ///< Cached application env.
     CRef<CNcbiRegistry>        m_Config;     ///< Guaranteed to be non-NULL
-    auto_ptr<CNcbiOstream>     m_DiagStream; ///< Opt., aux., see eDS_ToMemory
-    auto_ptr<CNcbiArguments>   m_Arguments;  ///< Command-line arguments
-    auto_ptr<CArgDescriptions> m_ArgDesc;    ///< Cmd.-line arg descriptions
-    auto_ptr<CArgs>            m_Args;       ///< Parsed cmd.-line args
+    unique_ptr<CNcbiOstream>     m_DiagStream; ///< Opt., aux., see eDS_ToMemory
+    unique_ptr<CNcbiArguments>   m_Arguments;  ///< Command-line arguments
+    unique_ptr<CArgDescriptions> m_ArgDesc;    ///< Cmd.-line arg descriptions
+    unique_ptr<CArgs>            m_Args;       ///< Parsed cmd.-line args
     TDisableArgDesc            m_DisableArgDesc;  ///< Arg desc. disabled
     THideStdArgs               m_HideArgs;   ///< Std cmd.-line flags to hide
     TStdioSetupFlags           m_StdioFlags; ///< Std C++ I/O adjustments
diff --git a/c++/include/corelib/ncbiargs.hpp b/c++/include/corelib/ncbiargs.hpp
index 1553264..144403f 100644
--- a/c++/include/corelib/ncbiargs.hpp
+++ b/c++/include/corelib/ncbiargs.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBIARGS__HPP
 #define CORELIB___NCBIARGS__HPP
 
-/*  $Id: ncbiargs.hpp 466633 2015-05-05 15:36:22Z gouriano $
+/*  $Id: ncbiargs.hpp 491416 2016-02-04 17:55:07Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -84,6 +84,7 @@
 #include <corelib/ncbiobj.hpp>
 #include <corelib/ncbi_limits.h>
 #include <corelib/ncbitime.hpp>
+#include <corelib/ncbimisc.hpp>
 #include <memory>
 #include <set>
 #include <list>
@@ -499,6 +500,10 @@ public:
 ///
 /// Example: Translating "CNcbiArguments" ---> "CArgs".
 /// Can also be used to compose and print out the USAGE info.
+///
+/// @sa CInputStreamSource
+///   CInputStreamSource helper class makes it possible to supply a list of
+///   input files, or list of directories
 
 class NCBI_XNCBI_EXPORT CArgDescriptions
 {
@@ -517,8 +522,8 @@ public:
     virtual ~CArgDescriptions(void);
 
     /// Type of CArgDescriptions
-    /// For a CGI application positional argumants and flags does not make
-    /// sense (this sintax cannot be expressed by CGI protocol)
+    /// For a CGI application positional arguments and flags does not make
+    /// sense (this syntax cannot be expressed by CGI protocol)
     enum EArgSetType {
         eRegularArgs,  ///< Regular application
         eCgiArgs       ///< CGI application
@@ -555,12 +560,14 @@ public:
         eInteger,    ///< Convertible into an integer number (int or Int8)
         eDouble,     ///< Convertible into a floating point number (double)
         eInputFile,  ///< Name of file (must exist and be readable)
-        eOutputFile, ///< Name of file (must be writeable)
-        eIOFile,     ///< Name of file (must be writeable)
+        eOutputFile, ///< Name of file (must be writable)
+        eIOFile,     ///< Name of file (must be writable)
         eDirectory,  ///< Name of file directory
         eDataSize,   ///< Integer number with possible "software" qualifiers (KB, KiB, et al)
-        eDateTime,   ///< DateTime string, formats "Y-M-DTh:m:gZ" or "Y/M/D h:m:gZ"
-
+        eDateTime,   ///< DateTime string, formats:
+                     ///< "M/D/Y h:m:s", "Y-M-DTh:m:g", "Y/M/D h:m:g", "Y-M-D h:m:g".
+                     ///< Time string can have trailing 'Z' symbol, specifying that
+                     ///< it represent time in the UTC format.
         k_EType_Size ///< For internal use only
     };
 
@@ -625,12 +632,12 @@ public:
         /// Such arguments can be read from command line, from file, or from
         /// console.
         /// On command line, they can appear in one of the following forms:
-        ///   -key                   -- read value from console, with automatically
-        ///                             generated prompt
-        ///   -key-file      fname   -- read value from file 'fname',
-        ///                             if 'fname' equals '-',  read value from
-        ///                             standard input (stdin) without any prompt
-        ///   -key-verbatim  value   -- read value from the command line, as is
+        ///   -key                 -- read value from console, with automatically
+        ///                           generated prompt
+        ///   -key-file fname      -- read value from file 'fname',
+        ///                           if 'fname' equals '-',  read value from
+        ///                           standard input (stdin) without any prompt
+        ///   -key-verbatim value  -- read value from the command line, as is
         fConfidential  = (1 << 13)
     };
     typedef unsigned int TFlags;  ///< Bitwise OR of "EFlags"
@@ -704,13 +711,20 @@ public:
                        const char*   display_value = nullptr
                       );
 
+    /// Define how flag presence affect CArgValue::HasValue().
+    /// @sa AddFlag
+    enum EFlagValue {
+        eFlagHasValueIfMissed = 0,
+        eFlagHasValueIfSet    = 1
+    };
+
     /// Add description for flag argument.
     ///
     /// Flag argument has the following syntax:
     ///
     ///  arg_flag  := -<flag>,     <flag> := "name"
     ///
-    /// If argument "set_value" is TRUE, then:
+    /// If argument "set_value" is eFlagHasValueIfSet (TRUE), then:
     ///    - if the flag is provided (in the command-line), then the resultant
     ///      CArgValue::HasValue() will be TRUE;
     ///    - else it will be FALSE.
@@ -719,11 +733,10 @@ public:
     ///
     /// NOTE: If CArgValue::HasValue() is TRUE, then AsBoolean() is
     /// always TRUE.
-    void AddFlag(const string& name,            ///< Name of argument
-                 const string& comment,         ///< Argument description
-                 bool          set_value = true ///< Is value set or not?
-                );
-
+    void AddFlag(const string& name,      ///< Name of argument
+                 const string& comment,   ///< Argument description
+                 CBoolEnum<EFlagValue> set_value = eFlagHasValueIfSet
+                 );
 
     /// Add description of mandatory opening positional argument.
     ///
@@ -748,7 +761,7 @@ public:
                     TFlags        flags = 0 ///< Optional flags
                     );
 
-    /// Add description for mandatory postional argument.
+    /// Add description for mandatory positional argument.
     ///
     /// Mandatory positional argument has the following syntax:
     ///
@@ -876,14 +889,16 @@ public:
     /// @param name
     ///    Name of the parameter(flag) to check
     /// @param constraint
-    ///    Constraint object
+    ///    The constraint object.
+    ///    NOTE: A CRef will always be taken on the object, and its lifetime
+    ///    will be controlled by the CObject's smart-pointer mechanism.
     /// @param negate
     ///    Flag indicates if this is inverted(NOT) constaint
     /// 
     /// @sa
     ///   See "CArgAllow_***" classes for some pre-defined constraints
     void SetConstraint(const string&      name,
-                       CArgAllow*         constraint,
+                       const CArgAllow*   constraint,
                        EConstraintNegate  negate = eConstraint);
 
     /// This version of SetConstraint doesn't take the ownership of object
@@ -1019,6 +1034,7 @@ public:
     {
         return m_AutoHelp;
     }
+
 private:
     typedef set< AutoPtr<CArgDesc> >  TArgs;    ///< Argument descr. type
     typedef TArgs::iterator           TArgsI;   ///< Arguments iterator
@@ -1072,13 +1088,13 @@ private:
                                                 bool negated=false) const;
 
     /// Helper method to find named parameter.
-    /// 'negative' (if provided) will indicate if the name refered to a
+    /// 'negative' (if provided) will indicate if the name referred to a
     /// negative alias.
     TArgsI  x_Find(const string& name,
                    bool*         negative = NULL);
 
     /// Helper method to find named parameter -- const version.
-    /// 'negative' (if provided) will indicate if the name refered to a
+    /// 'negative' (if provided) will indicate if the name referred to a
     /// negative alias.
     TArgsCI x_Find(const string& name,
                    bool*         negative = NULL) const;
@@ -1197,6 +1213,7 @@ public:
 
         // Special case for CGI -- a lone positional argument
         if (GetArgsType() == eCgiArgs  &&  argc == 2) {
+            x_CheckAutoHelp(argv[1]);
             return args.release();
         }
 
@@ -1355,7 +1372,7 @@ private:
     map<string,string> m_Aliases;   ///< command to alias; one alias only
     list<string> m_Commands;        ///< command names, and order
     list<string> m_CmdGroups;       ///< group names, and order
-    size_t m_CurrentGroup;          ///< current group #
+    size_t m_CurrentCmdGroup;       ///< current group #
     mutable string m_Command;       ///< current command
 };
 
@@ -1723,7 +1740,7 @@ public:
     /// Get argument name.
     const string& GetName   (void) const { return m_Name; }
 
-    /// Get arument description.
+    /// Get argument description.
     const string& GetComment(void) const { return m_Comment; }
 
     /// Get argument group
@@ -1747,12 +1764,16 @@ public:
     virtual void VerifyDefault (void) const;
 
     /// Set argument constraint.
+    /// @param constraint
+    ///    The constraint object.
+    ///    ATTN: A CRef must always be taken on the object by the
+    ///          derived class's implementation of this method!
     virtual 
-    void SetConstraint(CArgAllow*                           constraint,
+    void SetConstraint(const CArgAllow*                     constraint,
                        CArgDescriptions::EConstraintNegate  negate 
                                     = CArgDescriptions::eConstraint);
 
-    /// Returns TRUE if associated contraint is inverted (NOT)
+    /// Returns TRUE if associated constraint is inverted (NOT)
     /// @sa SetConstraint
     virtual bool IsConstraintInverted() const { return false; }
 
@@ -1778,7 +1799,6 @@ private:
     string m_Comment;   ///< Argument description
 };
 
-
 END_NCBI_SCOPE
 
 
diff --git a/c++/include/corelib/ncbidbg.hpp b/c++/include/corelib/ncbidbg.hpp
index ee7eaff..d8f2920 100644
--- a/c++/include/corelib/ncbidbg.hpp
+++ b/c++/include/corelib/ncbidbg.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBIDBG__HPP
 #define CORELIB___NCBIDBG__HPP
 
-/*  $Id: ncbidbg.hpp 470099 2015-06-11 11:28:54Z ivanov $
+/*  $Id: ncbidbg.hpp 491449 2016-02-04 19:41:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -68,7 +68,7 @@ BEGIN_NCBI_SCOPE
       << message << NCBI_NS_NCBI::Endm )
 
 #define _ALWAYS_TRACE_EX(err_code, err_subcode, message)    \
-    ( NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO             \
+    ( NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO,            \
       NCBI_NS_NCBI::eDiag_Trace).GetRef()                   \
       << NCBI_NS_NCBI::ErrCode( (err_code), (err_subcode) ) \
       << message << NCBI_NS_NCBI::Endm )
diff --git a/c++/include/corelib/ncbidiag.hpp b/c++/include/corelib/ncbidiag.hpp
index 264bc3a..12ce548 100644
--- a/c++/include/corelib/ncbidiag.hpp
+++ b/c++/include/corelib/ncbidiag.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBIDIAG__HPP
 #define CORELIB___NCBIDIAG__HPP
 
-/*  $Id: ncbidiag.hpp 483520 2015-11-02 14:44:26Z ivanov $
+/*  $Id: ncbidiag.hpp 500364 2016-05-04 12:04:46Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -971,6 +971,18 @@ public:
         return x_Put(x);
     }
 
+    template<class X> inline
+    const CNcbiDiag& Put(const exception*, const X& x) const {
+        const CException* xp = dynamic_cast<const CException*>(&x);
+        if ( xp ) {
+            return x_Put(*xp);
+        }
+        else {
+            string s = x.what();
+            return Put(&s, s);
+        }
+    }
+
     /// Helper method to post stack trace to diagnostic stream using
     /// standard stack trace formatting.
     ///
@@ -1838,15 +1850,15 @@ private:
     // Collected diag messages
     typedef list<SDiagMessage>       TDiagCollection;
 
-    auto_ptr<TProperties> m_Properties;       // Per-thread properties
-    auto_ptr<CDiagBuffer> m_DiagBuffer;       // Thread's diag buffer
+    unique_ptr<TProperties> m_Properties;       // Per-thread properties
+    unique_ptr<CDiagBuffer> m_DiagBuffer;       // Thread's diag buffer
     TTID                  m_TID;              // Cached thread ID
     TCount                m_ThreadPostNumber; // Number of posted messages
     TCollectGuards        m_CollectGuards;
     TDiagCollection       m_DiagCollection;
     size_t                m_DiagCollectionSize; // cached size of m_DiagCollection
-    auto_ptr<SRequestCtxWrapper> m_RequestCtx;        // Request context
-    auto_ptr<SRequestCtxWrapper> m_DefaultRequestCtx; // Default request context
+    unique_ptr<SRequestCtxWrapper> m_RequestCtx;        // Request context
+    unique_ptr<SRequestCtxWrapper> m_DefaultRequestCtx; // Default request context
 };
 
 
@@ -1926,6 +1938,9 @@ private:
                        double      timespan,
                        TExtraArgs& args);
 
+    // If available, add ncbi_role/ncbi_location to the arguments.
+    CDiagContext_Extra& PrintNcbiRoleAndLocation(void);
+
     friend class CDiagContext;
     friend NCBI_XNCBI_EXPORT
         CDiagContext_Extra g_PostPerf(int                       status,
@@ -2334,21 +2349,21 @@ private:
     static TPID                         sm_PID;
 
     mutable TUID                        m_UID;
-    mutable auto_ptr<CEncodedString>    m_Host;
+    mutable unique_ptr<CEncodedString>    m_Host;
     string                              m_HostIP;
-    auto_ptr<CEncodedString>            m_Username;
-    auto_ptr<CEncodedString>            m_AppName;
+    unique_ptr<CEncodedString>            m_Username;
+    unique_ptr<CEncodedString>            m_AppName;
     mutable bool                        m_AppNameSet;
-    mutable auto_ptr<CEncodedString>    m_DefaultSessionId;
-    mutable auto_ptr<string>            m_DefaultHitId;
+    mutable unique_ptr<CEncodedString>    m_DefaultSessionId;
+    mutable unique_ptr<string>            m_DefaultHitId;
     mutable bool                        m_LoggedHitId;
     int                                 m_ExitCode;
     bool                                m_ExitCodeSet;
     int                                 m_ExitSig;
     EDiagAppState                       m_AppState;
     TProperties                         m_Properties;
-    auto_ptr<CStopWatch>                m_StopWatch;
-    auto_ptr<TMessages>                 m_Messages;
+    unique_ptr<CStopWatch>                m_StopWatch;
+    unique_ptr<TMessages>                 m_Messages;
     size_t                              m_MaxMessages;
     static CDiagContext*                sm_Instance;
 
@@ -2356,9 +2371,9 @@ private:
     static bool                         sm_ApplogSeverityLocked;
 
     // Rate control
-    auto_ptr<CRequestRateControl>       m_AppLogRC;
-    auto_ptr<CRequestRateControl>       m_ErrLogRC;
-    auto_ptr<CRequestRateControl>       m_TraceLogRC;
+    unique_ptr<CRequestRateControl>       m_AppLogRC;
+    unique_ptr<CRequestRateControl>       m_ErrLogRC;
+    unique_ptr<CRequestRateControl>       m_TraceLogRC;
     bool                                m_AppLogSuspended;
     bool                                m_ErrLogSuspended;
     bool                                m_TraceLogSuspended;
@@ -2598,7 +2613,7 @@ private:
 
     /// Save messages if the handle is unavailable
     typedef deque<SDiagMessage> TMessages;
-    auto_ptr<TMessages> m_Messages;
+    unique_ptr<TMessages> m_Messages;
 };
 
 
@@ -2877,13 +2892,13 @@ private:
     ///
     /// Prohibit dynamic deallocation (and allocation) because there's no
     /// good reason to allow it, and out-of-order destruction is problematic.
-    void  operator delete   (void*)   { throw runtime_error("forbidden"); }
+    void  operator delete   (void*)   { }
 
     /// Private delete[] operator.
     ///
     /// Prohibit dynamic deallocation (and allocation) because there's no
     /// good reason to allow it, and out-of-order destruction is problematic.
-    void  operator delete[] (void*)   { throw runtime_error("forbidden"); }
+    void  operator delete[] (void*)   { }
 
     string            m_PostPrefix;            ///< Message prefix
     list<string>      m_PrefixList;            ///< List of prefixes
diff --git a/c++/include/corelib/ncbienv.hpp b/c++/include/corelib/ncbienv.hpp
index b5df2de..610148b 100644
--- a/c++/include/corelib/ncbienv.hpp
+++ b/c++/include/corelib/ncbienv.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBIENV__HPP
 #define NCBIENV__HPP
 
-/*  $Id: ncbienv.hpp 478279 2015-09-08 14:33:16Z ivanov $
+/*  $Id: ncbienv.hpp 477258 2015-08-27 16:21:10Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/corelib/ncbiexpt.hpp b/c++/include/corelib/ncbiexpt.hpp
index ade5dfb..380227a 100644
--- a/c++/include/corelib/ncbiexpt.hpp
+++ b/c++/include/corelib/ncbiexpt.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBIEXPT__HPP
 #define NCBIEXPT__HPP
 
-/*  $Id: ncbiexpt.hpp 459484 2015-02-18 20:00:46Z ucko $
+/*  $Id: ncbiexpt.hpp 487716 2015-12-21 16:13:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1177,6 +1177,7 @@ public: \
     }
 
 
+#if 0
 /// Exception bug workaround for GCC version less than 3.00.
 ///
 /// GCC compiler v.2.95 has a bug: one should not use virtual base class in
@@ -1193,6 +1194,15 @@ public: \
 #else
 #  define EXCEPTION_VIRTUAL_BASE virtual
 #endif
+#endif // if 0
+
+/// Do not use virtual base classes in exception declaration at all,
+/// because in this case derived class should initialize all base
+/// classes directly, that is not convenient and hard to control.
+///
+/// @deprecated
+///
+#define EXCEPTION_VIRTUAL_BASE
 
 
 
diff --git a/c++/include/corelib/ncbifile.hpp b/c++/include/corelib/ncbifile.hpp
index 4496a98..b320749 100644
--- a/c++/include/corelib/ncbifile.hpp
+++ b/c++/include/corelib/ncbifile.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBIFILE__HPP
 #define CORELIB___NCBIFILE__HPP
 
-/*  $Id: ncbifile.hpp 463266 2015-03-26 12:27:16Z ivanov $
+/*  $Id: ncbifile.hpp 497376 2016-04-06 13:21:22Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1499,7 +1499,8 @@ private:
 ///
 /// CFile --
 ///
-/// Define class to work with files.
+/// Define class to work with regular files.
+/// NOTE: it don't work with any special or block devices like /dev/null
 ///
 /// Models a file in a file system. Basic functionality is derived from
 /// CDirEntry and extended for files.
@@ -2231,8 +2232,8 @@ private:
     ERemoveMode m_RemoveOnDestruction; ///< Remove file on destruction
 
     // Automatic pointers to store I/O streams.
-    auto_ptr<CNcbiIstream> m_InFile;
-    auto_ptr<CNcbiOstream> m_OutFile;
+    unique_ptr<CNcbiIstream> m_InFile;
+    unique_ptr<CNcbiOstream> m_OutFile;
 
 private:
     // Prevent copying
@@ -2840,27 +2841,27 @@ typedef int TFindFiles;
 
 /// Find files in the specified directory
 template<class TFindFunc>
-TFindFunc FindFilesInDir(const CDir&            dir,
-                         const vector<string>&  masks,
-                         const vector<string>&  masks_subdir,
-                         TFindFunc&             find_func,
-                         TFindFiles             flags = fFF_Default)
+void FindFilesInDir(const CDir&            dir,
+                    const vector<string>&  masks,
+                    const vector<string>&  masks_subdir,
+                    TFindFunc&             find_func,
+                    TFindFiles             flags = fFF_Default)
 {
     TFindFiles find_type = flags & (fFF_Dir | fFF_File);
     if ( find_type == 0 ) {
         // nothing to find
-        return find_func;
+        return;
     }
-    auto_ptr<CDir::TEntries> 
+    unique_ptr<CDir::TEntries> 
         contents(dir.GetEntriesPtr(kEmptyStr, CDir::fIgnoreRecursive | CDir::fIgnorePath));
     if (contents.get() == NULL) {
         // error
-        return find_func;
+        return;
     }
 
     NStr::ECase use_case = (flags & fFF_Nocase) ? NStr::eNocase : NStr::eCase;
-
     string path;
+
     if ( dir.GetPath().length() ) {
         path = CDirEntry::AddTrailingPathSeparator(dir.GetPath());
     }
@@ -2885,37 +2886,36 @@ TFindFunc FindFilesInDir(const CDir&            dir,
              CDirEntry::MatchesMask(name, masks_subdir, use_case) &&
              (entry_type == fFF_Dir || dir_entry.IsDir()) /*real dir*/ ) {
             CDir nested_dir(dir_entry.GetPath());
-            find_func = FindFilesInDir(nested_dir, masks, masks_subdir,
-                                       find_func, flags);
+            FindFilesInDir(nested_dir, masks, masks_subdir, find_func, flags);
         }
-    } // ITERATE
-    return find_func;
+    }
+    return;
 }
 
 
 /// Find files in the specified directory
 template<class TFindFunc>
-TFindFunc FindFilesInDir(const CDir&   dir,
-                         const CMask&  masks,
-                         const CMask&  masks_subdir,
-                         TFindFunc&    find_func,
-                         TFindFiles    flags = fFF_Default)
+void FindFilesInDir(const CDir&   dir,
+                    const CMask&  masks,
+                    const CMask&  masks_subdir,
+                    TFindFunc&    find_func,
+                    TFindFiles    flags = fFF_Default)
 {
     TFindFiles find_type = flags & (fFF_Dir | fFF_File);
     if ( find_type == 0 ) {
         // nothing to find
-        return find_func;
+        return;
     }
-    auto_ptr<CDir::TEntries> 
+    unique_ptr<CDir::TEntries> 
         contents(dir.GetEntriesPtr(kEmptyStr, CDir::fIgnoreRecursive |  CDir::fIgnorePath));
     if (contents.get() == NULL) {
         // error
-        return find_func;
+        return;
     }
 
     NStr::ECase use_case = (flags & fFF_Nocase) ? NStr::eNocase : NStr::eCase;
-
     string path;
+
     if ( dir.GetPath().length() ) {
         path = CDirEntry::AddTrailingPathSeparator(dir.GetPath());
     }
@@ -2940,11 +2940,10 @@ TFindFunc FindFilesInDir(const CDir&   dir,
              masks_subdir.Match(name, use_case) &&
              (entry_type == fFF_Dir || dir_entry.IsDir()) /*real dir*/ ) {
             CDir nested_dir(dir_entry.GetPath());
-            find_func = FindFilesInDir(nested_dir, masks, masks_subdir,
-                                       find_func, flags);
+            FindFilesInDir(nested_dir, masks, masks_subdir, find_func, flags);
         }
-    } // ITERATE entries
-    return find_func;
+    }
+    return;
 }
 
 
@@ -2967,38 +2966,37 @@ TFindFunc FindFilesInDir(const CDir&   dir,
 
 template<class TPathIterator, 
          class TFindFunc>
-TFindFunc FindFiles(TPathIterator         path_begin,
-                    TPathIterator         path_end,
-                    const vector<string>& masks,
-                    TFindFunc&            find_func,
-                    TFindFiles            flags = fFF_Default)
+void FindFiles(TPathIterator         path_begin,
+               TPathIterator         path_end,
+               const vector<string>& masks,
+               TFindFunc&            find_func,
+               TFindFiles            flags = fFF_Default)
 {
     vector<string> masks_empty;
     for (; path_begin != path_end; ++path_begin) {
         const string& dir_name = *path_begin;
         CDir dir(dir_name);
-        find_func = FindFilesInDir(dir, masks, masks_empty, find_func, flags);
+        FindFilesInDir(dir, masks, masks_empty, find_func, flags);
     }
-    return find_func;
+    return;
 }
 
 
 template<class TPathIterator, 
          class TFindFunc>
-TFindFunc FindFiles2(TPathIterator         path_begin,
-                     TPathIterator         path_end,
-                     const vector<string>& masks,
-                     const vector<string>& masks_subdir,
-                     TFindFunc&            find_func,
-                     TFindFiles            flags = fFF_Default)
+void FindFiles2(TPathIterator         path_begin,
+                TPathIterator         path_end,
+                const vector<string>& masks,
+                const vector<string>& masks_subdir,
+                TFindFunc&            find_func,
+                TFindFiles            flags = fFF_Default)
 {
     for (; path_begin != path_end; ++path_begin) {
         const string& dir_name = *path_begin;
         CDir dir(dir_name);
-        find_func = FindFilesInDir(dir, masks, masks_subdir,
-                                   find_func, flags);
+        FindFilesInDir(dir, masks, masks_subdir, find_func, flags);
     }
-    return find_func;
+    return;
 }
 
 
@@ -3015,18 +3013,19 @@ TFindFunc FindFiles2(TPathIterator         path_begin,
 template<class TPathIterator, 
          class TMaskIterator, 
          class TFindFunc>
-TFindFunc FindFiles(TPathIterator path_begin,
-                    TPathIterator path_end,
-                    TMaskIterator mask_begin,
-                    TMaskIterator mask_end,
-                    TFindFunc&    find_func,
-                    TFindFiles    flags = fFF_Default)
+void FindFiles(TPathIterator path_begin,
+               TPathIterator path_end,
+               TMaskIterator mask_begin,
+               TMaskIterator mask_end,
+               TFindFunc&    find_func,
+               TFindFiles    flags = fFF_Default)
 {
     vector<string> masks;
     for (; mask_begin != mask_end; ++mask_begin) {
         masks.push_back(*mask_begin);
     }
-    return FindFiles(path_begin, path_end, masks, find_func, flags);
+    FindFiles(path_begin, path_end, masks, find_func, flags);
+    return;
 }
 
 
@@ -3042,38 +3041,37 @@ TFindFunc FindFiles(TPathIterator path_begin,
 
 template<class TPathIterator, 
          class TFindFunc>
-TFindFunc FindFiles(TPathIterator path_begin,
-                    TPathIterator path_end,
-                    const CMask&  masks,
-                    TFindFunc&    find_func,
-                    TFindFiles    flags = fFF_Default)
+void FindFiles(TPathIterator path_begin,
+               TPathIterator path_end,
+               const CMask&  masks,
+               TFindFunc&    find_func,
+               TFindFiles    flags = fFF_Default)
 {
     CMaskFileName masks_empty;
     for (; path_begin != path_end; ++path_begin) {
         const string& dir_name = *path_begin;
         CDir dir(dir_name);
-        find_func = FindFilesInDir(dir, masks, masks_empty, find_func, flags);
+        FindFilesInDir(dir, masks, masks_empty, find_func, flags);
     }
-    return find_func;
+    return;
 }
 
 
 template<class TPathIterator, 
          class TFindFunc>
-TFindFunc FindFiles2(TPathIterator path_begin,
-                     TPathIterator path_end,
-                     const CMask&  masks,
-                     const CMask&  masks_subdir,
-                     TFindFunc&    find_func,
-                     TFindFiles    flags = fFF_Default)
+void FindFiles2(TPathIterator path_begin,
+                TPathIterator path_end,
+                const CMask&  masks,
+                const CMask&  masks_subdir,
+                TFindFunc&    find_func,
+                TFindFiles    flags = fFF_Default)
 {
     for (; path_begin != path_end; ++path_begin) {
         const string& dir_name = *path_begin;
         CDir dir(dir_name);
-        find_func = FindFilesInDir(dir, masks, masks_subdir,
-                                   find_func, flags);
+        FindFilesInDir(dir, masks, masks_subdir, find_func, flags);
     }
-    return find_func;
+    return;
 }
 
 
diff --git a/c++/include/corelib/ncbimisc.hpp b/c++/include/corelib/ncbimisc.hpp
index 7e40e2f..c7a48cf 100644
--- a/c++/include/corelib/ncbimisc.hpp
+++ b/c++/include/corelib/ncbimisc.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBIMISC__HPP
 #define CORELIB___NCBIMISC__HPP
 
-/*  $Id: ncbimisc.hpp 468451 2015-05-22 18:30:31Z vasilche $
+/*  $Id: ncbimisc.hpp 494187 2016-03-04 12:23:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -283,6 +283,41 @@ private:
 };
 
 
+/// Template used to replace bool type arguments with some strict equivalent.
+/// This allow to prevent compiler to do an implicit casts from other types
+/// to bool. "TEnum" should be an enumerated type with two values:
+///   - negative (FALSE/OFF) should have value 0
+//    - positive (TRUE/ON) have value 1.
+
+template <class TEnum>
+class CBoolEnum
+{
+public:
+    // Constructors
+    CBoolEnum(bool  value) : m_Value(value) {}
+    CBoolEnum(TEnum value) : m_Value(value ? true : false) {}
+
+    /// Operator bool
+    operator bool() const   { return m_Value; }
+    /// Operator enum
+    operator TEnum () const { return TEnum(m_Value); }
+
+private:
+    bool m_Value;
+
+private:
+    // Disable implicit conversions from/to other types
+    CBoolEnum(char*);
+    CBoolEnum(int);
+    CBoolEnum(unsigned int);
+    template <class T> CBoolEnum(T);
+
+    operator int() const;
+    operator unsigned int() const;
+};
+
+
+
 #ifdef HAVE_NO_AUTO_PTR
 
 
@@ -689,7 +724,7 @@ enum ENull {
 
 
 // Default callback for null value - throws CCoreException.
-void g_ThrowOnNull(void);
+NCBI_XNCBI_EXPORT NCBI_NORETURN void g_ThrowOnNull(void);
 
 // Default callback template.
 template <class TValue>
@@ -725,7 +760,7 @@ public:
     }
 
     /// Get nullable value.
-    /// If NULL, then call FNullToValue and use the value return by the latter.
+    /// If NULL, then call TNullToValue and use the value return by the latter.
     /// @attention  The default implementation of TNullToValue (g_ThrowOnNull)
     ///             throws an exception! 
     operator TValue(void) const
@@ -733,6 +768,27 @@ public:
         return m_IsNull ? TNullToValue()() : m_Value;
     }
 
+    /// Get a const reference to the current value. If NULL, the reference is
+    /// a copy of the default value or throw (depending on TNullToValue
+    /// implementation). In any case the IsNull state is unchanged.
+    const TValue& GetValue(void) const
+    {
+        if ( m_IsNull ) {
+            const_cast<TValue&>(m_Value) = TNullToValue()();
+        }
+        return m_Value;
+    }
+
+    /// Get a non-const reference to the value. If NULL, try to initialize this
+    /// instance with the default value or throw.
+    TValue& SetValue(void)
+    {
+        if ( m_IsNull ) {
+            *this = TNullToValue()();
+        }
+        return m_Value;
+    }
+
     /// Assign a value to the nullable.
     CNullable& operator= (TValue value)
     {
@@ -908,6 +964,8 @@ const TSeqPos kInvalidSeqPos = ((TSeqPos) (-1));
 /// Use this typedef rather than its expansion, which may change.
 typedef int TSignedSeqPos;
 
+/// Type for Taxon1-name.taxid
+typedef int TTaxId;
 
 /// Type for sequence GI.
 ///
@@ -947,8 +1005,15 @@ public:
     CStrictGi& operator--(void) { m_Gi--; return *this; }
     CStrictGi operator--(int) { CStrictGi tmp = *this; m_Gi--; return tmp; }
 
+    TIntId operator+(const CStrictGi& gi) const { return m_Gi + gi.m_Gi; }
+    TIntId operator-(const CStrictGi& gi) const { return m_Gi - gi.m_Gi; }
+
     CStrictGi operator+(TIntId offset) const { return m_Gi + offset; }
     CStrictGi operator-(TIntId offset) const { return m_Gi - offset; }
+#if defined(NCBI_INT8_GI)
+    CStrictGi operator+(Int4 offset) const { return m_Gi + offset; }
+    CStrictGi operator-(Int4 offset) const { return m_Gi - offset; }
+#endif
 
     CStrictGi(TIntId value) : m_Gi(value) {}
     CStrictGi& operator=(TIntId value) { m_Gi = value; return *this; }
@@ -1168,6 +1233,16 @@ size_t ArraySize(const Element (&)[Size])
     return Size;
 }
 
+#ifdef NCBI_STRICT_GI
+template <> struct hash<ncbi::CStrictGi>
+{
+    size_t operator()(const ncbi::CStrictGi & x) const
+    {
+        return hash<ncbi::TIntId>()((ncbi::TIntId)x);
+    }
+};
+#endif /* NCBI_STRICT_GI */
+
 #endif
 
 END_STD_NAMESPACE;
diff --git a/c++/include/corelib/ncbimtx.hpp b/c++/include/corelib/ncbimtx.hpp
index 4f8123e..1b080de 100644
--- a/c++/include/corelib/ncbimtx.hpp
+++ b/c++/include/corelib/ncbimtx.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBIMTX__HPP
 #define CORELIB___NCBIMTX__HPP
 
-/* $Id: ncbimtx.hpp 450144 2014-10-23 13:52:16Z grichenk $
+/* $Id: ncbimtx.hpp 469570 2015-06-05 16:05:18Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -89,30 +89,6 @@
 
 BEGIN_NCBI_SCOPE
 
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Log mutex events if LOG_MUTEX_EVENTS is defined.
-//
-//    The mutex events (create/destroy/lock/unlock) are logged into
-//    ./mutex_events.log or the one specified in MUTEX_EVENTS_LOG_FILE
-//    env. variable.
-//
-
-#if defined(_DEBUG) &&  defined(LOG_MUTEX_EVENTS)
-
-// Logging function, prints pointer to the mutex, system thread ID
-// and the message.
-NCBI_XNCBI_EXPORT void WriteMutexEvent(void* mutex_ptr, const char* message);
-#  define WRITE_MUTEX_EVENT(mutex, message) WriteMutexEvent(mutex, message)
-
-#else
-
-#  define WRITE_MUTEX_EVENT(mutex, message) ((void)0)
-
-#endif
-
-
 /////////////////////////////////////////////////////////////////////////////
 //
 // DECLARATIONS of internal (platform-dependent) representations
diff --git a/c++/include/corelib/ncbireg.hpp b/c++/include/corelib/ncbireg.hpp
index 1124a66..88786fd 100644
--- a/c++/include/corelib/ncbireg.hpp
+++ b/c++/include/corelib/ncbireg.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBIREG__HPP
 #define CORELIB___NCBIREG__HPP
 
-/*  $Id: ncbireg.hpp 461481 2015-03-10 16:01:30Z ucko $
+/*  $Id: ncbireg.hpp 495404 2016-03-17 13:28:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -99,6 +99,8 @@ public:
         fSectionlessEntries = 0x4000,///< Allow empty section names (for test_res framework)
         fSections       = 0x8000,///< Indicates that we want sections from x_Enumerate
         fPlaintextAllowed = 0x10000,///< @sa GetEncryptedString()
+        fInSectionComments = 0x20000,/**< Indicates that we want in-section 
+                                          comments from x_Enumerate */
         fCoreLayers     = fTransient | fPersistent | fJustCore,
         fAllLayers      = fTransient | fPersistent | fNotJustCore,
         fCaseFlags      = fSectionCase | fEntryCase
@@ -253,6 +255,18 @@ public:
     const string& GetComment(const string& section = kEmptyStr,
                              const string& name    = kEmptyStr,
                              TFlags        flags   = 0) const;
+    
+    /// Enumerate in-section comments.
+    ///
+    /// Write all in-section comments to the "comments" list in
+    /// (registry priority) order. Previous contents of the list are
+    /// erased.
+    /// @param flags
+    ///   To control layers if search. Allowed values are fTransient, 
+    ///   fPersistent, fNotJustCore, fJustCore and their mix using |
+    void EnumerateInSectionComments(const string& section,
+                                    list<string>* comments,
+                                    TFlags        flags = fAllLayers) const;
 
     /// Enumerate section names.
     ///
@@ -283,6 +297,9 @@ public:
     void WriteLock(void);
     void Unlock   (void);
 
+    /// Entry name for an in-section comment
+    static const char* sm_InSectionCommentName;
+
 #ifdef NCBI_COMPILER_ICC
     /// Work around a compiler bug that can cause memory leaks.
     virtual ~IRegistry() { }
@@ -378,8 +395,6 @@ public:
 
     /// Set the configuration parameter value.
     ///
-    /// Unset the parameter if specified "value" is empty.
-    ///
     /// @param value
     ///   Value that the parameter is set to.
     /// @param flags
@@ -402,6 +417,12 @@ public:
              TFlags        flags   = 0,
              const string& comment = kEmptyStr);
 
+    /// Fully unset the configuration parameter value, so that
+    /// HasEntry returns false.
+    /// @return
+    ///   TRUE if there had been an existing value.
+    bool Unset(const string& section, const string& name, TFlags flags = 0);
+    
     /// Set comment "comment" for the registry entry "section:name".
     ///
     /// @param comment
@@ -442,6 +463,8 @@ protected:
     virtual bool x_Set(const string& section, const string& name,
                        const string& value, TFlags flags,
                        const string& comment) = 0;
+    virtual bool x_Unset(const string& section, const string& name,
+                         TFlags flags) = 0;
     virtual bool x_SetComment(const string& comment, const string& section,
                               const string& name, TFlags flags) = 0;
 
@@ -493,6 +516,7 @@ protected:
     bool x_Set(const string& section, const string& name,
                const string& value, TFlags flags,
                const string& comment);
+    bool x_Unset(const string& section, const string& name, TFlags flags);
     bool x_SetComment(const string& comment, const string& section,
                       const string& name, TFlags flags);
 
@@ -507,6 +531,7 @@ public: // WorkShop needs these exposed
               cleared(false)
             { }
         string   comment;
+        string   in_section_comment; //for comments inside section
         TEntries entries;
         bool     cleared;
     };
@@ -652,6 +677,7 @@ protected:
     bool x_Set(const string& section, const string& name,
                const string& value, TFlags flags,
                const string& comment);
+    bool x_Unset(const string& section, const string& name, TFlags flags);
     bool x_SetComment(const string& comment, const string& section,
                       const string& name, TFlags flags);
 
@@ -754,6 +780,7 @@ protected:
     bool x_Set(const string& section, const string& name,
                const string& value, TFlags flags,
                const string& comment);
+    bool x_Unset(const string& section, const string& name, TFlags flags);
     bool x_SetComment(const string& comment, const string& section,
                       const string& name, TFlags flags);
     IRWRegistry* x_Read(CNcbiIstream& is, TFlags flags, const string& path);
@@ -846,6 +873,8 @@ public:
 protected:
     void x_Clear(TFlags flags);
     IRWRegistry* x_Read(CNcbiIstream& is, TFlags flags, const string& path);
+    const string& x_GetComment(const string& section, const string& name,
+                               TFlags flags) const;
 
 private:
     void x_Init(void);
diff --git a/c++/include/corelib/ncbistr.hpp b/c++/include/corelib/ncbistr.hpp
index a70bb99..5cc1cc5 100644
--- a/c++/include/corelib/ncbistr.hpp
+++ b/c++/include/corelib/ncbistr.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___NCBISTR__HPP
 #define CORELIB___NCBISTR__HPP
 
-/*  $Id: ncbistr.hpp 479746 2015-09-23 13:17:35Z ivanov $
+/*  $Id: ncbistr.hpp 497430 2016-04-06 17:39:32Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -126,13 +126,8 @@ private:
 
 // SIZE_TYPE and NPOS
 
-/// Define size type.
 typedef NCBI_NS_STD::string::size_type SIZE_TYPE;
-
-/// Define NPOS constant as the special value "std::string::npos" which is
-/// returned when a substring search fails, or to indicate an unspecified
-/// string position.
-const SIZE_TYPE NPOS = static_cast<SIZE_TYPE>(-1);
+#define NPOS NCBI_NS_STD::string::npos
 
 
 
@@ -326,9 +321,9 @@ public:
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
     template <typename TNumeric>
-    static TNumeric StringToNumeric(const CTempString& str,
-                                    TStringToNumFlags  flags = 0,
-                                    int                base  = 10);
+    static TNumeric StringToNumeric(const CTempString str,
+                                    TStringToNumFlags flags = 0,
+                                    int               base  = 10);
 
     /// Convert string to a numeric value.
     ///
@@ -349,10 +344,10 @@ public:
     ///   - Otherwise, set errno to non-zero, set the value to zero, and
     ///     return false.
     template <typename TNumeric>
-    static bool StringToNumeric(const CTempString& str,
-                                TNumeric*          value, /*[out]*/ 
-                                TStringToNumFlags  flags = 0,
-                                int                base  = 10);
+    static bool StringToNumeric(const CTempString str,
+                                TNumeric*         value, /*[out]*/ 
+                                TStringToNumFlags flags = 0,
+                                int               base  = 10);
 
     /// Convert string to int.
     ///
@@ -369,9 +364,9 @@ public:
     ///     converted value.
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
-    static int StringToInt(const CTempString& str,
-                           TStringToNumFlags  flags = 0,
-                           int                base  = 10);
+    static int StringToInt(const CTempString str,
+                           TStringToNumFlags flags = 0,
+                           int               base  = 10);
 
     /// Convert string to unsigned int.
     ///
@@ -388,9 +383,9 @@ public:
     ///     converted value.
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
-    static unsigned int StringToUInt(const CTempString& str,
-                                     TStringToNumFlags  flags = 0,
-                                     int                base  = 10);
+    static unsigned int StringToUInt(const CTempString str,
+                                     TStringToNumFlags flags = 0,
+                                     int               base  = 10);
 
     /// Convert string to long.
     ///
@@ -407,9 +402,9 @@ public:
     ///     converted value.
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
-    static long StringToLong(const CTempString& str,
-                             TStringToNumFlags  flags = 0,
-                             int                base  = 10);
+    static long StringToLong(const CTempString str,
+                             TStringToNumFlags flags = 0,
+                             int               base  = 10);
 
     /// Convert string to unsigned long.
     ///
@@ -426,9 +421,9 @@ public:
     ///     converted value.
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
-    static unsigned long StringToULong(const CTempString& str,
-                                       TStringToNumFlags  flags = 0,
-                                       int                base  = 10);
+    static unsigned long StringToULong(const CTempString str,
+                                       TStringToNumFlags flags = 0,
+                                       int               base  = 10);
 
     /// Convert string to double-precision value (analog of strtod function)
     ///
@@ -479,8 +474,8 @@ public:
     /// @note
     ///   - Denormal or infinite results are considered successful conversion.
     ///   - To enforce finite and normalized result, use fDecimalPosixFinite flag.
-    static double StringToDouble(const CTempStringEx& str,
-                                 TStringToNumFlags    flags = 0);
+    static double StringToDouble(const CTempStringEx str,
+                                 TStringToNumFlags   flags = 0);
 
     /// This version accepts zero-terminated string
     /// @deprecated
@@ -505,9 +500,9 @@ public:
     ///     converted value.
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
-    static Int8 StringToInt8(const CTempString& str,
-                             TStringToNumFlags  flags = 0,
-                             int                base  = 10);
+    static Int8 StringToInt8(const CTempString str,
+                             TStringToNumFlags flags = 0,
+                             int               base  = 10);
 
     /// Convert string to Uint8.
     ///
@@ -524,9 +519,9 @@ public:
     ///     converted value.
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
-    static Uint8 StringToUInt8(const CTempString& str,
-                               TStringToNumFlags  flags = 0,
-                               int                base  = 10);
+    static Uint8 StringToUInt8(const CTempString str,
+                               TStringToNumFlags flags = 0,
+                               int               base  = 10);
 
     /// Convert string that can contain "software" qualifiers to Uint8. 
     ///
@@ -551,8 +546,8 @@ public:
     ///   - If conversion succeeds, return the converted value.
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
-    static Uint8 StringToUInt8_DataSize(const CTempString& str,
-                                        TStringToNumFlags  flags = 0);
+    static Uint8 StringToUInt8_DataSize(const CTempString str,
+                                        TStringToNumFlags flags = 0);
 
     /// Convert string to number of bytes. 
     ///
@@ -579,9 +574,9 @@ public:
     ///   - Otherwise, set errno to non-zero and return zero.
     /// @deprecated  Use StringToUInt8_DataSize(str,flags) instead.
     NCBI_DEPRECATED
-    static Uint8 StringToUInt8_DataSize(const CTempString& str,
-                                        TStringToNumFlags  flags,
-                                        int                base);
+    static Uint8 StringToUInt8_DataSize(const CTempString str,
+                                        TStringToNumFlags flags,
+                                        int               base);
 
     /// Convert string to size_t.
     ///
@@ -598,9 +593,9 @@ public:
     ///     converted value.
     ///   - Otherwise, if fConvErr_NoThrow is not set, throw an exception.
     ///   - Otherwise, set errno to non-zero and return zero.
-    static size_t StringToSizet(const CTempString& str,
-                                TStringToNumFlags  flags = 0,
-                                int                base  = 10);
+    static size_t StringToSizet(const CTempString str,
+                                TStringToNumFlags flags = 0,
+                                int               base  = 10);
 
     /// Convert string to pointer.
     ///
@@ -611,7 +606,7 @@ public:
     ///   - If conversion succeeds, set errno to zero and return the
     ///     converted value.
     ///   - Otherwise, set errno to non-zero and return NULL.
-    static const void* StringToPtr(const CTempStringEx& str);
+    static const void* StringToPtr(const CTempStringEx str);
 
     /// Convert character to integer.
     ///
@@ -1247,7 +1242,7 @@ public:
     ///   - If conversion succeeds, set errno to zero and return
     ///     TRUE or FALSE.
     ///   - Otherwise, set errno to non-zero and throw an exception.
-    static bool StringToBool(const CTempString& str);
+    static bool StringToBool(const CTempString str);
 
 
     /// Handle an arbitrary printf-style format string.
@@ -1296,7 +1291,7 @@ public:
     /// @sa
     ///   Other forms of overloaded CompareCase() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static int CompareCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+    static int CompareCase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                            const char* pattern);
 
     /// Case-sensitive compare of a substring with a pattern.
@@ -1316,8 +1311,8 @@ public:
     /// @sa
     ///   Other forms of overloaded CompareCase() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static int CompareCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                           const CTempString& pattern);
+    static int CompareCase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                           const CTempString pattern);
 
     /// Case-sensitive compare of two strings -- char* version.
     ///
@@ -1333,7 +1328,7 @@ public:
     ///   CompareNocase(), Compare() versions with same argument types.
     static int CompareCase(const char* s1, const char* s2);
 
-    /// Case-sensitive compare of two strings -- CTempStringEx& version.
+    /// Case-sensitive compare of two strings -- CTempStringEx version.
     ///
     /// @param s1
     ///   String to be compared -- operand 1.
@@ -1345,7 +1340,7 @@ public:
     ///   - Positive integer, if s1 > s2.   
     /// @sa
     ///   CompareNocase(), Compare() versions with same argument types.
-    static int CompareCase(const CTempStringEx& s1, const CTempStringEx& s2);
+    static int CompareCase(const CTempStringEx s1, const CTempStringEx s2);
 
     /// Case-insensitive compare of a substring with a pattern.
     ///
@@ -1366,7 +1361,7 @@ public:
     /// @sa
     ///   Other forms of overloaded CompareNocase() with differences in
     ///   argument types: char* vs. CTempString[Ex]&
-    static int CompareNocase(const CTempString& str, 
+    static int CompareNocase(const CTempString str, 
                              SIZE_TYPE pos, SIZE_TYPE n, const char* pattern);
 
     /// Case-insensitive compare of a substring with a pattern.
@@ -1388,9 +1383,9 @@ public:
     /// @sa
     ///   Other forms of overloaded CompareNocase() with differences in
     ///   argument types: char* vs. CTempString[Ex]&
-    static int CompareNocase(const CTempString& str, 
+    static int CompareNocase(const CTempString str, 
                              SIZE_TYPE pos, SIZE_TYPE n,
-                             const CTempString& pattern);
+                             const CTempString pattern);
 
     /// Case-insensitive compare of two strings -- char* version.
     ///
@@ -1406,7 +1401,7 @@ public:
     ///   CompareCase(), Compare() versions with same argument types.
     static int CompareNocase(const char* s1, const char* s2);
 
-    /// Case-insensitive compare of two strings -- CTempStringEx& version.
+    /// Case-insensitive compare of two strings -- CTempStringEx version.
     ///
     /// @param s1
     ///   String to be compared -- operand 1.
@@ -1418,7 +1413,7 @@ public:
     ///   - Positive integer, if s1 > s2 (case-insensitive compare).    
     /// @sa
     ///   CompareCase(), Compare() versions with same argument types.
-    static int CompareNocase(const CTempStringEx& s1, const CTempStringEx& s2);
+    static int CompareNocase(const CTempStringEx s1, const CTempStringEx s2);
 
     /// Compare of a substring with a pattern.
     ///
@@ -1440,7 +1435,7 @@ public:
     /// @sa
     ///   Other forms of overloaded Compare() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static int Compare(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+    static int Compare(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                        const char* pattern, ECase use_case = eCase);
 
     /// Compare of a substring with a pattern.
@@ -1463,8 +1458,8 @@ public:
     /// @sa
     ///   Other forms of overloaded Compare() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static int Compare(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                       const CTempString& pattern, ECase use_case = eCase);
+    static int Compare(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                       const CTempString pattern, ECase use_case = eCase);
 
     /// Compare two strings -- char* version.
     ///
@@ -1486,7 +1481,7 @@ public:
                        ECase use_case = eCase);
 
 
-    /// Compare two strings -- CTempStringEx& version.
+    /// Compare two strings -- CTempStringEx version.
     ///
     /// @param s1
     ///   String to be compared -- operand 1.
@@ -1502,7 +1497,7 @@ public:
     /// @sa
     ///   Other forms of overloaded Compare() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static int Compare(const CTempStringEx& s1, const CTempStringEx& s2,
+    static int Compare(const CTempStringEx s1, const CTempStringEx s2,
                        ECase use_case = eCase);
 
     /// Case-sensitive equality of a substring with a pattern.
@@ -1521,7 +1516,7 @@ public:
     /// @sa
     ///   Other forms of overloaded EqualCase() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static bool EqualCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+    static bool EqualCase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                           const char* pattern);
 
     /// Case-sensitive equality of a substring with a pattern.
@@ -1540,8 +1535,8 @@ public:
     /// @sa
     ///   Other forms of overloaded EqualCase() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static bool EqualCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                          const CTempString& pattern);
+    static bool EqualCase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                          const CTempString pattern);
 
     /// Case-sensitive equality of two strings -- char* version.
     ///
@@ -1567,7 +1562,7 @@ public:
     ///   - false, otherwise
     /// @sa
     ///   EqualCase(), Equal() versions with same argument types.
-    static bool EqualCase(const CTempStringEx& s1, const CTempStringEx& s2);
+    static bool EqualCase(const CTempStringEx s1, const CTempStringEx s2);
 
     /// Case-insensitive equality of a substring with a pattern.
     ///
@@ -1585,7 +1580,7 @@ public:
     /// @sa
     ///   Other forms of overloaded EqualNocase() with differences in
     ///   argument types: char* vs. CTempString[Ex]&
-    static bool EqualNocase(const CTempString& str,
+    static bool EqualNocase(const CTempString str,
                             SIZE_TYPE pos, SIZE_TYPE n,
                             const char* pattern);
 
@@ -1605,8 +1600,8 @@ public:
     /// @sa
     ///   Other forms of overloaded EqualNocase() with differences in
     ///   argument types: char* vs. CTempString[Ex]&
-    static bool EqualNocase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                            const CTempString& pattern);
+    static bool EqualNocase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                            const CTempString pattern);
 
     /// Case-insensitive equality of two strings -- char* version.
     ///
@@ -1632,7 +1627,7 @@ public:
     ///   - false, otherwise.
     /// @sa
     ///   EqualCase(), Equal() versions with same argument types.
-    static bool EqualNocase(const CTempStringEx& s1, const CTempStringEx& s2);
+    static bool EqualNocase(const CTempStringEx s1, const CTempStringEx s2);
 
     /// Test for equality of a substring with a pattern.
     ///
@@ -1653,7 +1648,7 @@ public:
     /// @sa
     ///   Other forms of overloaded Equal() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static bool Equal(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+    static bool Equal(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                       const char* pattern, ECase use_case = eCase);
 
     /// Test for equality of a substring with a pattern.
@@ -1676,8 +1671,8 @@ public:
     /// @sa
     ///   Other forms of overloaded Equal() with differences in argument
     ///   types: char* vs. CTempString[Ex]&
-    static bool Equal(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                      const CTempString& pattern, ECase use_case = eCase);
+    static bool Equal(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                      const CTempString pattern, ECase use_case = eCase);
 
     /// Test for equality of two strings -- char* version.
     ///
@@ -1711,7 +1706,7 @@ public:
     ///   - false, otherwise.
     /// @sa
     ///   EqualNocase(), Equal() versions with similar argument types.
-    static bool Equal(const CTempStringEx& s1, const CTempStringEx& s2,
+    static bool Equal(const CTempStringEx s1, const CTempStringEx s2,
                       ECase use_case = eCase);
 
     // NOTE.  On some platforms, "strn[case]cmp()" can work faster than their
@@ -1807,7 +1802,7 @@ public:
     ///   String to check.
     /// @param pos
     ///   starting position (default 0)
-    static bool IsBlank(const CTempString& str, SIZE_TYPE pos = 0);
+    static bool IsBlank(const CTempString str, SIZE_TYPE pos = 0);
 
     /// Checks if all letters in the given string have a lower case.
     ///
@@ -1818,7 +1813,7 @@ public:
     ///   according to the current C locale (std::islower()).
     ///   All non-letter characters will be ignored.
     ///   TRUE if empty or no letters.
-    static bool IsLower(const CTempString& str);
+    static bool IsLower(const CTempString str);
 
     /// Checks if all letters in the given string have a upper case.
     ///
@@ -1829,7 +1824,7 @@ public:
     ///   according to the current C locale (std::isupper()).
     ///   All non-letter characters will be skipped.
     ///   TRUE if empty or no letters.
-    static bool IsUpper(const CTempString& str);
+    static bool IsUpper(const CTempString str);
 
 
     // The following 4 methods change the passed string, then return it
@@ -1886,7 +1881,7 @@ public:
     /// @param use_case
     ///   Whether to do a case sensitive compare(default is eCase), or a
     ///   case-insensitive compare (eNocase) while checking.
-    static bool StartsWith(const CTempString& str, const CTempString& start,
+    static bool StartsWith(const CTempString str, const CTempString start,
                            ECase use_case = eCase);
 
     /// Check if a string starts with a specified character value.
@@ -1898,7 +1893,7 @@ public:
     /// @param use_case
     ///   Whether to do a case sensitive compare(default is eCase), or a
     ///   case-insensitive compare (eNocase) while checking.
-    static bool StartsWith(const CTempString& str, char start,
+    static bool StartsWith(const CTempString str, char start,
                            ECase use_case = eCase);
 
     /// Check if a string ends with a specified suffix value.
@@ -1910,7 +1905,7 @@ public:
     /// @param use_case
     ///   Whether to do a case sensitive compare(default is eCase), or a
     ///   case-insensitive compare (eNocase) while checking.
-    static bool EndsWith(const CTempString& str, const CTempString& end,
+    static bool EndsWith(const CTempString str, const CTempString end,
                          ECase use_case = eCase);
 
     /// Check if a string ends with a specified character value.
@@ -1922,7 +1917,7 @@ public:
     /// @param use_case
     ///   Whether to do a case sensitive compare(default is eCase), or a
     ///   case-insensitive compare (eNocase) while checking.
-    static bool EndsWith(const CTempString& str, char end,
+    static bool EndsWith(const CTempString str, char end,
                          ECase use_case = eCase);
 
     /// Determine the common prefix of two strings.
@@ -1933,7 +1928,7 @@ public:
     ///   String to be compared -- operand 2.
     /// @return
     ///   The number of characters common to the start of each string.
-    static SIZE_TYPE CommonPrefixSize(const CTempString& s1, const CTempString& s2);
+    static SIZE_TYPE CommonPrefixSize(const CTempString s1, const CTempString s2);
 
     /// Determine the common suffix of two strings.
     ///
@@ -1943,7 +1938,7 @@ public:
     ///   String to be compared -- operand 2.
     /// @return
     ///   The number of characters common to the end of each string.
-    static SIZE_TYPE CommonSuffixSize(const CTempString& s1, const CTempString& s2);
+    static SIZE_TYPE CommonSuffixSize(const CTempString s1, const CTempString s2);
 
     /// Determine if the suffix of one string is the prefix of another.
     ///
@@ -1954,15 +1949,48 @@ public:
     /// @return
     ///   The number of characters common to the end of the first string
     ///   and the start of the second string.
-    static SIZE_TYPE CommonOverlapSize(const CTempString& s1, const CTempString& s2);
+    static SIZE_TYPE CommonOverlapSize(const CTempString s1, const CTempString s2);
 
 
     /// Whether it is the first or last occurrence.
+    /// @deprecated
     enum EOccurrence {
         eFirst,             ///< First occurrence
         eLast               ///< Last occurrence
     };
 
+    /// Search direction for Find() methods.
+    enum EDirection {
+        eForwardSearch = 0,  ///< Search in a forward direction
+        eReverseSearch       ///< Search in a backward direction
+    };
+
+
+    /// Find the pattern in the string.
+    ///
+    /// @param str
+    ///   String to search.
+    /// @param pattern
+    ///   Pattern to search for in "str". 
+    /// @param use_case
+    ///   Whether to do a case sensitive compare (default is eCase), or a
+    ///   case-insensitive compare (eNocase) while searching for the pattern.
+    /// @param direction
+    ///   Define a search direction of the requested "occurrence"
+    ///   of "pattern" in "str".
+    /// @param occurrence
+    ///   Which occurrence of the pattern in the string to use (zero-based).
+    ///   NOTE:  When an occurrence is found the next occurrence will be
+    ///          searched for starting right *after* the found pattern.
+    /// @return
+    ///   - Start of the found pattern in the string.
+    ///   - NPOS if there is no occurrence of the pattern in the string.
+    static SIZE_TYPE Find(const CTempString str,
+                          const CTempString pattern,
+                          ECase             use_case   = eCase,
+                          EDirection        direction  = eForwardSearch,
+                          SIZE_TYPE         occurrence = 0);
+
     /// Find the pattern in the specified range of a string.
     ///
     /// @param str
@@ -1988,12 +2016,22 @@ public:
     ///   ["start", "end"], or
     ///   - NPOS if there is no occurrence of the pattern.
     /// @sa FindCase, FindNoCase, FindWord
-    static SIZE_TYPE Find(const CTempString& str,
-                          const CTempString& pattern,
-                          SIZE_TYPE   start = 0, SIZE_TYPE end = NPOS,
+    /// @deprecated
+    ///   Use Find() method without [start:end] range.
+    NCBI_DEPRECATED
+    static SIZE_TYPE Find(const CTempString str,
+                          const CTempString pattern,
+                          SIZE_TYPE   start, SIZE_TYPE end,
                           EOccurrence which = eFirst,
                           ECase       use_case = eCase);
 
+    /// Wrapper for backward-compatibility
+    inline
+    static SIZE_TYPE Find(const CTempString str, const CTempString pattern,
+                          SIZE_TYPE start)
+        { return FindCase(str, pattern, start); }
+
+
     /// Find the pattern in the specified range of a string using a case
     /// sensitive search.
     ///
@@ -2017,10 +2055,17 @@ public:
     ///   ["start", "end"], or
     ///   - NPOS if there is no occurrence of the pattern.
     /// @sa Find
-    static SIZE_TYPE FindCase  (const CTempString& str, 
-                                const CTempString& pattern,
-                                SIZE_TYPE   start = 0, SIZE_TYPE end = NPOS,
-                                EOccurrence which = eFirst);
+    /// @deprecated
+    ///   Use Find() method without [start:end] range.
+    NCBI_DEPRECATED
+    static SIZE_TYPE FindCase(const CTempString str, 
+                              const CTempString pattern,
+                              SIZE_TYPE   start, SIZE_TYPE end,
+                              EOccurrence which = eFirst);
+
+    /// Wrappers for backward-compatibility
+    static SIZE_TYPE FindCase(const CTempString str, const CTempString pattern);
+    static SIZE_TYPE FindCase(const CTempString str, const CTempString pattern, SIZE_TYPE start);
 
     /// Find the pattern in the specified range of a string using a case
     /// insensitive search.
@@ -2045,33 +2090,60 @@ public:
     ///   ["start", "end"], or
     ///   - NPOS if there is no occurrence of the pattern.
     /// @sa Find
-    static SIZE_TYPE FindNoCase(const CTempString& str,
-                                const CTempString& pattern,
-                                SIZE_TYPE   start = 0, SIZE_TYPE end = NPOS,
+    /// @deprecated
+    ///   Use Find() method without [start:end] range.
+    NCBI_DEPRECATED
+    static SIZE_TYPE FindNoCase(const CTempString str,
+                                const CTempString pattern,
+                                SIZE_TYPE   start, SIZE_TYPE end,
                                 EOccurrence which = eFirst);
 
+    /// Wrapper for backward-compatibility
+    static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern);
+    static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start);
+
     /// Test for presence of a given string in a list or vector of strings
 
     static const string* Find      (const list<string>& lst,
-                                    const CTempString& val,
+                                    const CTempString val,
                                     ECase use_case = eCase);
 
     static const string* FindCase  (const list<string>& lst,
-                                    const CTempString& val);
+                                    const CTempString val);
 
     static const string* FindNoCase(const list<string>& lst, 
-                                    const CTempString& val);
+                                    const CTempString val);
 
     static const string* Find      (const vector<string>& vec, 
-                                    const CTempString& val,
+                                    const CTempString val,
                                     ECase use_case = eCase);
 
     static const string* FindCase  (const vector<string>& vec,
-                                    const CTempString& val);
+                                    const CTempString val);
 
     static const string* FindNoCase(const vector<string>& vec,
-                                    const CTempString& val);
+                                    const CTempString val);
 
+    /// Find given word in the string.
+    ///
+    /// @param str
+    ///   String to search.
+    /// @param word
+    ///   Word to search for in "str". The "word" can have any symbols,
+    ///   not letters only. Function treat it as a pattern, even it have
+    ///   any non-word characters.
+    /// @param use_case
+    ///   Whether to do a case sensitive compare (default is eCase), or a
+    ///   case-insensitive compare (eNocase) while searching for the word.
+    /// @param direction
+    ///   Define a search direction of the occurrence of "word" in "str".
+    /// @return
+    ///   - Start of the found word in the string.
+    ///   - NPOS if there is no occurrence of the word in the string.
+    static SIZE_TYPE FindWord(const CTempString str,
+                              const CTempString word,
+                              ECase             use_case  = eCase,
+                              EDirection        direction = eForwardSearch);
 
     /// Find given word in the string.
     ///
@@ -2082,7 +2154,7 @@ public:
     /// @param str
     ///   String to search.
     /// @param word
-    ///   Pattern to search for in "str". The "word" can have any symbols,
+    ///   Word to search for in "str". The "word" can have any symbols,
     ///   not letters only. Function treat it as a pattern, even it have
     ///   any non-word characters.
     /// @param which
@@ -2094,14 +2166,19 @@ public:
     ///   case-insensitive compare (eNocase) while searching for the word.
     /// @return
     ///   - The start of the first or last (depending on "which" parameter)
-    ///   occurrence of "word" in "str", within the string interval
-    ///   ["start", "end"], or
+    ///     occurrence of "word" in "str", or
     ///   - NPOS if there is no occurrence of the word.
     /// @sa Find
-    static SIZE_TYPE FindWord(const CTempString& str,
-                              const CTempString& word,
-                              EOccurrence which = eFirst,
-                              ECase       use_case = eCase);
+    /// @deprecated
+    ///   Use FindWord() variant with EDirection parameter.
+    inline
+    NCBI_DEPRECATED
+    static SIZE_TYPE FindWord(const CTempString str,
+                              const CTempString word,
+                              EOccurrence which,
+                              ECase       use_case = eCase) {
+        return FindWord(str, word, use_case, which == eFirst ? eForwardSearch : eReverseSearch);
+    }
 
 
     /// Which end to truncate a string.
@@ -2135,14 +2212,15 @@ public:
     ///   So, for example, if the source is temporary string, then the result
     ///   will be invalid right away (will point to already released memory).
     /// @sa TruncateSpaces
-    static CTempString TruncateSpaces_Unsafe(const CTempString& str,
+    static CTempString TruncateSpaces_Unsafe(const CTempString str,
                                              ETrunc where = eTrunc_Both);
 
 
     /// @deprecated  Use TruncateSpaces_Unsafe() instead -- AND, do make sure
     ///              that you indeed use that in a safe manner!
+    inline
     NCBI_DEPRECATED
-    static CTempString TruncateSpaces(const CTempString& str,
+    static CTempString TruncateSpaces(const CTempString str,
                                       ETrunc where = eTrunc_Both) {
         return TruncateSpaces_Unsafe(str, where);
     }
@@ -2165,6 +2243,7 @@ public:
 
     /// @deprecated  Use TruncateSpaces_Unsafe() instead -- AND, do make sure
     ///              that you indeed use that in a safe manner!
+    inline
     NCBI_DEPRECATED
     static CTempString TruncateSpaces(const char* str,
                                       ETrunc where = eTrunc_Both) {
@@ -2192,9 +2271,9 @@ public:
     /// @param use_case
     ///   Whether to do a case sensitive compare (default is eCase), or a
     ///   case-insensitive compare (eNocase) while checking for a prefix.
-    static void TrimPrefixInPlace(string& str, const CTempString& prefix,
+    static void TrimPrefixInPlace(string& str, const CTempString prefix,
                                   ECase use_case = eCase);
-    static void TrimPrefixInPlace(CTempString& str, const CTempString& prefix,
+    static void TrimPrefixInPlace(CTempString& str, const CTempString prefix,
                                   ECase use_case = eCase);
 
     /// Trim suffix from a string (in-place)
@@ -2207,9 +2286,9 @@ public:
     /// @param use_case
     ///   Whether to do a case sensitive compare (default is eCase), or a
     ///   case-insensitive compare (eNocase) while checking for a prefix.
-    static void TrimSuffixInPlace(string& str, const CTempString& suffix,
+    static void TrimSuffixInPlace(string& str, const CTempString suffix,
                                   ECase use_case = eCase);
-    static void TrimSuffixInPlace(CTempString& str, const CTempString& suffix,
+    static void TrimSuffixInPlace(CTempString& str, const CTempString suffix,
                                   ECase use_case = eCase);
 
     /// Replace occurrences of a substring within a string.
@@ -2298,74 +2377,267 @@ public:
                                   SIZE_TYPE     start_pos = 0,
                                   SIZE_TYPE     max_replace = 0);
 
-    /// Flags for Split(InTwo) and Tokenize.  With quote support enabled,
-    /// doubling a quote character suppresses its special meaning, as does
-    /// escaping it if that's enabled too; unescaped trailing backslashes
-    /// and unbalanced quotes result in exceptions.
+    /// Flags for Split*() methods. 
+    /// 
+    /// @note
+    ///   With quote support enabled, doubling a quote character suppresses
+    ///   its special meaning, as does escaping it if that's enabled too;
+    ///   unescaped trailing backslashes and unbalanced quotes result in
+    ///   exceptions.
     enum ESplitFlags {
-        fSplit_MergeDelims     = 1 << 0, ///< Merge adjacent delimiters
-        fSplit_ByPattern       = 1 << 1, ///< Require full delimiter strings
-        fSplit_CanEscape       = 1 << 2, ///< Allow \... escaping
-        fSplit_CanSingleQuote  = 1 << 3, ///< Allow '...' quoting
-        fSplit_CanDoubleQuote  = 1 << 4, ///< Allow "..." quoting
-        fSplit_CanQuote        = fSplit_CanSingleQuote | fSplit_CanDoubleQuote
+        fSplit_MergeDelimiters = 1 << 0,  ///< Merge adjacent delimiters
+        fSplit_Truncate_Begin  = 1 << 1,  ///< Truncate leading delimiters
+        fSplit_Truncate_End    = 1 << 2,  ///< Truncate trailing delimiters
+        fSplit_Truncate        = fSplit_Truncate_Begin | fSplit_Truncate_End,
+        fSplit_ByPattern       = 1 << 3,  ///< Require full delimiter strings
+        fSplit_CanEscape       = 1 << 4,  ///< Allow \... escaping
+        fSplit_CanSingleQuote  = 1 << 5,  ///< Allow '...' quoting
+        fSplit_CanDoubleQuote  = 1 << 6,  ///< Allow "..." quoting
+        fSplit_CanQuote        = fSplit_CanSingleQuote | fSplit_CanDoubleQuote,
+        /// All delimiters are merged and trimmed, to get non-empty tokens only
+        fSplit_Tokenize        = fSplit_MergeDelimiters | fSplit_Truncate
+    };
+    /// Deprecated flags for Split*() methods.
+    /// @deprecated
+    enum ESplitFlags_DEPRECATED {
+        /// Legacy merge delimiters flag
+        /// Note that it truncates leading and trailing delimiters as well.
+        /// Please use ESplitFlags instead.
+        fSplit_MergeDelims = fSplit_MergeDelimiters | fSplit_Truncate,
+        /// Mo merge the delimiters.
+        /// fSplit_NoMergeDelims can be temporary used for semantics
+        /// purposes only, because we still have legacy Split() version
+        /// without flags, that use fSplit_MergeDelims by default.
+        fSplit_NoMergeDelims = 0
     };
     typedef int TSplitFlags; ///< Bitwise OR of ESplitFlags
 
-    /// Whether to merge adjacent delimiters in Split and Tokenize.
+    /// Whether to merge adjacent delimiters.
+    /// Used by some methods that don't need full functionality of ESplitFlags.
     enum EMergeDelims {
-        eNoMergeDelims,     ///< No merging of delimiters -- default for
-                            ///< Tokenize()
-        eMergeDelims        ///< Merge the delimiters -- default for Split()
+        eMergeDelims   = fSplit_MergeDelims,   ///< Merge the delimiters
+        eNoMergeDelims = fSplit_NoMergeDelims  ///< No merge the delimiters
     };
 
-
     /// Split a string using specified delimiters.
     ///
     /// @param str
     ///   String to be split.
     /// @param delim
-    ///   Delimiter(s) used to split string "str".  The interpretation of
+    ///   Delimiter(s) used to split string "str". The interpretation of
     ///   multi-character values depends on flags: by default, any of those
     ///   characters marks a split point (when unquoted), but with
     ///   fSplit_ByPattern, the entire string must occur.  (Meanwhile,
     ///   an empty value disables splitting.)
     /// @param arr
-    ///   The split tokens are added to the list "arr" and also returned by the
-    ///   function.  NB: in the fully CTempString-based variant, modifying or
-    ///   destroying the string underlying "str" will invalidate the tokens.
+    ///   The split tokens are added to the list "arr" and also returned
+    ///   by the function.
     /// @param flags
     ///   Flags directing splitting, characterized under ESplitFlags.
     /// @param token_pos
     ///   Optional array for the tokens' positions in "str".
+    /// @attention
+    ///   Modifying source CTempString object or destroying it,
+    ///   will invalidate results.
     /// @return 
     ///   The list "arr" is also returned.
     /// @sa
-    ///   ESplitFlags, Tokenize, SplitInTwo
-    static list<string>& Split(const CTempString& str,
-                               const CTempString& delim,
-                               list<string>& arr,
-                               TSplitFlags   flags = fSplit_MergeDelims,
-                               vector<SIZE_TYPE>* token_pos = NULL);
-
-    static list<string>& Split(const CTempString& str,
-                               const CTempString& delim,
-                               list<string>& arr,
-                               EMergeDelims  merge,
-                               vector<SIZE_TYPE>* token_pos = NULL);
-
-    static list<CTempStringEx>& Split(const CTempString&   str,
-                                      const CTempString&   delim,
-                                      list<CTempStringEx>& arr,
-                                      TSplitFlags flags = fSplit_MergeDelims,
-                                      vector<SIZE_TYPE>*   token_pos = NULL,
-                                      CTempString_Storage* storage = NULL);
-
-    static list<CTempString>& Split(const CTempString& str,
-                                    const CTempString& delim,
-                                    list<CTempString>& arr,
-                                    EMergeDelims       merge = eMergeDelims,
-                                    vector<SIZE_TYPE>* token_pos = NULL);
+    ///   ESplitFlags, SplitInTwo, SplitByPattern
+    static list<string>& Split( const CTempString    str,
+                                const CTempString    delim,
+                                list<string>&        arr,
+                                TSplitFlags          flags, // required
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static vector<string>& Split(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                vector<string>&      arr,
+                                TSplitFlags          flags = 0,
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static list<CTempString>& Split(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                list<CTempString>&   arr,
+                                TSplitFlags          flags, // required
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static vector<CTempString>& Split(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                vector<CTempString>& arr,
+                                TSplitFlags          flags = 0,
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static list<CTempStringEx>& Split(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                list<CTempStringEx>& arr,
+                                TSplitFlags          flags, // required
+                                vector<SIZE_TYPE>*   token_pos = NULL,
+                                CTempString_Storage* storage = NULL);
+
+    static vector<CTempStringEx>& Split(
+                                const CTempString      str,
+                                const CTempString      delim,
+                                vector<CTempStringEx>& arr,
+                                TSplitFlags            flags = 0,
+                                vector<SIZE_TYPE>*     token_pos = NULL,
+                                CTempString_Storage*   storage = NULL);
+
+    /// Variation of Split() wihout flags -- for backward compatibility only.
+    /// @attention
+    ///   Automatically use flags: fSplit_MergeDelimiters | fSplit_Truncate
+    /// @deprecated  Use Split() with TSplitFlags instead
+    inline
+    NCBI_DEPRECATED
+    static list<string>& Split(const CTempString    str,
+                               const CTempString    delim,
+                               list<string>&        arr) {
+        return Split(str, delim, arr, fSplit_MergeDelimiters | fSplit_Truncate);
+    }
+
+    /// Variation of Split() wihout flags -- for backward compatibility only.
+    /// @attention
+    ///   Automatically use flags: fSplit_MergeDelimiters | fSplit_Truncate
+    /// @deprecated  Use Split() with TSplitFlags instead
+    inline
+    NCBI_DEPRECATED
+    static list<CTempStringEx>& Split(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                list<CTempStringEx>& arr) {
+        return Split(str, delim, arr, fSplit_MergeDelimiters | fSplit_Truncate);
+    }
+
+    /// @deprecated  Use Split() with TSplitFlags instead
+    inline
+    NCBI_DEPRECATED
+    static list<string>& Split( const CTempString  str,
+                                const CTempString  delim,
+                                list<string>&      arr,
+                                EMergeDelims       merge,
+                                vector<SIZE_TYPE>* token_pos = NULL)  {
+        return Split(str, delim, arr, (TSplitFlags)merge, token_pos);
+    }
+
+    /// @deprecated  Use Split() with TSplitFlags instead
+    NCBI_DEPRECATED
+    static list<CTempString>& Split(
+                                const CTempString  str,
+                                const CTempString  delim,
+                                list<CTempString>& arr,
+                                EMergeDelims       merge = eMergeDelims,
+                                vector<SIZE_TYPE>* token_pos = NULL);
+
+    /// Split a string into two pieces using the specified delimiters
+    ///
+    /// @param str 
+    ///   String to be split.
+    /// @param delim
+    ///   Delimiters used to split string "str".
+    /// @param str1
+    ///   The sub-string of "str" before the first character of "delim".
+    ///   It will not contain any characters in "delim".
+    ///   Will be empty if "str" begin with a delimiter.
+    /// @param str2
+    ///   The sub-string of "str" after the first character of "delim" found.
+    ///   May contain "delim" characters.
+    ///   Will be empty if "str" had no "delim" characters or ended
+    ///   with the "delim" character.
+    /// @param flags
+    ///   Flags directing splitting, characterized under ESplitFlags.
+    ///   Note, that fSplit_Truncate_End don't have any effect due nature
+    ///   of this method.
+    /// @attention
+    ///   Modifying source CTempString object or destroying it,
+    ///   will invalidate results.
+    /// @return
+    ///   true if a symbol from "delim" was found in "str", false if not.
+    ///   This lets you distinguish when there were no delimiters and when
+    ///   the very last character was the first delimiter.
+    /// @sa
+    ///   ESplitFlags, Split
+    static bool SplitInTwo(const CTempString  str, 
+                           const CTempString  delim,
+                           string&            str1,
+                           string&            str2,
+                           TSplitFlags        flags = 0);
+
+    static bool SplitInTwo(const CTempString  str, 
+                           const CTempString  delim,
+                           CTempString&       str1,
+                           CTempString&       str2,
+                           TSplitFlags        flags = 0);
+
+    static bool SplitInTwo(const CTempString  str, 
+                           const CTempString  delim,
+                           CTempStringEx&     str1,
+                           CTempStringEx&     str2,
+                           TSplitFlags        flags = 0,
+                           CTempString_Storage* storage = NULL);
+
+    /// @deprecated  Use SplitInTwo() with TSplitFlags instead
+    NCBI_DEPRECATED
+    static bool SplitInTwo(const CTempString  str, 
+                           const CTempString  delim,
+                           string&            str1,
+                           string&            str2,
+                           EMergeDelims       merge);
+
+    /// @deprecated  Use SplitInTwo() with TSplitFlags instead
+    NCBI_DEPRECATED
+    static bool SplitInTwo(const CTempString  str, 
+                           const CTempString  delim,
+                           CTempString&       str1,
+                           CTempString&       str2,
+                           EMergeDelims       merge);
+
+
+    /// Variation of Split() wih fSplit_ByPattern flag applied by default
+
+    static list<string>& SplitByPattern(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                list<string>&        arr,
+                                TSplitFlags          flags = 0,
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static vector<string>& SplitByPattern(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                vector<string>&      arr,
+                                TSplitFlags          flags = 0,
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static list<CTempString>& SplitByPattern(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                list<CTempString>&   arr,
+                                TSplitFlags          flags = 0,
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static vector<CTempString>& SplitByPattern(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                vector<CTempString>& arr,
+                                TSplitFlags          flags = 0,
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static list<CTempStringEx>& SplitByPattern(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                list<CTempStringEx>& arr,
+                                TSplitFlags          flags = 0,
+                                vector<SIZE_TYPE>*   token_pos = NULL);
+
+    static vector<CTempStringEx>& SplitByPattern(
+                                const CTempString    str,
+                                const CTempString    delim,
+                                vector<CTempStringEx>& arr,
+                                TSplitFlags          flags = 0,
+                                vector<SIZE_TYPE>*   token_pos = NULL);
 
     /// Tokenize a string using the specified set of char delimiters.
     ///
@@ -2379,109 +2651,72 @@ public:
     ///   an empty value disables splitting.)
     /// @param arr
     ///   The tokens defined in "str" by using symbols from "delim" are added
-    ///   to the vector "arr" and also returned by the function.  NB: in the
-    ///   fully CTempString-based variant, modifying or destroying the string
-    ///   underlying "str" will invalidate the tokens.
+    ///   to the vector "arr" and also returned by the function.
     /// @param flags
     ///   Flags directing splitting, characterized under ESplitFlags.
     /// @param token_pos
     ///   Optional array for the tokens' positions in "str".
+    /// @attention
+    ///   Modifying source CTempString object or destroying it,
+    ///   will invalidate results.
     /// @return 
     ///   The vector "arr" is also returned.
     /// @sa
-    ///   ESplitFlags, Split, SplitInTwo
-    static vector<string>& Tokenize(const CTempString& str,
-                                    const CTempString& delim,
+    ///   ESplitFlags, Split, SplitInTwo, SplitByPattern
+
+    /// @deprecated  Use Split() instead
+    NCBI_DEPRECATED
+    static vector<string>& Tokenize(const CTempString  str,
+                                    const CTempString  delim,
                                     vector<string>&    arr,
                                     TSplitFlags        flags = 0,
                                     vector<SIZE_TYPE>* token_pos = NULL);
 
-    static vector<string>& Tokenize(const CTempString& str,
-                                    const CTempString& delim,
+    /// @deprecated  Use Split() instead
+    NCBI_DEPRECATED
+    static vector<string>& Tokenize(const CTempString  str,
+                                    const CTempString  delim,
                                     vector<string>&    arr,
                                     EMergeDelims       merge,
                                     vector<SIZE_TYPE>* token_pos = NULL);
 
+    /// @deprecated  Use Split() instead
+    NCBI_DEPRECATED
     static
-    vector<CTempStringEx>& Tokenize(const CTempString&     str,
-                                    const CTempString&     delim,
+    vector<CTempStringEx>& Tokenize(const CTempString      str,
+                                    const CTempString      delim,
                                     vector<CTempStringEx>& arr,
                                     TSplitFlags            flags = 0,
                                     vector<SIZE_TYPE>*     token_pos = NULL,
                                     CTempString_Storage*   storage = NULL);
 
+    /// @deprecated  Use Split() instead
+    NCBI_DEPRECATED
     static
-    vector<CTempString>& Tokenize(const CTempString&   str,
-                                  const CTempString&   delim,
-                                  vector<CTempString>& arr,
-                                  EMergeDelims         merge = eNoMergeDelims,
-                                  vector<SIZE_TYPE>*   token_pos = NULL);
+    vector<CTempString>& Tokenize(  const CTempString    str,
+                                    const CTempString    delim,
+                                    vector<CTempString>& arr,
+                                    EMergeDelims         merge = eNoMergeDelims,
+                                    vector<SIZE_TYPE>*   token_pos = NULL);
 
+    /// @deprecated  Use SplitByPattern() instead
+    NCBI_DEPRECATED
     static
-    vector<string>& TokenizePattern(const CTempString& str,
-                                    const CTempString& delim,
+    vector<string>& TokenizePattern(const CTempString  str,
+                                    const CTempString  delim,
                                     vector<string>&    arr,
                                     EMergeDelims       merge = eNoMergeDelims,
                                     vector<SIZE_TYPE>* token_pos = NULL);
 
+    /// @deprecated  Use SplitByPattern() instead
+    NCBI_DEPRECATED
     static
-    vector<CTempString>& TokenizePattern(const CTempString&   str,
-                                         const CTempString&   delim,
-                                         vector<CTempString>& arr,
-                                         EMergeDelims merge = eNoMergeDelims,
-                                         vector<SIZE_TYPE>* token_pos = NULL);
-
-    /// Split a string into two pieces using the specified delimiters
-    ///
-    /// @param str 
-    ///   String to be split.
-    /// @param delim
-    ///   Delimiters used to split string "str".
-    /// @param str1
-    ///   The sub-string of "str" before the first character of "delim".
-    ///   It will not contain any characters in "delim".
-    ///   Will be empty if "str" begin with a "delim" character.
-    ///   If a CTempString object itself, any changes to the string
-    ///   underlying "str" will invalidate it (and "str2").
-    /// @param str2
-    ///   The sub-string of "str" after the first character of "delim" found.
-    ///   May contain "delim" characters.
-    ///   Will be empty if "str" had no "delim" characters or ended
-    ///   with the first "delim" character.
-    ///   If a CTempString object itself, any changes to the string
-    ///   underlying "str" will invalidate it (and "str1").
-    /// @param flags
-    ///   Flags directing splitting, characterized under ESplitFlags.
-    /// @return
-    ///   true if a symbol from "delim" was found in "str", false if not.
-    ///   This lets you distinguish when there were no delimiters and when
-    ///   the very last character was the first delimiter.
-    /// @sa
-    ///   ESplitFlags, Split, Tokenize
-    static bool SplitInTwo(const CTempString& str, 
-                           const CTempString& delim,
-                           string&            str1,
-                           string&            str2,
-                           TSplitFlags        flags = 0);
-
-    static bool SplitInTwo(const CTempString& str, 
-                           const CTempString& delim,
-                           string&            str1,
-                           string&            str2,
-                           EMergeDelims       merge);
-
-    static bool SplitInTwo(const CTempString& str, 
-                           const CTempString& delim,
-                           CTempStringEx&     str1,
-                           CTempStringEx&     str2,
-                           TSplitFlags        flags = 0,
-                           CTempString_Storage* storage = NULL);
-
-    static bool SplitInTwo(const CTempString& str, 
-                           const CTempString& delim,
-                           CTempString&       str1,
-                           CTempString&       str2,
-                           EMergeDelims       merge = eNoMergeDelims);
+    vector<CTempString>& TokenizePattern(
+                                    const CTempString    str,
+                                    const CTempString    delim,
+                                    vector<CTempString>& arr,
+                                    EMergeDelims         merge = eNoMergeDelims,
+                                    vector<SIZE_TYPE>*   token_pos = NULL);
 
 
     /// Join strings using the specified delimiter.
@@ -2493,12 +2728,13 @@ public:
     /// @return 
     ///   The strings in "arr" are joined into a single string, separated
     ///   with "delim".
-    static string Join(const list<string>& arr,        const CTempString& delim);
-    static string Join(const list<CTempString>& arr,   const CTempString& delim);
-    static string Join(const vector<string>& arr,      const CTempString& delim);
-    static string Join(const vector<CTempString>& arr, const CTempString& delim);
-    static string Join(const set<string>& arr,         const CTempString& delim);
-    static string Join(const set<CTempString>& arr,    const CTempString& delim);
+    /// @sa Split
+    static string Join(const list<string>& arr,        const CTempString delim);
+    static string Join(const list<CTempString>& arr,   const CTempString delim);
+    static string Join(const vector<string>& arr,      const CTempString delim);
+    static string Join(const vector<CTempString>& arr, const CTempString delim);
+    static string Join(const set<string>& arr,         const CTempString delim);
+    static string Join(const set<CTempString>& arr,    const CTempString delim);
 
 
     /// How to display printable strings.
@@ -2537,19 +2773,19 @@ public:
     ///   Return a printable version of "str".
     /// @sa
     ///   ParseEscapes, CEncode, CParse, Sanitize
-    static string PrintableString(const CTempString& str,
-                                  TPrintableMode     mode =
+    static string PrintableString(const CTempString str,
+                                  TPrintableMode    mode =
                                   fNewLine_Quote | fNonAscii_Passthru);
 
     /// Flags for Sanitize().
     enum ESS_Flags {
         // Character filters (if no filters are set, then use fSS_print)
-        fSS_alpha = 1 << 1,    ///< Check on ::isalpha()
-        fSS_digit = 1 << 2,    ///< Check on ::isdigit()
-        fSS_alnum = 1 << 3,    ///< Check on ::isalnum()
-        fSS_print = 1 << 4,    ///< Check on ::isprint()
-        fSS_cntrl = 1 << 5,    ///< Check on ::iscntrl()
-        fSS_punct = 1 << 6,    ///< Check on ::ispunct()
+        fSS_alpha = 1 << 0,    ///< Check on ::isalpha()
+        fSS_digit = 1 << 1,    ///< Check on ::isdigit()
+        fSS_alnum = 1 << 2,    ///< Check on ::isalnum()
+        fSS_print = 1 << 3,    ///< Check on ::isprint()
+        fSS_cntrl = 1 << 4,    ///< Check on ::iscntrl()
+        fSS_punct = 1 << 5,    ///< Check on ::ispunct()
 
         // Filter: in or out?
         fSS_Reject = 1 << 11,  ///< Reject specified characters, allow all other.
@@ -2624,7 +2860,7 @@ public:
     ///     see eEscSeqRange* modes for behavior. 
     /// @sa 
     ///   EEscSeqFlags, PrintableString, CEncode, CParse
-    static string ParseEscapes(const CTempString& str, 
+    static string ParseEscapes(const CTempString str, 
                                EEscSeqRange mode = eEscSeqRange_Standard,
                                char user_char = '?');
 
@@ -2638,7 +2874,7 @@ public:
     /// @return
     ///   The extracted string, un-escaped and with the quotes removed.
     ///   Throw an exception on format error.
-    static string ParseQuoted(const CTempString& str, size_t* n_read = NULL);
+    static string ParseQuoted(const CTempString str, size_t* n_read = NULL);
 
     /// Define that string is quoted or not.
     enum EQuoted {
@@ -2654,7 +2890,7 @@ public:
     ///   Define, to 
     /// @sa
     ///   CParse, PrintableString
-    static string CEncode(const CTempString& str, EQuoted quoted = eQuoted);
+    static string CEncode(const CTempString str, EQuoted quoted = eQuoted);
 
     /// Discard C-style backslash escapes.
     ///
@@ -2669,14 +2905,14 @@ public:
     ///   String with parsed C-style escape sequences.
     /// @sa
     ///   CEncode
-    static string CParse(const CTempString& str, EQuoted quoted = eQuoted);
+    static string CParse(const CTempString str, EQuoted quoted = eQuoted);
 
     /// Encode a string for JavaScript.
     ///
     /// Replace relevant characters by predefined entities.
     /// Like to PrintableString(), but process some symbols in different way.
     /// @sa PrintableString
-    static string JavaScriptEncode(const CTempString& str);
+    static string JavaScriptEncode(const CTempString str);
 
     /// XML-encode flags
     enum EXmlEncode {
@@ -2690,7 +2926,7 @@ public:
     /// Encode a string for XML.
     ///
     /// Replace relevant characters by predefined entities.
-    static string XmlEncode(const CTempString& str,
+    static string XmlEncode(const CTempString str,
                             EXmlEncode flags = eXmlEnc_Contents);
 
 
@@ -2708,7 +2944,7 @@ public:
     /// Encode a string for HTML.
     ///
     /// Replace relevant characters by predefined entities.
-    static string HtmlEncode(const CTempString& str,
+    static string HtmlEncode(const CTempString str,
                              THtmlEncode flags = fHtmlEnc_EncodeAll);
 
     /// HTML-decode flags
@@ -2720,7 +2956,7 @@ public:
     typedef int THtmlDecode;   //<  bitwise OR of "EHtmlDecode"
 
     /// Decode HTML entities and character references.
-    static string HtmlDecode(const CTempString& str,
+    static string HtmlDecode(const CTempString str,
                              EEncoding encoding = eEncoding_Unknown,
                              THtmlDecode* result_flags = NULL);
 
@@ -2730,7 +2966,7 @@ public:
     static string HtmlEntity(TUnicodeSymbol uch);
 
     /// Encode a string for JSON.
-    static string JsonEncode(const CTempString& str);
+    static string JsonEncode(const CTempString str);
 
     /// Quotes a string in Bourne Again Shell (BASH) syntax, in a way
     /// that disallows non-printable characters in the result.
@@ -2772,7 +3008,7 @@ public:
         eUrlDec_Percent           ///< Decode only %XX
     };
     /// URL-encode string
-    static string URLEncode(const CTempString& str,
+    static string URLEncode(const CTempString str,
                             EUrlEncode flag = eUrlEnc_SkipMarkChars);
 
     /// SQL-encode string
@@ -2793,23 +3029,23 @@ public:
     static CStringUTF8 SQLEncode(const CStringUTF8& str);
 
     /// URL-decode string
-    static string URLDecode(const CTempString& str,
+    static string URLDecode(const CTempString str,
                             EUrlDecode flag = eUrlDec_All);
     /// URL-decode string to itself
     static void URLDecodeInPlace(string& str,
                                  EUrlDecode flag = eUrlDec_All);
     /// Check if the string needs the requested URL-encoding
-    static bool NeedsURLEncoding(const CTempString& str,
+    static bool NeedsURLEncoding(const CTempString str,
                                 EUrlEncode flag = eUrlEnc_SkipMarkChars);
 
     /// Check if the string contains a valid IP address
-    static bool IsIPAddress(const CTempStringEx& str);
+    static bool IsIPAddress(const CTempStringEx str);
 
 
     /// How to wrap the words in a string to a new line.
     enum EWrapFlags {
         fWrap_Hyphenate  = 0x1, ///< Add a hyphen when breaking words?
-        fWrap_HTMLPre    = 0x2, ///< Wrap as preformatted HTML?
+        fWrap_HTMLPre    = 0x2, ///< Wrap as pre-formatted HTML?
         fWrap_FlatFile   = 0x4  ///< Wrap for flat file use.
     };
     typedef int TWrapFlags;     ///< Bitwise OR of "EWrapFlags"
@@ -2966,23 +3202,23 @@ public:
     ///   The prefix string for the first line, if non-NULL.
     /// @return
     ///   Return "par", the list of justified lines (a paragraph).
-    static list<string>& Justify(const CTempString& str,
+    static list<string>& Justify(const CTempString  str,
                                  SIZE_TYPE          width,
                                  list<string>&      par,
                                  const CTempString* pfx  = 0,
                                  const CTempString* pfx1 = 0);
 
-    static list<string>& Justify(const CTempString& str,
+    static list<string>& Justify(const CTempString  str,
                                  SIZE_TYPE          width,
                                  list<string>&      par,
-                                 const CTempString& pfx,
+                                 const CTempString  pfx,
                                  const CTempString* pfx1 = 0);
 
-    static list<string>& Justify(const CTempString& str,
+    static list<string>& Justify(const CTempString  str,
                                  SIZE_TYPE          width,
                                  list<string>&      par,
-                                 const CTempString& pfx,
-                                 const CTempString& pfx1);
+                                 const CTempString  pfx,
+                                 const CTempString  pfx1);
 
 
     /// Search for a field.
@@ -2999,10 +3235,10 @@ public:
     ///   Found field; or empty string if the required field is not found.
     /// @note
     ///   Field 0 spans up to the first-found delimiter or the end-of-string.
-    static string GetField(const CTempString& str,
-                           size_t             field_no,
-                           const CTempString& delimiters,
-                           EMergeDelims       merge = eNoMergeDelims);
+    static string GetField(const CTempString str,
+                           size_t            field_no,
+                           const CTempString delimiters,
+                           EMergeDelims      merge = eNoMergeDelims);
 
     /// Search for a field.
     ///
@@ -3018,10 +3254,10 @@ public:
     ///   Found field; or empty string if the required field is not found.
     /// @note
     ///   Field 0 spans up to the delimiter or the end-of-string.
-    static string GetField(const CTempString& str,
-                           size_t             field_no,
-                           char               delimiter,
-                           EMergeDelims       merge = eNoMergeDelims);
+    static string GetField(const CTempString str,
+                           size_t            field_no,
+                           char              delimiter,
+                           EMergeDelims      merge = eNoMergeDelims);
 
     /// Search for a field.
     /// Avoid memory allocation at the expense of some usage safety.
@@ -3042,10 +3278,10 @@ public:
     ///   The return value stores a pointer to the input string 'str' so
     ///   the return object validity time matches lifetime of the input 'str'.
     static
-    CTempString GetField_Unsafe(const CTempString& str,
-                                size_t             field_no,
-                                const CTempString& delimiters,
-                                EMergeDelims       merge = eNoMergeDelims);
+    CTempString GetField_Unsafe(const CTempString str,
+                                size_t            field_no,
+                                const CTempString delimiters,
+                                EMergeDelims      merge = eNoMergeDelims);
 
     /// Search for a field.
     /// Avoid memory allocation at the expense of some usage safety.
@@ -3066,10 +3302,10 @@ public:
     ///   The return value stores a pointer to the input string 'str' so
     ///   the return object validity time matches lifetime of the input 'str'.
     static
-    CTempString GetField_Unsafe(const CTempString& str,
-                                size_t             field_no,
-                                char               delimiter,
-                                EMergeDelims       merge = eNoMergeDelims);
+    CTempString GetField_Unsafe(const CTempString str,
+                                size_t            field_no,
+                                char              delimiter,
+                                EMergeDelims      merge = eNoMergeDelims);
 
     // Template class for better error messages
     // from unimplemented template methods
@@ -3139,9 +3375,9 @@ public:
     ///   Character encoding of the source string
     /// @param validate
     ///   Verify the character encoding of the source
-    static CStringUTF8 AsUTF8(const CTempString& src,
-                              EEncoding          encoding,
-                              EValidate          validate = eNoValidate);
+    static CStringUTF8 AsUTF8(const CTempString src,
+                              EEncoding         encoding,
+                              EValidate         validate = eNoValidate);
 
     /// Convert into UTF8 from a Unicode C++ string
     ///
@@ -3223,10 +3459,10 @@ public:
     ///   Verify the character encoding of the source
     /// return
     ///   reference to modified dest string
-    static CStringUTF8& AppendAsUTF8(CStringUTF8&       dest,
-                                     const CTempString& src,
-                                     EEncoding          encoding, 
-                                     EValidate          validate = eNoValidate);
+    static CStringUTF8& AppendAsUTF8(CStringUTF8&      dest,
+                                     const CTempString src,
+                                     EEncoding         encoding, 
+                                     EValidate         validate = eNoValidate);
 
     /// Convert non-Unicode character into UTF8 and append it to existing string
     ///
@@ -3262,8 +3498,8 @@ public:
     /// @return
     ///   C++ string
     static string AsSingleByteString
-    (const CTempString& src, EEncoding encoding,
-     const char* substitute_on_error = 0, EValidate validate = eNoValidate);
+        (const CTempString src, EEncoding encoding,
+         const char* substitute_on_error = 0, EValidate validate = eNoValidate);
 
     /// Convert UTF8 string into Unicode
     ///
@@ -3281,10 +3517,10 @@ public:
     ///   Only for TStringUnicode, TStringUCS4, TStringUCS2, wstring types
     template <typename TChar>
     static basic_string<TChar> AsBasicString
-        (const CTempString& src,
+        (const CTempString src,
          const TChar* substitute_on_error, EValidate validate = eNoValidate);
     template <typename TChar>
-    static basic_string<TChar> AsBasicString(const CTempString& src);
+    static basic_string<TChar> AsBasicString(const CTempString src);
 
     /// Get the number of symbols (code points) in UTF8 string
     ///
@@ -3292,7 +3528,7 @@ public:
     ///   Source UTF8 string   
     /// @return
     ///   Number of symbols (code points)
-    static SIZE_TYPE GetSymbolCount(const CTempString& src);
+    static SIZE_TYPE GetSymbolCount(const CTempString src);
 
     /// Get the number of valid UTF-8 symbols (code points) in buffer
     ///
@@ -3300,7 +3536,7 @@ public:
     ///   Character buffer
     /// @return
     ///   Number of valid symbols (no exception thrown)
-    static SIZE_TYPE GetValidSymbolCount(const CTempString& src);
+    static SIZE_TYPE GetValidSymbolCount(const CTempString src);
 
     /// Get the number of valid UTF-8 bytes (code units) in buffer
     ///
@@ -3308,7 +3544,7 @@ public:
     ///   Character buffer
     /// @return
     ///   Number of valid bytes (no exception thrown)
-    static SIZE_TYPE GetValidBytesCount(const CTempString& src);
+    static SIZE_TYPE GetValidBytesCount(const CTempString src);
 
     /// Check the encoding of the C/C++ string
     ///
@@ -3320,7 +3556,7 @@ public:
     ///   Character encoding form to check against
     /// @return
     ///   Boolean result: encoding is same or compatible
-    static bool MatchEncoding(const CTempString& src, EEncoding encoding);
+    static bool MatchEncoding(const CTempString src, EEncoding encoding);
     
     /// Guess the encoding of the C/C++ string
     ///
@@ -3329,7 +3565,7 @@ public:
     ///   Character buffer
     /// @return
     ///   Encoding as guessed;  eEncoding_Unknown if cannot guess
-    static EEncoding GuessEncoding(const CTempString& src);
+    static EEncoding GuessEncoding(const CTempString src);
 
     /// Give Encoding name as string
     ///
@@ -3346,7 +3582,7 @@ public:
     ///   Name of the encoding
     /// @return
     ///   EEncoding enum;  eEncoding_Unknown for unsupported encodings
-    static EEncoding StringToEncoding(const CTempString& encoding_name);
+    static EEncoding StringToEncoding(const CTempString encoding_name);
 
     /// Convert encoded character into Unicode
     ///
@@ -3401,7 +3637,7 @@ public:
     /// @sa
     ///   IsWhiteSpace, TruncateSpacesInPlace, TruncateSpaces_Unsafe
     static CStringUTF8 TruncateSpaces
-    (const CTempString& str, NStr::ETrunc side = NStr::eTrunc_Both);
+        (const CTempString str, NStr::ETrunc side = NStr::eTrunc_Both);
 
     /// Truncate spaces in the string
     ///
@@ -3417,7 +3653,7 @@ public:
     /// @sa
     ///   IsWhiteSpace, TruncateSpacesInPlace, TruncateSpaces
     static CTempString TruncateSpaces_Unsafe
-    (const CTempString& str, NStr::ETrunc side = NStr::eTrunc_Both);
+        (const CTempString str, NStr::ETrunc side = NStr::eTrunc_Both);
 
     /// Convert sequence of UTF8 code units into Unicode code point
     ///
@@ -3458,13 +3694,13 @@ public:
     static TUnicodeSymbol DecodeNext(TUnicodeSymbol chU, char ch);
 
 private:
-    static void x_Validate(const CTempString& str);
+    static void x_Validate(const CTempString str);
     static SIZE_TYPE x_GetValidSymbolCount
-    (const CTempString& src, CTempString::const_iterator& err);
+        (const CTempString src, CTempString::const_iterator& err);
 
     static CStringUTF8& x_AppendChar(CStringUTF8& u8str, TUnicodeSymbol ch);
 
-    static CStringUTF8& x_Append(CStringUTF8& u8str, const CTempString& src,
+    static CStringUTF8& x_Append(CStringUTF8& u8str, const CTempString src,
                                  EEncoding encoding, EValidate validate);
 
     template <typename TIterator>
@@ -3477,8 +3713,8 @@ private:
 
     template <typename TChar>
     static basic_string<TChar> x_AsBasicString
-    (const CTempString& src,
-     const TChar* substitute_on_error, EValidate validate);
+        (const CTempString src,
+         const TChar* substitute_on_error, EValidate validate);
     
     template <typename TIterator>
     static TUnicodeSymbol x_Decode(TIterator& src);
@@ -3488,7 +3724,7 @@ private:
     static bool   x_EvalNext(char ch);
 
     // returns part of the string around an error in Utf8 encoding
-    static CTempString x_GetErrorFragment(const CTempString& src);
+    static CTempString x_GetErrorFragment(const CTempString src);
 
     template<class Type> class CNotImplemented {};
     friend class CStringUTF8_DEPRECATED;
@@ -3655,7 +3891,7 @@ public:
     };
     /// Decode the string. Must throw CStringException if the source string
     /// is not valid.
-    virtual string Decode(const CTempString& src, EStringType stype) const = 0;
+    virtual string Decode(const CTempString src, EStringType stype) const = 0;
     virtual ~IStringDecoder(void) {}
 };
 
@@ -3670,7 +3906,7 @@ public:
         eValue
     };
     /// Encode the string.
-    virtual string Encode(const CTempString& src, EStringType stype) const = 0;
+    virtual string Encode(const CTempString src, EStringType stype) const = 0;
     virtual ~IStringEncoder(void) {}
 };
 
@@ -3681,7 +3917,7 @@ class NCBI_XNCBI_EXPORT CStringDecoder_Url : public IStringDecoder
 public:
     CStringDecoder_Url(NStr::EUrlDecode flag = NStr::eUrlDec_All);
 
-    virtual string Decode(const CTempString& src, EStringType stype) const;
+    virtual string Decode(const CTempString src, EStringType stype) const;
 
 private:
     NStr::EUrlDecode m_Flag;
@@ -3694,7 +3930,7 @@ class NCBI_XNCBI_EXPORT CStringEncoder_Url : public IStringEncoder
 public:
     CStringEncoder_Url(NStr::EUrlEncode flag = NStr::eUrlEnc_SkipMarkChars);
 
-    virtual string Encode(const CTempString& src, EStringType stype) const;
+    virtual string Encode(const CTempString src, EStringType stype) const;
 
 private:
     NStr::EUrlEncode m_Flag;
@@ -3748,12 +3984,12 @@ public:
     ///   String encoder (Url, Xml etc.)
     /// @param own_encoder
     ///   Encoder ownership flag
-    CStringPairs(const CTempString& arg_sep,
-                 const CTempString& val_sep,
-                 IStringDecoder*    decoder = NULL,
-                 EOwnership         own_decoder = eTakeOwnership,
-                 IStringEncoder*    encoder = NULL,
-                 EOwnership         own_encoder = eTakeOwnership)
+    CStringPairs(const CTempString arg_sep,
+                 const CTempString val_sep,
+                 IStringDecoder*   decoder = NULL,
+                 EOwnership        own_decoder = eTakeOwnership,
+                 IStringEncoder*   encoder = NULL,
+                 EOwnership        own_encoder = eTakeOwnership)
         : m_ArgSep(arg_sep),
           m_ValSep(val_sep),
           m_Decoder(decoder, own_decoder),
@@ -3810,7 +4046,7 @@ public:
     /// @param merge_argsep
     ///   Flag for merging separators between pairs. By default the separators
     ///   are merged to prevent pairs where both name and value are empty.
-    void Parse(const CTempString& str,
+    void Parse(const CTempString str,
                NStr::EMergeDelims merge_argsep = NStr::eMergeDelims)
     {
         Parse(m_Data, str, m_ArgSep, m_ValSep,
@@ -3834,16 +4070,16 @@ public:
     ///   Flag for merging separators between pairs. By default the separators
     ///   are merged to prevent pairs where both name and value are empty.
     static void Parse(TStrPairs&         pairs,
-                      const CTempString& str,
-                      const CTempString& arg_sep,
-                      const CTempString& val_sep,
+                      const CTempString  str,
+                      const CTempString  arg_sep,
+                      const CTempString  val_sep,
                       IStringDecoder*    decoder = NULL,
                       EOwnership         own = eTakeOwnership,
                       NStr::EMergeDelims merge_argsep = NStr::eMergeDelims)
     {
         AutoPtr<IStringDecoder> decoder_guard(decoder, own);
         list<string> lst;
-        NStr::Split(str, arg_sep, lst, merge_argsep);
+        NStr::Split(str, arg_sep, lst, (NStr::TSplitFlags)merge_argsep);
         pairs.clear();
         ITERATE(list<string>, it, lst) {
             string name, val;
@@ -3938,11 +4174,11 @@ class NCBI_XNCBI_EXPORT CEncodedString
 {
 public:
     CEncodedString(void) {}
-    CEncodedString(const CTempString& s,
+    CEncodedString(const CTempString s,
                    NStr::EUrlEncode flag = NStr::eUrlEnc_SkipMarkChars);
 
     /// Set new original string
-    void SetString(const CTempString& s,
+    void SetString(const CTempString s,
                    NStr::EUrlEncode flag = NStr::eUrlEnc_SkipMarkChars);
 
     /// Check if the original string was encoded.
@@ -3958,7 +4194,7 @@ public:
 
 private:
     string           m_Original;
-    auto_ptr<string> m_Encoded;
+    unique_ptr<string> m_Encoded;
 };
 
 
@@ -4077,7 +4313,7 @@ typedef PNocase_Conditional_Generic<const char *> PNocase_Conditional_CStr;
 ///
 struct PQuickStringLess
 {
-    bool operator()(const CTempString& s1, const CTempString& s2) const {
+    bool operator()(const CTempString s1, const CTempString s2) const {
         size_t len1 = s1.size(), len2 = s2.size();
         return len1 < len2 ||
             (len1 == len2 && ::memcmp(s1.data(), s2.data(), len1) < 0);
@@ -4155,14 +4391,14 @@ void NStr::NumericToString(string& /*out_str*/, TNumeric /*value*/,
 }
 
 template <typename TNumeric> inline
-TNumeric NStr::StringToNumeric(const CTempString& /*str*/, 
+TNumeric NStr::StringToNumeric(const CTempString /*str*/, 
                                TStringToNumFlags /*flags*/, int /*base*/)
 {
     return CNotImplemented<TNumeric>::StringToNumeric_is_not_implemented_for_non_numeric_types();
 }
 
 template <typename TNumeric> inline
-bool NStr::StringToNumeric(const CTempString& /*str*/, TNumeric* /*value*/,
+bool NStr::StringToNumeric(const CTempString /*str*/, TNumeric* /*value*/,
                            TStringToNumFlags /*flags*/, int /*base*/)
 {
     return CNotImplemented<TNumeric>::StringToNumeric_is_not_implemented_for_non_numeric_types();
@@ -4199,7 +4435,7 @@ void NStr::NumericToString(string& out_str, unsigned char value,
 }
 
 template<> inline
-char NStr::StringToNumeric(const CTempString& str,
+char NStr::StringToNumeric(const CTempString str,
                            TStringToNumFlags flags, int base)
 {
     int n = StringToInt(str, flags, base);
@@ -4216,7 +4452,7 @@ char NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-unsigned char NStr::StringToNumeric(const CTempString& str,
+unsigned char NStr::StringToNumeric(const CTempString str,
                                     TStringToNumFlags flags, int base)
 {
     unsigned int n = StringToUInt(str, flags, base);
@@ -4233,7 +4469,7 @@ unsigned char NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            char* value, TStringToNumFlags flags, int base)
 {
     int n = StringToInt(str, flags, base);
@@ -4255,7 +4491,7 @@ bool NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            unsigned char* value, TStringToNumFlags flags, int base)
 {
     unsigned int n = StringToUInt(str, flags, base);
@@ -4293,7 +4529,7 @@ void NStr::NumericToString(string& out_str, wchar_t value,
 }
 
 template<> inline
-wchar_t NStr::StringToNumeric(const CTempString& str,
+wchar_t NStr::StringToNumeric(const CTempString str,
                               TStringToNumFlags flags, int base)
 {
     int n = StringToInt(str, flags, base);
@@ -4310,7 +4546,7 @@ wchar_t NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            wchar_t* value, TStringToNumFlags flags, int base)
 {
     int n = StringToInt(str, flags, base);
@@ -4362,7 +4598,7 @@ void NStr::NumericToString(string& out_str, unsigned short value,
 }
 
 template<> inline
-short NStr::StringToNumeric(const CTempString& str,
+short NStr::StringToNumeric(const CTempString str,
                             TStringToNumFlags flags, int base)
 {
     int n = StringToInt(str, flags, base);
@@ -4379,7 +4615,7 @@ short NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-unsigned short NStr::StringToNumeric(const CTempString& str,
+unsigned short NStr::StringToNumeric(const CTempString str,
                                      TStringToNumFlags flags, int base)
 {
     unsigned int n = StringToUInt(str, flags, base);
@@ -4396,7 +4632,7 @@ unsigned short NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            short* value, TStringToNumFlags flags, int base)
 {
     int n = StringToInt(str, flags, base);
@@ -4418,7 +4654,7 @@ bool NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            unsigned short* value, TStringToNumFlags flags, int base)
 {
     unsigned int n = StringToUInt(str, flags, base);
@@ -4470,21 +4706,21 @@ void NStr::NumericToString(string& out_str, unsigned int value,
 }
 
 template<> inline
-int NStr::StringToNumeric(const CTempString& str,
+int NStr::StringToNumeric(const CTempString str,
                           TStringToNumFlags flags, int base)
 {
     return StringToInt(str, flags, base);
 }
 
 template<> inline
-unsigned int NStr::StringToNumeric(const CTempString& str,
+unsigned int NStr::StringToNumeric(const CTempString str,
                                    TStringToNumFlags flags, int base)
 {
     return StringToUInt(str, flags, base);
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            int* value, TStringToNumFlags flags, int base)
 {
     *value = StringToInt(str, flags, base);
@@ -4492,7 +4728,7 @@ bool NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            unsigned int* value, TStringToNumFlags flags, int base)
 {
     *value = StringToUInt(str, flags, base);
@@ -4530,21 +4766,21 @@ void NStr::NumericToString(string& out_str, unsigned long value,
 }
 
 template<> inline
-long NStr::StringToNumeric(const CTempString& str,
+long NStr::StringToNumeric(const CTempString str,
                            TStringToNumFlags flags, int base)
 {
     return StringToLong(str, flags, base);
 }
 
 template<> inline
-unsigned long NStr::StringToNumeric(const CTempString& str,
+unsigned long NStr::StringToNumeric(const CTempString str,
                                     TStringToNumFlags flags, int base)
 {
     return StringToULong(str, flags, base);
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            long* value, TStringToNumFlags flags, int base)
 {
     *value = StringToLong(str, flags, base);
@@ -4552,7 +4788,7 @@ bool NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            unsigned long* value, TStringToNumFlags flags, int base)
 {
     *value = StringToULong(str, flags, base);
@@ -4591,21 +4827,21 @@ void NStr::NumericToString(string& out_str, Uint8 value,
 }
 
 template<> inline
-Int8 NStr::StringToNumeric(const CTempString& str,
+Int8 NStr::StringToNumeric(const CTempString str,
                            TStringToNumFlags flags, int base)
 {
     return StringToInt8(str, flags, base);
 }
 
 template<> inline
-Uint8 NStr::StringToNumeric(const CTempString& str,
+Uint8 NStr::StringToNumeric(const CTempString str,
                             TStringToNumFlags flags, int base)
 {
     return StringToUInt8(str, flags, base);
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            Int8* value, TStringToNumFlags flags, int base)
 {
     *value = StringToInt8(str, flags, base);
@@ -4613,7 +4849,7 @@ bool NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            Uint8* value, TStringToNumFlags flags, int base)
 {
     *value = StringToUInt8(str, flags, base);
@@ -4651,21 +4887,21 @@ void NStr::NumericToString(string& out_str, unsigned long long value,
 }
 
 template<> inline
-long long NStr::StringToNumeric(const CTempString& str,
+long long NStr::StringToNumeric(const CTempString str,
                                 TStringToNumFlags flags, int base)
 {
     return StringToInt8(str, flags, base);
 }
 
 template<> inline
-unsigned long long NStr::StringToNumeric(const CTempString& str,
+unsigned long long NStr::StringToNumeric(const CTempString str,
                                          TStringToNumFlags flags, int base)
 {
     return StringToUInt8(str, flags, base);
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            long long* value, TStringToNumFlags flags, int base)
 {
     *value = StringToInt8(str, flags, base);
@@ -4673,7 +4909,7 @@ bool NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            unsigned long long* value, TStringToNumFlags flags, int base)
 {
     *value = StringToUInt8(str, flags, base);
@@ -4698,7 +4934,7 @@ void NStr::NumericToString(string& out_str, float value,
 }
 
 template<> inline
-float NStr::StringToNumeric(const CTempString& str,
+float NStr::StringToNumeric(const CTempString str,
                             TStringToNumFlags flags, int /*base*/)
 {
     double n = StringToDouble(str, flags);
@@ -4716,7 +4952,7 @@ float NStr::StringToNumeric(const CTempString& str,
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            float* value, TStringToNumFlags flags, int /*base*/)
 {
     double n = StringToDouble(str, flags);
@@ -4755,14 +4991,14 @@ void NStr::NumericToString(string& out_str, double value,
 }
 
 template<> inline
-double NStr::StringToNumeric(const CTempString& str,
+double NStr::StringToNumeric(const CTempString str,
                              TStringToNumFlags flags, int /*base*/)
 {
     return StringToDouble(str, flags);
 }
 
 template<> inline
-bool NStr::StringToNumeric(const CTempString& str,
+bool NStr::StringToNumeric(const CTempString str,
                            double* value, TStringToNumFlags flags, int /*base*/)
 {
     *value = StringToDouble(str, flags);
@@ -4788,14 +5024,14 @@ void NStr::NumericToString(string& out_str, TGi value,
 }
 
 template <> inline
-TGi NStr::StringToNumeric(const CTempString& str, 
+TGi NStr::StringToNumeric(const CTempString str, 
                           TStringToNumFlags flags, int base)
 {
     return StringToNumeric<TIntId>(str, flags, base);
 }
 
 template <> inline
-bool NStr::StringToNumeric(const CTempString& str, TGi* value,
+bool NStr::StringToNumeric(const CTempString str, TGi* value,
                            TStringToNumFlags flags, int base)
 {
     return StringToNumeric(str, reinterpret_cast<TIntId*>(value), flags, base);
@@ -5155,25 +5391,19 @@ int NStr::CompareNocase(const char* s1, const char* s2)
 }
 
 inline
-int NStr::CompareCase(const CTempStringEx& s1, const CTempStringEx& s2)
+int NStr::CompareCase(const CTempStringEx s1, const CTempStringEx s2)
 {
-    if (s1.HasZeroAtEnd()  &&  s2.HasZeroAtEnd()) {
-        return CompareCase(s1.data(), s2.data());
-    }
     return CompareCase(s1, 0, s1.length(), s2);
 }
 
 inline
-int NStr::CompareNocase(const CTempStringEx& s1, const CTempStringEx& s2)
+int NStr::CompareNocase(const CTempStringEx s1, const CTempStringEx s2)
 {
-    if (s1.HasZeroAtEnd()  &&  s2.HasZeroAtEnd()) {
-        return CompareNocase(s1.data(), s2.data());
-    }
     return CompareNocase(s1, 0, s1.length(), s2);
 }
 
 inline
-int NStr::Compare(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+int NStr::Compare(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                   const char* pattern, ECase use_case)
 {
     return use_case == eCase ?
@@ -5181,8 +5411,8 @@ int NStr::Compare(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
 }
 
 inline
-int NStr::Compare(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                  const CTempString& pattern, ECase use_case)
+int NStr::Compare(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                  const CTempString pattern, ECase use_case)
 {
     return use_case == eCase ?
         CompareCase(str, pos, n, pattern): CompareNocase(str, pos, n, pattern);
@@ -5195,21 +5425,21 @@ int NStr::Compare(const char* s1, const char* s2, ECase use_case)
 }
 
 inline
-int NStr::Compare(const CTempStringEx& s1, const CTempStringEx& s2, ECase use_case)
+int NStr::Compare(const CTempStringEx s1, const CTempStringEx s2, ECase use_case)
 {
     return use_case == eCase ? CompareCase(s1, s2): CompareNocase(s1, s2);
 }
 
 inline
-bool NStr::EqualCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+bool NStr::EqualCase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                      const char* pattern)
 {
     return NStr::CompareCase(str, pos, n, pattern) == 0;
 }
 
 inline
-bool NStr::EqualCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                     const CTempString& pattern)
+bool NStr::EqualCase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                     const CTempString pattern)
 {
     return NStr::CompareCase(str, pos, n, pattern) == 0;
 }
@@ -5221,24 +5451,21 @@ bool NStr::EqualCase(const char* s1, const char* s2)
 }
 
 inline
-bool NStr::EqualCase(const CTempStringEx& s1, const CTempStringEx& s2)
+bool NStr::EqualCase(const CTempStringEx s1, const CTempStringEx s2)
 {
-    if (s1.HasZeroAtEnd()  &&  s2.HasZeroAtEnd()) {
-        return EqualCase(s1.data(), s2.data());
-    }
     return s1 == s2;
 }
 
 inline
-bool NStr::EqualNocase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+bool NStr::EqualNocase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                        const char* pattern)
 {
     return CompareNocase(str, pos, n, pattern) == 0;
 }
 
 inline
-bool NStr::EqualNocase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                       const CTempString& pattern)
+bool NStr::EqualNocase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                       const CTempString pattern)
 {
     return CompareNocase(str, pos, n, pattern) == 0;
 }
@@ -5250,16 +5477,13 @@ bool NStr::EqualNocase(const char* s1, const char* s2)
 }
 
 inline
-bool NStr::EqualNocase(const CTempStringEx& s1, const CTempStringEx& s2)
+bool NStr::EqualNocase(const CTempStringEx s1, const CTempStringEx s2)
 {
-    if (s1.HasZeroAtEnd()  &&  s2.HasZeroAtEnd()) {
-        return EqualNocase(s1.data(), s2.data());
-    }
     return EqualNocase(s1, 0, s1.length(), s2);
 }
 
 inline
-bool NStr::Equal(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+bool NStr::Equal(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                  const char* pattern, ECase use_case)
 {
     return use_case == eCase ?
@@ -5267,8 +5491,8 @@ bool NStr::Equal(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
 }
 
 inline
-bool NStr::Equal(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                 const CTempString& pattern, ECase use_case)
+bool NStr::Equal(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                 const CTempString pattern, ECase use_case)
 {
     return use_case == eCase ?
         EqualCase(str, pos, n, pattern) : EqualNocase(str, pos, n, pattern);
@@ -5281,20 +5505,20 @@ bool NStr::Equal(const char* s1, const char* s2, ECase use_case)
 }
 
 inline
-bool NStr::Equal(const CTempStringEx& s1, const CTempStringEx& s2, ECase use_case)
+bool NStr::Equal(const CTempStringEx s1, const CTempStringEx s2, ECase use_case)
 {
     return use_case == eCase ? EqualCase(s1, s2) : EqualNocase(s1, s2);
 }
 
 inline
-bool NStr::StartsWith(const CTempString& str, const CTempString& start, ECase use_case)
+bool NStr::StartsWith(const CTempString str, const CTempString start, ECase use_case)
 {
     return str.size() >= start.size()  &&
         Compare(str, 0, start.size(), start, use_case) == 0;
 }
 
 inline
-bool NStr::StartsWith(const CTempString& str, char start, ECase use_case)
+bool NStr::StartsWith(const CTempString str, char start, ECase use_case)
 {
     return !str.empty()  &&
         ((use_case == eCase) ? (str[0] == start) :
@@ -5303,14 +5527,14 @@ bool NStr::StartsWith(const CTempString& str, char start, ECase use_case)
 }
 
 inline
-bool NStr::EndsWith(const CTempString& str, const CTempString& end, ECase use_case)
+bool NStr::EndsWith(const CTempString str, const CTempString end, ECase use_case)
 {
     return str.size() >= end.size()  &&
         Compare(str, str.size() - end.size(), end.size(), end, use_case) == 0;
 }
 
 inline
-bool NStr::EndsWith(const CTempString& str, char end, ECase use_case)
+bool NStr::EndsWith(const CTempString str, char end, ECase use_case)
 {
     if (!str.empty()) {
         char last = str[str.length() - 1];
@@ -5322,7 +5546,7 @@ bool NStr::EndsWith(const CTempString& str, char end, ECase use_case)
 }
 
 inline
-SIZE_TYPE NStr::CommonPrefixSize(const CTempString& s1, const CTempString& s2)
+SIZE_TYPE NStr::CommonPrefixSize(const CTempString s1, const CTempString s2)
 {
     const SIZE_TYPE n = min(s1.length(), s2.length());
     for (SIZE_TYPE i = 0;  i < n;  i++) {
@@ -5334,7 +5558,7 @@ SIZE_TYPE NStr::CommonPrefixSize(const CTempString& s1, const CTempString& s2)
 }
 
 inline
-SIZE_TYPE NStr::CommonSuffixSize(const CTempString& s1, const CTempString& s2)
+SIZE_TYPE NStr::CommonSuffixSize(const CTempString s1, const CTempString s2)
 {
     const SIZE_TYPE len1 = s1.length();
     const SIZE_TYPE len2 = s2.length();
@@ -5348,16 +5572,21 @@ SIZE_TYPE NStr::CommonSuffixSize(const CTempString& s1, const CTempString& s2)
 }
 
 inline
-SIZE_TYPE NStr::Find(const CTempString& str, const CTempString& pattern,
+SIZE_TYPE NStr::Find(const CTempString str, const CTempString pattern,
                      SIZE_TYPE start, SIZE_TYPE end, EOccurrence where,
                      ECase use_case)
 {
-    return use_case == eCase ? FindCase(str, pattern, start, end, where)
-                             : FindNoCase(str, pattern, start, end, where);
+    SIZE_TYPE pos = Find(CTempString(str, start, end - start), pattern, use_case,
+                         where == eFirst ? eForwardSearch : eReverseSearch, 0);
+    if (pos == NPOS) {
+        return NPOS;
+    }
+    return pos + start;
 }
 
+// @deprecated
 inline
-SIZE_TYPE NStr::FindCase(const CTempString& str, const CTempString& pattern,
+SIZE_TYPE NStr::FindCase(const CTempString str, const CTempString pattern,
                          SIZE_TYPE start, SIZE_TYPE end, EOccurrence where)
 {
     if (where == eFirst) {
@@ -5370,66 +5599,59 @@ SIZE_TYPE NStr::FindCase(const CTempString& str, const CTempString& pattern,
 }
 
 inline
-const string* NStr::FindCase(const list<string>& lst, const CTempString& val)
+SIZE_TYPE NStr::FindCase(const CTempString str, const CTempString pattern)
 {
-    return Find(lst, val, eCase);
+    return Find(str, pattern, eCase);
 }
 
 inline
-const string* NStr::FindNoCase(const list <string>& lst, const CTempString& val)
+SIZE_TYPE NStr::FindCase(const CTempString str, const CTempString pattern, SIZE_TYPE start)
 {
-    return Find(lst, val, eNocase);
+    SIZE_TYPE pos = Find(CTempString(str, start), pattern, eCase);
+    if (pos == NPOS) {
+        return NPOS;
+    }
+    return pos + start;
 }
 
 inline
-const string* NStr::FindCase(const vector <string>& vec, const CTempString& val)
+SIZE_TYPE NStr::FindNoCase(const CTempString str, const CTempString pattern)
 {
-    return Find(vec, val, eCase);
+    return Find(str, pattern, eNocase);
 }
 
 inline
-const string* NStr::FindNoCase(const vector <string>& vec, const CTempString& val)
+SIZE_TYPE NStr::FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start)
 {
-    return Find(vec, val, eNocase);
+    SIZE_TYPE pos = Find(CTempString(str, start), pattern, eNocase);
+    if (pos == NPOS) {
+        return NPOS;
+    }
+    return pos + start;
 }
 
 inline
-list<string>& NStr::Split(const CTempString& str, const CTempString& delim,
-                          list<string>& arr, EMergeDelims merge,
-                          vector<SIZE_TYPE>* token_pos)
+const string* NStr::FindCase(const list<string>& lst, const CTempString val)
 {
-    return Split(str, delim, arr,
-                 (merge == eMergeDelims) ? fSplit_MergeDelims : 0, token_pos);
+    return Find(lst, val, eCase);
 }
 
 inline
-vector<string>& NStr::Tokenize(const CTempString& str, const CTempString& delim,
-                               vector<string>& arr, EMergeDelims merge,
-                               vector<SIZE_TYPE>* token_pos)
+const string* NStr::FindNoCase(const list <string>& lst, const CTempString val)
 {
-    return Tokenize(str, delim, arr,
-                    (merge == eMergeDelims) ? fSplit_MergeDelims : 0,
-                    token_pos);
+    return Find(lst, val, eNocase);
 }
 
 inline
-vector<string>& NStr::TokenizePattern(const CTempString& str,
-                                      const CTempString& delim,
-                                      vector<string>& arr, EMergeDelims merge,
-                                      vector<SIZE_TYPE>* token_pos)
+const string* NStr::FindCase(const vector <string>& vec, const CTempString val)
 {
-    return Tokenize(str, delim, arr,
-                    fSplit_ByPattern
-                    | ((merge == eMergeDelims) ? fSplit_MergeDelims : 0),
-                    token_pos);
+    return Find(vec, val, eCase);
 }
 
 inline
-bool NStr::SplitInTwo(const CTempString& str, const CTempString& delim,
-                      string& str1, string& str2, EMergeDelims merge)
+const string* NStr::FindNoCase(const vector <string>& vec, const CTempString val)
 {
-    return SplitInTwo(str, delim, str1, str2,
-                      (merge == eMergeDelims) ? fSplit_MergeDelims : 0);
+    return Find(vec, val, eNocase);
 }
 
 inline
@@ -5467,17 +5689,17 @@ list<string>& NStr::WrapList(const list<string>& l, SIZE_TYPE width,
 }
 
 inline
-list<string>& NStr::Justify(const CTempString& str, SIZE_TYPE width,
-                            list<string>& par, const CTempString& pfx,
+list<string>& NStr::Justify(const CTempString str, SIZE_TYPE width,
+                            list<string>& par, const CTempString pfx,
                             const CTempString* pfx1)
 {
     return Justify(str, width, par, &pfx, pfx1);
 }
 
 inline
-list<string>& NStr::Justify(const CTempString& str, SIZE_TYPE width,
-                            list<string>& par, const CTempString& pfx,
-                            const CTempString& pfx1)
+list<string>& NStr::Justify(const CTempString str, SIZE_TYPE width,
+                            list<string>& par, const CTempString pfx,
+                            const CTempString pfx1)
 {
     return Justify(str, width, par, &pfx, &pfx1);
 }
@@ -5489,7 +5711,7 @@ list<string>& NStr::Justify(const CTempString& str, SIZE_TYPE width,
 //
 
 inline CStringUTF8
-CUtf8::AsUTF8(const CTempString& src, EEncoding encoding, EValidate validate) {
+CUtf8::AsUTF8(const CTempString src, EEncoding encoding, EValidate validate) {
     CStringUTF8 u8;
     return  x_Append(u8,src,encoding,validate);
 }
@@ -5578,7 +5800,7 @@ CUtf8::AppendAsUTF8(CStringUTF8& u8, TChar src) {
 }
 
 inline CStringUTF8&
-CUtf8::AppendAsUTF8(CStringUTF8& u8, const CTempString& src,
+CUtf8::AppendAsUTF8(CStringUTF8& u8, const CTempString src,
               EEncoding   encoding, EValidate validate) {
     return  x_Append(u8,src,encoding,validate);
 }
@@ -5589,45 +5811,45 @@ CUtf8::AppendAsUTF8(CStringUTF8& u8, char src,
 }
 
 template <typename TChar> inline basic_string<TChar>
-CUtf8::AsBasicString(const CTempString& str) {
+CUtf8::AsBasicString(const CTempString str) {
     return CUtf8::AsBasicString<TChar>(str,nullptr,eNoValidate);
 }
 template <typename TChar> inline basic_string<TChar>
-CUtf8::AsBasicString(const CTempString& str,
+CUtf8::AsBasicString(const CTempString str,
     const TChar* on_error, EValidate validate) {
     return CNotImplemented<TChar>::Cannot_convert_to_nonUnicode_string();
 }
 template <> inline basic_string<TUnicodeSymbol>
-CUtf8::AsBasicString(const CTempString& str,
+CUtf8::AsBasicString(const CTempString str,
     const TUnicodeSymbol* on_error, EValidate validate) {
     return CUtf8::x_AsBasicString<TUnicodeSymbol>(str,on_error,validate);
 }
 #if NCBITOOLKIT_USE_LONG_UCS4
 template <> inline basic_string<TCharUCS4>
-CUtf8::AsBasicString(const CTempString& str,
+CUtf8::AsBasicString(const CTempString str,
     const TCharUCS4* on_error, EValidate validate) {
     return CUtf8::x_AsBasicString<TCharUCS4>(str,on_error,validate);
 }
 #endif
 template <> inline basic_string<TCharUCS2>
-CUtf8::AsBasicString(const CTempString& str,
+CUtf8::AsBasicString(const CTempString str,
     const TCharUCS2* on_error, EValidate validate) {
     return CUtf8::x_AsBasicString<TCharUCS2>(str,on_error,validate);
 }
 #if defined(HAVE_WSTRING)
 template <> inline basic_string<wchar_t>
-CUtf8::AsBasicString(const CTempString& str,
+CUtf8::AsBasicString(const CTempString str,
     const wchar_t* on_error, EValidate validate) {
     return CUtf8::x_AsBasicString<wchar_t>(str,on_error,validate);
 }
 #endif
 
-inline SIZE_TYPE CUtf8::GetValidSymbolCount(const CTempString& src) {
+inline SIZE_TYPE CUtf8::GetValidSymbolCount(const CTempString src) {
     CTempString::const_iterator err;
     return x_GetValidSymbolCount(src, err);
 }
 
-inline SIZE_TYPE CUtf8::GetValidBytesCount(const CTempString& src) {
+inline SIZE_TYPE CUtf8::GetValidBytesCount(const CTempString src) {
     CTempString::const_iterator err;
     x_GetValidSymbolCount(src,err);
     return (err-src.begin());
@@ -5653,7 +5875,7 @@ CUtf8::x_Decode(TIterator& src)
 }
 
 template <typename TChar> basic_string<TChar>
-CUtf8::x_AsBasicString(const CTempString& str,
+CUtf8::x_AsBasicString(const CTempString str,
     const TChar* substitute_on_error, EValidate validate)
 {
     if (validate == eValidate) {
@@ -5728,7 +5950,7 @@ CUtf8::x_Append(CStringUTF8& u8str, const TChar* src, SIZE_TYPE to)
 }
 
 inline  CStringUTF8
-CUtf8::TruncateSpaces(const CTempString& str, NStr::ETrunc side) {
+CUtf8::TruncateSpaces(const CTempString str, NStr::ETrunc side) {
     CStringUTF8 u8;
     return x_Append(u8, TruncateSpaces_Unsafe(str,side),
                     eEncoding_UTF8, eNoValidate);
diff --git a/c++/include/corelib/ncbistr_util.hpp b/c++/include/corelib/ncbistr_util.hpp
index cce56d7..631e8db 100644
--- a/c++/include/corelib/ncbistr_util.hpp
+++ b/c++/include/corelib/ncbistr_util.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___STR_UTIL__HPP
 #define CORELIB___STR_UTIL__HPP
 
-/*  $Id: ncbistr_util.hpp 406824 2013-07-16 15:18:17Z grichenk $
+/*  $Id: ncbistr_util.hpp 484553 2015-11-12 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -95,6 +95,7 @@ public:
     void   Add(const CTempString& s);
     void   Clear(void);
     void   Join(string* s) const;
+    void   Join(CTempString* s) const;
     void   Join(CTempStringEx* s) const;
     size_t GetSize(void) const;
 
@@ -139,29 +140,42 @@ public:
     typedef NStr::TSplitFlags TFlags;
 
     CStrTokenizeBase(const CTempString& str, const CTempString& delim,
-                     TFlags flags,
-                     CTempString_Storage* storage);
+                     TFlags flags, CTempString_Storage* storage);
 
     SIZE_TYPE GetPos(void) const { return m_Pos; }
     bool      AtEnd (void) const { return m_Pos == NPOS; }
 
-    bool Advance   (CTempStringList* part_collector);
-    void SkipDelims(void);
+    /// Return TRUE if it found some text and put it into collector.
+    /// The collector can have empty strings, even if function returns FALSE.
+    /// @note
+    ///   This method don't honor NStr::fSplit_Truncate_Begin flag, 
+    ///   due it's stream nature, so you should process it in the calling code.
+    ///   NStr::fSplit_Truncate_Begin is honored.
+    bool Advance(CTempStringList* part_collector, SIZE_TYPE* ptr_delim_pos = 0 /* out */);
 
+    /// Skip all delimiters starting from current position.
+    void SkipDelims(void) { x_SkipDelims(true); }
+
+    /// Assumes that we already have a delimiter on the previous
+    /// position, so just skip all subsequent, depending on flags.
+    void MergeDelims(void) { x_SkipDelims(false); }
+
+    // Set new delimiters.
     void SetDelim(const CTempString& delim);
 
 protected:
-    const CTempString& m_Str;
-    CTempString        m_Delim;
-    SIZE_TYPE          m_Pos;
-    TFlags             m_Flags;
+    const CTempString&   m_Str;
+    CTempString          m_Delim;
+    SIZE_TYPE            m_Pos;
+    TFlags               m_Flags;
     CTempString_Storage* m_Storage;
 
 private:
     void x_ExtendInternalDelim();
+    void x_SkipDelims(bool force_skip);
 
-    CTempStringEx m_InternalDelim;
-    CTempString_Storage m_DelimStorage;
+    CTempStringEx        m_InternalDelim;
+    CTempString_Storage  m_DelimStorage;
 };
 
 inline
@@ -178,12 +192,12 @@ inline
 void CStrTokenizeBase::SetDelim(const CTempString& delim)
 {
     m_Delim = delim;
+
     if ((m_Flags & NStr::fSplit_ByPattern) == 0) {
         m_InternalDelim = m_Delim;
     } else {
         m_InternalDelim.assign(m_Delim, 0, 1);
     }
-
     if ((m_Flags & (NStr::fSplit_CanEscape | NStr::fSplit_CanQuote)) != 0) {
         x_ExtendInternalDelim();
     }
@@ -220,7 +234,7 @@ public:
     ///   If delimiter is empty, then input string is appended to "arr" as is.
     /// @param flags
     ///   Flags governing splitting.
-    ///   Without NStr::fSplit_MergeDelims, delimiters that immediately follow
+    ///   Without NStr::fSplit_MergeDelimiters, delimiters that immediately follow
     ///   each other are treated as separate delimiters - empty string(s) 
     ///   appear in the target output.
     ///
@@ -241,10 +255,12 @@ public:
     ///   String added to target when there are no other characters between
     ///   delimiters
     ///
-    void Do(TContainer&        target,
-            TPosContainer&     token_pos,
-            const TString&     empty_str = TString())
+    void Do(TContainer&     target,
+            TPosContainer&  token_pos,
+            const TString&  empty_str = TString())
     {
+        const bool no_truncate_end = ((m_Flags & NStr::fSplit_Truncate_End) == 0);
+
         // Special cases
         if (m_Str.empty()) {
             return;
@@ -253,27 +269,32 @@ public:
             token_pos.push_back(0);
             return;
         }
-
         // Do target space reservation (if applicable)
         TReserveTrait::Reserve(*this, target, token_pos);
 
-        // Reposition to just after any initial delimiters
-        m_Pos = 0;
-        SkipDelims();
-
         // Tokenization
-        //
+        
         CTempStringList part_collector(m_Storage);
-        SIZE_TYPE       prev_pos;
+        SIZE_TYPE prev_pos;
+        SIZE_TYPE delim_pos = NPOS;
+        m_Pos = 0;
         do {
             prev_pos = m_Pos;
-            if (Advance(&part_collector)) {
+            bool have_text = Advance(&part_collector, &delim_pos);
+            if ( have_text || no_truncate_end ) {
                 target.push_back(empty_str);
                 part_collector.Join(&target.back());
                 part_collector.Clear();
                 token_pos.push_back(prev_pos);
             }
         } while ( !AtEnd() );
+
+        // account training delimiter
+        if ( delim_pos != NPOS  &&  no_truncate_end ) {
+            // add empty token after last delimiter
+            target.push_back(empty_str);
+            token_pos.push_back(delim_pos + 1);
+        }
     }
 };
 
diff --git a/c++/include/corelib/ncbitime.hpp b/c++/include/corelib/ncbitime.hpp
index f5d6ea1..691e972 100644
--- a/c++/include/corelib/ncbitime.hpp
+++ b/c++/include/corelib/ncbitime.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB__NCBITIME__HPP
 #define CORELIB__NCBITIME__HPP
 
-/*  $Id: ncbitime.hpp 472770 2015-07-14 13:57:15Z ivanov $
+/*  $Id: ncbitime.hpp 481663 2015-10-14 17:54:55Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -191,7 +191,7 @@ public:
         eISO8601_Date         = 2,  ///< Y-M-D       (eg 1997-07-16)
         eISO8601_DateTimeMin  = 3,  ///< Y-M-DTh:m   (eg 1997-07-16T19:20)
         eISO8601_DateTimeSec  = 4,  ///< Y-M-DTh:m:s (eg 1997-07-16T19:20:30)
-        eISO8601_DateTimeFrac = 5   ///< Y-M-DTh:m:g (eg 1997-07-16T19:20:30.123)
+        eISO8601_DateTimeFrac = 5   ///< Y-M-DTh:m:g (eg 1997-07-16T19:20:30.1234)
     };
 
     /// Default constructor.
@@ -514,6 +514,9 @@ public:
     ///   midnight (00:00:00), January 1, 1970 UTC.
     /// @param nanosec
     ///   Number of nanoseconds (0, if not possible to get).
+    /// @attention
+    ///   Result can differs from time(NULL) due different implementation
+    ///   and taking into account nanosecond part on some platforms (rounding).
     static void GetCurrentTimeT(time_t* sec, long* nanosec = 0);
 
     /// Set time using "struct tm" time value.
diff --git a/c++/include/corelib/plugin_manager.hpp b/c++/include/corelib/plugin_manager.hpp
index 1c50271..e587345 100644
--- a/c++/include/corelib/plugin_manager.hpp
+++ b/c++/include/corelib/plugin_manager.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___PLUGIN_MANAGER__HPP
 #define CORELIB___PLUGIN_MANAGER__HPP
 
-/* $Id: plugin_manager.hpp 460958 2015-03-04 17:53:33Z grichenk $
+/* $Id: plugin_manager.hpp 485209 2015-11-19 15:11:24Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -752,7 +752,7 @@ TClass* CPluginManager<TClass>::CreateInstanceFromList(
     _TRACE("Creating an instance of a driver having version " <<
            version << " from a list " << driver_list);
     list<string> drivers;
-    NStr::Split(driver_list, ":", drivers);
+    NStr::Split(driver_list, ":", drivers, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE ( list<string>, it, drivers ) {
         string drv_name = *it;
         const TPluginManagerParamTree* driver_params = params ?
diff --git a/c++/include/corelib/request_ctx.hpp b/c++/include/corelib/request_ctx.hpp
index 390a9f1..999efb9 100644
--- a/c++/include/corelib/request_ctx.hpp
+++ b/c++/include/corelib/request_ctx.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___REQUEST_CTX__HPP
 #define CORELIB___REQUEST_CTX__HPP
 
-/*  $Id: request_ctx.hpp 463649 2015-03-31 16:12:18Z grichenk $
+/*  $Id: request_ctx.hpp 489237 2016-01-11 17:27:20Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -55,6 +55,9 @@
 BEGIN_NCBI_SCOPE
 
 
+// Forward declarations
+class CRequestContext_PassThrough;
+
 class NCBI_XNCBI_EXPORT CRequestContext : public CObject
 {
 public:
@@ -149,6 +152,14 @@ public:
     /// Get current hit id appended with auto-incremented sub-hit id.
     /// If hit id is not set, return empty string.
     const string& GetNextSubHitID(void);
+    /// Get the last generated sub-hit id.
+    const string& GetCurrentSubHitID(void);
+
+    /// Dtab
+    bool IsSetDtab(void) const;
+    const string& GetDtab(void) const;
+    void SetDtab(const string& dtab);
+    void UnsetDtab(void);
 
     /// Request exit status
     int  GetRequestStatus(void) const;
@@ -274,7 +285,8 @@ private:
         eProp_HitID         = 1 << 3,
         eProp_ReqStatus     = 1 << 4,
         eProp_BytesRd       = 1 << 5,
-        eProp_BytesWr       = 1 << 6
+        eProp_BytesWr       = 1 << 6,
+        eProp_Dtab          = 1 << 7
     };
     typedef int TPropSet;
 
@@ -289,13 +301,26 @@ private:
 
     string x_GetHitID(CDiagContext::EDefaultHitIDFlags flag) const;
 
+    void x_UpdateSubHitID(bool increment);
+
     static bool& sx_GetDefaultAutoIncRequestIDOnPost(void);
 
+    // Methods used by CRequestContext_PassThrough
+    bool x_IsSetPassThroughProp(CTempString name, bool update) const;
+    void x_SetPassThroughProp(CTempString name, CTempString value, bool update) const;
+    const string& x_GetPassThroughProp(CTempString name, bool update) const;
+    void x_ResetPassThroughProp(CTempString name, bool update) const;
+    // Copy std properties from CRequestContext to pass-through data.
+    void x_UpdateStdPassThroughProp(CTempString name) const;
+    // Copy std properties from pass-through data to CRequestContext.
+    void x_UpdateStdContextProp(CTempString name) const;
+
     TCount         m_RequestID;
     EDiagAppState  m_AppState;
     string         m_ClientIP;
     CEncodedString m_SessionID;
     string         m_HitID;
+    string         m_Dtab;
     mutable bool   m_LoggedHitID;
     int            m_SubHitID;
     int            m_ReqStatus;
@@ -313,6 +338,66 @@ private:
     friend class CDiagContextThreadData;
     // TID of the thread currently using this context or -1.
     Uint8          m_OwnerTID;
+
+    // Access to passable properties.
+    friend class CRequestContext_PassThrough;
+    typedef map<string, string, PNocase> TPassThroughProperties;
+    mutable TPassThroughProperties m_PassThroughProperties;
+};
+
+
+/// Request context properties passed between tasks.
+class NCBI_XNCBI_EXPORT CRequestContext_PassThrough
+{
+public:
+    /// Get CRequestContext_PassThrough for the current request context.
+    CRequestContext_PassThrough(void);
+
+    /// Get CRequestContext_PassThrough for the specific request context.
+    CRequestContext_PassThrough(CRequestContext ctx);
+
+    /// Supported serialization/deserialization formats.
+    enum EFormat {
+        eFormat_UrlEncoded ///< name=value pairs URL-encoded and separated with '&'
+    };
+
+    /// Check if the property is set.
+    bool IsSet(CTempString name) const;
+
+    /// Set or update property value.
+    void Set(CTempString name, CTempString value);
+
+    /// Get current property value or empty string if it's not set;
+    const string& Get(CTempString name) const;
+
+    /// Reset property.
+    void Reset(CTempString name);
+
+    /// Serialize current values using the specified format.
+    string Serialize(EFormat format) const;
+
+    /// Deserialize values using the specified format.
+    void Deserialize(CTempString data, EFormat format);
+
+    /// Enumerate all properties. The callback must have the following signarure:
+    /// bool F(const string& name, const string& value);
+    /// The function should return true to continue enumaration, false to stop.
+    template<class TCallback>
+    void Enumerate(TCallback callback)
+    {
+        m_Context->x_UpdateStdPassThroughProp("");
+        ITERATE(TProperties, it, m_Context->m_PassThroughProperties) {
+            if ( !callback(it->first, it->second) ) break;
+        }
+    }
+
+private:
+    string x_SerializeUrlEncoded(void) const;
+    void x_DeserializeUrlEncoded(CTempString data);
+
+    typedef CRequestContext::TPassThroughProperties TProperties;
+
+    CRef<CRequestContext> m_Context;
 };
 
 
@@ -451,6 +536,52 @@ void CRequestContext::UnsetHitID(void)
     m_HitID.clear();
     m_LoggedHitID = false;
     m_SubHitID = 0;
+    m_SubHitIDCache.clear();
+}
+
+
+inline
+const string& CRequestContext::GetNextSubHitID(void)
+{
+    x_UpdateSubHitID(true);
+    return m_SubHitIDCache;
+}
+
+
+inline
+const string& CRequestContext::GetCurrentSubHitID(void)
+{
+    x_UpdateSubHitID(false);
+    return m_SubHitIDCache;
+}
+
+
+inline
+bool CRequestContext::IsSetDtab(void) const
+{
+    return x_IsSetProp(eProp_Dtab);
+}
+
+
+inline
+const string& CRequestContext::GetDtab(void) const
+{
+    return x_IsSetProp(eProp_Dtab) ? m_Dtab : kEmptyStr;
+}
+
+
+inline
+void CRequestContext::SetDtab(const string& dtab)
+{
+    x_SetProp(eProp_Dtab);
+    m_Dtab = dtab;
+}
+
+
+inline
+void CRequestContext::UnsetDtab(void)
+{
+    x_UnsetProp(eProp_Dtab);
 }
 
 
@@ -561,6 +692,48 @@ void CRequestContext::x_UnsetProp(EProperty prop)
 }
 
 
+inline
+CRequestContext_PassThrough::CRequestContext_PassThrough(void)
+{
+    m_Context.Reset(&GetDiagContext().GetRequestContext());
+}
+
+
+inline
+CRequestContext_PassThrough::CRequestContext_PassThrough(CRequestContext ctx)
+    : m_Context(&ctx)
+{
+}
+
+
+inline
+bool CRequestContext_PassThrough::IsSet(CTempString name) const
+{
+    return m_Context->x_IsSetPassThroughProp(name, true);
+}
+
+
+inline
+void CRequestContext_PassThrough::Set(CTempString name, CTempString value)
+{
+    m_Context->x_SetPassThroughProp(name, value, true);
+}
+
+
+inline
+const string& CRequestContext_PassThrough::Get(CTempString name) const
+{
+    return m_Context->x_GetPassThroughProp(name, true);
+}
+
+
+inline
+void CRequestContext_PassThrough::Reset(CTempString name)
+{
+    m_Context->x_ResetPassThroughProp(name, true);
+}
+
+
 END_NCBI_SCOPE
 
 
diff --git a/c++/include/corelib/tempstr.hpp b/c++/include/corelib/tempstr.hpp
index 5e70b4e..6908365 100644
--- a/c++/include/corelib/tempstr.hpp
+++ b/c++/include/corelib/tempstr.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___TEMPSTR__HPP
 #define CORELIB___TEMPSTR__HPP
 
-/*  $Id: tempstr.hpp 462543 2015-03-19 13:28:44Z drozdov $
+/*  $Id: tempstr.hpp 486329 2015-12-03 14:37:58Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -94,9 +94,9 @@ public:
     
     /// Assign new values to the content of the a string
     CTempString& assign(const char* src_str, size_type len);
-    CTempString& assign(const CTempString& src_str);
-    CTempString& assign(const CTempString& src_str, size_type pos, size_type len);
-    CTempString& operator=(const CTempString& str);
+    CTempString& assign(const CTempString src_str);
+    CTempString& assign(const CTempString src_str, size_type pos, size_type len);
+    CTempString& operator=(const CTempString str);
     
 
     /// Return an iterator to the string's starting position
@@ -130,7 +130,7 @@ public:
 
     /// Find the first instance of the entire matching string within the
     /// current string, beginning at an optional offset.
-    size_type find(const CTempString& match,
+    size_type find(const CTempString match,
                    size_type pos = 0) const;
 
     /// Find the first instance of a given character string within the
@@ -139,7 +139,7 @@ public:
 
     /// Find the first instance of the entire matching string within the
     /// current string in a backward direction, beginning at an optional offset.
-    size_type rfind(const CTempString& match,
+    size_type rfind(const CTempString match,
                     size_type pos = npos) const;
 
     /// Find the last instance of a given character string within the
@@ -148,22 +148,22 @@ public:
 
     /// Find the first occurrence of any character in the matching string
     /// within the current string, beginning at an optional offset.
-    size_type find_first_of(const CTempString& match,
+    size_type find_first_of(const CTempString match,
                             size_type pos = 0) const;
 
     /// Find the first occurrence of any character not in the matching string
     /// within the current string, beginning at an optional offset.
-    size_type find_first_not_of(const CTempString& match,
+    size_type find_first_not_of(const CTempString match,
                                 size_type pos = 0) const;
 
     /// Find the last occurrence of any character in the matching string
     /// within the current string, beginning at an optional offset.
-    size_type find_last_of(const CTempString& match,
+    size_type find_last_of(const CTempString match,
                            size_type pos = npos) const;
 
     /// Find the last occurrence of any character not in the matching string
     /// within the current string, beginning at an optional offset.
-    size_type find_last_not_of(const CTempString& match,
+    size_type find_last_not_of(const CTempString match,
                                size_type pos = npos) const;
 
     /// Obtain a substring from this string, beginning at a given offset
@@ -178,13 +178,13 @@ public:
     char operator[](size_type pos) const;
 
     /// Compare the current string with a given string.
-    int compare(const CTempString& str) const;
+    int compare(const CTempString str) const;
 
     // Comparison operators, see compare().
-    bool operator==(const CTempString& str) const;
-    bool operator!=(const CTempString& str) const;
-    bool operator< (const CTempString& str) const;
-    bool operator> (const CTempString& str) const;
+    bool operator==(const CTempString str) const;
+    bool operator!=(const CTempString str) const;
+    bool operator< (const CTempString str) const;
+    bool operator> (const CTempString str) const;
 
     /// @}
 
@@ -208,63 +208,116 @@ private:
 };
 
 
-NCBI_XNCBI_EXPORT
-CNcbiOstream& operator<<(CNcbiOstream& out, const CTempString& str);
+/////////////////////////////////////////////////////////////////////////////
 
 
 // Global comparison operators (counterparts for CTempString::operator's).
 
 inline
-bool operator==(const char* str1, const CTempString& str2)
+bool operator==(const char* str1, const CTempString str2)
 {
     return str2.compare(str1) == 0;
 }
 
 inline
-bool operator==(const string& str1, const CTempString& str2)
+bool operator==(const string& str1, const CTempString str2)
 {
     return str2.compare(str1) == 0;
 }
 
 inline
-bool operator!=(const char* str1, const CTempString& str2)
+bool operator!=(const char* str1, const CTempString str2)
 {
     return str2.compare(str1) != 0;
 }
 
 inline
-bool operator!=(const string& str1, const CTempString& str2)
+bool operator!=(const string& str1, const CTempString str2)
 {
     return str2.compare(str1) != 0;
 }
 
 inline
-bool operator<(const char* str1, const CTempString& str2)
+bool operator<(const char* str1, const CTempString str2)
 {
     return str2.compare(str1) > 0;
 }
 
 inline
-bool operator<(const string& str1, const CTempString& str2)
+bool operator<(const string& str1, const CTempString str2)
 {
     return str2.compare(str1) > 0;
 }
 
 inline
-bool operator>(const char* str1, const CTempString& str2)
+bool operator>(const char* str1, const CTempString str2)
 {
     return str2.compare(str1) < 0;
 }
 
 inline
-bool operator>(const string& str1, const CTempString& str2)
+bool operator>(const string& str1, const CTempString str2)
 {
     return str2.compare(str1) < 0;
 }
 
-/*
- * @}
- */
+// Operator +
+
+/// @internal
+inline
+string g_CTempString_plus(const char* str1, size_t len1,
+                          const char* str2, size_t len2)
+{
+    string tmp;
+    tmp.reserve(len1 + len2);
+    tmp.assign(str1, len1);
+    tmp.append(str2, len2);
+    return tmp;
+}
+
+inline
+string operator+(const char* str1, const CTempString str2)
+{
+    return g_CTempString_plus(str1, strlen(str1),
+                              str2.data(), str2.length());
+}
+
+inline
+string operator+(const CTempString str1, const char* str2)
+{
+    return g_CTempString_plus(str1.data(), str1.length(),
+                              str2, strlen(str2));
+}
+
+inline
+string operator+(const string& str1, const CTempString str2)
+{
+    return g_CTempString_plus(str1.data(), str1.length(),
+                              str2.data(), str2.length());
+}
+
+inline
+string operator+(const CTempString str1, const string& str2)
+{
+    return g_CTempString_plus(str1.data(), str1.length(),
+                              str2.data(), str2.length());
+}
+
+inline
+string operator+(const CTempString str1, const CTempString str2)
+{
+    return g_CTempString_plus(str1.data(), str1.length(),
+                              str2.data(), str2.length());
+}
+
+
+// Put CTempString to stream
+inline
+CNcbiOstream& operator<<(CNcbiOstream& out, const CTempString str)
+{
+    return out.write(str.data(), str.length());
+}
+
 
 
 /////////////////////////////////////////////////////////////////////////////
@@ -514,7 +567,7 @@ void CTempString::Copy(string& dst, size_type pos, size_type len) const
 
 
 inline
-CTempString::size_type CTempString::find_first_of(const CTempString& match,
+CTempString::size_type CTempString::find_first_of(const CTempString match,
                                                   size_type pos) const
 {
     if (match.length()  &&  pos < length()) {
@@ -529,7 +582,7 @@ CTempString::size_type CTempString::find_first_of(const CTempString& match,
 
 
 inline
-CTempString::size_type CTempString::find_first_not_of(const CTempString& match,
+CTempString::size_type CTempString::find_first_not_of(const CTempString match,
                                                       size_type pos) const
 {
     if (match.length()  &&  pos < length()) {
@@ -556,7 +609,7 @@ CTempString::size_type CTempString::find_first_not_of(const CTempString& match,
 
 
 inline
-CTempString::size_type CTempString::find_last_of(const CTempString& match,
+CTempString::size_type CTempString::find_last_of(const CTempString match,
                                                  size_type pos) const
 {
     if (match.length()) {
@@ -586,7 +639,7 @@ CTempString::size_type CTempString::find_last_of(const CTempString& match,
 
 
 inline
-CTempString::size_type CTempString::find_last_not_of(const CTempString& match,
+CTempString::size_type CTempString::find_last_not_of(const CTempString match,
                                                      size_type pos) const
 {
     if (match.length()) {
@@ -631,7 +684,7 @@ CTempString::size_type CTempString::find(char match, size_type pos) const
 
 
 inline
-CTempString::size_type CTempString::find(const CTempString& match,
+CTempString::size_type CTempString::find(const CTempString match,
                                          size_type pos) const
 {
     if (pos + match.length() > length()) {
@@ -681,7 +734,7 @@ CTempString::size_type CTempString::rfind(char match, size_type pos) const
 
 
 inline
-CTempString::size_type CTempString::rfind(const CTempString& match,
+CTempString::size_type CTempString::rfind(const CTempString match,
                                           size_type pos) const
 {
     if (match.length() > length()) {
@@ -720,7 +773,7 @@ CTempString& CTempString::assign(const char* src, size_type len)
 
 
 inline
-CTempString& CTempString::assign(const CTempString& src_str)
+CTempString& CTempString::assign(const CTempString src_str)
 {
     if (this != &src_str) {
         NCBI_TEMPSTR_DESTROY_COPY();
@@ -733,7 +786,7 @@ CTempString& CTempString::assign(const CTempString& src_str)
 
 
 inline
-CTempString& CTempString::assign(const CTempString& src_str,
+CTempString& CTempString::assign(const CTempString src_str,
                                  size_type          pos, 
                                  size_type          len)
 {
@@ -745,7 +798,7 @@ CTempString& CTempString::assign(const CTempString& src_str,
 
 
 inline
-CTempString& CTempString::operator=(const CTempString& src_str)
+CTempString& CTempString::operator=(const CTempString src_str)
 {
     return assign(src_str);
 }
@@ -773,7 +826,7 @@ CTempString::operator string(void) const
 
 
 inline
-int CTempString::compare(const CTempString& str) const
+int CTempString::compare(const CTempString str) const
 {
     const int kLess    = -1;
     const int kEqual   =  0;
@@ -803,25 +856,25 @@ int CTempString::compare(const CTempString& str) const
 
 
 inline
-bool CTempString::operator==(const CTempString& str) const
+bool CTempString::operator==(const CTempString str) const
 {
     return compare(str) == 0;
 }
 
 inline
-bool CTempString::operator!=(const CTempString& str) const
+bool CTempString::operator!=(const CTempString str) const
 {
     return compare(str) != 0;
 }
 
 inline
-bool CTempString::operator<(const CTempString& str) const
+bool CTempString::operator<(const CTempString str) const
 {
     return compare(str) < 0;
 }
 
 inline
-bool CTempString::operator>(const CTempString& str) const
+bool CTempString::operator>(const CTempString str) const
 {
     return compare(str) > 0;
 }
@@ -904,9 +957,9 @@ public:
         {
             return *this = str;
         }
-    CTempStringEx& assign(const CTempString& str,
-                          size_type          pos, 
-                          size_type          count)
+    CTempStringEx& assign(const CTempString str,
+                          size_type         pos, 
+                          size_type         count)
         {
             m_ZeroAtEnd = eNoZeroAtEnd;
             CTempString::assign(str, pos, count);
@@ -958,7 +1011,7 @@ private:
 
 
 /// Helper class to allocate memory for CTempString[Ex] on demand
-/// in the functions which need to modify the strings (e.g. NStr::Splilt).
+/// in the functions which need to modify the strings (e.g. NStr::Split).
 
 
 class NCBI_XNCBI_EXPORT CTempString_Storage
@@ -981,4 +1034,7 @@ private:
 
 END_NCBI_SCOPE
 
+
+/* @} */
+
 #endif  // CORELIB___TEMPSTR__HPP
diff --git a/c++/include/corelib/test_boost.hpp b/c++/include/corelib/test_boost.hpp
index 52f7dfe..8bae11a 100644
--- a/c++/include/corelib/test_boost.hpp
+++ b/c++/include/corelib/test_boost.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___TEST_BOOST__HPP
 #define CORELIB___TEST_BOOST__HPP
 
-/*  $Id: test_boost.hpp 462211 2015-03-17 14:17:35Z ucko $
+/*  $Id: test_boost.hpp 489876 2016-01-19 15:33:56Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -74,6 +74,8 @@
 #include <boost/preprocessor/array/elem.hpp>
 #include <boost/preprocessor/arithmetic/inc.hpp>
 
+#include <common/boost_skew_guard.hpp>
+
 #ifdef NCBI_COMPILER_MSVC
 #  pragma warning(pop)
 #endif
@@ -83,10 +85,80 @@
 // the framework.
 #undef BOOST_CHECK_THROW_IMPL
 #undef BOOST_CHECK_NO_THROW_IMPL
-#undef BOOST_FIXTURE_TEST_CASE
+#ifdef BOOST_FIXTURE_TEST_CASE_WITH_DECOR
+#  undef BOOST_FIXTURE_TEST_CASE_WITH_DECOR
+#else
+#  undef BOOST_FIXTURE_TEST_CASE
+#endif
 #undef BOOST_PARAM_TEST_CASE
 
-#define BOOST_CHECK_THROW_IMPL( S, E, P, prefix, TL )                    \
+#if BOOST_VERSION >= 105900
+#  if BOOST_VERSION >= 106000
+#    define BOOST_CHECK_THROW_IMPL( S, E, P, postfix, TL )              \
+do {                                                                    \
+    try {                                                               \
+        BOOST_TEST_PASSPOINT();                                         \
+        S;                                                              \
+        BOOST_TEST_TOOL_IMPL( 2, false, "exception " BOOST_STRINGIZE(E) \
+                              " expected but not raised",               \
+                              TL, CHECK_MSG, _ );                       \
+    } catch( E const& ex ) {                                            \
+        ::boost::unit_test::ut_detail::ignore_unused_variable_warning( ex ); \
+        BOOST_TEST_TOOL_IMPL( 2, P,                                     \
+                              "exception \"" BOOST_STRINGIZE( E )       \
+                              "\" raised as expected" postfix,          \
+                              TL, CHECK_MSG, _  );                      \
+    } catch (...) {                                                     \
+        BOOST_TEST_TOOL_IMPL( 2, false,                                 \
+                              "an unexpected exception was thrown by "  \
+                              BOOST_STRINGIZE( S ),                     \
+                              TL, CHECK_MSG, _ );                       \
+    }                                                                   \
+} while( ::boost::test_tools::tt_detail::dummy_cond() )                 \
+/**/
+#  else
+#    define BOOST_CHECK_THROW_IMPL( S, E, P, prefix, TL )               \
+do {                                                                    \
+    try {                                                               \
+        BOOST_TEST_PASSPOINT();                                         \
+        S;                                                              \
+        BOOST_TEST_TOOL_IMPL( 2, false, "exception " BOOST_STRINGIZE(E) \
+                              " is expected",                           \
+                              TL, CHECK_MSG, _ );                       \
+    } catch( E const& ex ) {                                            \
+        ::boost::unit_test::ut_detail::ignore_unused_variable_warning( ex ); \
+        BOOST_TEST_TOOL_IMPL( 2, P, prefix BOOST_STRINGIZE( E ) " is caught", \
+                              TL, CHECK_MSG, _  );                      \
+    } catch (...) {                                                     \
+        BOOST_TEST_TOOL_IMPL( 2, false,                                 \
+                              "an unexpected exception was thrown by "  \
+                              BOOST_STRINGIZE( S ),                     \
+                              TL, CHECK_MSG, _ );                       \
+    }                                                                   \
+} while( ::boost::test_tools::tt_detail::dummy_cond() )                 \
+/**/
+#  endif
+
+#  define BOOST_CHECK_NO_THROW_IMPL( S, TL )                            \
+do {                                                                    \
+    try {                                                               \
+        S;                                                              \
+        BOOST_TEST_TOOL_IMPL( 2, true, "no exceptions thrown by "       \
+                              BOOST_STRINGIZE( S ),                     \
+                              TL, CHECK_MSG, _ );                       \
+    } catch (std::exception& ex) {                                      \
+        BOOST_TEST_TOOL_IMPL( 2, false, "an std::exception was thrown by " \
+                              BOOST_STRINGIZE( S ) " : " << ex.what(),  \
+                              TL, CHECK_MSG, _ );                       \
+    } catch( ... ) {                                                    \
+        BOOST_TEST_TOOL_IMPL( 2, false, "a nonstandard exception thrown by " \
+                              BOOST_STRINGIZE( S ),                     \
+                              TL, CHECK_MSG, _ );                       \
+    }                                                                   \
+} while( ::boost::test_tools::tt_detail::dummy_cond() )                 \
+/**/
+#else
+#  define BOOST_CHECK_THROW_IMPL( S, E, P, prefix, TL )                  \
 try {                                                                    \
     BOOST_TEST_PASSPOINT();                                              \
     S;                                                                   \
@@ -104,7 +176,7 @@ catch (...) {                                                            \
 }                                                                        \
 /**/
 
-#define BOOST_CHECK_NO_THROW_IMPL( S, TL )                                   \
+#  define BOOST_CHECK_NO_THROW_IMPL( S, TL )                                 \
 try {                                                                        \
     S;                                                                       \
     BOOST_CHECK_IMPL( true, "no exceptions thrown by " BOOST_STRINGIZE( S ), \
@@ -121,6 +193,7 @@ catch( ... ) {                                                               \
                       TL, CHECK_MSG );                                       \
 }                                                                            \
 /**/
+#endif
 
 #if BOOST_VERSION >= 104200
 #  define NCBI_BOOST_LOCATION()  , boost::execution_exception::location()
@@ -128,7 +201,52 @@ catch( ... ) {                                                               \
 #  define NCBI_BOOST_LOCATION()
 #endif
 
-#define BOOST_FIXTURE_TEST_CASE( test_name, F )                         \
+#ifdef BOOST_FIXTURE_TEST_CASE_NO_DECOR
+#  define NCBI_BOOST_DECORATOR_ARG \
+    , boost::unit_test::decorator::collector::instance()
+#else
+#  define NCBI_BOOST_DECORATOR_ARG
+#endif
+
+#ifdef BOOST_FIXTURE_TEST_CASE_NO_DECOR
+#  define BOOST_FIXTURE_TEST_CASE_WITH_DECOR( test_name, F, decorators ) \
+struct test_name : public F { void test_method(); };                    \
+                                                                        \
+static void BOOST_AUTO_TC_INVOKER( test_name )()                        \
+{                                                                       \
+    BOOST_TEST_CHECKPOINT('"' << #test_name << "\" fixture entry.");    \
+    test_name t;                                                        \
+    BOOST_TEST_CHECKPOINT('"' << #test_name << "\" entry.");            \
+    try {                                                               \
+        t.test_method();                                                \
+    }                                                                   \
+    catch (NCBI_NS_NCBI::CException& ex) {                              \
+        ERR_POST("Uncaught exception in \""                             \
+                 << boost::unit_test                                    \
+                         ::framework::current_test_case().p_name        \
+                 << "\"" << ex);                                        \
+        throw boost::execution_exception(                               \
+                boost::execution_exception::cpp_exception_error, ""     \
+                NCBI_BOOST_LOCATION() );                                \
+    }                                                                   \
+    BOOST_TEST_CHECKPOINT('"' << #test_name << "\" exit.");             \
+}                                                                       \
+                                                                        \
+struct BOOST_AUTO_TC_UNIQUE_ID( test_name ) {};                         \
+                                                                        \
+static ::NCBI_NS_NCBI::SNcbiTestRegistrar                               \
+BOOST_JOIN( BOOST_JOIN( test_name, _registrar ), __LINE__ ) (           \
+    boost::unit_test::make_test_case(                                   \
+        &BOOST_AUTO_TC_INVOKER( test_name ), #test_name,                \
+        __FILE__, __LINE__ ),                                           \
+    ::NCBI_NS_NCBI::SNcbiTestTCTimeout<                                 \
+        BOOST_AUTO_TC_UNIQUE_ID( test_name )>::instance()->value(),     \
+    decorators );                                                       \
+                                                                        \
+void test_name::test_method()                                           \
+/**/
+#else
+#  define BOOST_FIXTURE_TEST_CASE( test_name, F )                       \
 struct test_name : public F { void test_method(); };                    \
                                                                         \
 static void BOOST_AUTO_TC_INVOKER( test_name )()                        \
@@ -161,6 +279,7 @@ BOOST_JOIN( BOOST_JOIN( test_name, _registrar ), __LINE__ ) (           \
                                                                         \
 void test_name::test_method()                                           \
 /**/
+#endif
 
 #define BOOST_PARAM_TEST_CASE( function, begin, end )                       \
     ::NCBI_NS_NCBI::NcbiTestGenTestCases( function,                         \
@@ -191,7 +310,8 @@ static struct BOOST_JOIN( test_name, _timeout_spec )                    \
 /// @sa BOOST_PARAM_TEST_CASE
 #define BOOST_AUTO_PARAM_TEST_CASE( function, begin, end )               \
     BOOST_AUTO_TU_REGISTRAR(function) (                                  \
-                            BOOST_PARAM_TEST_CASE(function, begin, end)) \
+                            BOOST_PARAM_TEST_CASE(function, begin, end)  \
+                            NCBI_BOOST_DECORATOR_ARG)                    \
 /**/
 
 #define BOOST_TIMEOUT(M)                                        \
@@ -204,13 +324,31 @@ static struct BOOST_JOIN( test_name, _timeout_spec )                    \
 
 
 
-#define NCBITEST_CHECK_IMPL(P, check_descr, TL, CT)                          \
+#if BOOST_VERSION >= 105900
+
+#  define NCBITEST_CHECK_IMPL_EX(frwd_type, P, check_descr, TL, CT, ARGS)    \
+    BOOST_CHECK_NO_THROW_IMPL(                                               \
+        BOOST_TEST_TOOL_IMPL(frwd_type, P, check_descr, TL, CT, ARGS), TL)
+
+#  define NCBITEST_CHECK_IMPL(P, check_descr, TL, CT)                        \
+    NCBITEST_CHECK_IMPL_EX(2, P, check_descr, TL, CT, _)
+
+#  define NCBITEST_CHECK_WITH_ARGS_IMPL(P, check_descr, TL, CT, ARGS)        \
+    NCBITEST_CHECK_IMPL_EX(0, ::boost::test_tools::tt_detail::P(),           \
+                           check_descr, TL, CT, ARGS)
+
+#else
+
+#  define NCBITEST_CHECK_IMPL(P, check_descr, TL, CT)                        \
     BOOST_CHECK_NO_THROW_IMPL(BOOST_CHECK_IMPL(P, check_descr, TL, CT), TL)
 
-#define NCBITEST_CHECK_WITH_ARGS_IMPL(P, check_descr, TL, CT, ARGS)          \
+#  define NCBITEST_CHECK_WITH_ARGS_IMPL(P, check_descr, TL, CT, ARGS)        \
     BOOST_CHECK_NO_THROW_IMPL(BOOST_CHECK_WITH_ARGS_IMPL(                    \
     ::boost::test_tools::tt_detail::P(), check_descr, TL, CT, ARGS), TL)
 
+#endif
+
+
 
 // Several analogs to BOOST_* macros that make simultaneous checking of
 // NO_THROW and some other condition
@@ -597,7 +735,6 @@ static ::NCBI_NS_NCBI::SNcbiTestUserFuncReg                            \
 NCBITEST_AUTOREG_OBJ(&NCBITEST_AUTOREG_HELPER, ::NCBI_NS_NCBI::type);  \
 static void NCBITEST_AUTOREG_FUNC(type)(::NCBI_NS_NCBI::param_decl)
 
-
 /// Extension auto-registrar from Boost.Test that can automatically set the
 /// timeout for unit.
 struct SNcbiTestRegistrar
@@ -608,24 +745,36 @@ struct SNcbiTestRegistrar
     SNcbiTestRegistrar(boost::unit_test::test_case* tc,
                        boost::unit_test::counter_t  exp_fail,
                        unsigned int                 timeout)
-        : TParent(tc, exp_fail)
+        : TParent(tc NCBI_BOOST_DECORATOR_ARG, exp_fail)
     {
         tc->p_timeout.set(timeout);
     }
 
+#ifdef BOOST_FIXTURE_TEST_CASE_WITH_DECOR
+    SNcbiTestRegistrar(boost::unit_test::test_case*            tc,
+                       unsigned int                            timeout,
+                       boost::unit_test::decorator::collector& decorator)
+        : TParent(tc, decorator)
+    {
+        tc->p_timeout.set(timeout);
+    }
+#endif
+
     SNcbiTestRegistrar(boost::unit_test::test_case* tc,
                        boost::unit_test::counter_t  exp_fail)
-        : TParent(tc, exp_fail)
+        : TParent(tc NCBI_BOOST_DECORATOR_ARG, exp_fail)
     {}
 
+#ifndef BOOST_FIXTURE_TEST_CASE_WITH_DECOR
     explicit
     SNcbiTestRegistrar(boost::unit_test::const_string ts_name)
         : TParent(ts_name)
     {}
+#endif
 
     explicit
     SNcbiTestRegistrar(boost::unit_test::test_unit_generator const& tc_gen)
-        : TParent(tc_gen)
+        : TParent(tc_gen NCBI_BOOST_DECORATOR_ARG)
     {}
 
     explicit
@@ -673,11 +822,16 @@ class CNcbiTestParamTestCaseGenerator
     : public boost::unit_test::test_unit_generator
 {
 public:
-    CNcbiTestParamTestCaseGenerator(
-                    boost::unit_test::callback1<ParamType> const& test_func,
-                    boost::unit_test::const_string                name,
-                    ParamIter                                     par_begin,
-                    ParamIter                                     par_end)
+#if BOOST_VERSION >= 105900
+    typedef boost::function<void (ParamType)> TTestFunc;
+#else
+    typedef boost::unit_test::callback1<ParamType> TTestFunc;
+#endif
+
+    CNcbiTestParamTestCaseGenerator(TTestFunc const&               test_func,
+                                    boost::unit_test::const_string name,
+                                    ParamIter                      par_begin,
+                                    ParamIter                      par_end)
         : m_TestFunc(test_func),
           m_Name(boost::unit_test::ut_detail::normalize_test_case_name(name)),
           m_ParBegin(par_begin),
@@ -694,12 +848,18 @@ public:
         if( m_ParBegin == m_ParEnd )
             return NULL;
 
-        boost::unit_test::ut_detail::test_func_with_bound_param<ParamType>
-                                    bound_test_func( m_TestFunc, *m_ParBegin );
         string this_name(m_Name);
         this_name += NStr::IntToString(++m_CaseIndex);
+#if BOOST_VERSION >= 105900
+        boost::unit_test::test_unit* res
+            = new boost::unit_test::test_case
+                (this_name, boost::bind(m_TestFunc, *m_ParBegin));
+#else
+        boost::unit_test::ut_detail::test_func_with_bound_param<ParamType>
+                                    bound_test_func( m_TestFunc, *m_ParBegin );
         boost::unit_test::test_unit* res
                   = new boost::unit_test::test_case(this_name, bound_test_func);
+#endif
         ++m_ParBegin;
 
         return res;
@@ -707,11 +867,11 @@ public:
 
 private:
     // Data members
-    boost::unit_test::callback1<ParamType>  m_TestFunc;
-    string                                  m_Name;
-    mutable ParamIter                       m_ParBegin;
-    ParamIter                               m_ParEnd;
-    mutable int                             m_CaseIndex;
+    TTestFunc         m_TestFunc;
+    string            m_Name;
+    mutable ParamIter m_ParBegin;
+    ParamIter         m_ParEnd;
+    mutable int       m_CaseIndex;
 };
 
 
@@ -719,7 +879,7 @@ private:
 /// special test case generator.
 template<typename ParamType, typename ParamIter>
 inline CNcbiTestParamTestCaseGenerator<ParamType, ParamIter>
-NcbiTestGenTestCases(boost::unit_test::callback1<ParamType> const& test_func,
+NcbiTestGenTestCases(typename CNcbiTestParamTestCaseGenerator<ParamType, ParamIter>::TTestFunc const& test_func,
                      boost::unit_test::const_string                name,
                      ParamIter                                     par_begin,
                      ParamIter                                     par_end)
diff --git a/c++/include/corelib/test_mt.hpp b/c++/include/corelib/test_mt.hpp
index 456eae3..420190b 100644
--- a/c++/include/corelib/test_mt.hpp
+++ b/c++/include/corelib/test_mt.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___TEST_MT__HPP
 #define CORELIB___TEST_MT__HPP
 
-/*  $Id: test_mt.hpp 350427 2012-01-20 14:55:32Z lavr $
+/*  $Id: test_mt.hpp 473921 2015-07-23 14:35:48Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -157,14 +157,29 @@ protected:
     /// The call may be ignored by the application
     void TestApp_IntraGroupSyncPoint(void);
 
+    ///  Wait until ALL threads reach a call of TestApp_GlobalSyncPoint().
+    /// @warning                   
+    ///  You can use this method if you want threads to be synchronized
+    ///  across different branches of code. The only thing to keep in mind
+    ///  is that EVERY thread has to reach TestApp_GlobalSyncPoint() for 
+    ///  execution to be continued.
+    /// @note
+    ///  Calling TestApp_GlobalSyncPoint() automatically awakes all threads 
+    ///  that would be otherwise awaken only with 
+    ///  TestApp_DelayedStartSyncPoint().
+    void TestApp_GlobalSyncPoint(void);
+
     /// Set allowed range of delayed-start sync points.
     /// The real number will be chosen randomly.
+    /// Note:   Specifying wrong number will cause inner assert() to fail
     void SetNumberOfDelayedStartSyncPoints(unsigned int num_min,
                                            unsigned int num_max);
-    
-    /// Report that the calling thread has reached some point in execution
-    /// The call can trigger start of other threads, or be ignored.
-    ///
+
+    ///  Start threads that belong to delayed group (this call may be ignored 
+    /// to provide more randomness).
+    /// @note
+    //   New threads will start from the beginning of Thread_Run(), not from
+    ///  anywhere in the middle.
     /// @param name
     ///   Name can be anything you like, providing other
     ///   threads use the same name. The test application distinguishes
diff --git a/c++/include/corelib/version.hpp b/c++/include/corelib/version.hpp
index 8e070b9..18ee5c2 100644
--- a/c++/include/corelib/version.hpp
+++ b/c++/include/corelib/version.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB___VERSION__HPP
 #define CORELIB___VERSION__HPP
 
-/*  $Id: version.hpp 355288 2012-03-05 15:07:14Z vasilche $
+/*  $Id: version.hpp 492326 2016-02-16 19:38:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -210,13 +210,33 @@ private:
 };
 
 
+/// This class allows to add build info (date and tag) to application version.
+///
+/// This can be done by providing explicitly created SBuildInfo instance
+/// (e.g. SBuildInfo(__DATE__ " " __TIME__, "RC1"))
+/// instead of implicit SBuildInfo(), where SBuildInfo instance is accepted.
+///
+/// If clients do not explicitly set their own build info,
+/// C++ Toolkit build info will be used in the reporting instead.
+
+struct NCBI_XNCBI_EXPORT SBuildInfo
+{
+    string date;
+    string tag;
+
+    SBuildInfo();
+    SBuildInfo(const string& d, const string& t = kEmptyStr) : date(d), tag(t) {}
+};
+
+
 class NCBI_XNCBI_EXPORT CVersion : public CObject
 {
 public:
 
-    CVersion(void);
+    CVersion(const SBuildInfo& build_info = SBuildInfo());
     
-    CVersion(const CVersionInfo& version);
+    CVersion(const CVersionInfo& version,
+            const SBuildInfo& build_info = SBuildInfo());
 
     /// Copy constructor.
     CVersion(const CVersion& version);
@@ -230,9 +250,15 @@ public:
                          int  ver_minor,
                          int  patch_level = 0,
                          const string& ver_name = kEmptyStr);
+    void SetVersionInfo( int  ver_major,
+                         int  ver_minor,
+                         int  patch_level,
+                         const string& ver_name,
+                         const SBuildInfo& build_info);
     /// Set version information
     /// @note Takes the ownership over the passed VersionInfo object 
-    void SetVersionInfo( CVersionInfo* version);
+    void SetVersionInfo(CVersionInfo* version);
+    void SetVersionInfo(CVersionInfo* version, const SBuildInfo& build_info);
     /// Get version information
     const CVersionInfo& GetVersionInfo( ) const;
 
@@ -246,6 +272,9 @@ public:
     /// @note Takes the ownership over the passed VersionInfo object 
     void AddComponentVersion( CComponentVersionInfo* component);
 
+    /// Get build info (date and tag, if set)
+    const SBuildInfo& GetBuildInfo() const;
+
     static string GetPackageName(void);
     static CVersionInfo GetPackageVersion(void);
     static string GetPackageConfig(void);
@@ -255,6 +284,8 @@ public:
         fComponents     = 0x02,  ///< Print components version info
         fPackageShort   = 0x04,  ///< Print package info, if available
         fPackageFull    = 0x08,  ///< Print package info, if available
+        fBuildInfo      = 0x10,  ///< Print build info (date and tag)
+        fBuildSignature = 0x20,  ///< Print build signature, if available
         fPrintAll       = 0xFF   ///< Print all version data
     };
     typedef int TPrintFlags;  ///< Binary OR of EPrintFlags
@@ -265,6 +296,7 @@ public:
 private:
     AutoPtr< CVersionInfo > m_VersionInfo;
     vector< AutoPtr< CComponentVersionInfo> > m_Components;
+    SBuildInfo m_BuildInfo;
 };
 
 
diff --git a/c++/include/dbapi/dbapi.hpp b/c++/include/dbapi/dbapi.hpp
index 3b7677f..62649cd 100644
--- a/c++/include/dbapi/dbapi.hpp
+++ b/c++/include/dbapi/dbapi.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI___DBAPI__HPP
 #define DBAPI___DBAPI__HPP
 
-/* $Id: dbapi.hpp 446742 2014-09-17 19:11:55Z ucko $
+/* $Id: dbapi.hpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -314,7 +314,7 @@ public:
 ///
 ///  Interface for a SQL statement
 
-class I_ITDescriptor;
+class I_BlobDescriptor;
 
 class NCBI_DBAPI_EXPORT IStatement
 {
@@ -424,23 +424,23 @@ public:
     virtual int GetRowCount() = 0;
 
     /// Get a writer for writing BLOBs using previously created
-    /// CDB_ITDescriptor
+    /// CDB_BlobDescriptor
     /// @param d
     ///   Descriptor
     /// @param blob_size
     ///   Size of BLOB to write
     /// @param flags
     ///   @see EBlobOStreamFlags.
-    virtual IWriter* GetBlobWriter(I_ITDescriptor &d,
+    virtual IWriter* GetBlobWriter(I_BlobDescriptor &d,
                                    size_t blob_size,
                                    TBlobOStreamFlags flags = 0) = 0;
 
-    virtual IWriter* GetBlobWriter(I_ITDescriptor &d,
+    virtual IWriter* GetBlobWriter(I_BlobDescriptor &d,
                                    size_t blob_size,
                                    EAllowLog log_it);
 
     /// Get an ostream for writing BLOBs using previously created
-    /// CDB_ITDescriptor
+    /// CDB_BlobDescriptor
     /// @param d
     ///   Descriptor
     /// @param blob_size
@@ -449,12 +449,12 @@ public:
     ///   @see EBlobOStreamFlags.
     /// @param buf_size
     ///   Buffer size, default 4096
-    virtual CNcbiOstream& GetBlobOStream(I_ITDescriptor &d,
+    virtual CNcbiOstream& GetBlobOStream(I_BlobDescriptor &d,
                                          size_t blob_size,
                                          TBlobOStreamFlags flags = 0,
                                          size_t buf_size = 0) = 0;
 
-    virtual CNcbiOstream& GetBlobOStream(I_ITDescriptor &d,
+    virtual CNcbiOstream& GetBlobOStream(I_BlobDescriptor &d,
                                          size_t blob_size,
                                          EAllowLog log_it,
                                          size_t buf_size = 0);
@@ -908,6 +908,12 @@ public:
     /// Set timeout for command cancellation and connection closing
     virtual void SetCancelTimeout(size_t nof_secs) {}
 
+    /// Get connection timeout.
+    virtual size_t GetTimeout(void) const;
+
+    /// Get timeout for command cancellation and connection closing
+    virtual size_t GetCancelTimeout(void) const;
+
     /// If enabled, redirects all error messages
     /// to CDB_MultiEx object (see below).
     virtual void MsgToEx(bool v) = 0;
diff --git a/c++/include/dbapi/driver/dbapi_conn_factory.hpp b/c++/include/dbapi/driver/dbapi_conn_factory.hpp
index 4c2fa14..575fc59 100644
--- a/c++/include/dbapi/driver/dbapi_conn_factory.hpp
+++ b/c++/include/dbapi/driver/dbapi_conn_factory.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_CONN_FACTORY_HPP
 #define DBAPI_CONN_FACTORY_HPP
 
-/*  $Id: dbapi_conn_factory.hpp 471064 2015-06-23 13:56:53Z fukanchi $
+/*  $Id: dbapi_conn_factory.hpp 470851 2015-06-19 16:29:01Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/dbapi/driver/dbapi_driver_conn_mgr.hpp b/c++/include/dbapi/driver/dbapi_driver_conn_mgr.hpp
index 7b235c3..4a1854a 100644
--- a/c++/include/dbapi/driver/dbapi_driver_conn_mgr.hpp
+++ b/c++/include/dbapi/driver/dbapi_driver_conn_mgr.hpp
@@ -2,7 +2,7 @@
 #define DBAPI_DRIVER_CONN_MGR_HPP
 
 
-/* $Id: dbapi_driver_conn_mgr.hpp 403742 2013-06-18 15:26:09Z grichenk $
+/* $Id: dbapi_driver_conn_mgr.hpp 494592 2016-03-08 17:55:58Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -128,11 +128,18 @@ public:
     /// Get access to the class instance.
     static CDbapiConnMgr& Instance(void);
 
+    /// What to do if a connection factory has already been
+    /// explicitly registered.
+    enum EIfSet {
+        eIfSet_Replace,      ///< Replace it anyway.
+        eIfSet_KeepSilently, ///< Silently keep it.
+        eIfSet_KeepAndWarn,  ///< Keep it, but issue a warning.
+        eIfSet_KeepAndThrow  ///< Keep it and throw an exception.
+    };
+
     /// Set up a connection factory.
-    void SetConnectionFactory(IDBConnectionFactory* factory)
-    {
-        m_ConnectFactory.Reset(factory);
-    }
+    void SetConnectionFactory(IDBConnectionFactory* factory,
+                              EIfSet if_set = eIfSet_Replace);
 
     /// Retrieve a connection factory.
     CRef<IDBConnectionFactory> GetConnectionFactory(void) const
@@ -153,8 +160,9 @@ private:
 
     CRef<IDBConnectionFactory> m_ConnectFactory;
 
-    CMutex m_Mutex;
+    CFastMutex   m_Mutex;
     unsigned int m_NumConnect;
+    bool         m_HasExplicitConnectionFactory;
 
     // Friends
     friend class CSafeStatic_Allocator<CDbapiConnMgr>;
diff --git a/c++/include/dbapi/driver/dbapi_driver_convert.hpp b/c++/include/dbapi/driver/dbapi_driver_convert.hpp
index 2000065..1d7b7d2 100644
--- a/c++/include/dbapi/driver/dbapi_driver_convert.hpp
+++ b/c++/include/dbapi/driver/dbapi_driver_convert.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER___DBAPI_DRIVER_CONVERT__HPP
 #define DBAPI_DRIVER___DBAPI_DRIVER_CONVERT__HPP
 
-/* $Id: dbapi_driver_convert.hpp 437342 2014-06-05 13:56:19Z ucko $
+/* $Id: dbapi_driver_convert.hpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NTOICE
@@ -436,6 +436,12 @@ private:
             case eDB_Image:
                 value = ConvertFromLOB<TO, CDB_Image>();
                 break;
+            case eDB_VarCharMax:
+                value = ConvertFromLOB<TO, CDB_VarCharMax>();
+                break;
+            case eDB_VarBinaryMax:
+                value = ConvertFromLOB<TO, CDB_VarBinaryMax>();
+                break;
             case eDB_Bit:
                 value = ConvertFrom<TO, CDB_Bit>();
                 break;
diff --git a/c++/include/dbapi/driver/dbapi_object_convert.hpp b/c++/include/dbapi/driver/dbapi_object_convert.hpp
index 779ae8c..0ecbb71 100644
--- a/c++/include/dbapi/driver/dbapi_object_convert.hpp
+++ b/c++/include/dbapi/driver/dbapi_object_convert.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER___DBAPI_OBJECT_CONVERT__HPP
 #define DBAPI_DRIVER___DBAPI_OBJECT_CONVERT__HPP
 
-/* $Id: dbapi_object_convert.hpp 408471 2013-07-30 18:55:35Z ucko $
+/* $Id: dbapi_object_convert.hpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NTOICE
@@ -516,7 +516,8 @@ private:
     const obj_type& m_Value; 
 };
 
-// Still missing CDB_VarBinary, CDB_Binary, CDB_LongBinary, CDB_Stream, CDB_Text, CDB_Text, 
+// Still missing CDB_VarBinary, CDB_Binary, CDB_LongBinary, CDB_Stream,
+// CDB_Text, CDB_Image, CDB_VarCharMax, CDB_VarBinaryMax
 
 } // namespace value_slice
 
diff --git a/c++/include/dbapi/driver/dbapi_svc_mapper.hpp b/c++/include/dbapi/driver/dbapi_svc_mapper.hpp
index e710df4..5e9a689 100644
--- a/c++/include/dbapi/driver/dbapi_svc_mapper.hpp
+++ b/c++/include/dbapi/driver/dbapi_svc_mapper.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_SVC_MAPPER_HPP
 #define DBAPI_SVC_MAPPER_HPP
 
-/*  $Id: dbapi_svc_mapper.hpp 414127 2013-09-20 16:02:32Z ucko $
+/*  $Id: dbapi_svc_mapper.hpp 494592 2016-03-08 17:55:58Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -284,14 +284,31 @@ MakeCDBUniversalMapper(const IRegistry* registry)
 }
 
 
-/// Easy-to-use macro to install the default DBAPI service mapper
-/// and a user-defined connection factory
-#   define DBLB_INSTALL_FACTORY(factory_name)                                  \
-        ncbi::CDbapiConnMgr::Instance().SetConnectionFactory(                  \
-            new factory_name(ncbi::MakeCDBUniversalMapper))
+/// Easy-to-use macro to install the default DBAPI service mapper and
+/// a user-defined connection factory, with control over what to do
+/// if a connection factory has already been explicitly registered.
+/// @sa DBLB_INSTALL_DEFAULT_EX, DBLB_INSTALL_FACTORY
+#define DBLB_INSTALL_FACTORY_EX(factory_name, if_set)     \
+    ncbi::CDbapiConnMgr::Instance().SetConnectionFactory( \
+        new factory_name(ncbi::MakeCDBUniversalMapper),   \
+        ncbi::CDbapiConnMgr::if_set)
 
 /// Easy-to-use macro to install the default DBAPI service mapper
-#define DBLB_INSTALL_DEFAULT() DBLB_INSTALL_FACTORY(ncbi::CDBConnectionFactory)
+/// and a user-defined connection factory.
+/// @sa DBLB_INSTALL_DEFAULT, DBLB_INSTALL_FACTORY_EX
+#define DBLB_INSTALL_FACTORY(factory_name) \
+    DBLB_INSTALL_FACTORY_EX(factory_name, eIfSet_Replace)
+
+/// Easy-to-use macro to install the default DBAPI service mapper,
+/// with control over what to do if a connection factory has already
+/// been explicitly registered.
+/// @sa DBLB_INSTALL_DEFAULT, DBLB_INSTALL_FACTORY_EX
+#define DBLB_INSTALL_DEFAULT_EX(if_set) \
+    DBLB_INSTALL_FACTORY_EX(ncbi::CDBConnectionFactory, if_set)
+
+/// Easy-to-use macro to install the default DBAPI service mapper.
+/// @sa DBLB_INSTALL_DEFAULT_EX, DBLB_INSTALL_FACTORY
+#define DBLB_INSTALL_DEFAULT() DBLB_INSTALL_DEFAULT_EX(eIfSet_Replace)
 
 
 
diff --git a/c++/include/dbapi/driver/drivers.hpp b/c++/include/dbapi/driver/drivers.hpp
index decca93..1b26ba8 100644
--- a/c++/include/dbapi/driver/drivers.hpp
+++ b/c++/include/dbapi/driver/drivers.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER___DRIVERS__HPP
 #define DBAPI_DRIVER___DRIVERS__HPP
 
-/* $Id: drivers.hpp 173033 2009-10-14 13:16:54Z ivanovp $
+/* $Id: drivers.hpp 487476 2015-12-17 19:48:39Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -45,6 +45,8 @@ BEGIN_NCBI_SCOPE
 extern void DBAPI_RegisterDriver_CTLIB      (void);
 extern void DBAPI_RegisterDriver_DBLIB      (void);
 extern void DBAPI_RegisterDriver_FTDS       (void);
+extern void DBAPI_RegisterDriver_FTDS64     (void);
+extern void DBAPI_RegisterDriver_FTDS95     (void);
 extern void DBAPI_RegisterDriver_ODBC       (void);
 extern void DBAPI_RegisterDriver_MYSQL      (void);
 // Development ...
diff --git a/c++/include/dbapi/driver/impl/dbapi_impl_cmd.hpp b/c++/include/dbapi/driver/impl/dbapi_impl_cmd.hpp
index 984b886..d136f9f 100644
--- a/c++/include/dbapi/driver/impl/dbapi_impl_cmd.hpp
+++ b/c++/include/dbapi/driver/impl/dbapi_impl_cmd.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER_IMPL___DBAPI_IMPL_CMD__HPP
 #define DBAPI_DRIVER_IMPL___DBAPI_IMPL_CMD__HPP
 
-/* $Id: dbapi_impl_cmd.hpp 441150 2014-07-21 19:10:46Z ucko $
+/* $Id: dbapi_impl_cmd.hpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -250,8 +250,8 @@ protected:
     /// NOTE: the cursor must be declared for update in CDB_Connection::Cursor()
     virtual bool Update(const string& table_name, const string& upd_query);
 
-    virtual bool UpdateTextImage(unsigned int item_num, CDB_Stream& data,
-                                 bool log_it = true);
+    virtual bool UpdateBlob(unsigned int item_num, CDB_Stream& data,
+                            bool log_it = true);
 
     virtual CDB_SendDataCmd* SendDataCmd(unsigned int item_num, size_t size,
                                          bool log_it = true,
diff --git a/c++/include/dbapi/driver/impl/dbapi_impl_connection.hpp b/c++/include/dbapi/driver/impl/dbapi_impl_connection.hpp
index b79c38a..293bb01 100644
--- a/c++/include/dbapi/driver/impl/dbapi_impl_connection.hpp
+++ b/c++/include/dbapi/driver/impl/dbapi_impl_connection.hpp
@@ -2,7 +2,7 @@
 #define DBAPI_DRIVER_IMPL___DBAPI_IMPL_CONNECTION__HPP
 
 
-/* $Id: dbapi_impl_connection.hpp 482702 2015-10-26 15:43:14Z ivanov $
+/* $Id: dbapi_impl_connection.hpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -154,14 +154,15 @@ public:
                                   const string& query,
                                   unsigned int  batch_size = 1) = 0;
     /// "Send-data" command
-    virtual CDB_SendDataCmd* SendDataCmd(I_ITDescriptor& desc,
-                                         size_t          data_size,
-                                         bool            log_it = true,
-                                         bool            dump_results = true) = 0;
+    virtual CDB_SendDataCmd* SendDataCmd(I_BlobDescriptor& desc,
+                                         size_t            data_size,
+                                         bool              log_it = true,
+                                         bool              dump_results = true)
+        = 0;
 
     /// Shortcut to send text and image to the server without using the
     /// "Send-data" command (SendDataCmd)
-    virtual bool SendData(I_ITDescriptor& desc, CDB_Stream& lob,
+    virtual bool SendData(I_BlobDescriptor& desc, CDB_Stream& lob,
                           bool log_it = true) = 0;
 
     virtual void SetDatabaseName(const string& name);
@@ -216,7 +217,11 @@ public:
 
     virtual void SetTimeout(size_t nof_secs) = 0;
     virtual void SetCancelTimeout(size_t nof_secs) = 0;
-    virtual void SetTextImageSize(size_t nof_bytes);
+    virtual void SetBlobSize(size_t nof_bytes);
+    void SetTextImageSize(size_t nof_bytes) { SetBlobSize(nof_bytes); }
+
+    virtual size_t GetTimeout(void) const;
+    virtual size_t GetCancelTimeout(void) const;
 
     virtual TSockHandle GetLowLevelHandle(void) const;
 
diff --git a/c++/include/dbapi/driver/impl/dbapi_impl_context.hpp b/c++/include/dbapi/driver/impl/dbapi_impl_context.hpp
index 8a46d14..7db2608 100644
--- a/c++/include/dbapi/driver/impl/dbapi_impl_context.hpp
+++ b/c++/include/dbapi/driver/impl/dbapi_impl_context.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER_IMPL___DBAPI_IMPL_CONTEXT__HPP
 #define DBAPI_DRIVER_IMPL___DBAPI_IMPL_CONTEXT__HPP
 
-/* $Id: dbapi_impl_context.hpp 480566 2015-10-01 16:55:03Z ivanov $
+/* $Id: dbapi_impl_context.hpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -144,7 +144,9 @@ public:
     virtual ~CDriverContext(void);
 
 public:
-    virtual bool SetMaxTextImageSize(size_t nof_bytes);
+    virtual bool SetMaxBlobSize(size_t nof_bytes);
+    bool SetMaxTextImageSize(size_t nof_bytes)
+        { return SetMaxBlobSize(nof_bytes); }
 
     virtual bool SetLoginTimeout(unsigned int nof_secs = 0);
     virtual unsigned int GetLoginTimeout(void) const;
@@ -214,10 +216,11 @@ public:
         return (GetClientEncoding() == eEncoding_UTF8);
     }
 
-    size_t GetMaxTextImageSize(void) const
+    size_t GetMaxBlobSize(void) const
     {
-        return m_MaxTextImageSize;
+        return m_MaxBlobSize;
     }
+    size_t GetMaxTextImageSize(void) const { return GetMaxBlobSize(); }
 
     static void ResetEnvSybase(void);
 
@@ -249,7 +252,7 @@ protected:
         return m_CntxHandlers;
     }
 
-    void UpdateConnMaxTextImageSize(void) const;
+    void UpdateConnMaxBlobSize(void) const;
     void UpdateConnTimeout(void) const;
 
     void SetExtraMsg(const string& msg) const
@@ -290,7 +293,7 @@ private:
     mutable string  m_ExtraMsg;
 
     string          m_ClientCharset;
-    size_t          m_MaxTextImageSize;
+    size_t          m_MaxBlobSize;
     EEncoding       m_ClientEncoding;
 
     /// Return unused connection "conn" to the driver context for future
diff --git a/c++/include/dbapi/driver/impl/dbapi_impl_result.hpp b/c++/include/dbapi/driver/impl/dbapi_impl_result.hpp
index 847c357..a1fefb6 100644
--- a/c++/include/dbapi/driver/impl/dbapi_impl_result.hpp
+++ b/c++/include/dbapi/driver/impl/dbapi_impl_result.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER_IMPL___DBAPI_IMPL_RESULT__HPP
 #define DBAPI_DRIVER_IMPL___DBAPI_IMPL_RESULT__HPP
 
-/* $Id: dbapi_impl_result.hpp 125482 2008-04-23 16:54:57Z ssikorsk $
+/* $Id: dbapi_impl_result.hpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -76,18 +76,21 @@ public:
     virtual CDB_Object* GetItem(CDB_Object* item_buf = 0, 
 					I_Result::EGetItem policy = I_Result::eAppendLOB) = 0;
 
-    /// Read a result item body (for text/image mostly).
+    /// Read a result item body (for BLOB columns, mostly).
     /// Return number of successfully read bytes.
     /// Set "*is_null" to TRUE if the item is <NULL>.
     /// Throw an exception on any error.
     virtual size_t ReadItem(void* buffer, size_t buffer_size,
                             bool* is_null = 0) = 0;
 
-    /// Get a descriptor for text/image column (for SendData).
-    /// Return NULL if this result doesn't (or can't) have img/text descriptor.
+    /// Get a descriptor for a BLOB column (for SendData).
+    /// Return NULL if this result doesn't (or can't) have a BLOB descriptor.
     /// NOTE: you need to call ReadItem (maybe even with buffer_size == 0)
     ///       before calling this method!
-    virtual I_ITDescriptor* GetImageOrTextDescriptor(void) = 0;
+    virtual I_BlobDescriptor* GetBlobDescriptor(void) = 0;
+
+    I_BlobDescriptor* GetImageOrTextDescriptor(void)
+        { return GetBlobDescriptor(); }
 
     /// Skip result item
     virtual bool SkipItem(void) = 0;
diff --git a/c++/include/dbapi/driver/interfaces.hpp b/c++/include/dbapi/driver/interfaces.hpp
index 483d23d..ee04b3c 100644
--- a/c++/include/dbapi/driver/interfaces.hpp
+++ b/c++/include/dbapi/driver/interfaces.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER___INTERFACES__HPP
 #define DBAPI_DRIVER___INTERFACES__HPP
 
-/* $Id: interfaces.hpp 482702 2015-10-26 15:43:14Z ivanov $
+/* $Id: interfaces.hpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -355,18 +355,21 @@ private:
 
 /////////////////////////////////////////////////////////////////////////////
 ///
-///  I_ITDescriptor::
+///  I_BlobDescriptor::
 ///
-/// Image or Text descriptor.
+/// BLOB descriptor.
 ///
 
-class NCBI_DBAPIDRIVER_EXPORT I_ITDescriptor
+class NCBI_DBAPIDRIVER_EXPORT I_BlobDescriptor
 {
 public:
     virtual int DescriptorType(void) const = 0;
-    virtual ~I_ITDescriptor(void);
+    virtual ~I_BlobDescriptor(void);
 };
 
+// historical name
+typedef I_BlobDescriptor I_ITDescriptor;
+
 
 /////////////////////////////////////////////////////////////////////////////
 ///
@@ -545,8 +548,11 @@ protected:
     /// NOTE: the cursor must be declared for update in CDB_Connection::Cursor()
     virtual bool Update(const string& table_name, const string& upd_query) = 0;
 
-    virtual bool UpdateTextImage(unsigned int item_num, CDB_Stream& data,
-                                 bool log_it = true) = 0;
+    virtual bool UpdateBlob(unsigned int item_num, CDB_Stream& data,
+                            bool log_it = true) = 0;
+    bool UpdateTextImage(unsigned int item_num, CDB_Stream& data,
+                         bool log_it = true)
+        { return UpdateBlob(item_num, data, log_it); }
 
     /// @brief 
     ///   Create send-data command.
@@ -689,15 +695,16 @@ public:
     ///   If "item_buf" is not NULL, then use "*item_buf" (its type should be
     ///   compatible with the type of retrieved item!) to retrieve the item to;
     ///   otherwise allocate new "CDB_Object".
-    ///   In case of "CDB_Image" and "CDB_Text" data types value will be *appended*
+    ///   If the existing "item_buf" has a BLOB type (CDB_Image, CDB_Text,
+    ///   CDB_VarBinaryMax, or CDB_VarCharMax), the value will be *appended*
     ///   to the "item_buf" by default (policy == eAppendLOB).
     /// 
     /// @param policy
-    ///   Data retrieval policy. If policy == eAppendLOB and "item_buf" is an
-    ///   object of CDB_Image or CDB_Text type, then data will be *appended* to
-    ///   the end of previously assigned data. If policy == eAssignLOB and "item_buf" is an
-    ///   object of CDB_Image or CDB_Text type, then new value will be *assigned*
-    ///   to the "item_buf" object.
+    ///   Data retrieval policy. If policy == eAppendLOB *and* "item_buf" has a
+    ///   BLOB type (CDB_Image, CDB_Text, CDB_VarBinaryMax, or CDB_VarCharMax),
+    ///   data will be *appended* to the end of previously assigned data.
+    ///   Otherwise (policy == eAssignLOB or "item_buf" has some other type),
+    ///   the new value will be *assigned* to the "item_buf" object.
     /// 
     /// @return 
     ///   a result item
@@ -707,7 +714,7 @@ public:
     virtual CDB_Object* GetItem(CDB_Object* item_buf = 0, EGetItem policy = eAppendLOB) = 0;
 
     /// @brief 
-    ///   Read a result item body (for text/image mostly).
+    ///   Read a result item body (for BLOB columns, mostly).
     ///   Throw an exception on any error.
     /// 
     /// @param buffer 
@@ -726,15 +733,18 @@ public:
                             bool* is_null = 0) = 0;
 
     /// @brief 
-    ///   Get a descriptor for text/image column (for SendData).
+    ///   Get a descriptor for a BLOB column (for SendData).
     /// 
     /// @return 
-    ///   Return NULL if this result doesn't (or can't) have img/text descriptor.
+    ///   Return NULL if this result doesn't (or can't) have a BLOB descriptor.
     ///
     /// @note
     ///   You need to call ReadItem (maybe even with buffer_size == 0)
     ///   before calling this method!
-    virtual I_ITDescriptor* GetImageOrTextDescriptor(void) = 0;
+    virtual I_BlobDescriptor* GetBlobDescriptor(void) = 0;
+
+    I_BlobDescriptor* GetImageOrTextDescriptor(void)
+        { return GetBlobDescriptor(); }
 
     /// @brief 
     /// Skip result item
@@ -821,14 +831,15 @@ public:
     ///   SetTimeout()
     virtual unsigned int GetTimeout(void) const = 0;
 
-    /// Set maximal size for Text and Image objects. 
+    /// Set maximal size for BLOB data. 
     ///
     /// @param nof_bytes
-    ///   Maximal size for Text and Image objects. Text and Image objects 
-    ///   exceeding this size will be truncated.
+    ///   Maximal size for BLOB data ([N]TEXT, IMAGE, [N]VARCHAR(MAX),
+    ///   VARBINARY(MAX), XML).  BLOBs exceeding this size will be truncated.
     /// @return 
     ///   FALSE on error (e.g. if "nof_bytes" is too big).
-    virtual bool SetMaxTextImageSize(size_t nof_bytes) = 0;
+    virtual bool SetMaxBlobSize(size_t nof_bytes) = 0;
+    bool SetMaxTextImageSize(size_t n) { return SetMaxBlobSize(n); }
 
 
     /// @brief 
@@ -1031,7 +1042,8 @@ public:
     /// Report if the driver supports this functionality
     enum ECapability {
         eBcp,                 //< Is able to run BCP operations.
-        eReturnITDescriptors, //< Is able to return ITDescriptor.
+        eReturnBlobDescriptors, //< Is able to return BlobDescriptor.
+        eReturnITDescriptors = eReturnBlobDescriptors,
         eReturnComputeResults //< Is able to return compute results.
     };
 
@@ -1180,10 +1192,11 @@ protected:
     ///   Newly created send-data object.
     ///
     /// @sa SendData
-    virtual CDB_SendDataCmd* SendDataCmd(I_ITDescriptor& desc,
-                                         size_t          data_size,
-                                         bool            log_it = true,
-                                         bool            discard_results = true) = 0;
+    virtual CDB_SendDataCmd* SendDataCmd(I_BlobDescriptor& desc,
+                                         size_t            data_size,
+                                         bool              log_it = true,
+                                         bool              discard_results = true)
+        = 0;
 
     /// @brief 
     ///   Shortcut to send text and image to the server without using the
@@ -1192,7 +1205,7 @@ protected:
     /// @param desc 
     ///   Lob descriptor.
     /// @param lob 
-    ///   Text or Image object.
+    ///   Large object -- [N]TEXT, IMAGE, [N]VARCHAR(MAX), or VARBINARY(MAX).
     /// @param log_it 
     ///   Log LOB operation if this value is set to true.
     /// 
@@ -1201,7 +1214,7 @@ protected:
     ///
     /// @sa
     ///   SendDataCmd
-    virtual bool SendData(I_ITDescriptor& desc, CDB_Stream& lob,
+    virtual bool SendData(I_BlobDescriptor& desc, CDB_Stream& lob,
                           bool log_it = true) = 0;
 
     /// @brief 
@@ -1336,6 +1349,9 @@ protected:
     ///   (depends on the underlying DB API), then set the timeout to infinite.
     virtual void SetTimeout(size_t nof_secs) = 0;
 
+    /// Get connection timeout.    
+    virtual size_t GetTimeout(void) const = 0;
+
     /// Get interface for extra features that could be implemented in the driver.
     virtual I_ConnectionExtra& GetExtraFeatures(void) = 0;
 
diff --git a/c++/include/dbapi/driver/odbc/interfaces.hpp b/c++/include/dbapi/driver/odbc/interfaces.hpp
index 4e73bd2..90e15f3 100644
--- a/c++/include/dbapi/driver/odbc/interfaces.hpp
+++ b/c++/include/dbapi/driver/odbc/interfaces.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER_ODBC___INTERFACES__HPP
 #define DBAPI_DRIVER_ODBC___INTERFACES__HPP
 
-/* $Id: interfaces.hpp 441150 2014-07-21 19:10:46Z ucko $
+/* $Id: interfaces.hpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -274,12 +274,12 @@ protected:
     virtual CDB_CursorCmd*   Cursor      (const string&   cursor_name,
                                           const string&   query,
                                           unsigned int    batch_size = 1);
-    virtual CDB_SendDataCmd* SendDataCmd (I_ITDescriptor& desc,
+    virtual CDB_SendDataCmd* SendDataCmd (I_BlobDescriptor& desc,
                                           size_t          data_size,
                                           bool            log_it = true,
                                           bool            dump_results = true);
 
-    virtual bool SendData(I_ITDescriptor& desc, CDB_Stream& lob,
+    virtual bool SendData(I_BlobDescriptor& desc, CDB_Stream& lob,
                           bool log_it = true);
 
     virtual bool Refresh(void);
@@ -334,7 +334,7 @@ protected:
     }
 
 private:
-    bool x_SendData(CDB_ITDescriptor::ETDescriptorType descr_type,
+    bool x_SendData(CDB_BlobDescriptor::ETDescriptorType descr_type,
                     CStatementBase& stmt,
                     CDB_Stream& stream);
     static string x_MakeFreeTDSVersion(int version);
@@ -585,8 +585,8 @@ protected:
 protected:
     virtual CDB_Result* OpenCursor(void);
     virtual bool Update(const string& table_name, const string& upd_query);
-    virtual bool UpdateTextImage(unsigned int item_num, CDB_Stream& data,
-                 bool log_it = true);
+    virtual bool UpdateBlob(unsigned int item_num, CDB_Stream& data,
+                            bool log_it = true);
     virtual CDB_SendDataCmd* SendDataCmd(unsigned int item_num, size_t size,
                                          bool log_it = true,
                                          bool dump_results = true);
@@ -594,7 +594,7 @@ protected:
     virtual bool CloseCursor(void);
 
 protected:
-    CDB_ITDescriptor* x_GetITDescriptor(unsigned int item_num);
+    CDB_BlobDescriptor* x_GetBlobDescriptor(unsigned int item_num);
 };
 
 
@@ -613,8 +613,8 @@ protected:
 protected:
     virtual CDB_Result* OpenCursor(void);
     virtual bool Update(const string& table_name, const string& upd_query);
-    virtual bool UpdateTextImage(unsigned int item_num, CDB_Stream& data,
-                 bool log_it = true);
+    virtual bool UpdateBlob(unsigned int item_num, CDB_Stream& data,
+                            bool log_it = true);
     virtual CDB_SendDataCmd* SendDataCmd(unsigned int item_num, size_t size,
                                          bool log_it = true,
                                          bool dump_results = true);
@@ -622,7 +622,7 @@ protected:
     virtual bool CloseCursor(void);
 
 protected:
-    CDB_ITDescriptor* x_GetITDescriptor(unsigned int item_num);
+    CDB_BlobDescriptor* x_GetBlobDescriptor(unsigned int item_num);
 
 protected:
     auto_ptr<CODBC_LangCmd> m_LCmd;
@@ -675,7 +675,7 @@ private:
 
     SQLHDBC m_Cmd;
     bool    m_WasBound;
-    bool    m_HasTextImage;
+    bool    m_HasBlob;
 };
 
 
@@ -692,7 +692,7 @@ class NCBI_DBAPIDRIVER_ODBC_EXPORT CODBC_SendDataCmd :
 
 protected:
     CODBC_SendDataCmd(CODBC_Connection& conn,
-                      CDB_ITDescriptor& descr,
+                      CDB_BlobDescriptor& descr,
                       size_t nof_bytes,
                       bool logit,
                       bool dump_results);
@@ -709,7 +709,7 @@ private:
     bool xCheck4MoreResults(void);
 
     SQLLEN  m_ParamPH;
-    const CDB_ITDescriptor::ETDescriptorType m_DescrType;
+    const CDB_BlobDescriptor::ETDescriptorType m_DescrType;
     CODBC_RowResult*  m_Res;
     bool m_HasMoreResults;
     bool m_DumpResults;
@@ -762,9 +762,8 @@ protected:
                             I_Result::EGetItem policy = I_Result::eAppendLOB);
     virtual size_t          ReadItem(void* buffer, size_t buffer_size,
                                      bool* is_null = 0);
-    virtual I_ITDescriptor* GetImageOrTextDescriptor(void);
-    CDB_ITDescriptor* GetImageOrTextDescriptor(int item_no,
-                                               const string& cond);
+    virtual I_BlobDescriptor* GetBlobDescriptor(void);
+    CDB_BlobDescriptor*     GetBlobDescriptor(int item_no, const string& cond);
     virtual bool            SkipItem(void);
 
     int xGetData(SQLSMALLINT target_type, SQLPOINTER buffer,
@@ -889,7 +888,7 @@ protected:
                             I_Result::EGetItem policy = I_Result::eAppendLOB);
     virtual size_t          ReadItem(void* buffer, size_t buffer_size,
                                      bool* is_null = 0);
-    virtual I_ITDescriptor* GetImageOrTextDescriptor(void);
+    virtual I_BlobDescriptor* GetBlobDescriptor(void);
     virtual bool            SkipItem(void);
 
 protected:
diff --git a/c++/include/dbapi/driver/odbc/unix_odbc/odbcinst.h b/c++/include/dbapi/driver/odbc/unix_odbc/odbcinst.h
index 8fd1e8f..df129ef 100644
--- a/c++/include/dbapi/driver/odbc/unix_odbc/odbcinst.h
+++ b/c++/include/dbapi/driver/odbc/unix_odbc/odbcinst.h
@@ -12,6 +12,8 @@
 #ifndef __ODBCINST_H
 #define __ODBCINST_H
 
+#include <stdio.h>
+
 #ifndef BOOL
 #define BOOL	int
 #endif
@@ -21,16 +23,54 @@
 #endif
 
 
-/********************************************************
- * WINDOW HANDLE
- * Create and init one of these before calling a function which requires
- * a HWND. Then pass this as HWND arg with a cast.
- * The unixODBC function will use the szGUI to look for a GUI plugin lib.
- ********************************************************/
+/*!
+ *  \brief  Our generic window handle.
+ *
+ *  This is used wherever a HWND is needed. The caller inits this according
+ *  to which UI the caller has (or simply desires). This may be a; console, xlib, qt3, qt4, 
+ *  gtk, mono, carbon, etc.
+ *
+ *  SQLCreateDataSource
+ *  (maps to ODBCCreateDataSource entry point in UI plugin)
+ *
+ *      This function requires a HWND (and it must NOT be NULL as per ODBC spec.). So 
+ *      the caller should *always* init an ODBCINSTWND and cast it to HWND as it is passed to 
+ *      SQLCreateDataSource. 
+ *
+ *  SQLManageDataSources 
+ *  (maps to ODBCManageDataSources entry point in UI plugin)
+ *
+ *      This function requires a HWND (and it must NOT be NULL as per ODBC spec.). So 
+ *      the caller should *always* init an ODBCINSTWND and cast it to HWND as it is passed to 
+ *      SQLManageDataSources. However; it may make sense to have a NULL hWnd... this is what 
+ *      an ODBC Administrator program would typically do.
+ *
+ *  Plugin Selection
+ *
+ *      1. Passing a NULL to a function instead of a valid HODBCINSTWND may result in an error
+ *      (this is the case with SQLCreateDataSource). In anycase; passing a NULL in this way 
+ *      negates the use of any UI plugin.
+ *      
+ *      2. szUI has a value and it is the file name (no path and no extension) of the UI
+ *      plugin. The plugin is loaded and the appropriate function is called with hWnd. The 
+ *      caller must have init hWnd in a manner which is appropriate for the UI plugin.
+ *      
+ *      3. Passing an empty szUI indicates that the UI plugin should be determined by other 
+ *      means (see 4). In such a case it is dangerous to use hWnd because it may not match 
+ *      the type expected by the plugin. hWnd will be ignored and a NULL will be passed to the UI
+ *      plugin.
+ *      
+ *      4. The fallback logic for determining the UI plugin is as follows;
+ *          - use the ODBCINSTUI environment variable to get the UI plugin file name
+ *          - use the ODBCINSTUI value in odbcinst.ini to get the UI plugin file name 
+ *
+ *  NOTE:   In the future we may want to consider making HWND of this type instead of having
+ *          two different types and having to cast HODBCINSTWND into a HWND.
+ */
 typedef struct  tODBCINSTWND
 {
-    char szGUI[21];                                 /* SHORT NAME FOR GUI; Qt, GTK, X, CONSOLE (case insensitive)                           */
-    HWND hWnd;                                      /* WINDOW HANDLE (i.e. pointer to a QWidget for Qt)                                     */
+    char szUI[FILENAME_MAX];    /*!< Plugin file name (no path and no extension) ie "odbcinstQ4".                       */
+    HWND hWnd;                  /*!< this is passed to the UI plugin - caller must know what the plugin is expecting    */
 		 
 } ODBCINSTWND, *HODBCINSTWND;
 
@@ -251,6 +291,167 @@ BOOL INSTAPI ConfigDriver(HWND hwndParent,
                           WORD 	*pcbMsgOut);
 #endif
 
+/*
+ * UNICODE APIs
+ */
+
+BOOL INSTAPI SQLInstallODBCW          (HWND       hwndParent,
+                                      LPCWSTR     lpszInfFile,
+									  LPCWSTR     lpszSrcPath,
+									  LPCWSTR     lpszDrivers);
+BOOL INSTAPI SQLCreateDataSourceW     (HWND       hwndParent,
+                                      LPCWSTR     lpszDSN);
+
+BOOL INSTAPI SQLGetTranslatorW        (HWND       hwnd,
+                                      LPWSTR      lpszName,
+                                      WORD       cbNameMax,
+                                      WORD     *pcbNameOut,
+                                      LPWSTR      lpszPath,
+                                      WORD       cbPathMax,
+                                      WORD     *pcbPathOut,
+                                      DWORD    *pvOption);
+BOOL INSTAPI SQLInstallDriverW        (LPCWSTR     lpszInfFile,
+                                      LPCWSTR     lpszDriver,
+                                      LPWSTR      lpszPath,
+                                      WORD       cbPathMax,
+                                      WORD      * pcbPathOut);
+BOOL INSTAPI SQLInstallDriverManagerW (LPWSTR      lpszPath,
+                                      WORD       cbPathMax,
+                                      WORD      * pcbPathOut);
+BOOL INSTAPI SQLGetInstalledDriversW  (LPWSTR      lpszBuf,
+                                      WORD       cbBufMax,
+                                      WORD      * pcbBufOut);
+BOOL INSTAPI SQLGetAvailableDriversW  (LPCWSTR     lpszInfFile,
+                                      LPWSTR      lpszBuf,
+                                      WORD       cbBufMax,
+                                      WORD      * pcbBufOut);
+BOOL INSTAPI SQLConfigDataSourceW     (HWND       hwndParent,
+                                      WORD       fRequest,
+                                      LPCWSTR     lpszDriver,
+                                      LPCWSTR     lpszAttributes);
+BOOL INSTAPI SQLWriteDSNToIniW        (LPCWSTR     lpszDSN,
+                                      LPCWSTR     lpszDriver);
+BOOL INSTAPI SQLRemoveDSNFromIniW     (LPCWSTR     lpszDSN);
+BOOL INSTAPI SQLValidDSNW             (LPCWSTR     lpszDSN);
+
+BOOL INSTAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection,
+                                         LPCWSTR lpszEntry,
+                                         LPCWSTR lpszString,
+                                         LPCWSTR lpszFilename);
+
+int  INSTAPI SQLGetPrivateProfileStringW( LPCWSTR lpszSection,
+                                        LPCWSTR lpszEntry,
+                                        LPCWSTR lpszDefault,
+                                        LPWSTR  lpszRetBuffer,
+                                        int    cbRetBuffer,
+                                        LPCWSTR lpszFilename);
+
+#if (ODBCVER >= 0x0250)
+BOOL INSTAPI SQLInstallTranslatorW(LPCWSTR lpszInfFile,
+                                  LPCWSTR lpszTranslator,
+                                  LPCWSTR lpszPathIn,
+                                  LPWSTR  lpszPathOut,
+                                  WORD   cbPathOutMax,
+                                  WORD  *pcbPathOut,
+                                  WORD   fRequest,
+                                  LPDWORD   lpdwUsageCount);
+BOOL INSTAPI SQLRemoveTranslatorW(LPCWSTR lpszTranslator,
+                                 LPDWORD lpdwUsageCount);
+BOOL INSTAPI SQLRemoveDriverW(LPCWSTR lpszDriver,
+                             BOOL fRemoveDSN,
+                             LPDWORD lpdwUsageCount);
+BOOL INSTAPI SQLConfigDriverW(HWND hwndParent,
+                             WORD fRequest,
+                             LPCWSTR lpszDriver,
+                             LPCWSTR lpszArgs,
+                             LPWSTR  lpszMsg,
+                             WORD   cbMsgMax,
+                             WORD   *pcbMsgOut);
+#endif
+
+#if (ODBCVER >= 0x0300)
+SQLRETURN   INSTAPI SQLInstallerErrorW(WORD iError,
+                            DWORD   *pfErrorCode,
+                            LPWSTR  lpszErrorMsg,
+                            WORD    cbErrorMsgMax,
+                            WORD    *pcbErrorMsg);
+SQLRETURN INSTAPI   SQLPostInstallerErrorW(DWORD dwErrorCode,
+                            LPCWSTR lpszErrorMsg);
+
+BOOL INSTAPI SQLWriteFileDSNW(LPCWSTR  lpszFileName,
+                              LPCWSTR  lpszAppName,
+                              LPCWSTR  lpszKeyName,
+                              LPCWSTR  lpszString);
+
+BOOL INSTAPI  SQLReadFileDSNW(LPCWSTR  lpszFileName,
+                              LPCWSTR  lpszAppName,
+                              LPCWSTR  lpszKeyName,
+                              LPWSTR   lpszString,
+                              WORD     cbString,
+                              WORD    *pcbString);
+BOOL INSTAPI SQLInstallDriverExW(LPCWSTR lpszDriver,
+                             LPCWSTR       lpszPathIn,
+                             LPWSTR    lpszPathOut,
+                             WORD      cbPathOutMax,
+                             WORD     *pcbPathOut,
+                             WORD       fRequest,
+                             LPDWORD    lpdwUsageCount);
+BOOL INSTAPI SQLInstallTranslatorExW(LPCWSTR lpszTranslator,
+                                  LPCWSTR lpszPathIn,
+                                  LPWSTR  lpszPathOut,
+                                  WORD   cbPathOutMax,
+                                  WORD  *pcbPathOut,
+                                  WORD   fRequest,
+                                  LPDWORD   lpdwUsageCount);
+#endif  /* ODBCVER >= 0x0300 */
+
+/*  Driver specific Setup APIs called by installer */
+
+BOOL INSTAPI ConfigDSNW (HWND   hwndParent,
+                        WORD    fRequest,
+                        LPCWSTR lpszDriver,
+                        LPCWSTR lpszAttributes);
+
+
+#if (ODBCVER >= 0x0250)
+BOOL INSTAPI ConfigDriverW(HWND hwndParent,
+                          WORD fRequest,
+                          LPCWSTR lpszDriver,
+                          LPCWSTR lpszArgs,
+                          LPWSTR  lpszMsg,
+                          WORD   cbMsgMax,
+                          WORD  *pcbMsgOut);
+#endif
+
+#ifndef SQL_NOUNICODEMAP    /* define this to disable the mapping */
+#ifdef  UNICODE
+
+#define  SQLInstallODBC                 SQLInstallODBCW          
+#define  SQLCreateDataSource            SQLCreateDataSourceW 
+#define  SQLGetTranslator               SQLGetTranslatorW     
+#define  SQLInstallDriver               SQLInstallDriverW      
+#define  SQLInstallDriverManager        SQLInstallDriverManagerW
+#define  SQLGetInstalledDrivers         SQLGetInstalledDriversW
+#define  SQLGetAvailableDrivers         SQLGetAvailableDriversW 
+#define  SQLConfigDataSource            SQLConfigDataSourceW
+#define  SQLWriteDSNToIni               SQLWriteDSNToIniW    
+#define  SQLRemoveDSNFromIni            SQLRemoveDSNFromIniW  
+#define  SQLValidDSN                    SQLValidDSNW           
+#define  SQLWritePrivateProfileString   SQLWritePrivateProfileStringW
+#define  SQLGetPrivateProfileString     SQLGetPrivateProfileStringW
+#define  SQLInstallTranslator           SQLInstallTranslatorW
+#define  SQLRemoveTranslator            SQLRemoveTranslatorW
+#define  SQLRemoveDriver                SQLRemoveDriverW
+#define  SQLConfigDriver                SQLConfigDriverW
+#define  SQLInstallerError              SQLInstallerErrorW
+#define  SQLPostInstallerError          SQLPostInstallerErrorW
+#define  SQLReadFileDSN                 SQLReadFileDSNW
+#define  SQLWriteFileDSN                SQLWriteFileDSNW
+#define  SQLInstallDriverEx             SQLInstallDriverExW
+#define  SQLInstallTranslatorEx         SQLInstallTranslatorExW
+
+#endif 
+#endif
 
 #ifdef __cplusplus
 }
diff --git a/c++/include/dbapi/driver/odbc/unix_odbc/sql.h b/c++/include/dbapi/driver/odbc/unix_odbc/sql.h
index 896f8f7..7f0ce00 100644
--- a/c++/include/dbapi/driver/odbc/unix_odbc/sql.h
+++ b/c++/include/dbapi/driver/odbc/unix_odbc/sql.h
@@ -12,7 +12,7 @@
  * default to 3.51 declare something else before here and you get a whole new ball of wax
  ***************************/
 #ifndef ODBCVER
-#define ODBCVER 0x0351
+#define ODBCVER 0x0380
 #endif
 
 #ifndef __SQLTYPES_H
@@ -39,6 +39,10 @@ extern "C" {
 #define SQL_NEED_DATA             99
 #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
 
+#if (ODBCVER >= 0x0380)
+#define SQL_PARAM_DATA_AVAILABLE    101  
+#endif
+
 /****************************
  * use these to indicate string termination to some function
  ***************************/
@@ -391,6 +395,10 @@ extern "C" {
 #define SQL_API_SQLTABLES              54
 #define SQL_API_SQLTRANSACT            23
 
+#if (ODBCVER >= 0x0380)
+#define SQL_API_SQLCANCELHANDLE      1022
+#endif
+
 /* Information requested by SQLGetInfo() */
 #if (ODBCVER >= 0x0300)
 #define SQL_MAX_DRIVER_CONNECTIONS           0
@@ -594,13 +602,23 @@ extern "C" {
 
     SQLRETURN  SQL_API SQLCancel(SQLHSTMT StatementHandle);
 
+#if (ODBCVER >= 0x0380)
+SQLRETURN  SQL_API SQLCancelHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle);
+#endif 
+
+
 #if (ODBCVER >= 0x0300)
     SQLRETURN  SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);
 
-    SQLRETURN  SQL_API SQLColAttribute (SQLHSTMT StatementHandle,
+    SQLRETURN  SQL_API SQLColAttribute(SQLHSTMT StatementHandle,
                                         SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
                                         SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
-                                        SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute /* spec says (SQLPOINTER) not (SQLEN*) - PAH */ );
+                                        SQLSMALLINT *StringLength, SQLLEN *NumericAttribute );
+
+										/* spec says (SQLPOINTER) not (SQLEN*) - PAH */
+										/* Ms now say SQLLEN* 
+                                           http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp - NG */
+										
 #endif
 
 
@@ -655,7 +673,7 @@ extern "C" {
 
 #if (ODBCVER >= 0x0300)
     SQLRETURN  SQL_API SQLFetchScroll(SQLHSTMT StatementHandle,
-                                      SQLSMALLINT FetchOrientation, SQLROWOFFSET FetchOffset);
+                                      SQLSMALLINT FetchOrientation, SQLLEN FetchOffset);
 #endif
 
     SQLRETURN  SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle);
@@ -791,7 +809,7 @@ extern "C" {
 #endif
 
     SQLRETURN  SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle,
-                                        SQLUSMALLINT Option, SQLROWCOUNT Value);
+                                        SQLUSMALLINT Option, SQLULEN Value);
 
     SQLRETURN  SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle,
                                          SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
diff --git a/c++/include/dbapi/driver/odbc/unix_odbc/sqlext.h b/c++/include/dbapi/driver/odbc/unix_odbc/sqlext.h
index 3b67b30..04c8657 100644
--- a/c++/include/dbapi/driver/odbc/unix_odbc/sqlext.h
+++ b/c++/include/dbapi/driver/odbc/unix_odbc/sqlext.h
@@ -98,6 +98,12 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define	SQL_OV_ODBC3						3UL
 #endif  /* ODBCVER >= 0x0300 */
 
+#if (ODBCVER >= 0x0380)
+/* new values for SQL_ATTR_ODBC_VERSION */
+/* From ODBC 3.8 onwards, we should use <major version> * 100 + <minor version> */
+#define SQL_OV_ODBC3_80                     380UL
+#endif  /* ODBCVER >= 0x0380 */
+
 /* connection attributes */
 #define SQL_ACCESS_MODE                 101
 #define SQL_AUTOCOMMIT                  102
@@ -134,6 +140,8 @@ extern "C" {                         /* Assume C declarations for C++ */
 
 #define SQL_ATTR_CONNECTION_DEAD	1209	/* GetConnectAttr only */
 
+#define SQL_ATTR_DRIVER_THREADING	1028	/* Driver threading level */
+
 #if (ODBCVER >= 0x0351)
 /*	ODBC Driver Manager sets this connection attribute to a unicode driver
 	(which supports SQLConnectW) when the application is an ANSI application
@@ -150,6 +158,11 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_ATTR_ANSI_APP			115
 #endif
 
+#if (ODBCVER >= 0x0380)
+#define SQL_ATTR_RESET_CONNECTION   116
+#define SQL_ATTR_ASYNC_DBC_FUNCTIONS_ENABLE    117
+#endif
+
 /* SQL_CONNECT_OPT_DRVR_START is not meaningful for 3.0 driver */
 #if (ODBCVER < 0x0300)
 #define SQL_CONNECT_OPT_DRVR_START      1000
@@ -177,7 +190,11 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_OPT_TRACE_OFF               0UL
 #define SQL_OPT_TRACE_ON                1UL
 #define SQL_OPT_TRACE_DEFAULT           SQL_OPT_TRACE_OFF
-#define SQL_OPT_TRACE_FILE_DEFAULT      "\\SQL.LOG"
+#ifdef _WINDOWS_
+#define SQL_OPT_TRACE_FILE_DEFAULT      "\\temp\\SQL.LOG"
+#else
+#define SQL_OPT_TRACE_FILE_DEFAULT      "/tmp/SQL.LOG"
+#endif
 
 /* SQL_ODBC_CURSORS options */
 #define SQL_CUR_USE_IF_NEEDED           0UL
@@ -205,6 +222,18 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_AA_FALSE					0L	/* the application is a Unicode app */
 #endif
 
+/* values for SQL_ATTR_RESET_CONNECTION */
+#if (ODBCVER >= 0x0380)
+#define SQL_RESET_CONNECTION_YES        1UL
+#endif
+
+/* values for SQL_ATTR_ASYNC_DBC_FUNCTIONS_ENABLE */
+#if (ODBCVER >= 0x0380)
+#define SQL_ASYNC_DBC_ENABLE_ON         1UL
+#define SQL_ASYNC_DBC_ENABLE_OFF        0UL
+#define SQL_ASYNC_DBC_ENABLE_DEFAULT    SQL_ASYNC_DBC_ENABLE_OFF
+#endif 
+
 /* statement attributes */
 #define SQL_QUERY_TIMEOUT		0
 #define SQL_MAX_ROWS			1
@@ -253,6 +282,10 @@ extern "C" {                         /* Assume C declarations for C++ */
 
 #endif  /* ODBCVER >= 0x0300 */
 
+#if (ODBCVER >= 0x0380)
+#define SQL_ATTR_ASYNC_STMT_EVENT           29
+#endif /* ODBCVER >= 0x0380 */
+
 #if (ODBCVER < 0x0300)
 #define SQL_STMT_OPT_MAX                SQL_ROW_NUMBER
 #define SQL_STMT_OPT_MIN	SQL_QUERY_TIMEOUT
@@ -524,7 +557,7 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_C_USHORT     (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/
 #define SQL_C_UTINYINT   (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/
 
-#if (ODBCVER >= 0x0300) && (SIZEOF_LONG == 8) && defined(DO_YOU_KNOW_WHAT_YOUR_ARE_DOING)
+#if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE)
 #define SQL_C_BOOKMARK   SQL_C_UBIGINT                     /* BOOKMARK        */
 #else
 #define SQL_C_BOOKMARK   SQL_C_ULONG                       /* BOOKMARK        */
@@ -540,6 +573,29 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_TYPE_MAX                    SQL_VARCHAR
 #endif
 
+/* base value of driver-specific C-Type (max is 0x7fff) */
+/* define driver-specific C-Type, named as SQL_DRIVER_C_TYPE_BASE, */
+/* SQL_DRIVER_C_TYPE_BASE+1, SQL_DRIVER_C_TYPE_BASE+2, etc. */
+#if (ODBCVER >= 0x380)
+#define SQL_DRIVER_C_TYPE_BASE      0x4000
+#endif
+
+/* base value of driver-specific fields/attributes (max are 0x7fff [16-bit] or 0x00007fff [32-bit]) */
+/* define driver-specific SQL-Type, named as SQL_DRIVER_SQL_TYPE_BASE, */
+/* SQL_DRIVER_SQL_TYPE_BASE+1, SQL_DRIVER_SQL_TYPE_BASE+2, etc. */
+/* */
+/* Please note that there is no runtime change in this version of DM. */
+/* However, we suggest that driver manufacturers adhere to this range */
+/* as future versions of the DM may enforce these constraints */
+#if (ODBCVER >= 0x380)
+#define SQL_DRIVER_SQL_TYPE_BASE    0x4000
+#define SQL_DRIVER_DESC_FIELD_BASE  0x4000
+#define SQL_DRIVER_DIAG_FIELD_BASE  0x4000
+#define SQL_DRIVER_INFO_TYPE_BASE   0x4000
+#define SQL_DRIVER_CONN_ATTR_BASE   0x00004000 
+#define SQL_DRIVER_STMT_ATTR_BASE   0x00004000
+#endif
+
 #if (ODBCVER >= 0x0300)
 #define SQL_C_VARBOOKMARK		SQL_C_BINARY
 #endif  /* ODBCVER >= 0x0300 */
@@ -559,11 +615,11 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_COLUMN_IGNORE			SQL_IGNORE
 #endif  /* ODBCVER >= 0x0300 */
 #define SQL_LEN_DATA_AT_EXEC_OFFSET  (-100)
-#define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
+#define SQL_LEN_DATA_AT_EXEC(length) (SQL_LEN_DATA_AT_EXEC_OFFSET-(length))
 
 /* binary length for driver specific attributes */
 #define SQL_LEN_BINARY_ATTR_OFFSET	 (-100)
-#define SQL_LEN_BINARY_ATTR(length)	 (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)
+#define SQL_LEN_BINARY_ATTR(length)  (SQL_LEN_BINARY_ATTR_OFFSET-(length))
 
 /* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter
 */
@@ -763,6 +819,7 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_CONVERT_VARBINARY               69
 #define SQL_CONVERT_VARCHAR                 70
 #define SQL_CONVERT_LONGVARBINARY           71
+#define SQL_CONVERT_GUID           			173
 #define SQL_ODBC_SQL_OPT_IEF                73		/* SQL_INTEGRITY */
 #define SQL_CORRELATION_NAME                74
 #define SQL_NON_NULLABLE_COLUMNS            75
@@ -888,6 +945,21 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_UNION_STATEMENT						SQL_UNION
 #endif  /* ODBCVER >= 0x0300 */
 
+#if (ODBCVER >= 0x0380)
+/* Info Types */
+#define SQL_ASYNC_DBC_FUNCTIONS                 10023
+#endif 
+
+#define SQL_DRIVER_AWARE_POOLING_SUPPORTED      10024
+
+#if (ODBCVER >= 0x0380)
+#define SQL_ASYNC_NOTIFICATION                  10025
+
+/* Possible values for SQL_ASYNC_NOTIFICATION */
+#define SQL_ASYNC_NOTIFICATION_NOT_CAPABLE      0x00000000L
+#define SQL_ASYNC_NOTIFICATION_CAPABLE          0x00000001L
+#endif /* ODBCVER >= 0x0380 */
+
 #define	SQL_DTC_TRANSITION_COST					1750
 
 /* SQL_ALTER_TABLE bitmasks */
@@ -941,6 +1013,7 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define	SQL_CVT_WCHAR						0x00200000L
 #define	SQL_CVT_WLONGVARCHAR				0x00400000L
 #define	SQL_CVT_WVARCHAR					0x00800000L
+#define	SQL_CVT_GUID						0x01000000L
 
 #endif  /* ODBCVER >= 0x0300 */
 
@@ -1220,6 +1293,9 @@ extern "C" {                         /* Assume C declarations for C++ */
 
 #define SQL_GD_BLOCK                        0x00000004L
 #define SQL_GD_BOUND                        0x00000008L
+#if (ODBCVER >= 0x0380)
+    #define SQL_GD_OUTPUT_PARAMS            0x00000010L
+#endif
 
 /* SQL_POSITIONED_STATEMENTS masks */
 
@@ -1624,12 +1700,21 @@ extern "C" {                         /* Assume C declarations for C++ */
 #define SQL_US_UNION							SQL_U_UNION
 #define SQL_US_UNION_ALL						SQL_U_UNION_ALL
 
+/* values for SQL_DRIVER_AWARE_POOLING_SUPPORTED */
+#define SQL_DRIVER_AWARE_POOLING_NOT_CAPABLE    0x00000000L
+#define SQL_DRIVER_AWARE_POOLING_CAPABLE        0x00000001L
 #endif  /* ODBCVER >= 0x0300 */
 
 /* SQL_DTC_TRANSITION_COST bitmasks */
 #define SQL_DTC_ENLIST_EXPENSIVE				0x00000001L
 #define SQL_DTC_UNENLIST_EXPENSIVE				0x00000002L
 
+#if (ODBCVER >= 0x0380)
+/* possible values for SQL_ASYNC_DBC_FUNCTIONS */
+#define SQL_ASYNC_DBC_NOT_CAPABLE               0x00000000L
+#define SQL_ASYNC_DBC_CAPABLE                   0x00000001L
+#endif 
+
 /* additional SQLDataSources fetch directions */
 #if (ODBCVER >= 0x0300)
 #define SQL_FETCH_FIRST_USER				31
@@ -1769,6 +1854,11 @@ SQLRETURN SQL_API SQLDriverConnect(
 #define SQL_RESULT_COL                   3
 #define SQL_PARAM_OUTPUT                 4
 #define SQL_RETURN_VALUE                 5
+#if (ODBCVER >= 0x0380)
+    #define SQL_PARAM_INPUT_OUTPUT_STREAM   8
+    #define SQL_PARAM_OUTPUT_STREAM         16
+#endif
+
 
 /* Defines for SQLProcedures (returned in the result set) */
 #define SQL_PT_UNKNOWN                   0
@@ -1853,9 +1943,9 @@ SQLRETURN SQL_API SQLDescribeParam(
 SQLRETURN SQL_API SQLExtendedFetch(
     SQLHSTMT           hstmt,
     SQLUSMALLINT       fFetchType,
-    SQLROWOFFSET       irow,
-    SQLROWSETSIZE 	  *pcrow,
-    SQLUSMALLINT 	  *rgfRowStatus);
+    SQLLEN             irow,
+    SQLULEN 	  	   *pcrow,
+    SQLUSMALLINT 	   *rgfRowStatus);
 
 SQLRETURN SQL_API SQLForeignKeys(
     SQLHSTMT           hstmt,
@@ -1889,8 +1979,8 @@ SQLRETURN SQL_API SQLNumParams(
 
 SQLRETURN SQL_API SQLParamOptions(
     SQLHSTMT           hstmt,
-    SQLUINTEGER        crow,
-    SQLUINTEGER 	  *pirow);
+    SQLULEN        	   crow,
+    SQLULEN 	  	   *pirow);
 
 SQLRETURN SQL_API SQLPrimaryKeys(
     SQLHSTMT           hstmt,
@@ -2017,24 +2107,46 @@ SQLRETURN SQL_API SQLSetScrollOptions(    /*      Use SQLSetStmtOptions */
     SQLLEN             crowKeyset,
     SQLUSMALLINT       crowRowset);
 
-/* Tracing section */
-
-#define		TRACE_VERSION	1000		/* Version of trace API */
-
+/*!
+ * \defgroup    Tracing.
+ *
+ *              unixODBC implements a slight variation of the tracing mechanism used 
+ *              on MS platforms. The unixODBC method loses the ability to produce trace
+ *              output for invalid handles but gains the following;
+ *
+ *              - better concurrency 
+ *              - allows tracing to be turned on/off and configured at finer granularity
+ *              - hopefully; better performance
+ *
+ *              unixODBC provides a cross-platform helper library called 'trace' and an
+ *              example/default trace plugin called 'odbctrac'. Those writing an ODBC 
+ *              driver can use the 'trace' helper library (a static library). Those wanting
+ *              to create custom trace output can implement a different version of the
+ *              'odbctrac' plugin.
+ *
+ *              The text file driver (odbctxt) included with unixODBC is an example of a 
+ *              driver using the 'trace' helper library.
+ *
+ *              The 'trace' library and the example plugin 'odbctrac' are designed to be 
+ *              portable on all platforms where unixODBC is available and on MS platforms.
+ *              This will allow drivers using 'trace' and 'odbctrac' plugin to equilly 
+ *              portable. On MS platforms - this compliments traditional tracing (mostly
+ *              just used by the Driver Manager).
+ *
+ * \sa          trace
+ *              odbctxt
+ *              odbctrac
+ */
+/*@{*/
+#define	TRACE_VERSION 1000                                  /*!< Version of trace API                               */
 #ifdef UNICODE
-RETCODE	 TraceOpenLogFile(LPWSTR,LPWSTR,DWORD); 	/* open a trace log file				*/
-#endif
-#ifdef __cplusplus
-RETCODE	 TraceCloseLogFile();					    /* Request to close a trace log			*/
+RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); 	/*!< open a trace log file				                */
 #else
-RETCODE	 TraceCloseLogFile(VOID);				    /* Request to close a trace log			*/
-#endif
-VOID	 TraceReturn(RETCODE,RETCODE);			/* Processes trace after FN is called	*/
-#ifdef __cplusplus
-DWORD	 TraceVersion();							/* Returns trace API version			*/
-#else
-DWORD	 TraceVersion(VOID);							/* Returns trace API version			*/
+RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); 	/*!< open a trace log file				                */
 #endif
+RETCODE TraceCloseLogFile(SQLPOINTER);					    /*!< Request to close a trace log		                */
+SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN);                /*!< Call to produce trace output upon function return. */
+DWORD	 TraceVersion(void);						        /*!< Returns trace API version			                */
 
 /* Functions for Visual Studio Analyzer*/
 /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits  */
@@ -2067,13 +2179,24 @@ typedef struct tagODBC_VS_ARGS {
 	RETCODE	RetCode;
 } ODBC_VS_ARGS, *PODBC_VS_ARGS;
 
-VOID	FireVSDebugEvent(PODBC_VS_ARGS);
-
+void	FireVSDebugEvent(PODBC_VS_ARGS);
+/*@}*/
 
 #ifdef __cplusplus
 }
 #endif
 
+/*
+ * connection pooling retry times
+ */
+
+BOOL ODBCSetTryWaitValue ( DWORD dwValue );
+#ifdef __cplusplus
+DWORD ODBCGetTryWaitValue ( );
+#else
+DWORD ODBCGetTryWaitValue ( void );
+#endif
+
 #ifndef __SQLUCODE_H
 #include "sqlucode.h"
 #endif
diff --git a/c++/include/dbapi/driver/odbc/unix_odbc/sqlspi.h b/c++/include/dbapi/driver/odbc/unix_odbc/sqlspi.h
new file mode 100644
index 0000000..e0a9d26
--- /dev/null
+++ b/c++/include/dbapi/driver/odbc/unix_odbc/sqlspi.h
@@ -0,0 +1,173 @@
+/*-----------------------------------------------------------------------------
+ File:            sqlspi.h
+
+ Contents:        This is the header for driver writers to support new ODBC 
+                  features. Application writers should not include 
+                  this header file
+                  Please include <sql.h> and <sqlext.h> before including this 
+                  file
+
+ Based on the sqlspi.h provided by Microsoft
+
+-----------------------------------------------------------------------------*/
+
+#ifndef __SQLSPI__
+#define __SQLSPI__
+
+#ifdef __cplusplus
+extern "C" {           // Assume C declarations for C++
+#endif                 // End of __cplusplus 
+
+/* SQL_SPI is just a marker for "Service Provider Interface", otherwise it is the same as API
+   Application should not call functions that are marked as SQL_SPI directly */
+#define SQL_SPI  SQL_API
+
+/*-------------------- ODBC Connection Info Handle -----------------------------*/
+/* handle for storing connection information for ODBC driver connection pooling */
+#define SQL_HANDLE_DBC_INFO_TOKEN               6       // Handle type, used in SQLAllocHandle
+typedef SQLHANDLE SQLHDBC_INFO_TOKEN;
+
+/*-------------------- ODBC Pool ID for driver-aware pooling -----------------------------*/
+typedef SQLULEN     POOLID;
+typedef DWORD*      TRANSID;
+
+/*-------------------- Driver-aware Connection Pooling --------------------------*/
+/* We define a few scores with special meaning */
+/* But driver can return any score between 0 and 100 */
+typedef DWORD SQLConnPoolRating;
+#define SQL_CONN_POOL_RATING_BEST               100     /* the best of the rating */
+#define SQL_CONN_POOL_RATING_GOOD_ENOUGH        99      /* the rating is good enough and we can stop rating */
+#define SQL_CONN_POOL_RATING_USELESS            0       /* the candidate connection must not be reused for the current request */
+
+/* SQLSetConnectAttr */
+#define SQL_ATTR_DBC_INFO_TOKEN                 118     /* reset the pooled connection in case it is not a perfect match */
+
+/* Set connection attributes into DBC info token */
+SQLRETURN SQL_SPI SQLSetConnectAttrForDbcInfoW(
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    SQLINTEGER          Attribute,
+    SQLPOINTER          Value,
+    SQLINTEGER          StringLength);
+
+/* Set connection information for SQLDriverConnect */
+SQLRETURN SQL_SPI SQLSetDriverConnectInfoW(
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    SQLWCHAR            *szConnStrIn,
+    SQLSMALLINT         cchConnStrIn);
+
+/* Set connection information for SQLConnect */
+SQLRETURN SQL_SPI SQLSetConnectInfoW
+(
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    SQLWCHAR            *szDSN,
+    SQLSMALLINT         cchDSN,
+    SQLWCHAR            *szUID,
+    SQLSMALLINT         cchUID,
+    SQLWCHAR            *szAuthStr,
+    SQLSMALLINT         cchAuthStr
+);
+
+/* Get the pool ID for the token */
+SQLRETURN SQL_SPI SQLGetPoolID(
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    POOLID*             pPoolID);
+
+/* Return how close hCandidateConnection matches with hRequest */
+/* *pRating must be between SQL_CONN_POOL_RATING_USELESS and SQL_CONN_POOL_RATING_BEST (inclusively) */
+/* If return value is not SQL_SUCCESS or *pRating > SQL_CONN_POOL_RATING_BEST, the candidate */
+/* connection will not be used any more in any other connection request */
+/* If fRequiresTransactionEnlistment is TRUE, transId represents the DTC transaction ID that */
+/* should be enlisted to (transId == 0 means unenlistment). Otherwise, transId should be ignored */
+SQLRETURN SQL_SPI SQLRateConnection(
+    SQLHDBC_INFO_TOKEN  hRequest,
+    SQLHDBC             hCandidateConnection,
+    BOOL                fRequiresTransactionEnlistment,
+    TRANSID             transId,
+    SQLConnPoolRating   *pRating);
+
+/* Create a physical connection */
+/* If application is calling SQLDriverConnect, szConnStrOut is non-NULL at input.  */
+/* Otherwise, it will be set to NULL */
+SQLRETURN SQL_SPI SQLPoolConnectW(
+    SQLHDBC             hdbc,
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    SQLWCHAR            *szConnStrOut, 
+    SQLSMALLINT         cchConnStrOutMax,
+    SQLSMALLINT         *pcchConnStrOut);
+
+/* Clean up a pool Id that was timed out */
+/*/ poolID [in]: the pool ID (under EnvironmentHandle) to be cleaned */
+SQLRETURN SQL_SPI SQLCleanupConnectionPoolID(
+    SQLHENV             EnvironmentHandle,
+    POOLID              poolID);
+
+/*-----------------------------------------------------------------------------*/
+/* functions for ANSI drivers */
+
+/* Set connection attributes into DBC info token */
+SQLRETURN SQL_SPI SQLSetConnectAttrForDbcInfoA(
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    SQLINTEGER          Attribute,
+    SQLPOINTER          Value,
+    SQLINTEGER          StringLength);
+
+/* Set connection information for SQLDriverConnect */
+SQLRETURN SQL_SPI SQLSetDriverConnectInfoA(
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    SQLCHAR             *szConnStrIn,
+    SQLSMALLINT         cchConnStrIn);
+
+/* Set connection information for SQLConnect */
+SQLRETURN SQL_SPI SQLSetConnectInfoA
+(
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    SQLCHAR             *szDSN,
+    SQLSMALLINT         cchDSN,
+    SQLCHAR             *szUID,
+    SQLSMALLINT         cchUID,
+    SQLCHAR             *szAuthStr,
+    SQLSMALLINT         cchAuthStr
+);
+
+/* Create a physical connection */
+/* If application is calling SQLDriverConnect, szConnStrOut is non-NULL at input. */
+/* Otherwise, it will be set to NULL */
+SQLRETURN SQL_SPI SQLPoolConnectA(
+    SQLHDBC             hdbc,
+    SQLHDBC_INFO_TOKEN  hDbcInfoToken,
+    SQLCHAR             *szConnStrOut, 
+    SQLSMALLINT         cchConnStrOutMax,
+    SQLSMALLINT         *pcchConnStrOut);
+
+/*-----------------------------------------------------------------------------*/
+/* Unicode mapping */
+/* Define SQL_NOUNICODEMAP to disable the mapping */
+#if (!defined(SQL_NOUNICODEMAP) && defined(UNICODE))
+#define SQLSetConnectAttrForDbcInfo     SQLSetConnectAttrForDbcInfoW
+#define SQLSetDriverConnectInfo         SQLSetDriverConnectInfoW
+#define SQLSetConnectInfo               SQLSetConnectInfoW
+#define SQLPoolConnect                  SQLPoolConnectW
+#else
+#define SQLSetConnectAttrForDbcInfo     SQLSetConnectAttrForDbcInfoA
+#define SQLSetDriverConnectInfo         SQLSetDriverConnectInfoA
+#define SQLSetConnectInfo               SQLSetConnectInfoA
+#define SQLPoolConnect                  SQLPoolConnectA
+#endif 
+/*------------------------------------------------------------------------------*/
+
+/*-------------------- Async Notification --------------------------*/
+#if (ODBCVER >= 0x0380)
+#define SQL_ATTR_ASYNC_DBC_NOTIFICATION_CALLBACK  120
+#define SQL_ATTR_ASYNC_DBC_NOTIFICATION_CONTEXT   121
+
+#define SQL_ATTR_ASYNC_STMT_NOTIFICATION_CALLBACK 30
+#define SQL_ATTR_ASYNC_STMT_NOTIFICATION_CONTEXT  31
+
+typedef SQLRETURN (SQL_API *SQL_ASYNC_NOTIFICATION_CALLBACK)(SQLPOINTER pContext, BOOL fLast);
+#endif /* ODBCVER >= 0x0380 */
+
+
+#ifdef __cplusplus
+}                   // End of extern "C" {
+#endif
+#endif
diff --git a/c++/include/dbapi/driver/odbc/unix_odbc/sqltypes.h b/c++/include/dbapi/driver/odbc/unix_odbc/sqltypes.h
index c2e6d94..4f961ec 100644
--- a/c++/include/dbapi/driver/odbc/unix_odbc/sqltypes.h
+++ b/c++/include/dbapi/driver/odbc/unix_odbc/sqltypes.h
@@ -20,10 +20,10 @@
 #define __SQLTYPES_H
 
 /****************************
- * default to the 3.51 definitions. should define ODBCVER before here if you want an older set of defines
+ * default to the 3.80 definitions. should define ODBCVER before here if you want an older set of defines
  ***************************/
 #ifndef ODBCVER
-#define ODBCVER	0x0351
+#define ODBCVER	0x0380
 #endif
 
 /*
@@ -45,14 +45,15 @@ extern "C" {
 
 /*
  * this is defined by configure, but will not be on a normal application build
+ * the install creates a unixodbc_conf.h file that contains the current build settings
  */
 
-#ifndef SIZEOF_LONG
-# if defined(__alpha) || defined(__sparcv9) || defined(__LP64__) || (defined(__HOS_AIX__) && defined(_LP64))
-# define SIZEOF_LONG        8
-#else
-# define SIZEOF_LONG        4
+#ifndef SIZEOF_LONG_INT
+#include "unixodbc_conf.h"
 #endif
+
+#ifndef SIZEOF_LONG_INT
+#error "Needs to know how big a long int is to continue!!!"
 #endif
 
 /****************************
@@ -68,7 +69,9 @@ extern "C" {
 #define SQL_API
 #endif
 #define	BOOL				int
+#ifndef _WINDOWS_
 typedef void*				HWND;
+#endif
 typedef char				CHAR;
 #ifdef UNICODE
 
@@ -88,12 +91,8 @@ typedef signed short        TCHAR;
 typedef char				TCHAR;
 #endif
 
-#ifndef DONT_TD_VOID
-typedef void				VOID;
-#endif
-
 typedef unsigned short		WORD;
-#if (SIZEOF_LONG == 4)
+#if (SIZEOF_INT == 2)
 typedef unsigned long		DWORD;
 #else
 typedef unsigned int		DWORD;
@@ -108,11 +107,14 @@ typedef unsigned short 		WCHAR;
 
 typedef WCHAR* 	            LPWSTR;
 typedef const char*         LPCSTR;
+typedef const WCHAR*        LPCWSTR;
 typedef TCHAR*              LPTSTR;
 typedef char*               LPSTR;
 typedef DWORD*           	LPDWORD;
 
+#ifndef _WINDOWS_
 typedef void*               HINSTANCE;
+#endif
 
 #endif
 
@@ -134,33 +136,26 @@ typedef double          SQLFLOAT;
  */
 
 /*
- * I (Nick) have made these changes, to cope with the new 3.52 MS
- * changes for 64 bit ODBC, but looking at MS's spec they havn't
- * finished it themself. For example, SQLBindCol now expects the
- * indicator variable to be a SQLLEN which then is a pointer to 
- * a 64 bit value. However the online book that comes with the 
- * headers, then goes on to describe the indicator_ptr in the 
- * descriptor record (which is set by SQLBindCol) as a pointer
- * to a SQLINTEGER (32 bit). So I don't think its ready for the
- * big time yet. Thats not to mention all the ODBC apps on 64 bit
- * platforms that this would break...
- *
- * I have just discovered that on win64 sizeof(long) == 4, so its
- * all smoke and mirrors...
+ * Hopefully by now it should be safe to assume most drivers know about SQLLEN now
+ * and the defaukt is now sizeof( SQLLEN ) = 8 on 64 bit platforms
  * 
  */
 
-#if (SIZEOF_LONG == 8)
-#ifndef BUILD_REAL_64_BIT_MODE
+#if (SIZEOF_LONG_INT == 8)
+#ifdef BUILD_LEGACY_64_BIT_MODE
 typedef int             SQLINTEGER;
 typedef unsigned int    SQLUINTEGER;
 #define SQLLEN          SQLINTEGER
 #define SQLULEN         SQLUINTEGER
 #define SQLSETPOSIROW   SQLUSMALLINT
-typedef SQLULEN         SQLROWCOUNT;
-typedef SQLULEN         SQLROWSETSIZE;
-typedef SQLULEN         SQLTRANSID;
-typedef SQLLEN          SQLROWOFFSET;
+/* 
+ * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril
+ *
+ typedef SQLULEN         SQLROWCOUNT;
+ typedef SQLULEN         SQLROWSETSIZE;
+ typedef SQLULEN         SQLTRANSID;
+ typedef SQLLEN          SQLROWOFFSET;
+*/
 #else
 typedef int             SQLINTEGER;
 typedef unsigned int    SQLUINTEGER;
@@ -168,16 +163,22 @@ typedef long            SQLLEN;
 typedef unsigned long   SQLULEN;
 typedef unsigned long   SQLSETPOSIROW;
 /* 
- * These are not supprted on 64bit ODBC according to MS 
- * typedef SQLULEN SQLTRANSID;
+ * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril
+ *
+ typedef SQLULEN 		SQLTRANSID;
+ typedef SQLULEN 		SQLROWCOUNT;
+ typedef SQLUINTEGER 	SQLROWSETSIZE;
+ typedef SQLLEN 		SQLROWOFFSET;
  */
-typedef SQLULEN SQLROWCOUNT;
-typedef SQLUINTEGER SQLROWSETSIZE;
-typedef SQLLEN SQLROWOFFSET;
 #endif
 #else
+#if SIZEOF_INT < 4
 typedef long            SQLINTEGER;
 typedef unsigned long   SQLUINTEGER;
+#else
+typedef int             SQLINTEGER;
+typedef unsigned int    SQLUINTEGER;
+#endif
 #define SQLLEN          SQLINTEGER
 #define SQLULEN         SQLUINTEGER
 #define SQLSETPOSIROW   SQLUSMALLINT
@@ -250,7 +251,7 @@ typedef void *          	    HSTMT;
 typedef unsigned char           UCHAR;
 typedef signed char             SCHAR;
 typedef SCHAR                   SQLSCHAR;
-#if (SIZEOF_LONG == 4)
+#if (SIZEOF_LONG_INT == 4)
 typedef long int                SDWORD;
 typedef unsigned long int       UDWORD;
 #else
@@ -370,15 +371,20 @@ typedef struct tagSQL_INTERVAL_STRUCT
 /****************************
  *
  ***************************/
-#if (ODBCVER >= 0x0300)
-#if (SIZEOF_LONG == 8)
-#  define ODBCINT64	    long
-#  define UODBCINT64	unsigned long
-#else
-# ifdef HAVE_LONG_LONG
-#  define ODBCINT64	    long long
-#  define UODBCINT64	unsigned long long
+#ifndef ODBCINT64
+# if (ODBCVER >= 0x0300)
+# if (SIZEOF_LONG_INT == 8)
+#   define ODBCINT64	    long
+#   define UODBCINT64	unsigned long
+#   define ODBCINT64_TYPE	    "long"
+#   define UODBCINT64_TYPE	"unsigned long"
 # else
+#  ifdef HAVE_LONG_LONG
+#   define ODBCINT64	    long long
+#   define UODBCINT64	unsigned long long
+#   define ODBCINT64_TYPE	    "long long"
+#   define UODBCINT64_TYPE	"unsigned long long"
+#  else
 /*
  * may fail in some cases, but what else can we do ?
  */
@@ -392,17 +398,21 @@ struct __bigint_struct_u
     unsigned int    hiword;
     unsigned int    loword;
 };
-#  define ODBCINT64	    struct __bigint_struct
-#  define UODBCINT64	struct __bigint_struct_u
+#   define ODBCINT64	    struct __bigint_struct
+#   define UODBCINT64	struct __bigint_struct_u
+#   define ODBCINT64_TYPE	    "struct __bigint_struct"
+#   define UODBCINT64_TYPE	"struct __bigint_struct_u"
+#  endif
 # endif
 #endif
+#endif
+
 #ifdef ODBCINT64
 typedef ODBCINT64	SQLBIGINT;
 #endif
 #ifdef UODBCINT64
 typedef UODBCINT64	SQLUBIGINT;
 #endif
-#endif
 
 
 /****************************
diff --git a/c++/include/dbapi/driver/odbc/unix_odbc/sqlucode.h b/c++/include/dbapi/driver/odbc/unix_odbc/sqlucode.h
index 1a08882..7b29bde 100644
--- a/c++/include/dbapi/driver/odbc/unix_odbc/sqlucode.h
+++ b/c++/include/dbapi/driver/odbc/unix_odbc/sqlucode.h
@@ -33,7 +33,7 @@ SQLRETURN SQL_API SQLColAttributeW(
 	SQLPOINTER		pCharAttr,
 	SQLSMALLINT		cbCharAttrMax,	
 	SQLSMALLINT  	*pcbCharAttr,
-	SQLPOINTER		pNumAttr);	
+	SQLLEN		*pNumAttr);	
 
 SQLRETURN SQL_API SQLColAttributesW(
     SQLHSTMT           hstmt,
@@ -381,7 +381,7 @@ SQLRETURN SQL_API SQLColAttributeA(
 	SQLPOINTER		pCharAttr,
 	SQLSMALLINT		cbCharAttrMax,	
 	SQLSMALLINT  	        *pcbCharAttr,
-	SQLPOINTER              pNumAttr);	
+	SQLLEN              	*pNumAttr);	
 
 SQLRETURN SQL_API SQLColAttributesA(
     SQLHSTMT        hstmt,
diff --git a/c++/include/dbapi/driver/odbc/unix_odbc/unixodbc_conf.h b/c++/include/dbapi/driver/odbc/unix_odbc/unixodbc_conf.h
new file mode 100644
index 0000000..175e37e
--- /dev/null
+++ b/c++/include/dbapi/driver/odbc/unix_odbc/unixodbc_conf.h
@@ -0,0 +1,7 @@
+#ifndef DBAPI_DRIVER_ODBC_UNIX_ODBC___UNIXODBC_CONF__H
+#define DBAPI_DRIVER_ODBC_UNIX_ODBC___UNIXODBC_CONF__H
+
+#include <ncbiconf.h>
+#define SIZEOF_LONG_INT SIZEOF_LONG
+
+#endif /* DBAPI_DRIVER_ODBC_UNIX_ODBC___UNIXODBC_CONF__H */
diff --git a/c++/include/dbapi/driver/public.hpp b/c++/include/dbapi/driver/public.hpp
index 2d3f4ad..a3ef0a9 100644
--- a/c++/include/dbapi/driver/public.hpp
+++ b/c++/include/dbapi/driver/public.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER___PUBLIC__HPP
 #define DBAPI_DRIVER___PUBLIC__HPP
 
-/* $Id: public.hpp 458199 2015-02-02 19:18:09Z ucko $
+/* $Id: public.hpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -113,10 +113,10 @@ public:
     ///   Newly created send-data object.
     ///
     /// @sa SendData
-    virtual CDB_SendDataCmd* SendDataCmd(I_ITDescriptor& desc,
-                                         size_t          data_size,
-                                         bool            log_it = true,
-                                         bool            discard_results = true);
+    virtual CDB_SendDataCmd* SendDataCmd(I_BlobDescriptor& desc,
+                                         size_t            data_size,
+                                         bool              log_it = true,
+                                         bool              discard_results = true);
 
     /// @brief 
     ///   Shortcut to send text and image to the server without using the
@@ -125,7 +125,7 @@ public:
     /// @param desc 
     ///   Lob descriptor.
     /// @param lob 
-    ///   Text or Image object.
+    ///   Large object -- [N]TEXT, IMAGE, [N]VARCHAR(MAX), or VARBINARY(MAX).
     /// @param log_it 
     ///   Log LOB operation if this value is set to true.
     /// 
@@ -134,7 +134,7 @@ public:
     ///
     /// @sa
     ///   SendDataCmd
-    virtual bool SendData(I_ITDescriptor& desc, CDB_Stream& lob,
+    virtual bool SendData(I_BlobDescriptor& desc, CDB_Stream& lob,
                           bool log_it = true);
 
     /// @brief 
@@ -300,6 +300,12 @@ public:
     /// Set timeout for command cancellation and connection closing
     virtual void SetCancelTimeout(size_t nof_secs);
 
+    /// Get connection timeout.    
+    size_t GetTimeout(void) const;
+
+    /// Get timeout for command cancellation and connection closing
+    size_t GetCancelTimeout(void) const;
+    
     /// Get interface for extra features that could be implemented in the driver.
     virtual I_ConnectionExtra& GetExtraFeatures(void);
 
@@ -456,16 +462,17 @@ public:
     ///   If "item_buf" is not NULL, then use "*item_buf" (its type should be
     ///   compatible with the type of retrieved item!) to retrieve the item to;
     ///   otherwise allocate new "CDB_Object".
-	///   In case of "CDB_Image" and "CDB_Text" data types value will be *appended*
-	///   to the "item_buf" by default (policy == eAppendLOB).
+    ///   If the existing "item_buf" has a BLOB type (CDB_Image, CDB_Text,
+    ///   CDB_VarBinaryMax, or CDB_VarCharMax), the value will be *appended*
+    ///   to the "item_buf" by default (policy == eAppendLOB).
     /// 
-	/// @param policy
-	///   Data retrieval policy. If policy == eAppendLOB and "item_buf" is an
-	///   object of CDB_Image or CDB_Text type, then data will be *appended* to
-	///   the end of previously assigned data. If policy == eAssignLOB and "item_buf" is an
-	///   object of CDB_Image or CDB_Text type, then new value will be *assigned*
-	///   to the "item_buf" object.
-	///
+    /// @param policy
+    ///   Data retrieval policy. If policy == eAppendLOB *and* "item_buf" has a
+    ///   BLOB type (CDB_Image, CDB_Text, CDB_VarBinaryMax, or CDB_VarCharMax),
+    ///   data will be *appended* to the end of previously assigned data.
+    ///   Otherwise (policy == eAssignLOB or "item_buf" has some other type),
+    ///   the new value will be *assigned* to the "item_buf" object.
+    ///
     /// @return 
     ///   a result item
     ///
@@ -474,7 +481,7 @@ public:
     virtual CDB_Object* GetItem(CDB_Object* item_buf = 0, EGetItem policy = eAppendLOB);
 
     /// @brief 
-    ///   Read a result item body (for text/image mostly).
+    ///   Read a result item body (for BLOB columns, mostly).
     ///   Throw an exception on any error.
     /// 
     /// @param buffer 
@@ -493,15 +500,15 @@ public:
                             bool* is_null = 0);
 
     /// @brief 
-    ///   Get a descriptor for text/image column (for SendData).
+    ///   Get a descriptor for a BLOB column (for SendData).
     /// 
     /// @return 
-    ///   Return NULL if this result doesn't (or can't) have img/text descriptor.
+    ///   Return NULL if this result doesn't (or can't) have a BLOB descriptor.
     ///
     /// @note
     ///   You need to call ReadItem (maybe even with buffer_size == 0)
     ///   before calling this method!
-    virtual I_ITDescriptor* GetImageOrTextDescriptor();
+    virtual I_BlobDescriptor* GetBlobDescriptor();
 
     /// @brief 
     /// Skip result item
@@ -821,8 +828,8 @@ public:
     /// Update the last fetched row.
     /// NOTE: the cursor must be declared for update in CDB_Connection::Cursor()
     virtual bool Update(const string& table_name, const string& upd_query);
-    virtual bool UpdateTextImage(unsigned int item_num, CDB_Stream& data,
-                                 bool log_it = true);
+    virtual bool UpdateBlob(unsigned int item_num, CDB_Stream& data,
+                            bool log_it = true);
     /// Make "send-data" command
     /// @brief 
     ///   Create send-data command.
@@ -923,16 +930,16 @@ private:
 
 
 
-class NCBI_DBAPIDRIVER_EXPORT CDB_ITDescriptor : public I_ITDescriptor
+class NCBI_DBAPIDRIVER_EXPORT CDB_BlobDescriptor : public I_BlobDescriptor
 {
 public:
     enum ETDescriptorType {eUnknown, eText, eBinary};
 
-    CDB_ITDescriptor(const string& table_name,
-                     const string& column_name,
-                     const string& search_conditions,
-                     ETDescriptorType column_type = eUnknown);
-    virtual ~CDB_ITDescriptor(void);
+    CDB_BlobDescriptor(const string& table_name,
+                       const string& column_name,
+                       const string& search_conditions,
+                       ETDescriptorType column_type = eUnknown);
+    virtual ~CDB_BlobDescriptor(void);
 
     virtual int DescriptorType(void) const;
 
@@ -959,6 +966,8 @@ protected:
     ETDescriptorType    m_ColumnType;
 };
 
+// historical name
+typedef CDB_BlobDescriptor CDB_ITDescriptor;
 
 
 class NCBI_DBAPIDRIVER_EXPORT CDB_ResultProcessor
diff --git a/c++/include/dbapi/driver/types.hpp b/c++/include/dbapi/driver/types.hpp
index 9c311be..8f2a9c7 100644
--- a/c++/include/dbapi/driver/types.hpp
+++ b/c++/include/dbapi/driver/types.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER___TYPES__HPP
 #define DBAPI_DRIVER___TYPES__HPP
 
-/* $Id: types.hpp 441148 2014-07-21 18:58:42Z ucko $
+/* $Id: types.hpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -68,10 +68,18 @@ enum EDB_Type {
     eDB_Numeric,
     eDB_LongChar,
     eDB_LongBinary,
+    eDB_VarCharMax,
+    eDB_VarBinaryMax,
 
     eDB_UnsupportedType
 };
 
+enum EBlobType {
+    eBlobType_none,
+    eBlobType_Text,
+    eBlobType_Binary
+};
+
 
 enum EBulkEnc {
     eBulkEnc_RawBytes,    // Raw bytes, perhaps already encoded in UCS-2.
@@ -307,6 +315,10 @@ public:
     static const char* GetTypeName(EDB_Type db_type,
                                    bool throw_on_unknown = true);
 
+    static EBlobType GetBlobType(EDB_Type db_type);
+    static bool      IsBlobType (EDB_Type db_type)
+        { return GetBlobType(db_type) != eBlobType_none; }
+
     string GetLogString(void) const;
 
 protected:
@@ -851,6 +863,8 @@ class CMemStore;
 class NCBI_DBAPIDRIVER_EXPORT CDB_Stream : public CDB_Object
 {
 public:
+    virtual ~CDB_Stream();
+
     // assignment
     virtual void AssignNULL();
     CDB_Stream&  Assign(const CDB_Stream& v);
@@ -858,6 +872,7 @@ public:
     // data manipulations
     virtual size_t Read     (void* buff, size_t nof_bytes);
     virtual size_t Peek     (void* buff, size_t nof_bytes) const;
+    virtual size_t PeekAt   (void* buff, size_t start, size_t nof_bytes) const;
     virtual size_t Append   (const void* buff, size_t nof_bytes);
     virtual void   Truncate (size_t nof_bytes = kMax_Int);
     virtual bool   MoveTo   (size_t byte_number);
@@ -867,10 +882,17 @@ public:
     virtual void AssignValue(const CDB_Object& v);
 
 protected:
-    // 'ctors
+    // constructors (destructor is public for compatibility with smart ptrs)
     CDB_Stream();
     CDB_Stream(const CDB_Stream& s, bool share_data = false);
-    virtual ~CDB_Stream();
+
+    // common CDB_Text and CDB_VarCharMax functionality
+    void   x_SetEncoding(EBulkEnc e);
+    size_t x_Append(const void* buff, size_t nof_bytes);
+    size_t x_Append(const CTempString& s, EEncoding enc);
+    size_t x_Append(const TStringUCS2& s);
+
+    EBulkEnc m_Encoding;
 
 private:
     // data storage
@@ -896,6 +918,26 @@ public:
 };
 
 
+/////////////////////////////////////////////////////////////////////////////
+class NCBI_DBAPIDRIVER_EXPORT CDB_VarBinaryMax : public CDB_Stream
+{
+public:
+    CDB_VarBinaryMax(void);
+    CDB_VarBinaryMax(const CDB_VarBinaryMax& v, bool share_data = false);
+    CDB_VarBinaryMax(const void* v, size_t l);
+    virtual ~CDB_VarBinaryMax(void);
+
+public:
+    void SetValue(const void* v, size_t l) { Truncate(); Append(v, l); }
+
+    CDB_VarBinaryMax& operator= (const CDB_VarBinaryMax& v);
+
+    virtual EDB_Type    GetType() const;
+    virtual CDB_Object* Clone()   const;
+    virtual CDB_Object* ShallowClone() const;
+};
+
+
 
 /////////////////////////////////////////////////////////////////////////////
 class NCBI_DBAPIDRIVER_EXPORT CDB_Text : public CDB_Stream
@@ -920,9 +962,51 @@ public:
     virtual EDB_Type    GetType() const;
     virtual CDB_Object* Clone()   const;
     virtual CDB_Object* ShallowClone() const;
+};
 
-private:
-    EBulkEnc m_Encoding;
+
+/////////////////////////////////////////////////////////////////////////////
+class NCBI_DBAPIDRIVER_EXPORT CDB_VarCharMax : public CDB_Stream
+{
+public:
+    CDB_VarCharMax(void);
+    CDB_VarCharMax(const CDB_VarCharMax& v, bool share_data = false);
+    CDB_VarCharMax(const string& s,         EEncoding enc = eEncoding_Unknown);
+    CDB_VarCharMax(const char* s,           EEncoding enc = eEncoding_Unknown);
+    CDB_VarCharMax(const char* s, size_t l, EEncoding enc = eEncoding_Unknown);
+    CDB_VarCharMax(const TStringUCS2& s);
+    virtual ~CDB_VarCharMax(void);
+
+public:
+    // Get and set the encoding to be used by subsequent Append operations.
+    EBulkEnc GetEncoding(void) const { return m_Encoding; }
+    void     SetEncoding(EBulkEnc e);
+
+    virtual size_t Append(const void* buff, size_t nof_bytes);
+    virtual size_t Append(const CTempString& s,
+                          EEncoding enc = eEncoding_Unknown);
+    virtual size_t Append(const TStringUCS2& s);
+
+    CDB_VarCharMax& SetValue(const string& s,
+                             EEncoding enc = eEncoding_Unknown)
+        { Truncate(); Append(s, enc); return *this; }
+    CDB_VarCharMax& SetValue(const char* s,
+                             EEncoding enc = eEncoding_Unknown)
+        { Truncate(); Append(s, enc); return *this; }
+    CDB_VarCharMax& SetValue(const char* s, size_t l,
+                             EEncoding enc = eEncoding_Unknown)
+        { Truncate(); Append(CTempString(s, l), enc); return *this; }
+    CDB_VarCharMax& SetValue(const TStringUCS2& s)
+        { Truncate(); Append(s); return *this; }
+
+    CDB_VarCharMax& operator= (const string& s)      { return SetValue(s); }
+    CDB_VarCharMax& operator= (const char*   s)      { return SetValue(s); }
+    CDB_VarCharMax& operator= (const TStringUCS2& s) { return SetValue(s); }
+    CDB_VarCharMax& operator= (const CDB_VarCharMax& v);
+
+    virtual EDB_Type    GetType() const;
+    virtual CDB_Object* Clone()   const;
+    virtual CDB_Object* ShallowClone() const;
 };
 
 
@@ -1064,10 +1148,27 @@ protected:
     unsigned char m_Body[33];
 };
 
+/////////////////////////////////////////////////////////////////////////////
 
 NCBI_PARAM_DECL_EXPORT(NCBI_DBAPIDRIVER_EXPORT, unsigned int, dbapi, max_logged_param_length);
 typedef NCBI_PARAM_TYPE(dbapi, max_logged_param_length) TDbapi_MaxLoggedParamLength;
 
+/////////////////////////////////////////////////////////////////////////////
+
+inline
+EBlobType CDB_Object::GetBlobType(EDB_Type db_type)
+{
+    switch (db_type) {
+    case eDB_Text:
+    case eDB_VarCharMax:
+        return eBlobType_Text;
+    case eDB_Image:
+    case eDB_VarBinaryMax:
+        return eBlobType_Binary;
+    default:
+        return eBlobType_none;
+    }
+}
 
 END_NCBI_SCOPE
 
diff --git a/c++/include/dbapi/driver/util/blobstore.hpp b/c++/include/dbapi/driver/util/blobstore.hpp
index 117d183..91f7bd4 100644
--- a/c++/include/dbapi/driver/util/blobstore.hpp
+++ b/c++/include/dbapi/driver/util/blobstore.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_UTILS___BLOBSTORE__HPP
 #define DBAPI_UTILS___BLOBSTORE__HPP
 
-/* $Id: blobstore.hpp 105739 2007-06-15 15:27:33Z ssikorsk $
+/* $Id: blobstore.hpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,15 +77,19 @@ private:
 };
 
 
-class NCBI_DBAPIUTIL_BLOBSTORE_EXPORT ItDescriptorMaker
+class NCBI_DBAPIUTIL_BLOBSTORE_EXPORT IBlobDescriptorMaker
 {
 public:
     virtual bool Init(CDB_Connection* con)= 0;
-    virtual I_ITDescriptor& ItDescriptor(void)= 0;
+    virtual I_BlobDescriptor& BlobDescriptor(void)= 0;
+    I_BlobDescriptor& ItDescriptor(void) { return BlobDescriptor(); }
     virtual bool Fini(void)= 0;
-    virtual ~ItDescriptorMaker(){};
+    virtual ~IBlobDescriptorMaker(){};
 };
 
+// historical name
+typedef IBlobDescriptorMaker ItDescriptorMaker;
+
 
 class NCBI_DBAPIUTIL_BLOBSTORE_EXPORT CBlobWriter : public IWriter
 {
@@ -100,7 +104,7 @@ public:
     typedef int TFlags;
 
     CBlobWriter(CDB_Connection* con,
-                ItDescriptorMaker*    desc_func,
+                IBlobDescriptorMaker* desc_func,
                 size_t          image_limit= 0x7FFFFFFF,
                 TFlags          flags= 0);
     /// Write up to count bytes from the buffer pointed to by
@@ -121,7 +125,7 @@ private:
     CBlobWriter();
     bool storeBlob(void);
     CDB_Image m_Blob;
-    ItDescriptorMaker *m_dMaker;
+    IBlobDescriptorMaker *m_dMaker;
     size_t m_Limit;
     CDB_Connection* m_Con;
     bool m_LogIt;
@@ -160,7 +164,7 @@ public:
                 const string& server,
                 const string& user,
                 const string& passwd,
-                ItDescriptorMaker* d_maker
+                IBlobDescriptorMaker* d_maker
                 );
     bool IsReady() const {
         return m_IsGood;
@@ -174,13 +178,13 @@ public:
 private:
     CBlobLoader();
     CDB_Connection* m_Conn;
-    ItDescriptorMaker* m_dMaker;
+    IBlobDescriptorMaker* m_dMaker;
     bool m_IsGood;
 };
 
 
 /***************************************************************************************
- * The SimpleBlobStore is a ready to use implementation of ItDescriptorMaker
+ * The SimpleBlobStore is a ready to use implementation of IBlobDescriptorMaker
  * it uses a table of the form:
  * create table TABLE_NAME (
  * ID varchar(n),
@@ -190,7 +194,7 @@ private:
  */
 
 class NCBI_DBAPIUTIL_BLOBSTORE_EXPORT CSimpleBlobStore
-    : public ItDescriptorMaker
+    : public IBlobDescriptorMaker
 {
 public:
     CSimpleBlobStore(const string& table_name,
@@ -203,7 +207,7 @@ public:
             m_Key= key;
     }
     virtual bool Init(CDB_Connection* con);
-    virtual I_ITDescriptor& ItDescriptor(void);
+    virtual I_BlobDescriptor& BlobDescriptor(void);
     virtual bool Fini(void);
     virtual ~CSimpleBlobStore();
 
@@ -219,13 +223,13 @@ protected:
     int m_ImageNum;
     CDB_VarChar m_Key;
     CDB_Int m_RowNum;
-    CDB_ITDescriptor m_Desc;
+    CDB_BlobDescriptor m_Desc;
 };
 
 
 /***************************************************************************************
  * CBlobStoreBase - the abstract base interface to deal with reading and writing
- * the image/text data from a C++ application.
+ * the BLOB data from a C++ application.
  */
 
 class NCBI_DBAPIUTIL_BLOBSTORE_EXPORT CBlobStoreBase
@@ -293,7 +297,7 @@ private:
 
 /***************************************************************************************
  * CBlobStoreStatic - the simple interface to deal with reading and writing
- * the image/text data from a C++ application.
+ * the BLOB data from a C++ application.
  * It uses connection to DB from an external pool.
  */
 
@@ -331,7 +335,7 @@ private:
 
 /***************************************************************************************
  * CBlobStoreDynamic - the simple interface to deal with reading and writing
- * the image/text data from a C++ application.
+ * the BLOB data from a C++ application.
  * It uses an internal connections pool and ask pool for a connection each time before
  * connection use.
  */
diff --git a/c++/include/dbapi/driver/util/parameters.hpp b/c++/include/dbapi/driver/util/parameters.hpp
index 1ce2a95..f160171 100644
--- a/c++/include/dbapi/driver/util/parameters.hpp
+++ b/c++/include/dbapi/driver/util/parameters.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER_UTIL___PARAMETERS__HPP
 #define DBAPI_DRIVER_UTIL___PARAMETERS__HPP
 
-/* $Id: parameters.hpp 441150 2014-07-21 19:10:46Z ucko $
+/* $Id: parameters.hpp 487511 2015-12-17 20:11:40Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -57,7 +57,7 @@ public:
                   CDB_Object* param, bool is_out = false);
 
     unsigned int NofParams() const {
-        return m_Params.size();
+        return static_cast<unsigned int>(m_Params.size());
     }
 
     CDB_Object* GetParam(unsigned int param_no) const {
diff --git a/c++/include/dbapi/error_codes.hpp b/c++/include/dbapi/error_codes.hpp
index c7aca8e..f51400b 100644
--- a/c++/include/dbapi/error_codes.hpp
+++ b/c++/include/dbapi/error_codes.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI___ERROR_CODES__HPP
 #define DBAPI___ERROR_CODES__HPP
 
-/*  $Id: error_codes.hpp 469244 2015-06-02 18:54:37Z ucko $
+/*  $Id: error_codes.hpp 495422 2016-03-17 13:33:23Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -75,7 +75,8 @@ NCBI_DEFINE_ERRCODE_X(Dbapi_BlobStream,    1134,  3);
 NCBI_DEFINE_ERRCODE_X(Dbapi_ObjImpls,      1135, 10);
 NCBI_DEFINE_ERRCODE_X(Dbapi_BulkInsert,    1136,  1);
 NCBI_DEFINE_ERRCODE_X(Dbapi_DrvrContext,   1137,  1);
-NCBI_DEFINE_ERRCODE_X(Dbapi_Sdbapi,        1138, 18);
+NCBI_DEFINE_ERRCODE_X(Dbapi_Sdbapi,        1138, 19);
+NCBI_DEFINE_ERRCODE_X(Dbapi_ConnMgr,       1139,  1);
 
 
 END_NCBI_SCOPE
diff --git a/c++/include/dbapi/variant.hpp b/c++/include/dbapi/variant.hpp
index 851873c..8b4de10 100644
--- a/c++/include/dbapi/variant.hpp
+++ b/c++/include/dbapi/variant.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI___VARIANT__HPP
 #define DBAPI___VARIANT__HPP
 
-/* $Id: variant.hpp 461616 2015-03-11 15:47:00Z ucko $
+/* $Id: variant.hpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -120,10 +120,13 @@ public:
     static CVariant LongChar     (const TStringUCS2 &s, size_t len = 0);
     static CVariant VarChar      (const char *p, size_t len = 0);
     static CVariant VarChar      (const TStringUCS2 &s, size_t len = 0);
+    static CVariant VarCharMax   (const char *p, size_t len = 0);
+    static CVariant VarCharMax   (const TStringUCS2 &s, size_t len = 0);
     static CVariant Char         (size_t size, const char *p);
     static CVariant Char         (size_t size, const TStringUCS2& s);
     static CVariant LongBinary   (size_t maxSize, const void *p, size_t len);
     static CVariant VarBinary    (const void *p, size_t len);
+    static CVariant VarBinaryMax (const void *p, size_t len);
     static CVariant Binary       (size_t size, const void *p, size_t len);
     static CVariant SmallDateTime(CTime *p);
     static CVariant DateTime     (CTime *p);
@@ -206,9 +209,15 @@ public:
     // Moves the internal position pointer
     bool MoveTo(size_t pos) const;
 
-    void SetITDescriptor(I_ITDescriptor* descr);
-    I_ITDescriptor& GetITDescriptor(void) const;
-    I_ITDescriptor* ReleaseITDescriptor(void) const;
+    void SetBlobDescriptor(I_BlobDescriptor* descr);
+    I_BlobDescriptor& GetBlobDescriptor(void) const;
+    I_BlobDescriptor* ReleaseBlobDescriptor(void) const;
+
+    void SetITDescriptor(I_BlobDescriptor* descr) { SetBlobDescriptor(descr); }
+    I_BlobDescriptor& GetITDescriptor(void) const
+        { return GetBlobDescriptor(); }
+    I_BlobDescriptor* ReleaseITDescriptor(void) const
+        { return ReleaseBlobDescriptor(); }
 
     // Simplify bulk insertion into NVARCHAR columns, which require
     // explicit handling.
@@ -228,7 +237,7 @@ private:
     void x_Inapplicable_Method(const char* method) const;
 
     class CDB_Object* m_data;
-    mutable auto_ptr<I_ITDescriptor> m_descr;
+    mutable auto_ptr<I_BlobDescriptor> m_descr;
 };
 
 bool NCBI_DBAPI_EXPORT operator==(const CVariant& v1, const CVariant& v2);
@@ -263,19 +272,23 @@ EDB_Type CVariant::GetType() const
 
 
 inline void
-CVariant::SetITDescriptor(I_ITDescriptor* descr)
+CVariant::SetBlobDescriptor(I_BlobDescriptor* descr)
 {
     m_descr.reset(descr);
 }
 
-inline I_ITDescriptor&
-CVariant::GetITDescriptor(void) const
+inline I_BlobDescriptor&
+CVariant::GetBlobDescriptor(void) const
 {
+    if (m_descr.get() == NULL) {
+        NCBI_THROW(CVariantException, eVariant,
+                   "No blob descriptor available.");
+    }
     return *m_descr;
 }
 
-inline I_ITDescriptor*
-CVariant::ReleaseITDescriptor(void) const
+inline I_BlobDescriptor*
+CVariant::ReleaseBlobDescriptor(void) const
 {
     return m_descr.release();
 }
diff --git a/c++/include/ncbi_pch.hpp b/c++/include/ncbi_pch.hpp
index 6c3b09c..d7b2df2 100644
--- a/c++/include/ncbi_pch.hpp
+++ b/c++/include/ncbi_pch.hpp
@@ -1,5 +1,5 @@
 #if defined(NCBI_USE_PCH)  &&  !defined(NCBI_PCH__HPP)
-/*  $Id: ncbi_pch.hpp 485953 2015-11-30 17:53:34Z blastadm $
+/*  $Id: ncbi_pch.hpp 500618 2016-05-05 19:15:27Z blastadm $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/ncbi_source_ver.h b/c++/include/ncbi_source_ver.h
index bdf3e1d..53cda90 100644
--- a/c++/include/ncbi_source_ver.h
+++ b/c++/include/ncbi_source_ver.h
@@ -1,4 +1,4 @@
-/*  $Id: ncbi_source_ver.h 485953 2015-11-30 17:53:34Z blastadm $
+/*  $Id: ncbi_source_ver.h 500618 2016-05-05 19:15:27Z blastadm $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/ncbiconf.h b/c++/include/ncbiconf.h
index ab8e245..8434a4c 100644
--- a/c++/include/ncbiconf.h
+++ b/c++/include/ncbiconf.h
@@ -1,7 +1,7 @@
 #ifndef FORWARDING_NCBICONF_H
 #define FORWARDING_NCBICONF_H
 
-/*  $Id: ncbiconf.h 485953 2015-11-30 17:53:34Z blastadm $
+/*  $Id: ncbiconf.h 500618 2016-05-05 19:15:27Z blastadm $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/entrez2/Entrez2_id_list.hpp b/c++/include/objects/entrez2/Entrez2_id_list.hpp
index a5f9e15..ab83f65 100644
--- a/c++/include/objects/entrez2/Entrez2_id_list.hpp
+++ b/c++/include/objects/entrez2/Entrez2_id_list.hpp
@@ -1,4 +1,4 @@
-/* $Id: Entrez2_id_list.hpp 103491 2007-05-04 17:18:18Z kazimird $
+/* $Id: Entrez2_id_list.hpp 481294 2015-10-08 14:03:49Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -55,6 +55,7 @@ class NCBI_ENTREZ2_EXPORT CEntrez2_id_list : public CEntrez2_id_list_Base
 public:
     typedef CConstResizingIterator<TUids> TConstUidIterator;
     typedef CResizingIterator<TUids>      TUidIterator;
+    typedef TIntId TUid;
 
     // constructor
     CEntrez2_id_list(void);
@@ -69,7 +70,7 @@ public:
     void Resize(size_t size);
 
     // set the container to a set of integer UIDs
-    void AssignUids(const vector<int>& uids);
+    void AssignUids(const vector<TUid>& uids);
 
     static const size_t sm_UidSize; // bytes
 
diff --git a/c++/include/objects/entrez2/entrez2_client.hpp b/c++/include/objects/entrez2/entrez2_client.hpp
index c5db32c..12f3237 100644
--- a/c++/include/objects/entrez2/entrez2_client.hpp
+++ b/c++/include/objects/entrez2/entrez2_client.hpp
@@ -1,4 +1,4 @@
-/* $Id: entrez2_client.hpp 103491 2007-05-04 17:18:18Z kazimird $
+/* $Id: entrez2_client.hpp 481294 2015-10-08 14:03:49Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -57,6 +57,8 @@ class NCBI_ENTREZ2_EXPORT CEntrez2Client : public CEntrez2Client_Base
 {
     typedef CEntrez2Client_Base Tparent;
 public:
+    typedef TIntId TUid;
+
     // constructor
     CEntrez2Client(void);
     // destructor
@@ -69,38 +71,41 @@ public:
     /// link_type is, for example, "nucleotide_nucleotide".
 
     /// This form just yields a vector of UIDs
-    void GetNeighbors(int query_uid, const string& db_from,
+    void GetNeighbors(TUid query_uid,
+                      const string& db_from,
                       const string& db_to,
-                      vector<int>& neighbor_uids);
+                      vector<TUid>& neighbor_uids);
 
     /// This form just yields a vector of UIDs, taking a vector of UIDs
-    void GetNeighbors(const vector<int>& db_from,
-                      const string& db_to,
+    void GetNeighbors(const vector<TUid>& query_uids,
+                      const string& db,
                       const string& link_type,
-                      vector<int>& neighbor_uids);
+                      vector<TUid>& neighbor_uids);
 
     /// This form returns the entire CEntrez2_link_set object,
     /// which includes scores.
-    CRef<CEntrez2_link_set> GetNeighbors(int query_uid,
+    CRef<CEntrez2_link_set> GetNeighbors(TUid query_uid,
                                          const string& db_from,
                                          const string& db_to);
 
     /// This form returns the entire CEntrez2_link_set object,
     /// which includes scores.
-    CRef<CEntrez2_link_set> GetNeighbors(const vector<int>& query_uids,
+    CRef<CEntrez2_link_set> GetNeighbors(const vector<TUid>& query_uids,
                                          const string& db_from,
                                          const string& db_to);
 
     /// Retrieve counts of the various types of neighbors available
-    CRef<CEntrez2_link_count_list> GetNeighborCounts(int query_uid,
+    CRef<CEntrez2_link_count_list> GetNeighborCounts(TUid query_uid,
                                                      const string& db);
     
     /// Some other simplified interfaces
 
     /// Query a db with a string, returning uids as integers
-    void Query(const string& query, const string& db,
-               vector<int>& result_uids,
-               size_t start_offs = 0, size_t count = 0,
+    void Query(const string& query,
+               const string& db,
+               vector<TUid>& result_uids,
+               size_t start_offs = 0,
+               size_t count = 0,
                TReply* reply = 0);
 
     /// Given some uids, a database, and an entrez query string,
@@ -109,17 +114,47 @@ public:
     /// Note: If a uid appears more than once in query_uids and
     /// matches the query string, it may or may not appear more
     /// more than once in the result.
-    void FilterIds(const vector<int>& query_uids, const string& db,
+    void FilterIds(const vector<TUid>& query_uids,
+                   const string& db,
                    const string& query_string,
-                   vector<int>& result_uids);
+                   vector<TUid>& result_uids);
 
     /// Retrieve the docsums for a set of UIDs
-    CRef<CEntrez2_docsum_list> GetDocsums(const vector<int>& uids,
+    CRef<CEntrez2_docsum_list> GetDocsums(const vector<TUid>& uids,
                                           const string& db);
 
     /// Retrieve the docsums for a single UID
-    CRef<CEntrez2_docsum_list> GetDocsums(int uid,
+    CRef<CEntrez2_docsum_list> GetDocsums(TUid uid,
+                                          const string& db);
+
+#ifdef NCBI_STRICT_GI
+    void GetNeighbors(TGi query_uid, const string& db_from,
+                      const string& db_to,
+                      vector<TGi>& neighbor_uids);
+    void GetNeighbors(const vector<TGi>& query_uids,
+                      const string& db,
+                      const string& link_type,
+                      vector<TGi>& neighbor_uids);
+    CRef<CEntrez2_link_set> GetNeighbors(TGi query_uid,
+                                         const string& db_from,
+                                         const string& db_to);
+    CRef<CEntrez2_link_set> GetNeighbors(const vector<TGi>& query_uids,
+                                         const string& db_from,
+                                         const string& db_to);
+    CRef<CEntrez2_link_count_list> GetNeighborCounts(TGi query_uid,
+                                                     const string& db);
+    void Query(const string& query, const string& db,
+               vector<TGi>& result_uids,
+               size_t start_offs = 0, size_t count = 0,
+               TReply* reply = 0);
+    void FilterIds(const vector<TGi>& query_uids, const string& db,
+                   const string& query_string,
+                   vector<TGi>& result_uids);
+    CRef<CEntrez2_docsum_list> GetDocsums(const vector<TGi>& uids,
+                                          const string& db);
+    CRef<CEntrez2_docsum_list> GetDocsums(TGi uid,
                                           const string& db);
+#endif
 
 protected:
     /// Get DB affinity of the request
diff --git a/c++/include/objects/general/Dbtag.hpp b/c++/include/objects/general/Dbtag.hpp
index 0eb4a40..456af1f 100644
--- a/c++/include/objects/general/Dbtag.hpp
+++ b/c++/include/objects/general/Dbtag.hpp
@@ -1,4 +1,4 @@
-/* $Id: Dbtag.hpp 460837 2015-03-03 18:33:15Z kans $
+/* $Id: Dbtag.hpp 496201 2016-03-24 15:11:44Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -209,7 +209,10 @@ public:
         eDbtagType_GenBank,
         eDbtagType_BioSample,
         eDbtagType_ISHAM_ITS,
-        eDbtagType_ERIC
+        eDbtagType_ERIC,
+        eDbtagType_I5KNAL,
+        eDbtagType_VISTA,
+        eDbtagType_BEI
     };
 
     enum EDbtagGroup {
diff --git a/c++/include/objects/general/User_field.hpp b/c++/include/objects/general/User_field.hpp
index bf19364..cf97a6e 100644
--- a/c++/include/objects/general/User_field.hpp
+++ b/c++/include/objects/general/User_field.hpp
@@ -1,4 +1,4 @@
-/* $Id: User_field.hpp 405847 2013-07-09 13:56:53Z gouriano $
+/* $Id: User_field.hpp 490266 2016-01-22 16:40:57Z kornbluh $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -56,13 +56,67 @@ public:
     // destructor
     ~CUser_field(void);
 
+    enum EParseField {
+        eParse_String,    ///< Add string even if all numbers
+        eParse_Number     ///< Parse a real or integer number, otherwise string
+    };
+
+    /// set value
+    CUser_field& SetInt(int value);
+    CUser_field& SetInt8(Int8 value);
+    CUser_field& SetGi(TGi gi);
+    CUser_field& SetDouble(double value);
+    CUser_field& SetBool(bool value);
+    CUser_field& SetString(const char* value);
+    CUser_field& SetString(const string& value);
+
+    /// set a data field to a given value
+    /// Int8 and TGi values can be stored into 'real' or 'str' fields if
+    /// the value doesn't fit into 'int' field
+    CUser_field& SetValue(int           value);
+    CUser_field& SetValue(Int8          value);
+#ifdef NCBI_STRICT_GI
+    CUser_field& SetValue(TGi           value);
+#endif
+    CUser_field& SetValue(double        value);
+    CUser_field& SetValue(bool          value);
+    CUser_field& SetValue(const char* value);
+    CUser_field& SetValue(const string& value);
+    CUser_field& SetValue(const char* value, EParseField parse);
+    CUser_field& SetValue(const string& value, EParseField parse);
+    CUser_field& SetValue(const vector<int>&    value);
+    CUser_field& SetValue(const vector<double>& value);
+    CUser_field& SetValue(const vector<string>& value);
+    CUser_field& SetValue(CUser_object& value);
+    CUser_field& SetValue(const vector< CRef<CUser_object> >& value);
+    CUser_field& SetValue(const vector< CRef<CUser_field> >& value);
+
+    /// get value
+    int GetInt(void) const;
+    Int8 GetInt8(void) const;
+    TGi GetGi(void) const;
+    bool GetBool(void) const;
+    double GetDouble(void) const;
+    const string& GetString(void) const;
+
+    template<class Type> Type GetValue(void) const;
+
     /// add fields to the current user field
     CUser_field& AddField(const string& label, int           value);
+    CUser_field& AddField(const string& label, Int8          value);
+#ifdef NCBI_STRICT_GI
+    CUser_field& AddField(const string& label, TGi           value);
+#endif
     CUser_field& AddField(const string& label, double        value);
     CUser_field& AddField(const string& label, bool          value);
 
-    CUser_field& AddField(const string& label, const CUser_field_Base::TData::TStr& value);
-    CUser_field& AddField(const string& label, const CUser_field_Base::TData::TStrs& value);
+    CUser_field& AddField(const string& label, const char* value);
+    CUser_field& AddField(const string& label, const string& value);
+    CUser_field& AddField(const string& label, const char* value,
+                          EParseField field);
+    CUser_field& AddField(const string& label, const string& value,
+                          EParseField field);
+    CUser_field& AddField(const string& label, const vector<string>& value);
 
     CUser_field& AddField(const string& label, const vector<int>&    value);
     CUser_field& AddField(const string& label, const vector<double>& value);
@@ -77,12 +131,14 @@ public:
     /// string 'str' on the delimiters; if the field doesn't exist, an
     /// exception will be thrown.
     const CUser_field&     GetField(const string& str,
-                                    const string& delim = ".") const;
+                                    const string& delim = ".",
+                                    NStr::ECase use_case = NStr::eCase) const;
 
     /// Return a field reference representing the tokenized key, or a
     /// NULL reference if the key doesn't exist.
     CConstRef<CUser_field> GetFieldRef(const string& str,
-                                       const string& delim = ".") const;
+                                       const string& delim = ".",
+                                       NStr::ECase use_case = NStr::eCase) const;
 
     /// For functions that don't use delims, we instead use a chain of names.
     struct NCBI_GENERAL_EXPORT SFieldNameChain {
@@ -134,27 +190,31 @@ public:
     /// Access a named field in this user field.  This will tokenize the
     /// string 'str' on the delimiters and recursively add fields where needed
     CUser_field&      SetField(const string& str,
-                               const string& delim = ".");
+                               const string& delim = ".",
+                               NStr::ECase use_case = NStr::eCase);
 
     /// Return a field reference representing the tokenized key, or a
     /// NULL reference if the key cannot be created for some reason.
     CRef<CUser_field> SetFieldRef(const string& str,
-                                  const string& delim = ".");
+                                  const string& delim = ".",
+                                  NStr::ECase use_case = NStr::eCase);
 
     /// Verify that a named field exists
     bool HasField(const string& str,
-                  const string& delim = ".") const;
+                  const string& delim = ".",
+                  NStr::ECase use_case = NStr::eCase) const;
                   
     /// Delete the named field.
     /// return true if successful. false if field doesn't exist.
     bool DeleteField(const string& str,
-                  const string& delim = ".");
+                     const string& delim = ".",
+                     NStr::ECase use_case = NStr::eCase);
+
 
 private:
     // Prohibit copy constructor and assignment operator
     CUser_field(const CUser_field& value);
     CUser_field& operator=(const CUser_field& value);
-
 };
 
 
@@ -168,6 +228,181 @@ CUser_field::CUser_field(void)
 }
 
 
+inline
+CUser_field& CUser_field::SetString(const string& value)
+{
+    SetData().SetStr(value);
+    return *this;
+}
+
+
+inline
+CUser_field& CUser_field::SetInt(int value)
+{
+    SetData().SetInt(value);
+    return *this;
+}
+
+
+inline
+CUser_field& CUser_field::SetBool(bool value)
+{
+    SetData().SetBool(value);
+    return *this;
+}
+
+
+inline
+CUser_field& CUser_field::SetDouble(double value)
+{
+    SetData().SetReal(value);
+    return *this;
+}
+
+
+inline
+CUser_field& CUser_field::SetValue(const char* value)
+{
+    return SetString(value);
+}
+
+
+inline
+CUser_field& CUser_field::SetValue(const string& value)
+{
+    return SetString(value);
+}
+
+
+inline
+CUser_field& CUser_field::SetValue(int value)
+{
+    return SetInt(value);
+}
+
+
+inline
+CUser_field& CUser_field::SetValue(bool value)
+{
+    return SetBool(value);
+}
+
+
+inline
+CUser_field& CUser_field::SetValue(double value)
+{
+    return SetDouble(value);
+}
+
+
+inline
+CUser_field& CUser_field::SetValue(Int8 value)
+{
+    return SetInt8(value);
+}
+
+
+inline
+CUser_field& CUser_field::SetGi(TGi value)
+{
+    return SetValue(TIntId(value));
+}
+
+
+#ifdef NCBI_STRICT_GI
+inline
+CUser_field& CUser_field::SetValue(TGi value)
+{
+    return SetGi(value);
+}
+#endif
+
+
+inline
+int CUser_field::GetInt(void) const
+{
+    return GetData().GetInt();
+}
+
+
+inline
+double CUser_field::GetDouble(void) const
+{
+    return GetData().GetReal();
+}
+
+
+inline
+bool CUser_field::GetBool(void) const
+{
+    return GetData().GetBool();
+}
+
+
+inline
+const string& CUser_field::GetString(void) const
+{
+    return GetData().GetStr();
+}
+
+
+template<>
+inline
+int CUser_field::GetValue<int>(void) const
+{
+    return GetInt();
+}
+
+
+template<>
+inline
+Int8 CUser_field::GetValue<Int8>(void) const
+{
+    return GetInt8();
+}
+
+
+template<>
+inline
+double CUser_field::GetValue<double>(void) const
+{
+    return GetDouble();
+}
+
+
+template<>
+inline
+bool CUser_field::GetValue<bool>(void) const
+{
+    return GetBool();
+}
+
+
+template<>
+inline
+string CUser_field::GetValue<string>(void) const
+{
+    return GetString();
+}
+
+
+inline
+TGi CUser_field::GetGi(void) const
+{
+    return GetValue<TIntId>();
+}
+
+
+#ifdef NCBI_STRICT_GI
+template<>
+inline
+TGi CUser_field::GetValue<TGi>(void) const
+{
+    return GetGi();
+}
+#endif
+
+
 /////////////////// end of CUser_field inline methods
 
 
@@ -176,4 +411,3 @@ END_objects_SCOPE // namespace ncbi::objects::
 END_NCBI_SCOPE
 
 #endif // OBJECTS_GENERAL_USER_FIELD_HPP
-/* Original file checksum: lines: 93, chars: 2437, CRC32: 222a2c32 */
diff --git a/c++/include/objects/general/User_object.hpp b/c++/include/objects/general/User_object.hpp
index d1d158a..7e78bf9 100644
--- a/c++/include/objects/general/User_object.hpp
+++ b/c++/include/objects/general/User_object.hpp
@@ -1,4 +1,4 @@
-/* $Id: User_object.hpp 478651 2015-09-11 12:01:08Z ivanov $
+/* $Id: User_object.hpp 490266 2016-01-22 16:40:57Z kornbluh $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -68,8 +68,12 @@ public:
     CUser_object& AddField(const string& label, const char* value,
                            EParseField parse = eParse_String);
     CUser_object& AddField(const string& label, int           value);
+    CUser_object& AddField(const string& label, Int8          value);
     CUser_object& AddField(const string& label, double        value);
     CUser_object& AddField(const string& label, bool          value);
+#ifdef NCBI_STRICT_GI
+    CUser_object& AddField(const string& label, TGi           value);
+#endif
 
     CUser_object& AddField(const string& label, const vector<string>& value);
     CUser_object& AddField(const string& label, const vector<int>&    value);
@@ -86,9 +90,11 @@ public:
     /// This version will throw an exception if the field
     /// doesn't exist.
     const CUser_field&     GetField(const string& str,
-                                    const string& delim = ".") const;
+                                    const string& delim = ".",
+                                    NStr::ECase use_case = NStr::eCase) const;
     CConstRef<CUser_field> GetFieldRef(const string& str,
-                                       const string& delim = ".") const;
+                                       const string& delim = ".",
+                                       NStr::ECase use_case = NStr::eCase) const;
 
     /// Access a named field in this user object.  This is a little
     /// sneaky in that it interprets a delimiter for recursion.  The
@@ -96,14 +102,17 @@ public:
     /// sub-object if a new sub-object needs to be created
     CUser_field&      SetField(const string& str,
                                const string& delim = ".",
-                               const string& obj_subtype = kEmptyStr);
+                               const string& obj_subtype = kEmptyStr,
+                               NStr::ECase use_case = NStr::eCase);
     CRef<CUser_field> SetFieldRef(const string& str,
                                   const string& delim = ".",
-                                  const string& obj_subtype = kEmptyStr);
+                                  const string& obj_subtype = kEmptyStr,
+                                  NStr::ECase use_case = NStr::eCase);
 
     /// Verify that a named field exists
     bool HasField(const string& str,
-                  const string& delim = ".") const;
+                  const string& delim = ".",
+                  NStr::ECase use_case = NStr::eCase) const;
 
     /// enum controlling what to return for a label
     /// this mirrors a request inside of feature::GetLabel()
@@ -163,13 +172,16 @@ public:
     EObjectType GetObjectType() const;
     void SetObjectType(EObjectType obj_type);
 
-    // for Unverified User-objects: Can have Organism and/or Feature
+    // for Unverified User-objects: Can have Organism and/or Feature and/or Misassembled
     bool IsUnverifiedOrganism() const;
     void AddUnverifiedOrganism();
     void RemoveUnverifiedOrganism();
     bool IsUnverifiedFeature() const;
     void AddUnverifiedFeature();
     void RemoveUnverifiedFeature();
+    bool IsUnverifiedMisassembled() const;
+    void AddUnverifiedMisassembled();
+    void RemoveUnverifiedMisassembled();
 
     void UpdateNcbiCleanup(int version);
 
@@ -195,14 +207,6 @@ CUser_object::CUser_object(void)
 }
 
 
-inline
-CUser_object& CUser_object::AddField(const string& label,
-                                     const char* value,
-                                     EParseField parse)
-{
-    return AddField(label, string(value), parse);
-}
-
 /////////////////// end of CUser_object inline methods
 
 
@@ -211,4 +215,3 @@ END_objects_SCOPE // namespace ncbi::objects::
 END_NCBI_SCOPE
 
 #endif // OBJECTS_GENERAL_USER_OBJECT_HPP
-/* Original file checksum: lines: 93, chars: 2438, CRC32: 8ba203fc */
diff --git a/c++/include/objects/genomecoll/GCClient_GetAssemblyReques.hpp b/c++/include/objects/genomecoll/GCClient_GetAssemblyReques.hpp
index 4597f9b..64a755a 100755
--- a/c++/include/objects/genomecoll/GCClient_GetAssemblyReques.hpp
+++ b/c++/include/objects/genomecoll/GCClient_GetAssemblyReques.hpp
@@ -1,4 +1,4 @@
-/* $Id: GCClient_GetAssemblyReques.hpp 479931 2015-09-24 17:18:23Z ivanov $
+/* $Id: GCClient_GetAssemblyReques.hpp 486570 2015-12-07 17:17:13Z shchekot $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -82,7 +82,6 @@ public:
         SRequestParam(int level_, int assembly_flags_, int chromosome_flags_, int scaffold_flags_, int component_flags_);
 
         bool SetMode(EAssemblyMode mode);
-        bool SetMode(const string& mode);
     };
 
 private:
diff --git a/c++/include/objects/genomecoll/GC_Sequence.hpp b/c++/include/objects/genomecoll/GC_Sequence.hpp
index 8034cf9..a04bc91 100644
--- a/c++/include/objects/genomecoll/GC_Sequence.hpp
+++ b/c++/include/objects/genomecoll/GC_Sequence.hpp
@@ -1,4 +1,4 @@
-/* $Id: GC_Sequence.hpp 479299 2015-09-18 11:47:36Z ivanov $
+/* $Id: GC_Sequence.hpp 479064 2015-09-16 12:18:23Z smithrg $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/genomecoll/genomic_collections_cli.hpp b/c++/include/objects/genomecoll/genomic_collections_cli.hpp
index 5c60dde..8ce6e05 100644
--- a/c++/include/objects/genomecoll/genomic_collections_cli.hpp
+++ b/c++/include/objects/genomecoll/genomic_collections_cli.hpp
@@ -1,4 +1,4 @@
-/* $Id: genomic_collections_cli.hpp 483522 2015-11-02 14:44:55Z ivanov $
+/* $Id: genomic_collections_cli.hpp 499302 2016-04-25 15:35:38Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -59,21 +59,16 @@ class CGCClient_EquivalentAssemblies;
 /////////////////////////////////////////////////////////////////////////////
 class CGenomicCollectionsService : public CGenomicCollectionsService_Base
 {
-    string m_url;
-
 public:
     CGenomicCollectionsService();
-    CGenomicCollectionsService(const string& url);
-
-    virtual void x_Connect();
 
-    // Override this to supply your own URL.
-    virtual string x_GetURL();
 
     typedef CGCClient_GetAssemblyRequest::ELevel ELevel;
 
     typedef EGCClient_AttributeFlags EAttributeFlags;
 
+    /// @deprecated Use GetAssembly(const string& acc, const string& mode)
+    NCBI_DEPRECATED
     CRef<CGC_Assembly> GetAssembly
         (const string& acc, 
          int level = CGCClient_GetAssemblyRequest::eLevel_scaffold,
@@ -82,6 +77,8 @@ public:
          int scafAttrFlags = eGCClient_AttributeFlags_none, 
          int compAttrFlags = eGCClient_AttributeFlags_none);
 
+    /// @deprecated Use GetAssembly(int releaseId,     const string& mode)
+    NCBI_DEPRECATED
     CRef<CGC_Assembly> GetAssembly
         (int releaseId, 
          int level = CGCClient_GetAssemblyRequest::eLevel_scaffold,
@@ -90,7 +87,11 @@ public:
          int scafAttrFlags = eGCClient_AttributeFlags_none, 
          int compAttrFlags = eGCClient_AttributeFlags_none);
 
+    /// @deprecated Use GetAssembly(const string& acc, const string& mode)
+    NCBI_DEPRECATED
     CRef<CGC_Assembly> GetAssembly(const string& acc, CGCClient_GetAssemblyRequest::EAssemblyMode mode);
+    /// @deprecated Use GetAssembly(int releaseId,     const string& mode)
+    NCBI_DEPRECATED
     CRef<CGC_Assembly> GetAssembly(int releaseId,     CGCClient_GetAssemblyRequest::EAssemblyMode mode);
 
     CRef<CGC_Assembly> GetAssembly(const string& acc, const string& mode);
@@ -101,28 +102,52 @@ public:
     struct SAssemblyMode
     {
         //as defined in GenomeColl_Master.dbo.CodeServiceModeAlias
+
+        //minimal contents: Only metadata
         static string kAssemblyOnly() {return "AssemblyOnly";};
-        static string kFTPExport()  {return "FTPExport";};
-    };
 
-    CRef<CGC_Assembly> _GetAssemblyNew(const string& acc, const string& mode);
-    CRef<CGC_Assembly> _GetAssemblyNew(int releaseId,     const string& mode);
+        // Top-level molecules
+        // No statistics
+        // No alignments data (which could be very large)
+        // pseudo scaffolds are reported as unlocalized/unplaced, as needed for analysis
+        static string kScaffolds()  {return "Scaffolds";};
+
+        // Top-level molecules
+        // all statistics on assembly, units and replicons
+        // alignments data when available
+        // pseudo scaffolds are reported as unlocalized/unplaced, as needed for analysis
+        static string kScaffoldsWithAlignments()  {return "ScaffoldsWithAlignments";};
+
+        // Almost maximum contents:
+        // all sequences down to contigs
+        // No statistics
+        // No alignments data (which could be very large)
+        // pseudo scaffolds are reported as unlocalized/unplaced, as needed for analysis
+        static string kAllSequences()  {return "AllSequences";};
+
+        // Maximum contents:
+        // all sequences down to contigs
+        // all statistics on assembly, units and replicons
+        // alignments data when available
+        // pseudo scaffolds are reported as unlocalized/unplaced, as needed for analysis
+        static string kAllSequencesWithAlignments()  {return "AllSequencesWithAlignments";};
+    };
 
     string ValidateChrType(const string& chrType, const string& chrLoc);
 
     CRef<CGCClient_AssemblyInfo> FindBestAssembly
         (const string& seq_id,
-         int filter_type = eGCClient_FindBestAssemblyFilter_any,
+         int filter_type,
          int sort_type = eGCClient_FindBestAssemblySort_default);
 
     CRef<CGCClient_AssemblySequenceInfo> FindBestAssembly
         (const list<string>& seq_id,
-         int filter_type = eGCClient_FindBestAssemblyFilter_any,
+         int filter_type,
          int sort_type = eGCClient_FindBestAssemblySort_default);
 
     CRef<CGCClient_AssembliesForSequences> FindAllAssemblies
         (const list<string>& seq_id,
-         int filter_type = eGCClient_FindBestAssemblyFilter_any,
+         int filter_type,
          int sort_type = eGCClient_FindBestAssemblySort_default);
 
 
diff --git a/c++/include/objects/seq/Seq_gap.hpp b/c++/include/objects/id2/id2_client.hpp
similarity index 55%
copy from c++/include/objects/seq/Seq_gap.hpp
copy to c++/include/objects/id2/id2_client.hpp
index 75a3319..ef1f151 100644
--- a/c++/include/objects/seq/Seq_gap.hpp
+++ b/c++/include/objects/id2/id2_client.hpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_gap.hpp 436442 2014-05-28 14:31:20Z ucko $
+/* $Id: id2_client.hpp 477911 2015-09-02 16:03:12Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -25,66 +25,77 @@
  *
  */
 
-/// @file Seq_gap.hpp
+/// @file id2_client.hpp
 /// User-defined methods of the data storage class.
 ///
 /// This file was originally generated by application DATATOOL
 /// using the following specifications:
-/// 'seq.asn'.
+/// 'id2.asn'.
 ///
 /// New methods or data members can be added to it if needed.
-/// See also: Seq_gap_.hpp
+/// See also: id2_client_.hpp
 
 
-#ifndef OBJECTS_SEQ_SEQ_GAP_HPP
-#define OBJECTS_SEQ_SEQ_GAP_HPP
+#ifndef OBJECTS_ID2_ID2_CLIENT_HPP
+#define OBJECTS_ID2_ID2_CLIENT_HPP
 
 
 // generated includes
-#include <objects/seq/Seq_gap_.hpp>
-
-#include <objects/seq/Linkage_evidence.hpp>
+#include <objects/id2/id2_client_.hpp>
 
 // generated classes
 
-
 BEGIN_NCBI_SCOPE
 
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
 /////////////////////////////////////////////////////////////////////////////
-class NCBI_SEQ_EXPORT CSeq_gap : public CSeq_gap_Base
+class NCBI_ID2_EXPORT CID2Client : public CID2Client_Base
 {
-    typedef CSeq_gap_Base Tparent;
+    typedef CID2Client_Base Tparent;
 public:
     // constructor
-    CSeq_gap(void);
+    CID2Client(void);
     // destructor
-    ~CSeq_gap(void);
+    ~CID2Client(void);
+
+    // ID2 allows multuple replies on each request, so we have to override
+    // default ReadReply. The Ask() methods return only the last reply,
+    // all replies are available via GetAllReplies() method.
+    typedef vector< CRef<TReply> > TReplies;
+    const TReplies& GetAllReplies(void)
+    { return m_Replies; }
 
-    void ChangeType(TType linkage_type);
-    void SetLinkageTypeScaffold(CLinkage_evidence::TType evidence_type);
-    void SetLinkageTypeLinkedRepeat(CLinkage_evidence::TType evidence_type);
-    bool AddLinkageEvidence(CLinkage_evidence::TType evidence_type);
+protected:
+    // ID2 requires requests to be sent in ID2-Request-Packet that may hold
+    // several requests, so we have to override default WriteRequest.
+    virtual void WriteRequest(CObjectOStream& out, const TRequest& request);
 
+    // ID2 allows multuple replies on each request, so we have to override
+    // default ReadReply. The Ask() methods return only the last reply,
+    // all replies are available via GetAllReplies() method.
+    virtual void ReadReply(CObjectIStream& in, TReply& reply);
+
+private:
+    TReplies m_Replies;
 
 private:
     // Prohibit copy constructor and assignment operator
-    CSeq_gap(const CSeq_gap& value);
-    CSeq_gap& operator=(const CSeq_gap& value);
+    CID2Client(const CID2Client& value);
+    CID2Client& operator=(const CID2Client& value);
 
 };
 
-/////////////////// CSeq_gap inline methods
+/////////////////// CID2Client inline methods
 
 // constructor
 inline
-CSeq_gap::CSeq_gap(void)
+CID2Client::CID2Client(void)
 {
 }
 
 
-/////////////////// end of CSeq_gap inline methods
+/////////////////// end of CID2Client inline methods
 
 
 END_objects_SCOPE // namespace ncbi::objects::
@@ -92,5 +103,4 @@ END_objects_SCOPE // namespace ncbi::objects::
 END_NCBI_SCOPE
 
 
-#endif // OBJECTS_SEQ_SEQ_GAP_HPP
-/* Original file checksum: lines: 86, chars: 2354, CRC32: 25e00c0f */
+#endif // OBJECTS_ID2_ID2_CLIENT_HPP
diff --git a/c++/include/objtools/data_loaders/genbank/reader_interface.hpp b/c++/include/objects/id2/id2processor.hpp
similarity index 51%
copy from c++/include/objtools/data_loaders/genbank/reader_interface.hpp
copy to c++/include/objects/id2/id2processor.hpp
index 386cd50..fc9177e 100644
--- a/c++/include/objtools/data_loaders/genbank/reader_interface.hpp
+++ b/c++/include/objects/id2/id2processor.hpp
@@ -1,6 +1,6 @@
-#ifndef READER_INTERFACE__HPP_INCLUDED
-#define READER_INTERFACE__HPP_INCLUDED
-/*  $Id: reader_interface.hpp 440707 2014-07-16 15:42:14Z vasilche $
+#ifndef OBJECTS_ID2_ID2PROCESSOR_HPP
+#define OBJECTS_ID2_ID2PROCESSOR_HPP
+/*  $Id: id2processor.hpp 486265 2015-12-02 19:22:44Z vasilche $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -25,38 +25,53 @@
 *
 *  Author:  Eugene Vasilchenko
 *
-*  File Description: Base data reader interface
+*  File Description: Interface for plug-in ID2 processing
 *
 */
 
-#include <corelib/plugin_manager.hpp>
+#include <corelib/ncbiobj.hpp>
+#include <vector>
 
 BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
 
-class CReader;
 
-END_SCOPE(objects)
+class CSeq_id;
+class CID2_Request_Packet;
+class CID2_Request;
+class CID2_Reply;
+
+// CID2ProcessorResolver callback can be used to get information from user of
+// CID2Processor interface to avoid possible deadlock or infinite recursion
+class NCBI_ID2_EXPORT CID2ProcessorResolver : public CObject
+{
+public:
+    CID2ProcessorResolver(void);
+    virtual ~CID2ProcessorResolver(void);
+
+    typedef vector<CConstRef<CSeq_id> > TIds;
+
+    virtual TIds GetIds(const CSeq_id& id) = 0;
+};
 
-NCBI_DECLARE_INTERFACE_VERSION(objects::CReader,  "xreader", 5, 1, 0);
 
-template<>
-class CDllResolver_Getter<objects::CReader>
+class NCBI_ID2_EXPORT CID2Processor : public CObject
 {
 public:
-    CPluginManager_DllResolver* operator()(void)
-    {
-        CPluginManager_DllResolver* resolver =
-            new CPluginManager_DllResolver
-            (CInterfaceVersion<objects::CReader>::GetName(),
-             kEmptyStr,
-             CVersionInfo::kAny,
-             CDll::eAutoUnload);
-        resolver->SetDllNamePrefix("ncbi");
-        return resolver;
-    }
+    CID2Processor(void);
+    virtual ~CID2Processor(void);
+    
+    typedef vector<CRef<CID2_Reply> > TReplies;
+
+    virtual TReplies ProcessSomeRequests(CID2_Request_Packet& packet,
+                                         CID2ProcessorResolver* resolver = 0) = 0;
+    virtual bool ProcessRequest(TReplies& replies,
+                                CID2_Request& request,
+                                CID2ProcessorResolver *resolver = 0) = 0;
 };
 
+
+END_SCOPE(objects)
 END_NCBI_SCOPE
 
-#endif//READER_INTERFACE__HPP_INCLUDED
+#endif//OBJECTS_ID2_ID2PROCESSOR_HPP
diff --git a/c++/include/objtools/format/genbank_gather.hpp b/c++/include/objects/id2/id2processor_interface.hpp
similarity index 67%
copy from c++/include/objtools/format/genbank_gather.hpp
copy to c++/include/objects/id2/id2processor_interface.hpp
index f14c9b2..fed6bae 100644
--- a/c++/include/objtools/format/genbank_gather.hpp
+++ b/c++/include/objects/id2/id2processor_interface.hpp
@@ -1,9 +1,7 @@
-#ifndef OBJTOOLS_FORMAT___GENBANK_GATHER__HPP
-#define OBJTOOLS_FORMAT___GENBANK_GATHER__HPP
-
-/*  $Id: genbank_gather.hpp 379519 2012-11-01 17:25:07Z kornbluh $
+#ifndef OBJECTS_ID2_ID2PROCESSOR_INTERFACE__HPP_INCLUDED
+#define OBJECTS_ID2_ID2PROCESSOR_INTERFACE__HPP_INCLUDED
+/*  $Id: id2processor_interface.hpp 480290 2015-09-29 16:17:42Z vasilche $
 * ===========================================================================
-*
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
 *
@@ -23,42 +21,35 @@
 *  purpose.
 *
 *  Please cite the author in any work or product based on this material.
-*
 * ===========================================================================
 *
-* Author:  Aaron Ucko, NCBI
-*          Mati Shomrat
+*  Author:  Eugene Vasilchenko
 *
-* File Description:
+*  File Description: CID2Processor plugin interface
 *
 */
-#include <corelib/ncbistd.hpp>
 
-#include <objtools/format/gather_items.hpp>
+#include <corelib/plugin_manager.hpp>
 
 
 BEGIN_NCBI_SCOPE
+
 BEGIN_SCOPE(objects)
 
+class CID2Processor;
 
-class CBioseqContext;
-class CBioseq;
+END_SCOPE(objects)
 
+NCBI_DECLARE_INTERFACE_VERSION(objects::CID2Processor,  "id2proc", 1, 0, 0);
 
-class NCBI_FORMAT_EXPORT CGenbankGatherer : public CFlatGatherer
+template<>
+class NCBI_ID2_EXPORT CDllResolver_Getter<objects::CID2Processor>
 {
 public:
-    CGenbankGatherer(void);
-
-    virtual void x_DoSingleSection(CBioseqContext& ctx) const;
-
-private:
-    void x_GatherWGS(void) const;
-    void x_GatherTSA(void) const;
+    CPluginManager_DllResolver* operator()(void);
 };
 
-
-END_SCOPE(objects)
 END_NCBI_SCOPE
 
-#endif  /* OBJTOOLS_FORMAT___GENBANK_GATHER__HPP */
+
+#endif//OBJECTS_ID2_ID2PROCESSOR_INTERFACE__HPP_INCLUDED
diff --git a/c++/include/objects/macro/String_constraint.hpp b/c++/include/objects/macro/String_constraint.hpp
index a1ea07c..414e0f6 100644
--- a/c++/include/objects/macro/String_constraint.hpp
+++ b/c++/include/objects/macro/String_constraint.hpp
@@ -1,4 +1,4 @@
-/* $Id: String_constraint.hpp 454228 2014-12-11 19:24:06Z asztalos $
+/* $Id: String_constraint.hpp 494819 2016-03-10 18:53:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -88,6 +88,8 @@ private:
     bool x_IsAllCaps(const string& str) const;
     bool x_IsAllLowerCase(const string& str) const;
     bool x_IsAllPunctuation(const string& str) const;
+    bool x_IsSkippable(const char ch) const;
+    bool x_IsAllSkippable(const string& str) const;
     // Checks whether the first letter of the first word is capitalized
     bool x_IsFirstCap(const string& str) const;
     // Checks whether the first letter of each word is capitalized
diff --git a/c++/include/objects/misc/error_codes.hpp b/c++/include/objects/misc/error_codes.hpp
index 4d8134d..bb3ae82 100644
--- a/c++/include/objects/misc/error_codes.hpp
+++ b/c++/include/objects/misc/error_codes.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS___ERROR_CODES__HPP
 #define OBJECTS___ERROR_CODES__HPP
 
-/*  $Id: error_codes.hpp 483824 2015-11-04 17:35:33Z ivanov $
+/*  $Id: error_codes.hpp 483748 2015-11-03 20:19:21Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/seq/Bioseq.hpp b/c++/include/objects/seq/Bioseq.hpp
index 0b8dfda..fb84993 100644
--- a/c++/include/objects/seq/Bioseq.hpp
+++ b/c++/include/objects/seq/Bioseq.hpp
@@ -1,4 +1,4 @@
-/* $Id: Bioseq.hpp 455474 2014-12-30 16:36:56Z foleyjp $
+/* $Id: Bioseq.hpp 489688 2016-01-14 22:21:13Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -96,7 +96,7 @@ public:
     // type by seq-loc). The location is splitted into simple
     // locations (intervals, points, whole-s etc.) and put into
     // ext::delta.
-    CBioseq(const CSeq_loc& loc, const string& str_id = kEmptyStr);
+    explicit CBioseq(const CSeq_loc& loc, const string& str_id = kEmptyStr);
 
     enum ELabelType {
         eType,
diff --git a/c++/include/objects/seq/Seq_gap.hpp b/c++/include/objects/seq/Seq_gap.hpp
index 75a3319..de9b2df 100644
--- a/c++/include/objects/seq/Seq_gap.hpp
+++ b/c++/include/objects/seq/Seq_gap.hpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_gap.hpp 436442 2014-05-28 14:31:20Z ucko $
+/* $Id: Seq_gap.hpp 499433 2016-04-26 14:13:30Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -50,6 +50,9 @@
 
 BEGIN_NCBI_SCOPE
 
+template <class KeyType, class ValueType, class KeyCompare >
+class CStaticArrayMap;
+
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
 /////////////////////////////////////////////////////////////////////////////
@@ -67,6 +70,39 @@ public:
     void SetLinkageTypeLinkedRepeat(CLinkage_evidence::TType evidence_type);
     bool AddLinkageEvidence(CLinkage_evidence::TType evidence_type);
 
+    /// indicates which linkage-evidences a given gap-type
+    /// can accept, if any
+    enum ELinkEvid {
+        /// only the "unspecified" linkage-evidence is allowed
+        eLinkEvid_UnspecifiedOnly,
+        /// no linkage-evidence is allowed
+        eLinkEvid_Forbidden,
+        /// any linkage-evidence is allowed, and at least one is required
+        eLinkEvid_Required,
+    };
+    /// Holds information about a given gap-type string
+    struct SGapTypeInfo {
+        /// The underlying type that the string corresponds to
+        CSeq_gap::EType m_eType;
+        /// Indicates what linkage-evidences are compatible with this
+        ELinkEvid       m_eLinkEvid;
+    };
+    /// Map a gap-type string to its information
+    /// Note that PCase_CStr, which means direct lookup is 
+    /// NOT insensitive to case, etc.
+    typedef CStaticArrayMap<const char *, SGapTypeInfo, PCase_CStr> TGapTypeMap;
+
+    /// From a gap-type string, get the SGapTypeInfo, 
+    /// insensitive to case, etc.  This is NOT quite the same as calling
+    /// find on the TGapTypeMap.
+    ///
+    /// @returns NULL if not found
+    static const SGapTypeInfo * NameToGapTypeInfo(const CTempString & sName);
+    /// This is for if the user needs to get the gap-type string
+    /// to SGapTypeInfo info directly (For example, to iterate through
+    /// all possible types).
+    static const TGapTypeMap & GetNameToGapTypeInfoMap(void);
+
 
 private:
     // Prohibit copy constructor and assignment operator
diff --git a/c++/include/objects/seq/Seq_inst.hpp b/c++/include/objects/seq/Seq_inst.hpp
index 20c313b..49f2191 100644
--- a/c++/include/objects/seq/Seq_inst.hpp
+++ b/c++/include/objects/seq/Seq_inst.hpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_inst.hpp 103491 2007-05-04 17:18:18Z kazimird $
+/* $Id: Seq_inst.hpp 488736 2016-01-05 15:02:56Z choi $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -63,6 +63,9 @@ public:
     bool IsNa(void) const;
     bool IsAa(void) const;
 
+    // translate EMol to string
+    static string GetMoleculeClass(EMol mol);
+
 private:
     // Prohibit copy constructor and assignment operator
     CSeq_inst(const CSeq_inst& value);
diff --git a/c++/include/objects/seq/seq_loc_mapper_base.hpp b/c++/include/objects/seq/seq_loc_mapper_base.hpp
index e3a76df..058f4c3 100644
--- a/c++/include/objects/seq/seq_loc_mapper_base.hpp
+++ b/c++/include/objects/seq/seq_loc_mapper_base.hpp
@@ -1,7 +1,7 @@
 #ifndef SEQ_LOC_MAPPER_BASE__HPP
 #define SEQ_LOC_MAPPER_BASE__HPP
 
-/*  $Id: seq_loc_mapper_base.hpp 482403 2015-10-22 18:03:40Z ivanov $
+/*  $Id: seq_loc_mapper_base.hpp 493266 2016-02-25 16:13:50Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -68,7 +68,7 @@ class CSeq_graph;
 class IMapper_Sequence_Info;
 
 
-/// CMappingRange - describles a single interval to interval
+/// CMappingRange - describes a single interval to interval
 /// mapping.
 class NCBI_SEQ_EXPORT CMappingRange : public CObject
 {
@@ -109,7 +109,7 @@ public:
     TRange Map_Range(TSeqPos           from,
                      TSeqPos           to,
                      const TRangeFuzz* fuzz = 0) const;
-    /// Map the strand, return true if the destination strand sould be
+    /// Map the strand, return true if the destination strand should be
     /// set (even if it's eNa_strand_unknown -- this may happen if the
     /// source strand is set to unknown).
     bool Map_Strand(bool is_set_strand,
@@ -130,11 +130,11 @@ private:
     CSeq_id_Handle      m_Dst_id_Handle;
     TSeqPos             m_Dst_from;
     ENa_strand          m_Dst_strand;
-    // Wether the mapping reverses the strand or not.
+    // Whether the mapping reverses the strand or not.
     // This value can be calculated from source and destination
     // strands, but is cached for better performance.
     bool                m_Reverse;
-    // Wether to extend the mapped location to the end of
+    // Whether to extend the mapped location to the end of
     // destination range. Used when mapping from a prot to a nuc.
     // ExtTo is set when both conditions are met:
     // - the mapping is from a protein to a nucleotide
@@ -166,14 +166,15 @@ private:
     //friend class CSeq_align_Mapper;
     friend struct CMappingRangeRef_Less;
     friend struct CMappingRangeRef_LessRev;
+
 public:
     // Interface for CPairwiseAln converter
     TSeqPos GetSrc_from(void) const { return m_Src_from; }
     TSeqPos GetDst_from(void) const { return m_Dst_from; }
-    TSeqPos GetLength(void) const { return m_Src_to - m_Src_from; }
-    bool GetReverse(void) const { return m_Reverse; }
-    int GetGroup(void) const { return m_Group; }
-    void SetGroup(int grp) { m_Group = grp; }
+    TSeqPos GetLength(void)   const { return m_Src_to - m_Src_from; }
+    bool    GetReverse(void)  const { return m_Reverse; }
+    int     GetGroup(void)    const { return m_Group; }
+    void    SetGroup(int grp) { m_Group = grp; }
 };
 
 
@@ -398,7 +399,7 @@ public:
     /// Merge any abutting or overlapping intervals
     CSeq_loc_Mapper_Base& SetMergeAll(void);
 
-    /// Wether to preserve or remove NULL sub-locations (usually
+    /// Whether to preserve or remove NULL sub-locations (usually
     /// indicating gaps) from the result. By default gaps are preserved.
     CSeq_loc_Mapper_Base& SetGapPreserve(void);
     CSeq_loc_Mapper_Base& SetGapRemove(void);
@@ -409,7 +410,7 @@ public:
     CSeq_loc_Mapper_Base& SetTrimSplicedSeg(bool trim);
 
     /// Keep ranges which can not be mapped. Does not affect truncation
-    /// of partially mapped ranges. By default nonmapping ranges are
+    /// of partially mapped ranges. By default non-mapping ranges are
     /// removed.
     CSeq_loc_Mapper_Base& KeepNonmappingRanges(void);
     CSeq_loc_Mapper_Base& TruncateNonmappingRanges(void);
@@ -537,6 +538,9 @@ protected:
     // rows become mapping source.
     void x_InitializeAlign(const CSeq_align& map_align,
                            const CSeq_id&    to_id);
+    // Recursive version of the above.
+    void x_InitializeAlign(const CSeq_align& map_align,
+                           const TSynonyms&  to_ids);
     // Initialize the mapper from an alignment, map to the specified row.
     void x_InitializeAlign(const CSeq_align& map_align,
                            size_t            to_row);
@@ -664,7 +668,7 @@ private:
     // sequence types could not be detected. In this case the mapper
     // will attempt to find at least one known type in the location
     // and force it for all sub-locations with unknown types.
-    // The function will fail if there are diferent known types in the
+    // The function will fail if there are different known types in the
     // same seq-loc.
     ESeqType x_ForceSeqTypes(const CSeq_loc& loc) const;
 
@@ -685,7 +689,7 @@ private:
     void x_InitAlign(const CStd_seg& sseg, size_t to_row);
     void x_InitAlign(const CPacked_seg& pseg, size_t to_row);
     void x_InitSpliced(const CSpliced_seg& spliced,
-                       const CSeq_id&      to_id);
+                       const TSynonyms&    to_ids);
     void x_InitSpliced(const CSpliced_seg& spliced, ESplicedRow to_row);
     void x_InitSparse(const CSparse_seg& sparse, int to_row);
 
@@ -735,6 +739,10 @@ private:
     // See also x_PushRangesToDstMix.
     void x_PushLocToDstMix(CRef<CSeq_loc> loc);
 
+    // Pushes NULL location to the destination mix (when a range
+    // can not be mapped).
+    void x_PushNullLoc(void);
+
     // Map the alignment. If row is NULL, map all rows. Otherwise
     // map only the selected row.
     CRef<CSeq_align> x_MapSeq_align(const CSeq_align& src_align,
@@ -805,6 +813,9 @@ private:
     // original id.
     const CSeq_id_Handle& x_GetPrimaryId(const CSeq_id_Handle& synonym) const;
 
+    // Check if the id is in the list of synonyms.
+    bool x_IsSynonym(const CSeq_id& id, const TSynonyms& synonyms) const;
+
     typedef map<CSeq_id_Handle, CSeq_id_Handle> TSynonymMap;
     typedef map<CSeq_id_Handle, TSeqPos> TLengthMap;
 
@@ -817,12 +828,12 @@ private:
     enum EMiscFlags {
         // Trim leading/trailing indels (gaps) from mapped spliced-seg alignments.
         fTrimSplicedSegs        = 1 << 0,
-        // Wether to keep or discard ranges which can not be mapped.
+        // Whether to keep or discard ranges which can not be mapped.
         fKeepNonmapping         = 1 << 1,
-        // Wether to check or not if the original location is on the same strand
+        // Whether to check or not if the original location is on the same strand
         // as the mapping source.
         fCheckStrand            = 1 << 2,
-        // Wether to include a source of each mapped range to the mapped seq-loc.
+        // Whether to include a source of each mapped range to the mapped seq-loc.
         fIncludeSrcLocs         = 1 << 3,
         // Prefer spliced-seg for mixed alignments.
         fMixedAlignsAsSpliced   = 1 << 4,
@@ -832,7 +843,7 @@ private:
     };
     typedef int TMiscFlags;
 
-    bool x_IsSetMiscFlag(EMiscFlags flag) const { return m_MiscFlags & flag; }
+    bool x_IsSetMiscFlag(EMiscFlags flag) const { return (m_MiscFlags & flag) == flag; }
     void x_SetMiscFlag(EMiscFlags flag, bool value);
 
     TMiscFlags m_MiscFlags;
@@ -904,9 +915,13 @@ public:
     /// NOTE: In most cases CollectSynonyms(const CSeq_id_Handle& id) should
     /// be used instead, since it takes care of synonym storage and mapping.
     /// This method does nothing but storing synonyms in the container.
-    void CollectSynonyms(const CSeq_id_Handle& id,
-                         TSynonyms&            synonyms) const;
-
+    void CollectSynonyms(const CSeq_id_Handle& id, TSynonyms& synonyms) const;
+    // Check if ranges which can not be mapped should be replaced with NULL
+    // locations. By default removed ranges are reported using neighbor's fuzz.
+    // The flag is controlled from environment/registry:
+    // MAPPER_NONMAPPING_AS_NULL=t
+    // [Mapper]/Nonmapping_As_Null=t
+    static bool GetNonMappingAsNull(void);
 };
 
 
diff --git a/c++/include/objects/seq/sofa_map.hpp b/c++/include/objects/seq/sofa_map.hpp
index 432e6ce..1dbb5d2 100644
--- a/c++/include/objects/seq/sofa_map.hpp
+++ b/c++/include/objects/seq/sofa_map.hpp
@@ -1,4 +1,4 @@
-/*  $Id: sofa_map.hpp 340818 2011-10-13 11:43:21Z ludwigf $
+/*  $Id: sofa_map.hpp 496057 2016-03-23 15:31:16Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,6 +32,7 @@
 #ifndef OBJECTS___SOFAMAP__HPP
 #define OBJECTS___SOFAMAP__HPP
 
+#include <objects/seqfeat/Seq_feat.hpp>
 #include <objects/seqfeat/SeqFeatData.hpp>
 
 BEGIN_NCBI_SCOPE
@@ -63,6 +64,9 @@ public:
         return m_default.m_name;
     }
 
+    string FeatureToSofaType(
+        const CSeq_feat&);
+
     const map<CFeatListItem, SofaType>& Map() const
     {
         return m_Map;
diff --git a/c++/include/objects/seqalign/Dense_diag.hpp b/c++/include/objects/seqalign/Dense_diag.hpp
index 6d7b24d..d13cbbb 100644
--- a/c++/include/objects/seqalign/Dense_diag.hpp
+++ b/c++/include/objects/seqalign/Dense_diag.hpp
@@ -1,4 +1,4 @@
-/* $Id: Dense_diag.hpp 482675 2015-10-26 14:12:53Z ivanov $
+/* $Id: Dense_diag.hpp 479309 2015-09-18 13:33:56Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/seqfeat/BioSource.hpp b/c++/include/objects/seqfeat/BioSource.hpp
index 39f325c..f283d15 100644
--- a/c++/include/objects/seqfeat/BioSource.hpp
+++ b/c++/include/objects/seqfeat/BioSource.hpp
@@ -1,4 +1,4 @@
-/* $Id: BioSource.hpp 454989 2014-12-22 12:41:16Z bollin $
+/* $Id: BioSource.hpp 488225 2015-12-28 20:52:28Z kans $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -63,7 +63,7 @@ public:
     ~CBioSource(void);
 
     // Get the appropriate gene code from this BioSource.
-    int GetGenCode(void) const;
+    int GetGenCode(int def = 1) const;
 
     // function for getting genome value from organelle name
     static CBioSource::EGenome GetGenomeByOrganelle (const string& organelle, NStr::ECase use_case = NStr::eCase, bool starts_with = false);
diff --git a/c++/include/objects/seqfeat/Gb_qual.hpp b/c++/include/objects/seqfeat/Gb_qual.hpp
index 4610800..db820dc 100644
--- a/c++/include/objects/seqfeat/Gb_qual.hpp
+++ b/c++/include/objects/seqfeat/Gb_qual.hpp
@@ -1,4 +1,4 @@
-/* $Id: Gb_qual.hpp 481760 2015-10-15 15:32:51Z ivanov $
+/* $Id: Gb_qual.hpp 493884 2016-03-02 14:18:51Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -49,6 +49,8 @@
 #include <corelib/ncbistd.hpp>
 #include <corelib/ncbistr.hpp>
 #include <serial/iterator.hpp>
+#include <util/static_map.hpp>
+
 
 BEGIN_NCBI_SCOPE
 
@@ -74,12 +76,28 @@ public:
     static bool CleanupRptUnitSeq(string& val);
     static bool CleanupReplace(string& val);
     static bool CleanupRptUnitRange(string& val);
-    
+
+    // for rpt_type qualifiers
+    typedef CStaticArraySet<const char *, PNocase_CStr> TLegalRepeatTypeSet;
+    static const TLegalRepeatTypeSet &GetSetOfLegalRepeatTypes(void);
+    static bool IsValidRptTypeValue(const string& val);
+
+    // for pseudogene qualifiers
+    typedef CStaticArraySet<const char *, PNocase_CStr> TLegalPseudogeneSet;
+    static const TLegalPseudogeneSet &GetSetOfLegalPseudogenes(void);
+    static bool IsValidPseudogeneValue(const string& val);
+
     static bool IsLegalMobileElementValue(const string& val);
     static void GetMobileElementValueElements(const string& val, string& element_type, string& element_name);
 
     static bool IsIllegalQualName(const string& val);
 
+    static void ParseInferenceString(string val, string &category, string &type_str, bool &is_same_species, string &database, 
+                                     string &accession, string &program, string &version, string &acc_list);
+
+    static string CleanupAndRepairInference( const string &orig_inference );
+
+
 private:
     // Prohibit copy constructor and assignment operator
     CGb_qual(const CGb_qual& value);
diff --git a/c++/include/objects/seqfeat/Prot_ref.hpp b/c++/include/objects/seqfeat/Prot_ref.hpp
index e2d9639..422f2d4 100644
--- a/c++/include/objects/seqfeat/Prot_ref.hpp
+++ b/c++/include/objects/seqfeat/Prot_ref.hpp
@@ -1,4 +1,4 @@
-/* $Id: Prot_ref.hpp 440810 2014-07-17 11:40:05Z bollin $
+/* $Id: Prot_ref.hpp 489218 2016-01-11 15:30:48Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -83,6 +83,9 @@ public:
     /// Return a replaced EC number's replacement.
     static const string& GetECNumberReplacement(const string& old_ecno);
 
+    // Indicate whether an EC number has been replaced by more than one value (split)
+    static bool IsECNumberSplit(const string& old_ecno);
+
     /// Verify correct form of EC number.
     static bool IsValidECNumberFormat (const string&  ecno);
 
diff --git a/c++/include/objects/seqfeat/RNA_ref.hpp b/c++/include/objects/seqfeat/RNA_ref.hpp
index c9550ed..3d4b697 100644
--- a/c++/include/objects/seqfeat/RNA_ref.hpp
+++ b/c++/include/objects/seqfeat/RNA_ref.hpp
@@ -1,4 +1,4 @@
-/* $Id: RNA_ref.hpp 471076 2015-06-23 15:21:05Z ivanov $
+/* $Id: RNA_ref.hpp 488648 2016-01-04 16:07:40Z asztalos $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -61,7 +61,7 @@ public:
 
     static string GetRnaTypeName (const CRNA_ref::EType rna_type);
 
-    const string& GetRnaProductName(void) const;
+    string GetRnaProductName(void) const;
     void SetRnaProductName(const string& product, string& remainder);
 
 private:
diff --git a/c++/include/objects/seqfeat/SeqFeatData.hpp b/c++/include/objects/seqfeat/SeqFeatData.hpp
index 8ada576..ce4ff5d 100644
--- a/c++/include/objects/seqfeat/SeqFeatData.hpp
+++ b/c++/include/objects/seqfeat/SeqFeatData.hpp
@@ -1,4 +1,4 @@
-/* $Id: SeqFeatData.hpp 478054 2015-09-03 16:30:15Z ivanov $
+/* $Id: SeqFeatData.hpp 477822 2015-09-02 12:03:07Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/seqfeat/Seq_feat.hpp b/c++/include/objects/seqfeat/Seq_feat.hpp
index 6e165fa..7e28ec5 100644
--- a/c++/include/objects/seqfeat/Seq_feat.hpp
+++ b/c++/include/objects/seqfeat/Seq_feat.hpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_feat.hpp 468197 2015-05-21 12:53:40Z kornbluh $
+/* $Id: Seq_feat.hpp 490392 2016-01-25 17:20:58Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -102,6 +102,17 @@ public:
     /// and reset the except flag if there are no exception texts left.
     void RemoveExceptText(const string & exception_text);
 
+    /// Produces the list of legal exceptions. Note that more than one of
+    /// these values might occur in Seq-feat.exception_text, separated by
+    /// commas, however RefSeq-only exceptions should only appear alone.
+    static vector<string> GetListOfLegalExceptions(bool include_refseq);
+
+    /// Indicates whether this specific text occurs in the list of legal exceptions
+    static bool IsExceptionTextInLegalList(const string& exception_text, bool allow_refseq);
+
+    /// Indicates whether this specific text is a RefSeq-only exception
+    static bool IsExceptionTextRefSeqOnly(const string& exception_text);
+
     /// Return a specified DB xref.  This will find the *first* item in the
     /// given referenced database.  If no item is found, an empty CConstRef<>
     /// is returned.
diff --git a/c++/include/objects/seqfeat/SubSource.hpp b/c++/include/objects/seqfeat/SubSource.hpp
index fbaf17c..400dc71 100644
--- a/c++/include/objects/seqfeat/SubSource.hpp
+++ b/c++/include/objects/seqfeat/SubSource.hpp
@@ -1,4 +1,4 @@
-/* $Id: SubSource.hpp 482191 2015-10-21 15:23:12Z ivanov $
+/* $Id: SubSource.hpp 493853 2016-03-02 14:07:56Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -103,6 +103,14 @@ public:
     static CRef<CDate> DateFromCollectionDate (const string& str) THROWS((CException));
 
     static void IsCorrectDateFormat(const string& date_string, bool& bad_format, bool& in_future);
+    typedef enum {
+        eDateFormatFlag_ok = 0,
+        eDateFormatFlag_bad_format = 1,
+        eDateFormatFlag_in_future = 2,
+        eDateFormatFlag_out_of_order = 4
+    } EDateFormatFlag;
+    static size_t CheckDateFormat(const string& date_string);
+
     static string GetCollectionDateProblem (const string& date_string);
     static bool IsCollectionDateAfterTime(const string& collection_date, time_t t, bool& bad_format);
     static bool IsCollectionDateAfterTime(const CDate& collection_date, time_t t);
@@ -210,10 +218,13 @@ private:
     CSubSource(const CSubSource& value);
     CSubSource& operator=(const CSubSource& value);
 
-    static string x_ParseDateRangeWithDelimiter(const string& orig_date, const string& delim);
+    static string x_ParseDateRangeWithDelimiter(const string& orig_date, CTempString delim);
     static vector<string> x_GetDateTokens(const string& orig_date);
     static CLatLonCountryId * x_CalculateLatLonId(float lat_value, float lon_value, string country, string province);
 
+    static int x_GetPrecision(const string& num_str);
+    static string x_FormatWithPrecision(double val, int precision);
+
     // validation data read from external files
     static auto_ptr<CLatLonCountryMap> m_LatLonCountryMap;
     static auto_ptr<CLatLonCountryMap> m_LatLonWaterMap;
diff --git a/c++/include/objects/seqfeat/RNA_ref.hpp b/c++/include/objects/seqfeat/Trna_ext.hpp
similarity index 69%
copy from c++/include/objects/seqfeat/RNA_ref.hpp
copy to c++/include/objects/seqfeat/Trna_ext.hpp
index c9550ed..3bd2dc0 100644
--- a/c++/include/objects/seqfeat/RNA_ref.hpp
+++ b/c++/include/objects/seqfeat/Trna_ext.hpp
@@ -1,4 +1,4 @@
-/* $Id: RNA_ref.hpp 471076 2015-06-23 15:21:05Z ivanov $
+/* $Id: Trna_ext.hpp 500111 2016-05-02 15:51:42Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -25,7 +25,7 @@
  *
  */
 
-/// @RNA_ref.hpp
+/// @file Trna_ext.hpp
 /// User-defined methods of the data storage class.
 ///
 /// This file was originally generated by application DATATOOL
@@ -33,15 +33,15 @@
 /// 'seqfeat.asn'.
 ///
 /// New methods or data members can be added to it if needed.
-/// See also: RNA_ref_.hpp
+/// See also: Trna_ext_.hpp
 
 
-#ifndef OBJECTS_SEQFEAT_RNA_REF_HPP
-#define OBJECTS_SEQFEAT_RNA_REF_HPP
+#ifndef OBJECTS_SEQFEAT_TRNA_EXT_HPP
+#define OBJECTS_SEQFEAT_TRNA_EXT_HPP
 
 
 // generated includes
-#include <objects/seqfeat/RNA_ref_.hpp>
+#include <objects/seqfeat/Trna_ext_.hpp>
 
 // generated classes
 
@@ -50,42 +50,40 @@ BEGIN_NCBI_SCOPE
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
 /////////////////////////////////////////////////////////////////////////////
-class NCBI_SEQFEAT_EXPORT CRNA_ref : public CRNA_ref_Base
+class NCBI_SEQFEAT_EXPORT CTrna_ext : public CTrna_ext_Base
 {
-    typedef CRNA_ref_Base Tparent;
+    typedef CTrna_ext_Base Tparent;
 public:
     // constructor
-    CRNA_ref(void);
+    CTrna_ext(void);
     // destructor
-    ~CRNA_ref(void);
+    ~CTrna_ext(void);
 
-    static string GetRnaTypeName (const CRNA_ref::EType rna_type);
-
-    const string& GetRnaProductName(void) const;
-    void SetRnaProductName(const string& product, string& remainder);
+    static bool ParseDegenerateCodon(CTrna_ext & tRNA, const string & codon);
 
 private:
     // Prohibit copy constructor and assignment operator
-    CRNA_ref(const CRNA_ref& value);
-    CRNA_ref& operator=(const CRNA_ref& value);
+    CTrna_ext(const CTrna_ext& value);
+    CTrna_ext& operator=(const CTrna_ext& value);
 
 };
 
-/////////////////// CRNA_ref inline methods
+/////////////////// CTrna_ext inline methods
 
 // constructor
 inline
-CRNA_ref::CRNA_ref(void)
+CTrna_ext::CTrna_ext(void)
 {
 }
 
 
-/////////////////// end of CRNA_ref inline methods
+/////////////////// end of CTrna_ext inline methods
 
 
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
 
-#endif // OBJECTS_SEQFEAT_RNA_REF_HPP
-/* Original file checksum: lines: 94, chars: 2540, CRC32: 568fe2b4 */
+
+#endif // OBJECTS_SEQFEAT_TRNA_EXT_HPP
+/* Original file checksum: lines: 86, chars: 2397, CRC32: 32a4a2dd */
diff --git a/c++/include/objects/seqfeat/seqfeat_macros.hpp b/c++/include/objects/seqfeat/seqfeat_macros.hpp
index 09d2191..387cd38 100644
--- a/c++/include/objects/seqfeat/seqfeat_macros.hpp
+++ b/c++/include/objects/seqfeat/seqfeat_macros.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_SEQFEAT___SEQFEAT_MACROS__HPP
 #define OBJECTS_SEQFEAT___SEQFEAT_MACROS__HPP
 
-/*  $Id: seqfeat_macros.hpp 394538 2013-04-03 19:01:36Z ucko $
+/*  $Id: seqfeat_macros.hpp 485040 2015-11-18 13:21:39Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -500,6 +500,26 @@ LIST_ERASE_ITEM (MOD_ON_ORGREF, Itr, Var)
 #define MOD_ON_ORGREF_IS_EMPTY(Var) \
 FIELD_IS_EMPTY( MOD_ON_ORGREF, Var )
 
+/// MOD_ON_ORGREF_IS_SORTED
+
+#define MOD_ON_ORGREF_IS_SORTED(Var, Func) \
+IS_SORTED (MOD_ON_ORGREF, Var, Func)
+
+/// SORT_SYN_ON_ORGREF
+
+#define SORT_MOD_ON_ORGREF(Var, Func) \
+DO_LIST_SORT (MOD_ON_ORGREF, Var, Func)
+
+/// SYN_ON_ORGREF_IS_UNIQUE
+
+#define MOD_ON_ORGREF_IS_UNIQUE(Var, Func) \
+IS_UNIQUE (MOD_ON_ORGREF, Var, Func)
+
+/// UNIQUE_MOD_ON_ORGREF
+
+#define UNIQUE_MOD_ON_ORGREF(Var, Func) \
+DO_UNIQUE (MOD_ON_ORGREF, Var, Func)
+
 
 /// SYN_ON_ORGREF macros
 
diff --git a/c++/include/objects/seqloc/Seq_id.hpp b/c++/include/objects/seqloc/Seq_id.hpp
index 3a41bec..306a098 100644
--- a/c++/include/objects/seqloc/Seq_id.hpp
+++ b/c++/include/objects/seqloc/Seq_id.hpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_id.hpp 483962 2015-11-05 15:31:25Z ivanov $
+/* $Id: Seq_id.hpp 488743 2016-01-05 15:59:17Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -82,15 +82,18 @@ public:
         fParse_RawGI      = 0x04, ///< Treat raw numbers as GIs, not local IDs
         fParse_AnyRaw     = fParse_RawText | fParse_RawGI,
         /// Treat otherwise unidentified strings as raw accessions,
-        /// provided that they pass rudimentary validation.
+        /// provided that they pass rudimentary validation.  Also,
+        /// accept PDB accessions with chains but no delimiters.
         fParse_ValidLocal = 0x08,
         /// Treat otherwise unidentified strings as local accessions as long
         /// as they don't resemble FASTA-style IDs (or ID sets).
         fParse_AnyLocal   = 0x18,
         fParse_NoFASTA    = 0x20, ///< Don't bother checking for a tag
 
-        /// By default, allow raw parsable non-numeric accessions and
-        /// plausible local accessions.
+        /// By default in ParseIDs and IsValid, allow raw parsable
+        /// non-numeric accessions and plausible local accessions.
+        /// (The string-based constructor and Set method have a
+        /// stricter default: fParse_AnyRaw.)
         fParse_Default    = fParse_RawText | fParse_ValidLocal
     };
     typedef int TParseFlags; // binary OR of EParseFlags
@@ -399,8 +402,10 @@ public:
 
     /// Deduces information from a bare accession a la WHICH_db_accession;
     /// may report false negatives on properties.
-    static EAccessionInfo IdentifyAccession(const CTempString& accession);
-    EAccessionInfo IdentifyAccession(void) const;
+    static EAccessionInfo IdentifyAccession(const CTempString& accession,
+                                            TParseFlags flags = fParse_AnyRaw);
+    EAccessionInfo IdentifyAccession(TParseFlags flags
+                                     = fParse_AnyRaw | fParse_AnyLocal) const;
 
     static void LoadAccessionGuide(const string& filename);
     static void LoadAccessionGuide(ILineReader& in);
@@ -579,6 +584,7 @@ private:
     CSeq_id& operator= (const CSeq_id&);
 
     static EAccessionInfo x_IdentifyAccession(const CTempString& main_acc,
+                                              TParseFlags flags,
                                               bool has_version);
 
     //CRef<CAbstractObjectManager> m_ObjectManager;
diff --git a/c++/include/objects/seqloc/Seq_loc.hpp b/c++/include/objects/seqloc/Seq_loc.hpp
index 125c779..2e71381 100644
--- a/c++/include/objects/seqloc/Seq_loc.hpp
+++ b/c++/include/objects/seqloc/Seq_loc.hpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_loc.hpp 475726 2015-08-11 18:12:56Z vasilche $
+/* $Id: Seq_loc.hpp 496694 2016-03-30 14:14:36Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -152,7 +152,14 @@ public:
     void ResetStrand(void);
 
     /// Return start and stop positions of the seq-loc.
-    /// Stop may be less than Start for circular sequences.
+    /// Start position is the start of the first range in the seq-loc,
+    /// stop is the end of the last range. if eExtreme_Biological flag
+    /// is used, the effective order of ranges and range direction depends
+    /// on the strand.
+    /// NOTE: The returned values are not necessarily the same as
+    /// the boundaries returned by GetTotalRange(). It's also not
+    /// guaranteed that the value returned by GetStart() is less or
+    /// equal to the one returned by GetStop().
     TSeqPos GetStart(ESeqLocExtremes ext) const;
     TSeqPos GetStop (ESeqLocExtremes ext) const;
 
diff --git a/c++/include/objects/taxon1/taxon1.hpp b/c++/include/objects/taxon1/taxon1.hpp
index cd06e62..03f9358 100644
--- a/c++/include/objects/taxon1/taxon1.hpp
+++ b/c++/include/objects/taxon1/taxon1.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBI_TAXON1_HPP
 #define NCBI_TAXON1_HPP
 
-/* $Id: taxon1.hpp 421902 2013-12-16 16:47:03Z domrach $
+/* $Id: taxon1.hpp 488663 2016-01-04 18:15:48Z domrach $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -60,7 +60,7 @@ class ITreeIterator;
 class NCBI_TAXON1_EXPORT CTaxon1 {
 public:
     typedef list< string > TNameList;
-    typedef vector< int > TTaxIdList;
+    typedef vector< TTaxId > TTaxIdList;
 
     CTaxon1();
     ~CTaxon1();
@@ -89,7 +89,7 @@ public:
     // NOTE:
     // Caller gets his own copy of Taxon2Data structure.
     ///
-    CRef< CTaxon2_data > GetById(int tax_id);
+    CRef< CTaxon2_data > GetById(TTaxId tax_id);
 
     //----------------------------------------------
     // Get organism by OrgRef
@@ -119,7 +119,7 @@ public:
     // NOTE:
     // This function uses the same information from inp_orgRef as Lookup
     ///
-    int GetTaxIdByOrgRef(const COrg_ref& inp_orgRef);
+    TTaxId GetTaxIdByOrgRef(const COrg_ref& inp_orgRef);
 
     enum EOrgRefStatus {
         eStatus_Ok = 0,
@@ -157,7 +157,7 @@ public:
     //         -tax_id - if multiple nodes found
     //                   (where tax_id > 1 is id of one of the nodes)
     ///
-    int GetTaxIdByName(const string& orgname);
+    TTaxId GetTaxIdByName(const string& orgname);
 
     //----------------------------------------------
     // Get tax_id by organism "unique" name
@@ -167,7 +167,7 @@ public:
     //         -tax_id - if multiple nodes found
     //                   (where tax_id > 1 is id of one of the nodes)
     ///
-    int FindTaxIdByName(const string& orgname);
+    TTaxId FindTaxIdByName(const string& orgname);
 
     //----------------------------------------------
     // Get tax_id by organism name using fancy search modes. If given a pointer
@@ -178,7 +178,7 @@ public:
     //              -1 - if multiple nodes found
     //              -2 - error during processing occured
     ///
-    int SearchTaxIdByName(const string& orgname,
+    TTaxId SearchTaxIdByName(const string& orgname,
 			  ESearch mode = eSearch_TokenSet,
 			  list< CRef< CTaxon1_name > >* name_list_out = NULL);
 
@@ -187,7 +187,7 @@ public:
     // Returns: number of organisms found (negative value on error), 
     // id list appended with found tax ids
     ///
-    int GetAllTaxIdByName(const string& orgname, TTaxIdList& lIds);
+    TTaxId GetAllTaxIdByName(const string& orgname, TTaxIdList& lIds);
 
     //----------------------------------------------
     // Get organism by tax_id
@@ -198,7 +198,7 @@ public:
     // This function does not make a copy of OrgRef structure but returns
     // pointer to internally stored OrgRef.
     ///
-    CConstRef< COrg_ref > GetOrgRef(int tax_id,
+    CConstRef< COrg_ref > GetOrgRef(TTaxId tax_id,
 				    bool& is_species,
 				    bool& is_uncultured,
 				    string& blast_name,
@@ -218,7 +218,7 @@ public:
     // NOTE:
     //   Root of the tree has tax_id of 1
     ///
-    int GetParent(int id_tax);
+    TTaxId GetParent(TTaxId id_tax);
 
     //---------------------------------------------
     // Get species tax_id (id_tax should be below species).
@@ -236,7 +236,7 @@ public:
 	eSpeciesMode_RankOnly,
 	eSpeciesMode_Flag
     };
-    int GetSpecies(int id_tax, ESpeciesMode mode = eSpeciesMode_Flag);
+    TTaxId GetSpecies(TTaxId id_tax, ESpeciesMode mode = eSpeciesMode_Flag);
 
     //---------------------------------------------
     // Get genus tax_id (id_tax should be below genus)
@@ -244,7 +244,7 @@ public:
     //               0 - no genus in the lineage
     //              -1 - if error
     ///
-    int GetGenus(int id_tax);
+    TTaxId GetGenus(TTaxId id_tax);
 
     //---------------------------------------------
     // Get superkingdom tax_id (id_tax should be below superkingdom)
@@ -252,14 +252,56 @@ public:
     //               0 - no superkingdom in the lineage
     //              -1 - if error
     ///
-    int GetSuperkingdom(int id_tax);
+    TTaxId GetSuperkingdom(TTaxId id_tax);
+
+    //---------------------------------------------
+    // Get ancestor tax_id by rank name
+    // rank name might be one of:
+    // no rank
+    // superkingdom
+    // kingdom
+    // subkingdom
+    // superphylum
+    // phylum
+    // subphylum
+    // superclass
+    // class
+    // subclass
+    // infraclass
+    // cohort
+    // subcohort
+    // superorder
+    // order
+    // suborder
+    // infraorder
+    // parvorder
+    // superfamily
+    // family
+    // subfamily
+    // tribe
+    // subtribe
+    // genus
+    // subgenus
+    // species group
+    // species subgroup
+    // species
+    // subspecies
+    // varietas
+    // forma
+    // Returns: tax_id of properly ranked accessor or
+    //               0 - no such rank in the lineage
+    //              -1 - invalid rank name
+    //              -2 - any other error (use GetLastError for details)
+    ///
+    TTaxId GetAncestorByRank(TTaxId id_tax, const char* rank_name);
+    TTaxId GetAncestorByRank(TTaxId id_tax, short rank_id);
 
     //---------------------------------------------
     // Get taxids for all children of specified node.
     // Returns: number of children, id list appended with found tax ids
     //          -1 - in case of error
     ///
-    int GetChildren(int id_tax, TTaxIdList& children_ids);
+    int GetChildren(TTaxId id_tax, TTaxIdList& children_ids);
 
     //---------------------------------------------
     // Get genetic code name by genetic code id
@@ -316,7 +358,7 @@ public:
     // ancestor)
     //          -1 - in case of an error
     ///
-    int Join(int taxid1, int taxid2);
+    TTaxId Join(TTaxId taxid1, TTaxId taxid2);
 
     //---------------------------------------------
     // Get all names for tax_id
@@ -325,7 +367,7 @@ public:
     // NOTE:
     // If unique is true then only unique names will be stored
     ///
-    int GetAllNames(int tax_id, TNameList& lNames, bool unique);
+    int GetAllNames(TTaxId tax_id, TNameList& lNames, bool unique);
 
     //---------------------------------------------
     // Get list of all names for tax_id.
@@ -333,7 +375,7 @@ public:
     // Returns: TRUE - success
     //          FALSE - failure
     ///
-    bool GetAllNamesEx(int tax_id, list< CRef< CTaxon1_name > >& lNames);
+    bool GetAllNamesEx(TTaxId tax_id, list< CRef< CTaxon1_name > >& lNames);
 
     //---------------------------------------------
     // Dump all names of the particular class
@@ -360,7 +402,7 @@ public:
     //       tax_id if found
     //       0      if not found
     ///
-    bool GetTaxId4GI(TGi gi, int& tax_id_out);
+    bool GetTaxId4GI(TGi gi, TTaxId& tax_id_out);
 
     //--------------------------------------------------
     // Get "blast" name for id
@@ -370,7 +412,7 @@ public:
     //                this node in the lineage or empty if there is no blast
     //                name above
     ///
-    bool GetBlastName(int tax_id, string& blast_name_out);
+    bool GetBlastName(TTaxId tax_id, string& blast_name_out);
 
     //--------------------------------------------------
     // Get error message after latest erroneous operation
@@ -393,7 +435,7 @@ public:
     // Returns: false if error
     //          true  if Ok, *ppNode is pointing to the node
     ///
-    bool LoadNode( int tax_id, const ITaxon1Node** ppNode = NULL )
+    bool LoadNode( TTaxId tax_id, const ITaxon1Node** ppNode = NULL )
     { return LoadSubtreeEx( tax_id, 0, ppNode ); }
 
     //--------------------------------------------------
@@ -403,7 +445,7 @@ public:
     // Returns: false if error
     //          true  if Ok, *ppNode is pointing to the subtree root
     ///
-    bool LoadChildren( int tax_id, const ITaxon1Node** ppNode = NULL )
+    bool LoadChildren( TTaxId tax_id, const ITaxon1Node** ppNode = NULL )
     { return LoadSubtreeEx( tax_id, 1, ppNode ); }
 
     //--------------------------------------------------
@@ -412,7 +454,7 @@ public:
     // Returns: false if error
     //          true  if Ok, *ppNode is pointing to the subtree root
     ///
-    bool LoadSubtree( int tax_id, const ITaxon1Node** ppNode = NULL )
+    bool LoadSubtree( TTaxId tax_id, const ITaxon1Node** ppNode = NULL )
     { return LoadSubtreeEx( tax_id, -1, ppNode ); }
 
     enum EIteratorMode {
@@ -438,7 +480,7 @@ public:
     // at the tree node with tax_id.
     // Returns: NULL if node doesn't exist or some other error occurred
     ///
-    CRef< ITreeIterator > GetTreeIterator( int tax_id, EIteratorMode mode
+    CRef< ITreeIterator > GetTreeIterator( TTaxId tax_id, EIteratorMode mode
 					   = eIteratorMode_Default );
 
     //--------------------------------------------------
@@ -448,11 +490,11 @@ public:
     // Returns: true  when success and last parameter is filled with value,
     //          false when call failed
     ///
-    bool GetNodeProperty( int tax_id, const string& prop_name,
+    bool GetNodeProperty( TTaxId tax_id, const string& prop_name,
                           bool& prop_val );
-    bool GetNodeProperty( int tax_id, const string& prop_name,
+    bool GetNodeProperty( TTaxId tax_id, const string& prop_name,
                           int& prop_val );
-    bool GetNodeProperty( int tax_id, const string& prop_name,
+    bool GetNodeProperty( TTaxId tax_id, const string& prop_name,
                           string& prop_val );
 
     //---------------------------------------------------
@@ -462,13 +504,13 @@ public:
     // Returns: true  when success and last parameter is filled with type material list,
     //          false when call failed
     ///
-    bool GetTypeMaterial( int tax_id, TNameList& type_material_list_out );
+    bool GetTypeMaterial( TTaxId tax_id, TNameList& type_material_list_out );
 
     //---------------------------------------------------
     // This function returns the maximal value for taxid
     // or -1 in case of error
     ///
-    int GetMaxTaxId( void );
+    TTaxId GetMaxTaxId( void );
 
     //---------------------------------------------------
     // This function constructs the "display common name" for the taxid following this algorithm:
@@ -481,7 +523,7 @@ public:
     //  4) the Blast inherited blast name
     // Returns: true on success, false in case of error
     ///
-    bool GetDisplayCommonName( int tax_id, string& disp_name_out );
+    bool GetDisplayCommonName( TTaxId tax_id, string& disp_name_out );
 
 private:
     friend class COrgRefCache;
@@ -510,12 +552,12 @@ private:
     bool             SendRequest(CTaxon1_req& req, CTaxon1_resp& resp, bool bShouldReconnect = true);
     void             SetLastError(const char* err_msg);
     void             PopulateReplaced(COrg_ref& org, COrgName::TMod& lMods);
-    bool             LookupByOrgRef(const COrg_ref& inp_orgRef, int* pTaxid,
+    bool             LookupByOrgRef(const COrg_ref& inp_orgRef, TTaxId* pTaxid,
                                     COrgName::TMod& hitMods);
     void             OrgRefAdjust( COrg_ref& inp_orgRef,
                                    const COrg_ref& db_orgRef,
-                                   int tax_id );
-    bool             LoadSubtreeEx( int tax_id, int type,
+                                   TTaxId tax_id );
+    bool             LoadSubtreeEx( TTaxId tax_id, int type,
                                     const ITaxon1Node** ppNode );
 };
 
@@ -527,7 +569,7 @@ public:
 
     //-------------------------------------------------
     // Returns: taxonomy id of the node
-    virtual int              GetTaxId() const = 0;
+    virtual TTaxId              GetTaxId() const = 0;
 
     //-------------------------------------------------
     // Returns: scientific name of the node. This name is NOT unique
diff --git a/c++/include/objects/taxon3/cached_taxon3.hpp b/c++/include/objects/taxon3/cached_taxon3.hpp
index d2c884f..1f90fd0 100755
--- a/c++/include/objects/taxon3/cached_taxon3.hpp
+++ b/c++/include/objects/taxon3/cached_taxon3.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBI_CACHED_TAXON3_HPP
 #define NCBI_CACHED_TAXON3_HPP
 
-/* $Id: cached_taxon3.hpp 478049 2015-09-03 16:29:00Z ivanov $
+/* $Id: cached_taxon3.hpp 473749 2015-07-22 11:14:39Z holmesbr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/taxon3/itaxon3.hpp b/c++/include/objects/taxon3/itaxon3.hpp
index 986b9fa..72b5b68 100644
--- a/c++/include/objects/taxon3/itaxon3.hpp
+++ b/c++/include/objects/taxon3/itaxon3.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBI_ITAXON3_HPP
 #define NCBI_ITAXON3_HPP
 
-/* $Id: itaxon3.hpp 478049 2015-09-03 16:29:00Z ivanov $
+/* $Id: itaxon3.hpp 473749 2015-07-22 11:14:39Z holmesbr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/taxon3/taxon3.hpp b/c++/include/objects/taxon3/taxon3.hpp
index a2c9325..b994b16 100644
--- a/c++/include/objects/taxon3/taxon3.hpp
+++ b/c++/include/objects/taxon3/taxon3.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBI_TAXON3_HPP
 #define NCBI_TAXON3_HPP
 
-/* $Id: taxon3.hpp 478049 2015-09-03 16:29:00Z ivanov $
+/* $Id: taxon3.hpp 473749 2015-07-22 11:14:39Z holmesbr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/trackmgr/TMgr_IdentityId.hpp b/c++/include/objects/trackmgr/TMgr_IdentityId.hpp
index f124a6e..4b5fb71 100644
--- a/c++/include/objects/trackmgr/TMgr_IdentityId.hpp
+++ b/c++/include/objects/trackmgr/TMgr_IdentityId.hpp
@@ -1,4 +1,4 @@
-/* $Id: TMgr_IdentityId.hpp 404012 2013-06-19 18:40:03Z meric $
+/* $Id: TMgr_IdentityId.hpp 477867 2015-09-02 13:52:21Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -56,6 +56,7 @@ public:
     ~CTMgr_IdentityId(void);
 
     static CRef<CTMgr_IdentityId> FromMyNCBIId(int myncbi_id);
+    static CRef<CTMgr_IdentityId> FromMyNCBIId(const string& myncbi_id);
     static CRef<CTMgr_IdentityId> FromSessionId(const string& session_id);
 
 private:
diff --git a/c++/include/objects/trackmgr/blast_client.hpp b/c++/include/objects/trackmgr/blast_client.hpp
index 1459060..4883dea 100644
--- a/c++/include/objects/trackmgr/blast_client.hpp
+++ b/c++/include/objects/trackmgr/blast_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__BLAST_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__BLAST_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__BLAST_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__BLAST_CLIENT_HPP
 
-/* $Id: blast_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: blast_client.hpp 488465 2015-12-30 23:55:06Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -78,5 +78,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__BLAST_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__BLAST_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/track_attrvalue_client.hpp b/c++/include/objects/trackmgr/createtrackset_client.hpp
similarity index 62%
copy from c++/include/objects/trackmgr/track_attrvalue_client.hpp
copy to c++/include/objects/trackmgr/createtrackset_client.hpp
index 9209928..d1f0e5b 100644
--- a/c++/include/objects/trackmgr/track_attrvalue_client.hpp
+++ b/c++/include/objects/trackmgr/createtrackset_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__CREATE_TRACKSET_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__CREATE_TRACKSET_CLIENT_HPP
 
-/* $Id: track_attrvalue_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: createtrackset_client.hpp 477317 2015-08-27 21:13:02Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -28,12 +28,12 @@
  *
  * Authors: Peter Meric
  *
- * File Description:  NetSchedule grid client for TrackManager track attr-value request/reply
+ * File Description:  NetSchedule grid client for TrackManager trackset request/reply
  *
  */
 
 /// @file tmgr_displaytrack_client.hpp
-/// NetSchedule grid client for TrackManager track attr-value request/reply
+/// NetSchedule grid client for TrackManager trackset request/reply
 
 #include <objects/trackmgr/gridrpcclient.hpp>
 
@@ -41,35 +41,34 @@
 BEGIN_NCBI_SCOPE
 
 BEGIN_SCOPE(objects)
-class CTMgr_TrackAttrValueRequest;
-class CTMgr_TrackAttrValueReply;
-class CSeq_id;
+class CTMgr_CreateTracksetRequest;
+class CTMgr_CreateTracksetReply;
 END_SCOPE(objects)
 
 
-class CTMS_TrackAttrValue_Client : private CGridRPCBaseClient<CAsnBinCompressed>
+class CTMS_CreateTrackSet_Client : private CGridRPCBaseClient<CAsnBinCompressed>
 {
 private:
     typedef CGridRPCBaseClient<ncbi::CAsnBinCompressed> TBaseClient;
 
 public:
-    typedef objects::CTMgr_TrackAttrValueRequest TRequest;
-    typedef objects::CTMgr_TrackAttrValueReply TReply;
+    typedef objects::CTMgr_CreateTracksetRequest TRequest;
+    typedef objects::CTMgr_CreateTracksetReply TReply;
     typedef CConstRef<TRequest> TRequestCRef;
     typedef CRef<TReply> TReplyRef;
 
 public:
-    CTMS_TrackAttrValue_Client(const string& NS_service,
-                             const string& NS_queue,
-                             const string& client_name,
-                             const string& NC_registry_section
-                            );
+    CTMS_CreateTrackSet_Client(const string& NS_service,
+                         const string& NS_queue,
+                         const string& client_name,
+                         const string& NC_registry_section
+                        );
 
-    CTMS_TrackAttrValue_Client(const string& NS_registry_section = "netschedule_api",
-                             const string& NC_registry_section = kEmptyStr
-                            );
+    CTMS_CreateTrackSet_Client(const string& NS_registry_section = "netschedule_api",
+                         const string& NC_registry_section = kEmptyStr
+                        );
 
-    virtual ~CTMS_TrackAttrValue_Client();
+    virtual ~CTMS_CreateTrackSet_Client();
 
     TReplyRef Fetch(const TRequest& request) const;
 };
@@ -77,5 +76,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__CREATE_TRACKSET_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/createusertrack_client.hpp b/c++/include/objects/trackmgr/createusertrack_client.hpp
index f1e9cc3..3411013 100644
--- a/c++/include/objects/trackmgr/createusertrack_client.hpp
+++ b/c++/include/objects/trackmgr/createusertrack_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__CREATE_USER_TRACK_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__CREATE_USER_TRACK_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__CREATE_USER_TRACK_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__CREATE_USER_TRACK_CLIENT_HPP
 
-/* $Id: createusertrack_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: createusertrack_client.hpp 488465 2015-12-30 23:55:06Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,5 +77,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__CREATE_USER_TRACK_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__CREATE_USER_TRACK_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/displaytrack_client.hpp b/c++/include/objects/trackmgr/displaytrack_client.hpp
index a958e89..82c04d3 100644
--- a/c++/include/objects/trackmgr/displaytrack_client.hpp
+++ b/c++/include/objects/trackmgr/displaytrack_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__DISPLAY_TRACK_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__DISPLAY_TRACK_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__DISPLAY_TRACK_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__DISPLAY_TRACK_CLIENT_HPP
 
-/* $Id: displaytrack_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: displaytrack_client.hpp 488465 2015-12-30 23:55:06Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -76,5 +76,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__DISPLAY_TRACK_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__DISPLAY_TRACK_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/gridrpcclient.hpp b/c++/include/objects/trackmgr/gridrpcclient.hpp
index 8d6ba2b..2619a99 100644
--- a/c++/include/objects/trackmgr/gridrpcclient.hpp
+++ b/c++/include/objects/trackmgr/gridrpcclient.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_MISC_SERIAL___GRID_RPC_CLIENT__HPP
-#define INTERNAL_MISC_SERIAL___GRID_RPC_CLIENT__HPP
+#ifndef OBJECTS_MISC_SERIAL___GRID_RPC_CLIENT__HPP
+#define OBJECTS_MISC_SERIAL___GRID_RPC_CLIENT__HPP
 
-/* $Id: gridrpcclient.hpp 471177 2015-06-24 13:24:03Z ivanov $
+/* $Id: gridrpcclient.hpp 489744 2016-01-15 16:50:24Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -94,7 +94,7 @@ public:
     /// @return
     ///   object stream
     static CObjectOStream*
-    GetOStream(CNcbiOstream& ostr, SStreamProp stream_prop = SStreamProp(CCompressStream::eLZO))
+    GetOStream(CNcbiOstream& ostr, SStreamProp stream_prop = SStreamProp(CCompressStream::eZip))
     {
         auto_ptr<CCompressionOStream> outstr_zip(
             new CCompressionOStream(
@@ -295,12 +295,6 @@ public:
     void x_Init(const string& NC_registry_section)
     {
         m_NC_api = CNetCacheAPI(CNetCacheAPI::eAppRegistry, NC_registry_section);
-        m_Grid_cli.reset(new CGridClient(m_NS_api.GetSubmitter(),
-                                         m_NC_api,
-                                         CGridClient::eManualCleanup,
-                                         CGridClient::eProgressMsgOn
-                                        )
-                        );
     }
 
     virtual ~CGridRPCBaseClient()
@@ -310,21 +304,26 @@ public:
     template <class TRequest, class TReply>
     pair<CNetScheduleJob, bool> Ask(const TRequest& request, TReply& reply) const
     {
-        CNcbiOstream& job_in = m_Grid_cli->GetOStream(); // job input stream
+        CGridClient grid_cli(m_NS_api.GetSubmitter(),
+                             m_NC_api,
+                             CGridClient::eManualCleanup,
+                             CGridClient::eProgressMsgOn
+                            );
+        CNcbiOstream& job_in = grid_cli.GetOStream(); // job input stream
         auto_ptr<CObjectOStream> outstr(TConnectTraits::GetOStream(job_in));
         *outstr << request;
         if (job_in.bad()) {
             NCBI_THROW(CIOException, eWrite, "Error while writing request");
         }
         outstr.reset();
-        m_Grid_cli->CloseStream();
+        grid_cli.CloseStream();
 
-        CNetScheduleJob& job = m_Grid_cli->GetJob();
+        CNetScheduleJob& job = grid_cli.GetJob();
         bool timed_out = false;
         x_PrepareJob(job);
 
         try {
-            const CNetScheduleAPI::EJobStatus evt = m_Grid_cli->SubmitAndWait(m_Timeout);
+            const CNetScheduleAPI::EJobStatus evt = grid_cli.SubmitAndWait(m_Timeout);
             switch (evt) {
             case CNetScheduleAPI::eDone:
             {
@@ -372,17 +371,11 @@ protected:
     template <class TReply>
     CNetScheduleJob x_GetJobById(const string job_id, TReply& reply) const
     {
-        CNetScheduleNotificationHandler job_handler;
         CNetScheduleJob job;
         job.job_id = job_id;
 
-        CDeadline deadline(m_Timeout, 0);
-        const int status_mask(
-            CNetScheduleNotificationHandler::fJSM_Done |
-            CNetScheduleNotificationHandler::fJSM_Canceled |
-            CNetScheduleNotificationHandler::fJSM_Failed
-        );
-        const CNetScheduleAPI::EJobStatus evt = job_handler.WaitForJobEvent(job.job_id, deadline, m_NS_api, status_mask);
+        CNetScheduleSubmitter job_submitter = m_NS_api.GetSubmitter();
+        const CNetScheduleAPI::EJobStatus evt = job_submitter.WaitForJob(job.job_id, m_Timeout);
         switch (evt) {
         case CNetScheduleAPI::eDone:
         {
@@ -412,12 +405,11 @@ protected:
 private:
     mutable CNetScheduleAPI m_NS_api;
     mutable CNetCacheAPI m_NC_api;
-    mutable auto_ptr<CGridClient> m_Grid_cli;
     Uint4 m_Timeout;
 };
 
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_MISC_SERIAL___GRID_RPC_CLIENT__HPP
+#endif // OBJECTS_MISC_SERIAL___GRID_RPC_CLIENT__HPP
 
diff --git a/c++/include/objects/trackmgr/item_resolver_client.hpp b/c++/include/objects/trackmgr/item_resolver_client.hpp
index 8a1bbda..812b07e 100644
--- a/c++/include/objects/trackmgr/item_resolver_client.hpp
+++ b/c++/include/objects/trackmgr/item_resolver_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__ITEM_RESOLVER_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__ITEM_RESOLVER_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__ITEM_RESOLVER_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__ITEM_RESOLVER_CLIENT_HPP
 
-/* $Id: item_resolver_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: item_resolver_client.hpp 488465 2015-12-30 23:55:06Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -79,5 +79,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__ITEM_RESOLVER_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__ITEM_RESOLVER_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/removeusertrack_client.hpp b/c++/include/objects/trackmgr/removeusertrack_client.hpp
index 958be32..3e9032a 100644
--- a/c++/include/objects/trackmgr/removeusertrack_client.hpp
+++ b/c++/include/objects/trackmgr/removeusertrack_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__REMOVE_USER_TRACK_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__REMOVE_USER_TRACK_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__REMOVE_USER_TRACK_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__REMOVE_USER_TRACK_CLIENT_HPP
 
-/* $Id: removeusertrack_client.hpp 411360 2013-08-28 02:31:39Z meric $
+/* $Id: removeusertrack_client.hpp 488465 2015-12-30 23:55:06Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,5 +77,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__REMOVE_USER_TRACK_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__REMOVE_USER_TRACK_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/switch_context_client.hpp b/c++/include/objects/trackmgr/supported_assemblies_client.hpp
similarity index 56%
copy from c++/include/objects/trackmgr/switch_context_client.hpp
copy to c++/include/objects/trackmgr/supported_assemblies_client.hpp
index 60a0e30..badc633 100644
--- a/c++/include/objects/trackmgr/switch_context_client.hpp
+++ b/c++/include/objects/trackmgr/supported_assemblies_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__SUPPORTED_ASSEMBLIES_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__SUPPORTED_ASSEMBLIES_CLIENT_HPP
 
-/* $Id: switch_context_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: supported_assemblies_client.hpp 478100 2015-09-03 19:05:40Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -28,12 +28,12 @@
  *
  * Authors: Peter Meric
  *
- * File Description:  NetSchedule grid client for TrackManager switch-context request/reply
+ * File Description:  NetSchedule grid client for TrackManager supported-assemblies request/reply
  *
  */
 
-/// @file tmgr_displaytrack_client.hpp
-/// NetSchedule grid client for TrackManager switch-context request/reply
+/// @file supported_assemblies_client.hpp
+/// NetSchedule grid client for TrackManager supported-assemblies request/reply
 
 #include <objects/trackmgr/gridrpcclient.hpp>
 
@@ -41,40 +41,41 @@
 BEGIN_NCBI_SCOPE
 
 BEGIN_SCOPE(objects)
-class CTMgr_SwitchTrackContextRequest;
-class CTMgr_SwitchTrackContextReply;
+class CTMgr_SupportedAssembliesRequest;
+class CTMgr_SupportedAssembliesReply;
 END_SCOPE(objects)
 
 
-class CTMS_SwitchContext_Client : private CGridRPCBaseClient<CAsnBinCompressed>
+class CTMS_SupportedAssemblies_Client : private CGridRPCBaseClient<CAsnBinCompressed>
 {
 private:
     typedef CGridRPCBaseClient<ncbi::CAsnBinCompressed> TBaseClient;
 
 public:
-    typedef objects::CTMgr_SwitchTrackContextRequest TRequest;
-    typedef objects::CTMgr_SwitchTrackContextReply TReply;
+    typedef objects::CTMgr_SupportedAssembliesRequest TRequest;
+    typedef objects::CTMgr_SupportedAssembliesReply TReply;
     typedef CConstRef<TRequest> TRequestCRef;
     typedef CRef<TReply> TReplyRef;
 
 public:
-    CTMS_SwitchContext_Client(const string& NS_service,
-                              const string& NS_queue,
-                              const string& client_name,
-                              const string& NC_registry_section
-                             );
+    CTMS_SupportedAssemblies_Client(const string& NS_service,
+                                    const string& NS_queue,
+                                    const string& client_name,
+                                    const string& NC_registry_section
+                                   );
 
-    CTMS_SwitchContext_Client(const string& NS_registry_section = "netschedule_api",
-                             const string& NC_registry_section = kEmptyStr
-                            );
+    CTMS_SupportedAssemblies_Client(const string& NS_registry_section = "netschedule_api",
+                                    const string& NC_registry_section = kEmptyStr
+                                   );
 
-    virtual ~CTMS_SwitchContext_Client();
+    virtual ~CTMS_SupportedAssemblies_Client();
 
     TReplyRef Fetch(const TRequest& request) const;
+    bool IsAssemblySupported(const string& assm_acc) const;
 };
 
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__SUPPORTED_ASSEMBLIES_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/switch_context_client.hpp b/c++/include/objects/trackmgr/switch_context_client.hpp
index 60a0e30..2f3d7dc 100644
--- a/c++/include/objects/trackmgr/switch_context_client.hpp
+++ b/c++/include/objects/trackmgr/switch_context_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
 
-/* $Id: switch_context_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: switch_context_client.hpp 488465 2015-12-30 23:55:06Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -76,5 +76,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__SWITCH_CONTEXT_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/track_attrvalue_client.hpp b/c++/include/objects/trackmgr/track_attrvalue_client.hpp
index 9209928..3c22e7c 100644
--- a/c++/include/objects/trackmgr/track_attrvalue_client.hpp
+++ b/c++/include/objects/trackmgr/track_attrvalue_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
 
-/* $Id: track_attrvalue_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: track_attrvalue_client.hpp 488465 2015-12-30 23:55:06Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,5 +77,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/trackmgr_client.hpp b/c++/include/objects/trackmgr/trackmgr_client.hpp
index fb6dfc5..9e5dfdb 100644
--- a/c++/include/objects/trackmgr/trackmgr_client.hpp
+++ b/c++/include/objects/trackmgr/trackmgr_client.hpp
@@ -1,4 +1,7 @@
-/* $Id: trackmgr_client.hpp 371635 2012-08-09 17:42:05Z clausen $
+#ifndef OBJECTS_TRACKMGR_OBJECTS_TRACKMGR_TRACKMGR_CLIENT_HPP
+#define OBJECTS_TRACKMGR_OBJECTS_TRACKMGR_TRACKMGR_CLIENT_HPP
+
+/* $Id: trackmgr_client.hpp 488465 2015-12-30 23:55:06Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -25,21 +28,6 @@
  *
  */
 
-/// @file trackmgr_client.hpp
-/// User-defined methods of the data storage class.
-///
-/// This file was originally generated by application DATATOOL
-/// using the following specifications:
-/// 'trackmgr.asn'.
-///
-/// New methods or data members can be added to it if needed.
-/// See also: trackmgr_client_.hpp
-
-
-#ifndef INTERNAL_TRACKMGR_OBJECTS_TRACKMGR_TRACKMGR_CLIENT_HPP
-#define INTERNAL_TRACKMGR_OBJECTS_TRACKMGR_TRACKMGR_CLIENT_HPP
-
-
 #include <objects/trackmgr/trackmgr_client_.hpp>
 
 
@@ -94,5 +82,5 @@ private:
 END_objects_SCOPE
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_OBJECTS_TRACKMGR_TRACKMGR_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_OBJECTS_TRACKMGR_TRACKMGR_CLIENT_HPP
 
diff --git a/c++/include/objects/trackmgr/track_attrvalue_client.hpp b/c++/include/objects/trackmgr/trackset_client.hpp
similarity index 60%
copy from c++/include/objects/trackmgr/track_attrvalue_client.hpp
copy to c++/include/objects/trackmgr/trackset_client.hpp
index 9209928..af4f1ee 100644
--- a/c++/include/objects/trackmgr/track_attrvalue_client.hpp
+++ b/c++/include/objects/trackmgr/trackset_client.hpp
@@ -1,7 +1,7 @@
-#ifndef INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
-#define INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
+#ifndef OBJECTS_TRACKMGR_GRIDCLI__TRACKSET_CLIENT_HPP
+#define OBJECTS_TRACKMGR_GRIDCLI__TRACKSET_CLIENT_HPP
 
-/* $Id: track_attrvalue_client.hpp 409282 2013-08-06 18:37:39Z meric $
+/* $Id: trackset_client.hpp 476431 2015-08-18 20:21:50Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -28,12 +28,12 @@
  *
  * Authors: Peter Meric
  *
- * File Description:  NetSchedule grid client for TrackManager track attr-value request/reply
+ * File Description:  NetSchedule grid client for TrackManager trackset request/reply
  *
  */
 
 /// @file tmgr_displaytrack_client.hpp
-/// NetSchedule grid client for TrackManager track attr-value request/reply
+/// NetSchedule grid client for TrackManager trackset request/reply
 
 #include <objects/trackmgr/gridrpcclient.hpp>
 
@@ -41,35 +41,34 @@
 BEGIN_NCBI_SCOPE
 
 BEGIN_SCOPE(objects)
-class CTMgr_TrackAttrValueRequest;
-class CTMgr_TrackAttrValueReply;
-class CSeq_id;
+class CTMgr_RetrieveTracksetRequest;
+class CTMgr_RetrieveTracksetReply;
 END_SCOPE(objects)
 
 
-class CTMS_TrackAttrValue_Client : private CGridRPCBaseClient<CAsnBinCompressed>
+class CTMS_TrackSet_Client : private CGridRPCBaseClient<CAsnBinCompressed>
 {
 private:
     typedef CGridRPCBaseClient<ncbi::CAsnBinCompressed> TBaseClient;
 
 public:
-    typedef objects::CTMgr_TrackAttrValueRequest TRequest;
-    typedef objects::CTMgr_TrackAttrValueReply TReply;
+    typedef objects::CTMgr_RetrieveTracksetRequest TRequest;
+    typedef objects::CTMgr_RetrieveTracksetReply TReply;
     typedef CConstRef<TRequest> TRequestCRef;
     typedef CRef<TReply> TReplyRef;
 
 public:
-    CTMS_TrackAttrValue_Client(const string& NS_service,
-                             const string& NS_queue,
-                             const string& client_name,
-                             const string& NC_registry_section
-                            );
+    CTMS_TrackSet_Client(const string& NS_service,
+                         const string& NS_queue,
+                         const string& client_name,
+                         const string& NC_registry_section
+                        );
 
-    CTMS_TrackAttrValue_Client(const string& NS_registry_section = "netschedule_api",
-                             const string& NC_registry_section = kEmptyStr
-                            );
+    CTMS_TrackSet_Client(const string& NS_registry_section = "netschedule_api",
+                         const string& NC_registry_section = kEmptyStr
+                        );
 
-    virtual ~CTMS_TrackAttrValue_Client();
+    virtual ~CTMS_TrackSet_Client();
 
     TReplyRef Fetch(const TRequest& request) const;
 };
@@ -77,5 +76,5 @@ public:
 
 END_NCBI_SCOPE
 
-#endif // INTERNAL_TRACKMGR_GRIDCLI__TRACK_ATTR_VALUE_CLIENT_HPP
+#endif // OBJECTS_TRACKMGR_GRIDCLI__TRACKSET_CLIENT_HPP
 
diff --git a/c++/include/objects/valerr/ValidErrItem.hpp b/c++/include/objects/valerr/ValidErrItem.hpp
index 5b181c2..1254c40 100644
--- a/c++/include/objects/valerr/ValidErrItem.hpp
+++ b/c++/include/objects/valerr/ValidErrItem.hpp
@@ -1,4 +1,4 @@
-/* $Id: ValidErrItem.hpp 473633 2015-07-21 17:05:11Z ivanov $
+/* $Id: ValidErrItem.hpp 473063 2015-07-15 23:22:36Z kans $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objects/valid/Comment_rule.hpp b/c++/include/objects/valid/Comment_rule.hpp
index cc902b9..000a88d 100644
--- a/c++/include/objects/valid/Comment_rule.hpp
+++ b/c++/include/objects/valid/Comment_rule.hpp
@@ -1,4 +1,4 @@
-/* $Id: Comment_rule.hpp 437004 2014-06-02 17:53:50Z kornbluh $
+/* $Id: Comment_rule.hpp 493827 2016-03-02 13:59:27Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -64,7 +64,7 @@ public:
     CConstRef<CField_rule> FindFieldRuleRef (const string& field_name) const;
     static void NormalizePrefix(string& prefix);
     static bool IsStructuredComment (const CUser_object& user);
-    static string GetStructuredCommentPrefix (const CUser_object& user);
+    static string GetStructuredCommentPrefix (const CUser_object& user, bool normalize = true);
     static string MakePrefixFromRoot(const string& root);
     static string MakeSuffixFromRoot(const string& root);
     static string KeywordForPrefix(const string& prefix);
@@ -75,6 +75,12 @@ public:
     typedef pair<CField_rule::TSeverity, string> TError;
     typedef vector<TError> TErrorList;
     TErrorList IsValid(const CUser_object& user) const;
+    void CheckFieldValue(CConstRef<CField_rule> field_rule, const string& value, TErrorList& errors) const;
+    void CheckFieldValue(CConstRef< CField_rule> rule, const CUser_field& field, TErrorList& errors) const;
+    static void CheckGeneralFieldValue(const string& value, TErrorList& errors);
+    static void CheckGeneralFieldName(const string& label, TErrorList& errors);
+    static void CheckGeneralField(const CUser_field& field, TErrorList& errors);
+    static TErrorList CheckGeneralStructuredComment(const CUser_object& user);
     bool ReorderFields(CUser_object& user) const;
 
 private:
diff --git a/c++/include/objmgr/annot_selector.hpp b/c++/include/objmgr/annot_selector.hpp
index 8dbd93e..731ae35 100644
--- a/c++/include/objmgr/annot_selector.hpp
+++ b/c++/include/objmgr/annot_selector.hpp
@@ -1,7 +1,7 @@
 #ifndef ANNOT_SELECTOR__HPP
 #define ANNOT_SELECTOR__HPP
 
-/*  $Id: annot_selector.hpp 435052 2014-05-13 17:26:17Z vasilche $
+/*  $Id: annot_selector.hpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -338,9 +338,11 @@ struct NCBI_XOBJMGR_EXPORT SAnnotSelector : public SAnnotTypeSelector
         fAdaptive_ByTriggers = 1<<1,
         fAdaptive_BySubtypes = 1<<2,
         fAdaptive_ByPolicy   = 1<<3,
-        kAdaptive_All        = fAdaptive_ByTriggers | fAdaptive_BySubtypes |
-                                   fAdaptive_ByPolicy,
-        kAdaptive_DefaultBits= fAdaptive_ByTriggers | fAdaptive_ByPolicy
+        fAdaptive_BySeqClass = 1<<4,
+        kAdaptive_All        = (fAdaptive_ByTriggers | fAdaptive_BySubtypes |
+                                fAdaptive_ByPolicy | fAdaptive_BySeqClass),
+        kAdaptive_DefaultBits= (fAdaptive_ByTriggers | fAdaptive_ByPolicy |
+                                fAdaptive_BySeqClass)
     };
     typedef Uint1 TAdaptiveDepthFlags;
     /// GetAdaptiveDepth() returns current value of 'adaptive depth' flag.
diff --git a/c++/include/objmgr/bioseq_handle.hpp b/c++/include/objmgr/bioseq_handle.hpp
index cbb53d0..d3b6162 100644
--- a/c++/include/objmgr/bioseq_handle.hpp
+++ b/c++/include/objmgr/bioseq_handle.hpp
@@ -1,7 +1,7 @@
 #ifndef BIOSEQ_HANDLE__HPP
 #define BIOSEQ_HANDLE__HPP
 
-/*  $Id: bioseq_handle.hpp 455474 2014-12-30 16:36:56Z foleyjp $
+/*  $Id: bioseq_handle.hpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -303,6 +303,14 @@ public:
     bool IsNa(void) const;
     bool IsAa(void) const;
 
+    enum ESequenceClass {
+        eSequenceClass_none,
+        eSequenceClass_INSD,
+        eSequenceClass_REFSEQ,
+        eSequenceClass_TPA
+    };
+    ESequenceClass GetSequenceClass(void) const;
+
     /// Get sequence map.
     const CSeqMap& GetSeqMap(void) const;
 
@@ -450,8 +458,9 @@ public:
     /// Feature fetch policy describes when to look for features on sequence
     /// segments.
     enum EFeatureFetchPolicy {
-        eFeatureFetchPolicy_default = 0,
-        eFeatureFetchPolicy_only_near = 1
+        eFeatureFetchPolicy_default = 0, // no valid feature policy found
+        eFeatureFetchPolicy_only_near = 1,
+        eFeatureFetchPolicy_allow_far = 2
     };
     EFeatureFetchPolicy GetFeatureFetchPolicy(void) const;
 
diff --git a/c++/include/objmgr/data_loader.hpp b/c++/include/objmgr/data_loader.hpp
index 3d893d6..f6d46f5 100644
--- a/c++/include/objmgr/data_loader.hpp
+++ b/c++/include/objmgr/data_loader.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_OBJMGR___DATA_LOADER__HPP
 #define OBJECTS_OBJMGR___DATA_LOADER__HPP
 
-/*  $Id: data_loader.hpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: data_loader.hpp 498421 2016-04-15 18:44:37Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -262,33 +262,96 @@ public:
     /// Request for a list of all Seq-ids of a sequence.
     /// The result container should not change if sequence with requested id
     /// is not known.
+    /// The result must be non-empty for existing sequences
     virtual void GetIds(const CSeq_id_Handle& idh, TIds& ids);
 
+    /// helper function to check if sequence exists, uses GetIds()
+    bool SequenceExists(const CSeq_id_Handle& idh);
+
     /// Request for a accession.version Seq-id of a sequence.
-    /// Returns null CSeq_id_Handle if sequence with requested id is not known.
+    /// Returns null CSeq_id_Handle if sequence with requested id is not known,
+    /// or if existing sequence doesn't have an accession
+    /// @sa GetAccVerFound()
     virtual CSeq_id_Handle GetAccVer(const CSeq_id_Handle& idh);
+    /// Better replacement of GetAccVer(), this method should be defined in
+    /// data loaders, GetAccVer() is left for compatibility.
+    /// @sa GetAccVer()
+    struct SAccVerFound {
+        bool sequence_found; // true if the sequence is found by data loader
+        CSeq_id_Handle acc_ver; // may be null even for existing sequence
+        SAccVerFound() : sequence_found(false) {}
+    };
+    virtual SAccVerFound GetAccVerFound(const CSeq_id_Handle& idh);
+
     /// Request for a gi of a sequence.
-    /// Returns zero gi if sequence with requested id is not known.
+    /// Returns zero gi if sequence with requested id is not known,
+    /// or if existing sequence doesn't have a gi
+    /// @sa GetGiFound()
     virtual TGi GetGi(const CSeq_id_Handle& idh);
+    /// Better replacement of GetGi(), this method should be defined in
+    /// data loaders, GetGi() is left for compatibility.
+    /// @sa GetGi()
+    struct SGiFound {
+        bool sequence_found; // true if the sequence is found by data loader
+        TGi gi; // may be 0 even for existing sequence
+        SGiFound() : sequence_found(false), gi(ZERO_GI) {}
+    };
+    virtual SGiFound GetGiFound(const CSeq_id_Handle& idh);
+
     /// Request for a label string of a sequence.
     /// Returns empty string if sequence with requested id is not known.
+    /// The result must be non-empty for existing sequences
     virtual string GetLabel(const CSeq_id_Handle& idh);
+
     /// Request for a taxonomy id of a sequence.
     /// Returns -1 if sequence with requested id is not known.
+    /// Returns 0 if existing sequence doesn't have TaxID
     virtual int GetTaxId(const CSeq_id_Handle& idh);
+
     /// Request for a length of a sequence.
     /// Returns kInvalidSeqPos if sequence with requested id is not known.
+    /// The result must not be kInvalidSeqPos for existing sequences
     virtual TSeqPos GetSequenceLength(const CSeq_id_Handle& idh);
+
     /// Request for a type of a sequence
-    /// Returns CSeq_inst::eMol_not_set if sequence is not known.
+    /// Returns CSeq_inst::eMol_not_set if sequence is not known
+    /// @sa GetSequenceTypeFound()
     virtual CSeq_inst::TMol GetSequenceType(const CSeq_id_Handle& idh);
+    /// Better replacement of GetSequenceType(), this method should be
+    /// defined in data loaders, GetSequenceType() is left for compatibility.
+    /// @sa GetSequenceType()
+    struct STypeFound {
+        bool sequence_found; // true if the sequence is found by data loader
+        CSeq_inst::TMol type; // may be eMol_not_set even for existing sequence
+        STypeFound() : sequence_found(false), type(CSeq_inst::eMol_not_set) {}
+    };
+    virtual STypeFound GetSequenceTypeFound(const CSeq_id_Handle& idh);
+
     /// Request for a state of a sequence.
-    /// Returns fState_not_found|fState_no_data if sequence
+    /// Returns CBioseq_Handle::fState_not_found|fState_no_data if sequence
     /// with requested id is not known.
+    /// Result mustn't be fState_not_found|fState_no_data if sequence exists
     virtual int GetSequenceState(const CSeq_id_Handle& idh);
+
     /// Request for a sequence hash.
-    /// Returns 0 if the sequence or hash is not known.
+    /// Returns 0 if the sequence or its hash is not known.
+    /// @sa GetSequenceHashFound()
     virtual int GetSequenceHash(const CSeq_id_Handle& idh);
+    /// Better replacement of GetSequenceHash(), this method should be
+    /// defined in data loaders, GetSequenceHash() is left for compatibility.
+    /// @sa GetSequenceHash()
+    struct SHashFound {
+        bool sequence_found; // true if the sequence is found by data loader
+        bool hash_known; // true if sequence exists but hash value isn't known
+        int hash; // may be 0 even for existing sequence
+        SHashFound()
+            : sequence_found(false),
+              hash_known(false),
+              hash(0)
+            {
+            }
+    };
+    virtual SHashFound GetSequenceHashFound(const CSeq_id_Handle& idh);
 
     /// Bulk loading interface for a small pieces of information per id.
     /// The 'loaded' bit set (in/out) marks ids that already processed.
@@ -305,6 +368,7 @@ public:
     typedef vector<CSeq_inst::TMol> TSequenceTypes;
     typedef vector<int> TSequenceStates;
     typedef vector<int> TSequenceHashes;
+    typedef vector<bool> THashKnown;
     /// Bulk request for accession.version Seq-ids of a set of sequences.
     virtual void GetAccVers(const TIds& ids, TLoaded& loaded, TIds& ret);
     /// Bulk request for gis of a set of sequences.
@@ -324,7 +388,7 @@ public:
                                    TSequenceStates& ret);
     /// Bulk request for hashes of a set of sequences.
     virtual void GetSequenceHashes(const TIds& ids, TLoaded& loaded,
-                                   TSequenceHashes& ret);
+                                   TSequenceHashes& ret, THashKnown& known);
 
     // Load multiple seq-ids. Same as GetRecords() for multiple ids
     // with choise set to eBlob. The map should be initialized with
@@ -368,6 +432,8 @@ public:
     typedef CRef<IEditSaver> TEditSaver;
     virtual TEditSaver GetEditSaver() const;
 
+    virtual CObjectManager::TPriority GetDefaultPriority(void) const;
+
 protected:
     /// Register the loader only if the name is not yet
     /// registered in the object manager
@@ -398,7 +464,7 @@ private:
 
 END_SCOPE(objects)
 
-NCBI_DECLARE_INTERFACE_VERSION(objects::CDataLoader, "xloader", 3, 4, 0);
+NCBI_DECLARE_INTERFACE_VERSION(objects::CDataLoader, "xloader", 4, 2, 0);
 
 template<>
 class CDllResolver_Getter<objects::CDataLoader>
diff --git a/c++/include/objmgr/error_codes.hpp b/c++/include/objmgr/error_codes.hpp
index 2a8b74b..5658137 100644
--- a/c++/include/objmgr/error_codes.hpp
+++ b/c++/include/objmgr/error_codes.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJMGR___ERROR_CODES__HPP
 #define OBJMGR___ERROR_CODES__HPP
 
-/*  $Id: error_codes.hpp 179019 2009-12-18 16:18:47Z vasilche $
+/*  $Id: error_codes.hpp 490251 2016-01-22 15:40:54Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -56,6 +56,7 @@ NCBI_DEFINE_ERRCODE_X(ObjMgr_IdRange,      1211,  0);
 NCBI_DEFINE_ERRCODE_X(ObjMgr_BlobSplit,    1212,  0);
 NCBI_DEFINE_ERRCODE_X(ObjMgr_SeqTable,     1213,  0);
 NCBI_DEFINE_ERRCODE_X(ObjMgr_ObjSplitInfo, 1214,  0);
+NCBI_DEFINE_ERRCODE_X(ObjMgr_Rd_Split,     1215,  0);
 
 END_NCBI_SCOPE
 
diff --git a/c++/include/objmgr/gc_assembly_parser.hpp b/c++/include/objmgr/gc_assembly_parser.hpp
index e06335d..b2e8150 100644
--- a/c++/include/objmgr/gc_assembly_parser.hpp
+++ b/c++/include/objmgr/gc_assembly_parser.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJMGR_GC_ASSEMBLY_PARSER__HPP
 #define OBJMGR_GC_ASSEMBLY_PARSER__HPP
 
-/*  $Id: gc_assembly_parser.hpp 479618 2015-09-22 15:42:58Z ivanov $
+/*  $Id: gc_assembly_parser.hpp 479439 2015-09-21 13:04:11Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objmgr/impl/annot_collector.hpp b/c++/include/objmgr/impl/annot_collector.hpp
index 4b72eb9..e2d249d 100644
--- a/c++/include/objmgr/impl/annot_collector.hpp
+++ b/c++/include/objmgr/impl/annot_collector.hpp
@@ -1,7 +1,7 @@
 #ifndef ANNOT_COLLECTOR__HPP
 #define ANNOT_COLLECTOR__HPP
 
-/*  $Id: annot_collector.hpp 458705 2015-02-09 15:12:21Z vasilche $
+/*  $Id: annot_collector.hpp 493571 2016-02-29 19:45:30Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -287,7 +287,7 @@ private:
     const TAnnotSet& GetAnnotSet(void) const;
     CScope& GetScope(void) const;
 
-    const SAnnotSelector& GetSelector(void);
+    const SAnnotSelector& GetSelector(void) const;
     bool CanResolveId(const CSeq_id_Handle& idh, const CBioseq_Handle& bh);
 
     void x_Initialize0(const SAnnotSelector& selector);
@@ -369,13 +369,20 @@ private:
                      const CTSE_Handle*     using_tse,
                      bool top_level = false);
 
+    CBioseq_Handle x_GetBioseqHandle(const CSeq_id_Handle& id,
+                                     bool top_level = false) const;
+    // returns if adaptive depth heuristics should be checked for a segment
+    bool x_CheckAdaptive(const CSeq_id_Handle& id) const;
+    bool x_CheckAdaptive(const CBioseq_Handle& bh) const;
+
     // Search annotations within tse before filtering by source location.
     // Called by: x_SearchLoc(), x_SearchMaster()
     // Calls: x_SearchTSE2()
     bool x_SearchTSE(const CTSE_Handle&    tse,
                      const CSeq_id_Handle& id,
                      const CHandleRange&   hr,
-                     CSeq_loc_Conversion*  cvt);
+                     CSeq_loc_Conversion*  cvt,
+                     bool check_adaptive);
 
     // Search annotations within tse after filtering by source location.
     // Called by: x_SearchTSE()
@@ -383,7 +390,8 @@ private:
     bool x_SearchTSE2(const CTSE_Handle&    tse,
                       const CSeq_id_Handle& id,
                       const CHandleRange&   hr,
-                      CSeq_loc_Conversion*  cvt);
+                      CSeq_loc_Conversion*  cvt,
+                      bool check_adaptive);
 
     // Called by: x_SearchTSE2()
     // Calls: x_SearchRange()
@@ -908,7 +916,7 @@ CScope& CAnnot_Collector::GetScope(void) const
 
 
 inline
-const SAnnotSelector& CAnnot_Collector::GetSelector(void)
+const SAnnotSelector& CAnnot_Collector::GetSelector(void) const
 {
     return *m_Selector;
 }
diff --git a/c++/include/objmgr/impl/bioseq_info.hpp b/c++/include/objmgr/impl/bioseq_info.hpp
index 53c9e55..0c36a7f 100644
--- a/c++/include/objmgr/impl/bioseq_info.hpp
+++ b/c++/include/objmgr/impl/bioseq_info.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_OBJMGR_IMPL___BIOSEQ_INFO__HPP
 #define OBJECTS_OBJMGR_IMPL___BIOSEQ_INFO__HPP
 
-/*  $Id: bioseq_info.hpp 201218 2010-08-17 14:38:33Z vasilche $
+/*  $Id: bioseq_info.hpp 499042 2016-04-21 17:39:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -224,6 +224,8 @@ public:
 
     int GetTaxId(void) const;
 
+    int GetSequenceClass(void) const;
+
     void x_AttachMap(CSeqMap& seq_map);
 
     void x_AddSeq_dataChunkId(TChunkId chunk_id);
diff --git a/c++/include/objmgr/impl/data_source.hpp b/c++/include/objmgr/impl/data_source.hpp
index 2c40b3b..2357de3 100644
--- a/c++/include/objmgr/impl/data_source.hpp
+++ b/c++/include/objmgr/impl/data_source.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_OBJMGR_IMPL___DATA_SOURCE__HPP
 #define OBJECTS_OBJMGR_IMPL___DATA_SOURCE__HPP
 
-/*  $Id: data_source.hpp 467006 2015-05-08 11:59:52Z vasilche $
+/*  $Id: data_source.hpp 494477 2016-03-07 19:25:35Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -230,14 +230,25 @@ public:
 
     typedef vector<CSeq_id_Handle> TIds;
     void GetIds(const CSeq_id_Handle& idh, TIds& ids);
-    CSeq_id_Handle GetAccVer(const CSeq_id_Handle& idh);
-    TGi GetGi(const CSeq_id_Handle& idh);
+    // null CSeq_id_Handle if sequence doesn't have accession
+    typedef CDataLoader::SAccVerFound SAccVerFound;
+    SAccVerFound GetAccVer(const CSeq_id_Handle& idh);
+    // ZERO_GI if sequence doesn't have GI
+    typedef CDataLoader::SGiFound SGiFound;
+    SGiFound GetGi(const CSeq_id_Handle& idh);
+    // empty string if sequence not found
     string GetLabel(const CSeq_id_Handle& idh);
+    // -1 if sequence not found
+    // 0 if sequence doesn't have TaxID
     int GetTaxId(const CSeq_id_Handle& idh);
+    // kInvalidSeqPos if sequence not found
     TSeqPos GetSequenceLength(const CSeq_id_Handle& idh);
-    CSeq_inst::TMol GetSequenceType(const CSeq_id_Handle& idh);
+    typedef CDataLoader::STypeFound STypeFound;
+    STypeFound GetSequenceType(const CSeq_id_Handle& idh);
+    // CBioseq_Handle::fState_not_found if sequence not found
     int GetSequenceState(const CSeq_id_Handle& idh);
-    int GetSequenceHash(const CSeq_id_Handle& idh);
+    typedef CDataLoader::SHashFound SHashFound;
+    SHashFound GetSequenceHash(const CSeq_id_Handle& idh);
 
     // bulk interface
     typedef vector<bool> TLoaded;
@@ -248,6 +259,7 @@ public:
     typedef vector<CSeq_inst::TMol> TSequenceTypes;
     typedef vector<int> TSequenceStates;
     typedef vector<int> TSequenceHashes;
+    typedef vector<bool> THashKnown;
     void GetAccVers(const TIds& ids, TLoaded& loaded, TIds& ret);
     void GetGis(const TIds& ids, TLoaded& loaded, TGis& ret);
     void GetLabels(const TIds& ids, TLoaded& loaded, TLabels& ret);
@@ -259,7 +271,7 @@ public:
     void GetSequenceStates(const TIds& ids, TLoaded& loaded,
                            TSequenceStates& ret);
     void GetSequenceHashes(const TIds& ids, TLoaded& loaded,
-                           TSequenceHashes& ret);
+                           TSequenceHashes& ret, THashKnown& known);
 
     typedef map<CSeq_id_Handle, SSeqMatch_DS>       TSeqMatchMap;
     void GetBlobs(TSeqMatchMap& match_map);
diff --git a/c++/include/objmgr/impl/handle_range_map.hpp b/c++/include/objmgr/impl/handle_range_map.hpp
index 72c9c56..cb9835a 100644
--- a/c++/include/objmgr/impl/handle_range_map.hpp
+++ b/c++/include/objmgr/impl/handle_range_map.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_OBJMGR_IMPL___HANDLE_RANGE_MAP__HPP
 #define OBJECTS_OBJMGR_IMPL___HANDLE_RANGE_MAP__HPP
 
-/*  $Id: handle_range_map.hpp 472371 2015-07-09 14:13:53Z ivanov $
+/*  $Id: handle_range_map.hpp 470193 2015-06-11 19:51:07Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objmgr/impl/scope_impl.hpp b/c++/include/objmgr/impl/scope_impl.hpp
index a077f7e..380a11d 100644
--- a/c++/include/objmgr/impl/scope_impl.hpp
+++ b/c++/include/objmgr/impl/scope_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJMGR_IMPL_SCOPE_IMPL__HPP
 #define OBJMGR_IMPL_SCOPE_IMPL__HPP
 
-/*  $Id: scope_impl.hpp 474909 2015-08-03 10:48:42Z ivanov $
+/*  $Id: scope_impl.hpp 496835 2016-03-31 15:49:15Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -324,12 +324,14 @@ public:
 
     CScope& GetScope(void);
 
+    typedef int TGetFlags;
+
     // Get "native" bioseq ids without filtering and matching.
-    TIds GetIds(const CSeq_id_Handle& idh);
-    CSeq_id_Handle GetAccVer(const CSeq_id_Handle& idh, bool force_load);
-    TGi GetGi(const CSeq_id_Handle& idh, bool force_load);
-    string GetLabel(const CSeq_id_Handle& idh, bool force_load);
-    int GetTaxId(const CSeq_id_Handle& idh, bool force_load);
+    TIds GetIds(const CSeq_id_Handle& idh, TGetFlags flags = 0);
+    CSeq_id_Handle GetAccVer(const CSeq_id_Handle& idh, TGetFlags flags);
+    TGi GetGi(const CSeq_id_Handle& idh, TGetFlags flags);
+    string GetLabel(const CSeq_id_Handle& idh, TGetFlags flags);
+    int GetTaxId(const CSeq_id_Handle& idh, TGetFlags flags);
 
     /// Bulk retrieval methods
 
@@ -338,19 +340,19 @@ public:
     TBioseqHandles GetBioseqHandles(const TIds& ids);
 
     // Get a set of accession/version pairs
-    void GetAccVers(TIds& ret, const TIds& idhs, bool force_load);
+    void GetAccVers(TIds& ret, const TIds& idhs, TGetFlags flags);
 
     // Get a set of gis
     typedef vector<TGi> TGIs;
-    void GetGis(TGIs& ret, const TIds& idhs, bool force_load);
+    void GetGis(TGIs& ret, const TIds& idhs, TGetFlags flags);
 
     // Get a set of label strings
     typedef vector<string> TLabels;
-    void GetLabels(TLabels& ret, const TIds& idhs, bool force_load);
+    void GetLabels(TLabels& ret, const TIds& idhs, TGetFlags flags);
 
     // Get a set of taxids
     typedef vector<int> TTaxIds;
-    void GetTaxIds(TTaxIds& ret, const TIds& idhs, bool force_load);
+    void GetTaxIds(TTaxIds& ret, const TIds& idhs, TGetFlags flags);
 
     // Get bioseq synonyms, resolving to the bioseq in this scope.
     CConstRef<CSynonymsSet> GetSynonyms(const CSeq_id_Handle& id,
@@ -365,27 +367,27 @@ public:
    
     bool IsTransactionActive() const;
 
-    TSeqPos GetSequenceLength(const CSeq_id_Handle& id, bool force_load);
-    CSeq_inst::TMol GetSequenceType(const CSeq_id_Handle& id, bool force_load);
-    int GetSequenceState(const CSeq_id_Handle& id, bool force_load);
-    int GetSequenceHash(const CSeq_id_Handle& id);
+    TSeqPos GetSequenceLength(const CSeq_id_Handle& id, TGetFlags flags);
+    CSeq_inst::TMol GetSequenceType(const CSeq_id_Handle& id, TGetFlags flags);
+    int GetSequenceState(const CSeq_id_Handle& id, TGetFlags flags);
+    int GetSequenceHash(const CSeq_id_Handle& id, TGetFlags flags);
 
     // Get a set of bioseq lengths
     typedef vector<TSeqPos> TSequenceLengths;
     void GetSequenceLengths(TSequenceLengths& ret,
-                            const TIds& idhs, bool force_load);
+                            const TIds& idhs, TGetFlags flags);
     // Get a set of bioseq types
     typedef vector<CSeq_inst::TMol> TSequenceTypes;
     void GetSequenceTypes(TSequenceTypes& ret,
-                          const TIds& idhs, bool force_load);
+                          const TIds& idhs, TGetFlags flags);
     // Get a set of bioseq states
     typedef vector<int> TSequenceStates;
     void GetSequenceStates(TSequenceStates& ret,
-                           const TIds& idhs, bool force_load);
+                           const TIds& idhs, TGetFlags flags);
     // Get a set of sequence hashes
     typedef vector<int> TSequenceHashes;
     void GetSequenceHashes(TSequenceHashes& ret,
-                           const TIds& idhs);
+                           const TIds& idhs, TGetFlags flags);
 
 
 private:
@@ -497,6 +499,11 @@ private:
     bool x_IsDummyTSE(const CTSE_Info& tse,
                       const CSeq_annot_Info& annot) const;
 
+    void x_GetBioseqHandlesSorted(const TIds& ids,
+                                  size_t from,
+                                  size_t count,
+                                  TBioseqHandles& ret);
+
 public:
     typedef pair<CConstRef<CSeq_entry_Info>, TTSE_Lock> TSeq_entry_Lock;
     typedef pair<CConstRef<CSeq_annot_Info>, TTSE_Lock> TSeq_annot_Lock;
diff --git a/c++/include/objmgr/impl/seq_annot_info.hpp b/c++/include/objmgr/impl/seq_annot_info.hpp
index 3c6085e..8fc7729 100644
--- a/c++/include/objmgr/impl/seq_annot_info.hpp
+++ b/c++/include/objmgr/impl/seq_annot_info.hpp
@@ -1,7 +1,7 @@
 #ifndef SEQ_ANNOT_INFO__HPP
 #define SEQ_ANNOT_INFO__HPP
 
-/*  $Id: seq_annot_info.hpp 465027 2015-04-16 13:18:40Z vasilche $
+/*  $Id: seq_annot_info.hpp 496424 2016-03-28 15:16:13Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -207,6 +207,11 @@ protected:
     void x_InitLocsKeys(CTSE_Info& tse);
     void x_InitFeatTableKeys(CTSE_Info& tse);
 
+    void x_AddAlignKeys(CAnnotObject_Info& info,
+                        const CSeq_align& align,
+                        const CMasterSeqSegments* master,
+                        CTSEAnnotObjectMapper& mapper);
+
     void x_UnmapAnnotObjects(CTSE_Info& tse);
     void x_DropAnnotObjects(CTSE_Info& tse);
 
diff --git a/c++/include/objmgr/impl/seq_id_sort.hpp b/c++/include/objmgr/impl/seq_id_sort.hpp
new file mode 100644
index 0000000..08bb0e7
--- /dev/null
+++ b/c++/include/objmgr/impl/seq_id_sort.hpp
@@ -0,0 +1,131 @@
+#ifndef OBJMGR_IMPL_SEQ_ID_SORT__HPP
+#define OBJMGR_IMPL_SEQ_ID_SORT__HPP
+
+/*  $Id: seq_id_sort.hpp 496835 2016-03-31 15:49:15Z ivanov $
+* ===========================================================================
+*
+*                            PUBLIC DOMAIN NOTICE
+*               National Center for Biotechnology Information
+*
+*  This software/database is a "United States Government Work" under the
+*  terms of the United States Copyright Act.  It was written as part of
+*  the author's official duties as a United States Government employee and
+*  thus cannot be copyrighted.  This software/database is freely available
+*  to the public for use. The National Library of Medicine and the U.S.
+*  Government have not placed any restriction on its use or reproduction.
+*
+*  Although all reasonable efforts have been taken to ensure the accuracy
+*  and reliability of the software and data, the NLM and the U.S.
+*  Government do not and cannot warrant the performance or results that
+*  may be obtained by using this software or data. The NLM and the U.S.
+*  Government disclaim all warranties, express or implied, including
+*  warranties of performance, merchantability or fitness for any particular
+*  purpose.
+*
+*  Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* Author:
+*           Aleksey Grichenko
+*
+* File Description:
+*           API for sorting seq-ids to improve the performance of data loaders.
+*
+*/
+
+#include <objects/seq/seq_id_handle.hpp>
+
+BEGIN_NCBI_SCOPE
+BEGIN_SCOPE(objects)
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CSortableSeq_id
+/////////////////////////////////////////////////////////////////////////////
+
+
+class NCBI_XOBJMGR_EXPORT CSortableSeq_id : public CObject
+{
+public:
+    CSortableSeq_id(const CSeq_id_Handle& idh, size_t idx);
+
+    bool operator<(const CSortableSeq_id& id) const;
+
+    const CSeq_id_Handle& GetId(void) const { return m_Id; }
+    size_t GetIndex(void) const { return m_Index; }
+
+private:
+    CSortableSeq_id(const CSortableSeq_id&);
+    CSortableSeq_id& operator=(const CSortableSeq_id&);
+
+    void x_ParseParts(const string& s);
+
+    struct SIdPart
+    {
+        SIdPart(Uint8 i)
+            : m_IsInt(true), m_Int(i) {}
+
+        SIdPart(const string& value)
+            : m_IsInt(false), m_Int(0)
+        {
+            for (size_t p = 0; p < value.size(); ++p) {
+                char c = value[p];
+                if (c < '0' || c > '9') {
+                    m_Str = value;
+                    return;
+                }
+                m_Int = m_Int*10 + c - '0';
+            }
+            m_IsInt = true;
+        }
+
+        bool m_IsInt;
+        string m_Str;
+        Uint8 m_Int;
+    };
+
+    typedef vector<SIdPart> TIdParts;
+
+    CSeq_id_Handle m_Id;
+    size_t m_Index;
+    TIdParts m_Parts;
+};
+
+
+inline
+bool operator<(const CRef<CSortableSeq_id>& id1, const CRef<CSortableSeq_id>& id2)
+{
+    return *id1 < *id2;
+}
+
+
+class NCBI_XOBJMGR_EXPORT CSortedSeq_ids
+{
+public:
+    typedef vector<CSeq_id_Handle> TIds;
+
+    CSortedSeq_ids(const TIds& ids);
+
+    void GetSortedIds(TIds& ids) const;
+
+    template<class TValue> void RestoreOrder(vector<TValue>& values) const
+    {
+        _ASSERT(values.size() == m_SortedIds.size());
+        vector<TValue> tmp = values;
+        for (size_t i = 0; i < m_SortedIds.size(); ++i) {
+            values[m_SortedIds[i]->GetIndex()] = tmp[i];
+        }
+    }
+
+private:
+    typedef vector< CRef<CSortableSeq_id> > TSortedIds;
+
+    TSortedIds  m_SortedIds;
+};
+
+
+END_SCOPE(objects)
+END_NCBI_SCOPE
+
+#endif //OBJMGR_IMPL_SEQ_ID_SORT__HPP
diff --git a/c++/include/objmgr/impl/seq_loc_cvt.hpp b/c++/include/objmgr/impl/seq_loc_cvt.hpp
index 0ca787b..ed440c0 100644
--- a/c++/include/objmgr/impl/seq_loc_cvt.hpp
+++ b/c++/include/objmgr/impl/seq_loc_cvt.hpp
@@ -1,7 +1,7 @@
 #ifndef SEQ_LOC_CVT__HPP
 #define SEQ_LOC_CVT__HPP
 
-/*  $Id: seq_loc_cvt.hpp 439336 2014-06-27 16:08:17Z vasilche $
+/*  $Id: seq_loc_cvt.hpp 486734 2015-12-09 19:13:21Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -138,7 +138,7 @@ public:
         eProduct
     };
 
-    bool Convert(const CSeq_loc& src, CRef<CSeq_loc>* dst,
+    bool Convert(const CSeq_loc& src, CRef<CSeq_loc>& dst,
                  EConvertFlag flag = eCnvDefault);
 
     void Reset(void);
@@ -211,7 +211,7 @@ private:
     CRef<CSeq_point> GetDstPoint(void);
     CRef<CSeq_loc_mix> GetDstMix(void);
 
-    void SetDstLoc(CRef<CSeq_loc>* loc);
+    void SetDstLoc(CRef<CSeq_loc>& loc);
 
     bool IsSpecialLoc(void) const;
 
@@ -235,13 +235,15 @@ private:
             return TRange(m_Src_from, m_Src_to);
         }
 
-    void ConvertPacked_int(const CSeq_loc& src, CRef<CSeq_loc>* dst);
-    void ConvertPacked_pnt(const CSeq_loc& src, CRef<CSeq_loc>* dst);
+    void ConvertPacked_int(const CSeq_loc& src, CRef<CSeq_loc>& dst);
+    void ConvertPacked_pnt(const CSeq_loc& src, CRef<CSeq_loc>& dst);
     bool ConvertSimpleMix(const CSeq_loc& src);
-    void ConvertMix(const CSeq_loc& src, CRef<CSeq_loc>* dst,
+    void ConvertMix(const CSeq_loc& src, CRef<CSeq_loc>& dst,
                     EConvertFlag flag = eCnvDefault);
-    void ConvertEquiv(const CSeq_loc& src, CRef<CSeq_loc>* dst);
-    void ConvertBond(const CSeq_loc& src, CRef<CSeq_loc>* dst);
+    void ConvertEquiv(const CSeq_loc& src, CRef<CSeq_loc>& dst);
+    void ConvertBond(const CSeq_loc& src, CRef<CSeq_loc>& dst);
+
+    static CSeq_loc_mix::Tdata* s_ConvertToMix(CRef<CSeq_loc>& loc);
 
     // Translation parameters:
     //   Source id and bounds:
@@ -325,9 +327,9 @@ public:
     void Convert(CAnnotObject_Ref& obj,
                  CSeq_loc_Conversion::ELocationType loctype);
     bool Convert(const CSeq_loc& src,
-                 CRef<CSeq_loc>* dst,
+                 CRef<CSeq_loc>& dst,
                  unsigned int loc_index);
-    void Convert(const CSeq_align& src, CRef<CSeq_align>* dst);
+    void Convert(const CSeq_align& src, CRef<CSeq_align>& dst);
 
     void Reset(void);
     bool IsPartial(void) const
@@ -351,26 +353,26 @@ private:
     void x_Add(CSeq_loc_Conversion& cvt, unsigned int loc_index);
 
     bool ConvertPoint(const CSeq_point& src,
-                      CRef<CSeq_loc>* dst,
+                      CRef<CSeq_loc>& dst,
                       unsigned int loc_index);
     bool ConvertInterval(const CSeq_interval& src,
-                         CRef<CSeq_loc>* dst,
+                         CRef<CSeq_loc>& dst,
                          unsigned int loc_index);
 
     bool ConvertPacked_int(const CSeq_loc& src,
-                           CRef<CSeq_loc>* dst,
+                           CRef<CSeq_loc>& dst,
                            unsigned int loc_index);
     bool ConvertPacked_pnt(const CSeq_loc& src,
-                           CRef<CSeq_loc>* dst,
+                           CRef<CSeq_loc>& dst,
                            unsigned int loc_index);
     bool ConvertMix(const CSeq_loc& src,
-                    CRef<CSeq_loc>* dst,
+                    CRef<CSeq_loc>& dst,
                     unsigned int loc_index);
     bool ConvertEquiv(const CSeq_loc& src,
-                      CRef<CSeq_loc>* dst,
+                      CRef<CSeq_loc>& dst,
                       unsigned int loc_index);
     bool ConvertBond(const CSeq_loc& src,
-                     CRef<CSeq_loc>* dst,
+                     CRef<CSeq_loc>& dst,
                      unsigned int loc_index);
     void ConvertFeature(CAnnotObject_Ref& ref,
                         const CSeq_feat& orig_feat,
diff --git a/c++/include/objmgr/impl/snp_annot_info.hpp b/c++/include/objmgr/impl/snp_annot_info.hpp
index 33dced4..7055bea 100644
--- a/c++/include/objmgr/impl/snp_annot_info.hpp
+++ b/c++/include/objmgr/impl/snp_annot_info.hpp
@@ -1,7 +1,7 @@
 #ifndef SNP_ANNOT_INFO__HPP
 #define SNP_ANNOT_INFO__HPP
 
-/*  $Id: snp_annot_info.hpp 468050 2015-05-19 19:16:25Z vasilche $
+/*  $Id: snp_annot_info.hpp 484035 2015-11-05 18:59:48Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -189,9 +189,11 @@ public:
 
     const_iterator FirstIn(const TRange& range) const;
 
-    TGi GetGi(void) const;
     const CSeq_id& GetSeq_id(void) const;
+    void SetSeq_id(const CSeq_id& id);
+    NCBI_DEPRECATED
     void SetGi(TGi gi);
+    void OffsetGi(TIntId gi_offset);
 
     size_t GetSize(void) const;
     const SSNP_Info& GetInfo(size_t index) const;
@@ -204,7 +206,6 @@ public:
     void x_AddSNP(const SSNP_Info& snp_info);
     void x_FinishParsing(void);
 
-protected:
     SSNP_Info::TCommentIndex x_GetCommentIndex(const string& comment);
     const string& x_GetComment(SSNP_Info::TCommentIndex index) const;
     SSNP_Info::TAlleleIndex x_GetAlleleIndex(const string& allele);
@@ -217,8 +218,21 @@ protected:
     SSNP_Info::TExtraIndex x_GetExtraIndex(const string& str);
     const string& x_GetExtra(SSNP_Info::TExtraIndex index) const;
 
-    bool x_CheckGi(TGi gi);
-    void x_SetGi(TGi gi);
+    const CIndexedStrings& x_GetComments(void) const {
+        return m_Comments;
+    }
+    const CIndexedStrings& x_GetAlleles(void) const {
+        return m_Alleles;
+    }
+    const CIndexedStrings& x_GetQualityCodesStr(void) const {
+        return m_QualityCodesStr;
+    }
+    const CIndexedOctetStrings& x_GetQualityCodesOs(void) const {
+        return m_QualityCodesOs;
+    }
+
+protected:
+    bool x_CheckId(const CSeq_id& id);
 
     void x_DoUpdate(TNeedUpdateFlags flags);
 
@@ -230,7 +244,6 @@ private:
     friend struct SSNP_Info;
     friend class CSeq_feat_Handle;
 
-    TGi                         m_Gi;
     CRef<CSeq_id>               m_Seq_id;
     TSNP_Set                    m_SNP_Set;
     CIndexedStrings             m_Comments;
@@ -285,13 +298,6 @@ CSeq_annot_SNP_Info::FirstIn(const CRange<TSeqPos>& range) const
 
 
 inline
-TGi CSeq_annot_SNP_Info::GetGi(void) const
-{
-    return m_Gi;
-}
-
-
-inline
 const CSeq_id& CSeq_annot_SNP_Info::GetSeq_id(void) const
 {
     return *m_Seq_id;
@@ -299,20 +305,6 @@ const CSeq_id& CSeq_annot_SNP_Info::GetSeq_id(void) const
 
 
 inline
-bool CSeq_annot_SNP_Info::x_CheckGi(TGi gi)
-{
-    if ( gi == m_Gi ) {
-        return true;
-    }
-    if ( m_Gi < ZERO_GI ) {
-        x_SetGi(gi);
-        return true;
-    }
-    return false;
-}
-
-
-inline
 CSeq_annot& CSeq_annot_SNP_Info::GetRemainingSeq_annot(void)
 {
     return *m_Seq_annot;
diff --git a/c++/include/objtools/data_loaders/genbank/impl/split_parser.hpp b/c++/include/objmgr/impl/split_parser.hpp
similarity index 97%
rename from c++/include/objtools/data_loaders/genbank/impl/split_parser.hpp
rename to c++/include/objmgr/impl/split_parser.hpp
index 69d496d..f66d7e3 100644
--- a/c++/include/objtools/data_loaders/genbank/impl/split_parser.hpp
+++ b/c++/include/objmgr/impl/split_parser.hpp
@@ -1,6 +1,6 @@
 #ifndef ID2_PARSER__HPP_INCLUDED
 #define ID2_PARSER__HPP_INCLUDED
-/*  $Id: split_parser.hpp 440703 2014-07-16 15:38:41Z vasilche $
+/*  $Id: split_parser.hpp 490251 2016-01-22 15:40:54Z vasilche $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -54,7 +54,7 @@ class CTSE_Info;
 class CTSE_Chunk_Info;
 class CSeq_id_Handle;
 
-class NCBI_XREADER_EXPORT CSplitParser
+class NCBI_XOBJMGR_EXPORT CSplitParser
 {
 public:
     static void Attach(CTSE_Info& tse, const CID2S_Split_Info& split);
diff --git a/c++/include/objmgr/impl/tse_assigner.hpp b/c++/include/objmgr/impl/tse_assigner.hpp
index 34765f7..6ca3ec3 100644
--- a/c++/include/objmgr/impl/tse_assigner.hpp
+++ b/c++/include/objmgr/impl/tse_assigner.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_OBJMGR_IMPL___TSE_ASSIGNER__HPP
 #define OBJECTS_OBJMGR_IMPL___TSE_ASSIGNER__HPP
 
-/*  $Id: tse_assigner.hpp 472380 2015-07-09 14:16:30Z ivanov $
+/*  $Id: tse_assigner.hpp 471824 2015-07-01 17:23:26Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objmgr/impl/tse_split_info.hpp b/c++/include/objmgr/impl/tse_split_info.hpp
index 1dca9ee..d621998 100644
--- a/c++/include/objmgr/impl/tse_split_info.hpp
+++ b/c++/include/objmgr/impl/tse_split_info.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_OBJMGR_IMPL___TSE_SPLIT_INFO__HPP
 #define OBJECTS_OBJMGR_IMPL___TSE_SPLIT_INFO__HPP
 
-/*  $Id: tse_split_info.hpp 472380 2015-07-09 14:16:30Z ivanov $
+/*  $Id: tse_split_info.hpp 471824 2015-07-01 17:23:26Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objmgr/object_manager.hpp b/c++/include/objmgr/object_manager.hpp
index a0d7f75..9ba69a3 100644
--- a/c++/include/objmgr/object_manager.hpp
+++ b/c++/include/objmgr/object_manager.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECT_MANAGER__HPP
 #define OBJECT_MANAGER__HPP
 
-/*  $Id: object_manager.hpp 467023 2015-05-08 14:53:15Z vasilche $
+/*  $Id: object_manager.hpp 498421 2016-04-15 18:44:37Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -151,6 +151,11 @@ public:
     typedef int TPriority;
     /// Default data source priority.
     enum EPriority {
+        kPriority_Entry = 9,    ///< Default priority for explicit entries
+        kPriority_Local = 44,   ///< Default priority for local data storage
+        kPriority_Replace = 88, ///< Default priority for replacement loaders
+        kPriority_Loader = 99,  ///< Default priority for main loaders
+
         kPriority_Default = -1, ///< Use default priority for added data
         kPriority_NotSet = -1   ///< Deprecated: use kPriority_Default instead
     };
diff --git a/c++/include/objmgr/objmgr_exception.hpp b/c++/include/objmgr/objmgr_exception.hpp
index 0f77419..f33e123 100644
--- a/c++/include/objmgr/objmgr_exception.hpp
+++ b/c++/include/objmgr/objmgr_exception.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJMGR_EXCEPTION__HPP
 #define OBJMGR_EXCEPTION__HPP
 
-/*  $Id: objmgr_exception.hpp 457199 2015-01-21 14:46:10Z gouriano $
+/*  $Id: objmgr_exception.hpp 494477 2016-03-07 19:25:35Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -60,6 +60,7 @@ public:
         eInvalidHandle,   ///< Attempt to use an invalid handle
         eLockedData,      ///< Attempt to remove locked data
         eTransaction,     ///< Transaction violation
+        eMissingData,     ///< The sequence doesn't have the data requested
         eOtherError
     };
     virtual const char* GetErrCodeString(void) const;
@@ -131,7 +132,8 @@ public:
         eNoConnection,
         eOtherError,
         eRepeatAgain,
-        eBadConfig
+        eBadConfig,
+        eNotFound
     };
     virtual const char* GetErrCodeString(void) const;
     NCBI_EXCEPTION_DEFAULT(CLoaderException, CObjMgrException);
diff --git a/c++/include/objmgr/scope.hpp b/c++/include/objmgr/scope.hpp
index cc1b5cc..b66fa1b 100644
--- a/c++/include/objmgr/scope.hpp
+++ b/c++/include/objmgr/scope.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJMGR_SCOPE__HPP
 #define OBJMGR_SCOPE__HPP
 
-/*  $Id: scope.hpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: scope.hpp 494477 2016-03-07 19:25:35Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -139,7 +139,7 @@ public:
                       const CSeq_id_Handle& id2,
                       EGetBioseqFlag get_flag);
 
-    typedef CBioseq_Handle::TId TIds;
+    typedef vector<CSeq_id_Handle> TIds;
     typedef vector<CBioseq_Handle> TBioseqHandles;
     /// Get bioseq handles for all ids. The returned vector contains
     /// bioseq handles for all requested ids in the same order.
@@ -378,109 +378,206 @@ public:
     /// not found in the scope.
     void RemoveSeq_annot(const CSeq_annot_Handle& annot);
 
-    /// Get "native" bioseq ids without filtering and matching.
-    TIds GetIds(const CSeq_id&        id );
-    TIds GetIds(const CSeq_id_Handle& idh);
+    /// EForceLoad flag instruct scope to ignore already loaded information
+    /// and alway request data loader for data.
+    enum EForceLoad {
+        eNoForceLoad,
+        eForceLoad
+    };
+    /// Flags to control behavior of various meta-data getters
+    ///   fForceLoad instructs scope to ignore already loaded information
+    ///     and alway request data loader for data
+    ///   fThrowOnMissing instructs to throw an exeption if the requested data
+    ///     is missing - either sequence id cannot be found in any data loader
+    ///     or the sequence doesn't have the requested meta-data
+    ///     without the flag getter will return special value
+    enum EGetFlags {
+        /// ignore already loaded information and alway request data loader
+        fForceLoad              = (1 << 0), // == eForceLoad for compatibility
+
+        /// fThrowOnMissingSequence will cause exception to be thrown
+        /// if sequence not found.
+        /// The exception type/code: CObjMgrException/eFindFailed
+        /// @sa CObjMgrException
+        fThrowOnMissingSequence = (1 << 1),
+
+        /// fThrowOnMissingData will cause exception to be thrown
+        /// if sequence is found but doesn't have the data
+        /// The exception type/code: CObjMgrException/eMissingData
+        /// @sa CObjMgrException
+        fThrowOnMissingData     = (1 << 2),
+
+        /// throw exception if sequence or requested data aren't found
+        /// @sa fThrowOnMissingSequence
+        /// @sa fThrowOnMissingData
+        /// @sa CObjMgrException
+        fThrowOnMissing         = fThrowOnMissingSequence|fThrowOnMissingData,
+
+        /// avoid time-consuming recalculation of missing data
+        fDoNotRecalculate       = (1 << 3)
+    };
+    typedef int TGetFlags;
+    /// obsolete enum
+    /// @sa EGetFlags
+    enum EForceLabelLoad {
+        eNoForceLabelLoad = eNoForceLoad,
+        eForceLabelLoad   = eForceLoad
+    };
 
-    CSeq_id_Handle GetAccVer(const CSeq_id_Handle& idh);
-    TGi GetGi(const CSeq_id_Handle& idh);
-    
+    /// Get "native" bioseq ids without filtering and matching.
+    /// Returns empty ids if the sequence is not found
+    /// @sa EGetflags
+    TIds GetIds(const CSeq_id&        id , TGetFlags flags = 0);
+    TIds GetIds(const CSeq_id_Handle& idh, TGetFlags flags = 0);
+
+    /// Get accession.version Seq-id
+    /// Returns null CSeq_id_Handle if the sequence is not found
+    /// or if it doesn't have accession
+    /// @sa EGetflags
+    CSeq_id_Handle GetAccVer(const CSeq_id_Handle& idh, TGetFlags flags = 0);
+
+    /// Get GI of a sequence
+    /// Returns ZERO_GI if the sequence is not found or if it doesn't have GI
+    /// @sa EGetflags
+    TGi GetGi(const CSeq_id_Handle& idh, TGetFlags flags = 0);
+
+    // helper methods to lookup for specific Seq-id types
     static CSeq_id_Handle x_GetAccVer(const TIds& ids);
     static TGi x_GetGi(const TIds& ids);
 
     /// Get short description of bioseq, usually "accession.version"
-    enum EForceLabelLoad {
-        eNoForceLabelLoad,
-        eForceLabelLoad
-    };
-    string GetLabel(const CSeq_id& id,
-                    EForceLabelLoad force_load = eNoForceLabelLoad);
-    string GetLabel(const CSeq_id_Handle& idh,
-                    EForceLabelLoad force_load = eNoForceLabelLoad);
+    /// Returns empty string if the sequence is not found.
+    /// @sa EGetflags
+    string GetLabel(const CSeq_id& id, TGetFlags flags = 0);
+    string GetLabel(const CSeq_id_Handle& idh, TGetFlags flags = 0);
 
     /// Get taxonomy id of bioseq
-    /// -1 means failure to determine the taxonomy id
-    /// 0 means absence of the taxonomy id for the sequence
-    enum EForceLoad {
-        eNoForceLoad,
-        eForceLoad
-    };
-    int GetTaxId(const CSeq_id& id,
-                 EForceLoad force_load = eNoForceLoad);
-    int GetTaxId(const CSeq_id_Handle& idh,
-                 EForceLoad force_load = eNoForceLoad);
-
-    // returns kInvalidSeqPos if sequence is not known
-    TSeqPos GetSequenceLength(const CSeq_id& id,
-                              EForceLoad force_load = eNoForceLoad);
-    TSeqPos GetSequenceLength(const CSeq_id_Handle& id,
-                              EForceLoad force_load = eNoForceLoad);
-
-    // returns CSeq_inst::eMol_not_set if sequence is not known
+    /// Return -1 if sequence is not found
+    /// Return 0 if sequence doesn't have taxonomy id
+    /// @sa EGetflags
+    int GetTaxId(const CSeq_id& id, TGetFlags flags = 0);
+    int GetTaxId(const CSeq_id_Handle& idh, TGetFlags flags = 0);
+
+    /// Get sequence length
+    /// Return kInvalidSeqPos if sequence is not found
+    /// @sa EGetflags
+    TSeqPos GetSequenceLength(const CSeq_id& id, TGetFlags flags = 0);
+    TSeqPos GetSequenceLength(const CSeq_id_Handle& id, TGetFlags flags = 0);
+
+    /// Get molecular type of sequence (protein/dna/rna)
+    /// Return CSeq_inst::eMol_not_set if sequence is not found
+    /// @sa EGetflags
+    /// @sa CSeq_inst::EMol
     CSeq_inst::TMol GetSequenceType(const CSeq_id& id,
-                                    EForceLoad force_load = eNoForceLoad);
+                                    TGetFlags flags = 0);
     CSeq_inst::TMol GetSequenceType(const CSeq_id_Handle& id,
-                                    EForceLoad force_load = eNoForceLoad);
-
-    // returns (fState_not_found|fState_no_data) if sequence is not known
-    CBioseq_Handle::TBioseqStateFlags GetSequenceState(const CSeq_id& id,
-                                                       EForceLoad force_load = eNoForceLoad);
-    CBioseq_Handle::TBioseqStateFlags GetSequenceState(const CSeq_id_Handle& id,
-                                                       EForceLoad force_load = eNoForceLoad);
-
-    // returns 0 if sequence or its hash is not known
+                                    TGetFlags flags = 0);
+
+    /// Get sequence GenBank state
+    /// Return (fState_not_found|fState_no_data) if sequence is not found
+    /// @sa EGetflags
+    /// @sa CBioseq_Handle::EBioseqStateFlags
+    CBioseq_Handle::TBioseqStateFlags GetSequenceState(const CSeq_id& id, TGetFlags flags = 0);
+    CBioseq_Handle::TBioseqStateFlags GetSequenceState(const CSeq_id_Handle& id, TGetFlags flags = 0);
+
+    /// Get sequence data hash value
+    /// Return 0 if sequence is not found or if its hash is not known
+    /// Note: 0 can be a real hash value, use flags to distinguish these cases
+    /// @sa EGetflags
     typedef int TSequenceHash;
-    TSequenceHash GetSequenceHash(const CSeq_id& id);
-    TSequenceHash GetSequenceHash(const CSeq_id_Handle& id);
+    TSequenceHash GetSequenceHash(const CSeq_id& id, TGetFlags flags = 0);
+    TSequenceHash GetSequenceHash(const CSeq_id_Handle& id, TGetFlags flags = 0);
 
     /// Bulk retrieval methods
+
+    /// Get accession.version Seq-id
+    /// Returns null CSeq_id_Handles for sequences that aren't found
+    /// or don't have accession id.
+    /// @sa GetAccVer
+    /// @sa EGetflags
     typedef vector<CSeq_id_Handle> TSeq_id_Handles;
     TSeq_id_Handles GetAccVers(const TSeq_id_Handles& idhs,
-                               EForceLoad force_load = eNoForceLoad);
+                                TGetFlags flags = 0);
     void GetAccVers(TSeq_id_Handles* results,
                     const TSeq_id_Handles& idhs,
-                    EForceLoad force_load = eNoForceLoad);
+                    TGetFlags flags = 0);
+
+    /// Get GI of a sequence
+    /// Returns ZERO_GI for sequence that aren't found or don't have GI
+    /// @sa GetGi
+    /// @sa EGetflags
     typedef vector<TGi> TGIs;
     TGIs GetGis(const TSeq_id_Handles& idhs,
-                EForceLoad force_load = eNoForceLoad);
+                TGetFlags flags = 0);
     void GetGis(TGIs* results,
                 const TSeq_id_Handles& idhs,
-                EForceLoad force_load = eNoForceLoad);
+                TGetFlags flags = 0);
+
+    /// Get short descriptions of sequences, usually "accession.version"
+    /// Returns empty strings for sequences that aren't found
+    /// @sa GetLabel
+    /// @sa EGetflags
     typedef vector<string> TLabels;
     TLabels GetLabels(const TSeq_id_Handles& idhs,
-                      EForceLoad force_load = eNoForceLoad);
+                      TGetFlags flags = 0);
     void GetLabels(TLabels* results,
                    const TSeq_id_Handles& idhs,
-                   EForceLoad force_load = eNoForceLoad);
+                   TGetFlags flags = 0);
+
+    /// Get taxonomy ids of sequences
+    /// Return -1 for sequences that aren't found
+    /// Return 0 for sequences that don't have taxonomy id
+    /// @sa EGetflags
     typedef vector<int> TTaxIds;
     TTaxIds GetTaxIds(const TSeq_id_Handles& idhs,
-                      EForceLoad force_load = eNoForceLoad);
+                      TGetFlags flags = 0);
     void GetTaxIds(TTaxIds* results,
                    const TSeq_id_Handles& idhs,
-                   EForceLoad force_load = eNoForceLoad);
+                   TGetFlags flags = 0);
 
+    /// Get lengths of sequences
+    /// Return kInvalidSeqPos for sequences that aren't found
+    /// @sa EGetflags
     typedef vector<TSeqPos> TSequenceLengths;
     TSequenceLengths GetSequenceLengths(const TSeq_id_Handles& idhs,
-                                        EForceLoad force_load = eNoForceLoad);
+                                        TGetFlags flags = 0);
     void GetSequenceLengths(TSequenceLengths* results,
                             const TSeq_id_Handles& idhs,
-                            EForceLoad force_load = eNoForceLoad);
+                            TGetFlags flags = 0);
+
+    /// Get molecular types of sequences (protein/dna/rna)
+    /// Return CSeq_inst::eMol_not_set for sequences that aren't found
+    /// @sa EGetflags
+    /// @sa CSeq_inst::EMol
     typedef vector<CSeq_inst::TMol> TSequenceTypes;
     TSequenceTypes GetSequenceTypes(const TSeq_id_Handles& idhs,
-                                    EForceLoad force_load = eNoForceLoad);
+                                    TGetFlags flags = 0);
     void GetSequenceTypes(TSequenceTypes* results,
                           const TSeq_id_Handles& idhs,
-                          EForceLoad force_load = eNoForceLoad);
+                          TGetFlags flags = 0);
+
+    /// Get GenBank states of sequences
+    /// Return (fState_not_found|fState_no_data) for sequences
+    /// that aren't found
+    /// @sa EGetflags
+    /// @sa CBioseq_Handle::EBioseqStateFlags
     typedef vector<CBioseq_Handle::TBioseqStateFlags> TSequenceStates;
     TSequenceStates GetSequenceStates(const TSeq_id_Handles& idhs,
-                                      EForceLoad force_load = eNoForceLoad);
+                                      TGetFlags flags = 0);
     void GetSequenceStates(TSequenceStates* results,
                            const TSeq_id_Handles& idhs,
-                           EForceLoad force_load = eNoForceLoad);
+                           TGetFlags flags = 0);
+
+    /// Get data hashes of sequences
+    /// Return 0 for sequences that aren't found or they don't have hash
+    /// Note: 0 can be a real hash value, use flags to distinguish these cases
+    /// @sa EGetflags
     typedef vector<TSequenceHash> TSequenceHashes;
-    TSequenceHashes GetSequenceHashes(const TSeq_id_Handles& idhs);
+    TSequenceHashes GetSequenceHashes(const TSeq_id_Handles& idhs,
+                                      TGetFlags flags = 0);
     void GetSequenceHashes(TSequenceHashes* results,
-                           const TSeq_id_Handles& idhs);
+                           const TSeq_id_Handles& idhs,
+                           TGetFlags flags = 0);
 
     /// Get bioseq synonyms, resolving to the bioseq in this scope.
     CConstRef<CSynonymsSet> GetSynonyms(const CSeq_id&        id);
diff --git a/c++/include/objmgr/seq_entry_ci.hpp b/c++/include/objmgr/seq_entry_ci.hpp
index fedac06..b197b03 100644
--- a/c++/include/objmgr/seq_entry_ci.hpp
+++ b/c++/include/objmgr/seq_entry_ci.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJMGR__SEQ_ENTRY_CI__HPP
 #define OBJMGR__SEQ_ENTRY_CI__HPP
 
-/*  $Id: seq_entry_ci.hpp 485120 2015-11-18 19:39:01Z vasilche $
+/*  $Id: seq_entry_ci.hpp 483569 2015-11-02 17:27:19Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objmgr/seq_feat_handle.hpp b/c++/include/objmgr/seq_feat_handle.hpp
index a626d61..9a2b9ff 100644
--- a/c++/include/objmgr/seq_feat_handle.hpp
+++ b/c++/include/objmgr/seq_feat_handle.hpp
@@ -1,7 +1,7 @@
 #ifndef SEQ_FEAT_HANDLE__HPP
 #define SEQ_FEAT_HANDLE__HPP
 
-/*  $Id: seq_feat_handle.hpp 458821 2015-02-10 17:18:44Z gotvyans $
+/*  $Id: seq_feat_handle.hpp 483571 2015-11-02 17:33:20Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -164,6 +164,8 @@ public:
     typedef SSNP_Info::TWeight TWeight;
 
     TSNPId GetSNPId(void) const;
+    const CSeq_id& GetSNPSeq_id(void) const;
+    NCBI_DEPRECATED
     CSeq_id::TGi GetSNPGi(void) const;
     bool IsSNPMinusStrand(void) const;
     TWeight GetSNPWeight(void) const;
diff --git a/c++/include/objmgr/seq_loc_mapper.hpp b/c++/include/objmgr/seq_loc_mapper.hpp
index 80d84f1..82f4398 100644
--- a/c++/include/objmgr/seq_loc_mapper.hpp
+++ b/c++/include/objmgr/seq_loc_mapper.hpp
@@ -1,7 +1,7 @@
 #ifndef SEQ_LOC_MAPPER__HPP
 #define SEQ_LOC_MAPPER__HPP
 
-/*  $Id: seq_loc_mapper.hpp 479618 2015-09-22 15:42:58Z ivanov $
+/*  $Id: seq_loc_mapper.hpp 479439 2015-09-21 13:04:11Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objmgr/seq_map.hpp b/c++/include/objmgr/seq_map.hpp
index 501798b..822e04c 100644
--- a/c++/include/objmgr/seq_map.hpp
+++ b/c++/include/objmgr/seq_map.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_OBJMGR___SEQ_MAP__HPP
 #define OBJECTS_OBJMGR___SEQ_MAP__HPP
 
-/*  $Id: seq_map.hpp 396537 2013-04-19 14:13:41Z vasilche $
+/*  $Id: seq_map.hpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -133,6 +133,7 @@ public:
         fFindExactLevel = (1<<4),
         fIgnoreUnresolved = (1<<5),
         fByFeaturePolicy= (1<<6),
+        fBySequenceClass= (1<<7),
         fFindRef        = (fFindLeafRef | fFindInnerRef),
         fFindAny        = fFindData | fFindGap | fFindRef,
         fFindAnyLeaf    = fFindData | fFindGap | fFindLeafRef,
@@ -372,6 +373,8 @@ protected:
                          TSeqPos ref_pos,
                          bool ref_minus_strand);
 
+    int x_GetSequenceClass(void) const;
+
     CBioseq_Info*    m_Bioseq;
 
     typedef vector<CSegment> TSegments;
diff --git a/c++/include/objmgr/seq_map_ci.hpp b/c++/include/objmgr/seq_map_ci.hpp
index 2a8843b..7844834 100644
--- a/c++/include/objmgr/seq_map_ci.hpp
+++ b/c++/include/objmgr/seq_map_ci.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_OBJMGR___SEQ_MAP_CI__HPP
 #define OBJECTS_OBJMGR___SEQ_MAP_CI__HPP
 
-/*  $Id: seq_map_ci.hpp 435052 2014-05-13 17:26:17Z vasilche $
+/*  $Id: seq_map_ci.hpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -87,6 +87,7 @@ public:
     TSeqPos x_GetSkipAfter(void) const;
     TSeqPos x_CalcLength(void) const;
     TSeqPos x_GetTopOffset(void) const;
+    int x_GetSequenceClass(void) const;
 
 private:
 
@@ -100,6 +101,7 @@ private:
     TSeqPos            m_LevelRangePos;
     TSeqPos            m_LevelRangeEnd;
     bool               m_MinusStrand;
+    mutable Int1       m_SequenceClass;
 
     friend class CSeqMap_CI;
     friend class CSeqMap;
@@ -186,6 +188,12 @@ struct NCBI_XOBJMGR_EXPORT SSeqMapSelector
             return *this;
         }
 
+    SSeqMapSelector& SetBySequenceClass(void)
+        {
+            m_Flags |= CSeqMap::fBySequenceClass;
+            return *this;
+        }
+
     size_t GetResolveCount(void) const
         {
             return m_MaxResolveCount;
@@ -347,6 +355,7 @@ private:
 
     TSeqPos x_GetTopOffset(void) const;
     void x_Resolve(TSeqPos pos);
+    CBioseq_Handle x_GetBioseq(const CSeq_id& seq_id) const;
 
     bool x_Found(void) const;
 
@@ -370,6 +379,8 @@ private:
                   const SSeqMapSelector& selector,
                   TSeqPos pos);
 
+    int x_GetSequenceClass(void) const; // CBioseq_Handle::ESequenceClass
+
     typedef vector<TSegmentInfo> TStack;
 
     // scope for length resolution
@@ -489,7 +500,8 @@ const CSeqMap::CSegment& CSeqMap_CI_SegmentInfo::x_GetSegment(void) const
 inline
 CSeqMap_CI_SegmentInfo::CSeqMap_CI_SegmentInfo(void)
     : m_Index(kInvalidSeqPos),
-      m_LevelRangePos(kInvalidSeqPos), m_LevelRangeEnd(kInvalidSeqPos)
+      m_LevelRangePos(kInvalidSeqPos), m_LevelRangeEnd(kInvalidSeqPos),
+      m_MinusStrand(false), m_SequenceClass(-1)
 {
 }
 
diff --git a/c++/include/objmgr/util/create_defline.hpp b/c++/include/objmgr/util/create_defline.hpp
index ec11322..2df694f 100644
--- a/c++/include/objmgr/util/create_defline.hpp
+++ b/c++/include/objmgr/util/create_defline.hpp
@@ -86,7 +86,8 @@ public:
         /// Refrain from anything that could add substantial overhead.
         fNoExpensiveOps    = fLocalAnnotsOnly,
         fGpipeMode         = 0x8, ///< Use GPipe defaults.
-        fOmitTaxonomicName = 0x10 ///< Do not add organism suffix to proteins.
+        fOmitTaxonomicName = 0x10, ///< Do not add organism suffix to proteins.
+        fDevMode           = 0x20 ///< Development mode for testing new features.
     };
     typedef int TUserFlags; ///< Binary "OR" of EUserFlags
 
@@ -161,7 +162,8 @@ private:
     );
     void x_SetSuffix (
         string& suffix,
-        const CBioseq_Handle& bsh
+        const CBioseq_Handle& bsh,
+        bool appendComplete
     );
 
     void x_AdjustProteinTitleSuffix (
@@ -181,6 +183,7 @@ private:
     bool m_LocalAnnotsOnly;
     bool m_GpipeMode;
     bool m_OmitTaxonomicName;
+    bool m_DevMode;
 
     /// seq-inst fields
     bool m_IsNA;
@@ -202,6 +205,7 @@ private:
     bool m_ThirdParty;
     bool m_WGSMaster;
     bool m_TSAMaster;
+    bool m_TLSMaster;
 
     string m_MainTitle;
     string m_GeneralStr;
@@ -219,6 +223,7 @@ private:
 
     bool m_HTGTech;
     bool m_HTGSUnfinished;
+    bool m_IsTLS;
     bool m_IsTSA;
     bool m_IsWGS;
     bool m_IsEST_STS_GSS;
@@ -269,6 +274,7 @@ private:
 
     /// user object fields
     bool m_IsUnverified;
+    CTempString m_TargetedLocus;
 
     /// map fields
     string m_rEnzyme;
diff --git a/c++/include/objmgr/util/feature.hpp b/c++/include/objmgr/util/feature.hpp
index a1febb9..6ac0749 100644
--- a/c++/include/objmgr/util/feature.hpp
+++ b/c++/include/objmgr/util/feature.hpp
@@ -1,7 +1,7 @@
 #ifndef FEAT__HPP
 #define FEAT__HPP
 
-/*  $Id: feature.hpp 480957 2015-10-06 12:01:31Z ivanov $
+/*  $Id: feature.hpp 499447 2016-04-26 14:17:39Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -493,7 +493,11 @@ void ReassignFeatureIds(const CSeq_entry_EditHandle& entry);
 NCBI_XOBJUTIL_EXPORT
 void ReassignFeatureIds(const CSeq_annot_EditHandle& annot);
 NCBI_XOBJUTIL_EXPORT
-bool GetFeatureGeneBiotype(feature::CFeatTree ft,
+bool GetFeatureGeneBiotype(feature::CFeatTree& ft,
+                           CMappedFeat mf,
+                           string& biotype);
+NCBI_XOBJUTIL_EXPORT
+bool GetFeatureGeneBiotypeFaster(feature::CFeatTree& ft,
                            CMappedFeat mf,
                            string& biotype);
 
@@ -523,15 +527,15 @@ NCBI_XOBJUTIL_EXPORT bool PromoteCDSToNucProtSet(objects::CSeq_feat_Handle& orig
 /// @param new_feat   The feature to be adjusted (if necessary)
 ///
 /// @return           Boolean to indicate whether the feature was changed
-bool AdjustFeaturePartialFlagForLocation(CSeq_feat& new_feat);
+NCBI_XOBJUTIL_EXPORT bool AdjustFeaturePartialFlagForLocation(CSeq_feat& new_feat);
 
-/// AdjustProteinFeaturePartialsToMatchCDS
-/// A function to change an existing MolInfo to match a coding region
-/// @param new_prot  The protein feature to be adjusted (if necessary)
-/// @param cds       The CDS to match
+/// CopyFeaturePartials
+/// A function to copy the start and end partialness from one feature to another
+/// @param dst       The feature to be adjusted (if necessary)
+/// @param src       The CDS to match
 ///
-/// @return          Boolean to indicate whether the protein feature was changed
-bool AdjustProteinFeaturePartialsToMatchCDS(CSeq_feat& new_prot, const CSeq_feat& cds);
+/// @return          Boolean to indicate whether the feature was changed
+NCBI_XOBJUTIL_EXPORT bool CopyFeaturePartials(CSeq_feat& dst, const CSeq_feat& src);
 
 /// AdjustProteinMolInfoToMatchCDS
 /// A function to change an existing MolInfo to match a coding region
@@ -539,7 +543,7 @@ bool AdjustProteinFeaturePartialsToMatchCDS(CSeq_feat& new_prot, const CSeq_feat
 /// @param cds      The CDS to match
 ///
 /// @return         Boolean to indicate whether molinfo was changed
-bool AdjustProteinMolInfoToMatchCDS(CMolInfo& molinfo, const CSeq_feat& cds);
+NCBI_XOBJUTIL_EXPORT bool AdjustProteinMolInfoToMatchCDS(CMolInfo& molinfo, const CSeq_feat& cds);
 
 /// AdjustForCDSPartials
 /// A function to make all of the necessary related changes to
@@ -549,7 +553,7 @@ bool AdjustProteinMolInfoToMatchCDS(CMolInfo& molinfo, const CSeq_feat& cds);
 /// @param seh        The Seq-entry-handle to be adjusted (if necessary)
 ///
 /// @return           Boolean to indicate whether the Seq-entry-handle was changed
-bool AdjustForCDSPartials(const CSeq_feat& cds, CSeq_entry_Handle seh);
+NCBI_XOBJUTIL_EXPORT bool AdjustForCDSPartials(const CSeq_feat& cds, CSeq_entry_Handle seh);
 
 /// RetranslateCDS
 /// A function to replace the protein Bioseq pointed to by cds.product
@@ -557,7 +561,23 @@ bool AdjustForCDSPartials(const CSeq_feat& cds, CSeq_entry_Handle seh);
 /// @param cds        The feature for which adjustments are to be made
 ///
 /// @return           Boolean to indicate whether the coding region was retranslated.
-bool RetranslateCDS(const CSeq_feat& cds, CScope& scope);
+NCBI_XOBJUTIL_EXPORT bool RetranslateCDS(const CSeq_feat& cds, CScope& scope);
+
+/// AddFeatureToBioseq
+/// A function to add a feature to a Bioseq - will create a new feature table
+/// Seq-annot if necessary.
+/// @param seq        The sequence on which to add the feature
+/// @param f          The feature to add
+/// @param scope      The scope that contains the sequence
+NCBI_XOBJUTIL_EXPORT void AddFeatureToBioseq(const CBioseq& seq, const CSeq_feat& f, CScope& scope);
+
+/// AddProteinFeature
+/// A function to create a protein feature with the specified protein name
+/// @param seq          The Bioseq on which to create the protein feature
+/// @param protein_name The protein name
+/// @param cds          The coding region for this protein feature
+/// @param scope        The scope in which the sequence can be found
+NCBI_XOBJUTIL_EXPORT void AddProteinFeature(const CBioseq& seq, const string& protein_name, const CSeq_feat& cds, CScope& scope);
 
 END_SCOPE(feature)
 END_SCOPE(objects)
diff --git a/c++/include/objmgr/util/objutil.hpp b/c++/include/objmgr/util/objutil.hpp
index d5bf20a..e6f901d 100644
--- a/c++/include/objmgr/util/objutil.hpp
+++ b/c++/include/objmgr/util/objutil.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJMGR_UTIL___OBJUTILS_HPP
 #define OBJMGR_UTIL___OBJUTILS_HPP
 
-/*  $Id: objutil.hpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: objutil.hpp 487384 2015-12-17 13:38:09Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objmgr/util/sequence.hpp b/c++/include/objmgr/util/sequence.hpp
index 434fcc0..f94ed77 100644
--- a/c++/include/objmgr/util/sequence.hpp
+++ b/c++/include/objmgr/util/sequence.hpp
@@ -1,7 +1,7 @@
 #ifndef SEQUENCE__HPP
 #define SEQUENCE__HPP
 
-/*  $Id: sequence.hpp 468762 2015-05-27 20:18:13Z gotvyans $
+/*  $Id: sequence.hpp 499692 2016-04-27 17:18:50Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -219,6 +219,20 @@ NCBI_XOBJUTIL_EXPORT
 CSeq_id_Handle GetId(const CSeq_id_Handle& id, CScope& scope,
                      EGetIdType type = eGetId_Default);
 
+/// Return a selected ID type from a set of Seq-ids
+/// Arguments (except 'id') and behavior is the same as of
+/// GetId(const CSeq_id& id, ...).
+NCBI_XOBJUTIL_EXPORT
+CSeq_id_Handle GetId(const CBioseq::TId& id,
+                     EGetIdType type = eGetId_Default);
+
+/// Return a selected ID type from a Bioseq
+/// Arguments (except 'seq') and behavior is the same as of
+/// GetId(const CBioseq_Handle& seq, ...).
+NCBI_XOBJUTIL_EXPORT
+CSeq_id_Handle GetId(const CBioseq& seq,
+                     EGetIdType type = eGetId_Default);
+
 /* @} */
 
 
@@ -518,6 +532,10 @@ GetBestOverlappingFeat(const CSeq_feat& feat,
                        TBestFeatOpts opts = fBestFeat_Defaults,
                        CGetOverlappingFeaturesPlugin *plugin = NULL );
 
+NCBI_XOBJUTIL_EXPORT
+CConstRef<CSeq_feat> GetmRNAforCDS(const CSeq_feat& cds, CScope& scope);
+
+
 /// Get the best overlapping feature for a SNP (variation) feature
 /// @param snp_feat
 ///   SNP feature object
@@ -556,12 +574,14 @@ CConstRef<CSeq_feat> GetBestOverlapForSNP(const CSeq_feat& snp_feat,
 /// Convenience functions for popular overlapping types
 enum ETransSplicing {
     eTransSplicing_No = 0,
-    eTransSplicing_Yes
+    eTransSplicing_Yes,
+    eTransSplicing_Auto ///< Ignore overlap strand if the source location
+                        ///< has mixed/both strand.
 };
 NCBI_XOBJUTIL_EXPORT
 CConstRef<CSeq_feat> GetOverlappingGene(
-    const CSeq_loc& loc, CScope& scope, 
-    ETransSplicing eTransSplicing = eTransSplicing_No);
+    const CSeq_loc& loc, CScope& scope,
+    ETransSplicing eTransSplicing = eTransSplicing_Auto);
 
 
 NCBI_XOBJUTIL_EXPORT
@@ -749,7 +769,8 @@ public:
                                const CSeq_loc* location = 0,
                                const string& custom_title = kEmptyStr);
     virtual void WriteSequence(const CBioseq_Handle& handle,
-                               const CSeq_loc* location = 0);
+                               const CSeq_loc* location = 0, 
+                               CSeq_loc::EOpFlags merge_flags=CSeq_loc::fMerge_All);
 
     /// These versions may set up a temporary object manager scope
     /// In the common case of a raw bioseq, no scope is needed
diff --git a/c++/include/objtools/align_format/align_format_util.hpp b/c++/include/objtools/align_format/align_format_util.hpp
index 754489a..e58e7e3 100644
--- a/c++/include/objtools/align_format/align_format_util.hpp
+++ b/c++/include/objtools/align_format/align_format_util.hpp
@@ -1,4 +1,4 @@
-/*  $Id: align_format_util.hpp 482732 2015-10-26 16:31:57Z ivanov $
+/*  $Id: align_format_util.hpp 488861 2016-01-06 15:45:07Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -65,31 +65,31 @@ static const char kClassInfo[] = "class=\"info\"";
 
 ///entrez
 // .ncbirc alias: ENTREZ
-static const char kEntrezUrl[] = "<a title=\"Show report for <@acc@>\" <@cssInf@>href=\"http://www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=genbank&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>\" <@target@>>";
+static const char kEntrezUrl[] = "<a title=\"Show report for <@acc@>\" <@cssInf@>href=\"//www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=genbank&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>\" <@target@>>";
 
 //.ncbirc alias: ENTREZ_TM
-static const char kEntrezTMUrl[] = "http://www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=genbank&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>";
+static const char kEntrezTMUrl[] = "//www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=genbank&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>";
 
 //.ncbirc alias: WGS
-static const char kWGSUrl[] = "http://www.ncbi.nlm.nih.gov/Traces/wgs/?val=<@wgsproj@>&page=1&display=contigs&search=<@wgsacc@>";
+static const char kWGSUrl[] = "//www.ncbi.nlm.nih.gov/Traces/wgs/?val=<@wgsproj@>&page=1&display=contigs&search=<@wgsacc@>";
 
 
 ///trace db
 //.ncbirc alias: TRACE
-static const char kTraceUrl[] = "<a title=\"Show report for <@val@>\" <@cssInf@>href=\"http://www.ncbi.nlm.nih.gov/Traces/trace.cgi?cmd=retrieve&dopt=fasta&val=<@val@>&RID=<@rid@>\">";
+static const char kTraceUrl[] = "<a title=\"Show report for <@val@>\" <@cssInf@>href=\"//www.ncbi.nlm.nih.gov/Traces/trace.cgi?cmd=retrieve&dopt=fasta&val=<@val@>&RID=<@rid@>\">";
 
 ///genome button
 //.ncbirc alias: GENOME_BTN
 static const char kGenomeButton[] = "<table border=0 width=600 cellpadding=8>\
 <tr valign=\"top\"><td><a href=\
-\"http://www.ncbi.nlm.nih.gov/mapview/map_search.cgi?taxid=%d&RID=%s&CLIENT=\
+\"//www.ncbi.nlm.nih.gov/mapview/map_search.cgi?taxid=%d&RID=%s&CLIENT=\
 %s&QUERY_NUMBER=%d\"><img border=0 src=\"html/GenomeView.gif\"></a></td>\
 <td>Show positions of the BLAST hits in the %s genome \
 using the Entrez Genomes MapViewer</td></tr></table><p>";
 
 ///unigene
 // .ncbirc alias: UNIGEN
-static const char kUnigeneUrl[] = "<a href=\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=<@db@>&cmd=Display&dopt=<@dopt@>_unigene&from_uid=<@gi@>&RID=<@rid@>&log$=unigene<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
+static const char kUnigeneUrl[] = "<a href=\"//www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=<@db@>&cmd=Display&dopt=<@dopt@>_unigene&from_uid=<@gi@>&RID=<@rid@>&log$=unigene<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 
 //substitues <@lnk_displ@>
 static const char kUnigeneImg[] = "<img border=0 height=16 width=16 src=\"images/U.gif\" alt=\"UniGene info linked to <@label@>\">";
@@ -98,22 +98,22 @@ static const string kUnigeneDispl =  "<div><@lnk@>-<span class=\"rlLink\">cluste
 
 ///structure
 // .ncbirc alias: STRUCTURE_URL
-static const char kStructureUrl[] = "<a href=\"http://www.ncbi.nlm.nih.gov/Structure/cblast/cblast.cgi?blast_RID=<@rid@>&blast_rep_gi=<@blast_rep_gi@>&hit=<@gi@>&<@cdd_params@>\
+static const char kStructureUrl[] = "<a href=\"//www.ncbi.nlm.nih.gov/Structure/cblast/cblast.cgi?blast_RID=<@rid@>&blast_rep_gi=<@blast_rep_gi@>&hit=<@gi@>&<@cdd_params@>\
 &blast_view=<@blast_view@>&hsp=0&taxname=<@taxname@>&client=blast&log$=structure<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 //substitues <@lnk_displ@>
-static const char kStructureImg[] = "<img border=0 height=16 width=16 src=\"http://www.ncbi.nlm.nih.gov/Structure/cblast/str_link.gif\" alt=\"Structure related to <@label@>\">";
+static const char kStructureImg[] = "<img border=0 height=16 width=16 src=\"//www.ncbi.nlm.nih.gov/Structure/cblast/str_link.gif\" alt=\"Structure related to <@label@>\">";
 //For text link <@lnk@> is substituted by formatted url
 static const string kStructureDispl =  "<div><@lnk@>-<span class=\"rlLink\">3D structure displays</span></div>";
 
 ///structure overview
-static const char kStructure_Overview[] = "<a href=\"http://www.ncbi.nlm.nih.\
+static const char kStructure_Overview[] = "<a href=\"//www.ncbi.nlm.nih.\
 gov/Structure/cblast/cblast.cgi?blast_RID=%s&blast_rep_gi=%d&hit=%d&%s\
 &blast_view=%s&hsp=0&taxname=%s&client=blast\">Related Structures</a>";
 
 
 ///Geo
 // .ncbirc alias: GEO
-static const char kGeoUrl[] =  "<a href=\"http://www.ncbi.nlm.nih.gov/geoprofiles/?LinkName=nucleotide_geoprofiles&from_uid=<@gi@>&RID=<@rid@>&log$=geo<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
+static const char kGeoUrl[] =  "<a href=\"//www.ncbi.nlm.nih.gov/geoprofiles/?LinkName=nucleotide_geoprofiles&from_uid=<@gi@>&RID=<@rid@>&log$=geo<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 
 
 //substitues <@lnk_displ@>
@@ -123,7 +123,7 @@ static const string kGeoDispl =  "<div><@lnk@>-<span class=\"rlLink\">microarray
 
 ///Gene
 // .ncbirc alias: GENE
-static const char kGeneUrl[] = "<a href=\"http://www.ncbi.nlm.nih.gov/gene?term=<@gi@>[<@uid@>]&RID=<@rid@>&log$=gene<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
+static const char kGeneUrl[] = "<a href=\"//www.ncbi.nlm.nih.gov/gene?term=<@gi@>[<@uid@>]&RID=<@rid@>&log$=gene<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 
 //substitues <@lnk_displ@>
 static const char kGeneImg[] = "<img border=0 height=16 width=16 src=\"images/G.gif\" alt=\"Gene info linked to <@label@>\">";
@@ -132,13 +132,13 @@ static const string kGeneDispl =  "<div><@lnk@>-<span class=\"rlLink\">associate
 
 ///Bioassay for proteins
 // .ncbirc alias: BIOASSAY_PROT
-static const char kBioAssayProtURL[] = "<a href=\"http://www.ncbi.nlm.nih.gov/entrez?db=pcassay&term=<@gi@>[PigGI]&RID=<@rid@>&log$=pcassay<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
+static const char kBioAssayProtURL[] = "<a href=\"//www.ncbi.nlm.nih.gov/entrez?db=pcassay&term=<@gi@>[PigGI]&RID=<@rid@>&log$=pcassay<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 //substitues <@lnk_displ@>
 static const char kBioAssayProtImg[] = "<img border=0 height=16 width=16 src=\"images/Bioassay.gif\" alt=\"PubChem BioAssay Info linked to <@label@>\">";
 
 ///Bioassay for nucleotides
 // .ncbirc alias: BIOASSAY_NUC
-static const char kBioAssayNucURL[] = "<a href=\"http://www.ncbi.nlm.nih.gov/entrez?db=pcassay&term=<@gi@>[RNATargetGI]&RID=<@rid@>&log$=pcassay<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
+static const char kBioAssayNucURL[] = "<a href=\"//www.ncbi.nlm.nih.gov/entrez?db=pcassay&term=<@gi@>[RNATargetGI]&RID=<@rid@>&log$=pcassay<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 static const char kBioAssayNucImg[] = "<img border=0 height=16 width=16 src=\"images/Bioassay.gif\" alt=\"PubChem BioAssay Info linked to <@label@>\">";
 
 //For text link <@lnk@> is substituted by formatted url for both BioAssay Nuc and Prot
@@ -146,7 +146,7 @@ static const string kBioAssayDispl =  "<div><@lnk@>-<span class=\"rlLink\">bioac
 
 ///mapviewer linkout
 // .ncbirc alias: MAPVIEWER
-static const char kMapviwerUrl[] = "<a href=\"http://www.ncbi.nlm.nih.gov/mapview/map_search.cgi?direct=on&gbgi=<@gi@>&THE_BLAST_RID=<@rid@>&log$=map<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
+static const char kMapviwerUrl[] = "<a href=\"//www.ncbi.nlm.nih.gov/mapview/map_search.cgi?direct=on&gbgi=<@gi@>&THE_BLAST_RID=<@rid@>&log$=map<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 //substitues <@lnk_displ@>
 static const char kMapviwerImg[] = "<img border=0 height=16 width=16 src=\"images/M.gif\" alt=\"Genome view with mapviewer linked to <@label@>\">";
 //For text link <@lnk@> is substituted by formatted url
@@ -154,19 +154,19 @@ static const string kMapviwerDispl =  "<div><@lnk@>-<span class=\"rlLink\">align
 
 ///mapviewer linkout
 //for used for NT/NW/NC
-static const string kMapviewBlastHitUrl = "http://www.ncbi.nlm.nih.gov/mapview/maps.cgi?maps=blast_set";
+static const string kMapviewBlastHitUrl = "//www.ncbi.nlm.nih.gov/mapview/maps.cgi?maps=blast_set";
 static const string kMapviewBlastHitParams = "<a href=\"<@user_url@>&db=<@db@>&na=<@is_na@>&gnl=<@gnl@>&gi=<@gi@>&term=<@gi@>[gi]&taxid=<@taxid@>&RID=<@rid@>&QUERY_NUMBER=<@query_number@>&log$=nucl<@log@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 
 
 ///Repr microbial Genome linkout
 // .ncbirc alias: REPR_MICROBIAL_GENOMES
-static const char kReprMicrobialGenomesUrl[] = "<a href=\"http://www.ncbi.nlm.nih.gov/genome?term=<@gi@>[gi]&RID=<@rid@>&log$=map<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
+static const char kReprMicrobialGenomesUrl[] = "<a href=\"//www.ncbi.nlm.nih.gov/genome?term=<@gi@>[gi]&RID=<@rid@>&log$=map<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>";
 //substitues <@lnk_displ@>
 static const char kReprMicrobialGenomesImg[] = "<img border=0 height=16 width=16 src=\"images/L.gif\" alt=\"View genome information for <@label@>\">";
 //For text link <@lnk@> is substituted by formatted url
 static const string kReprMicrobialGenomesDispl =  "<div><@lnk@>-<span class=\"rlLink\">Genomic Sequence</span></div>";
 
-static const char kIdenticalProteinsUrl[] = "<a href=\"http://www.ncbi.nlm.nih.gov/protein/<@gi@>?report=ipg\" title=\"View proteins identical to <@label@>\" <@lnkTarget@>><@lnk_displ@></a>";
+static const char kIdenticalProteinsUrl[] = "<a href=\"//www.ncbi.nlm.nih.gov/protein/<@gi@>?report=ipg\" title=\"View proteins identical to <@label@>\" <@lnkTarget@>><@lnk_displ@></a>";
 static const string kIdenticalProteinsDispl =  "<div><@lnk@>-<span class=\"rlLink\">Identical proteins to <@label@></span></div>";
 
 
@@ -176,13 +176,13 @@ static const char kDownloadLink[] = "<a href=\"<@download_url@>&segs=<@segs@>\">
 //substitues <@lnk_displ@>
 static const char kDownloadImg[] = "<img border=0 height=16 width=16 src=\"images/D.gif\" alt=\"Download subject sequence <@label@> spanning the HSP\">";
 
-static const char kSeqViewerUrl[] = "http://www.ncbi.nlm.nih.gov/<@dbtype@>/<@gi@>?report=graph&rid=<@rid@>[<@gi@>]&<@seqViewerParams@>&v=<@from@>:<@to@>&appname=ncbiblast&link_loc=<@link_loc@>";
+static const char kSeqViewerUrl[] = "//www.ncbi.nlm.nih.gov/<@dbtype@>/<@gi@>?report=graph&rid=<@rid@>[<@gi@>]&<@seqViewerParams@>&v=<@from@>:<@to@>&appname=ncbiblast&link_loc=<@link_loc@>";
 static const string kSeqViewerParams = "tracks=[key:sequence_track,name:Sequence,display_name:Sequence,id:STD1,category:Sequence,annots:Sequence,ShowLabel:true][key:gene_model_track,CDSProductFeats:false][key:alignment_track,name:other alignments,annots:NG Alignments|Refseq Alignments|Gnomon Alignments|Unnamed,shown:false]";
 
-static const char kSeqViewerUrlNonGi[] = "http://www.ncbi.nlm.nih.gov/projects/sviewer/?RID=<@rid@>&id=<@firstSeqID@>&<@seqViewerParams@>&v=<@from@>:<@to@>&appname=ncbiblast&link_loc=<@link_loc@>";
+static const char kSeqViewerUrlNonGi[] = "//www.ncbi.nlm.nih.gov/projects/sviewer/?RID=<@rid@>&id=<@firstSeqID@>&<@seqViewerParams@>&v=<@from@>:<@to@>&appname=ncbiblast&link_loc=<@link_loc@>";
 
 //to test ranges use:
-//static const char kSeqViewerUrl[] = "http://www.ncbi.nlm.nih.gov/<@dbtype@>/<@gi@>?report=graph&rid=<@rid@>&tracks=[key:gene_model_track],[key:alignment_track]&v=<@from@>:<@to@>,<@fromTest@>:<@toTest@>&flip=<@flip@>";
+//static const char kSeqViewerUrl[] = "//www.ncbi.nlm.nih.gov/<@dbtype@>/<@gi@>?report=graph&rid=<@rid@>&tracks=[key:gene_model_track],[key:alignment_track]&v=<@from@>:<@to@>,<@fromTest@>:<@toTest@>&flip=<@flip@>";
 
 static const char kCustomLinkTemplate[] = "<a href=\"<@custom_url@>\" class=\"<@custom_cls@>\" target=\"<@custom_trg@>\" title=\"<@custom_title@>\"><@custom_lnk_displ@></a>"; 
 static const char kCustomLinkTitle[]="Show <@custom_report_type@> report for <@seqid@>";
@@ -194,10 +194,10 @@ static const char kGenericLinkMouseoverTmpl[] = "<span class=\"jig-ncbipopper\"
 ///Sub-sequence
 // .ncbirc alias: ENTREZ_SUBSEQ
 
-static const char kEntrezSubseqUrl[] = "<a href=\"http://www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=gbwithparts&from=<@from@>&to=<@to@>&RID=<@rid@>\">";
+static const char kEntrezSubseqUrl[] = "<a href=\"//www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=gbwithparts&from=<@from@>&to=<@to@>&RID=<@rid@>\">";
 
 // .ncbirc alias: ENTREZ_SUBSEQ_TM
-static const char kEntrezSubseqTMUrl[] = "http://www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=gbwithparts&from=<@from@>&to=<@to@>&RID=<@rid@>";
+static const char kEntrezSubseqTMUrl[] = "//www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=gbwithparts&from=<@from@>&to=<@to@>&RID=<@rid@>";
 
 ///Default linkout order 
 //.ncbirc alias: LINKOUT_ORDER
@@ -213,14 +213,14 @@ static const char kBl2seqUrl[] = "<a href=\"blast.ncbi.nlm.nih.gov/Blast.cgi?QUE
 // .ncbirc alias: GETSEQ_SUB_FRM_0
 // .ncbirc alias: GETSEQ_SUB_FRM_1
 static const char k_GetSeqSubmitForm_0[] = "<FORM  method=\"post\" \
-action=\"http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?SUBMIT=y\" \
+action=\"//www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?SUBMIT=y\" \
 name=\"%s%d\"><input type=button value=\"Get selected sequences\" \
 onClick=\"finalSubmit(%d, 'getSeqAlignment%d', 'getSeqGi', '%s%d', %d)\"><input \
 type=\"hidden\" name=\"db\" value=\"\"><input type=\"hidden\" name=\"term\" \
 value=\"\"><input type=\"hidden\" name=\"doptcmdl\" value=\"docsum\"><input \
 type=\"hidden\" name=\"cmd\" value=\"search\"></form>";
 static const char k_GetSeqSubmitForm_1[] = "<FORM  method=\"POST\" \
-action=\"http://www.ncbi.nlm.nih.gov/Traces/trace.cgi\" \
+action=\"//www.ncbi.nlm.nih.gov/Traces/trace.cgi\" \
 name=\"%s%d\"><input type=button value=\"Get selected sequences\" \
 onClick=\"finalSubmit(%d, 'getSeqAlignment%d', 'getSeqGi', '%s%d', %d)\"><input \
 type=\"hidden\" name=\"val\" value=\"\"><input \
@@ -236,31 +236,31 @@ type=\"button\" value=\"Deselect all\" onClick=\"handleCheckAll('deselect', \
 
 // .ncbirc alias: TREEVIEW_FRM
 static const char k_GetTreeViewForm[] =  "<FORM  method=\"post\" \
-action=\"http://www.ncbi.nlm.nih.gov/blast/treeview/blast_tree_view.cgi?request=page&rid=%s&queryID=%s&distmode=on\" \
+action=\"//www.ncbi.nlm.nih.gov/blast/treeview/blast_tree_view.cgi?request=page&rid=%s&queryID=%s&distmode=on\" \
 name=\"tree%s%d\" target=\"trv%s\"> \
 <input type=button value=\"Distance tree of results\" onClick=\"extractCheckedSeq('getSeqAlignment%d', 'getSeqGi', 'tree%s%d')\"> \
 <input type=\"hidden\" name=\"sequenceSet\" value=\"\"><input type=\"hidden\" name=\"screenWidth\" value=\"\"></form>";
 
 // .ncbirc alias: GENE_INFO
 static const char kGeneInfoUrl[] =
-"http://www.ncbi.nlm.nih.gov/sites/entrez?db=gene&cmd=search&term=%d&RID=%s&log$=geneexplicit%s&blast_rank=%d";
+"//www.ncbi.nlm.nih.gov/sites/entrez?db=gene&cmd=search&term=%d&RID=%s&log$=geneexplicit%s&blast_rank=%d";
 
 // .ncbirc alias: TREEVIEW_CGI
-static const char kGetTreeViewCgi[] = "http://www.ncbi.nlm.nih.gov/blast/treeview/blast_tree_view.cgi";
+static const char kGetTreeViewCgi[] = "//www.ncbi.nlm.nih.gov/blast/treeview/blast_tree_view.cgi";
 // .ncbirc alias: ENTREZ_QUERY_CGI
-static const char kEntrezQueryCgi[] = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi";
+static const char kEntrezQueryCgi[] = "//www.ncbi.nlm.nih.gov/entrez/query.fcgi";
 // .ncbirc alias: TRACE_CGI
-static const char kTraceCgi[] = "http://www.ncbi.nlm.nih.gov/Traces/trace.cgi";
+static const char kTraceCgi[] = "//www.ncbi.nlm.nih.gov/Traces/trace.cgi";
 // .ncbirc alias:  MAP_SEARCH_CGI
-static const char kMapSearchCgi[] = "http://www.ncbi.nlm.nih.gov/mapview/map_search.cgi";
+static const char kMapSearchCgi[] = "//www.ncbi.nlm.nih.gov/mapview/map_search.cgi";
 // .ncbirc alias: CBLAST_CGI
-static const char kCBlastCgi[] = "http://www.ncbi.nlm.nih.gov/Structure/cblast/cblast.cgi";
+static const char kCBlastCgi[] = "//www.ncbi.nlm.nih.gov/Structure/cblast/cblast.cgi";
 // .ncbirc alias: ENTREZ_VIEWER_CGI
-static const char kEntrezViewerCgi[] = "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi";
+static const char kEntrezViewerCgi[] = "//www.ncbi.nlm.nih.gov/entrez/viewer.fcgi";
 // .ncbirc alias: BL2SEQ_WBLAST_CGI
-static const char kBl2SeqWBlastCgi[] = "http://www.ncbi.nlm.nih.gov/blast/bl2seq/wblast2.cgi";
+static const char kBl2SeqWBlastCgi[] = "//www.ncbi.nlm.nih.gov/blast/bl2seq/wblast2.cgi";
 // .ncbirc alias: ENTREZ_SITES_CGI
-static const char kEntrezSitesCgi[] = "http://www.ncbi.nlm.nih.gov/sites/entrez";
+static const char kEntrezSitesCgi[] = "//www.ncbi.nlm.nih.gov/sites/entrez";
 
 
 /// create map source of all static URL's using previously defined pairs
@@ -1200,6 +1200,10 @@ public:
                                                 list<TGi>& use_this_gi,
                                                 TGi& gi);
 
+    static TGi GetDisplayIds(const list< CRef< objects::CBlast_def_line > > &bdl,
+                                              const objects::CSeq_id& aln_id,
+                                              list<TGi>& use_this_gi);
+
     ///Check if accession is WGS
     ///@param accession: string accession [in]
     ///@param wgsProj: string  wgsProj [out]      
@@ -1221,6 +1225,9 @@ public:
 
     /// Calculate the uniq subject query coverage range (blastn only)
     static int GetUniqSeqCoverage(objects::CSeq_align_set & alnset);
+    static TGi GetGiForSeqIdList (const list<CRef<objects::CSeq_id> >& ids);
+
+    static string GetTitle(const objects::CBioseq_Handle & bh);
 
 protected:
 
diff --git a/c++/include/objtools/align_format/format_flags.hpp b/c++/include/objtools/align_format/format_flags.hpp
index cbddb93..c9a3ae2 100644
--- a/c++/include/objtools/align_format/format_flags.hpp
+++ b/c++/include/objtools/align_format/format_flags.hpp
@@ -1,4 +1,4 @@
-/*  $Id: format_flags.hpp 485058 2015-11-18 16:06:47Z ivanov $
+/*  $Id: format_flags.hpp 495725 2016-03-21 14:24:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -114,17 +114,22 @@ enum ETabularField {
     eQueryFrame,           ///< Query frame
     eSubjFrame,            ///< Subject frame
     eBTOP,                 ///< BLAST traceback operations.
-    eSubjectTaxIds,		   ///< Subject Tax ID
-    eSubjectSciNames,	   ///< Subject Scientific Name
-    eSubjectCommonNames,   ///< Subject Common Name
-    eSubjectBlastNames,	   ///< Subject Blast Name
-    eSubjectSuperKingdoms, ///< Subject Super Kingdom
+    eSubjectTaxIds,		   ///< Subject Tax IDs
+    eSubjectSciNames,	   ///< Subject Scientific Names
+    eSubjectCommonNames,   ///< Subject Common Names
+    eSubjectBlastNames,	   ///< Subject Blast Names
+    eSubjectSuperKingdoms, ///< Subject Super Kingdoms
     eSubjectTitle,		   ///< Only the first subject defline
     eSubjectAllTitles,	   ///< All subject deflines
     eSubjectStrand,        ///< Subject Strand
     eQueryCovSubject,      ///< Query Coverage per Subject
     eQueryCovSeqalign,     ///< Query Coverage per Seqalign
-    eQueryCovUniqSubject,      ///< Query Coverage per Subject
+    eQueryCovUniqSubject,  ///< Query Coverage per Subject
+    eSubjectTaxId,		   ///< Subject Tax ID
+    eSubjectSciName,	   ///< Subject Scientific Name
+    eSubjectCommonName,    ///< Subject Common Name
+    eSubjectBlastName,	   ///< Subject Blast Name
+    eSubjectSuperKingdom,  ///< Subject Super Kingdom
     eMaxTabularField       ///< Sentinel value
 };
 
diff --git a/c++/include/objtools/align_format/seqalignfilter.hpp b/c++/include/objtools/align_format/seqalignfilter.hpp
index b5c8ea7..9337857 100644
--- a/c++/include/objtools/align_format/seqalignfilter.hpp
+++ b/c++/include/objtools/align_format/seqalignfilter.hpp
@@ -1,4 +1,4 @@
-/*  $Id: seqalignfilter.hpp 482392 2015-10-22 16:37:19Z ivanov $
+/*  $Id: seqalignfilter.hpp 482276 2015-10-21 20:13:31Z zaretska $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/align_format/tabular.hpp b/c++/include/objtools/align_format/tabular.hpp
index 1e826f6..70bf4bb 100644
--- a/c++/include/objtools/align_format/tabular.hpp
+++ b/c++/include/objtools/align_format/tabular.hpp
@@ -1,4 +1,4 @@
-/* $Id: tabular.hpp 482732 2015-10-26 16:31:57Z ivanov $ 
+/* $Id: tabular.hpp 495725 2016-03-21 14:24:26Z ivanov $ 
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -283,6 +283,11 @@ protected:
     void x_PrintSubjectCommonNames();
     void x_PrintSubjectBlastNames();
     void x_PrintSubjectSuperKingdoms();
+    void x_PrintSubjectTaxId();
+    void x_PrintSubjectSciName();
+    void x_PrintSubjectCommonName();
+    void x_PrintSubjectBlastName();
+    void x_PrintSubjectSuperKingdom();
     void x_PrintSubjectTitle();
     void x_PrintSubjectAllTitles();
     void x_PrintSubjectStrand();
@@ -290,6 +295,7 @@ protected:
     void x_PrintSubjectCoverage();
     void x_PrintUniqSubjectCoverage();
     void x_SetTaxInfo(const objects::CBioseq_Handle & handle, const CRef<objects::CBlast_def_line_set> & bdlRef);
+    void x_SetTaxInfoAll(const objects::CBioseq_Handle & handle, const CRef<objects::CBlast_def_line_set> & bdlRef);
     void x_SetSubjectIds(const objects::CBioseq_Handle& bh, const CRef<objects::CBlast_def_line_set> & bdlRef);
     void x_SetQueryCovSubject(const objects::CSeq_align & align);
     void x_SetQueryCovUniqSubject(const objects::CSeq_align & align);
@@ -339,6 +345,11 @@ private:
     vector<string>		m_SubjectCommonNames;
     set<string>		m_SubjectBlastNames;
     set<string>		m_SubjectSuperKingdoms;
+    int				m_SubjectTaxId;
+    string			m_SubjectSciName;
+    string			m_SubjectCommonName;
+    string			m_SubjectBlastName;
+    string			m_SubjectSuperKingdom;
     CRef<CBlast_def_line_set> m_SubjectDefline;
 
     string m_SubjectStrand;
@@ -645,6 +656,10 @@ private:
     SIgGene m_JGene;
     vector<SIgDomain *> m_IgDomains;                                        
     vector<string> m_OtherInfo;
+    int m_Cdr3Start;
+    int m_Cdr3End;
+    string m_Cdr3Seq;
+    string m_Cdr3SeqTrans;
 };
 
 END_SCOPE(align_format)
diff --git a/c++/include/objtools/align_format/taxFormat.hpp b/c++/include/objtools/align_format/taxFormat.hpp
new file mode 100644
index 0000000..595bf9b
--- /dev/null
+++ b/c++/include/objtools/align_format/taxFormat.hpp
@@ -0,0 +1,296 @@
+/*  $Id: taxFormat.hpp 486926 2015-12-11 17:32:50Z zaretska $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Author:  Irena Zaretskaya
+ */
+
+/** @file taxFormat.hpp
+ *  Sequence alignment taxonomy display tool
+ *
+ */
+
+#ifndef OBJTOOLS_ALIGN_FORMAT___TAXFORMAT_HPP
+#define OBJTOOLS_ALIGN_FORMAT___TAXFORMAT_HPP
+
+#include <corelib/ncbireg.hpp>
+#include <objects/taxon1/taxon1.hpp>
+#include <objtools/align_format/align_format_util.hpp>
+
+
+
+
+
+BEGIN_NCBI_SCOPE
+USING_SCOPE(objects);
+class CCgiContext;
+BEGIN_SCOPE(align_format)
+
+
+/**
+ * Example:
+ * @code
+ * CRef<objects::CSeq_align_set> aln_set = ...
+ * CRef<objects::CScope> scope = ... 
+ * .......
+ * CTaxFormat txformat(*aln_set, *scope,<connectToTaxServer>);   
+ * ds.SetAlignOption(display_option);
+ * txformat.DisplayOrgReport(stdout);
+ * to display Lineage and/or taxonomy report connectToTaxServer = true (defualt)
+ * txformat.DisplayLineageReport(stdout);
+ * txformat.DisplayTaxonomyReport(stdout); 
+ * @endcode
+ */
+ 
+ const string kTaxBrowserURL           = "//www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi";
+ const string kBlastNameLink           = "<a href=\"<@taxBrowserURL@>?id=<@bl_taxid@>\" target=\"lnktx<@rid@>\" title=\"Show taxonomy info for <@blast_name@> (taxid <@bl_taxid@>)\"><@blast_name@></a>";
+
+ const string kOrgReportTable          = "<table><caption><h1>Organism Report</h1></caption><tr><th>Accession</th><th>Descr</th><th>Score</th><th>E-value</th></tr><@table_rows@></table><@taxidToSeqsMap@>";
+ const string kOrgReportOrganismHeader = "<tr><th colspan=\"4\"><a href=\"<@taxBrowserURL@>?id=<@taxid@>\" name=\"<@taxid@>\" title=\"Show taxonomy info for <@scientific_name@> (taxid <@taxid@>)\" target=\"lnktx<@rid@>\"><@scientific_name@>[<@blast_name_link@>] taxid <@taxid@></th></tr>";
+ const string kOrgReportOrganismHeaderNoTaxConnect = "<tr><th colspan=\"4\"><a href=\"<@taxBrowserURL@>?id=<@taxid@>\" name=\"<@taxid@>\" title=\"Show taxonomy info for <@scientific_name@> (taxid <@taxid@>)\" target=\"lnktx<@rid@>\"><@scientific_name@>[<@blast_name@>]</th></tr>";
+ const string kOrgReportTableHeader    = "<tr><th>Accession</th><th>Description</th><th>Score</th><th>E-value</th></tr>";
+ const string kOrgReportTableRow       = "<tr><td><a title=\"Show report for <@acc@>\" target=\"lnktx<@rid@>\" href=\"//www.ncbi.nlm.nih.gov/protein/<@gi@>?report=fwwwtax&log$=taxrep&RID=<@rid@>\"><@acc@></a></td><td><@descr_abbr@></td><td><@score@></td><td><@evalue@></td></tr>";
+
+ const string kTaxIdToSeqsMap          = "<input type=\"hidden\" id=\"txForSeq_<@taxid@>\" value=\"<@giList@>\" />";
+
+ const string kLineageReportTable          = "<table><caption><h1>Linage Report</h1><caption><@table_rows@></table>";
+ const string kLineageReportTableHeader    = "<tr><th>Organism</th><th>Blast Name</th><th>Score</th><th>Number of Hits</th><th>Description</th></tr>";
+ const string kLineageReportOrganismHeader = "<tr><td><@depth@><a href=\"//<@taxBrowserURL@>?id=<@taxid@>\" title=\"Show taxonomy info for <@scientific_name@> (taxid <@taxid@>)\" target=\"lnktx<@rid@>\"><@scientific_name@></a><td><@blast_name_link@></td><td colspan =\"3\"></td></tr>";
+ const string kLineageReportTableRow       = "<tr><td><@depth@><a href=\"//<@taxBrowserURL@>?id=<@taxid@>\" title=\"Show taxonomy info for <@scientific_name@> (taxid <@taxid@>)\" target=\"lnktx<@rid@>\"><@scientific_name@></a></td><td><@blast_name_link@></td><td><@score@></td><td><a href=\"#<@taxid@>\" title=\"Show organism report for <@scientific_name@>\"><@numhits@></a></td><td><a title=\"Show report for <@acc@> <@descr_abbr@>\" target=\"lnktx<@rid@>\" href=\"//www.ncbi.nlm.nih.gov/pro [...]
+
+
+ const string kTaxonomyReportTable          = "<table><caption><h1>Taxonomy Report</h1><caption><@table_rows@></table>";
+ const string kTaxonomyReportTableHeader    = "<tr><th>Taxonomy</th><th>Number of hits</th><th>Number of organisms</th><th>Description</th></tr>"; 
+ const string kTaxonomyReportOrganismHeader = "<tr><td><@depth@><a href=\"//<@taxBrowserURL@>?id=<@taxid@>\" title=\"Show taxonomy info for <@scientific_name@> (taxid <@taxid@>)\" target=\"lnktx<@rid@>\"><@scientific_name@></a></td><td><@numhits@></td><td><@numOrgs@></td><td><@descr_abbr@></td></tr>"; 
+ const string kTaxonomyReportTableRow       = "<tr><td><@depth@><a href=\"//<@taxBrowserURL@>?id=<@taxid@>\" title=\"Show taxonomy info for <@scientific_name@> (taxid <@taxid@>)\" target=\"lnktx<@rid@>\"><@scientific_name@></a></td><td><@numhits@></td><td><@numOrgs@></td><td><@descr_abbr@></td></tr>";
+
+ 
+
+class NCBI_ALIGN_FORMAT_EXPORT CTaxFormat {
+
+  public:
+        
+        
+    /// Constructors
+    ///@param seqalign: seqalign used to display taxonomy info     
+    ///@param scope: scope to fetch your sequence 
+    ///@param connectToTaxServe: default true indicates to connect to Tax server
+    CTaxFormat(const objects::CSeq_align_set & seqalign,
+                     objects::CScope & scope,
+                     bool connectToTaxServer = true);
+                     
+        /// Destructor
+    ~CTaxFormat();    
+
+    ///Displays Organism Report
+    ///@param out: stream for display
+    ///    
+    void DisplayOrgReport(CNcbiOstream & out);    
+
+    ///Displays Linage Report
+    ///@param out: stream for display
+    ///    
+    void DisplayLineageReport(CNcbiOstream& out);
+
+    ///Displays Taxonomy Report
+    ///@param out: stream for display
+    ///    
+    void DisplayTaxonomyReport(CNcbiOstream& out);
+    
+    struct SSeqInfo {
+        int taxid;                       ///< taxid   
+        TGi   gi;                        ///< gi
+        CRef<objects::CSeq_id> seqID;    ///< seqID used in defline
+        string label;                    ///< sequence label        
+        string title;                    ///< sequnce title
+        double bit_score;                ///< score 
+        double evalue;                   ///< evalue
+        TGi displGi;                     ///<gi for seq that is displayed in alignment section
+    };
+
+    struct STaxInfo {
+        int taxid;                       ///< taxid   
+        string commonName;               ///< commonName
+        string scientificName;           ///< scientificName  
+        string blastName;                ///< blastName
+        int    blNameTaxid;              ///< blastName taxid
+        vector <SSeqInfo*> seqInfoList;  ///< vector of SSeqInfo corresponding to taxid
+        string             giList;       ///< string of gis separated by comma corresponding to taxid
+        string             accList;      ///< string of accessions separated by comma corresponding to taxid
+        string             taxidList;    ///< string of "children" taxids containing sequences in alignment separated by comma corresponding to taxid
+
+        unsigned int       numChildren;  ///< Number of childre for taxid 
+        unsigned int       depth;        ///< Depth   
+        vector <int>       lineage;      ///< vector of taxids containg lineage for taxid  
+        unsigned int       numHits;      ///< Number of sequences in alignmnet corresponding to taxid and it's children
+        unsigned int       numOrgs;      ///< Number of organism in alignmnet corresponding to taxid and it's children
+    };
+
+    typedef map < int, struct STaxInfo > TSeqTaxInfoMap; 
+
+    struct SBlastResTaxInfo {
+        vector <int> orderedTaxids;   ///< taxids ordered by highest score or common tree top to bottom tarveres??
+        TSeqTaxInfoMap seqTaxInfoMap; ///< Map containing info for orderedTaxids
+    };
+
+
+    struct STaxFormatTemplates {
+        string blastNameLink;           ///< Template for displaying blast name link
+
+        string orgReportTable;          ///< Template for displaying organism report table
+        string orgReportOrganismHeader; ///< Template for organism report organism header
+        string orgReportTableHeader;    ///< Template for displaying organism report table header
+        string orgReportTableRow;       ///< Tempalte for displaying organism report table row
+
+        string taxIdToSeqsMap;          ///< Tempalte for mapping taxids to seqlist
+
+        string lineageReportTable;          ///< Template for displaying lineage report table
+        string lineageReportOrganismHeader; ///< Template for displaying lineage report organism header
+        string lineageReportTableHeader;    ///< Template for displaying lineage report table header
+        string lineageReportTableRow;       ///< Template for displaying lineage report table row
+
+        string taxonomyReportTable;         ///< Template for displaying taxonomy report table
+        string taxonomyReportOrganismHeader;///< Template for displaying taxonomy report organism header
+        string taxonomyReportTableHeader;   ///< Template for displaying taxonomy report table header
+        string taxonomyReportTableRow;      ///< Template for displaying taxonomy report table row
+    };
+
+    ///set connection to taxonomy server
+    ///@param connectToTaxServer: bool
+    ///
+    void SetConnectToTaxServer(bool connectToTaxServer) {m_ConnectToTaxServer = connectToTaxServer;}
+
+    ///set blast request id
+    ///@param rid: blast RID
+    ///
+    void SetRid(string rid) {
+        m_Rid = rid;
+    }
+
+    void SetCgiContext (CCgiContext& ctx) {
+        m_Ctx = &ctx;
+    }
+
+    ///Gets pointer to STaxFormatTemplates
+    ///@return: taxFormatTemplates
+    ///    
+    STaxFormatTemplates *GetTaxFormatTemplates(void) {return m_TaxFormatTemplates;}    
+
+    ///Gets taxids for sequences in alignment
+    ///@return: vector of taxids
+    ///    
+    vector <int> &GetAlignTaxIDs(void){return m_BlastResTaxInfo->orderedTaxids;}
+
+    ///Gets info for sequences in alignment corresponding to taxid
+    ///@param taxid: taxid
+    ///@return: STaxInfo 
+    ///    
+    struct STaxInfo &GetAlignTaxInfo(int taxid){ return m_BlastResTaxInfo->seqTaxInfoMap[taxid];}//Check if taxid exists in aligh first    
+
+    ///Gets taxids for sequences in taxonomy tree
+    ///@return: vector of taxids
+    ///    
+    vector <int> &GetTaxTreeTaxIDs(void){return m_TaxTreeinfo->orderedTaxids;}
+
+    ///Gets info for sequences in taxonomy tree corresponding to taxid
+    ///@param taxid: taxid
+    ///@return: STaxInfo 
+    ///    
+    struct STaxInfo &GetTaxTreeInfo(int taxid){ return m_TaxTreeinfo->seqTaxInfoMap[taxid];}
+
+    ///Checks if there are sequences in alignment with specified taxid
+    ///@param taxid: taxid
+    ///@return: bool true  if there are sequences in alignment with specified taxid
+    ///    
+    bool isTaxidInAlign(int taxid);
+    
+
+protected:
+ 
+    /// reference to seqalign set
+    CConstRef < objects::CSeq_align_set > m_SeqalignSetRef;     
+    objects::CScope & m_Scope;        
+    CCgiContext* m_Ctx;
+
+    
+    SBlastResTaxInfo *m_BlastResTaxInfo;    ///< SBlastResTaxInfo structure containing information for taxids in alignment, orderedTaxids are ordered by highest score
+    SBlastResTaxInfo *m_TaxTreeinfo;        ///< SBlastResTaxInfo structure containing information for all taxids in common tree, intermediate nodes with no hits or only 1 child are removed
+                                            ///< orderedTaxids are ordered by highest score    
+    list <STaxInfo> m_AlnLineageTaxInfo;    ///< STaxInfo structure list contaning info for lineage report ordered by linage display order. All taxids are "mapped" to the best hit linage
+    vector <int> m_BestHitLineage;          ///< vector of <int> containing taxids for the best hit linage
+
+      
+    string m_Rid;    
+    STaxFormatTemplates *m_TaxFormatTemplates; ///<
+    CNcbiIfstream *m_ConfigFile;
+    CNcbiRegistry *m_Reg;
+    string  m_TaxBrowserURL;                ///< Taxonomy Browser URL
+    CTaxon1 *m_TaxClient;                   ///< Taxonomy server client
+
+    bool    m_Debug;
+
+    bool  m_ConnectToTaxServer;
+    bool  m_TaxTreeLoaded;    
+    CRef< ITreeIterator > m_TreeIterator;
+    
+    CTaxFormat::SSeqInfo *x_FillTaxDispParams(const CRef< objects::CBlast_def_line > &bdl,
+                                  const objects::CBioseq_Handle& bsp_handle,
+                                  double bits, 
+                                  double evalue,    
+	                              list<TGi>& use_this_gi);
+
+    CTaxFormat::SSeqInfo *x_FillTaxDispParams(const objects::CBioseq_Handle& bsp_handle,
+                             double bits, 
+                             double evalue);
+                                  
+
+    void x_InitBlastDBTaxInfo(SSeqInfo *seqInfo);
+    void x_InitTaxInfoMap(void);
+
+    void x_InitTaxClient(void); /// Initializes CTaxon1 *m_TaxClient
+
+    void x_LoadTaxTree(void); // Loads tree containing taxids from seqalign in taxonomy client m_TaxClient       
+    
+
+    void x_InitLineageReport(void);
+    void x_InitTaxReport(void);
+
+    void x_InitOrgTaxMetaData(void); // Inits tree containing information for all taxids in common tree (m_TaxTreeinfo)
+    void x_InitLineageMetaData(void); // Inits list contaning info for lineage report ordered by linage display order (m_AlnLineageTaxInfo)
+
+    void x_InitBlastNameTaxInfo(STaxInfo &taxInfo);
+
+    string x_MapSeqTemplate(string seqTemplate, SSeqInfo *seqInfo);
+    string x_MapSeqTemplate(string seqTemplate, STaxInfo &taxInfo);
+    string x_MapTaxInfoTemplate(string tableRowTemplate,STaxInfo &taxInfo,unsigned int depth = 0);
+
+    void x_PrintTaxInfo(vector <int> taxids, string title);       
+    void x_PrintLineage(void);
+};
+
+
+END_SCOPE(align_format)
+END_NCBI_SCOPE
+
+#endif /* OBJTOOLS_ALIGN_FORMAT___TAXFORMAT_HPP */
diff --git a/c++/include/objtools/alnmgr/pairwise_aln.hpp b/c++/include/objtools/alnmgr/pairwise_aln.hpp
index 7494afb..874ca61 100644
--- a/c++/include/objtools/alnmgr/pairwise_aln.hpp
+++ b/c++/include/objtools/alnmgr/pairwise_aln.hpp
@@ -1,6 +1,6 @@
 #ifndef OBJTOOLS_ALNMGR___PAIRWISE_ALN__HPP
 #define OBJTOOLS_ALNMGR___PAIRWISE_ALN__HPP
-/*  $Id: pairwise_aln.hpp 367827 2012-06-28 16:50:47Z grichenk $
+/*  $Id: pairwise_aln.hpp 489532 2016-01-13 16:57:35Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -214,16 +214,32 @@ public:
     }
 
     /// Absolute direction of the first sequence.
+    /// Empty and mixed-strand alignments are iterated in direct order.
     bool IsFirstDirect(void) const
     {
         return m_Direct;
     }
 
 private:
+    friend class CSparse_CI;
+    // Iterate the selected range on the first sequence, allow to force
+    // direct order - to be used by CSparse_CI when one of the rows has
+    // mixed strand while the other one has single.
+    CPairwise_CI(const CPairwiseAln& pairwise,
+                 const TSignedRange& range,
+                 bool force_direct)
+        : m_Aln(&pairwise),
+          m_Direct(force_direct),
+          m_Range(range),
+          m_Unaligned(false)
+    {
+        x_Init(force_direct);
+    }
+
     typedef CPairwiseAln::const_iterator TIterator;
     typedef pair<TIterator, bool> TCheckedIterator;
 
-    void x_Init(void);
+    void x_Init(bool force_direct = false);
     void x_InitSegment(void);
 
     CConstRef<CPairwiseAln> m_Aln;
diff --git a/c++/include/objtools/alnmgr/sparse_aln.hpp b/c++/include/objtools/alnmgr/sparse_aln.hpp
index acc5220..79d1904 100644
--- a/c++/include/objtools/alnmgr/sparse_aln.hpp
+++ b/c++/include/objtools/alnmgr/sparse_aln.hpp
@@ -1,6 +1,6 @@
 #ifndef OBJTOOLS_ALNMGR___SPARSE_ALN__HPP
 #define OBJTOOLS_ALNMGR___SPARSE_ALN__HPP
-/*  $Id: sparse_aln.hpp 419906 2013-12-02 16:51:33Z grichenk $
+/*  $Id: sparse_aln.hpp 498721 2016-04-19 13:29:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -284,6 +284,7 @@ protected:
 
     void x_Build(const CAnchoredAln& src_align);
     CSeqVector& x_GetSeqVector(TNumrow row) const;
+    int x_GetGenCode(TNumrow row) const;
 
     typedef CAnchoredAln::TPairwiseAlnVector TPairwiseAlnVector;
 
diff --git a/c++/include/objtools/blast/blastdb_format/blastdb_seqid.hpp b/c++/include/objtools/blast/blastdb_format/blastdb_seqid.hpp
index 1358a0e..b024f30 100644
--- a/c++/include/objtools/blast/blastdb_format/blastdb_seqid.hpp
+++ b/c++/include/objtools/blast/blastdb_format/blastdb_seqid.hpp
@@ -1,4 +1,4 @@
-/*  $Id: blastdb_seqid.hpp 443490 2014-08-14 19:35:29Z vasilche $
+/*  $Id: blastdb_seqid.hpp 496013 2016-03-23 11:31:35Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -51,12 +51,12 @@ public:
     /// Constructor which takes a string as input, can be a GI, accession,
     /// NCBI Seq-id
     /// @param entry string to parse [in]
-    CBlastDBSeqId(const string& entry) : m_OID(kInvalid), m_EntryChoice(eNone) 
+    CBlastDBSeqId(const string& entry) : m_OID(kInvalid), m_EntryChoice(eNone)
     {
-        try { 
-            m_EntrySpecified.m_GI = NStr::StringToInt(entry); 
+        try {
+            m_EntrySpecified.m_GI = NStr::StringToLong(entry);
             m_EntryChoice = eGi;
-            return; 
+            return;
         } catch (...) {}
         m_EntrySpecified.m_SequenceId = new string(entry);
         m_EntryChoice = eSeqId;
@@ -148,7 +148,7 @@ private:
         eGi,    ///< GI
         eSeqId  ///< Sequence identifier as string
     };
-    /// Choice of entry set, only valid if 
+    /// Choice of entry set, only valid if
     EEntryChoices m_EntryChoice;
 
     /// Union to hold the memory of the data stored
@@ -166,7 +166,7 @@ private:
             m_EntryChoice = rhs.m_EntryChoice;
             if (IsStringId()) {
                 _ASSERT(rhs.m_EntrySpecified.m_SequenceId);
-                m_EntrySpecified.m_SequenceId = 
+                m_EntrySpecified.m_SequenceId =
                     new string(*rhs.m_EntrySpecified.m_SequenceId);
             } else {
                 m_EntrySpecified = rhs.m_EntrySpecified;
diff --git a/c++/include/objtools/blast/seqdb_reader/impl/seqdbatlas.hpp b/c++/include/objtools/blast/seqdb_reader/impl/seqdbatlas.hpp
index fd41afa..7232181 100644
--- a/c++/include/objtools/blast/seqdb_reader/impl/seqdbatlas.hpp
+++ b/c++/include/objtools/blast/seqdb_reader/impl/seqdbatlas.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_READERS_SEQDB__SEQDBATLAS_HPP
 #define OBJTOOLS_READERS_SEQDB__SEQDBATLAS_HPP
 
-/*  $Id: seqdbatlas.hpp 463291 2015-03-26 14:57:38Z rackerst $
+/*  $Id: seqdbatlas.hpp 484524 2015-11-12 15:32:31Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -205,7 +205,7 @@ class CSeqDBMemLease;
 /// destructor of this object will call Unlock() on the atlas if this
 /// thread has it locked.
 
-class CSeqDBLockHold {
+class NCBI_XOBJREAD_EXPORT CSeqDBLockHold {
 public:
     /// Constructor
     ///
@@ -1191,9 +1191,9 @@ private:
 /// various SeqDB critical regions, some of which are outside of this
 /// class.  ["Atlas: n. 1. A book or bound collection of maps..."; The
 /// American Heritage Dictionary of the English Language, 4th Edition.
-/// Copyright � 2000 by Houghton Mifflin Company.]
+/// Copyright (c) 2000 by Houghton Mifflin Company.]
 
-class CSeqDBAtlas {
+class NCBI_XOBJREAD_EXPORT CSeqDBAtlas {
 public:
     /// The type used for file offsets.
     typedef CRegionMap::TIndx TIndx;
@@ -1941,7 +1941,7 @@ private:
     /// of a fast region lookup table (m_Recent).  Existing entries in
     /// the table will move down one slot.  If the new entry already
     /// exists somewhere else in the table, it will be removed from
-    /// that point (and only entries between that point and the top of
+    /// that point, and only entries between that point and the top of
     /// the table will need to move.  If all slots in the table are
     /// used, the last entry will simply be dropped.
     ///
@@ -1952,18 +1952,22 @@ private:
         if (m_Recent[0] == r)
             return;
 
-        int found_at = eNumRecent-1;
+        Uint4 found_at = eNumRecent - 1;
 
-        for(int i = 0; i < eNumRecent-1; i++) {
+        for(Uint4 i = 0; i < (eNumRecent - 1); ++i) {
             if (m_Recent[i] == r) {
                 found_at = i;
                 break;
             }
         }
 
-        while(found_at) {
-            m_Recent[found_at] = m_Recent[found_at-1];
-            found_at --;
+        // NOTE: The second conditional below SHOULDN'T be necessary if
+        // you read through the code above.  However, g++ doesn't trust it
+        // without the "<" condition and issues a warning:
+        // "array subscript is above array bounds"
+        while(found_at > 0  &&  found_at < eNumRecent) {
+            m_Recent[found_at] = m_Recent[found_at - 1];
+            --found_at;
         }
 
         m_Recent[0] = r;
diff --git a/c++/include/objtools/blast/seqdb_reader/impl/seqdbgeneral.hpp b/c++/include/objtools/blast/seqdb_reader/impl/seqdbgeneral.hpp
index 0397d71..4c67ef3 100644
--- a/c++/include/objtools/blast/seqdb_reader/impl/seqdbgeneral.hpp
+++ b/c++/include/objtools/blast/seqdb_reader/impl/seqdbgeneral.hpp
@@ -1,7 +1,7 @@
 #ifndef CORELIB__SEQDB__SEQDBGENERAL_HPP
 #define CORELIB__SEQDB__SEQDBGENERAL_HPP
 
-/*  $Id: seqdbgeneral.hpp 480560 2015-10-01 16:50:48Z ivanov $
+/*  $Id: seqdbgeneral.hpp 480259 2015-09-29 14:58:22Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/blast/seqdb_reader/impl/seqdbisam.hpp b/c++/include/objtools/blast/seqdb_reader/impl/seqdbisam.hpp
index 5c04ceb..81945a7 100644
--- a/c++/include/objtools/blast/seqdb_reader/impl/seqdbisam.hpp
+++ b/c++/include/objtools/blast/seqdb_reader/impl/seqdbisam.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_READERS_SEQDB__SEQDBISAM_HPP
 #define OBJTOOLS_READERS_SEQDB__SEQDBISAM_HPP
 
-/*  $Id: seqdbisam.hpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbisam.hpp 482066 2015-10-20 15:12:08Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -124,7 +124,7 @@ s_SetTranslation(CSeqDBGiList & gis,
 /// these files, including one whose name ends in 'i' and one whose
 /// name ends in 'd'.
 
-class CSeqDBIsam : public CObject {
+class NCBI_XOBJREAD_EXPORT CSeqDBIsam : public CObject {
 public:
     /// Import the type representing one GI, OID association.
     typedef CSeqDBGiList::SGiOid TGiOid;
diff --git a/c++/include/objtools/blast/seqdb_reader/impl/seqdbvol.hpp b/c++/include/objtools/blast/seqdb_reader/impl/seqdbvol.hpp
index 2f3d3ed..1e3432f 100644
--- a/c++/include/objtools/blast/seqdb_reader/impl/seqdbvol.hpp
+++ b/c++/include/objtools/blast/seqdb_reader/impl/seqdbvol.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_READERS_SEQDB__SEQDBVOL_HPP
 #define OBJTOOLS_READERS_SEQDB__SEQDBVOL_HPP
 
-/*  $Id: seqdbvol.hpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbvol.hpp 481389 2015-10-09 14:40:20Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/blast/seqdb_reader/seqdbcommon.hpp b/c++/include/objtools/blast/seqdb_reader/seqdbcommon.hpp
index b50cf83..c14a4af 100644
--- a/c++/include/objtools/blast/seqdb_reader/seqdbcommon.hpp
+++ b/c++/include/objtools/blast/seqdb_reader/seqdbcommon.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_BLAST_SEQDB_READER___SEQDBCOMMON__HPP
 #define OBJTOOLS_BLAST_SEQDB_READER___SEQDBCOMMON__HPP
 
-/*  $Id: seqdbcommon.hpp 484802 2015-11-16 15:18:41Z ivanov $
+/*  $Id: seqdbcommon.hpp 484374 2015-11-10 16:37:43Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -359,7 +359,7 @@ public:
     }
 
     template <class T>
-    const T & GetKey(int index) const
+    const T GetKey(int index) const
     {
         return m_GisOids[index].gi;
     }
@@ -450,7 +450,7 @@ inline int CSeqDBGiList::GetSize<TTi>() const
 }
 
 template < >
-inline const TTi & CSeqDBGiList::GetKey<TTi>(int index) const
+inline const TTi CSeqDBGiList::GetKey<TTi>(int index) const
 {
     return m_TisOids[index].ti;
 }
@@ -474,7 +474,7 @@ inline int CSeqDBGiList::GetSize<string>() const
 }
 
 template < >
-inline const string & CSeqDBGiList::GetKey<string>(int index) const
+inline const string CSeqDBGiList::GetKey<string>(int index) const
 {
     return m_SisOids[index].si;
 }
diff --git a/c++/include/objtools/blast/seqdb_reader/seqdbexpert.hpp b/c++/include/objtools/blast/seqdb_reader/seqdbexpert.hpp
index 26cc440..5f8eb65 100644
--- a/c++/include/objtools/blast/seqdb_reader/seqdbexpert.hpp
+++ b/c++/include/objtools/blast/seqdb_reader/seqdbexpert.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_BLAST_SEQDB_READER___SEQDBEXPERT__HPP
 #define OBJTOOLS_BLAST_SEQDB_READER___SEQDBEXPERT__HPP
 
-/*  $Id: seqdbexpert.hpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbexpert.hpp 481389 2015-10-09 14:40:20Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/blast/seqdb_writer/build_db.hpp b/c++/include/objtools/blast/seqdb_writer/build_db.hpp
index 3a99dd2..52a40f5 100644
--- a/c++/include/objtools/blast/seqdb_writer/build_db.hpp
+++ b/c++/include/objtools/blast/seqdb_writer/build_db.hpp
@@ -1,4 +1,4 @@
-/*  $Id: build_db.hpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: build_db.hpp 485504 2015-11-23 14:41:02Z rackerst $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -229,8 +229,10 @@ public:
     /// sequences added to the database.
     ///
     /// @param src_db The source database. [in]
-    void SetLinkouts(const TLinkoutMap & linkouts,
-                     bool                keep_links);
+    NCBI_DEPRECATED void SetLinkouts(
+            const TLinkoutMap & linkouts,
+            bool                keep_links
+    );
 
     /// Specify a membership bit lookup object.
     ///
@@ -238,8 +240,16 @@ public:
     /// data for sequences added to the database.
     ///
     /// @param src_db The source database. [in]
-    void SetMembBits(const TLinkoutMap & membbits,
-                     bool                keep_mbits);
+    void SetMembBits(
+            const TLinkoutMap & membbits,
+            bool                keep_mbits
+    );
+
+    /// Specify a leaf-taxids object.
+    void SetLeafTaxIds(
+            const TIdToLeafs& taxids,
+            bool              keep_taxids
+    );
 
     /// Build the database.
     ///
@@ -507,7 +517,7 @@ private:
     /// @return True if all sequences were resolved.
     bool x_ReportUnresolvedIds(const CInputGiList & gi_list) const;
 
-    /// Store linkout and membership bits in provided headers.
+    /// Store linkout (now deprecated) and membership bits in provided headers.
     ///
     /// Each Seq-id found in each defline in the provided headers will
     /// be looked up in the set of linkout and membership bits
@@ -517,6 +527,11 @@ private:
     /// @param headers These deflines will be modified. [in|out]
     void x_SetLinkAndMbit(CRef<objects::CBlast_def_line_set> headers);
 
+    /// Store leaf taxids in provided headers.
+    ///
+    /// @param headers These deflines will be modified. [in|out]
+    void x_SetLeafTaxids(CRef<objects::CBlast_def_line_set> headers);
+
     /// Fetch a sequence from the remote service and add it to the db.
     ///
     /// The provided Seq-id will be used to fetch a Bioseq remotely,
@@ -551,9 +566,11 @@ private:
     bool m_IsProtein;
 
     /// True to keep linkout bits from source dbs, false to discard.
+    /// DEPRECATED
     bool m_KeepLinks;
 
     /// Table of linkout bits to apply to sequences.
+    /// DEPRECATED
     TIdToBits m_Id2Links;
 
     /// True to keep membership bits from source dbs, false to discard.
@@ -562,6 +579,12 @@ private:
     /// Table of membership bits to apply to sequences.
     TIdToBits m_Id2Mbits;
 
+    /// True to keep leaf taxids from source dbs, false to discard.
+    bool m_KeepLeafs;
+
+    /// Table of leaf taxids to apply to sequences.
+    TIdToLeafs m_Id2Leafs;
+
     /// Object manager, used for remote fetching.
     CRef<objects::CObjectManager>  m_ObjMgr;
 
diff --git a/c++/include/objtools/blast/seqdb_writer/multisource_util.hpp b/c++/include/objtools/blast/seqdb_writer/multisource_util.hpp
index 1aa241e..cf4b0d4 100644
--- a/c++/include/objtools/blast/seqdb_writer/multisource_util.hpp
+++ b/c++/include/objtools/blast/seqdb_writer/multisource_util.hpp
@@ -1,4 +1,4 @@
-/*  $Id: multisource_util.hpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: multisource_util.hpp 485504 2015-11-23 14:41:02Z rackerst $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -162,7 +162,10 @@ private:
 };
 
 /// Maps Seq-id key to bitset.
-typedef map< string, int > TIdToBits;
+typedef map<string, int> TIdToBits;
+
+/// Map from Seq-id string to set of leaf taxids.
+typedef map<string, CBlast_def_line::TTaxIds> TIdToLeafs;
 
 /// Map from linkout bit number to list of ids.
 typedef map<int, vector<string> > TLinkoutMap;
diff --git a/c++/include/objtools/blast/seqdb_writer/writedb.hpp b/c++/include/objtools/blast/seqdb_writer/writedb.hpp
index bad4d70..72af6c9 100644
--- a/c++/include/objtools/blast/seqdb_writer/writedb.hpp
+++ b/c++/include/objtools/blast/seqdb_writer/writedb.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_BLAST_SEQDB_WRITER___WRITEDB__HPP
 #define OBJTOOLS_BLAST_SEQDB_WRITER___WRITEDB__HPP
 
-/*  $Id: writedb.hpp 480972 2015-10-06 12:06:22Z ivanov $
+/*  $Id: writedb.hpp 480531 2015-10-01 15:03:55Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/cleanup/cleanup.hpp b/c++/include/objtools/cleanup/cleanup.hpp
index 3e3a77b..e8a6bc9 100644
--- a/c++/include/objtools/cleanup/cleanup.hpp
+++ b/c++/include/objtools/cleanup/cleanup.hpp
@@ -1,7 +1,7 @@
 #ifndef CLEANUP___CLEANUP__HPP
 #define CLEANUP___CLEANUP__HPP
 
-/*  $Id: cleanup.hpp 480959 2015-10-06 12:01:57Z ivanov $
+/*  $Id: cleanup.hpp 500220 2016-05-03 14:56:08Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -36,6 +36,9 @@
 #include <objmgr/scope.hpp>
 #include <objtools/cleanup/cleanup_change.hpp>
 #include <objects/seq/MolInfo.hpp>
+#include <objects/pub/Pub.hpp>
+#include <objects/seqfeat/Cdregion.hpp>
+
 
 BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
@@ -46,6 +49,8 @@ class CBioseq_set;
 class CSeq_annot;
 class CSeq_feat;
 class CSeq_submit;
+class COrgName;
+
 
 class CSeq_entry_Handle;
 class CBioseq_Handle;
@@ -75,7 +80,6 @@ public:
     
     // BASIC CLEANUP
     
-    /// Cleanup a Seq-entry. 
     CConstRef<CCleanupChange> BasicCleanup(CSeq_entry& se,  Uint4 options = 0);
     /// Cleanup a Seq-submit. 
     CConstRef<CCleanupChange> BasicCleanup(CSeq_submit& ss,  Uint4 options = 0);
@@ -110,12 +114,21 @@ public:
 
     // Useful cleanup functions
 
+    static bool ShouldStripPubSerial(const CBioseq& bs);
+
+
 /// Moves protein-specific features from nucleotide sequences in the Seq-entry to
 /// the appropriate protein sequence.
 /// @param seh Seq-entry Handle to edit [in]
 /// @return Boolean return value indicates whether any changes were made
     static bool MoveProteinSpecificFeats(CSeq_entry_Handle seh);
 
+    /// Moves one feature from nucleotide bioseq to
+    /// the appropriate protein sequence.
+    /// @param fh Feature to edit
+    /// @return Boolean return value indicates whether any changes were made
+    static bool MoveFeatToProtein(CSeq_feat_Handle fh);
+
 /// Calculates whether a Gene-xref is unnecessary (because it refers to the
 /// same gene as would be calculated using overlap)
 /// @param sf Seq-feat with the xref [in]
@@ -166,6 +179,75 @@ public:
 /// @return Boolean return value indicates whether gene-xrefs were removed
     static bool RemoveOrphanLocus_tagGeneXrefs(CSeq_feat& f, CBioseq_Handle bsh);
 
+/// Extends a coding region up to 50 nt. if the coding region:
+/// 1. does not end with a stop codon
+/// 2. is adjacent to a stop codon
+/// 3. is not pseudo
+/// @param f Seq-feat to edit
+/// @param bsh CBioseq_Handle on which the feature is located
+/// @return Boolean return value indicates whether the feature was extended
+    static bool ExtendToStopIfShortAndNotPartial(CSeq_feat& f, CBioseq_Handle bsh, bool check_for_stop = true);
+
+
+/// Extends a feature up to limit nt to a stop codon, or to the end of the sequence
+/// if limit == 0 (partial will be set if location extends to end of sequence but
+/// no stop codon is found)
+/// @param f Seq-feat to edit
+/// @param bsh CBioseq_Handle on which the feature is located
+/// @param limit maximum number of nt to extend, or 0 if unlimited
+/// @return Boolean return value indicates whether the feature was extended
+    static bool ExtendToStopCodon(CSeq_feat& f, CBioseq_Handle bsh, size_t limit, CCdregion::TFrame frame = CCdregion::eFrame_not_set);
+
+/// Translates coding region and selects best frame (without stops, or longest)
+/// @param cds Coding region Seq-feat to edit
+/// @param scope Scope in which to find coding region
+/// @return Boolean return value indicates whether the coding region was changed
+    static bool SetBestFrame(CSeq_feat& cds, CScope& scope);
+
+/// Chooses best frame based on location
+/// 1.	If the location is 5� complete, then the frame must be one.
+/// 2.	If the location is 5' partial and 3� complete, select a frame using the
+///      value of the location length modulo 3.
+/// @param cdregion Coding Region in which to set frame
+/// @param loc      Location to use for setting frame
+/// @param scope    Scope in which to find location sequence(s)
+/// @return Boolean return value indicates whether the frame was changed
+    static bool SetFrameFromLoc(CCdregion &cdregion, const CSeq_loc& loc, CScope& scope);
+    static bool SetFrameFromLoc(CCdregion::EFrame &frame, const CSeq_loc& loc, CScope& scope);
+
+/// 1. Set the partial flags when the CDS is partial and codon_start is 2 or 3
+/// 2. Make the CDS partial at the 5' end if there is no start codon
+/// 3. Make the CDS partial at the 3' end if there is no stop codon
+/// @param cds Coding region Seq-feat to edit
+/// @param scope Scope in which to find coding region and coding region's protein
+///        product sequence
+/// @return Boolean return value indicates whether the coding region changed
+    static bool SetCDSPartialsByFrameAndTranslation(CSeq_feat& cds, CScope& scope);
+
+/// Update EC numbers
+/// @param ec_num_list Prot-ref ec number list to clean
+/// @return Boolean value indicates whether any changes were made
+    static bool UpdateECNumbers(CProt_ref::TEc & ec_num_list);
+
+/// Set partialness of gene to match longest feature contained in gene
+/// @param gene  Seq-feat to edit
+/// @param scope Scope in which to find gene
+/// @return Boolean return value indicates whether the gene changed
+    static bool SetGenePartialByLongestContainedFeature(CSeq_feat& gene, CScope& scope);
+
+    static void SetProteinName(CProt_ref& prot, const string& protein_name, bool append);
+    static void SetProteinName(CSeq_feat& cds, const string& protein_name, bool append, CScope& scope);
+    static const string& GetProteinName(const CProt_ref& prot);
+    static const string& GetProteinName(const CSeq_feat& cds, CScope& scope);
+
+/// Checks to see if a feature is pseudo. Looks for pseudo flag set on feature,
+/// looks for pseudogene qualifier on feature, performs same checks for gene
+/// associated with feature
+/// @param feat Seq-feat to check
+/// @param scope CScope to use when looking for associated gene
+/// @return Boolean return value indicates whether any of the "pseudo" markers are found
+    static bool IsPseudo(const CSeq_feat& feat, CScope& scope);
+
 /// Sets MolInfo::tech for a sequence
 /// @param seq Bioseq to edit
 /// @param tech tech value to set
@@ -199,6 +281,23 @@ public:
 /// @return Boolean return value indicates whether object was updated
     static bool TaxonomyLookup(CSeq_entry_Handle seh);
 
+
+/// Sets genetic codes for coding regions on Bioseq-Handle
+/// @param Bioseq-Handle to examine
+/// @return Boolean indicates whether any coding regions were updated
+    static bool SetGeneticCodes(CBioseq_Handle bsh);
+
+/// Adjusts protein title to reflect partialness
+/// @param Bioseq to adjust
+/// @return Boolean indicates whether title was updated
+    static bool AddPartialToProteinTitle(CBioseq &bioseq);
+
+/// Removes protein product from pseudo coding region
+/// @param cds Seq-feat to adjust
+/// @param scope Scope in which to find protein sequence and remove it
+/// @return Boolean indicates whether anything changed
+    static bool RemovePseudoProduct(CSeq_feat& cds, CScope& scope);
+
 /// Performs WGS specific cleanup
 /// @param entry Seq-entry to edit
 /// @return Boolean return value indicates whether object was updated
@@ -210,17 +309,109 @@ public:
     static bool NormalizeDescriptorOrder(CSeq_descr& descr);
 
 /// Normalize Descriptor Order on a specific Seq-entry
-/// @param entry Seq-entry to edit
+/// @param seh Seq-entry-Handle to edit
 /// @return Boolean return value indicates whether object was updated
     static bool NormalizeDescriptorOrder(CSeq_entry_Handle seh);
 
+/// Remove all titles in Seqdescr except the last, because it is the
+/// only one that would be displayed in the flatfile
+/// @param seq Bioseq-Handle to edit
+/// @return Boolean return value indicates whether any titles were removed
+    static bool RemoveUnseenTitles(CSeq_entry_EditHandle::TSeq seq);
+
+/// Remove all titles in Seqdescr except the last, because it is the
+/// only one that would be displayed in the flatfile
+/// @param set Bioseq-set-Handle to edit
+/// @return Boolean return value indicates whether any titles were removed
+    static bool RemoveUnseenTitles(CSeq_entry_EditHandle::TSet set);
+
+/// Add GenBank Wrapper Set
+/// @param entry Seq-entry to edit
+/// @return Boolean return value indicates whether object changed
+    static bool AddGenBankWrapper(CSeq_entry_Handle seh);
+
+
+/// For Publication Citations
+/// Get labels for a pubdesc. To be used in citations.
+    static void GetPubdescLabels
+        (const CPubdesc& pd,
+        vector<int>& pmids, vector<int>& muids, vector<int>& serials,
+        vector<string>& published_labels, vector<string>& unpublished_labels);
+
+/// Get list of pubs that can be used for citations for Seq-feat on a Bioseq-handle
+/// @param bsh Bioseq-handle to search
+/// @return vector<CConstRef<CPub> > ordered list of pubs
+/// Note that Seq-feat.cit appear in the flatfile using the position
+/// in the list
+    static vector<CConstRef<CPub> > GetCitationList(CBioseq_Handle bsh);
+
+/// Remove duplicate publications
+    static bool RemoveDuplicatePubs(CSeq_descr& descr);
+
+    /// Some pubs should not be promoted to nuc-prot set from sequence
+    static bool OkToPromoteNpPub(const CPubdesc& pd);
+
+    /// For some sequences, pubs should not be promoted to nuc-prot set from sequence
+    static bool OkToPromoteNpPub(const CBioseq& b);
+
+    static bool PubAlreadyInSet(const CPubdesc& pd, const CSeq_descr& descr);
+
+/// Convert full-length publication features to publication descriptors.
+/// @param seh Seq-entry to edit
+/// @return bool indicates whether any changes were made
+    static bool ConvertPubFeatsToPubDescs(CSeq_entry_Handle seh);
+    
+/// Rescue pubs from Site-ref features
+/// @param seh Seq-entry to edit
+/// @return bool indicates whether any changes were made
+    static bool RescueSiteRefPubs(CSeq_entry_Handle seh);
+
+    //helper function for moving feature to pubdesc descriptor
+    static void MoveOneFeatToPubdesc(CSeq_feat_Handle feat, CRef<CSeqdesc> d, CBioseq_Handle b, bool remove_feat = true);
+
+/// Remove duplicate biosource descriptors
+    static bool RemoveDupBioSource(CSeq_descr& descr);
+
+/// Get BioSource from feature to use for source descriptor
+    static CRef<CBioSource> BioSrcFromFeat(const CSeq_feat& f);
+
+    static bool AreBioSourcesMergeable(const CBioSource& src1, const CBioSource& src2);
+    static bool MergeDupBioSources(CSeq_descr& descr);
+    static bool MergeDupBioSources(CBioSource& src1, const CBioSource& add);
+
+
+/// Convert full-length source features to source descriptors
+/// @param seh Seq-entry to edit
+/// @return bool indicates whether any changes were made
+    static bool ConvertSrcFeatsToSrcDescs(CSeq_entry_Handle seh);
+
+    static CConstRef <CSeq_feat> GetGeneForFeature(const CSeq_feat& feat, CScope& scope);
+
+/// Examine all genes and gene xrefs in the Seq-entry.
+/// If no genes have locus and some have locus tag AND no gene xrefs have locus-tag
+/// and some gene xrefs have locus, change all gene xrefs to use locus tag.
+/// If no genes have locus tag and some have locus AND no gene xrefs have locus
+/// and some gene xrefs have locus tag, change all gene xrefs to use locus.
+/// @param seh Seq-entry to edit
+/// @return bool indicates whether any changes were made
+    static bool FixGeneXrefSkew(CSeq_entry_Handle seh);
+
+/// Convert nuc-prot sets with just one sequence to just the sequence
+/// can't be done during the explore phase because it changes a seq to a set
+/// @param seh Seq-entry to edit
+/// @return bool indicates whether any changes were made
+    static bool RenormalizeNucProtSets(CSeq_entry_Handle seh);
 
 private:
     // Prohibit copy constructor & assignment operator
     CCleanup(const CCleanup&);
     CCleanup& operator= (const CCleanup&);
 
-    CScope*            m_Scope;
+    CRef<CScope>            m_Scope;
+
+    static bool x_MergeDupOrgNames(COrgName& on1, const COrgName& add);
+    static bool x_MergeDupOrgRefs(COrg_ref& org1, const COrg_ref& add);
+
 };
 
 
diff --git a/c++/include/objtools/cleanup/newcleanup.hpp b/c++/include/objtools/cleanup/newcleanup.hpp
index b426562..8292bd1 100755
--- a/c++/include/objtools/cleanup/newcleanup.hpp
+++ b/c++/include/objtools/cleanup/newcleanup.hpp
@@ -286,8 +286,6 @@ private:
 
     string x_ExtractSatelliteFromComment( string &comment );
 
-    void x_SetFrameFromLoc( CCdregion &cdregion, const CSeq_loc &location );
-
     void x_CleanupECNumber( string &ec_num );
 
     void x_CleanupAndRepairInference( string &inference );
diff --git a/c++/include/objtools/data_loaders/genbank/cache/reader_cache.hpp b/c++/include/objtools/data_loaders/genbank/cache/reader_cache.hpp
index 744551a..1cd9aac 100644
--- a/c++/include/objtools/data_loaders/genbank/cache/reader_cache.hpp
+++ b/c++/include/objtools/data_loaders/genbank/cache/reader_cache.hpp
@@ -1,7 +1,7 @@
 #ifndef READER_CACHE__HPP_INCLUDED
 #define READER_CACHE__HPP_INCLUDED
 
-/*  $Id: reader_cache.hpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: reader_cache.hpp 485218 2015-11-19 15:34:31Z vasilche $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -79,6 +79,10 @@ struct NCBI_XREADER_CACHE_EXPORT SCacheInfo
     static const char* GetTaxIdSubkey(void);
     // Seq-id -> hash (1 int)
     static const char* GetHashSubkey(void);
+    // Seq-id -> length (1 uint)
+    static const char* GetLengthSubkey(void);
+    // Seq-id -> type (1 byte)
+    static const char* GetTypeSubkey(void);
     // Seq-id -> list of Seq-id, binary ASN.1
     static const char* GetSeq_idsSubkey(void);
     // blob_id -> blob state (1 int)
@@ -167,6 +171,10 @@ public:
                          const CSeq_id_Handle& seq_id);
     bool LoadSequenceHash(CReaderRequestResult& result,
                           const CSeq_id_Handle& seq_id);
+    bool LoadSequenceLength(CReaderRequestResult& result,
+                            const CSeq_id_Handle& seq_id);
+    bool LoadSequenceType(CReaderRequestResult& result,
+                          const CSeq_id_Handle& seq_id);
     bool LoadSeq_idBlob_ids(CReaderRequestResult& result,
                             const CSeq_id_Handle& seq_id,
                             const SAnnotSelector* sel);
diff --git a/c++/include/objtools/data_loaders/genbank/cache/writer_cache.hpp b/c++/include/objtools/data_loaders/genbank/cache/writer_cache.hpp
index 121f46d..69a984b 100644
--- a/c++/include/objtools/data_loaders/genbank/cache/writer_cache.hpp
+++ b/c++/include/objtools/data_loaders/genbank/cache/writer_cache.hpp
@@ -1,7 +1,7 @@
 #ifndef WRITER_CACHE__HPP_INCLUDED
 #define WRITER_CACHE__HPP_INCLUDED
 
-/*  $Id: writer_cache.hpp 468561 2015-05-26 15:57:12Z vasilche $
+/*  $Id: writer_cache.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -49,10 +49,6 @@ class NCBI_XREADER_CACHE_EXPORT CCacheWriter : public CWriter,
 public:
     CCacheWriter(void);
 
-    virtual void SaveStringSeq_ids(CReaderRequestResult& result,
-                                   const string& seq_id);
-    virtual void SaveStringGi(CReaderRequestResult& result,
-                              const string& seq_id);
     virtual void SaveSeq_idSeq_ids(CReaderRequestResult& result,
                                    const CSeq_id_Handle& seq_id);
     virtual void SaveSeq_idGi(CReaderRequestResult& result,
@@ -65,6 +61,10 @@ public:
                                  const CSeq_id_Handle& seq_id);
     virtual void SaveSequenceHash(CReaderRequestResult& result,
                                   const CSeq_id_Handle& seq_id);
+    virtual void SaveSequenceLength(CReaderRequestResult& result,
+                                    const CSeq_id_Handle& seq_id);
+    virtual void SaveSequenceType(CReaderRequestResult& result,
+                                  const CSeq_id_Handle& seq_id);
     virtual void SaveSeq_idBlob_ids(CReaderRequestResult& result,
                                     const CSeq_id_Handle& seq_id,
                                     const SAnnotSelector* sel);
@@ -111,6 +111,11 @@ protected:
                 return m_Ptr - m_Buffer;
             }
         void CheckSpace(size_t size);
+        void StoreBool(bool v)
+            {
+                CheckSpace(1);
+                x_StoreUint1(v);
+            }
         void StoreUint4(Uint4 v)
             {
                 CheckSpace(4);
@@ -146,6 +151,11 @@ protected:
                 m_Ptr[3] = v;
                 m_Ptr += 4;
             }
+        void x_StoreUint1(Uint1 v)
+            {
+                m_Ptr[0] = v;
+                m_Ptr += 1;
+            }
 
     private:
         CStoreBuffer(const CStoreBuffer&);
diff --git a/c++/include/objtools/data_loaders/genbank/gbloader.hpp b/c++/include/objtools/data_loaders/genbank/gbloader.hpp
index 88ade5e..d954c75 100644
--- a/c++/include/objtools/data_loaders/genbank/gbloader.hpp
+++ b/c++/include/objtools/data_loaders/genbank/gbloader.hpp
@@ -1,7 +1,7 @@
 #ifndef GBLOADER__HPP_INCLUDED
 #define GBLOADER__HPP_INCLUDED
 
-/*  $Id: gbloader.hpp 475892 2015-08-12 18:52:12Z vasilche $
+/*  $Id: gbloader.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -186,25 +186,27 @@ public:
     virtual void DropTSE(CRef<CTSE_Info> tse_info);
 
     virtual void GetIds(const CSeq_id_Handle& idh, TIds& ids);
-    virtual CSeq_id_Handle GetAccVer(const CSeq_id_Handle& idh);
-    virtual TGi GetGi(const CSeq_id_Handle& idh);
+    virtual SAccVerFound GetAccVerFound(const CSeq_id_Handle& idh);
+    virtual SGiFound GetGiFound(const CSeq_id_Handle& idh);
     virtual string GetLabel(const CSeq_id_Handle& idh);
     virtual int GetTaxId(const CSeq_id_Handle& idh);
     virtual int GetSequenceState(const CSeq_id_Handle& idh);
-    virtual int GetSequenceHash(const CSeq_id_Handle& idh);
+    virtual SHashFound GetSequenceHashFound(const CSeq_id_Handle& idh);
+    virtual TSeqPos GetSequenceLength(const CSeq_id_Handle& sih);
+    virtual STypeFound GetSequenceTypeFound(const CSeq_id_Handle& sih);
 
     virtual void GetAccVers(const TIds& ids, TLoaded& loader, TIds& ret);
     virtual void GetGis(const TIds& ids, TLoaded& loader, TGis& ret);
     virtual void GetLabels(const TIds& ids, TLoaded& loader, TLabels& ret);
     virtual void GetTaxIds(const TIds& ids, TLoaded& loader, TTaxIds& ret);
-    virtual void GetSequenceLengths(const TIds& ids, TLoaded& loaded,
-                                    TSequenceLengths& ret);
-    virtual void GetSequenceTypes(const TIds& ids, TLoaded& loaded,
-                                  TSequenceTypes& ret);
     virtual void GetSequenceStates(const TIds& ids, TLoaded& loader,
                                    TSequenceStates& ret);
     virtual void GetSequenceHashes(const TIds& ids, TLoaded& loader,
-                                   TSequenceHashes& ret);
+                                   TSequenceHashes& ret, THashKnown& known);
+    virtual void GetSequenceLengths(const TIds& ids, TLoaded& loader,
+                                    TSequenceLengths& ret);
+    virtual void GetSequenceTypes(const TIds& ids, TLoaded& loader,
+                                  TSequenceTypes& ret);
 
     virtual TTSE_LockSet GetRecords(const CSeq_id_Handle& idh,
                                     EChoice choice);
diff --git a/c++/include/objtools/data_loaders/genbank/gbloader_params.h b/c++/include/objtools/data_loaders/genbank/gbloader_params.h
index 543711d..a605bbe 100644
--- a/c++/include/objtools/data_loaders/genbank/gbloader_params.h
+++ b/c++/include/objtools/data_loaders/genbank/gbloader_params.h
@@ -1,7 +1,7 @@
 #ifndef GBLOADER_PARAMS__HPP_INCLUDED
 #define GBLOADER_PARAMS__HPP_INCLUDED
 
-/*  $Id: gbloader_params.h 475892 2015-08-12 18:52:12Z vasilche $
+/*  $Id: gbloader_params.h 475861 2015-08-12 15:33:37Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/data_loaders/genbank/gicache/reader_gicache.hpp b/c++/include/objtools/data_loaders/genbank/gicache/reader_gicache.hpp
index 059c2a2..0a014c1 100644
--- a/c++/include/objtools/data_loaders/genbank/gicache/reader_gicache.hpp
+++ b/c++/include/objtools/data_loaders/genbank/gicache/reader_gicache.hpp
@@ -1,7 +1,7 @@
 #ifndef READER_GICACHE__HPP_INCLUDED
 #define READER_GICACHE__HPP_INCLUDED
 
-/*  $Id: reader_gicache.hpp 440703 2014-07-16 15:38:41Z vasilche $
+/*  $Id: reader_gicache.hpp 484420 2015-11-10 19:50:38Z ucko $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -32,12 +32,13 @@
 
 #include <objtools/data_loaders/genbank/reader.hpp>
 #include <corelib/ncbimtx.hpp>
+#include <connect/ncbi_core_cxx.hpp>
 
 BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
 
 
-class NCBI_XREADER_GICACHE_EXPORT CGICacheReader : public CReader
+class NCBI_XREADER_GICACHE_EXPORT CGICacheReader : public CReader, protected CConnIniter
 {
 public:
     CGICacheReader(void);
diff --git a/c++/include/objtools/data_loaders/genbank/impl/dispatcher.hpp b/c++/include/objtools/data_loaders/genbank/impl/dispatcher.hpp
index 74118f7..9d571b5 100644
--- a/c++/include/objtools/data_loaders/genbank/impl/dispatcher.hpp
+++ b/c++/include/objtools/data_loaders/genbank/impl/dispatcher.hpp
@@ -2,7 +2,7 @@
 #define DISPATCHER__HPP_INCLUDED
 /* */
 
-/*  $Id: dispatcher.hpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: dispatcher.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -83,8 +83,6 @@ public:
         return !sih || sih.Which() == CSeq_id::e_Local;
     }
 
-    void LoadStringSeq_ids(CReaderRequestResult& result,
-                           const string& seq_id);
     void LoadSeq_idBlob_ids(CReaderRequestResult& result,
                             const CSeq_id_Handle& seq_id,
                             const SAnnotSelector* sel);
@@ -100,26 +98,38 @@ public:
                          const CSeq_id_Handle& seq_id);
     void LoadSequenceHash(CReaderRequestResult& result,
                           const CSeq_id_Handle& seq_id);
+    void LoadSequenceLength(CReaderRequestResult& result,
+                            const CSeq_id_Handle& seq_id);
+    void LoadSequenceType(CReaderRequestResult& result,
+                          const CSeq_id_Handle& seq_id);
 
     // bulk requests
     typedef vector<bool> TLoaded;
+    typedef vector<bool> TKnown;
     typedef vector<TGi> TGis;
     typedef vector<string> TLabels;
     typedef vector<int> TTaxIds;
     typedef vector<int> THashes;
+    typedef vector<TSeqPos> TLengths;
+    typedef vector<CSeq_inst::EMol> TTypes;
     typedef vector<TBlobState> TStates;
     void LoadAccVers(CReaderRequestResult& result,
-                     const TIds ids, TLoaded& loaded, TIds& ret);
+                     const TIds& ids, TLoaded& loaded, TIds& ret);
     void LoadGis(CReaderRequestResult& result,
-                 const TIds ids, TLoaded& loaded, TGis& ret);
+                 const TIds& ids, TLoaded& loaded, TGis& ret);
     void LoadLabels(CReaderRequestResult& result,
-                    const TIds ids, TLoaded& loaded, TLabels& ret);
+                    const TIds& ids, TLoaded& loaded, TLabels& ret);
     void LoadTaxIds(CReaderRequestResult& result,
-                    const TIds ids, TLoaded& loaded, TTaxIds& ret);
+                    const TIds& ids, TLoaded& loaded, TTaxIds& ret);
     void LoadHashes(CReaderRequestResult& result,
-                    const TIds ids, TLoaded& loaded, THashes& ret);
+                    const TIds& ids, TLoaded& loaded,
+                    THashes& ret, TKnown& known);
+    void LoadLengths(CReaderRequestResult& result,
+                     const TIds& ids, TLoaded& loaded, TLengths& ret);
+    void LoadTypes(CReaderRequestResult& result,
+                   const TIds& ids, TLoaded& loaded, TTypes& ret);
     void LoadStates(CReaderRequestResult& result,
-                    const TIds ids, TLoaded& loaded, TStates& ret);
+                    const TIds& ids, TLoaded& loaded, TStates& ret);
  
     static bool SetBlobState(size_t i,
                              CReaderRequestResult& result,
diff --git a/c++/include/objtools/data_loaders/genbank/impl/info_cache.hpp b/c++/include/objtools/data_loaders/genbank/impl/info_cache.hpp
index 02b9f18..d51e77c 100644
--- a/c++/include/objtools/data_loaders/genbank/impl/info_cache.hpp
+++ b/c++/include/objtools/data_loaders/genbank/impl/info_cache.hpp
@@ -1,7 +1,7 @@
 #ifndef GENBANK_IMPL_INFO_CACHE
 #define GENBANK_IMPL_INFO_CACHE
 
-/*  $Id: info_cache.hpp 448421 2014-10-06 16:04:30Z gotvyans $
+/*  $Id: info_cache.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -75,6 +75,11 @@ enum EDoNotWait {
     eDoNotWait
 };
 
+enum EExpirationType {
+    eExpire_normal,
+    eExpire_fast
+};
+
 class CLoadMutex : public CObject, public CMutex // CFastMutex
 {
 public:
@@ -154,7 +159,7 @@ protected:
         {
             return m_Requestor;
         }
-    TExpirationTime GetNewExpirationTime(void) const;
+    TExpirationTime GetNewExpirationTime(EExpirationType type) const;
     CInfoManager& GetManager(void) const;
 
     bool IsLocked(void) const
@@ -163,17 +168,18 @@ protected:
         }
 
     bool IsLoaded(void) const;
-    bool SetLoaded(TExpirationTime new_expiration_time);
-    bool SetLoaded(void);
+    bool SetLoadedFor(TExpirationTime new_expiration_time);
+    bool SetLoaded(EExpirationType type);
     TExpirationTime GetExpirationTime(void) const
         {
             return GetInfo().GetExpirationTime();
         }
 
     typedef CMutex TMainMutex; // CFastMutex
+    bool x_SetLoadedFor(TMainMutex::TWriteLockGuard& guard,
+                        TExpirationTime new_expiration_time);
     bool x_SetLoaded(TMainMutex::TWriteLockGuard& guard,
-                     TExpirationTime new_expiration_time);
-    bool x_SetLoaded(TMainMutex::TWriteLockGuard& guard);
+                     EExpirationType type);
 
     CInfoRequestor& m_Requestor;
     CRef<CInfo_Base> m_Info;
@@ -242,7 +248,7 @@ public:
 
     typedef CInfo_Base::TExpirationTime TExpirationTime;
     virtual TExpirationTime GetRequestTime(void) const = 0;
-    virtual TExpirationTime GetNewExpirationTime(void) const = 0;
+    virtual TExpirationTime GetNewExpirationTime(EExpirationType type) const = 0;
     
 protected:
     friend class CInfoManager;
@@ -304,23 +310,24 @@ bool CInfoRequestorLock::IsLoaded(void) const
 
 inline
 CInfoRequestorLock::TExpirationTime
-CInfoRequestorLock::GetNewExpirationTime(void) const
+CInfoRequestorLock::GetNewExpirationTime(EExpirationType type) const
 {
-    return GetRequestor().GetNewExpirationTime();
+    return GetRequestor().GetNewExpirationTime(type);
 }
 
 
 inline
-bool CInfoRequestorLock::SetLoaded(void)
+bool CInfoRequestorLock::SetLoaded(EExpirationType type)
 {
-    return SetLoaded(GetNewExpirationTime());
+    return SetLoadedFor(GetNewExpirationTime(type));
 }
 
 
 inline
-bool CInfoRequestorLock::x_SetLoaded(TMainMutex::TWriteLockGuard& guard)
+bool CInfoRequestorLock::x_SetLoaded(TMainMutex::TWriteLockGuard& guard,
+                                     EExpirationType type)
 {
-    return x_SetLoaded(guard, GetNewExpirationTime());
+    return x_SetLoadedFor(guard, GetNewExpirationTime(type));
 }
 
 
@@ -345,21 +352,21 @@ public:
         {
             return m_Lock->IsLoaded();
         }
-    bool SetLoaded(TExpirationTime expiration_time)
+    bool SetLoadedFor(TExpirationTime expiration_time)
         {
-            return m_Lock->SetLoaded(expiration_time);
+            return m_Lock->SetLoadedFor(expiration_time);
         }
-    bool SetLoaded(void)
+    bool SetLoaded(EExpirationType type)
         {
-            return m_Lock->SetLoaded();
+            return m_Lock->SetLoaded(type);
         }
     TExpirationTime GetExpirationTime(void) const
         {
             return m_Lock->GetExpirationTime();
         }
-    TExpirationTime GetNewExpirationTime(void) const
+    TExpirationTime GetNewExpirationTime(EExpirationType type) const
         {
-            return m_Lock->GetNewExpirationTime();
+            return m_Lock->GetNewExpirationTime(type);
         }
 
     CInfoRequestor& GetRequestor(void) const
@@ -379,14 +386,15 @@ protected:
         {
             return m_Lock->GetManager().GetMainMutex();
         }
-    bool x_SetLoaded(TDataMutex::TWriteLockGuard& guard,
-                     TExpirationTime expiration_time)
+    bool x_SetLoadedFor(TDataMutex::TWriteLockGuard& guard,
+                        TExpirationTime expiration_time)
         {
-            return m_Lock->x_SetLoaded(guard, expiration_time);
+            return m_Lock->x_SetLoadedFor(guard, expiration_time);
         }
-    bool x_SetLoaded(TDataMutex::TWriteLockGuard& guard)
+    bool x_SetLoaded(TDataMutex::TWriteLockGuard& guard,
+                     EExpirationType type)
         {
-            return m_Lock->x_SetLoaded(guard);
+            return m_Lock->x_SetLoaded(guard, type);
         }
 #else
     typedef CMutex TDataMutex; // CFastMutex
@@ -395,14 +403,15 @@ protected:
         {
             return sm_DataMutex;
         }
-    bool x_SetLoaded(TDataMutex::TWriteLockGuard& /*guard*/,
+    bool x_SetLoadedFor(TDataMutex::TWriteLockGuard& /*guard*/,
                      TExpirationTime expiration_time)
         {
-            return m_Lock->SetLoaded(expiration_time);
+            return m_Lock->SetLoadedFor(expiration_time);
         }
-    bool x_SetLoaded(TDataMutex::TWriteLockGuard& /*guard*/)
+    bool x_SetLoaded(TDataMutex::TWriteLockGuard& /*guard*/,
+                     EExpirationType type)
         {
-            return m_Lock->SetLoaded();
+            return m_Lock->SetLoaded(type);
         }
 #endif
 
@@ -528,19 +537,19 @@ public:
             TDataMutex::TReadLockGuard guard(GetDataLock());
             return GetInfo().m_Data;
         }
-    bool SetLoaded(const TData& data)
+    bool SetLoaded(const TData& data, EExpirationType type)
         {
             TDataMutex::TWriteLockGuard guard(GetDataLock());
-            bool changed = x_SetLoaded(guard);
+            bool changed = x_SetLoaded(guard, type);
             if ( changed ) {
                 GetInfo().m_Data = data;
             }
             return changed;
         }
-    bool SetLoaded(const TData& data, TExpirationTime expiration_time)
+    bool SetLoadedFor(const TData& data, TExpirationTime expiration_time)
         {
             TDataMutex::TWriteLockGuard guard(GetDataLock());
-            bool changed = x_SetLoaded(guard, expiration_time);
+            bool changed = x_SetLoadedFor(guard, expiration_time);
             if ( changed ) {
                 GetInfo().m_Data = data;
             }
@@ -633,7 +642,8 @@ public:
         }
     bool SetLoaded(CInfoRequestor& requestor,
                    const key_type& key,
-                   const data_type& value)
+                   const data_type& value,
+                   EExpirationType type)
         {
             TCacheMutex::TWriteLockGuard guard(m_CacheMutex);
             _ASSERT(x_Check());
@@ -645,12 +655,12 @@ public:
             TInfoLock lock;
             x_SetInfo(lock, requestor, *slot);
             _ASSERT(x_Check());
-            return lock.SetLoaded(value);
+            return lock.SetLoaded(value, type);
         }
-    bool SetLoaded(CInfoRequestor& requestor,
-                   const key_type& key,
-                   const data_type& value,
-                   TExpirationTime expiration_time)
+    bool SetLoadedFor(CInfoRequestor& requestor,
+                      const key_type& key,
+                      const data_type& value,
+                      TExpirationTime expiration_time)
         {
             TCacheMutex::TWriteLockGuard guard(m_CacheMutex);
             _ASSERT(x_Check());
@@ -662,7 +672,7 @@ public:
             TInfoLock lock;
             x_SetInfo(lock, requestor, *slot);
             _ASSERT(x_Check());
-            return lock.SetLoaded(value, expiration_time);
+            return lock.SetLoadedFor(value, expiration_time);
         }
     TInfoLock GetLoaded(CInfoRequestor& requestor,
                         const key_type& key)
diff --git a/c++/include/objtools/data_loaders/genbank/impl/processors.hpp b/c++/include/objtools/data_loaders/genbank/impl/processors.hpp
index 9d63994..88783bd 100644
--- a/c++/include/objtools/data_loaders/genbank/impl/processors.hpp
+++ b/c++/include/objtools/data_loaders/genbank/impl/processors.hpp
@@ -1,6 +1,6 @@
 #ifndef PROCESSORS__HPP_INCLUDED
 #define PROCESSORS__HPP_INCLUDED
-/*  $Id: processors.hpp 442103 2014-07-30 16:02:46Z vasilche $
+/*  $Id: processors.hpp 487082 2015-12-15 00:25:55Z vasilche $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -336,7 +336,8 @@ public:
 
     enum {
         eSat_ANNOT_CDD      = 10,
-        eSat_ANNOT          = 26
+        eSat_ANNOT          = 26,
+        eSat_VDB_WGS        = 1000
     };
     enum {
         eSubSat_SNP         = 1<<0,
diff --git a/c++/include/objtools/data_loaders/genbank/impl/reader_id1_base.hpp b/c++/include/objtools/data_loaders/genbank/impl/reader_id1_base.hpp
index 032ad10..953b4bc 100644
--- a/c++/include/objtools/data_loaders/genbank/impl/reader_id1_base.hpp
+++ b/c++/include/objtools/data_loaders/genbank/impl/reader_id1_base.hpp
@@ -1,6 +1,6 @@
 #ifndef READER_ID1_BASE__HPP_INCLUDED
 #define READER_ID1_BASE__HPP_INCLUDED
-/*  $Id: reader_id1_base.hpp 440703 2014-07-16 15:38:41Z vasilche $
+/*  $Id: reader_id1_base.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -47,8 +47,6 @@ public:
     CId1ReaderBase(void);
     ~CId1ReaderBase(void);
 
-    bool LoadStringSeq_ids(CReaderRequestResult& result,
-                           const string& seq_id);
     /*
     bool LoadSeq_idSeq_ids(CReaderRequestResult& result,
                            const CSeq_id_Handle& seq_id);
diff --git a/c++/include/objtools/data_loaders/genbank/impl/reader_id2_base.hpp b/c++/include/objtools/data_loaders/genbank/impl/reader_id2_base.hpp
index a01b4ef..50f4d45 100644
--- a/c++/include/objtools/data_loaders/genbank/impl/reader_id2_base.hpp
+++ b/c++/include/objtools/data_loaders/genbank/impl/reader_id2_base.hpp
@@ -1,7 +1,7 @@
 #ifndef READER_ID2_BASE__HPP_INCLUDED
 #define READER_ID2_BASE__HPP_INCLUDED
 
-/*  $Id: reader_id2_base.hpp 465720 2015-04-23 18:17:30Z vasilche $
+/*  $Id: reader_id2_base.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -64,6 +64,7 @@ class CID2S_Split_Info;
 class CID2S_Reply_Get_Chunk;
 class CID2S_Chunk_Id;
 class CID2S_Chunk;
+class CID2Processor;
 
 class CReaderRequestResult;
 struct SId2LoadedSet;
@@ -75,8 +76,6 @@ public:
     ~CId2ReaderBase(void);
 
     // new interface
-    bool LoadStringSeq_ids(CReaderRequestResult& result,
-                           const string& seq_id);
     bool LoadSeq_idSeq_ids(CReaderRequestResult& result,
                            const CSeq_id_Handle& seq_id);
     bool LoadSeq_idGi(CReaderRequestResult& result,
@@ -89,6 +88,10 @@ public:
                          const CSeq_id_Handle& seq_id);
     bool LoadSequenceHash(CReaderRequestResult& result,
                           const CSeq_id_Handle& seq_id);
+    bool LoadSequenceLength(CReaderRequestResult& result,
+                            const CSeq_id_Handle& seq_id);
+    bool LoadSequenceType(CReaderRequestResult& result,
+                          const CSeq_id_Handle& seq_id);
     bool LoadSeq_idBlob_ids(CReaderRequestResult& result,
                             const CSeq_id_Handle& seq_id,
                             const SAnnotSelector* sel);
@@ -102,7 +105,12 @@ public:
     bool LoadTaxIds(CReaderRequestResult& result,
                     const TIds& ids, TLoaded& loaded, TTaxIds& ret);
     bool LoadHashes(CReaderRequestResult& result,
-                    const TIds& ids, TLoaded& loaded, THashes& ret);
+                    const TIds& ids, TLoaded& loaded,
+                    THashes& ret, TKnown& known);
+    bool LoadLengths(CReaderRequestResult& result,
+                     const TIds& ids, TLoaded& loaded, TLengths& ret);
+    bool LoadTypes(CReaderRequestResult& result,
+                   const TIds& ids, TLoaded& loaded, TTypes& ret);
     bool LoadStates(CReaderRequestResult& result,
                     const TIds& ids, TLoaded& loaded, TStates& ret);
 
@@ -112,10 +120,6 @@ public:
                          const TBlobId& blob_id);
 
     bool LoadBlobs(CReaderRequestResult& result,
-                   const string& seq_id,
-                   TContentsMask mask,
-                   const SAnnotSelector* sel);
-    bool LoadBlobs(CReaderRequestResult& result,
                    const CSeq_id_Handle& seq_id,
                    TContentsMask mask,
                    const SAnnotSelector* sel);
@@ -157,8 +161,6 @@ protected:
 
     void x_SetResolve(CID2_Request_Get_Blob_Id& get_blob_id,
                       const CSeq_id& seq_id);
-    void x_SetResolve(CID2_Request_Get_Blob_Id& get_blob_id,
-                      const string& seq_id);
     void x_SetResolve(CID2_Blob_Id& blob_id, const CBlob_id& src);
 
     void x_SetDetails(CID2_Get_Blob_Details& details,
@@ -214,11 +216,6 @@ protected:
                            SId2LoadedSet& loaded_set,
                            const CID2_Reply& main_reply,
                            const CID2_Reply_Get_Seq_id& reply);
-    void x_ProcessGetStringSeqId(CReaderRequestResult& result,
-                                 SId2LoadedSet& loaded_set,
-                                 const CID2_Reply& main_reply,
-                                 const string& seq_id,
-                                 const CID2_Reply_Get_Seq_id& reply);
     void x_ProcessGetSeqIdSeqId(CReaderRequestResult& result,
                                 SId2LoadedSet& loaded_set,
                                 const CID2_Reply& main_reply,
@@ -258,13 +255,18 @@ private:
     CAtomicCounter_WithAutoInit m_RequestSerialNumber;
 
     enum {
-        fAvoidRequest_nested_get_blob_info = 1,
-        fAvoidRequest_for_Seq_id_label     = 2,
-        fAvoidRequest_for_Seq_id_taxid     = 4,
-        fAvoidRequest_for_SequenceHash     = 8
+        fAvoidRequest_nested_get_blob_info = 1<<0,
+        fAvoidRequest_for_Seq_id_label     = 1<<1,
+        fAvoidRequest_for_Seq_id_taxid     = 1<<2,
+        fAvoidRequest_for_Seq_id_hash      = 1<<3,
+        fAvoidRequest_for_Seq_id_length    = 1<<4,
+        fAvoidRequest_for_Seq_id_type      = 1<<5
     };
     typedef int TAvoidRequests;
     TAvoidRequests m_AvoidRequest;
+
+    typedef vector< CRef<CID2Processor> > TProcessors;
+    TProcessors m_Processors;
 };
 
 
diff --git a/c++/include/objtools/data_loaders/genbank/impl/request_result.hpp b/c++/include/objtools/data_loaders/genbank/impl/request_result.hpp
index 4aea0a2..d697719 100644
--- a/c++/include/objtools/data_loaders/genbank/impl/request_result.hpp
+++ b/c++/include/objtools/data_loaders/genbank/impl/request_result.hpp
@@ -1,7 +1,7 @@
 #ifndef GBLOADER_REQUEST_RESULT__HPP_INCLUDED
 #define GBLOADER_REQUEST_RESULT__HPP_INCLUDED
 
-/*  $Id: request_result.hpp 452490 2014-11-20 15:50:53Z vasilche $
+/*  $Id: request_result.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -83,9 +83,14 @@ public:
     enum {
         kUnknownState = -256
     };
-    explicit CFixedSeq_ids(TState state = kUnknownState);
-    explicit CFixedSeq_ids(const TList& list, TState state = kUnknownState);
-    CFixedSeq_ids(ENcbiOwnership ownership, TList& list, TState state = kUnknownState);
+    CFixedSeq_ids(void);
+    explicit
+    CFixedSeq_ids(TState state);
+    explicit
+    CFixedSeq_ids(const TList& list,
+                  TState state = kUnknownState);
+    CFixedSeq_ids(ENcbiOwnership ownership, TList& list,
+                  TState state = kUnknownState);
 
     const TList& Get(void) const
         {
@@ -100,11 +105,16 @@ public:
         {
             return m_State;
         }
-    void SetState(TState state)
+
+    bool IsFound(void) const
         {
-            m_State = state;
+            return !empty() &&
+                !(GetState() & CBioseq_Handle::fState_not_found);
         }
 
+    void SetState(TState state);
+    void SetNotFound(void);
+
     bool empty(void) const
         {
             return Get().empty();
@@ -126,8 +136,8 @@ public:
             return *begin();
         }
 
-    TGi FindGi(void) const;
-    CSeq_id_Handle FindAccVer(void) const;
+    CDataLoader::SGiFound FindGi(void) const;
+    CDataLoader::SAccVerFound FindAccVer(void) const;
     string FindLabel(void) const;
 
 private:
@@ -214,19 +224,29 @@ public:
     enum {
         kUnknownState = -256
     };
-    explicit CFixedBlob_ids(TState state = kUnknownState);
-    explicit CFixedBlob_ids(const TList& list, TState state = kUnknownState);
-    CFixedBlob_ids(ENcbiOwnership ownership, TList& list, TState state = kUnknownState);
+    CFixedBlob_ids(void);
+    explicit
+    CFixedBlob_ids(TState state);
+    explicit
+    CFixedBlob_ids(const TList& list,
+                   TState state = kUnknownState);
+    CFixedBlob_ids(ENcbiOwnership ownership, TList& list,
+                   TState state = kUnknownState);
 
     TState GetState(void) const
         {
             return m_State;
         }
-    void SetState(TState state)
+
+    bool IsFound(void) const
         {
-            m_State = state;
+            return !empty() &&
+                !(GetState() & CBioseq_Handle::fState_not_found);
         }
 
+    void SetState(TState state);
+    void SetNotFound(void);
+
     const TList& Get(void) const
         {
             return m_Ref->GetData();
@@ -279,11 +299,11 @@ public:
     CGBInfoManager(size_t gc_size);
     ~CGBInfoManager(void);
 
-    typedef GBL::CInfoCache<CSeq_id_Handle, CSeq_id_Handle> TCacheAcc;
+    typedef CDataLoader::SAccVerFound TSequenceAcc;
+    typedef GBL::CInfoCache<CSeq_id_Handle, TSequenceAcc> TCacheAcc;
     typedef GBL::CInfoCache<CSeq_id_Handle, CFixedSeq_ids> TCacheSeqIds;
-    typedef GBL::CInfoCache<CSeq_id_Handle, TGi> TCacheGi;
-    typedef GBL::CInfoCache<string, CFixedSeq_ids> TCacheStrSeqIds;
-    typedef GBL::CInfoCache<string, TGi> TCacheStrGi;
+    typedef CDataLoader::SGiFound TSequenceGi;
+    typedef GBL::CInfoCache<CSeq_id_Handle, TSequenceGi> TCacheGi;
     typedef GBL::CInfoCache<CSeq_id_Handle, string> TCacheLabel;
     typedef int TTaxId;
     typedef GBL::CInfoCache<CSeq_id_Handle, TTaxId> TCacheTaxId;
@@ -291,8 +311,12 @@ public:
     typedef GBL::CInfoCache<TKeyBlobIds, CFixedBlob_ids> TCacheBlobIds;
     typedef int TBlobState;
     typedef GBL::CInfoCache<CBlob_id, TBlobState> TCacheBlobState;
-    typedef int TSequenceHash;
+    typedef CDataLoader::SHashFound TSequenceHash;
     typedef GBL::CInfoCache<CSeq_id_Handle, TSequenceHash> TCacheHash;
+    typedef TSeqPos TSequenceLength;
+    typedef GBL::CInfoCache<CSeq_id_Handle, TSequenceLength> TCacheLength;
+    typedef CDataLoader::STypeFound TSequenceType;
+    typedef GBL::CInfoCache<CSeq_id_Handle, TSequenceType> TCacheType;
     typedef int TBlobVersion;
     typedef GBL::CInfoCache<CBlob_id, TBlobVersion> TCacheBlobVersion;
     typedef GBL::CInfoCache<CBlob_id, CTSE_LoadLock> TCacheBlob;
@@ -301,11 +325,11 @@ public:
     TCacheAcc m_CacheAcc;
     TCacheSeqIds m_CacheSeqIds;
     TCacheGi m_CacheGi;
-    TCacheStrSeqIds m_CacheStrSeqIds;
-    TCacheStrGi m_CacheStrGi;
     TCacheLabel m_CacheLabel;
     TCacheTaxId m_CacheTaxId;
     TCacheHash m_CacheHash;
+    TCacheLength m_CacheLength;
+    TCacheType m_CacheType;
     TCacheBlobIds m_CacheBlobIds;
     TCacheBlobState m_CacheBlobState;
     TCacheBlobVersion m_CacheBlobVersion;
@@ -322,11 +346,8 @@ public:
         {
         }
     CLoadLockSeqIds(CReaderRequestResult& result, const CSeq_id_Handle& id);
-    CLoadLockSeqIds(CReaderRequestResult& result, const string& id);
     CLoadLockSeqIds(CReaderRequestResult& result, const CSeq_id_Handle& id,
                     EAlreadyLoaded);
-    CLoadLockSeqIds(CReaderRequestResult& result, const string& id,
-                    EAlreadyLoaded);
 
     TData GetSeq_ids(void) const
         {
@@ -336,17 +357,35 @@ public:
         {
             return GetData().GetState();
         }
+
+    static bool IsFound(const TData& data)
+        {
+            return data.IsFound();
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
     bool SetLoadedSeq_ids(const TData& data)
         {
-            return SetLoaded(data);
+            return SetLoaded(data, GetExpType(data));
         }
     bool SetLoadedSeq_ids(const TData& data, TExpirationTime expiration_time)
         {
-            return SetLoaded(data, expiration_time);
+            return SetLoadedFor(data, expiration_time);
         }
     bool SetLoadedSeq_ids(const CLoadLockSeqIds& ids)
         {
-            return SetLoaded(ids.GetSeq_ids(), ids.GetExpirationTime());
+            return SetLoadedFor(ids.GetSeq_ids(), ids.GetExpirationTime());
         }
 };
 
@@ -360,7 +399,27 @@ public:
         {
         }
     CLoadLockGi(CReaderRequestResult& result, const CSeq_id_Handle& id);
-    CLoadLockGi(CReaderRequestResult& result, const string& id);
+
+    static TGi GetGi(const TData& data)
+        {
+            return data.gi;
+        }
+    static bool IsFound(const TData& data)
+        {
+            return data.sequence_found;
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
 
     bool IsLoadedGi(void) const
         {
@@ -374,13 +433,13 @@ public:
         {
             return GetData();
         }
-    bool SetLoadedGi(TGi data)
+    bool SetLoadedGi(const TData& data)
         {
-            return SetLoaded(data);
+            return SetLoaded(data, GetExpType(data));
         }
     bool SetLoadedGi(const TData& data, TExpirationTime expiration_time)
         {
-            return SetLoaded(data, expiration_time);
+            return SetLoadedFor(data, expiration_time);
         }
 };
 
@@ -394,7 +453,27 @@ public:
         {
         }
     CLoadLockAcc(CReaderRequestResult& result, const CSeq_id_Handle& id);
-    CLoadLockAcc(CReaderRequestResult& result, const string& id);
+
+    static const CSeq_id_Handle& GetAcc(const TData& data)
+        {
+            return data.acc_ver;
+        }
+    static bool IsFound(const TData& data)
+        {
+            return data.sequence_found;
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
 
     bool IsLoadedAccVer(void) const
         {
@@ -408,13 +487,13 @@ public:
         {
             return GetData();
         }
-    bool SetLoadedAccVer(const CSeq_id_Handle& data)
+    bool SetLoadedAccVer(const TData& data)
         {
-            return SetLoaded(data);
+            return SetLoaded(data, GetExpType(data));
         }
     bool SetLoadedAccVer(const TData& data, TExpirationTime expiration_time)
         {
-            return SetLoaded(data, expiration_time);
+            return SetLoadedFor(data, expiration_time);
         }
 };
 
@@ -429,6 +508,23 @@ public:
         }
     CLoadLockLabel(CReaderRequestResult& result, const CSeq_id_Handle& id);
 
+    static bool IsFound(const TData& data)
+        {
+            return !data.empty();
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
     bool IsLoadedLabel(void) const
         {
             return IsLoaded();
@@ -439,11 +535,11 @@ public:
         }
     bool SetLoadedLabel(const TData& data)
         {
-            return SetLoaded(data);
+            return SetLoaded(data, GetExpType(data));
         }
     bool SetLoadedLabel(const TData& data, TExpirationTime expiration_time)
         {
-            return SetLoaded(data, expiration_time);
+            return SetLoadedFor(data, expiration_time);
         }
 };
 
@@ -458,6 +554,23 @@ public:
         }
     CLoadLockTaxId(CReaderRequestResult& result, const CSeq_id_Handle& id);
 
+    static bool IsFound(const TData& data)
+        {
+            return data != -1;
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
     bool IsLoadedTaxId(void) const
         {
             return IsLoaded();
@@ -468,11 +581,11 @@ public:
         }
     bool SetLoadedTaxId(const TData& data)
         {
-            return SetLoaded(data);
+            return SetLoaded(data, GetExpType(data));
         }
     bool SetLoadedTaxId(const TData& data, TExpirationTime expiration_time)
         {
-            return SetLoaded(data, expiration_time);
+            return SetLoadedFor(data, expiration_time);
         }
 };
 
@@ -487,6 +600,27 @@ public:
         }
     CLoadLockHash(CReaderRequestResult& result, const CSeq_id_Handle& id);
 
+    static int GetHash(const TData& data)
+        {
+            return data.hash;
+        }
+    static bool IsFound(const TData& data)
+        {
+            return data.sequence_found;
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
     bool IsLoadedHash(void) const
         {
             return IsLoaded();
@@ -497,11 +631,107 @@ public:
         }
     bool SetLoadedHash(const TData& data)
         {
-            return SetLoaded(data);
+            return SetLoaded(data, GetExpType(data));
         }
     bool SetLoadedHash(const TData& data, TExpirationTime expiration_time)
         {
-            return SetLoaded(data, expiration_time);
+            return SetLoadedFor(data, expiration_time);
+        }
+};
+
+
+class NCBI_XREADER_EXPORT CLoadLockLength :
+    public CGBInfoManager::TCacheLength::TInfoLock
+{
+    typedef CGBInfoManager::TCacheLength::TInfoLock TParent;
+public:
+    CLoadLockLength(void)
+        {
+        }
+    CLoadLockLength(CReaderRequestResult& result, const CSeq_id_Handle& id);
+
+    static bool IsFound(const TData& data)
+        {
+            return data != kInvalidSeqPos;
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
+    bool IsLoadedLength(void) const
+        {
+            return IsLoaded();
+        }
+    TData GetLength(void) const
+        {
+            return GetData();
+        }
+    bool SetLoadedLength(const TData& data)
+        {
+            return SetLoaded(data, GetExpType(data));
+        }
+    bool SetLoadedLength(const TData& data, TExpirationTime expiration_time)
+        {
+            return SetLoadedFor(data, expiration_time);
+        }
+};
+
+
+class NCBI_XREADER_EXPORT CLoadLockType :
+    public CGBInfoManager::TCacheType::TInfoLock
+{
+    typedef CGBInfoManager::TCacheType::TInfoLock TParent;
+public:
+    CLoadLockType(void)
+        {
+        }
+    CLoadLockType(CReaderRequestResult& result, const CSeq_id_Handle& id);
+
+    static CSeq_inst::TMol GetType(const TData& data)
+        {
+            return data.type;
+        }
+    static bool IsFound(const TData& data)
+        {
+            return data.sequence_found;
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
+    bool IsLoadedType(void) const
+        {
+            return IsLoaded();
+        }
+    TData GetType(void) const
+        {
+            return GetData();
+        }
+    bool SetLoadedType(const TData& data)
+        {
+            return SetLoaded(data, GetExpType(data));
+        }
+    bool SetLoadedType(const TData& data, TExpirationTime expiration_time)
+        {
+            return SetLoadedFor(data, expiration_time);
         }
 };
 
@@ -529,18 +759,36 @@ public:
         {
             return GetData().GetState();
         }
+
+    static bool IsFound(const TData& data)
+        {
+            return data.IsFound();
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
     bool SetLoadedBlob_ids(const TData& data, TExpirationTime expiration_time)
         {
-            return SetLoaded(data, expiration_time);
+            return SetLoadedFor(data, expiration_time);
         }
     bool SetLoadedBlob_ids(const TData& data)
         {
-            return SetLoadedBlob_ids(data, GetNewExpirationTime());
+            return SetLoaded(data, GetExpType(data));
         }
     bool SetNoBlob_ids(const CFixedBlob_ids::TState& state,
                        TExpirationTime expiration_time)
         {
-            return SetLoadedBlob_ids(CFixedBlob_ids(state), expiration_time);
+            return SetLoadedFor(CFixedBlob_ids(state), expiration_time);
         }
     bool SetNoBlob_ids(const CFixedBlob_ids::TState& state)
         {
@@ -565,6 +813,23 @@ public:
     CLoadLockBlobState(CReaderRequestResult& result, const CBlob_id& id,
                        EAlreadyLoaded);
 
+    static bool IsFound(const TData& data)
+        {
+            return !(data & CBioseq_Handle::fState_not_found);
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
     TData GetBlobState(void) const
         {
             return GetData();
@@ -588,6 +853,23 @@ public:
     CLoadLockBlobVersion(CReaderRequestResult& result, const CBlob_id& id,
                          EAlreadyLoaded);
 
+    static bool IsFound(const TData& data)
+        {
+            return data >= 0;
+        }
+    bool IsFound(void) const
+        {
+            return IsFound(GetData());
+        }
+    static GBL::EExpirationType GetExpType(const TData& data)
+        {
+            return IsFound(data)? GBL::eExpire_normal: GBL::eExpire_fast;
+        }
+    GBL::EExpirationType GetExpType(void) const
+        {
+            return GetExpType(GetData());
+        }
+
     TData GetBlobVersion(void) const
         {
             return GetData();
@@ -731,16 +1013,22 @@ public:
     // new lock Manager support
 
     TExpirationTime GetRequestTime(void) const;
-    TExpirationTime GetNewExpirationTime(void) const;
+    TExpirationTime GetNewExpirationTime(GBL::EExpirationType type) const;
 
     typedef CGBInfoManager::TCacheSeqIds::TInfoLock TInfoLockIds;
+    typedef CGBInfoManager::TSequenceAcc TSequenceAcc;
     typedef CGBInfoManager::TCacheAcc::TInfoLock TInfoLockAcc;
+    typedef CGBInfoManager::TSequenceGi TSequenceGi;
     typedef CGBInfoManager::TCacheGi::TInfoLock TInfoLockGi;
     typedef CGBInfoManager::TCacheLabel::TInfoLock TInfoLockLabel;
     typedef CGBInfoManager::TTaxId TTaxId;
     typedef CGBInfoManager::TCacheTaxId::TInfoLock TInfoLockTaxId;
     typedef CGBInfoManager::TSequenceHash TSequenceHash;
     typedef CGBInfoManager::TCacheHash::TInfoLock TInfoLockHash;
+    typedef CGBInfoManager::TSequenceLength TSequenceLength;
+    typedef CGBInfoManager::TCacheLength::TInfoLock TInfoLockLength;
+    typedef CGBInfoManager::TSequenceType TSequenceType;
+    typedef CGBInfoManager::TCacheType::TInfoLock TInfoLockType;
     typedef CGBInfoManager::TCacheBlobIds::TInfoLock TInfoLockBlobIds;
     typedef CGBInfoManager::TCacheBlobState::TInfoLock TInfoLockBlobState;
     typedef CGBInfoManager::TCacheBlobVersion::TInfoLock TInfoLockBlobVersion;
@@ -750,6 +1038,7 @@ public:
     bool MarkLoadingSeqIds(const CSeq_id_Handle& id);
     TInfoLockIds GetLoadLockSeqIds(const CSeq_id_Handle& id);
     TInfoLockIds GetLoadedSeqIds(const CSeq_id_Handle& id);
+    // returns true if information can be stored into external cache
     bool SetLoadedSeqIds(const CSeq_id_Handle& id,
                          const CFixedSeq_ids& value);
 
@@ -757,29 +1046,17 @@ public:
     bool MarkLoadingAcc(const CSeq_id_Handle& id);
     TInfoLockAcc GetLoadLockAcc(const CSeq_id_Handle& id);
     TInfoLockAcc GetLoadedAcc(const CSeq_id_Handle& id);
+    // returns true if information can be stored into external cache
     bool SetLoadedAcc(const CSeq_id_Handle& id,
-                      const CSeq_id_Handle& value);
+                      const TSequenceAcc& value);
 
     bool IsLoadedGi(const CSeq_id_Handle& id);
     bool MarkLoadingGi(const CSeq_id_Handle& id);
     TInfoLockGi GetLoadLockGi(const CSeq_id_Handle& id);
     TInfoLockGi GetLoadedGi(const CSeq_id_Handle& id);
+    // returns true if information can be stored into external cache
     bool SetLoadedGi(const CSeq_id_Handle& id,
-                     const TGi& value);
-
-    bool IsLoadedSeqIds(const string& id);
-    bool MarkLoadingSeqIds(const string& id);
-    TInfoLockIds GetLoadLockSeqIds(const string& id);
-    TInfoLockIds GetLoadedSeqIds(const string& id);
-    bool SetLoadedSeqIds(const string& id,
-                         const CFixedSeq_ids& value);
-
-    bool IsLoadedGi(const string& id);
-    bool MarkLoadingGi(const string& id);
-    TInfoLockGi GetLoadLockGi(const string& id);
-    TInfoLockGi GetLoadedGi(const string& id);
-    bool SetLoadedGi(const string& id,
-                     const TGi& value);
+                     const TSequenceGi& value);
 
     // set Acc.Ver info using Ids info
     bool UpdateAccFromSeqIds(TInfoLockAcc& acc_lock,
@@ -815,6 +1092,7 @@ public:
     bool MarkLoadingLabel(const CSeq_id_Handle& id);
     TInfoLockLabel GetLoadLockLabel(const CSeq_id_Handle& id);
     TInfoLockLabel GetLoadedLabel(const CSeq_id_Handle& id);
+    // returns true if information can be stored into external cache
     bool SetLoadedLabel(const CSeq_id_Handle& id,
                         const string& value);
 
@@ -822,6 +1100,7 @@ public:
     bool MarkLoadingTaxId(const CSeq_id_Handle& id);
     TInfoLockTaxId GetLoadLockTaxId(const CSeq_id_Handle& id);
     TInfoLockTaxId GetLoadedTaxId(const CSeq_id_Handle& id);
+    // returns true if information can be stored into external cache
     bool SetLoadedTaxId(const CSeq_id_Handle& id,
                         const TTaxId& value);
 
@@ -829,9 +1108,26 @@ public:
     bool MarkLoadingHash(const CSeq_id_Handle& id);
     TInfoLockHash GetLoadLockHash(const CSeq_id_Handle& id);
     TInfoLockHash GetLoadedHash(const CSeq_id_Handle& id);
+    // returns true if information can be stored into external cache
     bool SetLoadedHash(const CSeq_id_Handle& id,
                        const TSequenceHash& value);
 
+    bool IsLoadedLength(const CSeq_id_Handle& id);
+    bool MarkLoadingLength(const CSeq_id_Handle& id);
+    TInfoLockLength GetLoadLockLength(const CSeq_id_Handle& id);
+    TInfoLockLength GetLoadedLength(const CSeq_id_Handle& id);
+    // returns true if information can be stored into external cache
+    bool SetLoadedLength(const CSeq_id_Handle& id,
+                       const TSequenceLength& value);
+
+    bool IsLoadedType(const CSeq_id_Handle& id);
+    bool MarkLoadingType(const CSeq_id_Handle& id);
+    TInfoLockType GetLoadLockType(const CSeq_id_Handle& id);
+    TInfoLockType GetLoadedType(const CSeq_id_Handle& id);
+    // returns true if information can be stored into external cache
+    bool SetLoadedType(const CSeq_id_Handle& id,
+                       const TSequenceType& value);
+
     bool IsLoadedBlobIds(const CSeq_id_Handle& id,
                          const SAnnotSelector* sel);
     bool MarkLoadingBlobIds(const CSeq_id_Handle& id,
@@ -840,6 +1136,7 @@ public:
                                         const SAnnotSelector* sel);
     TInfoLockBlobIds GetLoadedBlobIds(const CSeq_id_Handle& id,
                                       const SAnnotSelector* sel);
+    // returns true if information can be stored into external cache
     bool SetLoadedBlobIds(const CSeq_id_Handle& id,
                           const SAnnotSelector* sel,
                           const CFixedBlob_ids& value);
@@ -848,17 +1145,17 @@ public:
     bool MarkLoadingBlobState(const TKeyBlob& blob_id);
     TInfoLockBlobState GetLoadLockBlobState(const TKeyBlob& blob_id);
     TInfoLockBlobState GetLoadedBlobState(const TKeyBlob& blob_id);
+    // returns true if information can be stored into external cache
     bool SetLoadedBlobState(const TKeyBlob& blob_id, TBlobState state);
-    void SetAndSaveBlobState(const TKeyBlob& blob_id,
-                             TBlobState state);
+    void SetAndSaveBlobState(const TKeyBlob& blob_id, TBlobState state);
 
     bool IsLoadedBlobVersion(const TKeyBlob& blob_id);
     bool MarkLoadingBlobVersion(const TKeyBlob& blob_id);
     TInfoLockBlobVersion GetLoadLockBlobVersion(const TKeyBlob& blob_id);
     TInfoLockBlobVersion GetLoadedBlobVersion(const TKeyBlob& blob_id);
+    // returns true if information can be stored into external cache
     bool SetLoadedBlobVersion(const TKeyBlob& blob_id, TBlobVersion version);
-    void SetAndSaveBlobVersion(const TKeyBlob& blob_id,
-                               TBlobVersion version);
+    void SetAndSaveBlobVersion(const TKeyBlob& blob_id, TBlobVersion version);
 
     /*
     void SetSeq_entry(const TKeyBlob& blob_id,
@@ -912,14 +1209,16 @@ public:
 
     // expiration support
     TExpirationTime GetStartTime(void) const { return m_StartTime; }
-    TExpirationTime GetNewIdExpirationTime(void) const;
-    virtual TExpirationTime GetIdExpirationTimeout(void) const;
+    TExpirationTime GetNewIdExpirationTime(GBL::EExpirationType type) const;
+    virtual TExpirationTime GetIdExpirationTimeout(GBL::EExpirationType type) const;
 
     virtual bool GetAddWGSMasterDescr(void) const;
 
     CWriter* GetIdWriter(void) const;
     CWriter* GetBlobWriter(void) const;
 
+    bool IsInProcessor(void) const { return m_InProcessor > 0; }
+
 private:
     friend class CLoadLockBlob;
     friend class CLoadLockSetter;
@@ -933,6 +1232,7 @@ private:
     TLevel          m_Level;
     CSeq_id_Handle  m_RequestedId;
     int             m_RecursionLevel;
+    int             m_InProcessor;
     double          m_RecursiveTime;
     CReaderAllocatedConnection* m_AllocatedConnection;
     double          m_RetryDelay;
@@ -949,7 +1249,9 @@ private: // hide methods
 class CReaderRequestResultRecursion : public CStopWatch
 {
 public:
-    CReaderRequestResultRecursion(CReaderRequestResult& result);
+    explicit
+    CReaderRequestResultRecursion(CReaderRequestResult& result,
+                                  bool in_processor = false);
     ~CReaderRequestResultRecursion(void);
     CReaderRequestResult& GetResult(void) const
         {
@@ -965,6 +1267,7 @@ public:
 private:
     CReaderRequestResult& m_Result;
     double m_SaveTime;
+    bool m_InProcessor;
 private: // to prevent copying
     CReaderRequestResultRecursion(const CReaderRequestResultRecursion&);
     void operator=(const CReaderRequestResultRecursion&);
diff --git a/c++/include/objtools/data_loaders/genbank/impl/statistics.hpp b/c++/include/objtools/data_loaders/genbank/impl/statistics.hpp
index e933fd0..08babf6 100644
--- a/c++/include/objtools/data_loaders/genbank/impl/statistics.hpp
+++ b/c++/include/objtools/data_loaders/genbank/impl/statistics.hpp
@@ -1,7 +1,7 @@
 #ifndef GENBANK__STATISTICS__HPP_INCLUDED
 #define GENBANK__STATISTICS__HPP_INCLUDED
 
-/*  $Id: statistics.hpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: statistics.hpp 485218 2015-11-19 15:34:31Z vasilche $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -60,6 +60,8 @@ public:
         eStat_ParseSplit,
         eStat_ParseChunk,
         eStat_Hash,
+        eStat_Length,
+        eStat_Type,
 
         eStats_Count,
         eStat_Last = eStats_Count-1
diff --git a/c++/include/objtools/data_loaders/genbank/reader.hpp b/c++/include/objtools/data_loaders/genbank/reader.hpp
index 5658980..e2c31e8 100644
--- a/c++/include/objtools/data_loaders/genbank/reader.hpp
+++ b/c++/include/objtools/data_loaders/genbank/reader.hpp
@@ -1,6 +1,6 @@
 #ifndef READER__HPP_INCLUDED
 #define READER__HPP_INCLUDED
-/*  $Id: reader.hpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: reader.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -73,8 +73,6 @@ public:
     /// All LoadXxx() methods should return false if
     /// there is no requested data in the reader.
     /// This will notify dispatcher that there is no sense to retry.
-    virtual bool LoadStringSeq_ids(CReaderRequestResult& result,
-                                   const string& seq_id) = 0;
     virtual bool LoadSeq_idBlob_ids(CReaderRequestResult& result,
                                     const CSeq_id_Handle& seq_id,
                                     const SAnnotSelector* sel);
@@ -90,6 +88,10 @@ public:
                                  const CSeq_id_Handle& seq_id);
     virtual bool LoadSequenceHash(CReaderRequestResult& result,
                                   const CSeq_id_Handle& seq_id);
+    virtual bool LoadSequenceLength(CReaderRequestResult& result,
+                                    const CSeq_id_Handle& seq_id);
+    virtual bool LoadSequenceType(CReaderRequestResult& result,
+                                  const CSeq_id_Handle& seq_id);
 
     // bulk requests
     typedef vector<CSeq_id_Handle> TIds;
@@ -99,6 +101,9 @@ public:
     typedef vector<int> TTaxIds;
     typedef vector<int> TStates;
     typedef vector<int> THashes;
+    typedef vector<bool> TKnown;
+    typedef vector<TSeqPos> TLengths;
+    typedef vector<CSeq_inst::EMol> TTypes;
     virtual bool LoadAccVers(CReaderRequestResult& result,
                              const TIds& ids, TLoaded& loaded, TIds& ret);
     virtual bool LoadGis(CReaderRequestResult& result,
@@ -108,7 +113,12 @@ public:
     virtual bool LoadTaxIds(CReaderRequestResult& result,
                             const TIds& ids, TLoaded& loaded, TTaxIds& ret);
     virtual bool LoadHashes(CReaderRequestResult& result,
-                            const TIds& ids, TLoaded& loaded, THashes& ret);
+                            const TIds& ids, TLoaded& loaded,
+                            THashes& ret, TKnown& known);
+    virtual bool LoadLengths(CReaderRequestResult& result,
+                             const TIds& ids, TLoaded& loaded, TLengths& ret);
+    virtual bool LoadTypes(CReaderRequestResult& result,
+                           const TIds& ids, TLoaded& loaded, TTypes& ret);
     virtual bool LoadStates(CReaderRequestResult& result,
                             const TIds& ids, TLoaded& loaded, TStates& ret);
 
@@ -118,10 +128,6 @@ public:
                                  const TBlobId& blob_id) = 0;
 
     virtual bool LoadBlobs(CReaderRequestResult& result,
-                           const string& seq_id,
-                           TContentsMask mask,
-                           const SAnnotSelector* sel);
-    virtual bool LoadBlobs(CReaderRequestResult& result,
                            const CSeq_id_Handle& seq_id,
                            TContentsMask mask,
                            const SAnnotSelector* sel);
@@ -141,33 +147,25 @@ public:
     virtual bool LoadBlobSet(CReaderRequestResult& result,
                              const TSeqIds& seq_ids);
 
-    enum ESave {
-        eSave,
-        eDoNotSave
-    };
-    void SetAndSaveStringSeq_ids(CReaderRequestResult& result,
-                                 const string& seq_id,
-                                 const CFixedSeq_ids& seq_ids) const;
     void SetAndSaveSeq_idSeq_ids(CReaderRequestResult& result,
                                  const CSeq_id_Handle& seq_id,
                                  const CFixedSeq_ids& seq_ids) const;
-    void SetAndSaveNoStringSeq_ids(CReaderRequestResult& result,
-                                   const string& seq_id,
-                                   TState state) const;
     void SetAndSaveNoSeq_idSeq_ids(CReaderRequestResult& result,
                                    const CSeq_id_Handle& seq_id,
                                    TState state) const;
 
+    typedef CDataLoader::SAccVerFound TSequenceAcc;
+    typedef CDataLoader::SGiFound TSequenceGi;
+    typedef CDataLoader::STypeFound TSequenceType;
+    typedef CDataLoader::SHashFound TSequenceHash;
+
     void SetAndSaveSeq_idAccVer(CReaderRequestResult& result,
                                 const CSeq_id_Handle& seq_id,
-                                const CSeq_id_Handle& acc_id) const;
+                                const TSequenceAcc& acc_id) const;
 
-    void SetAndSaveStringGi(CReaderRequestResult& result,
-                            const string& seq_id,
-                            TGi gi) const;
     void SetAndSaveSeq_idGi(CReaderRequestResult& result,
                             const CSeq_id_Handle& seq_id,
-                            TGi gi, ESave = eSave) const;
+                            const TSequenceGi& gi) const;
 
     // copy info
     void SetAndSaveSeq_idAccFromSeqIds(CReaderRequestResult& result,
@@ -194,10 +192,16 @@ public:
 
     void SetAndSaveSeq_idTaxId(CReaderRequestResult& result,
                                const CSeq_id_Handle& seq_id,
-                               int taxid, ESave save = eSave) const;
+                               int taxid) const;
     void SetAndSaveSequenceHash(CReaderRequestResult& result,
                                 const CSeq_id_Handle& seq_id,
-                                int hash, ESave save = eSave) const;
+                                const TSequenceHash& hash) const;
+    void SetAndSaveSequenceLength(CReaderRequestResult& result,
+                                  const CSeq_id_Handle& seq_id,
+                                  TSeqPos length) const;
+    void SetAndSaveSequenceType(CReaderRequestResult& result,
+                                const CSeq_id_Handle& seq_id,
+                                const TSequenceType& type) const;
     void SetAndSaveSeq_idBlob_ids(CReaderRequestResult& result,
                                   const CSeq_id_Handle& seq_id,
                                   const SAnnotSelector* sel,
diff --git a/c++/include/objtools/data_loaders/genbank/reader_interface.hpp b/c++/include/objtools/data_loaders/genbank/reader_interface.hpp
index 386cd50..8544b5a 100644
--- a/c++/include/objtools/data_loaders/genbank/reader_interface.hpp
+++ b/c++/include/objtools/data_loaders/genbank/reader_interface.hpp
@@ -1,6 +1,6 @@
 #ifndef READER_INTERFACE__HPP_INCLUDED
 #define READER_INTERFACE__HPP_INCLUDED
-/*  $Id: reader_interface.hpp 440707 2014-07-16 15:42:14Z vasilche $
+/*  $Id: reader_interface.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -38,7 +38,7 @@ class CReader;
 
 END_SCOPE(objects)
 
-NCBI_DECLARE_INTERFACE_VERSION(objects::CReader,  "xreader", 5, 1, 0);
+NCBI_DECLARE_INTERFACE_VERSION(objects::CReader,  "xreader", 6, 1, 0);
 
 template<>
 class CDllResolver_Getter<objects::CReader>
diff --git a/c++/include/objtools/data_loaders/genbank/writer.hpp b/c++/include/objtools/data_loaders/genbank/writer.hpp
index 1dbc6d2..26c3711 100644
--- a/c++/include/objtools/data_loaders/genbank/writer.hpp
+++ b/c++/include/objtools/data_loaders/genbank/writer.hpp
@@ -2,7 +2,7 @@
 #define WRITER__HPP_INCLUDED
 /* */
 
-/*  $Id: writer.hpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: writer.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -68,10 +68,6 @@ public:
 
     virtual ~CWriter(void);
 
-    virtual void SaveStringSeq_ids(CReaderRequestResult& result,
-                                   const string& seq_id) = 0;
-    virtual void SaveStringGi(CReaderRequestResult& result,
-                              const string& seq_id) = 0;
     virtual void SaveSeq_idSeq_ids(CReaderRequestResult& result,
                                    const CSeq_id_Handle& seq_id) = 0;
     virtual void SaveSeq_idGi(CReaderRequestResult& result,
@@ -84,6 +80,10 @@ public:
                                  const CSeq_id_Handle& seq_id) = 0;
     virtual void SaveSequenceHash(CReaderRequestResult& result,
                                   const CSeq_id_Handle& seq_id) = 0;
+    virtual void SaveSequenceLength(CReaderRequestResult& result,
+                                    const CSeq_id_Handle& seq_id) = 0;
+    virtual void SaveSequenceType(CReaderRequestResult& result,
+                                  const CSeq_id_Handle& seq_id) = 0;
     virtual void SaveSeq_idBlob_ids(CReaderRequestResult& result,
                                     const CSeq_id_Handle& seq_id,
                                     const SAnnotSelector* sel) = 0;
diff --git a/c++/include/objtools/data_loaders/genbank/writer_interface.hpp b/c++/include/objtools/data_loaders/genbank/writer_interface.hpp
index 4dffc97..719e4f3 100644
--- a/c++/include/objtools/data_loaders/genbank/writer_interface.hpp
+++ b/c++/include/objtools/data_loaders/genbank/writer_interface.hpp
@@ -2,7 +2,7 @@
 #define WRITER_INTERFACE__HPP_INCLUDED
 /* */
 
-/*  $Id: writer_interface.hpp 440707 2014-07-16 15:42:14Z vasilche $
+/*  $Id: writer_interface.hpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
@@ -78,7 +78,7 @@ public:
 
 END_SCOPE(objects)
 
-NCBI_DECLARE_INTERFACE_VERSION(objects::CWriter,  "xwriter", 5, 1, 0);
+NCBI_DECLARE_INTERFACE_VERSION(objects::CWriter,  "xwriter", 6, 1, 0);
 
 template<>
 class CDllResolver_Getter<objects::CWriter>
diff --git a/c++/include/objtools/data_loaders/loaders.hpp b/c++/include/objtools/data_loaders/loaders.hpp
index 7ab427a..f105474 100644
--- a/c++/include/objtools/data_loaders/loaders.hpp
+++ b/c++/include/objtools/data_loaders/loaders.hpp
@@ -1,7 +1,7 @@
 #ifndef DATA_LOADERS___LOADERS__HPP
 #define DATA_LOADERS___LOADERS__HPP
 
-/* $Id: loaders.hpp 485953 2015-11-30 17:53:34Z blastadm $
+/* $Id: loaders.hpp 110873 2007-09-18 18:27:53Z jcherry $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE                          
diff --git a/c++/include/objtools/edit/autodef.hpp b/c++/include/objtools/edit/autodef.hpp
index 84bd855..0f8e90e 100644
--- a/c++/include/objtools/edit/autodef.hpp
+++ b/c++/include/objtools/edit/autodef.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_EDIT___AUTODEF__HPP
 #define OBJTOOLS_EDIT___AUTODEF__HPP
 
-/*  $Id: autodef.hpp 484817 2015-11-16 16:23:10Z ivanov $
+/*  $Id: autodef.hpp 490362 2016-01-25 12:43:11Z bollin $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -87,6 +87,7 @@ public:
     void SetFeatureListType(CAutoDefOptions::EFeatureListType feature_list_type);
     void SetMiscFeatRule(CAutoDefOptions::EMiscFeatRule misc_feat_rule);
     void SetProductFlag(CBioSource::EGenome product_flag);
+    void SetNuclearCopyFlag(CBioSource::EGenome product_flag);
 	void SetSpecifyNuclearProduct (bool specify_nuclear_product);
     void SetAltSpliceFlag (bool alt_splice_flag);
     void SetSuppressLocusTags(bool suppress_locus_tags);
@@ -96,7 +97,7 @@ public:
     void SuppressMobileElementAndInsertionSequenceSubfeatures(bool suppress);
     void SetKeepExons(bool keep);
     void SetKeepIntrons(bool keep);
-    void SetKeepPromoters(bool keep);
+    void SetKeepRegulatoryFeatures(bool keep);
     void SetKeepLTRs(bool keep);
     void SetKeep3UTRs(bool keep);
     void SetKeep5UTRs(bool keep);
@@ -187,6 +188,13 @@ void CAutoDef::SetProductFlag(CBioSource::EGenome product_flag)
 
 
 inline
+void CAutoDef::SetNuclearCopyFlag(CBioSource::EGenome product_flag)
+{
+    m_Options.SetNuclearCopyFlag(product_flag);
+}
+
+
+inline
 void CAutoDef::SetSpecifyNuclearProduct (bool specify_nuclear_product)
 {
     m_Options.SetSpecifyNuclearProduct(specify_nuclear_product);
@@ -243,12 +251,11 @@ void CAutoDef::SetKeepIntrons(bool keep)
 
 
 inline
-void CAutoDef::SetKeepPromoters(bool keep)
+void CAutoDef::SetKeepRegulatoryFeatures(bool keep)
 {
-    m_Options.SetKeepPromoters(keep);
+    m_Options.SetKeepRegulatoryFeatures(keep);
 }
 
-
 inline
 void CAutoDef::SetKeepLTRs(bool keep)
 {
diff --git a/c++/include/objtools/edit/autodef_feature_clause.hpp b/c++/include/objtools/edit/autodef_feature_clause.hpp
index c5fbf53..a8e6a0f 100644
--- a/c++/include/objtools/edit/autodef_feature_clause.hpp
+++ b/c++/include/objtools/edit/autodef_feature_clause.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_EDIT___AUTODEF_FEATURE_CLAUSE__HPP
 #define OBJTOOLS_EDIT___AUTODEF_FEATURE_CLAUSE__HPP
 
-/*  $Id: autodef_feature_clause.hpp 483240 2015-10-29 14:24:28Z ivanov $
+/*  $Id: autodef_feature_clause.hpp 493843 2016-03-02 14:04:45Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -65,10 +65,12 @@ public:
     virtual bool IsNoncodingProductFeat();
     virtual bool IsSatelliteClause();
     virtual bool IsPromoter();
+    virtual bool IsLTR();
     static bool IsSatellite(const CSeq_feat& feat);
     static bool IsPromoter(const CSeq_feat& feat);
     static bool IsGeneCluster (const CSeq_feat& feat);
     static bool IsControlRegion (const CSeq_feat& feat);
+    static bool IsLTR(const CSeq_feat& feat);
 
     
     // functions for comparing locations
diff --git a/c++/include/objtools/edit/autodef_feature_clause_base.hpp b/c++/include/objtools/edit/autodef_feature_clause_base.hpp
index f5a62d1..38fbfce 100644
--- a/c++/include/objtools/edit/autodef_feature_clause_base.hpp
+++ b/c++/include/objtools/edit/autodef_feature_clause_base.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_EDIT___AUTODEF_FEATURE_CLAUSE_BASE__HPP
 #define OBJTOOLS_EDIT___AUTODEF_FEATURE_CLAUSE_BASE__HPP
 
-/*  $Id: autodef_feature_clause_base.hpp 483241 2015-10-29 14:24:51Z ivanov $
+/*  $Id: autodef_feature_clause_base.hpp 490362 2016-01-25 12:43:11Z bollin $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -120,7 +120,6 @@ public:
     void GroupConsecutiveExons(CBioseq_Handle bh);
     void GroupSegmentedCDSs(bool suppress_allele);
     void RemoveGenesMentionedElsewhere();
-    void RemoveTransSplicedLeaders();
     void RemoveuORFs();
     void RemoveOptionalMobileElements();
     void ConsolidateRepeatedClauses(bool suppress_allele);
@@ -140,9 +139,9 @@ public:
     string FindGeneProductName(CAutoDefFeatureClause_Base *gene_clause);
     void AssignGeneProductNames(CAutoDefFeatureClause_Base *main_clause, bool suppress_allele);
     
-    void RemoveFeaturesByType(unsigned int feature_type);
+    void RemoveFeaturesByType(unsigned int feature_type, bool except_promoter = false);
     bool IsFeatureTypeLonely(unsigned int feature_type);
-    void RemoveFeaturesInmRNAsByType(unsigned int feature_type);
+    void RemoveFeaturesInmRNAsByType(unsigned int feature_type, bool except_promoter = false);
     
     virtual bool ShouldRemoveExons();
     
@@ -151,11 +150,16 @@ public:
     virtual bool IsBioseqPrecursorRNA();
     void RemoveBioseqPrecursorRNAs();
 
+    virtual bool IsPromoter() { return false; }
+
     void Consolidate(CAutoDefFeatureClause_Base& other, bool suppress_allele);
     void TakeSubclauses(CAutoDefFeatureClause_Base& other);
 
     static vector<string> GetMiscRNAElements(const string& product);
     static vector<string> GetTrnaIntergenicSpacerClausePhrases(const string& comment);
+    static bool IsValidFeatureClausePhrase(const string& phrase);
+    static vector<string> GetFeatureClausePhrases(string comment);
+    static CAutoDefFeatureClause_Base *ClauseFromPhrase(const string& phrase, CBioseq_Handle bh, const CSeq_feat& cf, const CSeq_loc& mapped_loc, bool first, bool last);
 
    
 protected:
diff --git a/c++/include/objtools/edit/autodef_mod_combo.hpp b/c++/include/objtools/edit/autodef_mod_combo.hpp
index 0d367a8..561cd42 100644
--- a/c++/include/objtools/edit/autodef_mod_combo.hpp
+++ b/c++/include/objtools/edit/autodef_mod_combo.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_EDIT___AUTODEF_MOD_COMBO__HPP
 #define OBJTOOLS_EDIT___AUTODEF_MOD_COMBO__HPP
 
-/*  $Id: autodef_mod_combo.hpp 484815 2015-11-16 16:22:24Z ivanov $
+/*  $Id: autodef_mod_combo.hpp 500380 2016-05-04 13:50:52Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -109,6 +109,8 @@ public:
     CAutoDefOptions::EHIVCloneIsolateRule GetHIVCloneIsolateRule();
 
     string GetSourceDescriptionString(const CBioSource& bsrc);
+    static bool IsUsableInDefline(CSubSource::ESubtype subtype);
+    static bool IsUsableInDefline(COrgMod::ESubtype subtype);
 
     typedef vector<CSubSource::ESubtype> TSubSourceTypeVector;
     typedef vector<COrgMod::ESubtype> TOrgModTypeVector;
@@ -166,6 +168,9 @@ private:
     void x_CleanUpTaxName (string &tax_name);
     bool x_AddSubsourceString (string &source_description, const CBioSource& bsrc, CSubSource::ESubtype st);
     bool x_AddOrgModString (string &source_description, const CBioSource& bsrc, COrgMod::ESubtype st);
+
+    static bool x_AddMinicircle(string& source_description, const CBioSource& bsrc);
+    static bool x_AddMinicircle(string& source_description, const string& note_text);
     
     typedef pair<COrgMod::ESubtype, bool> TExtraOrgMod;
     typedef map<COrgMod::ESubtype, bool> TExtraOrgMods;
diff --git a/c++/include/objtools/edit/autodef_options.hpp b/c++/include/objtools/edit/autodef_options.hpp
index b9cfe72..8b35784 100644
--- a/c++/include/objtools/edit/autodef_options.hpp
+++ b/c++/include/objtools/edit/autodef_options.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_EDIT___AUTODEF_OPTIONS__HPP
 #define OBJTOOLS_EDIT___AUTODEF_OPTIONS__HPP
 
-/*  $Id: autodef_options.hpp 483235 2015-10-29 14:22:28Z ivanov $
+/*  $Id: autodef_options.hpp 490362 2016-01-25 12:43:11Z bollin $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -69,6 +69,7 @@ public:
         eOptionFieldType_FeatureListType,
         eOptionFieldType_MiscFeatRule,
         eOptionFieldType_ProductFlag,
+        eOptionFieldType_NuclearCopyFlag,
         eOptionFieldType_SpecifyNuclearProduct,
         eOptionFieldType_AltSpliceFlag,
         eOptionFieldType_SuppressLocusTags,
@@ -78,8 +79,8 @@ public:
         eOptionFieldType_SuppressMobileElementSubfeatures,
         eOptionFieldType_KeepExons,
         eOptionFieldType_KeepIntrons,
-        eOptionFieldType_KeepPromoters,
         eOptionFieldType_UseFakePromoters,
+        eOptionFieldType_KeepRegulatoryFeatures,
         eOptionFieldType_KeepLTRs,
         eOptionFieldType_Keep3UTRs,
         eOptionFieldType_Keep5UTRs,
@@ -90,6 +91,7 @@ public:
         eOptionFieldType_UseNcRNAComment,
         eOptionFieldType_SuppressedFeatures,
         eOptionFieldType_ModifierList,
+        eOptionFieldType_TargetedLocusName,
         eOptionFieldMax
     };
 
@@ -128,15 +130,20 @@ public:
     bool GetUseFakePromoters() const { return m_BooleanFlags[eOptionFieldType_UseFakePromoters]; }
     void SetUseFakePromoters(bool val = true) {
         m_BooleanFlags[eOptionFieldType_UseFakePromoters] = val;
-        if (val) {
-            m_BooleanFlags[eOptionFieldType_KeepPromoters] = true;
-        }
     }
 
     CBioSource::TGenome GetProductFlag() const { return m_ProductFlag; };
     void SetProductFlag(CBioSource::EGenome val) { 
         m_ProductFlag = val; 
         m_BooleanFlags[eOptionFieldType_SpecifyNuclearProduct] = false; 
+        m_NuclearCopyFlag = CBioSource::eGenome_unknown;
+    }
+
+    CBioSource::TGenome GetNuclearCopyFlag() const { return m_NuclearCopyFlag; };
+    void SetNuclearCopyFlag(CBioSource::EGenome val) {
+        m_NuclearCopyFlag = val;
+        m_BooleanFlags[eOptionFieldType_SpecifyNuclearProduct] = false;
+        m_ProductFlag = CBioSource::eGenome_unknown;
     }
 
     bool GetSpecifyNuclearProduct() const { return m_BooleanFlags[eOptionFieldType_SpecifyNuclearProduct]; }
@@ -144,6 +151,7 @@ public:
         m_BooleanFlags[eOptionFieldType_SpecifyNuclearProduct] = val;
         if (val) {
             m_ProductFlag = CBioSource::eGenome_unknown;
+            m_NuclearCopyFlag = CBioSource::eGenome_unknown;
         }
     }
 
@@ -171,7 +179,7 @@ public:
     AUTODEFBOOLFIELD(SuppressMobileElementSubfeatures)
     AUTODEFBOOLFIELD(KeepExons)
     AUTODEFBOOLFIELD(KeepIntrons)
-    AUTODEFBOOLFIELD(KeepPromoters)
+    AUTODEFBOOLFIELD(KeepRegulatoryFeatures)
     AUTODEFBOOLFIELD(KeepLTRs)
     AUTODEFBOOLFIELD(Keep3UTRs)
     AUTODEFBOOLFIELD(Keep5UTRs)
@@ -207,6 +215,12 @@ public:
     string GetProductFlag(CBioSource::TGenome value) const;
     CBioSource::TGenome GetProductFlag(const string& value) const;
 
+    string GetNuclearCopyFlag(CBioSource::TGenome value) const;
+    CBioSource::TGenome GetNuclearCopyFlag(const string& value) const;
+
+    string GetTargetedLocusName() const { return m_TargetedLocusName;  }
+    void SetTargetedLocusName(const string& tls) { m_TargetedLocusName = tls; }
+
 private:
 
     bool m_BooleanFlags[eOptionFieldMax];
@@ -215,8 +229,10 @@ private:
     TFeatureListType m_FeatureListType;
     TMiscFeatRule m_MiscFeatRule;
     CBioSource::TGenome m_ProductFlag;
+    CBioSource::TGenome m_NuclearCopyFlag;
     typedef vector<CSeqFeatData::ESubtype> TSuppressedFeatureSubtypes;
     TSuppressedFeatureSubtypes m_SuppressedFeatureSubtypes;
+    string m_TargetedLocusName;
 
     TOrgMods m_OrgMods;
     TSubSources m_SubSources;
@@ -236,7 +252,9 @@ private:
     void x_MakeModifierList(CUser_object& user) const;
     void x_SetModifierList(const CUser_field& field);
 
+
     CRef<CUser_field> x_MakeMaxMods() const;
+    CRef<CUser_field> x_MakeTargetedLocusName() const;
 
 #define AUTODEFENUMFIELD(Fieldname) \
     CRef<CUser_field> x_Make##Fieldname() const { \
@@ -250,6 +268,7 @@ private:
     AUTODEFENUMFIELD(MiscFeatRule)
     AUTODEFENUMFIELD(HIVRule)
     AUTODEFENUMFIELD(ProductFlag)
+    AUTODEFENUMFIELD(NuclearCopyFlag)
 
     void x_Reset();
 };
diff --git a/c++/include/objtools/edit/cds_fix.hpp b/c++/include/objtools/edit/cds_fix.hpp
index 05b9030..e781a4f 100644
--- a/c++/include/objtools/edit/cds_fix.hpp
+++ b/c++/include/objtools/edit/cds_fix.hpp
@@ -1,4 +1,4 @@
-/*  $Id: cds_fix.hpp 465650 2015-04-23 14:18:20Z bollin $
+/*  $Id: cds_fix.hpp 499447 2016-04-26 14:17:39Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -49,19 +49,22 @@ NCBI_XOBJEDIT_EXPORT void ExtendStop(CSeq_loc& loc, TSeqPos len, CScope& scope);
 NCBI_XOBJEDIT_EXPORT bool DoesCodingRegionHaveTerminalCodeBreak(const objects::CCdregion& cdr);
 NCBI_XOBJEDIT_EXPORT CRef<CSeq_loc> GetLastCodonLoc(const CSeq_feat& cds, CScope& scope);
 NCBI_XOBJEDIT_EXPORT bool AddTerminalCodeBreak(CSeq_feat& cds, CScope& scope);
-NCBI_XOBJEDIT_EXPORT bool AdjustProteinMolInfoToMatchCDS(CMolInfo& molinfo, const CSeq_feat& cds);
 NCBI_XOBJEDIT_EXPORT bool AdjustProteinFeaturePartialsToMatchCDS(CSeq_feat& new_prot, const CSeq_feat& cds);
-NCBI_XOBJEDIT_EXPORT bool AdjustFeaturePartialFlagForLocation(CSeq_feat& new_feat);
-NCBI_XOBJEDIT_EXPORT bool AdjustForCDSPartials(const CSeq_feat& cds, CSeq_entry_Handle seh);
-NCBI_XOBJEDIT_EXPORT bool RetranslateCDS(const CSeq_feat& cds, CScope& scope);
 NCBI_XOBJEDIT_EXPORT CRef<CSeq_feat> MakemRNAforCDS(const CSeq_feat& cds, CScope& scope);
-NCBI_XOBJEDIT_EXPORT CConstRef<CSeq_feat> GetmRNAforCDS(const CSeq_feat& cds, CScope& scope);
 NCBI_XOBJEDIT_EXPORT CRef<CGenetic_code> GetGeneticCodeForBioseq(CBioseq_Handle bh);
 NCBI_XOBJEDIT_EXPORT bool TruncateCDSAtStop(CSeq_feat& cds, CScope& scope);
 NCBI_XOBJEDIT_EXPORT bool ExtendCDSToStopCodon (CSeq_feat& cds, CScope& scope);
 NCBI_XOBJEDIT_EXPORT void AdjustCDSFrameForStartChange(CCdregion& cds, int change);
 NCBI_XOBJEDIT_EXPORT bool DemoteCDSToNucSeq(objects::CSeq_feat_Handle& orig_feat);
 
+// these methods are being moved to ncbi::feature namespace 
+// please modify your usage of them
+NCBI_DEPRECATED NCBI_XOBJEDIT_EXPORT bool AdjustFeaturePartialFlagForLocation(CSeq_feat& new_feat);
+NCBI_DEPRECATED NCBI_XOBJEDIT_EXPORT bool AdjustProteinMolInfoToMatchCDS(CMolInfo& molinfo, const CSeq_feat& cds);
+NCBI_DEPRECATED NCBI_XOBJEDIT_EXPORT bool AdjustForCDSPartials(const CSeq_feat& cds, CSeq_entry_Handle seh);
+NCBI_DEPRECATED NCBI_XOBJEDIT_EXPORT bool RetranslateCDS(const CSeq_feat& cds, CScope& scope);
+NCBI_DEPRECATED NCBI_XOBJEDIT_EXPORT CConstRef<CSeq_feat> GetmRNAforCDS(const CSeq_feat& cds, CScope& scope);
+
 class NCBI_XOBJEDIT_EXPORT ApplyCDSFrame
 {
 public:
diff --git a/c++/include/objtools/edit/feattable_edit.hpp b/c++/include/objtools/edit/feattable_edit.hpp
index a84bef0..08542c1 100644
--- a/c++/include/objtools/edit/feattable_edit.hpp
+++ b/c++/include/objtools/edit/feattable_edit.hpp
@@ -1,4 +1,4 @@
-/*  $Id: feattable_edit.hpp 478464 2015-09-09 15:29:44Z ivanov $
+/*  $Id: feattable_edit.hpp 498135 2016-04-13 17:19:58Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -45,7 +45,9 @@ BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
 BEGIN_SCOPE(edit)
 
+//  ----------------------------------------------------------------------------
 class NCBI_XOBJEDIT_EXPORT CFeatTableEdit
+//  ----------------------------------------------------------------------------
 {
     typedef list<CRef<CSeq_feat> > FEATS;
 
@@ -65,6 +67,9 @@ public:
     void GenerateProteinAndTranscriptIds();
     void GenerateLocusIds();
     void SubmitFixProducts();
+    void GenerateMissingMrnaForCds();
+    void GenerateMissingGeneForMrna();
+    void GenerateMissingGeneForCds();
 
     unsigned int PendingLocusTagNumber() const {
         return mLocusTagNumber;
@@ -97,8 +102,10 @@ protected:
     void xFeatureAddTranscriptId(
         CMappedFeat);
 
-    CRef<CSeq_feat> xMakeGeneForMrna(
+    CRef<CSeq_feat> xMakeGeneForFeature(
         const CMappedFeat&);
+    void xGenerateMissingGeneForSubtype(
+        CSeqFeatData::ESubtype);
 
     CSeq_annot& mAnnot;
     CRef<CScope> mpScope;
diff --git a/c++/include/objtools/edit/loc_edit.hpp b/c++/include/objtools/edit/loc_edit.hpp
index d724d77..9eebad9 100644
--- a/c++/include/objtools/edit/loc_edit.hpp
+++ b/c++/include/objtools/edit/loc_edit.hpp
@@ -1,4 +1,4 @@
-/*  $Id: loc_edit.hpp 443569 2014-08-15 17:02:07Z asztalos $
+/*  $Id: loc_edit.hpp 488678 2016-01-04 19:38:41Z asztalos $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -102,6 +102,9 @@ public:
     static bool Extend3(CSeq_feat& feat, CScope& scope);
     static bool HasNulls(const CSeq_loc& orig_loc);
 
+    static bool Is5AtEndOfSeq(const CSeq_loc& loc, CBioseq_Handle bsh);
+    static bool Is3AtEndOfSeq(const CSeq_loc& loc, CBioseq_Handle bsh);
+
 private:
     EPartialPolicy m_PartialPolicy5;
     EPartialPolicy m_PartialPolicy3;
diff --git a/c++/include/objtools/edit/parse_text_options.hpp b/c++/include/objtools/edit/parse_text_options.hpp
index 472b70f..fc3fc57 100644
--- a/c++/include/objtools/edit/parse_text_options.hpp
+++ b/c++/include/objtools/edit/parse_text_options.hpp
@@ -1,6 +1,6 @@
 #ifndef _PARSE_TEXT_OPTIONS_HPP_
 #define _PARSE_TEXT_OPTIONS_HPP_
-/*  $Id: parse_text_options.hpp 477905 2015-09-02 15:51:25Z ivanov $
+/*  $Id: parse_text_options.hpp 477682 2015-09-01 14:07:43Z asztalos $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/format/genbank_gather.hpp b/c++/include/objtools/edit/publication_edit.hpp
similarity index 50%
copy from c++/include/objtools/format/genbank_gather.hpp
copy to c++/include/objtools/edit/publication_edit.hpp
index f14c9b2..653e36a 100644
--- a/c++/include/objtools/format/genbank_gather.hpp
+++ b/c++/include/objtools/edit/publication_edit.hpp
@@ -1,7 +1,6 @@
-#ifndef OBJTOOLS_FORMAT___GENBANK_GATHER__HPP
-#define OBJTOOLS_FORMAT___GENBANK_GATHER__HPP
-
-/*  $Id: genbank_gather.hpp 379519 2012-11-01 17:25:07Z kornbluh $
+#ifndef OBJTOOLS_EDIT__PUBLICATION_EDIT__HPP
+#define OBJTOOLS_EDIT__PUBLICATION_EDIT__HPP
+/*  $Id: publication_edit.hpp 493845 2016-03-02 14:05:29Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -15,50 +14,47 @@
 *  Government have not placed any restriction on its use or reproduction.
 *
 *  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
+*  and reliability of the software and data,  the NLM and the U.S.
 *  Government do not and cannot warrant the performance or results that
 *  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
+*  Government disclaim all warranties,  express or implied,  including
+*  warranties of performance,  merchantability or fitness for any particular
 *  purpose.
 *
 *  Please cite the author in any work or product based on this material.
 *
 * ===========================================================================
 *
-* Author:  Aaron Ucko, NCBI
-*          Mati Shomrat
+* Authors:  Igor Filippov, Andrea Asztalos
 *
 * File Description:
-*
+*   Functions that provides fixes for author names  
 */
-#include <corelib/ncbistd.hpp>
 
-#include <objtools/format/gather_items.hpp>
+#include <corelib/ncbistd.hpp>
 
 
 BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
+    class CName_std;
+BEGIN_SCOPE(edit)
 
+// returns one or more (skip_rest = true) initials from the input string
+NCBI_XOBJEDIT_EXPORT string GetFirstInitial(string input, bool skip_rest);
 
-class CBioseqContext;
-class CBioseq;
-
-
-class NCBI_FORMAT_EXPORT CGenbankGatherer : public CFlatGatherer
-{
-public:
-    CGenbankGatherer(void);
-
-    virtual void x_DoSingleSection(CBioseqContext& ctx) const;
+// generates the contents of the 'initials' member based on the first name and 
+// existing value
+NCBI_XOBJEDIT_EXPORT bool GenerateInitials(CName_std& name);
 
-private:
-    void x_GatherWGS(void) const;
-    void x_GatherTSA(void) const;
-};
+// fixes the 'initials' member only if it has been already set
+NCBI_XOBJEDIT_EXPORT bool FixInitials(CName_std& name);
 
+// moves the middle name (initials member) to the first name
+NCBI_XOBJEDIT_EXPORT bool MoveMiddleToFirst(CName_std& name);
 
+END_SCOPE(edit)
 END_SCOPE(objects)
 END_NCBI_SCOPE
 
-#endif  /* OBJTOOLS_FORMAT___GENBANK_GATHER__HPP */
+#endif    
+    // OBJTOOLS_EDIT__PUBLICATION_EDIT__HPP
\ No newline at end of file
diff --git a/c++/include/objtools/edit/rna_edit.hpp b/c++/include/objtools/edit/rna_edit.hpp
index 2bafab0..bdb5b15 100644
--- a/c++/include/objtools/edit/rna_edit.hpp
+++ b/c++/include/objtools/edit/rna_edit.hpp
@@ -1,4 +1,4 @@
-/*  $Id: rna_edit.hpp 477902 2015-09-02 15:50:40Z ivanov $
+/*  $Id: rna_edit.hpp 476471 2015-08-19 13:10:52Z asztalos $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/edit/seq_entry_edit.hpp b/c++/include/objtools/edit/seq_entry_edit.hpp
index 38f92da..5bd7449 100644
--- a/c++/include/objtools/edit/seq_entry_edit.hpp
+++ b/c++/include/objtools/edit/seq_entry_edit.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_EDIT___SEQ_ENTRY_EDIT__HPP
 #define OBJTOOLS_EDIT___SEQ_ENTRY_EDIT__HPP
 
-/*  $Id: seq_entry_edit.hpp 468566 2015-05-26 16:19:06Z filippov $
+/*  $Id: seq_entry_edit.hpp 500101 2016-05-02 15:35:32Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -141,6 +141,16 @@ void BioseqSetDescriptorPropagateDown(
     const vector<CSeqdesc::E_Choice> &choices_to_delete = 
         vector<CSeqdesc::E_Choice>() );
 
+/// Moves descriptors up from children of the given bioseq-set if each child
+/// has an identical copy of the descriptor.  It does NOT check for 
+/// duplicate Seqdescs. Will not move molinfo, title, or source descriptors.
+///
+/// @param bioseq_set_h
+///   This is the bioseq_set whose descriptors we're moving.
+NCBI_XOBJEDIT_EXPORT
+void BioseqSetDescriptorPropagateUp(CBioseq_set_Handle set);
+
+
 /// Creates a User-object descriptor on every sequence that has a local ID
 /// Contains the original local ID
 NCBI_XOBJEDIT_EXPORT
@@ -304,7 +314,13 @@ void RetranslateCdregion(CBioseq_Handle nuc_bsh,
 NCBI_XOBJEDIT_EXPORT CRef<CSeqdesc> FindUnverified(const CBioseq& seq);
 NCBI_XOBJEDIT_EXPORT bool IsUnverifiedOrganism(const CBioseq& seq);
 NCBI_XOBJEDIT_EXPORT bool IsUnverifiedFeature(const CBioseq& seq);
+NCBI_XOBJEDIT_EXPORT bool IsUnverifiedMisassembled(const CBioseq& seq);
 
+// For TargetedLocusSequences
+NCBI_XOBJEDIT_EXPORT string GetTargetedLocusName(const CSeq_feat& feat);
+NCBI_XOBJEDIT_EXPORT string GenerateTargetedLocusName(CBioseq_Handle seq);
+NCBI_XOBJEDIT_EXPORT void SetTargetedLocusName(CBioseq_Handle seq, const string& tls);
+NCBI_XOBJEDIT_EXPORT string GetTargetedLocusNameConsensus(const string& tls1, const string& tls2);
 
 END_SCOPE(edit)
 END_SCOPE(objects)
diff --git a/c++/include/objtools/edit/source_edit.hpp b/c++/include/objtools/edit/source_edit.hpp
index dfa2c4d..fe325ea 100644
--- a/c++/include/objtools/edit/source_edit.hpp
+++ b/c++/include/objtools/edit/source_edit.hpp
@@ -1,4 +1,4 @@
-/*  $Id: source_edit.hpp 475824 2015-08-12 11:28:53Z ivanov $
+/*  $Id: source_edit.hpp 473823 2015-07-22 18:53:24Z asztalos $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/edit/struc_comm_field.hpp b/c++/include/objtools/edit/struc_comm_field.hpp
index 24eba18..57a74a6 100644
--- a/c++/include/objtools/edit/struc_comm_field.hpp
+++ b/c++/include/objtools/edit/struc_comm_field.hpp
@@ -1,4 +1,4 @@
-/*  $Id: struc_comm_field.hpp 432910 2014-04-21 11:50:11Z bollin $
+/*  $Id: struc_comm_field.hpp 493879 2016-03-02 14:17:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -82,6 +82,8 @@ public:
     virtual string GetLabel() const { return m_Prefix + " " + m_FieldName; };
     bool IsStructuredCommentForThisField (const CUser_object& user) const;
     static CRef<CUser_object> MakeUserObject(const string& prefix);
+    static bool IsValid(const CUser_object& obj, const string& desired_prefix);
+    static void ReorderFields(CUser_object& obj);
 
 protected:
     string m_Prefix;
@@ -138,6 +140,46 @@ protected:
 };
 
 
+class NCBI_XOBJEDIT_EXPORT CANIComment
+{
+public:
+    CANIComment();
+    CANIComment(CUser_object& user);
+    ~CANIComment() {};
+    static CRef<CUser_object> MakeEmptyUserObject();
+
+#define ANI_STRING_FIELD(Fieldname) \
+    static void Set##Fieldname(CUser_object& obj, string val, EExistingText existing_text = eExistingText_replace_old); \
+    static string Get##Fieldname(const CUser_object& obj); \
+    CANIComment& Set##Fieldname(string val, EExistingText existing_text = eExistingText_replace_old); \
+    string Get##Fieldname() { return Get##Fieldname(*m_User); }
+
+    ANI_STRING_FIELD(ThisGenome)
+    ANI_STRING_FIELD(CurrentName)
+    ANI_STRING_FIELD(PreviousName)
+    ANI_STRING_FIELD(DateUpdated)
+    ANI_STRING_FIELD(AnalysisType)
+    ANI_STRING_FIELD(Analysis1)
+    ANI_STRING_FIELD(A1Genome)
+    ANI_STRING_FIELD(A1Name)
+    ANI_STRING_FIELD(A1ANI)
+    ANI_STRING_FIELD(A1QueryCoverage)
+    ANI_STRING_FIELD(A1SubjectCoverage)
+    ANI_STRING_FIELD(Analysis2)
+    ANI_STRING_FIELD(A2Genome)
+    ANI_STRING_FIELD(A2Name)
+    ANI_STRING_FIELD(A2ANI)
+    ANI_STRING_FIELD(A2QueryCoverage)
+    ANI_STRING_FIELD(A2SubjectCoverage)
+
+    CRef<CUser_object> MakeUserObject();
+
+    static bool IsValid(const CUser_object& obj);
+
+protected:
+    CRef<CUser_object> m_User;
+};
+
 
 END_SCOPE(edit)
 END_SCOPE(objects)
diff --git a/c++/include/objtools/error_codes.hpp b/c++/include/objtools/error_codes.hpp
index 018abad..07d848d 100644
--- a/c++/include/objtools/error_codes.hpp
+++ b/c++/include/objtools/error_codes.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS___ERROR_CODES__HPP
 #define OBJTOOLS___ERROR_CODES__HPP
 
-/*  $Id: error_codes.hpp 485953 2015-11-30 17:53:34Z blastadm $
+/*  $Id: error_codes.hpp 480266 2015-09-29 15:09:58Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -51,7 +51,7 @@ NCBI_DEFINE_ERRCODE_X(Objtools_LDS_Loader,  1407,  3);
 NCBI_DEFINE_ERRCODE_X(Objtools_GBLoader,    1408,  2);
 NCBI_DEFINE_ERRCODE_X(Objtools_GB_Util,     1409, 14);
 NCBI_DEFINE_ERRCODE_X(Objtools_Reader,      1410,  0);
-NCBI_DEFINE_ERRCODE_X(Objtools_Rd_Id2Base,  1411, 14);
+NCBI_DEFINE_ERRCODE_X(Objtools_Rd_Id2Base,  1411,  0);
 NCBI_DEFINE_ERRCODE_X(Objtools_Rd_Split,    1412,  1);
 NCBI_DEFINE_ERRCODE_X(Objtools_Rd_Disp,     1413,  0);
 NCBI_DEFINE_ERRCODE_X(Objtools_Rd_Process,  1414,  7);
diff --git a/c++/include/objtools/format/cigar_formatter.hpp b/c++/include/objtools/format/cigar_formatter.hpp
index 4c9d4bb..a899e73 100644
--- a/c++/include/objtools/format/cigar_formatter.hpp
+++ b/c++/include/objtools/format/cigar_formatter.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT___CIGAR_FORMATTER__HPP
 #define OBJTOOLS_FORMAT___CIGAR_FORMATTER__HPP
 
-/*  $Id: cigar_formatter.hpp 484559 2015-11-12 17:45:51Z ivanov $
+/*  $Id: cigar_formatter.hpp 484434 2015-11-10 20:29:29Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/format/context.hpp b/c++/include/objtools/format/context.hpp
index 4839b6b..1ff0351 100644
--- a/c++/include/objtools/format/context.hpp
+++ b/c++/include/objtools/format/context.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT___CONTEXT__HPP
 #define OBJTOOLS_FORMAT___CONTEXT__HPP
 
-/*  $Id: context.hpp 478451 2015-09-09 15:24:40Z ivanov $
+/*  $Id: context.hpp 495720 2016-03-21 14:22:27Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -152,6 +152,12 @@ public:
     const string& GetTSAMasterAccn(void) const { return m_TSAMasterAccn; }
     const string& GetTSAMasterName(void) const { return m_TSAMasterName; }
 
+    // Targeted Locus Study
+    bool IsTLS      (void) const { return m_IsTLS;       }
+    bool IsTLSMaster(void) const { return m_IsTLSMaster; }
+    const string& GetTLSMasterAccn(void) const { return m_TLSMasterAccn; }
+    const string& GetTLSMasterName(void) const { return m_TLSMasterName; }
+
     TReferences& SetReferences(void) { return m_References; }
     const TReferences& GetReferences(void) const { return m_References; }
 
@@ -209,7 +215,8 @@ public:
         fUnverified_None = 0, // for convenience
 
         fUnverified_Organism              = 1 << 0,
-        fUnverified_SequenceOrAnnotation  = 1 << 1
+        fUnverified_SequenceOrAnnotation  = 1 << 1,
+        fUnverified_Misassembled          = 1 << 2
         // if you add more here, make sure 
         // to update CFlatGatherer::x_UnverifiedComment
     };
@@ -291,6 +298,8 @@ private:
     string                m_WGSMasterName;
     string                m_TSAMasterAccn;
     string                m_TSAMasterName;
+    string                m_TLSMasterAccn;
+    string                m_TLSMasterName;
     string                m_FinishingStatus;
     string                m_Taxname;
     string                m_FiletrackURL;
@@ -337,6 +346,8 @@ private:
     bool m_IsWGSMaster;
     bool m_IsTSA;
     bool m_IsTSAMaster;
+    bool m_IsTLS;
+    bool m_IsTLSMaster;
     bool m_IsHup;
     TGi  m_Gi;
     bool m_ShowGBBSource;
diff --git a/c++/include/objtools/format/flat_file_config.hpp b/c++/include/objtools/format/flat_file_config.hpp
index 868aeb7..913aec0 100644
--- a/c++/include/objtools/format/flat_file_config.hpp
+++ b/c++/include/objtools/format/flat_file_config.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT___FLAT_FILE_CONFIG__HPP
 #define OBJTOOLS_FORMAT___FLAT_FILE_CONFIG__HPP
 
-/*  $Id: flat_file_config.hpp 481617 2015-10-14 14:42:01Z ivanov $
+/*  $Id: flat_file_config.hpp 500529 2016-05-05 14:28:05Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -88,7 +88,8 @@ public:
         eFormat_GFF3,
         eFormat_FeaturesOnly,
         eFormat_SAM,
-        eFormat_AGP
+        eFormat_AGP,
+        eFormat_Lite
     };
 
     enum EMode {
@@ -360,6 +361,8 @@ public:
     bool IsFormatGFF    (void) const { return m_Format == eFormat_GFF;     }
     bool IsFormatGFF3   (void) const { return m_Format == eFormat_GFF3;    }
 	bool IsFormatAGP    (void) const { return m_Format == eFormat_AGP;     }
+	bool IsFormatLite   (void) const { return m_Format == eFormat_Lite;    }
+
     // setters
     void SetFormat(const TFormat& format) { m_Format = format; }
     void SetFormatGenbank(void) { m_Format = eFormat_GenBank;  }
@@ -370,6 +373,7 @@ public:
     void SetFormatGFF    (void) { m_Format = eFormat_GFF;      }
     void SetFormatGFF3   (void) { m_Format = eFormat_GFF3;     }
     void SetFormatAGP    (void) { m_Format = eFormat_AGP;      }
+    void SetFormatLite   (void) { m_Format = eFormat_Lite;     }
 
     // -- Mode
     // getters
diff --git a/c++/include/objtools/format/flat_file_generator.hpp b/c++/include/objtools/format/flat_file_generator.hpp
index c1d5edc..cacb86a 100644
--- a/c++/include/objtools/format/flat_file_generator.hpp
+++ b/c++/include/objtools/format/flat_file_generator.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT___FLAT_FILE_GENERATOR__HPP
 #define OBJTOOLS_FORMAT___FLAT_FILE_GENERATOR__HPP
 
-/*  $Id: flat_file_generator.hpp 481618 2015-10-14 14:42:22Z ivanov $
+/*  $Id: flat_file_generator.hpp 481472 2015-10-13 00:35:27Z kans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/format/gather_items.hpp b/c++/include/objtools/format/gather_items.hpp
index b565cc7..6d52fb0 100644
--- a/c++/include/objtools/format/gather_items.hpp
+++ b/c++/include/objtools/format/gather_items.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT___GATHER_ITEMS__HPP
 #define OBJTOOLS_FORMAT___GATHER_ITEMS__HPP
 
-/*  $Id: gather_items.hpp 478451 2015-09-09 15:24:40Z ivanov $
+/*  $Id: gather_items.hpp 495720 2016-03-21 14:22:27Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -162,6 +162,7 @@ protected:
     void x_RefSeqGenomeComments(CBioseqContext& ctx) const;
     void x_WGSComment(CBioseqContext& ctx) const;
     void x_TSAComment(CBioseqContext& ctx) const;
+    void x_TLSComment(CBioseqContext& ctx) const;
     void x_GBBSourceComment(CBioseqContext& ctx) const;
     void x_BarcodeComment(CBioseqContext& ctx) const;
     void x_DescComments(CBioseqContext& ctx) const;
diff --git a/c++/include/objtools/format/genbank_gather.hpp b/c++/include/objtools/format/genbank_gather.hpp
index f14c9b2..28d2769 100644
--- a/c++/include/objtools/format/genbank_gather.hpp
+++ b/c++/include/objtools/format/genbank_gather.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT___GENBANK_GATHER__HPP
 #define OBJTOOLS_FORMAT___GENBANK_GATHER__HPP
 
-/*  $Id: genbank_gather.hpp 379519 2012-11-01 17:25:07Z kornbluh $
+/*  $Id: genbank_gather.hpp 495730 2016-03-21 14:26:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -55,6 +55,7 @@ public:
 private:
     void x_GatherWGS(void) const;
     void x_GatherTSA(void) const;
+    void x_GatherTLS(void) const;
 };
 
 
diff --git a/c++/include/objtools/format/items/comment_item.hpp b/c++/include/objtools/format/items/comment_item.hpp
index 44458fa..82f3fed 100644
--- a/c++/include/objtools/format/items/comment_item.hpp
+++ b/c++/include/objtools/format/items/comment_item.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT_ITEMS___COMMENT_ITEM__HPP
 #define OBJTOOLS_FORMAT_ITEMS___COMMENT_ITEM__HPP
 
-/*  $Id: comment_item.hpp 476214 2015-08-17 13:04:33Z ivanov $
+/*  $Id: comment_item.hpp 495720 2016-03-21 14:22:27Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -134,6 +134,7 @@ public:
     static string GetStringForRefSeqGenome(const CUser_object& uo);
     static string GetStringForWGS(CBioseqContext& ctx);
     static string GetStringForTSA(CBioseqContext& ctx);
+    static string GetStringForTLS(CBioseqContext& ctx);
     static string GetStringForMolinfo(const CMolInfo& mi, CBioseqContext& ctx);
     static string GetStringForHTGS(CBioseqContext& ctx);
     static string GetStringForUnordered(CBioseqContext& ctx);
diff --git a/c++/include/objtools/format/items/gene_finder.hpp b/c++/include/objtools/format/items/gene_finder.hpp
index da7a3e7..af6bd70 100644
--- a/c++/include/objtools/format/items/gene_finder.hpp
+++ b/c++/include/objtools/format/items/gene_finder.hpp
@@ -1,4 +1,4 @@
-/*  $Id: gene_finder.hpp 381828 2012-11-29 12:13:32Z kornbluh $
+/*  $Id: gene_finder.hpp 493806 2016-03-02 13:53:13Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -49,7 +49,7 @@
 BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
 
-class CGeneFinder {
+class NCBI_XOBJUTIL_EXPORT CGeneFinder {
 public:
 
     /// Find the gene associated with the given feature.
diff --git a/c++/include/objtools/format/items/tsa_item.hpp b/c++/include/objtools/format/items/tsa_item.hpp
index 9d2db94..f9f4236 100644
--- a/c++/include/objtools/format/items/tsa_item.hpp
+++ b/c++/include/objtools/format/items/tsa_item.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT_ITEMS___TSA_ITEM__HPP
 #define OBJTOOLS_FORMAT_ITEMS___TSA_ITEM__HPP
 
-/*  $Id: tsa_item.hpp 360035 2012-04-19 13:43:48Z kornbluh $
+/*  $Id: tsa_item.hpp 495730 2016-03-21 14:26:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -48,14 +48,15 @@ class IFormatter;
 
 ///////////////////////////////////////////////////////////////////////////
 //
-// TSA
+// TSA (and TLS)
 
 class NCBI_FORMAT_EXPORT CTSAItem : public CFlatItem
 {
 public:
     enum ETSAType {
         eTSA_not_set,
-        eTSA_Projects
+        eTSA_Projects,
+        eTLS_Projects
         /*eTSA_ScaffoldList,
         eTSA_ContigList*/
     };
diff --git a/c++/include/objtools/format/sam_formatter.hpp b/c++/include/objtools/format/sam_formatter.hpp
index d20e13a..12c36e4 100644
--- a/c++/include/objtools/format/sam_formatter.hpp
+++ b/c++/include/objtools/format/sam_formatter.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_FORMAT___SAM_FORMATTER__HPP
 #define OBJTOOLS_FORMAT___SAM_FORMATTER__HPP
 
-/*  $Id: sam_formatter.hpp 484559 2015-11-12 17:45:51Z ivanov $
+/*  $Id: sam_formatter.hpp 484434 2015-11-10 20:29:29Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/bed_reader.hpp b/c++/include/objtools/readers/bed_reader.hpp
index 68434f3..e0351ea 100644
--- a/c++/include/objtools/readers/bed_reader.hpp
+++ b/c++/include/objtools/readers/bed_reader.hpp
@@ -1,4 +1,4 @@
-/*  $Id: bed_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: bed_reader.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/error_container.hpp b/c++/include/objtools/readers/error_container.hpp
index bbb3c6e..b18ddf0 100644
--- a/c++/include/objtools/readers/error_container.hpp
+++ b/c++/include/objtools/readers/error_container.hpp
@@ -1,4 +1,4 @@
-/*  $Id: error_container.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: error_container.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/fasta.hpp b/c++/include/objtools/readers/fasta.hpp
index c6bdf59..9fc3aaf 100644
--- a/c++/include/objtools/readers/fasta.hpp
+++ b/c++/include/objtools/readers/fasta.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_READERS___FASTA__HPP
 #define OBJTOOLS_READERS___FASTA__HPP
 
-/*  $Id: fasta.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: fasta.hpp 499434 2016-04-26 14:13:36Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -181,39 +181,6 @@ public:
     /// @returns currently set maximum ID length
     Uint4 GetMaxIDLength(void) const { return m_MaxIDLength; }
 
-    /// indicates which linkage-evidences a given gap-type
-    /// can accept, if any
-    enum ELinkEvid {
-        /// only the "unspecified" linkage-evidence is allowed
-        eLinkEvid_UnspecifiedOnly,
-        /// no linkage-evidence is allowed
-        eLinkEvid_Forbidden,
-        /// any linkage-evidence is allowed, and at least one is required
-        eLinkEvid_Required, 
-    };
-    /// Holds information about a given gap-type string
-    struct SGapTypeInfo {
-        /// The underlying type that the string corresponds to
-        CSeq_gap::EType m_eType;
-        /// Indicates what linkage-evidences are compatible with this
-        ELinkEvid       m_eLinkEvid;
-    };
-    /// Map a gap-type string to its information
-    /// Note that PCase_CStr, which means direct lookup is 
-    /// NOT insensitive to case, etc.
-    typedef CStaticArrayMap<const char *, SGapTypeInfo, PCase_CStr> TGapTypeMap;
-
-    /// From a gap-type string, get the SGapTypeInfo, 
-    /// insensitive to case, etc.  This is NOT quite the same as calling
-    /// find on the TGapTypeMap.
-    ///
-    /// @returns NULL if not found
-    static const SGapTypeInfo * NameToGapTypeInfo(const CTempString & sName);
-    /// This is for if the user needs to get the gap-type string
-    /// to SGapTypeInfo info directly (For example, to iterate through
-    /// all possible types).
-    static const TGapTypeMap & GetNameToGapTypeInfoMap(void);
-
     // Make case-sensitive and other kinds of insensitivity, too
     // (such as "spaces" and "underscores" becoming "hyphens"
     static string CanonicalizeString(const CTempString & sValue);
diff --git a/c++/include/objtools/readers/gff2_data.hpp b/c++/include/objtools/readers/gff2_data.hpp
index ce6b918..85483a3 100644
--- a/c++/include/objtools/readers/gff2_data.hpp
+++ b/c++/include/objtools/readers/gff2_data.hpp
@@ -1,4 +1,4 @@
-/*  $Id: gff2_data.hpp 479671 2015-09-22 18:44:45Z ivanov $
+/*  $Id: gff2_data.hpp 489339 2016-01-12 15:46:54Z ludwigf $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -133,6 +133,7 @@ public:
     static void TokenizeGFF(vector<CTempStringEx>& columns, const CTempStringEx& line);
 protected:
     virtual bool x_AssignAttributesFromGff(
+        const string&,
         const string& );
 
 	bool x_SplitGffAttributes(
@@ -162,10 +163,14 @@ protected:
         int,
         CRef<CSeq_feat> ) const;
 
-    virtual bool x_InitFeatureData(
+    virtual bool xInitFeatureData(
         int,
         CRef<CSeq_feat> ) const;
 
+    virtual bool xUpdateFeatureData(
+        int,
+        CRef<CSeq_feat>) const;
+
     virtual bool x_MigrateAttributesSubSource(
         int,
         CRef<CSeq_feat>,
@@ -179,10 +184,10 @@ protected:
     //utility helpers:
     //
     static string xNormalizedAttributeKey(
-        const string&);
+        const CTempString&);
 
     static string xNormalizedAttributeValue(
-        const string&);
+        const CTempString&);
 
     static bool xMigrateAttributeDefault(
         TAttributes&,
diff --git a/c++/include/objtools/readers/gff2_reader.hpp b/c++/include/objtools/readers/gff2_reader.hpp
index 7bca942..29049b9 100644
--- a/c++/include/objtools/readers/gff2_reader.hpp
+++ b/c++/include/objtools/readers/gff2_reader.hpp
@@ -1,4 +1,4 @@
- /*  $Id: gff2_reader.hpp 479677 2015-09-22 18:46:01Z ivanov $
+ /*  $Id: gff2_reader.hpp 497078 2016-04-04 14:59:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -164,7 +164,7 @@ public:
         const CGff2Record&,
         CRef< CSeq_annot > );
 
-    virtual bool x_AddFeatureToAnnot(
+    virtual bool xAddFeatureToAnnot(
         CRef< CSeq_feat >,
         CRef< CSeq_annot > );
                             
@@ -180,6 +180,11 @@ public:
         const CGff2Record&,
         CRef< CSeq_feat > );
 
+    bool xFeatureSetQualifier(
+        const string&,
+        const string&,
+        CRef<CSeq_feat>);
+
     virtual bool x_ProcessQualifierSpecialCase(
         CGff2Record::TAttrCit,
         CRef< CSeq_feat > );
@@ -266,6 +271,9 @@ public:
     bool x_HasTemporaryLocation(
         const CSeq_feat& );
 
+    virtual bool xIsIgnoredFeatureType(
+        const string&);
+
     static bool IsExon(
         CRef< CSeq_feat > );
 
diff --git a/c++/include/objtools/readers/gff3_reader.hpp b/c++/include/objtools/readers/gff3_reader.hpp
index b7f5b8c..3c5df52 100644
--- a/c++/include/objtools/readers/gff3_reader.hpp
+++ b/c++/include/objtools/readers/gff3_reader.hpp
@@ -1,4 +1,4 @@
- /*  $Id: gff3_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+ /*  $Id: gff3_reader.hpp 497078 2016-04-04 14:59:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -87,6 +87,8 @@ public:
 
     virtual ~CGff3Reader();
 
+    bool IsInGenbankMode() const;
+
 protected:
     virtual CGff2Record* x_CreateRecord() { return new CGff3ReadRecord(); };    
 
@@ -99,7 +101,7 @@ protected:
         const CGff2Record&,
         CRef<CSeq_feat>);
 
-    virtual bool x_AddFeatureToAnnot(
+    virtual bool xAddFeatureToAnnot(
         CRef< CSeq_feat >,
         CRef< CSeq_annot > );
 
@@ -153,6 +155,9 @@ protected:
         const CGff2Record&,
         ILineErrorListener*);
 
+    virtual bool xIsIgnoredFeatureType(
+        const string&);
+
     // Data:
     map<string, string> mCdsParentMap;
     map<string, CRef<CSeq_interval> > mMrnaLocs;
diff --git a/c++/include/objtools/readers/gtf_reader.hpp b/c++/include/objtools/readers/gtf_reader.hpp
index 7bc9bfe..56dc9db 100644
--- a/c++/include/objtools/readers/gtf_reader.hpp
+++ b/c++/include/objtools/readers/gtf_reader.hpp
@@ -1,4 +1,4 @@
- /*  $Id: gtf_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+ /*  $Id: gtf_reader.hpp 493620 2016-03-01 13:41:06Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -51,6 +51,7 @@ public:
 
 protected:
     bool x_AssignAttributesFromGff(
+        const string&,
         const string& );
 };
 
@@ -198,6 +199,10 @@ protected:
         const CGff2Record&,
         CRef< CSeq_feat >& );
 
+    bool x_FeatureSetQualifiers(
+        const CGff2Record&,
+        CRef< CSeq_feat >);
+
     virtual bool x_ProcessQualifierSpecialCase(
         CGff2Record::TAttrCit,
         CRef< CSeq_feat > );
diff --git a/c++/include/objtools/readers/gvf_reader.hpp b/c++/include/objtools/readers/gvf_reader.hpp
index 9af603d..c37540d 100644
--- a/c++/include/objtools/readers/gvf_reader.hpp
+++ b/c++/include/objtools/readers/gvf_reader.hpp
@@ -1,4 +1,4 @@
- /*  $Id: gvf_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+ /*  $Id: gvf_reader.hpp 489339 2016-01-12 15:46:54Z ludwigf $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -71,6 +71,7 @@ public:
 
 protected:
     virtual bool x_AssignAttributesFromGff(
+        const string&,
         const string& );
     void xTraceError(
         EDiagSev,
diff --git a/c++/include/objtools/readers/idmapper.hpp b/c++/include/objtools/readers/idmapper.hpp
index 4ee35f5..43990fd 100644
--- a/c++/include/objtools/readers/idmapper.hpp
+++ b/c++/include/objtools/readers/idmapper.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_IDMAPPER___IDMAPPER_IMPL__HPP
 #define OBJTOOLS_IDMAPPER___IDMAPPER_IMPL__HPP
 
-/*  $Id: idmapper.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: idmapper.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/line_error.hpp b/c++/include/objtools/readers/line_error.hpp
index 732ea89..9d2c5dd 100644
--- a/c++/include/objtools/readers/line_error.hpp
+++ b/c++/include/objtools/readers/line_error.hpp
@@ -1,4 +1,4 @@
-/*  $Id: line_error.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: line_error.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/message_listener.hpp b/c++/include/objtools/readers/message_listener.hpp
index d3f7b4f..43e7e89 100644
--- a/c++/include/objtools/readers/message_listener.hpp
+++ b/c++/include/objtools/readers/message_listener.hpp
@@ -1,4 +1,4 @@
-/*  $Id: message_listener.hpp 477855 2015-09-02 13:14:34Z ivanov $
+/*  $Id: message_listener.hpp 473683 2015-07-21 19:07:58Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/microarray_reader.hpp b/c++/include/objtools/readers/microarray_reader.hpp
index 49198b3..7a81a17 100644
--- a/c++/include/objtools/readers/microarray_reader.hpp
+++ b/c++/include/objtools/readers/microarray_reader.hpp
@@ -1,4 +1,4 @@
-/*  $Id: microarray_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: microarray_reader.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/reader_base.hpp b/c++/include/objtools/readers/reader_base.hpp
index 4946cc1..4742a67 100644
--- a/c++/include/objtools/readers/reader_base.hpp
+++ b/c++/include/objtools/readers/reader_base.hpp
@@ -1,4 +1,4 @@
-/*  $Id: reader_base.hpp 479677 2015-09-22 18:46:01Z ivanov $
+/*  $Id: reader_base.hpp 479221 2015-09-17 15:56:21Z gotvyans $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/readfeat.hpp b/c++/include/objtools/readers/readfeat.hpp
index cf8ec34..6d37cfe 100644
--- a/c++/include/objtools/readers/readfeat.hpp
+++ b/c++/include/objtools/readers/readfeat.hpp
@@ -68,7 +68,8 @@ public:
         fIgnoreWebComments      = (1<<3), ///< = 0x08 (ignore web comment lines such as lines that start with " INFO:", or consist of many equals signs)
         fCreateGenesFromCDSs    = (1<<4), ///< = 0x10 (If a CDS has a gene xref, create a gene with the same intervals if one doesn't already exist.)
         fCDSsMustBeInTheirGenes = (1<<5), ///< = 0x20 (If a CDS has a gene xref, it *must* be inside of that gene)
-        fReportDiscouragedKey = (1<<6), ///< = 0x40 (Report discouraged keys into the error container)
+        fReportDiscouragedKey   = (1<<6), ///< = 0x40 (Report discouraged keys into the error container)
+        fLeaveProteinIds        = (1<<7)  ///< = 0x80 (Leave all protein_id as a qualifiers)
     };
     typedef int TFlags;
 
@@ -82,7 +83,8 @@ public:
     static CRef<CSeq_annot> ReadSequinFeatureTable(ILineReader& reader,
                                                    const TFlags flags = 0,
                                                    ILineErrorListener* pMessageListener=0,
-                                                   ITableFilter *filter = 0);
+                                                   ITableFilter *filter = 0,
+                                                   const string& seqid_prefix = kEmptyStr);
 
     static CRef<CSeq_annot> ReadSequinFeatureTable (CNcbiIstream& ifs,
                                                     const TFlags flags = 0,
diff --git a/c++/include/objtools/readers/rm_reader.hpp b/c++/include/objtools/readers/rm_reader.hpp
index 3a852a6..dba7fca 100644
--- a/c++/include/objtools/readers/rm_reader.hpp
+++ b/c++/include/objtools/readers/rm_reader.hpp
@@ -1,4 +1,4 @@
-/*  $Id: rm_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: rm_reader.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/source_mod_parser.hpp b/c++/include/objtools/readers/source_mod_parser.hpp
index f0a82a5..8ef6f9c 100644
--- a/c++/include/objtools/readers/source_mod_parser.hpp
+++ b/c++/include/objtools/readers/source_mod_parser.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_READERS___SOURCE_MOD_PARSER__HPP
 #define OBJTOOLS_READERS___SOURCE_MOD_PARSER__HPP
 
-/*  $Id: source_mod_parser.hpp 466781 2015-05-06 16:05:10Z kornbluh $
+/*  $Id: source_mod_parser.hpp 499427 2016-04-26 14:11:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -96,6 +96,8 @@ public:
     string ParseTitle(const CTempString& title, CConstRef<CSeq_id> seqid,
         size_t iMaxModsToParse = std::numeric_limits<size_t>::max() );
 
+    void AddMods(const CTempString& name, const CTempString& value);
+
     /// Apply previously extracted modifiers to the given object, marking all
     /// relevant ones as used.
     void ApplyAllMods(CBioseq& seq, CTempString organism = kEmptyStr, CConstRef<CSeq_loc> location = CConstRef<CSeq_loc>());
@@ -184,6 +186,9 @@ public:
     /// Allows user to get the list of bad mods found by this
     const TMods & GetBadMods(void) const { return m_BadMods; }
 
+    /// Set all mods to unused 
+    void SetAllUnused();
+
     class CModFilter : public CObject {
     public:
         virtual ~CModFilter(void) { }
diff --git a/c++/include/objtools/readers/ucscregion_reader.hpp b/c++/include/objtools/readers/ucscregion_reader.hpp
index 83422e9..14b630e 100644
--- a/c++/include/objtools/readers/ucscregion_reader.hpp
+++ b/c++/include/objtools/readers/ucscregion_reader.hpp
@@ -1,4 +1,4 @@
-/*  $Id: ucscregion_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: ucscregion_reader.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/vcf_reader.hpp b/c++/include/objtools/readers/vcf_reader.hpp
index 01c7477..ab906c5 100644
--- a/c++/include/objtools/readers/vcf_reader.hpp
+++ b/c++/include/objtools/readers/vcf_reader.hpp
@@ -1,4 +1,4 @@
-/*  $Id: vcf_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: vcf_reader.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/objtools/readers/wiggle_reader.hpp b/c++/include/objtools/readers/wiggle_reader.hpp
index 63498b0..42845ec 100644
--- a/c++/include/objtools/readers/wiggle_reader.hpp
+++ b/c++/include/objtools/readers/wiggle_reader.hpp
@@ -1,4 +1,4 @@
-/*  $Id: wiggle_reader.hpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: wiggle_reader.hpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/serial/enumvalues.hpp b/c++/include/serial/enumvalues.hpp
index 8bd41b7..3f9e567 100644
--- a/c++/include/serial/enumvalues.hpp
+++ b/c++/include/serial/enumvalues.hpp
@@ -1,7 +1,7 @@
 #ifndef ENUMVALUES__HPP
 #define ENUMVALUES__HPP
 
-/*  $Id: enumvalues.hpp 471532 2015-06-29 11:41:24Z ivanov $
+/*  $Id: enumvalues.hpp 471296 2015-06-25 12:36:15Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/serial/impl/choice.hpp b/c++/include/serial/impl/choice.hpp
index f3b848d..daf0f36 100644
--- a/c++/include/serial/impl/choice.hpp
+++ b/c++/include/serial/impl/choice.hpp
@@ -1,7 +1,7 @@
 #ifndef CHOICE__HPP
 #define CHOICE__HPP
 
-/*  $Id: choice.hpp 448502 2014-10-07 13:33:03Z gouriano $
+/*  $Id: choice.hpp 477153 2015-08-26 18:45:21Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -130,8 +130,8 @@ public:
         return m_AllowEmpty;
     }
 
+    void SetSelectDelay(TSelectDelayFunction func);
 protected:
-    void SetSelectDelayFunction(TSelectDelayFunction func);
     void CallUserOp_Assign(TObjectPtr dst, TConstObjectPtr src) const;
 
     friend class CChoiceTypeInfoFunctions;
diff --git a/c++/include/serial/impl/classinfohelper.hpp b/c++/include/serial/impl/classinfohelper.hpp
index 9d1eef6..409576e 100644
--- a/c++/include/serial/impl/classinfohelper.hpp
+++ b/c++/include/serial/impl/classinfohelper.hpp
@@ -1,7 +1,7 @@
 #ifndef CLASSINFOHELPER__HPP
 #define CLASSINFOHELPER__HPP
 
-/*  $Id: classinfohelper.hpp 448502 2014-10-07 13:33:03Z gouriano $
+/*  $Id: classinfohelper.hpp 477153 2015-08-26 18:45:21Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -165,7 +165,8 @@ public:
                 Get(choicePtr).Select(E_Choice(index + eMemberIndexToGeneratedChoice), NCBI_NS_NCBI::eDoResetVariant, memPool);
             }
         }
-    static void SelectDelayBuffer(void* choicePtr,
+    static void SelectDelayBuffer(const CChoiceTypeInfo* /*choiceType*/,
+                                  void* choicePtr,
                                   TMemberIndex index)
         {
             typedef typename CClassType::E_Choice E_Choice;
diff --git a/c++/include/serial/impl/memberlist.hpp b/c++/include/serial/impl/memberlist.hpp
index fa013f1..6ab3154 100644
--- a/c++/include/serial/impl/memberlist.hpp
+++ b/c++/include/serial/impl/memberlist.hpp
@@ -1,7 +1,7 @@
 #ifndef MEMBERLIST__HPP
 #define MEMBERLIST__HPP
 
-/*  $Id: memberlist.hpp 483285 2015-10-29 18:05:21Z ivanov $
+/*  $Id: memberlist.hpp 481847 2015-10-16 15:34:27Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/serial/impl/stltypes.hpp b/c++/include/serial/impl/stltypes.hpp
index 226a8e2..a6b5fb3 100644
--- a/c++/include/serial/impl/stltypes.hpp
+++ b/c++/include/serial/impl/stltypes.hpp
@@ -1,7 +1,7 @@
 #ifndef STLTYPES__HPP
 #define STLTYPES__HPP
 
-/*  $Id: stltypes.hpp 478074 2015-09-03 17:20:57Z ivanov $
+/*  $Id: stltypes.hpp 474629 2015-07-30 14:03:40Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/serial/objistrasn.hpp b/c++/include/serial/objistrasn.hpp
index 7f8d62e..894c47a 100644
--- a/c++/include/serial/objistrasn.hpp
+++ b/c++/include/serial/objistrasn.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJISTRASN__HPP
 #define OBJISTRASN__HPP
 
-/*  $Id: objistrasn.hpp 387211 2013-01-28 13:50:21Z gouriano $
+/*  $Id: objistrasn.hpp 477149 2015-08-26 18:15:22Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -207,6 +207,7 @@ private:
     virtual EPointerType ReadPointerType(void);
     virtual TObjectIndex ReadObjectPointer(void);
     virtual string ReadOtherPointer(void);
+    virtual void StartDelayBuffer(void);
 
     // low level methods
     char GetChar(void);
diff --git a/c++/include/serial/objistrjson.hpp b/c++/include/serial/objistrjson.hpp
index db17b8b..10d0e16 100644
--- a/c++/include/serial/objistrjson.hpp
+++ b/c++/include/serial/objistrjson.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJISTRJSON__HPP
 #define OBJISTRJSON__HPP
 
-/*  $Id: objistrjson.hpp 481917 2015-10-19 13:23:10Z ivanov $
+/*  $Id: objistrjson.hpp 480247 2015-09-29 14:08:47Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/serial/objostr.hpp b/c++/include/serial/objostr.hpp
index 3328092..205d0a3 100644
--- a/c++/include/serial/objostr.hpp
+++ b/c++/include/serial/objostr.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJOSTR__HPP
 #define OBJOSTR__HPP
 
-/*  $Id: objostr.hpp 459636 2015-02-20 14:45:49Z gouriano $
+/*  $Id: objostr.hpp 484578 2015-11-12 19:13:20Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -207,6 +207,17 @@ public:
         return tmp;
     }
 
+    // Enforce explicit writing of values with default,
+    // even when they were never set
+    //
+    // This is dangerous, and contradicts specification
+    // but might be useful to make sure defaults are properly reported to recipient
+    // Use at your own risk
+    void EnforceWritingDefaultValues(bool enforce = true);
+
+    // Is explicit writing of values with default enforced
+    bool IsWritingDefaultValuesEnforced() const;
+
 //---------------------------------------------------------------------------
 // Formatting of the output
 
@@ -539,6 +550,7 @@ public:
 
     // delayed buffer
     virtual bool Write(CByteSource& source);
+    void Write(const char* data, size_t size);
 
 #ifdef NCBI_STRICT_GI
     void WriteStd(const TGi& data);
@@ -787,6 +799,7 @@ protected:
     EDelayBufferParsing  m_ParseDelayBuffers;
     bool  m_FastWriteDouble;
     ESpecialCaseWrite m_SpecialCaseWrite;
+    bool  m_EnforceWritingDefaults;
 
 private:
     static CObjectOStream* OpenObjectOStreamAsn(CNcbiOstream& out,
@@ -814,6 +827,15 @@ public:
     friend class CObjectStreamCopier;
 };
 
+inline void
+CObjectOStream::EnforceWritingDefaultValues(bool enforce) {
+    m_EnforceWritingDefaults = enforce;
+}
+inline bool
+CObjectOStream::IsWritingDefaultValuesEnforced() const {
+    return m_EnforceWritingDefaults;
+}
+
 
 /* @} */
 
diff --git a/c++/include/serial/objostrjson.hpp b/c++/include/serial/objostrjson.hpp
index 011d22a..427247c 100644
--- a/c++/include/serial/objostrjson.hpp
+++ b/c++/include/serial/objostrjson.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJOSTRJSON__HPP
 #define OBJOSTRJSON__HPP
 
-/*  $Id: objostrjson.hpp 481916 2015-10-19 13:22:37Z ivanov $
+/*  $Id: objostrjson.hpp 480245 2015-09-29 14:03:38Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/serial/rpcbase.hpp b/c++/include/serial/rpcbase.hpp
index 437a107..b6d2848 100644
--- a/c++/include/serial/rpcbase.hpp
+++ b/c++/include/serial/rpcbase.hpp
@@ -1,7 +1,7 @@
 #ifndef SERIAL___RPCBASE__HPP
 #define SERIAL___RPCBASE__HPP
 
-/*  $Id: rpcbase.hpp 483519 2015-11-02 14:44:04Z ivanov $
+/*  $Id: rpcbase.hpp 489897 2016-01-19 18:58:14Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -41,7 +41,7 @@
 #include <serial/objostr.hpp>
 #include <serial/serial.hpp>
 #include <util/retry_ctx.hpp>
-
+#include <serial/rpcbase_impl.hpp>
 
 /** @addtogroup GenClassSupport
  *
@@ -51,89 +51,6 @@
 
 BEGIN_NCBI_SCOPE
 
-/// Base class for CRPCClient template - defines methods
-/// independent of request and response types.
-class NCBI_XSERIAL_EXPORT CRPCClient_Base
-{
-public:
-    CRPCClient_Base(const string&     service,
-                    ESerialDataFormat format,
-                    unsigned int      retry_limit);
-    virtual ~CRPCClient_Base(void);
-
-    void Connect(void);
-    void Disconnect(void);
-    void Reset(void);
-
-    const string& GetService(void) const            { return m_Service; }
-             void SetService(const string& service) { m_Service = service; }
-
-    ESerialDataFormat GetFormat(void) const            { return m_Format; }
-                 void SetFormat(ESerialDataFormat fmt) { m_Format = fmt; }
-
-    unsigned int GetRetryLimit(void) const     { return m_RetryLimit; }
-            void SetRetryLimit(unsigned int n) { m_RetryLimit = n; }
-
-    const CTimeSpan GetRetryDelay(void) const          { return m_RetryDelay; }
-    void            SetRetryDelay(const CTimeSpan& ts) { m_RetryDelay = ts; }
-
-protected:
-    void SetAffinity(const string& affinity);
-
-    /// These run with m_Mutex already acquired.
-    virtual void x_Connect(void) = 0;
-    virtual void x_Disconnect(void);
-            void x_SetStream(CNcbiIostream* stream);
-
-    void x_Ask(const CSerialObject& request, CSerialObject& reply);
-    // Casting stubs.
-    virtual void x_WriteRequest(CObjectOStream& out, const CSerialObject& request) = 0;
-    virtual void x_ReadReply(CObjectIStream& in, CSerialObject& reply) = 0;
-    virtual string x_GetAffinity(const CSerialObject& request) const = 0;
-
-private:
-    /// Prohibit default copy constructor and assignment operator.
-    CRPCClient_Base(const CRPCClient_Base&);
-    bool operator= (const CRPCClient_Base&);
-
-    ESerialDataFormat        m_Format;
-    CMutex                   m_Mutex;   ///< To allow sharing across threads.
-    CTimeSpan                m_RetryDelay;
-    int                      m_RetryCount;
-    int                      m_RecursionCount;
-
-protected:
-    string                   m_Service; ///< Used by default Connect().
-    auto_ptr<CNcbiIostream>  m_Stream; // This must be destroyed after m_In/m_Out.
-    auto_ptr<CObjectIStream> m_In;
-    auto_ptr<CObjectOStream> m_Out;
-    string                   m_Affinity;
-    const STimeout*          m_Timeout; ///< Cloned if not special.
-    unsigned int             m_RetryLimit;
-    CHttpRetryContext        m_RetryCtx;
-
-    // Retry policy; by default, just _TRACEs the event and returns
-    // true.  May reset the connection (or do anything else, really),
-    // but note that Ask() will always automatically reconnect if the
-    // stream is explicitly bad.  (Ask() also takes care of enforcing
-    // m_RetryLimit.)
-    virtual bool x_ShouldRetry(unsigned int tries);
-
-    // Calculate effective retry delay. Returns value from CRetryContext
-    // if any, or the value set by SetRetryDelay. The returned value never
-    // exceeds max_delay.
-    CTimeSpan x_GetRetryDelay(double max_delay) const;
-
-    // CConn_HttpStream callback for parsing headers.
-    // 'user_data' must point to an instance of CRPCConnStatus.
-    static EHTTP_HeaderParse sx_ParseHeader(const char* http_header,
-                                            void*       user_data,
-                                            int         server_error);
-
-    static bool sx_IsSpecial(const STimeout* timeout);
-};
-
-
 /// CRPCClient -- prototype client for ASN.1/XML-based RPC.
 /// Normally connects automatically on the first real request and
 /// disconnects automatically in the destructor, but allows both events
@@ -148,8 +65,15 @@ public:
     CRPCClient(const string&     service     = kEmptyStr,
                ESerialDataFormat format      = eSerial_AsnBinary,
                unsigned int      retry_limit = 3)
-        : CRPCClient_Base(service, format, retry_limit) {}
-    virtual ~CRPCClient(void) {}
+        : CRPCClient_Base(service, format, retry_limit),
+          m_Timeout(kDefaultTimeout)
+        {}
+    virtual ~CRPCClient(void)
+    {
+        if ( !sx_IsSpecial(m_Timeout) ) {
+            delete const_cast<STimeout*>(m_Timeout);
+        }
+    }
 
     virtual void Ask(const TRequest& request, TReply& reply)
     { x_Ask(request, reply); }
@@ -190,30 +114,16 @@ protected:
     /// Connect to a URL.  (Discouraged; please establish and use a
     /// suitable named service if possible.)
             void x_ConnectURL(const string& url);
-};
-
-
-class NCBI_XSERIAL_EXPORT CRPCClientException : public CException
-{
-public:
-    enum EErrCode {
-        eRetry,   ///< Request failed, should be retried if possible.
-        eFailed,  ///< Request (or retry) failed.
-        eOther
-    };
 
-    virtual const char* GetErrCodeString(void) const;
-
-    bool IsSetRetryContext(void) const { return m_RetryCtx; }
-    /// Read retry related data.
-    CRetryContext& GetRetryContext(void) { return *m_RetryCtx; }
-    /// Set new retry context.
-    void SetRetryContext(CRetryContext& ctx) { m_RetryCtx.Reset(&ctx); }
+    // CConn_HttpStream callback for parsing headers.
+    // 'user_data' must point to an instance of CRPCConnStatus.
+    static EHTTP_HeaderParse sx_ParseHeader(const char* http_header,
+                                            void*       user_data,
+                                            int         server_error);
 
-    NCBI_EXCEPTION_DEFAULT(CRPCClientException, CException);
+    static bool sx_IsSpecial(const STimeout* timeout);
 
-private:
-    CRef<CRetryContext> m_RetryCtx;
+    const STimeout*          m_Timeout; ///< Cloned if not special.
 };
 
 
@@ -230,11 +140,23 @@ void CRPCClient<TRequest, TReply>::x_Connect(void)
     }
     _ASSERT( !m_Service.empty() );
     SConnNetInfo* net_info = ConnNetInfo_Create(m_Service.c_str());
+    if ( !m_Args.empty() ) {
+        if ( !ConnNetInfo_AppendArg(net_info, m_Args.c_str(), 0) ) {
+            NCBI_THROW(CRPCClientException, eArgs,
+                "Error sending additional request arguments");
+        }
+    }
     if ( m_RetryCtx.IsSetArgs() ) {
-        ConnNetInfo_AppendArg(net_info, m_RetryCtx.GetArgs().c_str(), 0);
+        if ( !ConnNetInfo_AppendArg(net_info, m_RetryCtx.GetArgs().c_str(), 0) ) {
+            NCBI_THROW(CRPCClientException, eArgs,
+                "Error sending retry context arguments");
+        }
     }
     else if (!m_Affinity.empty()) {
-        ConnNetInfo_PostOverrideArg(net_info, m_Affinity.c_str(), 0);
+        if ( !ConnNetInfo_PostOverrideArg(net_info, m_Affinity.c_str(), 0) ) {
+            NCBI_THROW(CRPCClientException, eArgs,
+                "Error sending request affinity");
+        }
     }
 
     // Install callback for parsing headers.
@@ -255,8 +177,17 @@ void CRPCClient<TRequest, TReply>::x_ConnectURL(const string& url)
 {
     SConnNetInfo* net_info = ConnNetInfo_Create(0);
     ConnNetInfo_ParseURL(net_info, url.c_str());
+    if ( !m_Args.empty() ) {
+        if ( !ConnNetInfo_PostOverrideArg(net_info, m_Args.c_str(), 0) ) {
+            NCBI_THROW(CRPCClientException, eArgs,
+                "Error sending additional request arguments");
+        }
+    }
     if ( m_RetryCtx.IsSetArgs() ) {
-        ConnNetInfo_PostOverrideArg(net_info, m_RetryCtx.GetArgs().c_str(), 0);
+        if ( !ConnNetInfo_PostOverrideArg(net_info, m_RetryCtx.GetArgs().c_str(), 0) ) {
+            NCBI_THROW(CRPCClientException, eArgs,
+                "Error sending retry context arguments");
+        }
     }
     x_SetStream(new CConn_HttpStream(net_info,
         kEmptyStr, // user_header
@@ -308,12 +239,38 @@ const STimeout* CRPCClient<TRequest, TReply>::GetTimeout(EIO_Event direction)
         = dynamic_cast<CConn_IOStream*>(m_Stream.get());
     if (conn_stream) {
         return conn_stream->GetTimeout(direction);
-    } else {
+    }
+    else {
         return m_Timeout;
     }
 }
 
 
+template<class TRequest, class TReply>
+inline
+EHTTP_HeaderParse
+CRPCClient<TRequest, TReply>::sx_ParseHeader(const char* http_header,
+                                             void*       user_data,
+                                             int         server_error)
+{
+    if ( !user_data ) return eHTTP_HeaderContinue;
+    CHttpRetryContext* retry_ctx = reinterpret_cast<CHttpRetryContext*>(user_data);
+    _ASSERT(retry_ctx);
+    retry_ctx->ParseHeader(http_header);
+
+    // Always read response body - normal content or error.
+    return eHTTP_HeaderContinue;
+}
+
+
+template<class TRequest, class TReply>
+inline
+bool CRPCClient<TRequest, TReply>::sx_IsSpecial(const STimeout* timeout)
+{
+    return timeout == kDefaultTimeout  ||  timeout == kInfiniteTimeout;
+}
+
+
 END_NCBI_SCOPE
 
 
diff --git a/c++/include/serial/rpcbase_impl.hpp b/c++/include/serial/rpcbase_impl.hpp
new file mode 100644
index 0000000..e03b3ec
--- /dev/null
+++ b/c++/include/serial/rpcbase_impl.hpp
@@ -0,0 +1,170 @@
+#ifndef SERIAL___RPCBASE_IMPL__HPP
+#define SERIAL___RPCBASE_IMPL__HPP
+
+/*  $Id: rpcbase_impl.hpp 499300 2016-04-25 15:23:35Z ivanov $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Author:  Aaron Ucko, NCBI
+ *
+ * File Description:
+ *   Generic template class for ASN.1/XML RPC clients
+ *
+ */
+
+#include <corelib/ncbimtx.hpp>
+#include <corelib/ncbi_system.hpp>
+#include <serial/objistr.hpp>
+#include <serial/objostr.hpp>
+#include <serial/serial.hpp>
+#include <util/retry_ctx.hpp>
+
+
+/** @addtogroup GenClassSupport
+ *
+ * @{
+ */
+
+
+BEGIN_NCBI_SCOPE
+
+/// Base class for CRPCClient template - defines methods
+/// independent of request and response types.
+class NCBI_XSERIAL_EXPORT CRPCClient_Base
+{
+public:
+    CRPCClient_Base(const string&     service,
+                    ESerialDataFormat format,
+                    unsigned int      retry_limit);
+    virtual ~CRPCClient_Base(void);
+
+    void Connect(void);
+    void Disconnect(void);
+    void Reset(void);
+
+    /// Set additional connection arguments.
+    void SetArgs(const string& args) { m_Args = args; }
+    void SetArgs(const CUrlArgs& args) { m_Args = args.GetQueryString(CUrlArgs::eAmp_Char); }
+    /// Get additional connection arguments.
+    const string& GetArgs(void) const { return m_Args; }
+
+    const string& GetService(void) const            { return m_Service; }
+             void SetService(const string& service) { m_Service = service; }
+
+    ESerialDataFormat GetFormat(void) const            { return m_Format; }
+                 void SetFormat(ESerialDataFormat fmt) { m_Format = fmt; }
+
+    unsigned int GetRetryLimit(void) const     { return m_RetryLimit; }
+            void SetRetryLimit(unsigned int n) { m_RetryLimit = n; }
+
+    const CTimeSpan GetRetryDelay(void) const          { return m_RetryDelay; }
+    void            SetRetryDelay(const CTimeSpan& ts) { m_RetryDelay = ts; }
+
+protected:
+    void SetAffinity(const string& affinity);
+
+    /// These run with m_Mutex already acquired.
+    virtual void x_Connect(void) = 0;
+    virtual void x_Disconnect(void);
+            void x_SetStream(CNcbiIostream* stream);
+
+    void x_Ask(const CSerialObject& request, CSerialObject& reply);
+    // Casting stubs.
+    virtual void x_WriteRequest(CObjectOStream& out, const CSerialObject& request) = 0;
+    virtual void x_ReadReply(CObjectIStream& in, CSerialObject& reply) = 0;
+    virtual string x_GetAffinity(const CSerialObject& request) const = 0;
+
+private:
+    /// Prohibit default copy constructor and assignment operator.
+    CRPCClient_Base(const CRPCClient_Base&);
+    bool operator= (const CRPCClient_Base&);
+
+    ESerialDataFormat        m_Format;
+    CMutex                   m_Mutex;   ///< To allow sharing across threads.
+    CTimeSpan                m_RetryDelay;
+    unsigned int             m_RetryCount;
+    int                      m_RecursionCount;
+
+protected:
+    string                   m_Service; ///< Used by default Connect().
+    string                   m_Args;
+    auto_ptr<CNcbiIostream>  m_Stream; // This must be destroyed after m_In/m_Out.
+    auto_ptr<CObjectIStream> m_In;
+    auto_ptr<CObjectOStream> m_Out;
+    string                   m_Affinity;
+    unsigned int             m_RetryLimit;
+    CHttpRetryContext        m_RetryCtx;
+
+    // Retry policy; by default, just _TRACEs the event and returns
+    // true.  May reset the connection (or do anything else, really),
+    // but note that Ask() will always automatically reconnect if the
+    // stream is explicitly bad.  (Ask() also takes care of enforcing
+    // m_RetryLimit.)
+    virtual bool x_ShouldRetry(unsigned int tries);
+
+    // Calculate effective retry delay. Returns value from CRetryContext
+    // if any, or the value set by SetRetryDelay. The returned value never
+    // exceeds max_delay.
+    CTimeSpan x_GetRetryDelay(double max_delay) const;
+};
+
+
+class NCBI_XSERIAL_EXPORT CRPCClientException : public CException
+{
+public:
+    enum EErrCode {
+        eRetry,   ///< Request failed, should be retried if possible.
+        eFailed,  ///< Request (or retry) failed.
+        eArgs,    ///< Failed to send request arguments.
+        eOther
+    };
+
+    virtual const char* GetErrCodeString(void) const;
+
+    bool IsSetRetryContext(void) const { return m_RetryCtx; }
+    /// Read retry related data.
+    CRetryContext& GetRetryContext(void) { return *m_RetryCtx; }
+    /// Set new retry context.
+    void SetRetryContext(CRetryContext& ctx) { m_RetryCtx.Reset(&ctx); }
+
+    NCBI_EXCEPTION_DEFAULT(CRPCClientException, CException);
+
+protected:
+    virtual void x_Assign(const CException& src)
+    {
+        CException::x_Assign(src);
+        m_RetryCtx = dynamic_cast<const CRPCClientException&>(src).m_RetryCtx;
+    }
+
+private:
+    CRef<CRetryContext> m_RetryCtx;
+};
+
+
+END_NCBI_SCOPE
+
+
+/* @} */
+
+#endif  /* SERIAL___RPCBASE_IMPL__HPP */
diff --git a/c++/include/serial/serialimpl.hpp b/c++/include/serial/serialimpl.hpp
index cc73469..c1b963b 100644
--- a/c++/include/serial/serialimpl.hpp
+++ b/c++/include/serial/serialimpl.hpp
@@ -1,7 +1,7 @@
 #ifndef SERIALIMPL__HPP
 #define SERIALIMPL__HPP
 
-/*  $Id: serialimpl.hpp 471531 2015-06-29 11:40:57Z ivanov $
+/*  $Id: serialimpl.hpp 471224 2015-06-24 17:35:04Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/serial/serialutil.hpp b/c++/include/serial/serialutil.hpp
index e6b4f9b..f946c88 100644
--- a/c++/include/serial/serialutil.hpp
+++ b/c++/include/serial/serialutil.hpp
@@ -1,7 +1,7 @@
 #ifndef SERIALUTIL__HPP
 #define SERIALUTIL__HPP
 
-/*  $Id: serialutil.hpp 478074 2015-09-03 17:20:57Z ivanov $
+/*  $Id: serialutil.hpp 474629 2015-07-30 14:03:40Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/include/util/bitset/bm.h b/c++/include/util/bitset/bm.h
index 0242ef3..02f3a38 100644
--- a/c++/include/util/bitset/bm.h
+++ b/c++/include/util/bitset/bm.h
@@ -571,7 +571,7 @@ public:
                     }
                     prev = *(bdescr->gap_.ptr);
                     val = *(++(bdescr->gap_.ptr));
-                    bdescr->gap_.gap_len = (gap_word_t)val - prev;
+                    bdescr->gap_.gap_len = (gap_word_t)(val - prev);
                     return *this;  // next "ON" found;
                 }
 
@@ -695,7 +695,7 @@ public:
                     gap_word_t* first = BMGAP_PTR(this->block_) + 1;
                     if (bdescr->gap_.ptr == first)
                     {
-                        bdescr->gap_.gap_len = (gap_word_t)val + 1;
+                        bdescr->gap_.gap_len = (gap_word_t)(val + 1);
                     }
                     else
                     {
diff --git a/c++/include/util/bitset/bmalloc.h b/c++/include/util/bitset/bmalloc.h
index c233a1a..e741281 100644
--- a/c++/include/util/bitset/bmalloc.h
+++ b/c++/include/util/bitset/bmalloc.h
@@ -194,8 +194,8 @@ public:
                                     const gap_word_t* glevel_len)
     {
         BM_ASSERT(level < bm::gap_levels);
-        unsigned len = 
-            glevel_len[level] / (sizeof(bm::word_t) / sizeof(gap_word_t));
+        unsigned len = (unsigned)(glevel_len[level] / 
+                                  (sizeof(bm::word_t) / sizeof(gap_word_t)));
 
         return (bm::gap_word_t*)block_alloc_.allocate(len, 0);
     }
@@ -208,7 +208,7 @@ public:
         BM_ASSERT(IS_VALID_ADDR((bm::word_t*)block));
          
         unsigned len = gap_capacity(block, glevel_len);
-        len /= sizeof(bm::word_t) / sizeof(bm::gap_word_t);
+        len /= (unsigned)(sizeof(bm::word_t) / sizeof(bm::gap_word_t));
         block_alloc_.deallocate((bm::word_t*)block, len);        
     }
 
diff --git a/c++/include/util/bitset/bmblocks.h b/c++/include/util/bitset/bmblocks.h
index 4694a91..de40f59 100755
--- a/c++/include/util/bitset/bmblocks.h
+++ b/c++/include/util/bitset/bmblocks.h
@@ -695,9 +695,9 @@ public:
             return bm::set_array_size;
         }
 
-        unsigned top_block_size = 
-            bits_to_store / (bm::set_block_size * sizeof(bm::word_t) * 
-                                                bm::set_array_size * 8);
+        unsigned top_block_size = (unsigned)
+            (bits_to_store / (bm::set_block_size * sizeof(bm::word_t) * 
+                              bm::set_array_size * 8));
         return top_block_size + (top_block_size < bm::set_array_size);
     }
 
diff --git a/c++/include/util/bitset/bmconst.h b/c++/include/util/bitset/bmconst.h
index e0022ef..4307a57 100644
--- a/c++/include/util/bitset/bmconst.h
+++ b/c++/include/util/bitset/bmconst.h
@@ -55,7 +55,7 @@ const unsigned set_block_mask  = 0xFFFFu;
 const unsigned set_blkblk_mask = 0xFFFFFFu;
 
 const unsigned set_block_plain_size = set_block_size / 32u;
-const unsigned set_block_plain_cnt = sizeof(bm::word_t) * 8u;
+const unsigned set_block_plain_cnt = (unsigned)(sizeof(bm::word_t)) * 8u;
 
 // Word parameters
 
@@ -70,8 +70,9 @@ typedef unsigned short gap_word_t;
 const unsigned gap_max_buff_len = 1280;
 const unsigned gap_length_threashold = set_block_size * 3; // should be 2-3 bits per word
 const unsigned gap_max_bits = 65536;
-const unsigned gap_equiv_len = 
-   (sizeof(bm::word_t) * bm::set_block_size) / sizeof(gap_word_t);
+const unsigned gap_equiv_len =
+     (unsigned)((sizeof(bm::word_t) * bm::set_block_size) / 
+                 sizeof(gap_word_t));
 const unsigned gap_levels = 4;
 const unsigned gap_max_level = bm::gap_levels - 1;
 
@@ -83,7 +84,7 @@ const unsigned set_array_shift = 8u;
 const unsigned set_array_mask  = 0xFFu;
 const unsigned set_total_blocks = (bm::set_array_size * bm::set_array_size);
 
-const unsigned bits_in_block = bm::set_block_size * sizeof(bm::word_t) * 8;
+const unsigned bits_in_block = bm::set_block_size * (unsigned)sizeof(bm::word_t) * 8;
 const unsigned bits_in_array = bm::bits_in_block * bm::set_array_size;
 
 
diff --git a/c++/include/util/bitset/bmfunc.h b/c++/include/util/bitset/bmfunc.h
index 0b91ddb..9d5045a 100644
--- a/c++/include/util/bitset/bmfunc.h
+++ b/c++/include/util/bitset/bmfunc.h
@@ -73,7 +73,7 @@ struct bv_statistics
     void add_bit_block()
     {
         ++bit_blocks;
-        unsigned mem_used = sizeof(bm::word_t) * bm::set_block_size;
+        unsigned mem_used = (unsigned)(sizeof(bm::word_t) * bm::set_block_size);
         memory_used += mem_used;
         max_serialize_mem += mem_used;
     }
@@ -82,9 +82,9 @@ struct bv_statistics
     void add_gap_block(unsigned capacity, unsigned length)
     {
         ++gap_blocks;
-        unsigned mem_used = capacity * sizeof(gap_word_t);
+        unsigned mem_used = (unsigned)(capacity * sizeof(gap_word_t));
         memory_used += mem_used;
-        max_serialize_mem += length * sizeof(gap_word_t);
+        max_serialize_mem += (unsigned)(length * sizeof(gap_word_t));
     }
 };
 
@@ -1180,7 +1180,7 @@ template<typename T> unsigned gap_set_value(unsigned val,
     BM_ASSERT(pos < bm::gap_max_bits);
     unsigned curr = gap_bfind(buf, pos, is_set);
 
-    register T end = (*buf >> 3);
+    register T end = (T)(*buf >> 3);
 	if (*is_set == val)
 	{
 		*is_set = 0;
@@ -1190,7 +1190,7 @@ template<typename T> unsigned gap_set_value(unsigned val,
 
     register T* pcurr = buf + curr;
     register T* pprev = pcurr - 1;
-    register T* pend = buf + end;
+    register T* pend  = buf + end;
 
     // Special case, first bit GAP operation. There is no platform beside it.
     // initial flag must be inverted.
@@ -1244,11 +1244,11 @@ template<typename T> unsigned gap_set_value(unsigned val,
         ::memmove(pcurr+2, pcurr,(end - curr + 1)*sizeof(T));
         *pcurr++ = (T)(pos - 1);
         *pcurr = (T)pos;
-		end+=2;
+		end = (T)(end + 2);
 	}
 
     // Set correct length word.
-    *buf = (*buf & 7) + (end << 3);
+    *buf = (T)((*buf & 7) + (end << 3));
 
     buf[end] = bm::gap_max_bits - 1;
     return end;
@@ -2384,7 +2384,7 @@ template<typename T>
 */
 template<typename T> T gap_length(const T* buf)
 {
-    return (*buf >> 3) + 1;
+    return (T)((*buf >> 3) + 1);
 }
 
 
@@ -2823,7 +2823,7 @@ void bit_count_change32(const bm::word_t* block,
     
     BM_INCWORD_BITCOUNT(*bit_count, w);
     
-    const int w_shift = sizeof(w) * 8 - 1;    
+    const int w_shift = (int)sizeof(w) * 8 - 1;    
     w ^= (w >> 1);
     BM_INCWORD_BITCOUNT(*gap_count, w);
     *gap_count -= (w_prev = (w0 >> w_shift)); // negative value correction
@@ -4722,9 +4722,12 @@ bm::set_representation best_representation(unsigned bit_count,
                                            unsigned gap_count,
                                            unsigned block_size)
 {
-    unsigned arr_size = sizeof(bm::gap_word_t) * bit_count + sizeof(bm::gap_word_t);
-    unsigned gap_size = sizeof(bm::gap_word_t) * gap_count + sizeof(bm::gap_word_t);
-    unsigned inv_arr_size = sizeof(bm::gap_word_t) * (total_possible_bitcount - bit_count) + sizeof(bm::gap_word_t);
+    unsigned arr_size = 
+        (unsigned)(sizeof(bm::gap_word_t) * bit_count + sizeof(bm::gap_word_t));
+    unsigned gap_size =
+        (unsigned)(sizeof(bm::gap_word_t) * gap_count + sizeof(bm::gap_word_t));
+    unsigned inv_arr_size = 
+        (unsigned)(sizeof(bm::gap_word_t) * (total_possible_bitcount - bit_count) + sizeof(bm::gap_word_t));
 
     if ((gap_size < block_size) && (gap_size < arr_size) && (gap_size < inv_arr_size))
     {
diff --git a/c++/include/util/bitset/bmutil.h b/c++/include/util/bitset/bmutil.h
index 113c025..4ce5a81 100644
--- a/c++/include/util/bitset/bmutil.h
+++ b/c++/include/util/bitset/bmutil.h
@@ -78,22 +78,22 @@ template<typename T>
 T ilog2(T x)
 {
     unsigned int l = 0;
-    if(x >= 1<<16) { x>>=16; l |= 16; }
-    if(x >= 1<<8)  { x>>=8; l |= 8; }
-    if(x >= 1<<4)  { x>>=4; l |= 4; }
-    if(x >= 1<<2)  { x>>=2; l |= 2; }
-    if(x >= 1<<1)  l |=1;
-    return l;
+    if (x >= 1<<16) { x = (T)(x >> 16); l |= 16; }
+    if (x >= 1<<8)  { x = (T)(x >> 8);  l |= 8; }
+    if (x >= 1<<4)  { x = (T)(x >> 4);  l |= 4; }
+    if (x >= 1<<2)  { x = (T)(x >> 2);  l |= 2; }
+    if (x >= 1<<1)  l |=1;
+    return (T)l;
 }
 
 template<>
 inline bm::gap_word_t ilog2(gap_word_t x)
 {
     unsigned int l = 0;
-    if(x >= 1<<8)  { x>>=8; l |= 8; }
-    if(x >= 1<<4)  { x>>=4; l |= 4; }
-    if(x >= 1<<2)  { x>>=2; l |= 2; }
-    if(x >= 1<<1)  l |=1;
+    if (x >= 1<<8)  { x = (bm::gap_word_t)(x >> 8); l |= 8; }
+    if (x >= 1<<4)  { x = (bm::gap_word_t)(x >> 4); l |= 4; }
+    if (x >= 1<<2)  { x = (bm::gap_word_t)(x >> 2); l |= 2; }
+    if (x >= 1<<1)  l |=1;
     return (bm::gap_word_t)l;
 }
 
@@ -140,9 +140,9 @@ template<>
 inline bm::gap_word_t ilog2_LUT<bm::gap_word_t>(bm::gap_word_t x)
 {
     unsigned l = 0;    
-    if (x & 0xff00) 
-    {
-        l += 8; x >>= 8;
+    if (x & 0xff00) {
+        l += 8;
+        x = (bm::gap_word_t)(x >> 8);
     }
     return (bm::gap_word_t)(l + first_bit_table<true>::_idx[x]);
 }
diff --git a/c++/include/util/bitset/encoding.h b/c++/include/util/bitset/encoding.h
index 9831eaa..4cf655d 100644
--- a/c++/include/util/bitset/encoding.h
+++ b/c++/include/util/bitset/encoding.h
@@ -796,7 +796,7 @@ inline decoder_little_endian::decoder_little_endian(const unsigned char* buf)
 
 BMFORCEINLINE bm::short_t decoder_little_endian::get_16()
 {
-    bm::short_t a = ((bm::short_t)buf_[0] << 8) + ((bm::short_t)buf_[1]);
+    bm::short_t a = bm::short_t(((bm::short_t)buf_[0] << 8) + ((bm::short_t)buf_[1]));
     buf_ += sizeof(a);
     return a;
 }
@@ -841,7 +841,7 @@ inline void decoder_little_endian::get_16(bm::short_t* s, unsigned count)
     const bm::short_t* s_end = s + count;
     do 
     {
-        bm::short_t a = ((bm::short_t)buf[0] << 8) + ((bm::short_t)buf[1]);
+        bm::short_t a = bm::short_t(((bm::short_t)buf[0] << 8) + ((bm::short_t)buf[1]));
         *s++ = a;
         buf += sizeof(a);
     } while (s < s_end);
diff --git a/c++/include/util/cache/icache_cf.hpp b/c++/include/util/cache/icache_cf.hpp
index 6477d3d..eb48f75 100644
--- a/c++/include/util/cache/icache_cf.hpp
+++ b/c++/include/util/cache/icache_cf.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL_ICACHE_CF__HPP
 #define UTIL_ICACHE_CF__HPP
 
-/* $Id: icache_cf.hpp 408317 2013-07-29 18:47:05Z grichenk $
+/* $Id: icache_cf.hpp 497436 2016-04-06 17:56:51Z ivanov $
 * ===========================================================================
 *
 *                            public DOMAIN NOTICE                          
@@ -133,7 +133,7 @@ public:
         const char* kCFParam_timestamp_check_expiration   = "check_expiration";
 
         list<string> opt;
-        NStr::Split(options, " \t", opt);
+        NStr::Split(options, " \t", opt, NStr::fSplit_Tokenize);
         ICache::TTimeStampFlags ts_flag = 0;
         ITERATE(list<string>, it, opt) {
             const string& opt_value = *it;
diff --git a/c++/include/util/file_manifest.hpp b/c++/include/util/file_manifest.hpp
new file mode 100644
index 0000000..232bbb5
--- /dev/null
+++ b/c++/include/util/file_manifest.hpp
@@ -0,0 +1,238 @@
+#ifndef UTIL___FILE_MANIFEST_HPP__
+#define UTIL___FILE_MANIFEST_HPP__
+
+/*  $Id: file_manifest.hpp 494188 2016-03-04 12:23:34Z ivanov $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors:  Cheinan Marks
+ *
+ * File Description:
+ *   C++ class to handle GPipe manifest files.  These are action node
+ *   newline-separated, one column file path manifests.  Do not confuse
+ *   this manifest with the queue XML manifest in gpipe/objects/manifest.
+ */
+
+
+#include <corelib/ncbiobj.hpp>
+#include <corelib/ncbiexpt.hpp>
+#include <vector>
+#include <string>
+#include <iterator>
+
+
+BEGIN_NCBI_SCOPE
+
+class CArgValue;
+
+class NCBI_XUTIL_EXPORT CFileManifest
+{
+public:
+    CFileManifest( const string & manifest_path );
+
+    /// Convenience constructor, to read a manifest from a command
+    /// line argument's value. This avoids the user having to choose
+    /// amongst AsString(), which is correct, and AsInputFile(), which
+    /// isn't supported (as there is no constructor taking a stream
+    /// as input).
+    CFileManifest( const CArgValue& manifest_path );
+
+    /// Check the manifest for consistency and open all the referenced files.
+    /// WARNING:  This method throws an exception on failure!  Be prepared to
+    /// catch it!
+    /// Success is indicated by a return without an exception.
+    void Validate() const;   /// throws CManifestException
+
+    /// Returns the manifest file path, not the files referenced in the
+    /// manifest.
+    string GetPath() const { return m_ManifestPath; }
+
+    /// Returns all the file paths referenced by the manifest.
+    vector<string> GetAllFilePaths() const;
+
+    /// Returns the first file path in the manifest.  Throws if there are more
+    /// than one file.
+    string GetSingleFilePath() const;
+
+    /// Write a list of files to a manifest.  Will overwrite any previous data.
+    void WriteManyFilePaths( const vector<string> & file_paths );
+
+protected:
+    void x_Init();
+
+private:
+    string m_ManifestPath;
+};
+
+
+class NCBI_XUTIL_EXPORT CManifestException : public CException
+{
+public:
+    enum EErrCode {
+        eEmptyManifestName
+        , eCantOpenManifestForRead
+        , eCantOpenManifestForWrite
+        , eCantOpenFileInManifest
+        , eMoreThanOneFile
+        , eInvalidFileFormat
+        , eInvalidFilePath
+    };
+
+    virtual const char* GetErrCodeString() const
+    {
+        switch (GetErrCode()) {
+            case eEmptyManifestName: 
+                return "The manifest filename was empty.";
+            case eCantOpenManifestForRead: 
+                return "Unable to open the manifest for reading.";
+            case eCantOpenManifestForWrite: 
+                return "Unable to open the manifest for writing.";
+            case eCantOpenFileInManifest: 
+                return "Unable to open a file in the manifest.";
+            case eInvalidFileFormat: 
+                return "Invalid manifest format: must be 1 or 2 columns";
+            case eInvalidFilePath: 
+                return "Invalid file path: must not contain spaces, "
+                       "quotes, or escapes";
+            default:     
+                return CException::GetErrCodeString();
+        }
+    }
+
+    NCBI_EXCEPTION_DEFAULT( CManifestException, CException );
+};
+
+
+/// Iterator to walk the files in the manifest.  Ignores comment (start with #)
+/// and blank lines.  Filters out the first column in two column manifests.
+template <class TString>
+class CBasicManifest_CI : public iterator<input_iterator_tag, TString, 
+                                          ptrdiff_t, const TString *, 
+                                          const TString &>
+{
+public:
+    typedef typename TString::value_type        TChar;
+    typedef typename TString::traits_type       TTraits;
+    typedef basic_istream<TChar, TTraits>  TIStream;
+
+    CBasicManifest_CI() : m_InputStream( NULL ) {}
+    CBasicManifest_CI( TIStream & input_stream )
+        : m_InputStream( &input_stream ),
+          m_NextValue( x_GetNextValue() )
+    {
+        ++*this;
+    }
+
+    const TString& operator*() const
+    {
+        _ASSERT( m_InputStream );
+        return m_Value;
+    }
+    const TString* operator->() const
+    {
+        _ASSERT( m_InputStream );
+        return &m_Value;
+    }
+
+    CBasicManifest_CI<TString> & operator++()
+    {
+        _ASSERT( m_InputStream );
+        if ( m_InputStream ) {
+            m_Value = m_NextValue;
+
+            if ( m_InputStream->fail() ) {
+                m_InputStream = NULL;
+            } else {
+                m_NextValue = x_GetNextValue();
+            }
+        }
+
+        return *this;
+    }
+
+    CBasicManifest_CI<TString> operator++( int )
+    {
+        CBasicManifest_CI<TString> prev( *this );
+        ++*this;
+
+        return prev;
+    }
+
+    bool operator!=( const CBasicManifest_CI<TString> & other ) const
+    {
+        return m_InputStream != other.m_InputStream;
+    }
+
+    bool operator==( const CBasicManifest_CI<TString> & other ) const
+    {
+        return !(*this != other);
+    }
+
+private:
+    TIStream *  m_InputStream;
+    TString     m_Value;
+    TString     m_NextValue;
+
+    string x_GetNextValue()
+    {
+        string next_value;
+
+        do {
+            getline( *m_InputStream, next_value );
+        } while ( *m_InputStream && 
+                  ( next_value.empty() || ( next_value[0] == '#' ) ) );
+
+        //  Filter out the first column of two column manifests
+        string::size_type  first_tab = next_value.find_first_of( '\t' );
+        string::size_type  last_tab = next_value.find_last_of( '\t' );
+        if (first_tab != last_tab) {
+            string error_string = "More than 2 columns in: " + next_value;
+            NCBI_THROW( CManifestException, eInvalidFileFormat, error_string );
+        }
+        if ( last_tab != string::npos ) {
+            next_value.erase( 0, last_tab + 1 );
+            LOG_POST( Warning << "Two column manifest was found." );
+        }
+
+        string::size_type  bad_char_pos = next_value.find_first_of(" '`\"\\");
+        if ( bad_char_pos != string::npos ) {
+            string error_string = "Invalid character at position " +
+                                    NStr::NumericToString(bad_char_pos + 1) +
+                                    ": " +
+                                    next_value.substr(0, bad_char_pos) +
+                                    ">>>" + next_value[bad_char_pos] + "<<<" +
+                                    next_value.substr(bad_char_pos + 1);
+            NCBI_THROW( CManifestException, eInvalidFilePath, error_string );
+        }
+        return  next_value;
+    }
+};
+
+typedef CBasicManifest_CI<string> CManifest_CI;
+
+
+
+END_NCBI_SCOPE
+
+#endif  //  UTIL___FILE_MANIFEST_HPP__
diff --git a/c++/include/util/format_guess.hpp b/c++/include/util/format_guess.hpp
index 44b9187..2c72698 100644
--- a/c++/include/util/format_guess.hpp
+++ b/c++/include/util/format_guess.hpp
@@ -1,7 +1,7 @@
 #ifndef FORMATGUESS__HPP
 #define FORMATGUESS__HPP
 
-/*  $Id: format_guess.hpp 474485 2015-07-29 14:04:41Z ivanov $
+/*  $Id: format_guess.hpp 488617 2016-01-04 12:42:47Z ludwigf $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -327,7 +327,7 @@ private:
 protected:
     static int s_CheckOrder[];
     
-    static const streamsize s_iTestBufferSize = 4096;
+    static const streamsize s_iTestBufferSize = 8096;
 
     CNcbiIstream& m_Stream;
     bool m_bOwnsStream;
diff --git a/c++/include/util/id_mux.hpp b/c++/include/util/id_mux.hpp
index 6e9954d..9088641 100644
--- a/c++/include/util/id_mux.hpp
+++ b/c++/include/util/id_mux.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL___ID_MUX__HPP
 #define UTIL___ID_MUX__HPP
 
-/*  $Id: id_mux.hpp 105610 2007-06-13 19:44:30Z kuznets $
+/*  $Id: id_mux.hpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -251,7 +251,7 @@ bool CIdDeMux<TBV, TBVFact>::GetCoordinatesFast(unsigned  id,
             const TBitVector& bv = *(dv[j]);
             dim_found = bv[id];
             if (dim_found) {
-                coord[i] = j;
+                coord[i] = (unsigned)j;
                 break;
             }
         } // for j
diff --git a/c++/include/util/line_reader.hpp b/c++/include/util/line_reader.hpp
index 8599329..f2f5d95 100644
--- a/c++/include/util/line_reader.hpp
+++ b/c++/include/util/line_reader.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL___LINE_READER__HPP
 #define UTIL___LINE_READER__HPP
 
-/*  $Id: line_reader.hpp 404226 2013-06-21 12:29:54Z kornbluh $
+/*  $Id: line_reader.hpp 489925 2016-01-19 21:26:37Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -71,30 +71,46 @@ public:
     /// Indicates (negatively) whether there is any more input.
     virtual bool AtEOF(void) const = 0;
 
-    /// Return the next character to be read without consuming it.
+    /// Returns the first character of the next string without consuming it.
+    /// If the next string is empty, returns zero.
+    ///  @note
+    /// Before the first call of operator++() this function returns the
+    /// first char of the first string.
+    ///  @attention
+    /// It is not guaranteed that any implementation of this function 
+    /// will stop reading at EOF, so you should check for EOF yourself
     virtual char PeekChar(void) const = 0;
 
-    /// Make a line available.  MUST be called even for the first line;
+    /// Make a line available. MUST be called even for the first line;
     /// MAY trigger EOF conditions even when also retrieving data.
+    /// When beyond the last string, becomes a no-op.
     virtual ILineReader& operator++(void) = 0;
     void ReadLine(void) { ++*this; }
 
     /// Unget current line, which must be valid.
     /// After calling this method:
-    ///   AtEOF() should return false,
-    ///   PeekChar() should return first char of the line
-    ///   call to operator*() is illegal
-    ///   operator++() will make the line current
+    ///   1. AtEOF() returns false,
+    ///   2. PeekChar() returns first char of the current line,
+    ///   3. Calling operator*() or UngetLine() is illegal,
+    ///   4. Calling operator++() will make the line current again
     virtual void UngetLine(void) = 0;
 
-    /// Return the current line, minus its terminator.
+    ///  Return the current line, minus its terminator. Before the first run of
+    ///  operator++() returns an empty CTempString.
+    ///  At EOF returns an empty CTempString.
+    /// @attention
+    ///  Right after UngetLine() calling this
+    ///  method is illegal. Call operator++() first
     virtual CTempString operator*(void) const = 0;
     CTempString GetCurrentLine(void) const { return **this; }
 
     /// Return the current (absolute) position.
     virtual CT_POS_TYPE GetPosition(void) const = 0;
 
-    /// Return the current line number (counting from 1, not 0).
+    ///  Returns the current line number (counting from 1, not 0).
+    /// @attention
+    ///  Right after constructor or after UngetLine() calling this
+    ///  method is illegal. Call operator++() first
     virtual unsigned int GetLineNumber(void) const = 0;
 };
 
diff --git a/c++/include/util/ncbi_cache.hpp b/c++/include/util/ncbi_cache.hpp
index 84f1a36..29518c9 100644
--- a/c++/include/util/ncbi_cache.hpp
+++ b/c++/include/util/ncbi_cache.hpp
@@ -1,6 +1,6 @@
 #ifndef CORELIB___NCBI_CACHE__HPP
 #define CORELIB___NCBI_CACHE__HPP
-/*  $Id: ncbi_cache.hpp 444509 2014-08-25 17:24:31Z vasilche $
+/*  $Id: ncbi_cache.hpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -381,10 +381,10 @@ CCache<TKey, TValue, THandler, TLock, TSize>::x_InsertElement(
     if (weight == 0) {
         weight = 1;
     }
-    TWeight adjusted_weight = weight + x_GetBaseWeight();
+    TWeight adjusted_weight = (TWeight)(weight + x_GetBaseWeight());
     if (adjusted_weight < weight) {
         x_PackElementIndex();
-        adjusted_weight = weight + x_GetBaseWeight();
+        adjusted_weight = (TWeight)(weight + x_GetBaseWeight());
         if (adjusted_weight < weight) {
             NCBI_THROW(CCacheException, eWeightOverflow,
                 "Cache element weight overflow");
@@ -430,10 +430,10 @@ template <class TKey, class TValue, class THandler, class TLock, class TSize>
 void CCache<TKey, TValue, THandler, TLock, TSize>::x_PackElementIndex(void)
 {
     // Overflow detected - adjust orders
-    TOrder order_shift = m_Counter - 1;
+    TOrder order_shift = (TOrder)(m_Counter - 1);
     TOrder order_max = numeric_limits<TOrder>::max();
     if ( !m_CacheSet.empty() ) {
-        TWeight weight_shift = (*m_CacheSet.begin())->m_Weight - 1;
+        TWeight weight_shift = (TWeight)((*m_CacheSet.begin())->m_Weight - 1);
         TWeight weight_max = weight_shift;
         TOrder order_min = 0;
         ITERATE(typename TCacheSet, it, m_CacheSet) {
@@ -450,7 +450,7 @@ void CCache<TKey, TValue, THandler, TLock, TSize>::x_PackElementIndex(void)
                 weight_max = e->m_Weight;
             }
         }
-        order_shift -= order_min;
+        order_shift = (TOrder)(order_shift - order_min);
         if (order_shift < 2) {
             // Can not pack orders, try slow method
             typedef set<TOrder> TOrderSet;
@@ -480,7 +480,7 @@ void CCache<TKey, TValue, THandler, TLock, TSize>::x_PackElementIndex(void)
                             "Cache element index overflow");
                 }
                 order_min = rg_from;
-                order_shift = rg_to - rg_from;
+                order_shift = (TOrder)(rg_to - rg_from);
             }
         }
         if (weight_shift <= 1  &&  weight_max + 1 <= 0) {
@@ -493,12 +493,12 @@ void CCache<TKey, TValue, THandler, TLock, TSize>::x_PackElementIndex(void)
         NON_CONST_ITERATE(typename TCacheSet, it, m_CacheSet) {
             TCacheElement* e = *it;
             if (e->m_Order > order_min) {
-                e->m_Order -= order_shift;
+                e->m_Order = (TOrder)(e->m_Order - order_shift);
             }
-            e->m_Weight -= weight_shift;
+            e->m_Weight = (TOrder)(e->m_Weight - weight_shift);
         }
     }
-    m_Counter -= order_shift;
+    m_Counter = (TOrder)(m_Counter - order_shift);
 }
 
 
diff --git a/c++/include/util/range_coll.hpp b/c++/include/util/range_coll.hpp
index 43c6b49..de4f036 100644
--- a/c++/include/util/range_coll.hpp
+++ b/c++/include/util/range_coll.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL___RANGE_COLL__HPP
 #define UTIL___RANGE_COLL__HPP
 
-/*  $Id: range_coll.hpp 479120 2015-09-16 16:48:06Z mozese2 $
+/*  $Id: range_coll.hpp 479119 2015-09-16 16:47:37Z mozese2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -53,7 +53,7 @@ struct PRangeLessPos
 // class CRangeCollection<Position> represent a sorted collection of 
 // CRange<Position>. It is guaranteed that ranges in collection do not overlap.
 // Unless DivideAt() was explicitly called, it is also guarantees that they
-// and aren't adjacent so that there is no gap beween them.
+// aren't adjacent so that there is no gap beween them.
 // Adding an interval to the collection leads to possible merging it with 
 // existing intervals.
 
diff --git a/c++/include/util/resize_iter.hpp b/c++/include/util/resize_iter.hpp
index 850ad41..a484a12 100644
--- a/c++/include/util/resize_iter.hpp
+++ b/c++/include/util/resize_iter.hpp
@@ -1,7 +1,7 @@
 #ifndef RESIZE_ITER__HPP
 #define RESIZE_ITER__HPP
 
-/*  $Id: resize_iter.hpp 103491 2007-05-04 17:18:18Z kazimird $
+/*  $Id: resize_iter.hpp 489095 2016-01-08 13:02:41Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -237,7 +237,8 @@ TElement StoreBits(TIterator& start, const TIterator& end,
     static const size_t kBitsPerElement = CHAR_BIT * sizeof(TElement);
 
     if (bit_offset) {
-        partial &= (~(TElement)0) << (kBitsPerElement - bit_offset);
+        partial = (TElement)(partial & 
+                      (~(TElement)0) << (kBitsPerElement - bit_offset));
     } else {
         partial = 0;
     }
@@ -245,7 +246,8 @@ TElement StoreBits(TIterator& start, const TIterator& end,
     if (bit_offset + bit_count <= kBitsPerElement) {
         // Everything fits in one element.
         bit_offset += bit_count;
-        partial |= data << (kBitsPerElement - bit_offset);
+        partial = (TElement)(partial | 
+                      (data << (kBitsPerElement - bit_offset)));
         if (bit_count == kBitsPerElement) {
             *(start++) = partial;
             bit_count = 0;
@@ -253,18 +255,18 @@ TElement StoreBits(TIterator& start, const TIterator& end,
         }
     } else {
         // We need to split it up.
-        *(start++) = partial | ((data >> (bit_count + bit_offset
-                                          - kBitsPerElement))
-                                & ((1 << (kBitsPerElement - bit_offset)) - 1));
+        *(start++) = (TElement)(partial | 
+            ((data >> (bit_count + bit_offset - kBitsPerElement))
+              & ((1 << (kBitsPerElement - bit_offset)) - 1)) );
         for (bit_offset += bit_count - kBitsPerElement;
              bit_offset >= kBitsPerElement;
              bit_offset -= kBitsPerElement) {
             if (start != end) {
-                *(start++) = data >> (bit_offset - kBitsPerElement);
+                *(start++) = (TElement)(data >> (bit_offset - kBitsPerElement));
             }
         }
         if (bit_offset) {
-            partial = data << (kBitsPerElement - bit_offset);
+            partial = (TElement)(data << (kBitsPerElement - bit_offset));
         } else {
             partial = 0;
         }
diff --git a/c++/include/util/retry_ctx.hpp b/c++/include/util/retry_ctx.hpp
index a5ce919..91a0510 100644
--- a/c++/include/util/retry_ctx.hpp
+++ b/c++/include/util/retry_ctx.hpp
@@ -1,7 +1,7 @@
 #ifndef RETRY_CTX__HPP
 #define RETRY_CTX__HPP
 
-/*  $Id: retry_ctx.hpp 483518 2015-11-02 14:43:40Z ivanov $
+/*  $Id: retry_ctx.hpp 486793 2015-12-10 12:44:00Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -478,7 +478,7 @@ void CRetryContext::ResetContent(void)
 inline
 bool CRetryContext::x_IsSetFlag(FFlags f) const
 {
-    return m_Flags & f;
+    return (m_Flags & f) == f;
 }
 
 
diff --git a/c++/include/util/stream_source.hpp b/c++/include/util/stream_source.hpp
new file mode 100644
index 0000000..0c12d0a
--- /dev/null
+++ b/c++/include/util/stream_source.hpp
@@ -0,0 +1,236 @@
+#ifndef UTIL___STREAM_SOURCE__HPP
+#define UTIL___STREAM_SOURCE__HPP
+
+/*  $Id: stream_source.hpp 497775 2016-04-11 11:26:07Z mozese2 $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors:  Mike DiCuccio
+ *
+ * File Description:
+ *
+ */
+
+#include <corelib/ncbistd.hpp>
+#include <corelib/ncbiargs.hpp>
+
+BEGIN_NCBI_SCOPE
+
+
+///
+/// class CInputStreamSource encapsulates details of how we supply applications
+/// with input data through sets of command-line options, and permits code to
+/// work with a standard API for accepting input data from the command-line.
+///
+/// This class offers many variants for accepting and managing input data.
+/// Currently supported modes are:
+///
+///  - Supply a single argument for an input stream of data
+///  - Supply an argument indicating a manifest file (a file whose contents
+///    list a set of files, one per line; comment lines preceded by '#' will be
+///    skipped
+///  - Supply an argument indicating an input search path, with or without a
+///    search mask, defining the files to be processed
+///
+/// Once instantiated, this class supports the ability to iterate a set of
+/// input streams using the code metaphor:
+///
+/// \code
+///     const CArgs& args = GetArgs();
+///     for (CInputStreamSource source(args);  source;  ++source) {
+///         CNcbiIstream& istr = *source;
+///         ...
+///     }
+/// \encode
+///
+/// Streams are checked for error conditions at the start (badbit or
+/// failbit before being returned from the iterator) and end (badbit
+/// after use, prior to iterating to the next stream),
+/// throwing an exception in such case. The former handles cases of files
+/// which don't exist, and the latter handles cases of disk read errors
+/// without preventing operations line getline (which sets failbit
+/// on reading the last line of input, with a terminator).
+class NCBI_XUTIL_EXPORT CInputStreamSource
+{
+public:
+    /// Supply a standard set of arguments via argument descriptions to an
+    /// application
+    ///
+    /// Currently supported arguments are:
+    ///
+    ///  - -i (-input) for a single input stream
+    ///  - -input-manifest for a manifest file
+    ///  - -input-path (with or without -input-mask) for a file search path
+    ///
+    /// Any or all of these arguments may be supplied by an application
+    ///
+    /// @param arg_desc Argument description class into which arguments will be
+    /// added
+    /// @param prefix The base prefix to use.  Providing a different value here
+    /// can be used to add a standard panel of additional arguments to control
+    /// input sources.
+    /// @param description The description that will appear in -help
+    /// @param is_mandatory A flag to indicate whether one of the configured
+    /// arguments must be provided.
+    ///
+    static void SetStandardInputArgs(CArgDescriptions& arg_desc,
+                                     const string &prefix = "input",
+                                     const string &description = "data to process",
+                                     bool is_mandatory = false);
+
+    /// Get the standard input arguments that are present in args
+    /// so we can pass them on to some other program that also uses
+    /// CInputStreamSource.
+    static vector<string> RecreateInputArgs(const CArgs& args,
+                                            const string &prefix = "input");
+
+    /// Check whether the arguments for a specific prefix have been set up in
+    /// this application
+    static bool HaveArgsForPrefix(const string &prefix = "input");
+
+    /// Default ctor
+    /// This ctor leaves the stream source empty
+    ///
+    CInputStreamSource();
+
+    /// Initialize our stream source through the arguments provided on a
+    /// command-line
+    ///
+    /// This constructor will interpret the commands supplied via
+    /// SetStandardInputArgs()
+    ///
+    /// @param args Argument class for interpretation
+    ///
+    CInputStreamSource(const CArgs& args, const string& prefix = "input");
+
+    /// Initialize from a stream
+    /// No ownership is claimed by this class - lifetime management of the
+    /// stream is the responsibility of the caller.
+    ///
+    /// @pre The stream is in a good condition, else throws an exception.
+    /// @param fname (optional) file name from whence the stream was
+    ///        created, for use in output and debug messages.
+    ///
+    void InitStream(CNcbiIstream& istr,
+                    const string& fname = kEmptyStr);
+
+    /// Initialize from a single file path.
+    ///
+    void InitFile(const string& file_path);
+
+    /// Initialize from a manifest file
+    ///
+    /// @see CFileManifest
+    ///
+    void InitManifest(const string& manifest);
+
+    /// Initialize from a file search path
+    ///
+    void InitFilesInDirSubtree(const string& file_path,
+                               const string& file_mask = kEmptyStr);
+
+    /// Initialize from a set of arguments
+    ///
+    void InitArgs(const CArgs& args, const string &prefix = "input");
+
+    /// Access the current stream
+    ///
+    /// @return The current stream
+    ///
+    CNcbiIstream& GetStream(void);
+
+    /// Access the current stream, and get the file name
+    ///
+    /// @param fname receives the name of the current file
+    /// @return The current stream
+    ///
+    NCBI_DEPRECATED
+    CNcbiIstream& GetStream(string* fname);
+
+    /// Dereferencing the stream class returns the current stream
+    /// @return The current stream
+    ///
+    CNcbiIstream& operator*();
+
+    /// Advance to the next stream in the class
+    ///
+    /// @return self, satisfying chainability of commands
+    ///
+    /// @post The old stream, if there was one, is not in a bad condition
+    ///       (badbit set as may occur if there was a disk read error;
+    ///       the failbit is ignored, since operations like geline will
+    ///       set it to indicate the last line with a line terminator).
+    ///
+    ///       The current stream, if it exists, is in a good condition
+    ///       (badbit or failbit set).
+    ///
+    ///       If these conditions aren't met, throws an exception.
+    ///
+    CInputStreamSource& operator++();
+
+    /// Determine if there are any more streams to be processed
+    ///
+    /// @return boolean, true if there are more streams
+    ///
+    operator bool();
+
+    /// Resets the iterator to the first stream in the class
+    ///
+    /// @return self
+    CInputStreamSource& Rewind(void);
+
+    /// Returns the current file name
+    string GetCurrentFileName(void) const;
+
+    /// Returns the current file index and the total number of files
+    ///
+    /// @param count
+    ///   address of variable which receives the total number of files
+    /// @return
+    ///   the current file index
+    size_t GetCurrentStreamIndex(size_t* count = nullptr) const;
+
+private:
+    CArgs m_Args;
+    string m_Prefix;
+
+    CNcbiIstream* m_Istr;
+    auto_ptr<CNcbiIfstream> m_IstrOwned;
+    vector<string> m_Files;
+    size_t m_CurrIndex;
+    string m_CurrFile;
+
+    /// forbidden
+    CInputStreamSource(const CInputStreamSource&);
+    CInputStreamSource& operator=(const CInputStreamSource&);
+};
+
+
+
+
+
+END_NCBI_SCOPE
+
+
+#endif  // UTIL___STREAM_SOURCE__HPP
diff --git a/c++/include/util/sync_queue.hpp b/c++/include/util/sync_queue.hpp
index 8bc7321..50877ed 100644
--- a/c++/include/util/sync_queue.hpp
+++ b/c++/include/util/sync_queue.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL___SYNC_QUEUE__HPP
 #define UTIL___SYNC_QUEUE__HPP
 
-/*  $Id: sync_queue.hpp 347572 2011-12-19 19:48:05Z ivanovp $
+/*  $Id: sync_queue.hpp 490388 2016-01-25 16:58:30Z satskyse $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -145,7 +145,7 @@ BEGIN_NCBI_SCOPE
 
 
 // This class is for internal use only.
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 class CSyncQueue_InternalAutoLock;
 
 
@@ -153,16 +153,18 @@ class CSyncQueue_InternalAutoLock;
 template <class Type, class Container>
 class CSyncQueue_I_Base;
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 class CSyncQueue_I;
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 class CSyncQueue_ConstAccessGuard;
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 class CSyncQueue_AccessGuard;
 
 
+class CSyncQueue_DefaultTraits;
+
 
 /// Thread-safe queue object with a blocking mechanism.
 ///
@@ -171,8 +173,20 @@ class CSyncQueue_AccessGuard;
 /// long time for some bulk operations. This can be achieved by
 /// CSyncQueue::T*AccessGuard classes.
 ///
-/// CSyncQueue can be used with C++ Toolkit threads as well as with any kind
-/// of native threads. The only difference between these cases is passing
+/// CSyncQueue can be used in single threaded applications or multithreaded
+/// applications with C++ Toolkit threads as well as with any kind of
+/// native threads. In case of multithreaded applications a CSyncQueue object
+/// could be used only from one thread or from many threads. To distinguish
+/// how the object is accessed the template supports the 'Traits' parameter.
+/// The traits in particular report if the the queue is accessed from many
+/// threads (see the CSyncQueue_DefaultTraits::IsUsedConcurrently() description
+/// for the details of what could happen if the IsUsedConcurrently() is not
+/// implemented properly). The default traits suppose that the C++ Toolkit
+/// CThread class is used to create threads.
+///
+/// There is a difference as well of how the timeouts are handled depending on
+/// what threads are used in the application if so: the C++ Toolkit threads or
+/// some other threads. The only difference between these cases is passing
 /// NULL as timeout in methods Push(), Pop() and Clear(). When C++ Toolkit
 /// CThread class is used to create application's threads then NULL value will
 /// mean indefinite timeout (as stated in comments to those methods). But if
@@ -192,13 +206,18 @@ class CSyncQueue_AccessGuard;
 ///   pop_front(). For other containers you need to implement an adaptor to
 ///   use it in CSyncQueue. For STL set, multiset and priority_queue classes
 ///   adaptors implemented further in this file.
+/// @param Traits
+///   Traits which are used to alter internal behavior. Currently it only
+///   affects the way how the number of running threads is detected.
+///   @sa CSyncQueue_DefaultTraits
 
-template < class Type, class Container = deque<Type> >
+template < class Type, class Container = deque<Type>,
+           class Traits = CSyncQueue_DefaultTraits >
 class CSyncQueue
 {
 public:
     /// Short name of this queue type
-    typedef CSyncQueue<Type, Container>              TThisType;
+    typedef CSyncQueue<Type, Container, Traits>      TThisType;
     /// Type of values stored in the queue
     typedef typename Container::value_type           TValue;
     /// Type of size of the queue
@@ -306,9 +325,10 @@ public:
 
 public:
     /// Type of access guardian for constant queue
-    typedef CSyncQueue_ConstAccessGuard<Type, Container>    TConstAccessGuard;
+    typedef CSyncQueue_ConstAccessGuard<Type, Container,
+                                        Traits>             TConstAccessGuard;
     /// Type of access guardian for non-constant queue
-    typedef CSyncQueue_AccessGuard<Type, Container>         TAccessGuard;
+    typedef CSyncQueue_AccessGuard<Type, Container, Traits> TAccessGuard;
 
 private:
     /// Type of underlying iterator
@@ -316,9 +336,11 @@ private:
     /// Type of underlying constant iterator
     typedef typename Container::const_iterator              TNativeConstIter;
     /// Constant iterator on this queue
-    typedef CSyncQueue_I<Type, Container, TNativeConstIter> TConstIterator;
+    typedef CSyncQueue_I<Type, Container,
+                         TNativeConstIter, Traits>          TConstIterator;
     /// Non-constant iterator on this queue
-    typedef CSyncQueue_I<Type, Container, TNativeIter>      TIterator;
+    typedef CSyncQueue_I<Type, Container,
+                         TNativeIter, Traits>               TIterator;
 
 private:
     // Prohibit copy and assignment
@@ -327,7 +349,8 @@ private:
 
     /// Short name of auto-lock for this queue type.
     /// For internal use only.
-    typedef CSyncQueue_InternalAutoLock<Type, Container> TAutoLock;
+    typedef CSyncQueue_InternalAutoLock<Type, Container, Traits>
+                                                            TAutoLock;
 
     /// Lock access to the queue.
     /// @note  This call will block if the queue is already locked by
@@ -517,15 +540,79 @@ private:
     mutable int m_LockCount;
 
     //
-    friend class CSyncQueue_ConstAccessGuard <Type, Container>;
-    friend class CSyncQueue_AccessGuard      <Type, Container>;
-    friend class CSyncQueue_InternalAutoLock <Type, Container>;
-    friend class CSyncQueue_I                <Type, Container, TNativeIter>;
-    friend class CSyncQueue_I                <Type, Container, TNativeConstIter>;
+    friend class CSyncQueue_ConstAccessGuard <Type, Container, Traits>;
+    friend class CSyncQueue_AccessGuard      <Type, Container, Traits>;
+    friend class CSyncQueue_InternalAutoLock <Type, Container, Traits>;
+    friend class CSyncQueue_I                <Type, Container,
+                                              TNativeIter, Traits>;
+    friend class CSyncQueue_I                <Type, Container,
+                                              TNativeConstIter, Traits>;
 };
 
 
 
+/// Default traits for the CSyncQueue class.
+/// It also serves as a base class for user defined CSyncQueue traits.
+class CSyncQueue_DefaultTraits
+{
+    public:
+        /// Tells if the queue can be used from many threads.
+        ///
+        /// Derived classes can re-implement this method. If this method
+        /// provides incorrect information then the following two cases lead
+        /// to specific problems:
+        /// 1. The application is in a single thread mode or does not use the
+        ///    queue from many threads concurrently but the method tells the
+        ///    queue can be used concurrently:
+        ///    the methods with timeouts will wait for the specified timeout
+        ///    even if it is an infinite one.
+        /// 2. The application is multithreaded and the queue is used from many
+        ///    threads but the method tells the queue cannot be used
+        ///    concurrently:
+        ///    the methods with timeouts will return right away without waiting
+        ///    during the specified timeout.
+        static bool  IsUsedConcurrently(void)
+        {
+            return CThread::GetThreadsCount() > 0;
+        }
+
+        /// At the moment the only requirement to the traits is to provide
+        /// a static function which tells f the queue can be used from many
+        /// threads (IsUsedConcurrently()).
+        /// Later on the traits could be extended while the CSyncQueue template
+        /// arguments will not be changed.
+        /// To make sure that future extensions of the traits won't break the
+        /// existing user code the alternative implementations of the
+        /// CSyncQueue traits must derive from CSyncQueue_DefaultTraits.
+        static void
+        CSyncQueue_Traits_Must_Be_Inherited_From_CSyncQueue_DefaultTraits(void)
+        {}
+};
+
+
+/// Convenience trait implementation which tells that the queue can be used
+/// from many threads.
+class CSyncQueue_Traits_ConcurrencyOn : public CSyncQueue_DefaultTraits
+{
+    public:
+        static bool IsUsedConcurrently(void)
+        {
+            return true;
+        }
+};
+
+/// Convenience trait implementation which tells that the queue cannot be used
+/// from many threads.
+class CSyncQueue_Traits_ConcurrencyOff : public CSyncQueue_DefaultTraits
+{
+    public:
+        static bool IsUsedConcurrently(void)
+        {
+            return false;
+        }
+};
+
+
 
 /// Access guard to a constant CSyncQueue. This guard guarantees that
 /// while it is alive the queue is locked and no other thread can change it.
@@ -538,12 +625,12 @@ private:
 /// Full description and examples of using look here:
 /// @ref CSyncQueueDescription.
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 class CSyncQueue_ConstAccessGuard
 {
 public:
     /// Queue type that this object can guard
-    typedef const CSyncQueue<Type, Container>           TQueue;
+    typedef const CSyncQueue<Type, Container, Traits>   TQueue;
     /// Type of size of the queue
     typedef typename TQueue::TSize                      TSize;
     /// Type of values stored in the queue
@@ -595,7 +682,7 @@ public:
 
 private:
     // Prohibit assignment and copy constructor
-    typedef CSyncQueue_ConstAccessGuard<Type, Container> TThisType;
+    typedef CSyncQueue_ConstAccessGuard<Type, Container, Traits> TThisType;
     CSyncQueue_ConstAccessGuard(const TThisType&);
     TThisType& operator= (const TThisType&);
 
@@ -617,9 +704,11 @@ private:
 
     // friends
     friend
-    class CSyncQueue_I<Type, Container, typename TQueue::TNativeIter>;
+    class CSyncQueue_I<Type, Container,
+                       typename TQueue::TNativeIter, Traits>;
     friend
-    class CSyncQueue_I<Type, Container, typename TQueue::TNativeConstIter>;
+    class CSyncQueue_I<Type, Container,
+                       typename TQueue::TNativeConstIter, Traits>;
 };
 
 
@@ -633,15 +722,16 @@ private:
 /// Full description and examples of using look here:
 /// @ref CSyncQueueDescription.
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 class CSyncQueue_AccessGuard
-    : public CSyncQueue_ConstAccessGuard<Type, Container>
+    : public CSyncQueue_ConstAccessGuard<Type, Container, Traits>
 {
 public:
     /// Short name of the ancestor class
-    typedef CSyncQueue_ConstAccessGuard<Type, Container>   TBaseType;
+    typedef CSyncQueue_ConstAccessGuard<Type, Container, Traits>
+                                                           TBaseType;
     /// Queue type that this object can guard
-    typedef CSyncQueue<Type, Container>                    TQueue;
+    typedef CSyncQueue<Type, Container, Traits>            TQueue;
     /// Type of size of the queue
     typedef typename TQueue::TSize                         TSize;
     /// Type of values stored in the queue
@@ -713,7 +803,7 @@ public:
 
 private:
     // Prohibit assignment and copy constructor
-    typedef CSyncQueue_AccessGuard<Type, Container> TThisType;
+    typedef CSyncQueue_AccessGuard<Type, Container, Traits> TThisType;
     CSyncQueue_AccessGuard(const TThisType&);
     TThisType& operator= (const TThisType&);
 };
@@ -754,18 +844,20 @@ public:
 /// All iterators can normally operate only when access guardian is active.
 /// When access guardian is destroyed all iterator methods will throw
 /// CSyncQueueException.
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 class CSyncQueue_I : public CSyncQueue_I_Base<Type, Container>
 {
 public:
     /// Short name for this type
-    typedef CSyncQueue_I<Type, Container, TNativeIterator>  TThisType;
+    typedef CSyncQueue_I<Type, Container,
+                         TNativeIterator, Traits>           TThisType;
     /// Queue type that this object will iterate over
-    typedef CSyncQueue<Type, Container>                     TQueue;
+    typedef CSyncQueue<Type, Container, Traits>             TQueue;
     /// Type of constant access guardian
-    typedef CSyncQueue_ConstAccessGuard<Type, Container>    TConstAccessGuard;
+    typedef CSyncQueue_ConstAccessGuard<Type,
+                                        Container, Traits>  TConstAccessGuard;
     /// Type of access guardian
-    typedef CSyncQueue_AccessGuard<Type, Container>         TAccessGuard;
+    typedef CSyncQueue_AccessGuard<Type, Container, Traits> TAccessGuard;
     /// Type of the difference between to iterators
     typedef typename TNativeIterator::difference_type       TDiff;
     /// Type of reference to stored value
@@ -858,8 +950,8 @@ private:
 
 
     // friends
-    friend class CSyncQueue_ConstAccessGuard<Type, Container>;
-    friend class CSyncQueue_AccessGuard<Type, Container>;
+    friend class CSyncQueue_ConstAccessGuard<Type, Container, Traits>;
+    friend class CSyncQueue_AccessGuard<Type, Container, Traits>;
 
     // Const iterator must be friend of non-const iterator. But const
     // iterator cannot be friend of itself (gives compile error on
@@ -867,7 +959,7 @@ private:
     typedef typename
     GetTypeWhenNotEqual<typename TQueue::TNativeConstIter,
                         TNativeIterator>::Result       TIntrnNativeConstIter;
-    friend class CSyncQueue_I<Type, Container, TIntrnNativeConstIter>;
+    friend class CSyncQueue_I<Type, Container, TIntrnNativeConstIter, Traits>;
 };
 
 
@@ -1058,12 +1150,12 @@ inline void ThrowSyncQueueEmpty(void) {
 /// For internal use in CSyncQueue only. Do not use it in your applications.
 /// Use CSyncQueue_AccessLock instead.
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 class CSyncQueue_InternalAutoLock
 {
 public:
     /// Short name for queue type that this object can lock
-    typedef CSyncQueue<Type, Container>   TQueue;
+    typedef CSyncQueue<Type, Container, Traits>   TQueue;
 
     /// Default ctor
     CSyncQueue_InternalAutoLock() : m_Queue(NULL)  {}
@@ -1119,7 +1211,7 @@ public:
 
 private:
     // Prohibit assignment and copy constructor
-    typedef CSyncQueue_InternalAutoLock<Type, Container> TMyType;
+    typedef CSyncQueue_InternalAutoLock<Type, Container, Traits> TMyType;
     CSyncQueue_InternalAutoLock(const TMyType&);
     TMyType& operator= (const TMyType&);
 
@@ -1131,9 +1223,9 @@ private:
 
 //   CSyncQueue
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-CSyncQueue<Type, Container>::CSyncQueue(TSize max_size)
+CSyncQueue<Type, Container, Traits>::CSyncQueue(TSize max_size)
     : m_Size(0),
       m_MaxSize(max_size),
       m_TrigLock(1, 1),
@@ -1147,33 +1239,35 @@ CSyncQueue<Type, Container>::CSyncQueue(TSize max_size)
         NCBI_THROW(CSyncQueueException, eWrongMaxSize,
                    "Maximum size of the queue must be greater than zero");
     }
+
+    // This is only to enforce inheritance of the Traits class from
+    // CSyncQueue_DefaultTraits class.
+    Traits::CSyncQueue_Traits_Must_Be_Inherited_From_CSyncQueue_DefaultTraits();
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-bool CSyncQueue<Type, Container>::IsEmpty(void) const
+bool CSyncQueue<Type, Container, Traits>::IsEmpty(void) const
 {
     return m_Size == 0;
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-bool CSyncQueue<Type, Container>::IsFull(void) const
+bool CSyncQueue<Type, Container, Traits>::IsFull(void) const
 {
     return m_Size >= m_MaxSize;
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-bool CSyncQueue<Type, Container>::x_Lock(const CTimeSpan* timeout) const
+bool CSyncQueue<Type, Container, Traits>::x_Lock(const CTimeSpan* timeout) const
 {
     if (timeout) {
-        if ( !m_TrigLock.TryWait(timeout->GetCompleteSeconds(),
-                                 timeout->GetNanoSecondsAfterSecond()) )
-        {
+        if ( !m_TrigLock.TryWait(CTimeout(*timeout)) ) {
             return false;
         }
     }
@@ -1185,9 +1279,9 @@ bool CSyncQueue<Type, Container>::x_Lock(const CTimeSpan* timeout) const
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::x_Unlock(void) const
+void CSyncQueue<Type, Container, Traits>::x_Unlock(void) const
 {
     if (!IsFull()   &&  m_CntWaitNotFull.Get() > 0) {
         m_TrigNotFull.Post();
@@ -1200,11 +1294,12 @@ void CSyncQueue<Type, Container>::x_Unlock(void) const
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::x_DoubleLock(TAutoLock*       my_lock,
-                                               TAutoLock*       other_lock,
-                                               const TThisType& other_obj)
+void CSyncQueue<Type, Container, Traits>::x_DoubleLock(
+                                                TAutoLock*       my_lock,
+                                                TAutoLock*       other_lock,
+                                                const TThisType& other_obj)
     const
 {
     // The order of locking is significant
@@ -1222,9 +1317,10 @@ void CSyncQueue<Type, Container>::x_DoubleLock(TAutoLock*       my_lock,
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::x_LockAndWait(TAutoLock*       lock,
+void CSyncQueue<Type, Container, Traits>::x_LockAndWait(
+                                                TAutoLock*       lock,
                                                 const CTimeSpan* full_tmo,
                                                 const CTimeSpan* service_tmo,
                                                 TCheckFunc       func_to_check,
@@ -1233,17 +1329,24 @@ void CSyncQueue<Type, Container>::x_LockAndWait(TAutoLock*       lock,
                                                 TErrorThrower    throw_error)
     const
 {
+   // TODO: change to use CTimeout instead
     auto_ptr<CTimeSpan> real_timeout;
 
     if (full_tmo) {
         real_timeout.reset(new CTimeSpan(*full_tmo));
     }
-    else if (CThread::GetThreadsCount() == 0) {
-        // If we are in single-thread mode or we didn't run other threads
-        // then we will wait forever. Avoid it and let's think that timeout
-        // was ran over.
+    #if defined(NCBI_THREADS)
+    else if (!Traits::IsUsedConcurrently()) {
+        // If the queue is not used from many threads then we will wait forever.
+        // Avoid it and let's think that timeout was ran over.
         real_timeout.reset(new CTimeSpan(0.0));
     }
+    #else
+    else {
+        // Single-thread mode
+        real_timeout.reset(new CTimeSpan(0.0));
+    }
+    #endif
 
     if (real_timeout.get()) {
         // finite timeout
@@ -1263,8 +1366,8 @@ void CSyncQueue<Type, Container>::x_LockAndWait(TAutoLock*       lock,
             counter->Add(1);
             lock->Unlock();
 
-            bool is_success = trigger->TryWait(tmo.GetCompleteSeconds(),
-                                               tmo.GetNanoSecondsAfterSecond());
+            // TODO: change 'tmo' to CTimeout!
+            bool is_success = trigger->TryWait(CTimeout(tmo));
 
             // To minimize unnecessary semaphore increasing we decrease
             // the counter asap, before we can acquire queue lock.
@@ -1302,9 +1405,9 @@ void CSyncQueue<Type, Container>::x_LockAndWait(TAutoLock*       lock,
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>
+void CSyncQueue<Type, Container, Traits>
     ::x_LockAndWaitWhileFull(TAutoLock*       lock, 
                              const CTimeSpan* full_tmo,
                              const CTimeSpan* service_tmo)
@@ -1315,9 +1418,9 @@ void CSyncQueue<Type, Container>
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>
+void CSyncQueue<Type, Container, Traits>
     ::x_LockAndWaitWhileEmpty(TAutoLock* lock, 
                              const CTimeSpan* full_tmo,
                              const CTimeSpan* service_tmo)
@@ -1328,9 +1431,10 @@ void CSyncQueue<Type, Container>
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::x_GuardedLock(const CTimeSpan* timeout) const
+void CSyncQueue<Type, Container, Traits>::x_GuardedLock(
+                                                const CTimeSpan* timeout) const
 {
     if (x_IsGuarded()) {
         ++m_LockCount;
@@ -1350,9 +1454,9 @@ void CSyncQueue<Type, Container>::x_GuardedLock(const CTimeSpan* timeout) const
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::x_GuardedUnlock(void) const
+void CSyncQueue<Type, Container, Traits>::x_GuardedUnlock(void) const
 {
     _ASSERT( x_IsGuarded() );
 
@@ -1366,9 +1470,9 @@ void CSyncQueue<Type, Container>::x_GuardedUnlock(void) const
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-bool CSyncQueue<Type, Container>::x_IsGuarded(void) const
+bool CSyncQueue<Type, Container, Traits>::x_IsGuarded(void) const
 {
     if (m_CurGuardTID == TThreadSystemID(kThreadSystemID_None))
         return false;
@@ -1379,27 +1483,27 @@ bool CSyncQueue<Type, Container>::x_IsGuarded(void) const
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TSize
-    CSyncQueue<Type, Container>::GetSize(void) const
+typename CSyncQueue<Type, Container, Traits>::TSize
+    CSyncQueue<Type, Container, Traits>::GetSize(void) const
 {
     return m_Size;
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TSize
-    CSyncQueue<Type, Container>::GetMaxSize(void) const
+typename CSyncQueue<Type, Container, Traits>::TSize
+    CSyncQueue<Type, Container, Traits>::GetMaxSize(void) const
 {
     return m_MaxSize;
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::x_Push_NonBlocking(const TValue& elem)
+void CSyncQueue<Type, Container, Traits>::x_Push_NonBlocking(const TValue& elem)
 {
     // NOTE. This check is active only when the queue is under access guard
     if ( IsFull() ) {
@@ -1411,10 +1515,10 @@ void CSyncQueue<Type, Container>::x_Push_NonBlocking(const TValue& elem)
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TValue
-    CSyncQueue<Type, Container>::x_Pop_NonBlocking(void)
+typename CSyncQueue<Type, Container, Traits>::TValue
+    CSyncQueue<Type, Container, Traits>::x_Pop_NonBlocking(void)
 {
     // NOTE. This check is active only when the queue is under access guard
     if (IsEmpty()) {
@@ -1428,20 +1532,20 @@ typename CSyncQueue<Type, Container>::TValue
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::x_Clear_NonBlocking(void)
+void CSyncQueue<Type, Container, Traits>::x_Clear_NonBlocking(void)
 {
     m_Store.clear();
     m_Size = 0;
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::Push(const TValue&    elem,
-                                       const CTimeSpan* full_tmo,
-                                       const CTimeSpan* service_tmo)
+void CSyncQueue<Type, Container, Traits>::Push(const TValue&    elem,
+                                               const CTimeSpan* full_tmo,
+                                               const CTimeSpan* service_tmo)
 {
     TAutoLock lock;
 
@@ -1453,20 +1557,20 @@ void CSyncQueue<Type, Container>::Push(const TValue&    elem,
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::Push(const TValue&    elem,
-                                       const CTimeSpan* timeout)
+void CSyncQueue<Type, Container, Traits>::Push(const TValue&    elem,
+                                               const CTimeSpan* timeout)
 {
     Push(elem, timeout, timeout);
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TValue
-    CSyncQueue<Type, Container>::Pop(const CTimeSpan* full_tmo,
-                                     const CTimeSpan* service_tmo)
+typename CSyncQueue<Type, Container, Traits>::TValue
+    CSyncQueue<Type, Container, Traits>::Pop(const CTimeSpan* full_tmo,
+                                             const CTimeSpan* service_tmo)
 {
     TAutoLock lock;
 
@@ -1478,18 +1582,18 @@ typename CSyncQueue<Type, Container>::TValue
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TValue
-CSyncQueue<Type, Container>::Pop(const CTimeSpan* timeout)
+typename CSyncQueue<Type, Container, Traits>::TValue
+CSyncQueue<Type, Container, Traits>::Pop(const CTimeSpan* timeout)
 {
     return Pop(timeout, timeout);
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::Clear(const CTimeSpan* timeout)
+void CSyncQueue<Type, Container, Traits>::Clear(const CTimeSpan* timeout)
 {
     TAutoLock lock;
 
@@ -1503,9 +1607,9 @@ void CSyncQueue<Type, Container>::Clear(const CTimeSpan* timeout)
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue<Type, Container>::CopyTo(TThisType* other) const
+void CSyncQueue<Type, Container, Traits>::CopyTo(TThisType* other) const
 {
     if (this != other) {
         TAutoLock my_lock;
@@ -1541,46 +1645,46 @@ void CSyncQueue<Type, Container>::CopyTo(TThisType* other) const
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TNativeIter
-    CSyncQueue<Type, Container>::x_Begin()
+typename CSyncQueue<Type, Container, Traits>::TNativeIter
+    CSyncQueue<Type, Container, Traits>::x_Begin()
 {
     return m_Store.begin();
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TNativeConstIter
-    CSyncQueue<Type, Container>::x_Begin() const
+typename CSyncQueue<Type, Container, Traits>::TNativeConstIter
+    CSyncQueue<Type, Container, Traits>::x_Begin() const
 {
     return m_Store.begin();
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TNativeIter
-    CSyncQueue<Type, Container>::x_End()
+typename CSyncQueue<Type, Container, Traits>::TNativeIter
+    CSyncQueue<Type, Container, Traits>::x_End()
 {
     return m_Store.end();
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TNativeConstIter
-    CSyncQueue<Type, Container>::x_End() const
+typename CSyncQueue<Type, Container, Traits>::TNativeConstIter
+    CSyncQueue<Type, Container, Traits>::x_End() const
 {
     return m_Store.end();
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TNativeIter
-    CSyncQueue<Type, Container>::x_Erase(TNativeIter iter)
+typename CSyncQueue<Type, Container, Traits>::TNativeIter
+    CSyncQueue<Type, Container, Traits>::x_Erase(TNativeIter iter)
 {
     TNativeIter res = m_Store.erase(iter);
     --m_Size;
@@ -1588,11 +1692,11 @@ typename CSyncQueue<Type, Container>::TNativeIter
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue<Type, Container>::TNativeIter
-    CSyncQueue<Type, Container>::x_Erase(TNativeIter from_iter,
-                                         TNativeIter to_iter)
+typename CSyncQueue<Type, Container, Traits>::TNativeIter
+    CSyncQueue<Type, Container, Traits>::x_Erase(TNativeIter from_iter,
+                                                 TNativeIter to_iter)
 {
     // Count number of elements to delete. Some container's iterators
     // don't have operator- and operator<. So we have to imitate them.
@@ -1619,9 +1723,9 @@ typename CSyncQueue<Type, Container>::TNativeIter
 
 //   CSyncQueue_I
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>::
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>::
 CSyncQueue_I(TConstAccessGuard* guard, const TNativeIterator& iter)
     : m_Guard(guard),
       m_Iter (iter),
@@ -1632,18 +1736,18 @@ CSyncQueue_I(TConstAccessGuard* guard, const TNativeIterator& iter)
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>::~CSyncQueue_I(void)
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>::~CSyncQueue_I(void)
 {
     if ( m_Valid )
         m_Guard->x_RemoveIter(this);
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>::
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>::
 CSyncQueue_I(const TThisType& other)
     : m_Valid(false)
 {
@@ -1651,9 +1755,9 @@ CSyncQueue_I(const TThisType& other)
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>::
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>::
 CSyncQueue_I(const TInternalNonConst& other)
     : m_Guard(other.m_Guard),
       m_Iter (other.m_Iter),
@@ -1664,10 +1768,10 @@ CSyncQueue_I(const TInternalNonConst& other)
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>&
-    CSyncQueue_I<Type, Container, TNativeIterator>
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>&
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>
         ::operator= (const TThisType& other)
 {
     if ( m_Valid )
@@ -1684,9 +1788,9 @@ CSyncQueue_I<Type, Container, TNativeIterator>&
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-void CSyncQueue_I<Type, Container, TNativeIterator>::Invalidate(void)
+void CSyncQueue_I<Type, Container, TNativeIterator, Traits>::Invalidate(void)
 {
     m_Guard->x_RemoveIter(this);
     m_Valid = false;
@@ -1695,9 +1799,9 @@ void CSyncQueue_I<Type, Container, TNativeIterator>::Invalidate(void)
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-void CSyncQueue_I<Type, Container, TNativeIterator>
+void CSyncQueue_I<Type, Container, TNativeIterator, Traits>
     ::CheckGuard(TConstAccessGuard *guard) const
 {
     if (m_Guard != guard) {
@@ -1706,9 +1810,10 @@ void CSyncQueue_I<Type, Container, TNativeIterator>
     }
 }
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-void CSyncQueue_I<Type, Container, TNativeIterator>::CheckValid(void) const
+void CSyncQueue_I<Type, Container,
+                  TNativeIterator, Traits>::CheckValid(void) const
 {
     if ( !m_Valid ) {
         NCBI_THROW(CSyncQueueException, eIterNotValid,
@@ -1718,9 +1823,9 @@ void CSyncQueue_I<Type, Container, TNativeIterator>::CheckValid(void) const
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-void CSyncQueue_I<Type, Container, TNativeIterator>
+void CSyncQueue_I<Type, Container, TNativeIterator, Traits>
     ::CheckMatched(const TThisType& other) const
 {
     if (m_Guard != other.m_Guard) {
@@ -1730,19 +1835,19 @@ void CSyncQueue_I<Type, Container, TNativeIterator>
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
 TNativeIterator
-    CSyncQueue_I<Type, Container, TNativeIterator>::x_GetBase() const
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>::x_GetBase() const
 {
     return m_Iter;
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>&
-    CSyncQueue_I<Type, Container, TNativeIterator>::operator++ (void)
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>&
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>::operator++ (void)
 {
     CheckValid();
 
@@ -1751,10 +1856,10 @@ CSyncQueue_I<Type, Container, TNativeIterator>&
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>
-    CSyncQueue_I<Type, Container, TNativeIterator>::operator++ (int)
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>::operator++ (int)
 {
     CheckValid();
 
@@ -1764,10 +1869,10 @@ CSyncQueue_I<Type, Container, TNativeIterator>
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>&
-    CSyncQueue_I<Type, Container, TNativeIterator>::operator-- (void)
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>&
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>::operator-- (void)
 {
     CheckValid();
 
@@ -1776,10 +1881,10 @@ CSyncQueue_I<Type, Container, TNativeIterator>&
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>
-    CSyncQueue_I<Type, Container, TNativeIterator>::operator-- (int)
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>::operator-- (int)
 {
     CheckValid();
 
@@ -1789,10 +1894,11 @@ CSyncQueue_I<Type, Container, TNativeIterator>
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>&
-    CSyncQueue_I<Type, Container, TNativeIterator>::operator+= (TDiff offset)
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>&
+    CSyncQueue_I<Type, Container,
+                 TNativeIterator, Traits>::operator+= (TDiff offset)
 {
     CheckValid();
 
@@ -1801,10 +1907,11 @@ CSyncQueue_I<Type, Container, TNativeIterator>&
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>&
-    CSyncQueue_I<Type, Container, TNativeIterator>::operator-= (TDiff offset)
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>&
+    CSyncQueue_I<Type, Container,
+                 TNativeIterator, Traits>::operator-= (TDiff offset)
 {
     CheckValid();
 
@@ -1813,10 +1920,10 @@ CSyncQueue_I<Type, Container, TNativeIterator>&
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>
-    CSyncQueue_I<Type, Container, TNativeIterator>
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>
         ::operator+ (TDiff offset) const
 {
     CheckValid();
@@ -1827,20 +1934,20 @@ CSyncQueue_I<Type, Container, TNativeIterator>
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator> operator+
-(typename CSyncQueue_I<Type, Container, TNativeIterator>::TDiff  offset,
- const    CSyncQueue_I<Type, Container, TNativeIterator>&        iter)
+CSyncQueue_I<Type, Container, TNativeIterator, Traits> operator+
+(typename CSyncQueue_I<Type, Container, TNativeIterator, Traits>::TDiff  offset,
+ const    CSyncQueue_I<Type, Container, TNativeIterator, Traits>&        iter)
 {
     return iter + offset;
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-CSyncQueue_I<Type, Container, TNativeIterator>
-    CSyncQueue_I<Type, Container, TNativeIterator>
+CSyncQueue_I<Type, Container, TNativeIterator, Traits>
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>
         ::operator- (TDiff offset) const
 {
     CheckValid();
@@ -1851,10 +1958,10 @@ CSyncQueue_I<Type, Container, TNativeIterator>
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-typename CSyncQueue_I<Type, Container, TNativeIterator>::TDiff
-    CSyncQueue_I<Type, Container, TNativeIterator>
+typename CSyncQueue_I<Type, Container, TNativeIterator, Traits>::TDiff
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>
         ::operator- (const TThisType& other) const
 {
     CheckValid();
@@ -1866,23 +1973,26 @@ typename CSyncQueue_I<Type, Container, TNativeIterator>::TDiff
 
 
 // Additional difference between const and non-const iterators
-template <class Type, class Container, class TNativeIterL, class TNativeIterR>
+template <class Type, class Container,
+          class TNativeIterL, class TNativeIterR, class Traits>
 inline
-typename CSyncQueue_I<Type, Container, TNativeIterL>::TDiff
-    operator- (const CSyncQueue_I<Type, Container, TNativeIterL>&  left,
-               const CSyncQueue_I<Type, Container, TNativeIterR>&  right)
+typename CSyncQueue_I<Type, Container, TNativeIterL, Traits>::TDiff
+    operator- (const CSyncQueue_I<Type, Container, TNativeIterL, Traits>&  left,
+               const CSyncQueue_I<Type, Container, TNativeIterR, Traits>&  right)
 {
     typedef typename
-        CSyncQueue<Type, Container>::TAccessGuard::TConstIterator TConstIterator;
+        CSyncQueue<Type, Container, Traits>::TAccessGuard::TConstIterator
+                                                                TConstIterator;
 
     return TConstIterator(left) - TConstIterator(right);
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-typename CSyncQueue_I<Type, Container, TNativeIterator>::TRef
-    CSyncQueue_I<Type, Container, TNativeIterator>::operator* (void) const
+typename CSyncQueue_I<Type, Container, TNativeIterator, Traits>::TRef
+    CSyncQueue_I<Type, Container,
+                 TNativeIterator, Traits>::operator* (void) const
 {
     CheckValid();
 
@@ -1890,10 +2000,11 @@ typename CSyncQueue_I<Type, Container, TNativeIterator>::TRef
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-typename CSyncQueue_I<Type, Container, TNativeIterator>::TPtr
-    CSyncQueue_I<Type, Container, TNativeIterator>::operator-> (void) const
+typename CSyncQueue_I<Type, Container, TNativeIterator, Traits>::TPtr
+    CSyncQueue_I<Type, Container,
+                 TNativeIterator, Traits>::operator-> (void) const
 {
     CheckValid();
 
@@ -1901,10 +2012,10 @@ typename CSyncQueue_I<Type, Container, TNativeIterator>::TPtr
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-typename CSyncQueue_I<Type, Container, TNativeIterator>::TRef
-    CSyncQueue_I<Type, Container, TNativeIterator>
+typename CSyncQueue_I<Type, Container, TNativeIterator, Traits>::TRef
+    CSyncQueue_I<Type, Container, TNativeIterator, Traits>
         ::operator[] (TDiff offset) const
 {
     CheckValid();
@@ -1913,9 +2024,9 @@ typename CSyncQueue_I<Type, Container, TNativeIterator>::TRef
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-bool CSyncQueue_I<Type, Container, TNativeIterator>
+bool CSyncQueue_I<Type, Container, TNativeIterator, Traits>
     ::operator== (const TThisType& other) const
 {
     CheckMatched(other);
@@ -1924,18 +2035,18 @@ bool CSyncQueue_I<Type, Container, TNativeIterator>
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-bool CSyncQueue_I<Type, Container, TNativeIterator>
+bool CSyncQueue_I<Type, Container, TNativeIterator, Traits>
     ::operator!= (const TThisType& other) const
 {
     return !(*this == other);
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-bool CSyncQueue_I<Type, Container, TNativeIterator>
+bool CSyncQueue_I<Type, Container, TNativeIterator, Traits>
     ::operator< (const TThisType& other) const
 {
     CheckMatched(other);
@@ -1944,27 +2055,27 @@ bool CSyncQueue_I<Type, Container, TNativeIterator>
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-bool CSyncQueue_I<Type, Container, TNativeIterator>
+bool CSyncQueue_I<Type, Container, TNativeIterator, Traits>
     ::operator> (const TThisType& other) const
 {
     return other < *this;
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-bool CSyncQueue_I<Type, Container, TNativeIterator>
+bool CSyncQueue_I<Type, Container, TNativeIterator, Traits>
     ::operator<= (const TThisType& other) const
 {
     return !(other < *this);
 }
 
 
-template <class Type, class Container, class TNativeIterator>
+template <class Type, class Container, class TNativeIterator, class Traits>
 inline
-bool CSyncQueue_I<Type, Container, TNativeIterator>
+bool CSyncQueue_I<Type, Container, TNativeIterator, Traits>
     ::operator>= (const TThisType& other) const
 {
     return !(*this < other);
@@ -1973,61 +2084,81 @@ bool CSyncQueue_I<Type, Container, TNativeIterator>
 
 // Additional comparing between const and non-const iterators
 
-template <class Type, class Container, class TNativeIterL, class TNativeIterR>
+template <class Type, class Container,
+          class TNativeIterL, class TNativeIterR, class Traits>
 inline
-bool operator== (const CSyncQueue_I<Type, Container, TNativeIterL>&  left,
-                 const CSyncQueue_I<Type, Container, TNativeIterR>&  right)
+bool operator== (const CSyncQueue_I<Type, Container,
+                                    TNativeIterL, Traits>&  left,
+                 const CSyncQueue_I<Type, Container,
+                                    TNativeIterR, Traits>&  right)
 {
     typedef
-        typename CSyncQueue<Type, Container>::TConstIterator  TConstIterator;
+        typename CSyncQueue<Type, Container, Traits>::TConstIterator
+                                                            TConstIterator;
 
     return TConstIterator(left) == TConstIterator(right);
 }
 
 
-template <class Type, class Container, class TNativeIterL, class TNativeIterR>
+template <class Type, class Container,
+          class TNativeIterL, class TNativeIterR, class Traits>
 inline
-bool operator!= (const CSyncQueue_I<Type, Container, TNativeIterL>&  left,
-                 const CSyncQueue_I<Type, Container, TNativeIterR>&  right)
+bool operator!= (const CSyncQueue_I<Type, Container,
+                                    TNativeIterL, Traits>&  left,
+                 const CSyncQueue_I<Type, Container,
+                                    TNativeIterR, Traits>&  right)
 {
     return !(left == right);
 }
 
 
-template <class Type, class Container, class TNativeIterL, class TNativeIterR>
+template <class Type, class Container,
+          class TNativeIterL, class TNativeIterR, class Traits>
 inline
-bool operator< (const CSyncQueue_I<Type, Container, TNativeIterL>&  left,
-                const CSyncQueue_I<Type, Container, TNativeIterR>&  right)
+bool operator< (const CSyncQueue_I<Type, Container,
+                                   TNativeIterL, Traits>&  left,
+                const CSyncQueue_I<Type, Container,
+                                   TNativeIterR, Traits>&  right)
 {
     typedef
-        typename CSyncQueue<Type, Container>::TConstIterator  TConstIterator;
+        typename CSyncQueue<Type, Container, Traits>::TConstIterator
+                                                            TConstIterator;
 
     return TConstIterator(left) < TConstIterator(right);
 }
 
 
-template <class Type, class Container, class TNativeIterL, class TNativeIterR>
+template <class Type, class Container,
+          class TNativeIterL, class TNativeIterR, class Traits>
 inline
-bool operator> (const CSyncQueue_I<Type, Container, TNativeIterL>&  left,
-                const CSyncQueue_I<Type, Container, TNativeIterR>&  right)
+bool operator> (const CSyncQueue_I<Type, Container,
+                                   TNativeIterL, Traits>&  left,
+                const CSyncQueue_I<Type, Container,
+                                   TNativeIterR, Traits>&  right)
 {
     return right < left;
 }
 
 
-template <class Type, class Container, class TNativeIterL, class TNativeIterR>
+template <class Type, class Container,
+          class TNativeIterL, class TNativeIterR, class Traits>
 inline
-bool operator<= (const CSyncQueue_I<Type, Container, TNativeIterL>&  left,
-                 const CSyncQueue_I<Type, Container, TNativeIterR>&  right)
+bool operator<= (const CSyncQueue_I<Type, Container,
+                                    TNativeIterL, Traits>&  left,
+                 const CSyncQueue_I<Type, Container,
+                                    TNativeIterR, Traits>&  right)
 {
     return !(right < left);
 }
 
 
-template <class Type, class Container, class TNativeIterL, class TNativeIterR>
+template <class Type, class Container,
+          class TNativeIterL, class TNativeIterR, class Traits>
 inline
-bool operator>= (const CSyncQueue_I<Type, Container, TNativeIterL>&  left,
-                 const CSyncQueue_I<Type, Container, TNativeIterR>&  right)
+bool operator>= (const CSyncQueue_I<Type, Container,
+                                    TNativeIterL, Traits>&  left,
+                 const CSyncQueue_I<Type, Container,
+                                    TNativeIterR, Traits>&  right)
 {
     return !(left < right);
 }
@@ -2036,9 +2167,9 @@ bool operator>= (const CSyncQueue_I<Type, Container, TNativeIterL>&  left,
 
 //   CSyncQueue_ConstAccessGuard
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-CSyncQueue_ConstAccessGuard<Type, Container>::
+CSyncQueue_ConstAccessGuard<Type, Container, Traits>::
 CSyncQueue_ConstAccessGuard(TQueue& queue_to_guard)
     : m_Queue(queue_to_guard)
 {
@@ -2046,9 +2177,10 @@ CSyncQueue_ConstAccessGuard(TQueue& queue_to_guard)
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-CSyncQueue_ConstAccessGuard<Type, Container>::~CSyncQueue_ConstAccessGuard()
+CSyncQueue_ConstAccessGuard<Type, Container,
+                            Traits>::~CSyncQueue_ConstAccessGuard()
 {
     NON_CONST_ITERATE(typename list<TIterBase*>, it, m_Iters)
     {
@@ -2059,54 +2191,55 @@ CSyncQueue_ConstAccessGuard<Type, Container>::~CSyncQueue_ConstAccessGuard()
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue_ConstAccessGuard<Type, Container>::x_AddIter(TIterBase* iter)
+void CSyncQueue_ConstAccessGuard<Type, Container,
+                                 Traits>::x_AddIter(TIterBase* iter)
 {
     m_Iters.push_back(iter);
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-void CSyncQueue_ConstAccessGuard<Type, Container>
+void CSyncQueue_ConstAccessGuard<Type, Container, Traits>
     ::x_RemoveIter(TIterBase* iter)
 {
     m_Iters.remove(iter);
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_ConstAccessGuard<Type, Container>::TIterator
-    CSyncQueue_ConstAccessGuard<Type, Container>::Begin(void)
+typename CSyncQueue_ConstAccessGuard<Type, Container, Traits>::TIterator
+    CSyncQueue_ConstAccessGuard<Type, Container, Traits>::Begin(void)
 {
     return TIterator(this, m_Queue.x_Begin());
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_ConstAccessGuard<Type, Container>::TIterator
-    CSyncQueue_ConstAccessGuard<Type, Container>::End(void)
+typename CSyncQueue_ConstAccessGuard<Type, Container, Traits>::TIterator
+    CSyncQueue_ConstAccessGuard<Type, Container, Traits>::End(void)
 {
     return TIterator(this, m_Queue.x_End());
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_ConstAccessGuard<Type, Container>::TRevIterator
-    CSyncQueue_ConstAccessGuard<Type, Container>::RBegin(void)
+typename CSyncQueue_ConstAccessGuard<Type, Container, Traits>::TRevIterator
+    CSyncQueue_ConstAccessGuard<Type, Container, Traits>::RBegin(void)
 {
     return TRevIterator(End());
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_ConstAccessGuard<Type, Container>::TRevIterator
-    CSyncQueue_ConstAccessGuard<Type, Container>::REnd(void)
+typename CSyncQueue_ConstAccessGuard<Type, Container, Traits>::TRevIterator
+    CSyncQueue_ConstAccessGuard<Type, Container, Traits>::REnd(void)
 {
     return TRevIterator(Begin());
 }
@@ -2116,10 +2249,10 @@ typename CSyncQueue_ConstAccessGuard<Type, Container>::TRevIterator
 // if 'const CSyncQueue<Type,Container>' change to
 // 'typename CSyncQueue_ConstAccessGuard<Type, Container>::TQueue'
 // then MSVC gives an error - it cannot propagate const specifier here
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-const CSyncQueue<Type,Container>&
-    CSyncQueue_ConstAccessGuard<Type, Container>::Queue(void) const
+const CSyncQueue<Type,Container, Traits>&
+    CSyncQueue_ConstAccessGuard<Type, Container, Traits>::Queue(void) const
 {
     return m_Queue;
 }
@@ -2128,38 +2261,38 @@ const CSyncQueue<Type,Container>&
 
 //   CSyncQueue_AccessGuard
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-CSyncQueue_AccessGuard<Type, Container>
+CSyncQueue_AccessGuard<Type, Container, Traits>
     ::CSyncQueue_AccessGuard(TQueue& queue_to_guard)
         : TBaseType(queue_to_guard)
 {}
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_AccessGuard<Type, Container>::TQueue&
-    CSyncQueue_AccessGuard<Type, Container>::Queue(void) const
+typename CSyncQueue_AccessGuard<Type, Container, Traits>::TQueue&
+    CSyncQueue_AccessGuard<Type, Container, Traits>::Queue(void) const
 {
     return const_cast<TQueue&> (TBaseType::Queue());
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_AccessGuard<Type, Container>::TIterator
-    CSyncQueue_AccessGuard<Type, Container>::Erase(TIterator iter)
+typename CSyncQueue_AccessGuard<Type, Container, Traits>::TIterator
+    CSyncQueue_AccessGuard<Type, Container, Traits>::Erase(TIterator iter)
 {
     iter.CheckGuard(this);
     return TIterator(this, Queue().x_Erase(iter.x_GetBase()));
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_AccessGuard<Type, Container>::TIterator
-    CSyncQueue_AccessGuard<Type, Container>::Erase(TIterator  from_iter,
-                                                   TIterator  to_iter)
+typename CSyncQueue_AccessGuard<Type, Container, Traits>::TIterator
+    CSyncQueue_AccessGuard<Type, Container, Traits>::Erase(TIterator  from_iter,
+                                                           TIterator  to_iter)
 {
     from_iter.CheckGuard(this);
     to_iter.CheckGuard(this);
@@ -2169,37 +2302,37 @@ typename CSyncQueue_AccessGuard<Type, Container>::TIterator
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_AccessGuard<Type, Container>::TIterator
-    CSyncQueue_AccessGuard<Type, Container>::Begin(void)
+typename CSyncQueue_AccessGuard<Type, Container, Traits>::TIterator
+    CSyncQueue_AccessGuard<Type, Container, Traits>::Begin(void)
 {
     return TIterator(this, Queue().x_Begin());
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_AccessGuard<Type, Container>::TIterator
-    CSyncQueue_AccessGuard<Type, Container>::End(void)
+typename CSyncQueue_AccessGuard<Type, Container, Traits>::TIterator
+    CSyncQueue_AccessGuard<Type, Container, Traits>::End(void)
 {
     return TIterator(this, Queue().x_End());
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_AccessGuard<Type, Container>::TRevIterator
-    CSyncQueue_AccessGuard<Type, Container>::RBegin(void)
+typename CSyncQueue_AccessGuard<Type, Container, Traits>::TRevIterator
+    CSyncQueue_AccessGuard<Type, Container, Traits>::RBegin(void)
 {
     return TRevIterator(End());
 }
 
 
-template <class Type, class Container>
+template <class Type, class Container, class Traits>
 inline
-typename CSyncQueue_AccessGuard<Type, Container>::TRevIterator
-    CSyncQueue_AccessGuard<Type, Container>::REnd(void)
+typename CSyncQueue_AccessGuard<Type, Container, Traits>::TRevIterator
+    CSyncQueue_AccessGuard<Type, Container, Traits>::REnd(void)
 {
     return TRevIterator(Begin());
 }
diff --git a/c++/include/util/thread_pool_old.hpp b/c++/include/util/thread_pool_old.hpp
index 099c6aa..6ff7d70 100644
--- a/c++/include/util/thread_pool_old.hpp
+++ b/c++/include/util/thread_pool_old.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL__THREAD_POOL_OLD__HPP
 #define UTIL__THREAD_POOL_OLD__HPP
 
-/*  $Id: thread_pool_old.hpp 467434 2015-05-13 16:41:39Z sadyrovr $
+/*  $Id: thread_pool_old.hpp 489095 2016-01-08 13:02:41Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -90,7 +90,7 @@ public:
 
     const TPriority& GetPriority(void) const     { return m_Priority; }
     const EStatus&   GetStatus(void) const       { return m_Status; }
-    TUserPriority    GetUserPriority(void) const { return m_Priority >> 24; }
+    TUserPriority    GetUserPriority(void) const { return TUserPriority(m_Priority >> 24); }
 
     void MarkAsComplete(void)        { x_SetStatus(eComplete); }
     void MarkAsForciblyCaught(void)  { x_SetStatus(eForciblyCaught); }
@@ -908,8 +908,8 @@ bool CBlockingQueue<TRequest>::x_WaitForPredicate(TQueuePredicate pred,
             CTime start(CTime::eCurrent, CTime::eGmt);
             // Temporarily release the mutex while waiting, to avoid deadlock.
             guard.Release();
-            sem.TryWait(span.GetCompleteSeconds(),
-                        span.GetNanoSecondsAfterSecond());
+            sem.TryWait((unsigned int)span.GetCompleteSeconds(),
+                        (unsigned int)span.GetNanoSecondsAfterSecond());
             guard.Guard(m_Mutex);
             span -= CurrentTime(CTime::eGmt) - start;
         }
diff --git a/c++/include/util/transmissionrw.hpp b/c++/include/util/transmissionrw.hpp
index bce4765..a023059 100644
--- a/c++/include/util/transmissionrw.hpp
+++ b/c++/include/util/transmissionrw.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL___TRANSMISSIONRW__HPP
 #define UTIL___TRANSMISSIONRW__HPP
 
-/*  $Id: transmissionrw.hpp 304778 2011-06-16 16:14:34Z kazimird $
+/*  $Id: transmissionrw.hpp 477239 2015-08-27 15:35:49Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -122,17 +122,13 @@ public:
     IWriter& GetWriter() { _ASSERT(m_Wrt); return *m_Wrt; }
 
 private:
-    ERW_Result x_WritePacket(const void* buf,
-                             size_t      count,
-                             size_t&     bytes_written);
-
-private:
     CTransmissionWriter(const CTransmissionWriter&);
     CTransmissionWriter& operator=(CTransmissionWriter&);
 private:
     IWriter*     m_Wrt;
     EOwnership   m_OwnWrt;
     ESendEofPacket m_SendEof;
+    size_t m_PacketBytesToWrite;
 };
 
 
diff --git a/c++/include/util/value_convert.hpp b/c++/include/util/value_convert.hpp
index 78d78e4..09ae369 100644
--- a/c++/include/util/value_convert.hpp
+++ b/c++/include/util/value_convert.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL___VALUE_CONVERT__HPP
 #define UTIL___VALUE_CONVERT__HPP
 
-/* $Id: value_convert.hpp 423993 2014-01-10 16:41:29Z ucko $
+/* $Id: value_convert.hpp 499843 2016-04-28 16:12:36Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -107,14 +107,24 @@ public:
     {
         return MakeCP<CP>(NStr::StringToInt(m_Value, NStr::fAllowTrailingSymbols));
     }
-#if !defined(NCBI_INT8_IS_LONG)  &&  \
-    (defined(NCBI_COMPILER_GCC)  ||  defined(NCBI_COMPILER_ICC)  ||  \
-     defined(NCBI_COMPILER_WORKSHOP)  ||  defined(NCBI_COMPILER_MSVC))
+    operator unsigned long(void) const
+    {
+        return MakeCP<CP>(NStr::StringToULong(m_Value, NStr::fAllowTrailingSymbols));
+    }
     operator long(void) const
     {
         return MakeCP<CP>(NStr::StringToLong(m_Value, NStr::fAllowTrailingSymbols));
     }
-#endif
+#if NCBI_INT8_IS_LONG
+    operator unsigned long long(void) const
+    {
+        return MakeCP<CP>(NStr::StringToUInt8(m_Value, NStr::fAllowTrailingSymbols));
+    }
+    operator long long(void) const
+    {
+        return MakeCP<CP>(NStr::StringToInt8(m_Value, NStr::fAllowTrailingSymbols));
+    }
+#else
     operator Uint8(void) const
     {
         return MakeCP<CP>(NStr::StringToUInt8(m_Value, NStr::fAllowTrailingSymbols));
@@ -123,6 +133,7 @@ public:
     {
         return MakeCP<CP>(NStr::StringToInt8(m_Value, NStr::fAllowTrailingSymbols));
     }
+#endif
     operator float(void) const
     {
         return MakeCP<CP>(NStr::StringToDouble(m_Value));
@@ -228,15 +239,24 @@ public:
     {
         return MakeCP<CP>(NStr::StringToInt(m_Value, NStr::fAllowTrailingSymbols));
     }
-#if !defined(NCBI_INT8_IS_LONG)  &&  \
-    ((defined(NCBI_COMPILER_GCC) && NCBI_COMPILER_VERSION >= 400)  ||  \
-     defined(NCBI_COMPILER_ICC)  ||  defined(NCBI_COMPILER_WORKSHOP) || \
-     defined(NCBI_COMPILER_MSVC))
+    operator unsigned long(void) const
+    {
+        return MakeCP<CP>(NStr::StringToULong(m_Value, NStr::fAllowTrailingSymbols));
+    }
     operator long(void) const
     {
         return MakeCP<CP>(NStr::StringToLong(m_Value, NStr::fAllowTrailingSymbols));
     }
-#endif
+#if NCBI_INT8_IS_LONG
+    operator unsigned long long(void) const
+    {
+        return MakeCP<CP>(NStr::StringToUInt8(m_Value, NStr::fAllowTrailingSymbols));
+    }
+    operator long long(void) const
+    {
+        return MakeCP<CP>(NStr::StringToInt8(m_Value, NStr::fAllowTrailingSymbols));
+    }
+#else
     operator Uint8(void) const
     {
         return MakeCP<CP>(NStr::StringToUInt8(m_Value, NStr::fAllowTrailingSymbols));
@@ -245,6 +265,7 @@ public:
     {
         return MakeCP<CP>(NStr::StringToInt8(m_Value, NStr::fAllowTrailingSymbols));
     }
+#endif
     operator float(void) const
     {
         return MakeCP<CP>(NStr::StringToDouble(m_Value));
@@ -877,7 +898,6 @@ private:
     const obj_type  m_Value;
 };
 
-#if SIZEOF_LONG == 8  &&  !defined(NCBI_INT8_IS_LONG)
 template <typename CP>
 class CValueConvert<CP, unsigned long>
 {
@@ -937,9 +957,177 @@ public:
 private:
     const obj_type m_Value;
 };
+
+#if NCBI_INT8_IS_LONG
+template <typename CP>
+class CValueConvert<CP, unsigned long long>
+{
+public:
+    typedef unsigned long long obj_type;
+
+    CValueConvert(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+#if defined(NCBI_COMPILER_WORKSHOP) && NCBI_COMPILER_VERSION <= 550
+    operator bool(void) const
+    { 
+        return m_Value != 0;
+    }
+    operator Uint1(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Int1(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Uint2(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Int2(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Uint4(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Int4(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Uint8(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Int8(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator float(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator double(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator long double(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+#else
+    template <typename TO>
+    operator TO(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
 #endif
+    operator string(void) const
+    {
+        return NStr::UInt8ToString(m_Value);
+    }
+    operator CTime(void) const
+    {
+        return CTime(MakeCP<CP>(m_Value));
+    }
+
+private:
+    const obj_type m_Value;
+};
 
 template <typename CP>
+class CValueConvert<CP, long long>
+{
+public:
+    typedef long long obj_type;
+
+    CValueConvert(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+#if defined(NCBI_COMPILER_WORKSHOP) && NCBI_COMPILER_VERSION <= 550
+    operator bool(void) const
+    { 
+        return m_Value != 0;
+    }
+    operator Uint1(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Int1(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Uint2(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Int2(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Uint4(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Int4(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+#if NCBI_PLATFORM_BITS == 32
+    operator time_t(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+#endif
+    operator Uint8(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator Int8(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator float(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator double(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+    operator long double(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+#else
+    template <typename TO>
+    operator TO(void) const
+    {
+        return MakeCP<CP>(m_Value);
+    }
+#endif
+    operator string(void) const
+    {
+        return NStr::Int8ToString(m_Value);
+    }
+    operator CTime(void) const
+    {
+        return CTime(MakeCP<CP>(m_Value));
+    }
+
+private:
+    const obj_type  m_Value;
+};
+#else
+template <typename CP>
 class CValueConvert<CP, Uint8>
 {
 public:
@@ -1106,6 +1294,7 @@ public:
 private:
     const obj_type  m_Value;
 };
+#endif
 
 template <typename CP>
 class CValueConvert<CP, float>
@@ -1530,6 +1719,35 @@ CValueConvert<SRunTimeCP, Int4>::operator bool(void) const
         return m_Value != 0;
 }
 
+#if NCBI_INT8_IS_LONG
+template <> template <>
+inline
+CValueConvert<SSafeCP, unsigned long long>::operator bool(void) const
+{   
+        return m_Value != 0;
+}
+
+template <> template <>
+inline
+CValueConvert<SRunTimeCP, unsigned long long>::operator bool(void) const
+{   
+        return m_Value != 0;
+}
+
+template <> template <>
+inline
+CValueConvert<SSafeCP, long long>::operator bool(void) const
+{   
+        return m_Value != 0;
+}
+
+template <> template <>
+inline
+CValueConvert<SRunTimeCP, long long>::operator bool(void) const
+{   
+        return m_Value != 0;
+}
+#else
 template <> template <>
 inline
 CValueConvert<SSafeCP, Uint8>::operator bool(void) const
@@ -1557,6 +1775,7 @@ CValueConvert<SRunTimeCP, Int8>::operator bool(void) const
 {   
         return m_Value != 0;
 }
+#endif
 
 // CTime has "empty" value semantic.
 template <> template <>
diff --git a/c++/include/util/value_convert_policy.hpp b/c++/include/util/value_convert_policy.hpp
index 2b38163..5471d70 100644
--- a/c++/include/util/value_convert_policy.hpp
+++ b/c++/include/util/value_convert_policy.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL___VALUE_CONV_POLICY__HPP
 #define UTIL___VALUE_CONV_POLICY__HPP
 
-/* $Id: value_convert_policy.hpp 422301 2013-12-19 15:07:44Z ucko $
+/* $Id: value_convert_policy.hpp 499843 2016-04-28 16:12:36Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NTOICE
@@ -186,6 +186,7 @@ struct SConvertUsingRunTimeCP<true, true>
         const bool same_sign      = from_is_signed == to_is_signed; 
 
         const TO min_allowed = kMin_Auto, max_allowed = kMax_Auto;
+        if (max_allowed == 1) {return value != 0;}
 
         if (SLessThanTypeMin<from_is_signed, to_is_signed>::Check(
                 value, min_allowed)
@@ -245,10 +246,21 @@ public:
     {
         return m_Value ? 1 : 0;
     }
+    operator long(void) const
+    {
+        return m_Value ? 1 : 0;
+    }
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value ? 1 : 0;
+    }
+#else
     operator Int8(void) const
     {
         return m_Value ? 1 : 0;
     }
+#endif
 
     operator Uint1(void) const
     {
@@ -262,10 +274,21 @@ public:
     {
         return m_Value ? 1 : 0;
     }
+    operator unsigned long(void) const
+    {
+        return m_Value ? 1 : 0;
+    }
+#if NCBI_INT8_IS_LONG
+    operator unsigned long long(void) const
+    {
+        return m_Value ? 1 : 0;
+    }
+#else
     operator Uint8(void) const
     {
         return m_Value ? 1 : 0;
     }
+#endif
 
     operator float(void) const
     {
@@ -416,7 +439,6 @@ private:
     obj_type m_Value;
 };
 
-#ifndef NCBI_INT8_IS_LONG
 template <>
 class CConvPolicy<SRunTimeCP, long>
 {
@@ -438,9 +460,74 @@ public:
 private:
     obj_type m_Value;
 };
-#endif
 
 template <>
+class CConvPolicy<SRunTimeCP, unsigned long>
+{
+public:
+    typedef unsigned long obj_type;
+
+    CConvPolicy(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+    template <typename TO>
+    operator TO(void) const
+    {
+        return ConvertUsingRunTimeCP<TO>(m_Value);
+    }
+
+private:
+    obj_type m_Value;
+};
+
+#if NCBI_INT8_IS_LONG
+template <>
+class CConvPolicy<SRunTimeCP, long long>
+{
+public:
+    typedef long long obj_type;
+
+    CConvPolicy(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+    template <typename TO>
+    operator TO(void) const
+    {
+        return ConvertUsingRunTimeCP<TO>(m_Value);
+    }
+
+private:
+    obj_type m_Value;
+};
+template <>
+class CConvPolicy<SRunTimeCP, unsigned long long>
+{
+public:
+    typedef unsigned long long obj_type;
+
+    CConvPolicy(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+    template <typename TO>
+    operator TO(void) const
+    {
+        return ConvertUsingRunTimeCP<TO>(m_Value);
+    }
+
+private:
+    obj_type m_Value;
+};
+#else
+template <>
 class CConvPolicy<SRunTimeCP, Int8>
 {
 public:
@@ -483,6 +570,7 @@ public:
 private:
     obj_type m_Value;
 };
+#endif
 
 template <>
 class CConvPolicy<SRunTimeCP, string>
@@ -628,10 +716,21 @@ public:
     {
         return m_Value ? 1 : 0;
     }
+    operator long(void) const
+    {
+        return m_Value ? 1 : 0;
+    }
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value ? 1 : 0;
+    }
+#else
     operator Int8(void) const
     {
         return m_Value ? 1 : 0;
     }
+#endif
 
     // Unsigned to unsigned ...
 
@@ -647,10 +746,21 @@ public:
     {
         return m_Value ? 1 : 0;
     }
+    operator unsigned long(void) const
+    {
+        return m_Value ? 1 : 0;
+    }
+#if NCBI_INT8_IS_LONG
+    operator unsigned long long(void) const
+    {
+        return m_Value ? 1 : 0;
+    }
+#else
     operator Uint8(void) const
     {
         return m_Value ? 1 : 0;
     }
+#endif
 
 
 private:
@@ -685,10 +795,21 @@ public:
     {
         return m_Value;
     }
+    operator long(void) const
+    {
+        return m_Value;
+    }
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Int8(void) const
     {
         return m_Value;
     }
+#endif
 
     //
     operator float(void) const
@@ -736,10 +857,21 @@ public:
     {
         return m_Value;
     }
+    operator long(void) const
+    {
+        return m_Value;
+    }
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Int8(void) const
     {
         return m_Value;
     }
+#endif
 
     // Unsigned to unsigned ...
 
@@ -751,10 +883,21 @@ public:
     {
         return m_Value;
     }
+    operator unsigned long(void) const
+    {
+        return m_Value;
+    }
+#if NCBI_INT8_IS_LONG
+    operator unsigned long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Uint8(void) const
     {
         return m_Value;
     }
+#endif
 
     //
     operator float(void) const
@@ -798,10 +941,21 @@ public:
     {
         return m_Value;
     }
+    operator long(void) const
+    {
+        return m_Value;
+    }
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Int8(void) const
     {
         return m_Value;
     }
+#endif
 
     //
     operator float(void) const
@@ -845,10 +999,21 @@ public:
     {
         return m_Value;
     }
+    operator long(void) const
+    {
+        return m_Value;
+    }
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Int8(void) const
     {
         return m_Value;
     }
+#endif
 
     // Unsigned to unsigned ...
 
@@ -856,10 +1021,21 @@ public:
     {
         return m_Value;
     }
+    operator unsigned long(void) const
+    {
+        return m_Value;
+    }
+#if NCBI_INT8_IS_LONG
+    operator unsigned long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Uint8(void) const
     {
         return m_Value;
     }
+#endif
 
     //
     operator float(void) const
@@ -896,13 +1072,24 @@ public:
     {
         return m_Value;
     }
+    operator long(void) const
+    {
+        return m_Value;
+    }
 
     // Signed to signed ...
 
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Int8(void) const
     {
         return m_Value;
     }
+#endif
 
     //
     operator float(void) const
@@ -911,11 +1098,11 @@ public:
     }
     operator double(void) const
     {
-        return m_Value;
+        return static_cast<double>(m_Value);
     }
     operator long double(void) const
     {
-        return m_Value;
+        return static_cast<long double>(m_Value);
     }
 
 private:
@@ -939,20 +1126,42 @@ public:
     {
         return m_Value;
     }
+    operator long(void) const
+    {
+        return m_Value;
+    }
 
     // Unsigned to signed ...
 
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Int8(void) const
     {
         return m_Value;
     }
+#endif
 
     // Unsigned to unsigned ...
+    operator unsigned long(void) const
+    {
+        return m_Value;
+    }
 
+#if NCBI_INT8_IS_LONG
+    operator unsigned long long(void) const
+    {
+        return m_Value;
+    }
+#else
     operator Uint8(void) const
     {
         return m_Value;
     }
+#endif
 
     //
     operator float(void) const
@@ -961,18 +1170,213 @@ public:
     }
     operator double(void) const
     {
+        return static_cast<double>(m_Value);
+    }
+    operator long double(void) const
+    {
+        return static_cast<long double>(m_Value);
+    }
+
+private:
+    obj_type m_Value;
+};
+
+template <>
+class CConvPolicy<SSafeCP, long>
+{
+public:
+    typedef long obj_type;
+
+    CConvPolicy(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+    // Convert to itself.
+    operator obj_type(void) const
+    {
+        return m_Value;
+    }
+
+    // Signed to signed ...
+
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value;
+    }
+#else
+    operator Int8(void) const
+    {
         return m_Value;
     }
+#endif
+
+    //
+    operator bool(void) const
+    {
+        return m_Value != 0;
+    }
+    operator float(void) const
+    {
+        return static_cast<float>(m_Value);
+    }
+    operator double(void) const
+    {
+        return static_cast<double>(m_Value);
+    }
     operator long double(void) const
     {
+        return static_cast<long double>(m_Value);
+    }
+
+private:
+    obj_type m_Value;
+};
+
+template <>
+class CConvPolicy<SSafeCP, unsigned long>
+{
+public:
+    typedef unsigned long obj_type;
+
+    CConvPolicy(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+    // Convert to itself.
+    operator obj_type(void) const
+    {
         return m_Value;
     }
 
+    // Unsigned to signed ...
+
+#if NCBI_INT8_IS_LONG
+    operator long long(void) const
+    {
+        return m_Value;
+    }
+#else
+    operator Int8(void) const
+    {
+        return m_Value;
+    }
+#endif
+
+    // Unsigned to unsigned ...
+
+#if NCBI_INT8_IS_LONG
+    operator unsigned long long(void) const
+    {
+        return m_Value;
+    }
+#else
+    operator Uint8(void) const
+    {
+        return m_Value;
+    }
+#endif
+
+    //
+    operator bool(void) const
+    {
+        return m_Value != 0;
+    }
+    operator float(void) const
+    {
+        return static_cast<float>(m_Value);
+    }
+    operator double(void) const
+    {
+        return static_cast<double>(m_Value);
+    }
+    operator long double(void) const
+    {
+        return static_cast<long double>(m_Value);
+    }
+
+private:
+    obj_type m_Value;
+};
+
+#if NCBI_INT8_IS_LONG
+template <>
+class CConvPolicy<SSafeCP, long long>
+{
+public:
+    typedef long long obj_type;
+
+    CConvPolicy(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+    // Convert only to itself.
+    operator obj_type(void) const
+    {
+        return m_Value;
+    }
+
+    //
+    operator float(void) const
+    {
+        return static_cast<float>(m_Value);
+    }
+    operator double(void) const
+    {
+        return static_cast<double>(m_Value);
+    }
+    operator long double(void) const
+    {
+        return static_cast<long double>(m_Value);
+    }
+
 private:
     obj_type m_Value;
 };
 
 template <>
+class CConvPolicy<SSafeCP, unsigned long long>
+{
+public:
+    typedef unsigned long long obj_type;
+
+    CConvPolicy(obj_type value)
+    : m_Value(value)
+    {
+    }
+
+public:
+    // Convert only to itself.
+    operator obj_type(void) const
+    {
+        return m_Value;
+    }
+
+    //
+    operator float(void) const
+    {
+        return static_cast<float>(m_Value);
+    }
+    operator double(void) const
+    {
+        return static_cast<double>(m_Value);
+    }
+    operator long double(void) const
+    {
+        return static_cast<long double>(m_Value);
+    }
+
+private:
+    obj_type m_Value;
+};
+#else
+template <>
 class CConvPolicy<SSafeCP, Int8>
 {
 public:
@@ -1043,6 +1447,7 @@ public:
 private:
     obj_type m_Value;
 };
+#endif
 
 template <>
 class CConvPolicy<SSafeCP, string>
diff --git a/c++/scripts/common/add_vdb.sh b/c++/scripts/common/add_vdb.sh
index 7945190..8d66b71 100755
--- a/c++/scripts/common/add_vdb.sh
+++ b/c++/scripts/common/add_vdb.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: add_vdb.sh 478499 2015-09-09 19:00:24Z ivanov $
+# $Id: add_vdb.sh 486134 2015-12-01 18:54:11Z ucko $
 . "`dirname $0`/common.sh"
 
 set -e
@@ -10,23 +10,28 @@ cd $root
 root=`pwd`
 ptb_ini=../src/build-system/project_tree_builder.ini
 tag=`sed -ne 's,.*/vdb-versions/,,p' $ptb_ini`
-name=ncbi-vdb${tag+"-$tag"}
+name=ncbi-vdb${tag:+"-$tag"}
 platform=`COMMON_DetectPlatform`
 
 mkdir -p src
 cd src
 if [ -d ncbi-vdb/.git ]; then
-    (cd ncbi-vdb  &&  git fetch)
+    (cd ncbi-vdb  &&  git fetch --tags origin master)
 else
     git clone https://github.com/ncbi/ncbi-vdb.git
 fi
 if [ -d ngs/.git ]; then
-    (cd ngs  &&  git fetch)
+    (cd ngs  &&  git pull)
 else
     git clone https://github.com/ncbi/ngs.git
 fi
 cd ncbi-vdb
-git checkout "${tag:-master}"
+git checkout "${tag:-master}" || git checkout master
+if [ ! -d interfaces ]; then
+    echo "WARNING: tag $tag unusable; trying master."
+    name=ncbi-vdb
+    git checkout master
+fi
 if [ "$platform" = IntelMAC ]; then
     archflag=--arch=fat86
     if [ ! -d $root/tmp/force-clang ]; then
diff --git a/c++/scripts/common/check/check_add.sh b/c++/scripts/common/check/check_add.sh
index c7c992a..e3793da 100755
--- a/c++/scripts/common/check/check_add.sh
+++ b/c++/scripts/common/check/check_add.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $Id: check_add.sh 468632 2015-05-27 11:59:00Z ivanov $
+# $Id: check_add.sh 487040 2015-12-14 17:30:22Z ivanov $
 # Author:  Vladimir Ivanov, NCBI 
 #
 ###########################################################################
@@ -34,6 +34,7 @@ x_delim=" ____ "
 # Default timeout for check (in seconds)
 x_timeout_default=200
 
+
 # Attempt to determine the relative source directory if necessary.
 # (This logic assumes that the first occurrence of src as a path
 # component will be the relevant one.)
@@ -51,7 +52,7 @@ fi
 
 # Get app name
 x_app=`grep '^ *APP[ =]' "$x_srcdir/Makefile.$x_test.app"`
-x_app=`echo "$x_app" | sed -e 's/^.*=//' -e 's/^ *//'`
+x_app=`echo "$x_app" | sed -e 's/^.*=//' -e 's/^ *//' -e 's/ *$//'`
 
 x_tpath=$x_srcdir_rel/$x_test
 if grep -c '^ *CHECK_CMD' $x_srcdir/Makefile.$x_test.app > /dev/null ; then 
@@ -95,10 +96,8 @@ x_files=`grep '^ *CHECK_COPY' "$x_srcdir/Makefile.$x_test.app" | sed -e 's/^.*=/
 # Get application's check timeout
 x_timeout=`grep '^ *CHECK_TIMEOUT' "$x_srcdir/Makefile.$x_test.app" | sed -e 's/^.*=//' -e 's/^[ ]*//'`
 x_timeout="${x_timeout:-$x_timeout_default}"
-# Get application's requirement
-reg_build=`grep '^ *REQUIRES' "$x_srcdir/Makefile.$x_test.app" | sed -e 's/^.*=//' -e 's/^[ ]*//'`
-req_check=`grep '^ *CHECK_REQUIRES' "$x_srcdir/Makefile.$x_test.app" | sed -e 's/^.*=//' -e 's/^[ ]*//'`
-x_requires="$reg_build $req_check"
+# Get check requirements
+x_requires=`grep '^ *CHECK_REQUIRES' "$x_srcdir/Makefile.$x_test.app" | sed -e 's/^.*=//' -e 's/^[ ]*//'`
 
 # Get list of watchers
 x_makefile="$x_srcdir/Makefile.$x_test.app"
diff --git a/c++/scripts/common/check/check_exec.sh b/c++/scripts/common/check/check_exec.sh
index 3ba703a..643bdb7 100755
--- a/c++/scripts/common/check/check_exec.sh
+++ b/c++/scripts/common/check/check_exec.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $Id: check_exec.sh 453282 2014-12-02 16:01:34Z ivanov $
+# $Id: check_exec.sh 487998 2015-12-23 18:21:14Z ivanov $
 # Author:  Vladimir Ivanov, NCBI 
 #
 ###########################################################################
@@ -38,7 +38,9 @@ trap "rm -f $timestamp_file" 0 1 2 15
 echo $$ > check_exec.pid
 
 # Reinforce timeout
-ulimit -t `expr $timeout + 5` > /dev/null 2>&1
+# Note, we cannot set it to $timeout for MT-test, because
+# CPU time count for each thread and sum.
+ulimit -t `expr $timeout \* 3` > /dev/null 2>&1
 
 # Use different kill on Unix and Cygwin
 case `uname -s` in
diff --git a/c++/scripts/common/check/check_exec_test.sh b/c++/scripts/common/check/check_exec_test.sh
index 31ae456..2f8c4b5 100755
--- a/c++/scripts/common/check/check_exec_test.sh
+++ b/c++/scripts/common/check/check_exec_test.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $Id: check_exec_test.sh 449804 2014-10-21 14:51:36Z ivanov $
+# $Id: check_exec_test.sh 487998 2015-12-23 18:21:14Z ivanov $
 # Author:  Vladimir Ivanov, NCBI 
 #
 ###########################################################################
@@ -44,7 +44,9 @@ touch $timestamp_file
 trap "rm -f $tmp $timestamp_file" 0 1 2 15
 
 # Reinforce timeout
-ulimit -t `expr $timeout + 5` > /dev/null 2>&1
+# Note, we cannot set it to $timeout for MT-test, because
+# CPU time count for each thread and sum.
+ulimit -t `expr $timeout \* 3` > /dev/null 2>&1
 
 # Use different kill on Unix and Cygwin
 case `uname -s` in
diff --git a/c++/scripts/common/check/check_make_cfg.sh b/c++/scripts/common/check/check_make_cfg.sh
index d7b7f5e..89af5e4 100755
--- a/c++/scripts/common/check/check_make_cfg.sh
+++ b/c++/scripts/common/check/check_make_cfg.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $Id: check_make_cfg.sh 473888 2015-07-23 12:02:15Z ivanov $
+# $Id: check_make_cfg.sh 500063 2016-05-02 12:21:38Z ivanov $
 # Author:  Vladimir Ivanov, NCBI 
 #
 ###########################################################################
@@ -280,7 +280,7 @@ esac
 
 ## Run
 
-trap "touch \$check_dir/check.failed"  1 2 15
+trap "touch \$check_dir/check.failed; exit 1"  1 2 15
 rm \$check_dir/check.failed \$check_dir/check.success > /dev/null 2>&1 
 
 # Set log_site for tests
@@ -582,13 +582,17 @@ saved_path="\$PATH"
 FEATURES="$x_features"
 export FEATURES
 
-# Add current configuration's build 'bin' and 'lib' directories to PATH
-export PATH=".:\${build_dir}/\${build_tree}/bin/\${build_cfg}:\${build_dir}/\${build_tree}/lib/\${build_cfg}:\${saved_path}"
+# Redirect output for C++ diagnostic framework to stderr
+NCBI_CONFIG__LOG__FILE="-"
+export NCBI_CONFIG__LOG__FILE
 
 # Export bin and lib paths
 export CFG_BIN="\${build_dir}/\${build_tree}/bin/\${build_cfg}"
 export CFG_LIB="\${build_dir}/\${build_tree}/lib/\${build_cfg}"
 
+# Add current configuration's build 'bin' and 'lib' directories to PATH
+export PATH=".:\${CFG_BIN}:\${CFG_LIB}:\${saved_path}"
+
 
 EOF
 
@@ -632,6 +636,10 @@ for x_row in $x_tests; do
    if test ! -z "$x_files" ; then
       x_path="$x_check_dir/$x_rel_dir"
       mkdir -p "$x_path"
+      # Automatically copy .ini file if exists
+      x_copy="$x_src_dir/$x_app.ini"
+      test -f $x_copy  &&  cp -f "$x_copy" "$x_path"
+      # Copy specified CHECK_COPY files/dirs
       for i in $x_files ; do
          x_copy="$x_src_dir/$i"
          if test -f "$x_copy"  -o  -d "$x_copy" ; then
diff --git a/c++/scripts/common/check/check_make_unix.sh b/c++/scripts/common/check/check_make_unix.sh
index 844c404..e8f9ac0 100755
--- a/c++/scripts/common/check/check_make_unix.sh
+++ b/c++/scripts/common/check/check_make_unix.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $Id: check_make_unix.sh 471330 2015-06-25 15:56:48Z ivanov $
+# $Id: check_make_unix.sh 500063 2016-05-02 12:21:38Z ivanov $
 # Author:  Vladimir Ivanov, NCBI 
 #
 ###########################################################################
@@ -296,7 +296,7 @@ case "\$method" in
 esac
 
 
-trap "touch $x_target_dir/check.failed"  1 2 15
+trap "touch $x_target_dir/check.failed; exit 1"  1 2 15
 rm $x_target_dir/check.failed $x_target_dir/check.success > /dev/null 2>&1 
 
 # Set log_site for tests
@@ -499,7 +499,7 @@ RunTest()
             esac
             if test -f \$x_applog_sh; then
                chmod a+x \$x_applog_sh 2>&1
-               \$x_applog_sh >> "$x_build_dir/test_stat_load.log" 2>&1
+               \$x_applog_sh >> "$x_build_dir/test_stat_load_applog.log" 2>&1
             else
                echo "Error generating \$x_applog_sh "
             fi
@@ -608,7 +608,7 @@ EOF_launch
                 load_avg="\`uptime | sed -e 's/.*averages*: *\(.*\) *$/\1/' -e 's/[, ][, ]*/ /g'\`"
                 rm \$launch_sh
 
-                sed -e '/ ["][$][@]["].*\$/ {
+                LC_ALL=C sed -e '/ ["][$][@]["].*\$/ {
                         s/^.*: //
                         s/ ["][$][@]["].*$//
                 }' \$x_log >> \$x_test_out
@@ -810,18 +810,25 @@ for x_row in $x_tests; do
    x_requires=" `echo "$x_row" | sed -e 's/^[^~]*~//' -e 's/^[^~]*~//' -e 's/^[^~]*~//' -e 's/^[^~]*~//' -e 's/^[^~]*~//'  -e 's/^[^~]*~//' -e 's/^[^~]*~//' -e 's/~.*$//'` "
    x_authors=`echo "$x_row" | sed -e 's/.*~//'`
 
-   # Check application requirements
-   for x_req in $x_requires; do
-      test -f "$x_conf_dir/status/$x_req.enabled"  ||  continue 2
-   done
-
    # Application base build directory
    x_work_dir_tail="`echo \"$x_row\" | sed -e 's/~.*$//'`"
    x_work_dir="$x_compile_dir/$x_work_dir_tail"
 
+   # Check application requirements ($CHECK_REQUIRES)
+   for x_req in $x_requires; do
+      if test ! -f "$x_conf_dir/status/$x_req.enabled" ; then
+         echo "SKIP -- $x_work_dir_tail/$x_app (unmet CHECK_REQUIRES)"
+         continue 2
+      fi
+   done
+
    # Copy specified files to the build directory
 
    if test "$x_import_prj" = "no"; then
+      # Automatically copy .ini file if exists
+      x_copy="$x_src_dir/$x_app.ini"
+      test -f $x_copy  &&  cp -pf "$x_copy" "$x_work_dir"
+      # Copy specified CHECK_COPY files/dirs
       if test ! -z "$x_files"; then
          for i in $x_files ; do
             x_copy="$x_src_dir/$i"
diff --git a/c++/scripts/common/check/inspxe-suppressions/_vs.sup b/c++/scripts/common/check/inspxe-suppressions/_vs.sup
index 4ea2b79..05b25f0 100644
--- a/c++/scripts/common/check/inspxe-suppressions/_vs.sup
+++ b/c++/scripts/common/check/inspxe-suppressions/_vs.sup
@@ -262,3 +262,40 @@ suppression = {
 		}
 	}
 }
+suppression = {
+	name = "False positive in MS implementation of basic_string::assign()"
+	type = {invalid_memory_access}
+	stacks = {
+		{
+			!!!;
+			src=xstring,func=assign,line=1160,func_line=12;
+		}
+	}
+}
+suppression = {
+	name = "libsybct64.dll internal problem"
+	type = {invalid_memory_access}
+	stacks = {
+		allocation={
+			!!!;
+			mod=ntdll.dll,func=RtlCompareUnicodeStrings;
+			...;
+			mod=libsybct64.dll,func=ct_dynsqlda;
+		}
+	}
+}
+suppression = {
+	name = "MSVCR120.dll memory error in stat64()"
+	type = {invalid_memory_access}
+	stacks = {
+		allocation={
+			...;
+			mod=MSVCR120.dll,func=stat64;
+		}
+		{
+			...;
+			mod=MSVCR120.dll,func=stat64;
+		}
+	}
+}
+
diff --git a/c++/scripts/common/check/inspxe.sh b/c++/scripts/common/check/inspxe.sh
index 32fcbb5..5b5d2f0 100755
--- a/c++/scripts/common/check/inspxe.sh
+++ b/c++/scripts/common/check/inspxe.sh
@@ -37,7 +37,7 @@ exe=$1.exe
 shift
 
 # Run test
-"$inspxe" -collect mi3 -knob detect-resource-leaks=false -result-dir $rd -return-app-exitcode -suppression-file "$suppress_dir" -- $exe "$@"
+"$inspxe" -collect mi3 -knob detect-resource-leaks=false -knob stack-depth=32 -result-dir $rd -return-app-exitcode -suppression-file "$suppress_dir" -- $exe "$@"
 app_result=$?
 "$inspxe" -report problems -report-all -result-dir $rd
 insp_result=$?
diff --git a/c++/scripts/common/check/valgrind.supp b/c++/scripts/common/check/valgrind.supp
index 89afb60..8573afd 100644
--- a/c++/scripts/common/check/valgrind.supp
+++ b/c++/scripts/common/check/valgrind.supp
@@ -1,6 +1,6 @@
-# $Id: valgrind.supp 462287 2015-03-17 18:28:07Z vakatov $
+# $Id: valgrind.supp 481966 2015-10-19 16:23:39Z vakatov $
 #
-# Valgrind suppression file (version 3.5.0 -> 3.8.1).
+# Valgrind suppression file (version 3.5.0 -> 3.11.0).
 #
 ################################################################################
 #
@@ -33,6 +33,38 @@
 ################################################################################
 
 
+#{
+#   NCBI VDB ver 2.5.0 -- uninit value created on stack, passed around
+#   Memcheck:Param
+#   fun:__open_nocancel
+#   fun:KSysDirOpenFileRead_v1 (sysdir.c:1838)
+#}
+
+
+{
+   GnuTLS/Nettle -- apparent optimization shortcut
+   Memcheck:Addr8
+   fun:__gmpn_copyi_core2
+   fun:__gmpn_powm
+   fun:__gmpz_powm
+   fun:nettle_rsa_compute_root
+   fun:nettle_rsa_pkcs1_sign_tr
+   fun:_wrap_nettle_pk_sign
+   fun:gnutls_privkey_sign_data
+   fun:_gnutls_check_key_cert_match
+   fun:gnutls_certificate_set_x509_key
+   fun:gnutls_certificate_set_x509_simple_pkcs12_mem
+   fun:gnutls_certificate_set_x509_simple_pkcs12_file
+}
+
+{
+   NCBI VDB ver 2.5.0 -- uninit value created on stack in string_vprintf (printf.c:3374)
+   Memcheck:Cond
+   ...
+   fun:add_aws_nodes
+}
+
+
 {
     corelib/CFileUtil::GetTotalDiskSpace, PANFS, CXX-5713 because DLL is not supposed to be closed
     Memcheck:Leak
@@ -361,6 +393,7 @@
 {
    Googles as an apparent LZO2' intentional overread for performance
    Memcheck:Value8
+   ...
    fun:find_match
    fun:lzo1x_999_compress_internal
    fun:lzo1x_999_compress_level
diff --git a/c++/scripts/common/common.sh b/c++/scripts/common/common.sh
index 0c7298a..451eeec 100755
--- a/c++/scripts/common/common.sh
+++ b/c++/scripts/common/common.sh
@@ -1,5 +1,5 @@
 #
-#  $Id: common.sh 481670 2015-10-14 18:27:18Z ivanov $
+#  $Id: common.sh 481498 2015-10-13 13:57:17Z ucko $
 #  ATTENTION!  This is to be 'included' (using ". common.sh'), not executed!
 #              Then, you execute the "COMMON_xxx" function(s) you like inside
 #              your script.
diff --git a/c++/scripts/common/impl/generate_all_objects.sh b/c++/scripts/common/impl/generate_all_objects.sh
index e730c25..730f45d 100755
--- a/c++/scripts/common/impl/generate_all_objects.sh
+++ b/c++/scripts/common/impl/generate_all_objects.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: generate_all_objects.sh 440349 2014-07-11 15:58:08Z ucko $
+# $Id: generate_all_objects.sh 489003 2016-01-07 16:17:34Z ucko $
 
 # Generate classes for all public ASN.1/XML specs and selected
 # internal ones (if present).
@@ -43,9 +43,11 @@ for spec in src/serial/test/we_cpp.asn src/objects/*/*.asn \
   src/internal/blast/Blastdb2Entrez/dbASN/bdb2ez.asn \
   src/internal/cppcore/test_stat_ext/loader/BoostTestXML.dtd \
   src/internal/gpipe/objects/*/*.asn src/internal/gpipe/objects/*/*.dtd \
+  src/internal/gpipe/objects/*/*.xsd \
   src/internal/gpipe/gpinit/src/gpinit_compare/gpinit.asn \
   src/internal/gpipe/gpexec/queue/lib/gpxapi.asn \
-  src/internal/snp/objects/rsm/rsm.asn; do
+  src/internal/peptides/objects/unimod/unimod.xsd \
+  src/internal/variation/snp/objects/rsm/rsm.asn; do
     if test -f "$spec"; then
         case $spec in
             */seq_annot_ref.asn ) continue ;; # sample data, not a spec
diff --git a/c++/scripts/common/impl/install.sh b/c++/scripts/common/impl/install.sh
index 723644a..66b3d45 100755
--- a/c++/scripts/common/impl/install.sh
+++ b/c++/scripts/common/impl/install.sh
@@ -16,7 +16,7 @@
 
 echo "[`date`]"
 
-svn_location=`echo '$URL: https://svn.ncbi.nlm.nih.gov/repos/toolkit/release/blast/2.3.0/c++/scripts/common/impl/install.sh $' | sed "s%\\$[U]RL: *\\([^$][^$]*\\) \\$.*%\\1%"`
+svn_location=`echo '$URL: https://svn.ncbi.nlm.nih.gov/repos/toolkit/release/blast/2.4.0/c++/scripts/common/impl/install.sh $' | sed "s%\\$[U]RL: *\\([^$][^$]*\\) \\$.*%\\1%"`
 svn_revision=`echo '$Revision: 429376 $' | sed "s%\\$[R]evision: *\\([^$][^$]*\\) \\$.*%\\1%"`
 
 script_name=`basename $0`
diff --git a/c++/scripts/common/impl/run_with_lock.sh b/c++/scripts/common/impl/run_with_lock.sh
index 0f233b1..65d13fc 100755
--- a/c++/scripts/common/impl/run_with_lock.sh
+++ b/c++/scripts/common/impl/run_with_lock.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: run_with_lock.sh 341098 2011-10-17 16:02:18Z ucko $
+# $Id: run_with_lock.sh 483249 2015-10-29 14:36:05Z ucko $
 
 orig_PATH=$PATH
 PATH=/bin:/usr/bin
diff --git a/c++/scripts/common/new_project.wsf b/c++/scripts/common/new_project.wsf
index 364b303..9ca41d7 100644
--- a/c++/scripts/common/new_project.wsf
+++ b/c++/scripts/common/new_project.wsf
@@ -180,7 +180,7 @@
             usage_str += "    [builddir]  -- path to the pre-built NCBI C++ toolkit\n";
             usage_str += "                       default path is: " + GetDefaultCXX_ToolkitFolder() + "\\" + GetDefaultCXX_ToolkitSubFolder() + "\n";
             usage_str += "                       you can only specify a subfolder of " + GetDefaultCXX_ToolkitFolder() + "\n";
-            usage_str += "    [-msvc nn]  -- MSVC version: 100, 100x64, 110, 110x64; default is " + GetDefaultMsvcVer() + "\n";
+            usage_str += "    [-msvc nn]  -- MSVC version: 100, 100x64, 120, 120x64; default is " + GetDefaultMsvcVer() + "\n";
             usage_str += "    [-dll]      -- use  NCBI C++ toolkit DLLs' instead of static libraries\n";
             usage_str += "    [-b]        -- copy NCBI C++ toolkit DLLs' to local binary directories\n";
             usage_str += "    [-v]        -- show details about what is being made\n";
diff --git a/c++/scripts/common/project_utilits.js b/c++/scripts/common/project_utilits.js
index c4feb34..c1fca38 100644
--- a/c++/scripts/common/project_utilits.js
+++ b/c++/scripts/common/project_utilits.js
@@ -10,9 +10,9 @@ var g_open_solution = true;
 var g_def_branch = "toolkit/trunk/internal/c++";
 var g_branch     = "toolkit/trunk/internal/c++";
 
-// valid:   "71", "80", "80x64", "90", "90x64", "100", "100x64", "110", "110x64"
-var g_def_msvcver = "100";
-var g_msvcver     = "100";
+// valid:   "71", "80", "80x64", "90", "90x64", "100", "100x64", "120", "120x64"
+var g_def_msvcver = "120";
+var g_msvcver     = "120";
 
 ////////////////////////////////////////////////////////////////////////////////////
 // Utility functions :
@@ -500,6 +500,7 @@ function SetMsvcVer(oArgs, flag)
                             && msvcver != "90" &&  msvcver != "90x64"
                             && msvcver != "100" && msvcver != "100x64"
                             && msvcver != "110" && msvcver != "110x64"
+                            && msvcver != "120" && msvcver != "120x64"
            ) {
             WScript.Echo("ERROR: Unknown version of MSVC requested: " + msvcver);
             WScript.Quit(1);    
@@ -522,6 +523,9 @@ function GetMsvcFolder()
     if (g_msvcver == "110" || g_msvcver == "110x64") {
         return "vs2013";
     }
+    if (g_msvcver == "120" || g_msvcver == "120x64") {
+        return "vs2013";
+    }
     return "msvc710_prj";
 }
 
@@ -600,9 +604,9 @@ function GetDefaultSuffix()
         s = "msvc10";
     } else if (g_msvcver == "100x64") {
         s = "msvc10.64";
-    } else if (g_msvcver == "110") {
+    } else if (g_msvcver == "110" || g_msvcver == "120") {
         s = "vs2013";
-    } else if (g_msvcver == "110x64") {
+    } else if (g_msvcver == "110x64" || g_msvcver == "120x64") {
         s = "vs2013.64";
     } else {
         s = "msvc71";
@@ -632,6 +636,10 @@ function GetPtbTargetSolutionArgs(oShell, ptb)
         s = " -ide 1100 -arch Win32";
     } else if (g_msvcver == "110x64") {
         s = " -ide 1100 -arch x64";
+    } else if (g_msvcver == "120") {
+        s = " -ide 1200 -arch Win32";
+    } else if (g_msvcver == "120x64") {
+        s = " -ide 1200 -arch x64";
     } else {
         s = " -ide 710 -arch Win32";
     }
@@ -639,7 +647,9 @@ function GetPtbTargetSolutionArgs(oShell, ptb)
 }
 function GetTargetPlatform()
 {
-    if (g_msvcver == "80x64" || g_msvcver == "90x64" || g_msvcver == "100x64" || g_msvcver == "110x64") {
+    if (g_msvcver == "80x64"  || g_msvcver == "90x64" ||
+        g_msvcver == "100x64" || g_msvcver == "110x64" ||
+        g_msvcver == "120x64") {
         return "x64";
     }
     return "Win32";
diff --git a/c++/scripts/projects/blast/Manifest b/c++/scripts/projects/blast/Manifest
index a4500e0..2b70f66 100644
--- a/c++/scripts/projects/blast/Manifest
+++ b/c++/scripts/projects/blast/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 482777 2015-10-26 18:45:55Z camacho $
+# $Id: Manifest 493735 2016-03-01 21:14:46Z camacho $
 #
 # Author: Christiam Camacho
 #
@@ -40,7 +40,7 @@ DEFAULT_CONFIGURE_FLAGS: --without-debug --with-strip --with-openmp --with-mt --
 # ICC gives us about 10% improvement in the core2 microarchitecture, so prefer
 # that. The build-root is needed so that rpmbuild can find the proper directories
 # to copy the binaries from
-Linux64-Centos     : icc : ICC.sh            --with-strip --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile
+Linux64-Centos     : icc : ICC.sh            --with-strip --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile --with-experimental=Int8GI
 #Linux64-Centos     : gcc : GCC.sh            --with-strip --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile
 #Linux64-Centos     : gcc-debug : GCC.sh            --with-strip --with-debug --without-pcre --with-mt --with-openmp --with-flat-makefile
 
@@ -49,6 +49,8 @@ DEFAULT_CONFIGURATIONS: Linux64-Centos:icc
 Win32         : plain : static  32  ReleaseMT
 Win64         : plain : static  64  ReleaseMT
 
-IntelMAC    : universal : GCC.sh --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile --with-universal=i386,x86_64 --with-ncbi-public
+#IntelMAC            : universal : GCC.sh   --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile --with-universal=i386,x86_64 --with-ncbi-public
+IntelMAC    : universal : Clang.sh --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile --with-universal=i386,x86_64 --with-ncbi-public --with-experimental=Int8GI
+#IntelMAC-Clang36    : clang     : Clang.sh --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile --with-ncbi-public
 
 USE_COMPONENTS
diff --git a/c++/scripts/projects/blast/components.link b/c++/scripts/projects/blast/components.link
index 0072cc9..e8df490 100644
--- a/c++/scripts/projects/blast/components.link
+++ b/c++/scripts/projects/blast/components.link
@@ -1,10 +1,9 @@
 [components]
-infrastructure  16.1
-core            16.1
-dbase           16.1
-web             16.1
-objects         16.1
-objtools        16.1
-algo            16.1
-blast           16.1
-app             16.1
+infrastructure  17.0
+core            17.0
+dbase           17.0
+web             17.0
+objects         17.0
+objtools        17.0
+algo            17.0
+app             17.0
diff --git a/c++/scripts/projects/blast/post_build/blast_utils.py b/c++/scripts/projects/blast/post_build/blast_utils.py
index 1bd530b..08da04a 100644
--- a/c++/scripts/projects/blast/post_build/blast_utils.py
+++ b/c++/scripts/projects/blast/post_build/blast_utils.py
@@ -1,17 +1,21 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """ Various utilities/tools for BLAST """
+from __future__ import print_function
 
-__all__ = [ "safe_exec", "update_blast_version" ]
+__all__ = ["safe_exec", "update_blast_version"]
 
 import os
 import subprocess
-import shutil
 import platform
-        
+import unittest
+import tempfile
+import re
+
+
 def safe_exec(cmd):
     """ Executes a command and checks its return value, throwing an
         exception if it fails.
-    """   
+    """
     try:
         msg = "Command: '" + cmd + "' "
         retcode = subprocess.call(cmd, shell=True)
@@ -21,37 +25,61 @@ def safe_exec(cmd):
         elif retcode != 0:
             msg += "Failed with exit code " + str(retcode)
             raise RuntimeError(msg)
-    except OSError, err:
+    except OSError as err:
         msg += "Execution failed: " + err
         raise RuntimeError(msg)
 
-def update_blast_version(config_file, blast_version):
+
+class Tester(unittest.TestCase):
+    '''Testing class for this script.'''
+    def test_one(self):
+        ver = "2.3.0"
+        line1 = "Hello BLAST"
+        with tempfile.NamedTemporaryFile(mode='w+t') as fp:
+            print(line1, file=fp)
+            print("BLAST_VERSION", file=fp)
+            print(line1, file=fp, flush=True)
+
+            update_blast_version(fp.name, ver)
+
+            fp.seek(0)
+            line = fp.readline().rstrip()
+            self.assertEqual(line1, line)
+            line = fp.readline().rstrip()
+            self.assertEqual(ver, line)
+            line = fp.readline().rstrip()
+            self.assertEqual(line1, line)
+
+
+def update_blast_version(config_file, ver):
     """Updates the BLAST version in the specified file.
-    
+
     Assumes the specified file contains the string BLAST_VERSION, which will
     be replaced by the contents of the variable passed to this function.
     """
-    import re
-    temp_fname = os.tmpnam()
-    shutil.move(config_file, temp_fname)
+    (fd, fname) = tempfile.mkstemp()
     try:
-        out = open(config_file, "w")
-        infile = open(temp_fname, "r")
-        for line in infile:
-            print >> out, re.sub("BLAST_VERSION", blast_version, line),
+        with open(config_file, "r") as infile, open(fname, "w") as out:
+            for line in infile:
+                newline = re.sub("BLAST_VERSION", ver, line.rstrip())
+                print(newline, file=out)
+
+        with open(config_file, "w") as out, open(fname, "r") as infile:
+            for line in infile:
+                print(line.rstrip(), file=out)
     finally:
-        out.close()
-        infile.close()
-        os.unlink(temp_fname)
+        os.close(fd)
+        os.remove(fname)
+
 
 def create_new_tarball_name(platform, program, version):
-    """ Converts the name of a platform as specified to the prepare_release 
+    """ Converts the name of a platform as specified to the prepare_release
     framework to an archive name according to BLAST release naming conventions.
-    
+
     Note: the platform names come from the prepare_release script conventions,
     more information can be found in http://mini.ncbi.nih.gov/3oo
     """
-    
+
     retval = "ncbi-" + program + "-" + version
     if program == "blast":
         retval += "+"
@@ -73,13 +101,14 @@ def create_new_tarball_name(platform, program, version):
         raise RuntimeError("Unknown platform: " + platform)
     return retval
 
+
 def determine_platform():
     """ Determines the platform (as defined in prepare_release) for the current
-    hostname 
+    hostname
     """
 
     p = platform.platform().lower()
-    print "PLATFORM = " + p
+    print("PLATFORM = " + p)
     if p.find("linux") != -1:
         if p.find("x86_64") != -1:
             return "Linux64"
diff --git a/c++/scripts/projects/blast/post_build/make_installers.py b/c++/scripts/projects/blast/post_build/make_installers.py
index bc3817a..d7ce0b6 100755
--- a/c++/scripts/projects/blast/post_build/make_installers.py
+++ b/c++/scripts/projects/blast/post_build/make_installers.py
@@ -1,10 +1,11 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Driver program for post-build processing"""
-# $Id: make_installers.py 460014 2015-02-24 16:22:34Z camacho $
+# $Id: make_installers.py 495954 2016-03-22 19:12:50Z camacho $
 #
 # Author: Christiam Camacho
 #
 
+from __future__ import print_function
 import os, sys, os.path
 from optparse import OptionParser
 import blast_utils
@@ -28,10 +29,10 @@ def main(): #IGNORE:R0911
     global VERBOSE #IGNORE:W0603
     VERBOSE = options.VERBOSE
     if VERBOSE:
-        print "BLAST version", blast_version
-        print "Platform:", platform
-        print "Installation directory:", installdir
-        print "Source tarball:", srctarball
+        print("BLAST version", blast_version)
+        print("Platform:", platform)
+        print("Installation directory:", installdir)
+        print("Source tarball:", srctarball)
 
     if platform.startswith("Win"):
         return launch_win_installer_build(installdir, blast_version)                
@@ -43,14 +44,14 @@ def main(): #IGNORE:R0911
     if platform == "IntelMAC":
         return mac_post_build(installdir, blast_version)
     
-    print >> sys.stderr, "Unknown OS identifier: " + platform
-    print >> sys.stderr, "Exiting post build script."
+    print("Unknown OS identifier:" + platform, file=sys.stderr)
+    print("Exiting post build script.", file=sys.stderr)
     return 2
 
 def launch_win_installer_build(installdir, blast_version):
     '''Windows post-build: create installer'''
     if VERBOSE: 
-        print "Packaging for Windows..."
+        print("Packaging for Windows...")
     cmd = "python " + os.path.join(SCRIPTS_DIR, "win", "make_win.py") + " "
     cmd += blast_version + " " + installdir
     if VERBOSE: 
@@ -61,8 +62,8 @@ def launch_win_installer_build(installdir, blast_version):
 def launch_rpm_build(installdir, blast_version, srctarball):
     '''Linux post-build: create RPM'''
     if VERBOSE: 
-        print "Packing linux RPM..."
-    cmd = "python " + os.path.join(SCRIPTS_DIR, "rpm", "make_rpm.py") + " "
+        print("Packing linux RPM...")
+    cmd = "python3 " + os.path.join(SCRIPTS_DIR, "rpm", "make_rpm.py") + " "
     cmd += blast_version + " " + installdir + " " + srctarball
     if VERBOSE: 
         cmd += " -v"
@@ -73,7 +74,7 @@ def launch_rpm_build(installdir, blast_version, srctarball):
 def mac_post_build(installdir, blast_version):
     '''MacOSX post-build: create installer'''
     if VERBOSE:
-        print "Packaging for MacOSX..."
+        print("Packaging for MacOSX...")
     script_dir = os.path.join(SCRIPTS_DIR, "macosx")
     cmd = os.path.join(script_dir, "ncbi-blast.sh") + " "
     cmd += installdir + " " + script_dir + " " + blast_version
@@ -82,7 +83,7 @@ def mac_post_build(installdir, blast_version):
 
 def do_nothing(platform):
     '''No op function'''
-    print "No post-build step necessary for", platform
+    print("No post-build step necessary for", platform)
     return 0
 
 # The script execution entry point
diff --git a/c++/scripts/projects/blast/post_build/rpm/make_rpm.py b/c++/scripts/projects/blast/post_build/rpm/make_rpm.py
index 3ea93c4..9182709 100755
--- a/c++/scripts/projects/blast/post_build/rpm/make_rpm.py
+++ b/c++/scripts/projects/blast/post_build/rpm/make_rpm.py
@@ -1,8 +1,9 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Script to create a source/binary RPM.
 """
-# $Id: make_rpm.py 478474 2015-09-09 15:57:05Z camacho $
+# $Id: make_rpm.py 496041 2016-03-23 14:47:36Z camacho $
 
+from __future__ import print_function
 import sys, os, shutil
 from optparse import OptionParser
 import subprocess
@@ -34,18 +35,15 @@ def setup_rpmbuild():
     os.chdir(cwd)
 
     # Create ~/.rpmmacros
-    try:
-        out = open(RPMMACROS, "w")
-        print >> out, "%_topdir %( echo", os.path.join(cwd, RPMBUILD_HOME), ")"
-        print >> out, "%_tmppath %( echo", 
-        print >> out, os.path.join(cwd, RPMBUILD_HOME, "tmp"), ")"
-        print >> out
-        print >> out, "%packager Christiam E. Camacho (camacho at ncbi.nlm.nih.gov)"
-        print >> out, "%debug_package %{nil}"
-    finally:
-        out.close()
-    if VERBOSE: 
-        print "Created", RPMMACROS
+    with open(RPMMACROS, "w") as out:
+        print("%_topdir %( echo", os.path.join(cwd, RPMBUILD_HOME), ")", file=out)
+        print("%_tmppath %( echo", end=' ', file=out) 
+        print(os.path.join(cwd, RPMBUILD_HOME, "tmp"), ")", file=out)
+        print(file=out)
+        print("%packager Christiam E. Camacho (camacho at ncbi.nlm.nih.gov)", file=out)
+        print("%debug_package %{nil}", file=out)
+        if VERBOSE: 
+            print("Created", RPMMACROS)
 
 def cleanup_rpm():
     """ Delete rpm files """
@@ -68,7 +66,7 @@ def cleanup_srctarball_contents():
         if os.path.exists(path):
             shutil.rmtree(path)
             if VERBOSE: 
-                print "Deleting", path
+                print("Deleting", path)
                
     projects_path = os.path.join(PACKAGE_NAME, "c++", "scripts", "projects")
     for root, dirs, files in os.walk(projects_path): 
@@ -77,7 +75,7 @@ def cleanup_srctarball_contents():
             if fnmatch.fnmatch(name, "*blast/*"): 
                 continue
             if VERBOSE:
-                print "Deleting file", name
+                print("Deleting file", name)
             os.remove(name)
             
         for name in dirs:
@@ -85,7 +83,7 @@ def cleanup_srctarball_contents():
             if fnmatch.fnmatch(name, "*blast*"):
                 continue
             if VERBOSE: 
-                print "Deleting directory", name
+                print("Deleting directory", name)
             shutil.rmtree(name)
             
 
@@ -134,8 +132,9 @@ def move_rpms_to_installdir(installdir):
     args = [ "find", RPMBUILD_HOME, "-name", "*.rpm" ]
     output = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
     for rpm in output.split():
+        rpm = rpm.decode('ascii')
         if VERBOSE: 
-            print "mv", rpm, installer_dir
+            print("mv", rpm, installer_dir)
         shutil.move(rpm, installer_dir)
 
 
@@ -156,7 +155,7 @@ def main():
     global VERBOSE, PACKAGE_NAME, TARBALL #IGNORE:W0603
     VERBOSE = options.VERBOSE
     if VERBOSE: 
-        print "Installing RPM to", installdir
+        print("Installing RPM to", installdir)
         
     PACKAGE_NAME = "ncbi-blast-" + blast_version + "+"
     TARBALL = PACKAGE_NAME + ".tgz"
diff --git a/c++/scripts/projects/blast/post_build/rpm/ncbi-blast.spec b/c++/scripts/projects/blast/post_build/rpm/ncbi-blast.spec
index 15195b2..61c7d62 100644
--- a/c++/scripts/projects/blast/post_build/rpm/ncbi-blast.spec
+++ b/c++/scripts/projects/blast/post_build/rpm/ncbi-blast.spec
@@ -10,6 +10,50 @@ BuildArch:   i686 x86_64
 BuildRoot:   /var/tmp/%{name}-buildroot
 Prefix:      /usr
 
+AutoReqProv: no
+Requires:    /usr/bin/perl  
+Requires:    ld-linux-x86-64.so.2()(64bit)  
+Requires:    ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)  
+Requires:    libbz2.so.1()(64bit)  
+Requires:    libc.so.6()(64bit)  
+Requires:    libc.so.6(GLIBC_2.2.5)(64bit)  
+Requires:    libc.so.6(GLIBC_2.3)(64bit)  
+Requires:    libc.so.6(GLIBC_2.3.2)(64bit)  
+Requires:    libc.so.6(GLIBC_2.7)(64bit)  
+Requires:    libdl.so.2()(64bit)  
+Requires:    libdl.so.2(GLIBC_2.2.5)(64bit)  
+Requires:    libgcc_s.so.1()(64bit)  
+Requires:    libgcc_s.so.1(GCC_3.0)(64bit)  
+Requires:    libm.so.6()(64bit)  
+Requires:    libm.so.6(GLIBC_2.2.5)(64bit)  
+Requires:    libnsl.so.1()(64bit)  
+Requires:    libpthread.so.0()(64bit)  
+Requires:    libpthread.so.0(GLIBC_2.2.5)(64bit)  
+Requires:    libpthread.so.0(GLIBC_2.3.2)(64bit)  
+Requires:    librt.so.1()(64bit)  
+Requires:    libstdc++.so.6()(64bit)  
+Requires:    libstdc++.so.6(CXXABI_1.3)(64bit)  
+Requires:    libstdc++.so.6(CXXABI_1.3.1)(64bit)  
+Requires:    libstdc++.so.6(GLIBCXX_3.4)(64bit)  
+Requires:    libstdc++.so.6(GLIBCXX_3.4.5)(64bit)  
+Requires:    libz.so.1()(64bit)  
+Requires:    libz.so.1(ZLIB_1.2.0)(64bit)  
+Requires:    perl(Archive::Tar)  
+Requires:    perl(Digest::MD5)  
+Requires:    perl(File::Temp)  
+Requires:    perl(File::stat)  
+Requires:    perl(Getopt::Long)  
+Requires:    perl(List::MoreUtils)  
+Requires:    perl(Net::FTP)  
+Requires:    perl(Pod::Usage)  
+Requires:    perl(constant)  
+Requires:    perl(strict)  
+Requires:    perl(warnings)  
+Requires:    rpmlib(CompressedFileNames) <= 3.0.4-1
+Requires:    rpmlib(FileDigests) <= 4.6.0-1
+Requires:    rpmlib(PayloadFilesHavePrefix) <= 4.0-1
+Requires:    rpmlib(PayloadIsXz) <= 5.2-1
+
 %description
 The NCBI Basic Local Alignment Search Tool (BLAST) finds regions of
 local similarity between sequences. The program compares nucleotide or
diff --git a/c++/scripts/projects/blast/post_build/rpm/test.sh b/c++/scripts/projects/blast/post_build/rpm/test.sh
new file mode 100755
index 0000000..b5505f3
--- /dev/null
+++ b/c++/scripts/projects/blast/post_build/rpm/test.sh
@@ -0,0 +1,13 @@
+#!/bin/sh -xe
+# Script to run the make_rpm.py script. Assumes SRC_TARBALL exists and points
+# to the output of a prepare_release build
+SRC_TARBALL=/net/snowman/vol/export4/blastqa/camacho/OUTPUT/prepare_release.2016-04-16-00-11-44.build.blast-2.3.1/releaseSrc.tar.gz
+INST=JUNK_DIR
+rm -fr $INST
+mkdir $INST
+./make_rpm.py -v 2.3.1 $INST $SRC_TARBALL
+rpm -qp --provides $INST/installer/ncbi-blast-2.3.1+-1.x86_64.rpm >p
+rpm -qp --requires $INST/installer/ncbi-blast-2.3.1+-1.x86_64.rpm >r
+# set +e
+# diff p provides.new
+# diff r requires.new
diff --git a/c++/scripts/projects/blast/post_build/win/make_win.py b/c++/scripts/projects/blast/post_build/win/make_win.py
index 5a7b1d2..648b3ef 100644
--- a/c++/scripts/projects/blast/post_build/win/make_win.py
+++ b/c++/scripts/projects/blast/post_build/win/make_win.py
@@ -1,9 +1,10 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 """Script to create the Windows installer for BLAST command line applications"""
-# $Id: make_win.py 463585 2015-03-30 18:17:24Z camacho $
+# $Id: make_win.py 495892 2016-03-22 15:02:26Z camacho $
 #
 # Author: Christiam camacho
 
+from __future__ import print_function
 import os, sys, os.path
 import shutil
 from optparse import OptionParser
@@ -67,7 +68,7 @@ def main():
     for app in apps:
         app = os.path.join(installdir, "bin", app)
         if VERBOSE: 
-            print "Copying", app, "to", cwd
+            print("Copying", app, "to", cwd)
         shutil.copy(app, cwd)
     
     
@@ -85,7 +86,7 @@ def main():
     for aux_file in ("EnvVarUpdate.nsh", "ncbilogo.ico"):
         src = os.path.join(SCRIPT_DIR, aux_file)
         if VERBOSE:
-            print "Copying", src, "to", cwd
+            print("Copying", src, "to", cwd)
         shutil.copy(src, cwd)
         
     # makensis is in the path of the script courtesy of the release framework
diff --git a/c++/scripts/projects/corelib/Manifest b/c++/scripts/projects/corelib/Manifest
index 72d20a8..814dcdd 100644
--- a/c++/scripts/projects/corelib/Manifest
+++ b/c++/scripts/projects/corelib/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 474940 2015-08-03 15:56:40Z fukanchi $
+# $Id: Manifest 486339 2015-12-03 15:52:01Z fukanchi $
 #
 # Author: Sergey Satskiy
 #
@@ -33,7 +33,7 @@ Linux64-Centos  : icc       : ICC.sh       --without-debug --without-mt --with-s
 Linux64-Centos  : icc_mtdll : ICC.sh       --without-debug --with-mt --with-dll --without-runpath --with-flat-makefile
 Linux64-Centos  : gcc       : GCC.sh       --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
 
-FreeBSD32  : plain     : Clang.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
+FreeBSD64  : plain     : Clang.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
 
 SunOSx86   : gcc     : GCC.sh 4.5.3     --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
 SunOSx86   : w55     : WorkShop55.sh 32 --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
diff --git a/c++/scripts/projects/datatool/ChangeLog b/c++/scripts/projects/datatool/ChangeLog
index 9f7b0e5..d85ed64 100644
--- a/c++/scripts/projects/datatool/ChangeLog
+++ b/c++/scripts/projects/datatool/ChangeLog
@@ -145,3 +145,13 @@ Fixed bugs in schema parsing .
 June 29, 2015
 version 2.14.0,  CXX-6104
 Added option to selectively write named integers by value only.
+
+March 21, 2016
+version 2.15.0, CXX-7948
+Added mapping of certain data types to strings.
+Fixed delayed buffer in choice variants.
+Changed to print schema comments using documentation tag.
+
+
+
+
diff --git a/c++/scripts/projects/datatool/Manifest b/c++/scripts/projects/datatool/Manifest
index c19dec7..4172f6f 100644
--- a/c++/scripts/projects/datatool/Manifest
+++ b/c++/scripts/projects/datatool/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 483955 2015-11-05 15:16:36Z fukanchi $
+# $Id: Manifest 486339 2015-12-03 15:52:01Z fukanchi $
 #
 # Author: Sergey Satskiy
 #
@@ -30,7 +30,7 @@ APP: datatool
 Linux64-Centos  : plain  : GCC.sh      --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c
 Linux64-Ubuntu  : plain  : GCC.sh      --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c
 
-FreeBSD32  : plain  : Clang.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c
+FreeBSD64  : plain  : Clang.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c
 
 IntelMAC   : plain  : GCC.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c
 
diff --git a/c++/scripts/projects/datatool/components.link b/c++/scripts/projects/datatool/components.link
index 373477a..e34864e 100644
--- a/c++/scripts/projects/datatool/components.link
+++ b/c++/scripts/projects/datatool/components.link
@@ -1,3 +1,3 @@
 [components]
-infrastructure  16.1
-core            16.1
+infrastructure  17.0
+core            17.0
diff --git a/c++/scripts/projects/dispatcher/Manifest b/c++/scripts/projects/dispatcher/Manifest
index 4cda81d..e7e503e 100644
--- a/c++/scripts/projects/dispatcher/Manifest
+++ b/c++/scripts/projects/dispatcher/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 469726 2015-06-08 16:04:24Z lavr $
+# $Id: Manifest 486339 2015-12-03 15:52:01Z fukanchi $
 #
 # Author: Sergey Satskiy
 #
@@ -35,6 +35,6 @@ POSTBUILD: [ "$platform" != "Cygwin64" ] || { cp -vp /usr/{bin/cygcheck.exe,bin/
 # --with-distcc, --with-action etc.
 Linux64-Centos  : ICC   : ICC.sh         --with-local-lbsm --without-debug --without-mt --with-static --without-serial --without-runpath --with-flat-makefile
 Linux64-Centos  : GCC   : GCC.sh         --with-local-lbsm --without-debug --without-mt --with-static --without-serial --without-runpath --with-flat-makefile
-FreeBSD32       : Clang : Clang.sh       --with-local-lbsm --without-debug --without-mt --with-static --without-serial --without-runpath --with-flat-makefile
+FreeBSD64       : Clang : Clang.sh       --with-local-lbsm --without-debug --without-mt --with-static --without-serial --without-runpath --with-flat-makefile
 IntelMAC        : GCC   : GCC.sh         --with-local-lbsm --without-debug --without-mt --with-static --without-serial --without-runpath --with-flat-makefile --with-universal=i386,x86_64
 # Cygwin64        : GCC   : GCC.sh         --with-local-lbsm --without-debug --without-mt --with-static --without-serial --without-runpath --without-flat-makefile
diff --git a/c++/scripts/projects/grid/ChangeLog b/c++/scripts/projects/grid/ChangeLog
deleted file mode 100644
index 2ede8a2..0000000
--- a/c++/scripts/projects/grid/ChangeLog
+++ /dev/null
@@ -1,219 +0,0 @@
-2015-02-05 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* grid_cli getjoboutput: fix for incorrect input stream status check
-
-2015-01-21 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* remote_cgi, remote_app: can run behind firewalls now.
-	* grid_cli: new default: try all servers in service to find ICache blob.
-	* grid_cli: new command 'discover' to query LBSM.
-	* grid_cli replay: new option '--dump-cgi-stdin'.
-
-	* all applications: fixed service traversal with unresponsive NC server.
-
-2014-12-23 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* cgi2rcgi: fix for when framework overrides Status header from template
-
-2014-11-18 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* remote_cgi, remote_app: implicit affinity specification
-	* grid_cli: support for NetStorage object attributes
-	* remote_cgi, remote_app: NetCache parameters in NetSchedule servers
-	* ncfetch.cgi: now works with NetStorage objects
-	* remote_cgi, remote_app: new "offline" mode for development and testing
-	* remote_cgi, remote_app: suspend (pause)/resume functionality
-	* remote_cgi, remote_app: option to fail jobs without further retries
-	* all applications: support for page hit IDs
-	* remote_cgi, remote_app: can limit the number of parallel jobs per user
-	* cgi2rcgi: support for JSONP
-	* grid_cli: new option --try-all-servers to find an ICache blob
-	* all applications: support for blob keys used by NetCache in HTTP mode
-	* grid_cli: new option to cancel only the pending jobs
-	* remote_cgi, remote_app: support for job groups
-	* grid_cli reconf: new option --mirror to reconfigure NC mirrors on the fly
-	* cgi2rcgi: new option add_job_id_to_response=true (the real CGI response)
-
-	* all applications: mention relevant blob and job keys in error messages
-
-	* remote_cgi, remote_app: fix for omission of standby/penalized NS servers
-	* grid_cli: fix for dynamic queue creation
-	* remote_cgi, remote_app: fix for timeout on Windows due to large job output
-
-2013-12-11 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* grid_cli: support for NetStorage architecture.
-	* all: support for NS and NC keys in CompoundID format.
-	* all: NC keys generated by mirrored servers are now "mirrored".
-	* remote_app, remote_cgi: print more info in reply to 'STAT'.
-	* remote_app, remote_cgi: new arguments '-daemon', '-nodaemon'.
-	* grid_cli: support for NetSchedule servers in 'health' command.
-	* grid_cli: support for NetCache servers in 'drain' command.
-	* grid_cli: new login option '--no-conn-retries'.
-
-	* grid_cli: use new administrative NetSchedule commands.
-	* remote_app, remote_cgi: on startup, wait for NS servers to appear.
-	* all: ability to handle floating-point NS timeouts.
-	* ncfetch.cgi: ability to set Content-Disposition type to inline.
-	* remote_app, remote_cgi: verify that the executable actually exists.
-	* remote_app, remote_cgi: send their affinities to each new NS server.
-
-	* remote_app, remote_cgi: do not submit results for cancelled jobs.
-	* remote_app, remote_cgi: fix for sending an empty list of affinities.
-	* remote_app, remote_cgi: create procinfofile just before idle loop.
-	* remote_app, remote_cgi: send the correct port number to NS.
-	* remote_app, remote_cgi: support for floating point in NS RECO output.
-	* remote_app, remote_cgi: fixed lock-up after failing an exclusive job.
-
-2012-12-20 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* all: Job input/output NetCache blobs are prolonged for job liftime.
-	* all worker nodes: New command line option -procinfofile.
-	* all: Client identification is sent to NetSchedule for accountability.
-	* all: Web client IP/session tracking in all applications.
-	* grid_cli: Support for real-time job watching.
-	* grid_cli: NetSchedule reconfiguration now produces a list of changes.
-	* grid_cli: New options to submit and retrieve remote_app jobs.
-	* grid_cli: New queueinfo option to show information on queue classes.
-	* grid_cli: New command to purge NetCache databases.
-
-	* all worker nodes: Improved NetSchedule server querying.
-	* all worker nodes: Job result submission from a separate thread.
-	* all worker nodes: Keep running even if all NS servers are down.
-	* all worker nodes: When idle, terminate immediately upon request.
-	* cgi2rcgi: Shorter job submission timeout to skip unresponsive servers.
-	* grid_cli, ncfetch: enable_mirroring="if_key_mirrored" by default.
-	* grid_cli: stats --ns --jobs-by-status now also work without --queue.
-
-	* all worker nodes: Fixed occasional GET2 errors due to zero timeout.
-	* all worker nodes: Recovery from ePrefAffExpired when no affinities.
-	* remote_app, remote_cgi: Treat $PATH as case-insensitive on Windows.
-
-2012-06-20 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* all: This release is not compatible with older NetSchedule anymore.
-	* all workers: Support for job affinities.
-	* grid_cli (login): New command to generate client session token for NS.
-	* all: Cross-site connections to NS and NC servers through a proxy.
-	* all: New configuration parameter smart_service_retries.
-	* all workers: Display of client identification in STAT output.
-	* grid_cli (replay): New command to reconstruct remote_cgi environment.
-	* grid_cli (--admin): All admin commands now accept LBSM services.
-	* grid_cli (drain): New command to switch NS to "draining" mode.
-
-	* cgi2rcgi: Now accepts inline progress messages (versus NC keys).
-	* cgi2rcgi: New parameter html_pass_through to pass HTML output as is.
-	* ncfetch.cgi: Proper HTTP status codes for client-side errors.
-	* cgi2rcgi: Faster job result retrieval.
-	* all workers: Better handling of NetSchedule notifications.
-	* all apps: Uniform version reporting across all Grid applications.
-	* grid_cli (stats): Better command line option checking.
-	* all: Ignore server logic errors when looking for a vacant server.
-	* grid_cli, ncfetch.cgi: Auto switching to mirroring mode for reading.
-	* grid_cli (stats): --active-job-count re-implemented using STAT JOBS.
-	* grid_cli (stats): Options --aggregation-interval, --previous-interval.
-	* remote_cgi, remote_app: Define $NCBI_NS_QUEUE along with $NCBI_NS_JID.
-
-	* all: Fixed automatic mirroring mode for keys containing service name.
-
-2012-04-05 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* all: Support for NetSchedule client identification.
-	* grid_cli (readjob): New job "reading" semantics.
-	* grid_cli (submitjob): New option to wait for job completion.
-	* grid_cli (getconf): Now works for NetSchedule as well.
-	* all: Support for server initiated warnings (NetSchedule).
-	* grid_cli (stats): New option to retrieve NetSchedule client registry.
-	* grid_cli (stats): Option to print current NS notification subscribers.
-	* grid_cli (stats): New option to print information on affinities (NS).
-	* grid_cli (dumpqueue): Options for pagination and selection by status.
-	* grid_cli: Support for NetSchedule job groups.
-	* grid_cli (canceljob): Options to cancel all jobs or job group.
-	* grid_cli: Support for NetSchedule extended version output.
-	* grid_cli: Multiple options for NetSchedule testing and debugging.
-
-	* all: Better support of NetCache mirroring.
-	* grid_cli (jobinfo): Pretty-printing of NetSchedule job events.
-	* all: Dropped support for NetSchedule tags and deprecated commands.
-	* grid_cli (help): Separation of command synopses by topic.
-	* grid_cli (serverinfo): Now works for LBSM services too.
-	* grid_cli: Alphabet for affinity tokens: alphanumerics + '.' + '_'
-
-	* all: Fixed a bug in iteration over mirrored NetCache servers.
-	* grid_cli (deletequeue): Fixed argument parsing.
-	* grid_cli (blobinfo): Now works in ICache mode.
-	* grid_cli: Fixed a race condition in saving job progress message.
-
-2011-06-22 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* grid_cli: Support for worker nodes (serverinfo, stats, shutdown).
-	* grid_cli: New submitjob option '--progress-message'.
-
-	* remote_cgi, remote_app: Dropped NetSchedule commands REGC, URGC.
-
-	* grid_cli, netcache_control: Restored NetCache backward compatibility.
-	* remote_cgi, remote_app: Do not send binary zeros over control socket.
-
-2011-06-09 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* grid_cli: Initial release.
-	* cgi2rcgi.cgi: Now allows to narrow the set of job affinities.
-	* netcache_control: New option to override blob server address.
-	* netschedule_control: New option to override job server address.
-	* netcache_control: New parameter -blobinfo.
-
-	* all worker nodes: Fixed listening port allocation on Windows.
-	* cgi2rcgi: Does not create blobs for empty progress messages anymore.
-	* cgi2rcgi: Fix for: some substitutions missing if expect_complete = 0.
-
-2010-09-28 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* cgi2rcgi.cgi: Support for JSON output.
-	* ncfetch.cgi: New CGI parameter "filename".
-
-	* netcache_control: New command -remove.
-	* cgi2rcgi.cgi: job_key parameter can contain spaces now.
-
-	* cgi2rcgi.cgi: User-visible errors are also logged now.
-	* ncfetch.cgi: No-password error is correctly reported now.
-
-2010-08-16 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* ncfetch.cgi: Now can use password-protected NetCache API.
-	* cgi2rcgi: Affinity token for NetSchedule can be specified.
-	* netcache_control: New parameters -reinit, -reconf, -auth.
-	* cgi2rcgi: Custom (error-specific) HTML and header templates.
-
-	* cgi2rcgi: HTTP headers to disable caching by proxy servers.
-	* remote_app, remote_cgi: tmp_dir now allows substitutions.
-	* all worker nodes: New retry logic to reconnect to NS/NC.
-
-	* remote_app: Now survives "Not all data sent to child process".
-	* all worker nodes: No "basic_ios::clear" error anymore.
-	* cgi2rcgi: A bug associated with donot_parse_content was fixed.
-	* remote_app: Job is now failed if unable to send results to NC.
-	* remote_app, remote_cgi: Proper handling of job cancellation.
-	* cgi2rcgi: No excessive polling of NC while waiting for results.
-
-	* netcache_control: Commands -dropstat and -log were removed.
-
-2009-07-17 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* remote_app, remote_cgi: Timeouts are now treated as failures.
-	* save_to_nc, netcache_control: Fixed binary IO on Windows.
-	* remote_app: Fixed temporary directory removal on Windows.
-	* remote_app: Fix: send the END line after multiline ouptut.
-
-	* NS/NC API: Pass along ClientIP and SessionID to the server.
-	* remote_app, remote_cgi: Implemented the INIT NS command.
-	* ns_remote_job_control: Implemented bulk dump of output.
-
-	* netschedule control: Implemented the 'cancel' action.
-	* NC API: Added a method to retrieve blob size.
-	* remote_app, remote_cgi: Introduced [log]/merge_lines=yes/no.
-
-	* netbvstore: The server and its client API were removed.
-
-2008-10-07 Dmitry Kazimirov <kazimird at ncbi.nlm.nih.gov>
-
-	* GRID 1.0.0: The first packaged release.
diff --git a/c++/scripts/projects/grid/LICENSE b/c++/scripts/projects/grid/LICENSE
deleted file mode 100644
index f3577c2..0000000
--- a/c++/scripts/projects/grid/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-                            PUBLIC DOMAIN NOTICE
-               National Center for Biotechnology Information
-
-  This software/database is a "United States Government Work" under the
-  terms of the United States Copyright Act.  It was written as part of
-  the author's official duties as a United States Government employee and
-  thus cannot be copyrighted.  This software/database is freely available
-  to the public for use. The National Library of Medicine and the U.S.
-  Government have not placed any restriction on its use or reproduction.
-
-  Although all reasonable efforts have been taken to ensure the accuracy
-  and reliability of the software and data, the NLM and the U.S.
-  Government do not and cannot warrant the performance or results that
-  may be obtained by using this software or data. The NLM and the U.S.
-  Government disclaim all warranties, express or implied, including
-  warranties of performance, merchantability or fitness for any particular
-  purpose.
-
-  Please cite the author in any work or product based on this material.
diff --git a/c++/scripts/projects/grid/Manifest b/c++/scripts/projects/grid/Manifest
deleted file mode 100644
index 612061a..0000000
--- a/c++/scripts/projects/grid/Manifest
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Filename: Manifest
-#
-# $Id: Manifest 481183 2015-10-07 16:16:53Z fukanchi $
-#
-# Author:  Dmitry Kazimirov
-#
-# Purpose: This file defines all the supported configurations of the Grid
-#          package.  It is used by the prepare_release system.
-#
-
-APP: remote_app ns_submit_remote_job ns_remote_job_control
-ETC: src/app/grid/remote_app/remote_app.ini
-
-APP: remote_cgi cgi2rcgi
-ETC: src/app/grid/remote_app/remote_cgi.ini src/app/grid/cgi2rcgi/cgi2rcgi.ini
-
-APP: cgi_tunnel2grid.cgi$exe
-ETC: src/app/grid/cgi_tunnel2grid/sample/sample.ini
-
-APP: test_gridclient_stress test_grid_worker
-ETC: src/app/grid/test/test_gridclient_stress.ini
-ETC: src/app/grid/test/test_grid_worker.ini
-
-APP: test_netschedule_client test_netschedule_node test_netschedule_stress
-ETC: src/app/grid/test/test_netschedule_node.ini
-
-APP: grid_cli netschedule_control
-APP: netcache_control ncfetch.cgi$exe
-APP: cidtool
-
-APP: file_upload.cgi$exe
-ETC: src/app/grid/util/file_upload.ini
-
-# Each line describes a single configuration
-# The format is as follows:
-# <HardwareIdentifier> : <ReleaseSuffix> : <CompilerConfigurationScriptWithKeys>
-# Configuration script is relative to c++/compilers/unix/ .
-# Release configurator assumes that this script will eventually call standard configure script and pass all options
-# to it. So some standard options may be added by release configurator, such as --build-root-sfx, --with-projects,
-# --with-distcc, --with-action etc.
-
-Linux64-Centos : Release : GCC.sh --without-debug --with-optimization --with-symbols --with-mt --without-bdb
-Linux64-Centos : Debug : GCC.sh --with-debug --with-mt --without-bdb
-Linux64-Ubuntu : Release : GCC.sh --without-debug --with-optimization --with-symbols --with-mt --without-bdb
-Linux64-Ubuntu : Debug : GCC.sh --with-debug --with-mt --without-bdb
-Linux32-Ubuntu : Release : GCC.sh --without-debug --with-optimization --with-symbols --with-mt --without-bdb --without-runpath
-FreeBSD32 : Release : Clang.sh --without-debug --with-optimization --with-symbols --with-mt --without-bdb
-FreeBSD32 : Debug : Clang.sh --with-debug --with-mt --without-bdb
-IntelMAC : Release : GCC.sh --without-debug --with-optimization --with-symbols --with-mt --without-bdb
-IntelMAC : Debug : GCC.sh --with-debug --with-mt --without-bdb
-Win32_13 : Release : static 32 ReleaseDLL
-Win32_13 : Debug : static 32 DebugDLL
-
-#USE_COMPONENTS
diff --git a/c++/scripts/projects/grid/README b/c++/scripts/projects/grid/README
deleted file mode 100644
index eb6695a..0000000
--- a/c++/scripts/projects/grid/README
+++ /dev/null
@@ -1,66 +0,0 @@
-$Id: README 467562 2015-05-14 15:10:56Z fukanchi $
-
-This package contains miscellaneous client-side Grid applications.
-
-Here is a brief description of the containing applications:
-
-* remote_app
-
-    A worker node daemon capable of running multiple distributed
-    copies of regular applications and collecting their output in the
-    Grid for later retrieval by what is called the submitter.
-
-* remote_cgi
-
-    A worker node daemon that runs CGI applications in the simulated
-    environment of a web server. The concept is similar to what
-    remote_app does except that the submitter is always an instance
-    of the cgi2rcgi application.
-
-* cgi2rcgi
-
-    CGI application that serializes HTTP requests and sends them
-    over the Grid for processing by remote_cgi worker nodes.
-
-* cgi_tunnel2grid.cgi
-
-    This is the early days version of the cgi2rcgi application.
-    Please do not use it.
-
-* grid_mgr.cgi
-
-    This is a CGI application that displays status of Grid services.
-    It is installed and can be accessed at
-    http://intranet/ieb/ToolBox/STAT/grid_monitor/grid_mgr.cgi
-
-* ns_submit_remote_job
-
-    Utility for submitting jobs for later processing by remote_app.
-    Command line arguments of the remote application can be specified
-    on the command line of ns_submit_remote_job and remote application
-    output can be retrieved later with ns_remote_job_control.
-
-* ns_remote_job_control
-
-    This utility is for querying information about a NetSchedule job.
-    It also can be used to stop worker nodes and cancel jobs.
-
-* test_gridclient_stress
-
-    An integrated stress test for Grid. It submits and then waits for
-    the specified number of NetSchedule jobs.  It is also possible to
-    specify the amount of data transmitted through NetCache.
-
-* cidtool
-
-    Generate and decode identifiers in CompoundID format.
-
-* file_upload.cgi
-
-    Utility that writes its input to a segregated NetCache instance
-    with a short TTL.
-
-* ncfetch.cgi
-
-   Compose HTTP response out of NetCache data.
-
diff --git a/c++/scripts/projects/grid/components.link b/c++/scripts/projects/grid/components.link
deleted file mode 100644
index 761777f..0000000
--- a/c++/scripts/projects/grid/components.link
+++ /dev/null
@@ -1,5 +0,0 @@
-[components]
-infrastructure  16.1
-core            16.1
-misc            16.1
-web             16.1
diff --git a/c++/scripts/projects/grid/project.lst b/c++/scripts/projects/grid/project.lst
deleted file mode 100644
index 50fefd4..0000000
--- a/c++/scripts/projects/grid/project.lst
+++ /dev/null
@@ -1,24 +0,0 @@
-corelib$
-corelib/impl$
-corelib/hash_impl$
-util$
-util/regexp$
-util/xregexp
-util/compress
-util/qparse$
-util/bitset$ update-only
-util/cache$ update-only
-util/math$ update-only
-connect$
-connect/ext$
-connect/impl$
-connect/services$
-connect/services/impl$
-cgi$
-cgi/impl$
-html$
-misc$
-misc/grid_cgi
-misc/netstorage
-app$
-app/grid
diff --git a/c++/scripts/projects/igblast/Manifest b/c++/scripts/projects/igblast/Manifest
index 1fe51ab..e38fa0c 100644
--- a/c++/scripts/projects/igblast/Manifest
+++ b/c++/scripts/projects/igblast/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 483955 2015-11-05 15:16:36Z fukanchi $
+# $Id: Manifest 497677 2016-04-08 19:08:30Z camacho $
 #
 # Author: Christiam Camacho
 #
@@ -31,16 +31,15 @@ DEFAULT_CONFIGURE_FLAGS: --without-debug --with-strip --with-mt --with-build-roo
 # ICC gives us about 10% improvement in the core2 microarchitecture, so prefer
 # that. The build-root is needed so that rpmbuild can find the proper directories
 # to copy the binaries from
-Linux32-Centos   : icc : ICC.sh            --with-strip --without-debug --without-pcre --with-mt --with-flat-makefile
-Linux64-Centos   : icc : ICC.sh            --with-strip --without-debug --without-pcre --with-mt --with-flat-makefile
+Linux64-Centos   : icc : ICC.sh            --with-strip --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile
 #Linux64-Centos     : gcc-debug : GCC.sh            --with-strip --with-debug --without-pcre --with-mt --with-flat-makefile
 
-DEFAULT_CONFIGURATIONS: Linux32-Centos:icc Linux64-Centos:icc
+DEFAULT_CONFIGURATIONS: Linux64-Centos:icc
 
-Win32_13    : plain : static  32  ReleaseMT
-Win64_13    : plain : static  64  ReleaseMT
+Win32    : plain : static  32  ReleaseMT
+Win64    : plain : static  64  ReleaseMT
 
-IntelMAC    : universal : GCC.sh 4.0     --without-debug --without-pcre --with-mt --with-flat-makefile --with-universal=i386,x86_64 --with-ncbi-public
+IntelMAC    : universal : Clang.sh      --without-debug --without-pcre --with-mt --with-openmp --with-flat-makefile --with-universal=i386,x86_64 --with-ncbi-public
 
 USE_COMPONENTS
 
diff --git a/c++/scripts/projects/igblast/README b/c++/scripts/projects/igblast/README
index cd611c2..c23b873 100644
--- a/c++/scripts/projects/igblast/README
+++ b/c++/scripts/projects/igblast/README
@@ -7,9 +7,12 @@ igblastn:
 1).       Blast database files for searching germline V, D, and J genes.  You can specify any germline 
 databases you like (using -germline_db_V, -germline_db_J and -germline_db_D options).   
 The NCBI mouse germline gene databases (i.e., mouse_gl_V, etc.) are supplied with igblastn program 
-(see http://www.ncbi.nlm.nih.gov/igblast/ about database details).  
+(see http://www.ncbi.nlm.nih.gov/igblast/ about database details).
+  
 To search IMGT germline sequences, you need to download them from IMGT web site 
-(http://www.imgt.org/IMGT_vquest/share/textes/ ).   After you have downloaded the sequences, 
+(http://www.imgt.org/IMGT_vquest/share/textes/ ).  You need to download all V, D and J sequences for whatever 
+organisms you are interested in.  Combine all V and all J sequences, respectively, into a separate file (i.e., 
+one file for all V sequences and one file all for J sequences).  After you have downloaded the sequences, 
 invoke our utility tool edit_imgt_file.pl (download from the release/ directory) to process the sequences (to change 
  the long IMGT definition lines to germline gene names only).  For example:
 
@@ -50,7 +53,7 @@ show_translation -outfmt 3
 b).  To query one or more mouse T cell receptor sequences (contained in myseq) against imgt mouse 
 germline gene database:
 ./igblastn -germline_db_V imgt_tcr_db_v -germline_db_J imgt_tcr_db_j -germline_db_D imgt_tcr_db -
-organism mouse -domain_system imgt -query myseqtcr -ig_seqtype TCR -auxiliary_data 
+organism mouse -domain_system imgt -query myseq -ig_seqtype TCR -auxiliary_data 
 optional_file/mouse_gl.aux -show_translation -outfmt 3
 
 c).  To query one or human Ig sequences (contained in myseq) against custom database such as Andew 
@@ -91,3 +94,7 @@ Some examples:
 
 ./igblastp -germline_db_V mouse_gl_V -query myseq.prot -outfmt 3 -organism mouse -db nr �remote
 
+
+Other notes:
+
+The V gene domain annotation only works for IMGT annotation system for TCR sequences.
diff --git a/c++/scripts/projects/igblast/components.link b/c++/scripts/projects/igblast/components.link
index dd77326..e8df490 100644
--- a/c++/scripts/projects/igblast/components.link
+++ b/c++/scripts/projects/igblast/components.link
@@ -1,10 +1,9 @@
 [components]
-infrastructure  15.0
-core            15.0
-dbase           15.0
-web             15.0
-objects         15.0
-objtools        15.0
-algo            15.0
-blast           15.0
-app             15.0
+infrastructure  17.0
+core            17.0
+dbase           17.0
+web             17.0
+objects         17.0
+objtools        17.0
+algo            17.0
+app             17.0
diff --git a/c++/scripts/projects/igblast/post_build/blast_utils.py b/c++/scripts/projects/igblast/post_build/blast_utils.py
index b1b1b0b..cfa22b0 100644
--- a/c++/scripts/projects/igblast/post_build/blast_utils.py
+++ b/c++/scripts/projects/igblast/post_build/blast_utils.py
@@ -1,12 +1,16 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """ Various utilities/tools for BLAST """
+from __future__ import print_function
 
-__all__ = [ "safe_exec", "update_blast_version" ]
+__all__ = ["safe_exec", "update_blast_version"]
 
 import os
 import subprocess
-import shutil
 import platform
+import unittest
+import tempfile
+import re
+
         
 def safe_exec(cmd):
     """ Executes a command and checks its return value, throwing an
@@ -21,28 +25,52 @@ def safe_exec(cmd):
         elif retcode != 0:
             msg += "Failed with exit code " + str(retcode)
             raise RuntimeError(msg)
-    except OSError, err:
+    except OSError as err:
         msg += "Execution failed: " + err
         raise RuntimeError(msg)
 
-def update_blast_version(config_file, blast_version):
+
+class Tester(unittest.TestCase):
+    '''Testing class for this script.'''
+    def test_one(self):
+        ver = "2.3.0"
+        line1 = "Hello BLAST"
+        with tempfile.NamedTemporaryFile(mode='w+t') as fp:
+            print(line1, file=fp)
+            print("BLAST_VERSION", file=fp)
+            print(line1, file=fp, flush=True)
+
+            update_blast_version(fp.name, ver)
+
+            fp.seek(0)
+            line = fp.readline().rstrip()
+            self.assertEqual(line1, line)
+            line = fp.readline().rstrip()
+            self.assertEqual(ver, line)
+            line = fp.readline().rstrip()
+            self.assertEqual(line1, line)
+
+
+def update_blast_version(config_file, ver):
     """Updates the BLAST version in the specified file.
     
     Assumes the specified file contains the string BLAST_VERSION, which will
     be replaced by the contents of the variable passed to this function.
     """
-    import re
-    temp_fname = os.tmpnam()
-    shutil.move(config_file, temp_fname)
+    (fd, fname) = tempfile.mkstemp()
     try:
-        out = open(config_file, "w")
-        infile = open(temp_fname, "r")
-        for line in infile:
-            print >> out, re.sub("BLAST_VERSION", blast_version, line),
+        with open(config_file, "r") as infile, open(fname, "w") as out:
+            for line in infile:
+                newline = re.sub("BLAST_VERSION", ver, line.rstrip())
+                print(newline, file=out)
+
+        with open(config_file, "w") as out, open(fname, "r") as infile:
+            for line in infile:
+                print(line.rstrip(), file=out)
     finally:
-        out.close()
-        infile.close()
-        os.unlink(temp_fname)
+        os.close(fd)
+    os.remove(fname)
+
 
 def create_new_tarball_name(platform, version):
     """ Converts the name of a platform as specified to the prepare_release 
@@ -77,7 +105,7 @@ def determine_platform():
     """
 
     p = platform.platform().lower()
-    print "PLATFORM = " + p
+    print("PLATFORM = " + p)
     if p.find("linux") != -1:
         if p.find("x86_64") != -1:
             return "Linux64"
diff --git a/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/01_stage-contents.xml b/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/01_stage-contents.xml
deleted file mode 100644
index bc1e5a7..0000000
--- a/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/01_stage-contents.xml
+++ /dev/null
@@ -1 +0,0 @@
-<pkg-contents spec="1.12"/>
\ No newline at end of file
diff --git a/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/01_stage.xml b/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/01_stage.xml
deleted file mode 100644
index 36f7404..0000000
--- a/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/01_stage.xml
+++ /dev/null
@@ -1 +0,0 @@
-<pkgref spec="1.12" uuid="2448F256-3661-4ED0-8936-ECAA112D07AE"><config><identifier>gov.nih.nlm.ncbi.blast</identifier><version>0.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true">_stage</installFrom><installTo>/</installTo><flags><followSymbolicLinks/><discardResourceForks/></flags><packageStore type="internal"></packageStore><mod>parent</mod><mod>requireAuthorization</mod><mod>relocatable</mod><mod>installFro [...]
diff --git a/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/index.xml b/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/index.xml
deleted file mode 100644
index e3bdd1a..0000000
--- a/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.pmdoc/index.xml
+++ /dev/null
@@ -1 +0,0 @@
-<pkmkdoc spec="1.12"><properties><title>BLAST</title><build>blast.pkg</build><organization>gov.nih.nlm.ncbi</organization><userSees ui="easy"/><min-target os="2"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>The Basic Local Alignment Search Tool (BLAST) finds regions of local similarity between sequences. The program compares nucleotide or protein sequences to sequence databases and calculates the statisti [...]
diff --git a/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.sh b/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.sh
index 3364b4a..ae19239 100755
--- a/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.sh
+++ b/c++/scripts/projects/igblast/post_build/macosx/ncbi-igblast.sh
@@ -1,102 +1,87 @@
-#!/bin/sh
+#!/bin/sh -xe
 
 INSTALLDIR=$1
 SCRIPTDIR=$2
 BLAST_VERSION=$3
-PRODUCT="ncbi-igblast-$BLAST_VERSION"
+PRODUCT="ncbi-igblast-$BLAST_VERSION+"
+
+INSTALL_LOCATION1=/usr/local/ncbi/blast
+INSTALL_LOCATION2=/etc/paths.d
+STAGE_DIR1=_stage1
+STAGE_DIR2=_stage2
+RESOURCES_DIR=Resources
+ID=gov.nlm.nih.ncbi.blast
 
 if [ $# -ne 3 ] ; then
     echo "Usage: ncbi-igblast.sh [installation directory] [MacOSX post-build script directory] [BLAST version]";
     exit 1;
 fi
 
-BLAST_BINS="igblastn igblastp"
-DATA_DIRS="optional_file internal_data"
-ALL_BINS="$BLAST_BINS"
+setup()
+{
+    rm -rf $PRODUCT.dmg $PRODUCT $STAGE_DIR1 $STAGE_DIR2 $INSTALLDIR/installer $RESOURCES_DIR
+    mkdir -p $STAGE_DIR1/bin $STAGE_DIR1/doc $STAGE_DIR2 $PRODUCT
+}
 
-rm -rf $PRODUCT.dmg $PRODUCT _stage $INSTALLDIR/installer
-mkdir -p _stage/usr/local/ncbi/igblast/bin _stage/usr/local/ncbi/igblast/doc \
-         _stage/usr/local/ncbi/igblast/data _stage/private/etc/paths.d
-if [ $? -ne 0 ]; then
-    echo FAILURE
-    exit 1;
-fi
+prep_binary_component_package() 
+{
+    BLAST_BINS="igblastn igblastp"
+    DATA_DIRS="optional_file internal_data"
+    ALL_BINS="$BLAST_BINS"
 
-cp $INSTALLDIR/README _stage/usr/local/ncbi/igblast/doc/README.txt
-if [ $? -ne 0 ]; then
-    echo "FAILED to copy $INSTALLDIR/README"
-    exit 1;
-fi
+    cp $INSTALLDIR/README $STAGE_DIR1/doc/README.txt
 
-cp -p $SCRIPTDIR/ncbi_igblast _stage/private/etc/paths.d
-if [ $? -ne 0 ]; then
-    echo FAILURE
-    exit 1;
-fi
+    for bin in $ALL_BINS; do
+        cp -p $INSTALLDIR/bin/$bin $STAGE_DIR1/bin
+    done
 
-# This is needed because the binary ncbi-blast.pmproj has this string hard
-# coded
-cp -p $INSTALLDIR/LICENSE ./license.txt
-for f in uninstall_ncbi_igblast.zip large-Blue_ncbi_logo.tiff ncbi-igblast.pmdoc welcome.txt; do
-    echo copying $f to local directory
-    cp -rp $SCRIPTDIR/$f .
-    if [ $? -ne 0 ]; then
-        echo FAILURE
-        exit 1;
-    fi
-done
-
-for bin in $ALL_BINS; do
-    echo copying $bin
-    cp -p $INSTALLDIR/bin/$bin _stage/usr/local/ncbi/igblast/bin
-    if [ $? -ne 0 ]; then
-        echo FAILURE
-        exit 1;
-    fi
-done
-
-for dir in $DATA_DIRS; do
-    echo copying $SCRIPTDIR/../../../../../src/app/igblast/$dir
-    cp -R $SCRIPTDIR/../../../../../src/app/igblast/$dir _stage/usr/local/ncbi/igblast/data
-    if [ $? -ne 0 ]; then
-        echo FAILURE
-        exit 1;
-    fi
-done
-
-echo building package
-mkdir $PRODUCT
-/Developer/usr/bin/packagemaker --id gov.nih.nlm.ncbi.blast --doc ncbi-igblast.pmdoc --out $PRODUCT/$PRODUCT.pkg
-if [ $? -ne 0 ]; then
-    echo FAILURE
-    exit 1;
-fi
+    /usr/bin/pkgbuild --root $STAGE_DIR1 --identifier $ID.binaries --version \
+        $BLAST_VERSION --install-location $INSTALL_LOCATION1 binaries.pkg
+}
 
-echo copying uninstaller
-cp -p uninstall_ncbi_igblast.zip $PRODUCT
-if [ $? -ne 0 ]; then
-    echo FAILURE
-    exit 1;
-fi
+prep_paths_component_package()
+{
+    echo /usr/local/ncbi/igblast/bin > $STAGE_DIR2/ncbi_blast
+    /usr/bin/pkgbuild --root $STAGE_DIR2 --identifier $ID.paths --version \
+        $BLAST_VERSION --install-location $INSTALL_LOCATION2 paths.pkg
+}
 
-echo creating disk image
-/usr/bin/hdiutil create $PRODUCT.dmg -srcfolder $PRODUCT
-if [ $? -ne 0 ]; then
-    echo FAILURE
-    exit 1;
-fi
+customize_distribution_xml()
+{
+    sed -i.bak '/options/i\
+    <title>NCBI IgBLAST+ Command Line Applications</title> \
+    <welcome file="welcome.txt" mime-type="text/plain"/> \
+    <license file="LICENSE" mime-type="text/plain"/> \
+    <background scaling="proportional" alignment="left" file="large-Blue_ncbi_logo.tiff" mime-type="image/tiff"/> \
+' Distribution.xml 
+}
 
-echo moving disk image
-mkdir $INSTALLDIR/installer
-if [ $? -ne 0 ]; then
-    echo FAILURE
-    exit 1;
-fi
-mv $PRODUCT.dmg $INSTALLDIR/installer
-if [ $? -ne 0 ]; then
-    echo FAILURE
-    exit 1;
-fi
+create_product_archive()
+{
+	/usr/bin/productbuild --synthesize --identifier $ID --version \
+    $BLAST_VERSION --package binaries.pkg --package paths.pkg Distribution.xml
+
+    customize_distribution_xml
+
+    mkdir $RESOURCES_DIR
+    cp -p $INSTALLDIR/LICENSE $RESOURCES_DIR
+    for f in welcome.txt large-Blue_ncbi_logo.tiff ; do
+        cp -p $SCRIPTDIR/$f $RESOURCES_DIR
+    done
+
+	/usr/bin/productbuild --resources Resources --distribution Distribution.xml $PRODUCT/$PRODUCT.pkg
+    cp -p $SCRIPTDIR/uninstall_ncbi_igblast.zip $PRODUCT
+}
+
+create_disk_image()
+{
+	/usr/bin/hdiutil create $PRODUCT.dmg -srcfolder $PRODUCT
+    mkdir $INSTALLDIR/installer
+    mv $PRODUCT.dmg $INSTALLDIR/installer
+}
 
-echo done
-rm -rf _stage $PRODUCT
+setup
+prep_binary_component_package
+prep_paths_component_package
+create_product_archive
+create_disk_image
diff --git a/c++/scripts/projects/igblast/post_build/macosx/ncbi_igblast b/c++/scripts/projects/igblast/post_build/macosx/ncbi_igblast
deleted file mode 100644
index ca0e106..0000000
--- a/c++/scripts/projects/igblast/post_build/macosx/ncbi_igblast
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/ncbi/igblast/bin
diff --git a/c++/scripts/projects/igblast/post_build/make_installers.py b/c++/scripts/projects/igblast/post_build/make_installers.py
index ff98b6e..da4e560 100755
--- a/c++/scripts/projects/igblast/post_build/make_installers.py
+++ b/c++/scripts/projects/igblast/post_build/make_installers.py
@@ -1,10 +1,11 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Driver program for post-build processing"""
-# $Id: make_installers.py 381942 2012-11-30 16:26:29Z camacho $
+# $Id: make_installers.py 496124 2016-03-23 20:34:27Z camacho $
 #
 # Author: Christiam Camacho
 #
 
+from __future__ import print_function
 import os, sys, os.path
 from optparse import OptionParser
 import blast_utils
@@ -27,9 +28,9 @@ def main(): #IGNORE:R0911
     global VERBOSE #IGNORE:W0603
     VERBOSE = options.VERBOSE
     if VERBOSE:
-        print "BLAST version", blast_version
-        print "Platform:", platform
-        print "Installation directory:", installdir
+        print("BLAST version", blast_version)
+        print("Platform:", platform)
+        print("Installation directory:", installdir)
 
     if platform.startswith("Win"):
         return launch_win_installer_build(installdir, blast_version)                
@@ -40,14 +41,14 @@ def main(): #IGNORE:R0911
     if platform == "IntelMAC":
         return mac_post_build(installdir, blast_version)
     
-    print >> sys.stderr, "Unknown OS identifier: " + platform
-    print >> sys.stderr, "Exiting post build script."
+    print("Unknown OS identifier:", platform, file=sys.stderr)
+    print("Exiting post build script.", file=sys.stderr)
     return 2
 
 def launch_win_installer_build(installdir, blast_version):
     '''Windows post-build: create installer'''
     if VERBOSE: 
-        print "Packaging for Windows..."
+        print("Packaging for Windows...")
     cmd = "python " + os.path.join(SCRIPTS_DIR, "win", "make_win.py") + " "
     cmd += blast_version + " " + installdir
     if VERBOSE: 
@@ -58,8 +59,8 @@ def launch_win_installer_build(installdir, blast_version):
 def launch_rpm_build(installdir, blast_version):
     '''Linux post-build: create RPM'''
     if VERBOSE: 
-        print "Packing linux RPM..."
-    cmd = "python " + os.path.join(SCRIPTS_DIR, "rpm", "make_rpm.py") + " "
+        print("Packing linux RPM...")
+    cmd = "python3 " + os.path.join(SCRIPTS_DIR, "rpm", "make_rpm.py") + " "
     cmd += blast_version + " " + installdir
     if VERBOSE: 
         cmd += " -v"
@@ -69,7 +70,7 @@ def launch_rpm_build(installdir, blast_version):
 def mac_post_build(installdir, blast_version):
     '''MacOSX post-build: create installer'''
     if VERBOSE:
-        print "Packaging for MacOSX..."
+        print("Packaging for MacOSX...")
     script_dir = os.path.join(SCRIPTS_DIR, "macosx")
     cmd = os.path.join(script_dir, "ncbi-igblast.sh") + " "
     cmd += installdir + " " + script_dir + " " + blast_version
@@ -78,7 +79,7 @@ def mac_post_build(installdir, blast_version):
 
 def do_nothing(platform):
     '''No op function'''
-    print "No post-build step necessary for", platform
+    print("No post-build step necessary for", platform)
     return 0
 
 # The script execution entry point
diff --git a/c++/scripts/projects/igblast/post_build/rpm/make_rpm.py b/c++/scripts/projects/igblast/post_build/rpm/make_rpm.py
index d827d32..c0a7e84 100755
--- a/c++/scripts/projects/igblast/post_build/rpm/make_rpm.py
+++ b/c++/scripts/projects/igblast/post_build/rpm/make_rpm.py
@@ -1,11 +1,13 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Script to create a source/binary RPM.
 """
-# $Id: make_rpm.py 358044 2012-03-28 17:37:42Z camacho $
+# $Id: make_rpm.py 496124 2016-03-23 20:34:27Z camacho $
 
+from __future__ import print_function
 import sys, os, shutil
 from optparse import OptionParser
 import subprocess
+import tarfile
 SCRIPT_DIR = os.path.dirname(os.path.abspath(sys.argv[0]))
 sys.path.append(os.path.join(SCRIPT_DIR, ".."))
 from blast_utils import *   #IGNORE:W0401
@@ -33,17 +35,15 @@ def setup_rpmbuild():
     os.chdir(cwd)
 
     # Create ~/.rpmmacros
-    try:
-        out = open(RPMMACROS, "w")
-        print >> out, "%_topdir %( echo", os.path.join(cwd, RPMBUILD_HOME), ")"
-        print >> out, "%_tmppath %( echo", 
-        print >> out, os.path.join(cwd, RPMBUILD_HOME, "tmp"), ")"
-        print >> out
-        print >> out, "%packager Christiam E. Camacho (camacho at ncbi.nlm.nih.gov)"
-    finally:
-        out.close()
-    if VERBOSE: 
-        print "Created", RPMMACROS
+    with open(RPMMACROS, "w") as out:
+        print("%_topdir %( echo", os.path.join(cwd, RPMBUILD_HOME), ")", file=out)
+        print("%_tmppath %( echo", end=' ', file=out) 
+        print(os.path.join(cwd, RPMBUILD_HOME, "tmp"), ")", file=out)
+        print(file=out)
+        print("%packager Christiam E. Camacho (camacho at ncbi.nlm.nih.gov)", file=out)
+        print("%debug_package %{nil}", file=out)
+        if VERBOSE: 
+            print("Created", RPMMACROS)
 
 def cleanup_rpm():
     """ Delete rpm files """
@@ -65,7 +65,7 @@ def cleanup_svn_co():
         if os.path.exists(path):
             shutil.rmtree(path)
             if VERBOSE: 
-                print "Deleting", path
+                print("Deleting", path)
                
     projects_path = os.path.join(PACKAGE_NAME, "c++", "scripts", "projects")
     for root, dirs, files in os.walk(projects_path): 
@@ -74,7 +74,7 @@ def cleanup_svn_co():
             if fnmatch.fnmatch(name, "*blast/*"): 
                 continue
             if VERBOSE:
-                print "Deleting file", name
+                print("Deleting file", name)
             os.remove(name)
             
         for name in dirs:
@@ -82,7 +82,7 @@ def cleanup_svn_co():
             if fnmatch.fnmatch(name, "*blast*"):
                 continue
             if VERBOSE: 
-                print "Deleting directory", name
+                print("Deleting directory", name)
             shutil.rmtree(name)
             
 
@@ -102,7 +102,6 @@ def svn_checkout(blast_version):
 
 def compress_sources():
     """Compress sources to be included in source RPM"""
-    import tarfile
     tar = tarfile.open(TARBALL, "w:bz2")
     tar.add(PACKAGE_NAME)
     tar.close()
@@ -135,8 +134,9 @@ def move_rpms_to_installdir(installdir):
     args = [ "find", RPMBUILD_HOME, "-name", "*.rpm" ]
     output = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
     for rpm in output.split():
+        rpm = rpm.decode('ascii')
         if VERBOSE: 
-            print "mv", rpm, installer_dir
+            print("mv", rpm, installer_dir)
         shutil.move(rpm, installer_dir)
 
 
@@ -154,7 +154,7 @@ def main():
     global VERBOSE, PACKAGE_NAME, TARBALL #IGNORE:W0603
     VERBOSE = options.VERBOSE
     if VERBOSE: 
-        print "Installing RPM to", installdir
+        print("Installing RPM to", installdir)
         
     PACKAGE_NAME = "ncbi-igblast-" + blast_version
     TARBALL = PACKAGE_NAME + ".tgz"
diff --git a/c++/scripts/projects/igblast/post_build/win/make_win.py b/c++/scripts/projects/igblast/post_build/win/make_win.py
index 8fbf4a8..e7fb633 100644
--- a/c++/scripts/projects/igblast/post_build/win/make_win.py
+++ b/c++/scripts/projects/igblast/post_build/win/make_win.py
@@ -1,9 +1,10 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 """Script to create the Windows installer for BLAST command line applications"""
-# $Id: make_win.py 360165 2012-04-19 21:52:47Z camacho $
+# $Id: make_win.py 495893 2016-03-22 15:02:30Z camacho $
 #
 # Author: Christiam camacho
 
+from __future__ import print_function
 import os, sys, os.path
 import shutil
 from optparse import OptionParser
@@ -46,7 +47,7 @@ def main():
     for app in apps:
         app = os.path.join(installdir, "bin", app)
         if VERBOSE: 
-            print "Copying", app, "to", cwd
+            print("Copying", app, "to", cwd)
         shutil.copy(app, cwd)
     
     
@@ -67,7 +68,7 @@ def main():
         os.chdir(newdir)
         dest = os.path.join(cwd, directory)
         if VERBOSE:
-            print "Copying", directory, "to", dest
+            print("Copying", directory, "to", dest)
         shutil.copytree(directory, dest)
     os.chdir(cwd)
     for root, dirs, files in os.walk(cwd):
@@ -75,13 +76,13 @@ def main():
             path = os.path.join(root, subdir)
             if subdir == ".svn":
                 if VERBOSE:
-                    print "Removing ", path
+                    print("Removing", path)
                 shutil.rmtree(path)
 
     for aux_file in ("EnvVarUpdate.nsh", "unix2dos.nsh", "ncbilogo.ico"):
         src = os.path.join(SCRIPT_DIR, aux_file)
         if VERBOSE:
-            print "Copying", src, "to", cwd
+            print("Copying", src, "to", cwd)
         shutil.copy(src, cwd)
         
     # makensis is in the path of the script courtesy of the release framework
diff --git a/c++/scripts/projects/ncbi_applog/ChangeLog b/c++/scripts/projects/ncbi_applog/ChangeLog
index fae9b7c..40a0553 100644
--- a/c++/scripts/projects/ncbi_applog/ChangeLog
+++ b/c++/scripts/projects/ncbi_applog/ChangeLog
@@ -1,2 +1,47 @@
-Jun 03, 2012
-PrepareRelease framework initialised
+
+1.1.0
+    - Allow to send RAW logs incrementally (for CGI redirects). CXX-7803
+    - Add possibility to generate an Applog query URL on a base of token ('url' command). CXX-7846
+
+
+1.0.17 (02/16/16)
+    - Disable all C++ Toolkit diagnostics and logging. Report ncbi_applog errors locally to stderr. CXX-7782
+    - Bugfixes. CXX-7804, CXX-7616
+
+1.0.16 (07/23/15)
+    - Extend with SID/PHID generation. CXX-5015
+    - Bugfixes. CXX-5771, CXX-4939
+    - Add support for host role/location. CXX-4797
+
+1.0.15 (02/23/15)
+    test only
+
+1.0.14 (-)
+    failed
+
+1.0.13 (01/13/14) - first public version 
+
+    - Clog try to fallback to /log/<port> or /log/srv. CXX-3423
+    - Add support for $NCBI_CONFIG_LOG_FILE, allow extracting SID from the token. CXX-3818
+    - Alow to specify posting timestamp. CXX-3933
+    - Add RAW logs processing. CXX-4053
+
+
+TEST VERSIONS:
+
+1.0.12 (12/16/13)
+1.0.11 (12/10/13)
+1.0.10 (11/20/13)
+1.0.9  (10/28/13)
+1.0.8  (-)
+1.0.7  (07/30/13)
+1.0.6  (07/24/13)
+1.0.5  (-)
+1.0.4  (-)
+1.0.3  (11/29/12)
+1.0.2  (-)
+1.0.1  (-)
+
+
+Main development thread. CXX-2439
+
diff --git a/c++/scripts/projects/ncbi_applog/Manifest b/c++/scripts/projects/ncbi_applog/Manifest
index 0ebfa79..eb61824 100644
--- a/c++/scripts/projects/ncbi_applog/Manifest
+++ b/c++/scripts/projects/ncbi_applog/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 481183 2015-10-07 16:16:53Z fukanchi $
+# $Id: Manifest 486339 2015-12-03 15:52:01Z fukanchi $
 #
 # Author: Alexey Rafanovich
 #
@@ -29,7 +29,7 @@ POSTBUILD: cp $srcdir/src/misc/clog/app/test_ncbi_applog.sh $installdir/bin
 
 Linux64-Centos : plain  : GCC.sh   --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
 Linux64-Ubuntu : plain  : GCC.sh   --without-debug --with-mt    --with-static --without-runpath --with-flat-makefile
-FreeBSD32      : plain  : Clang.sh --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
+FreeBSD64      : plain  : Clang.sh --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
 IntelMAC       : plain  : GCC.sh   --without-debug --without-mt --with-static --without-runpath --with-flat-makefile
 Win32_13       : plain  : static 32 ReleaseMT
 
diff --git a/c++/scripts/projects/ncbi_applog/README b/c++/scripts/projects/ncbi_applog/README
index 832627a..d9690a1 100644
--- a/c++/scripts/projects/ncbi_applog/README
+++ b/c++/scripts/projects/ncbi_applog/README
@@ -1 +1 @@
-ncbi_applog
\ No newline at end of file
+NCBI_APPLOG is an internal NCBI command-line utility to log to AppLog
diff --git a/c++/scripts/projects/ncbi_gui_base.lst b/c++/scripts/projects/ncbi_gui_base.lst
index bc59901..6cbb168 100644
--- a/c++/scripts/projects/ncbi_gui_base.lst
+++ b/c++/scripts/projects/ncbi_gui_base.lst
@@ -30,8 +30,10 @@ internal/mapview/objects
 misc/grid_cgi$
 misc/xmlwrapp
 misc/eutils_client$
+misc/hydra_client$
 misc/discrepancy$
 misc/discrepancy_report$
+misc/biosample_util$
 objects
 objmgr
 objtools
diff --git a/c++/scripts/projects/netcache/ChangeLog b/c++/scripts/projects/netcache/ChangeLog
index aee0a59..04037a5 100644
--- a/c++/scripts/projects/netcache/ChangeLog
+++ b/c++/scripts/projects/netcache/ChangeLog
@@ -139,3 +139,28 @@ version 6.9.0 (CXX-7396)
 Modified periodic sync logic to avoid deadlocks and enhance speed, corrected error handling.
 Added blob enumeration command.
 Reviewed and corrected configuration defaults.
+
+December 02, 2015
+version 6.9.1 (CXX-7583)
+Added reporting of expired blob deletion.
+Added DB files error checks and recovery when handling data blobs and shrinking database.
+
+December 10, 2015
+version 6.9.2 (CXX-7646)
+bug fixes
+
+January 21, 2015
+version 6.9.3 (CXX-7681)
+Added configuration report, corrected meaning of setup priority.
+Redesigned periodic syncronization algorithm.
+
+February 16, 2016
+version 6.9.4 (CXX-7839)
+Changed to do mirroring after quorum requirement is met.
+
+March 01, 2016
+version 6.9.5 (CXX-7908)
+Changed to do blob synchronization after quorum requirement is met.
+
+
+
diff --git a/c++/scripts/projects/netschedule/ChangeLog b/c++/scripts/projects/netschedule/ChangeLog
index dab40ee..84aae25 100644
--- a/c++/scripts/projects/netschedule/ChangeLog
+++ b/c++/scripts/projects/netschedule/ChangeLog
@@ -1,3 +1,30 @@
+Release 4.26.0 cloned from 4.25.0 (2016-05-04)
+
+Improvements:
+    * NetSchedule: [server]/wst_cache_size parameter could not be reconfigured
+      (JIRA: CXX-7986)
+    * Scope attribute for jobs (JIRA: CXX-8034)
+    * NetSchedule: performance degradation after millions of jobs
+      (JIRA: CXX-8074)
+
+
+Release 4.25.0 based on SC-17.0 (2016-03-24)
+
+Improvements:
+    * Configure which queues should log state transition performance records
+      (JIRA: CXX-7958)
+    * NetSchedule: scope feature (JIRA: CXX-7856)
+    * NetSchedule: changing the PHID generation for logging (JIRA: CXX-7651)
+
+
+Release 4.24.0 cloned from 4.23.2 (2015-11-30)
+
+Improvements:
+    * NetSchedule: queue name case insensitivity (JIRA: CXX-7536)
+    * NetSchedule: remove [server]/reinit parameter (JIRA: CXX-7466)
+    * NetSchedule: WST/WST2 overheads (JIRA: CXX-4826)
+
+
 Release 4.23.2 cloned from 4.23.1 (2015-10-19)
 
 Improvements:
diff --git a/c++/scripts/projects/netschedule/components.link b/c++/scripts/projects/netschedule/components.link
index b1e583c..78af816 100644
--- a/c++/scripts/projects/netschedule/components.link
+++ b/c++/scripts/projects/netschedule/components.link
@@ -1,4 +1,4 @@
 [components]
-infrastructure  16.1
-core            16.1
-dbase           16.1
+infrastructure  17.0
+core            17.0
+dbase           17.0
diff --git a/c++/scripts/projects/netstorage/ChangeLog b/c++/scripts/projects/netstorage/ChangeLog
index 3e5ea7e..91859ae 100644
--- a/c++/scripts/projects/netstorage/ChangeLog
+++ b/c++/scripts/projects/netstorage/ChangeLog
@@ -1,3 +1,8 @@
+Release 2.2.0 based on SC-17.0 (XXXX-XX-XX)
+Requires DB version 3.8
+
+
+
 Release 2.1.3 based on SC-16.1 (2015-08-25)
 
     * Bug fix: Implemented a workaround to overcome FileTrack write-once restriction.
diff --git a/c++/scripts/projects/netstorage/components.link b/c++/scripts/projects/netstorage/components.link
index 55e867a..50b59f2 100644
--- a/c++/scripts/projects/netstorage/components.link
+++ b/c++/scripts/projects/netstorage/components.link
@@ -1,6 +1,6 @@
 [components]
-infrastructure  16.1
-core            16.1
-dbase           16.1
-misc            16.1
+infrastructure  17.0
+core            17.0
+dbase           17.0
+misc            17.0
 
diff --git a/c++/scripts/projects/netstorage/project.lst b/c++/scripts/projects/netstorage/project.lst
index 282c2c7..f1e5102 100644
--- a/c++/scripts/projects/netstorage/project.lst
+++ b/c++/scripts/projects/netstorage/project.lst
@@ -28,6 +28,17 @@ dbapi/driver/util$ update-only
 dbapi/driver/odbc/unix_odbc$ update-only
 dbapi/driver/ctlib$
 dbapi/driver/ftds64$
+dbapi/driver/ftds64/impl$
 dbapi/driver/ftds64/freetds
 dbapi/driver/ftds64/ctlib$
+dbapi/driver/ftds95$
+dbapi/driver/ftds95/freetds$
+dbapi/driver/ftds95/freetds/freetds update-only
+dbapi/driver/ftds95/freetds/replacements update-only
+dbapi/driver/ftds95/freetds/tds$
+dbapi/driver/ftds95/freetds/ctlib$
+dbapi/driver/ftds95/ctlib$
+dbapi/driver/ftds95/impl update-only
+dbapi/driver/ftds95/freetds/replacements$
+dbapi/driver/ftds-default
 dbapi/simple$
diff --git a/c++/scripts/projects/netstorage_gc/project.lst b/c++/scripts/projects/netstorage_gc/project.lst
index f94d543..b50eb09 100644
--- a/c++/scripts/projects/netstorage_gc/project.lst
+++ b/c++/scripts/projects/netstorage_gc/project.lst
@@ -2,7 +2,6 @@ corelib$
 util$
 util/regexp$
 util/compress
-util/fileblobstorage$
 util/qparse$
 util/bitset$ update-only
 util/cache$ update-only
@@ -27,6 +26,8 @@ dbapi/driver/util$ update-only
 dbapi/driver/odbc/unix_odbc$ update-only
 dbapi/driver/ctlib$
 dbapi/driver/ftds64$
+dbapi/driver/ftds64/impl$
 dbapi/driver/ftds64/freetds
 dbapi/driver/ftds64/ctlib$
+dbapi/driver/ftds-default
 dbapi/simple$
diff --git a/c++/scripts/projects/project_tree_builder/ChangeLog b/c++/scripts/projects/project_tree_builder/ChangeLog
index 14db23d..1fbac9f 100644
--- a/c++/scripts/projects/project_tree_builder/ChangeLog
+++ b/c++/scripts/projects/project_tree_builder/ChangeLog
@@ -299,3 +299,6 @@ June 01, 2015
 version 4.1.2,   CXX-6005
 Added analysis and reporting of cyclic library dependencies.
 
+March 09, 2016
+version 4.1.3, CXX-7917
+Added support for VS2015
diff --git a/c++/scripts/projects/project_tree_builder/Manifest b/c++/scripts/projects/project_tree_builder/Manifest
index 219a3cf..29b59ee 100644
--- a/c++/scripts/projects/project_tree_builder/Manifest
+++ b/c++/scripts/projects/project_tree_builder/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 483955 2015-11-05 15:16:36Z fukanchi $
+# $Id: Manifest 486339 2015-12-03 15:52:01Z fukanchi $
 #
 # Author: Sergey Satskiy
 #
@@ -32,9 +32,8 @@ Linux64-Centos    : plain : GCC.sh           --without-debug --without-mt --with
 
 Linux64-Ubuntu    : plain : GCC.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c
 
-FreeBSD32  : plain : Clang.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c --without-pcre
+FreeBSD64  : plain : Clang.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c --without-pcre
 
-#PowerMAC   : plain : GCC.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c
 IntelMAC   : plain : GCC.sh           --without-debug --without-mt --with-static --without-runpath --with-flat-makefile --without-ncbi-c
 #IntelMAC    : universal : GCC.sh        --without-debug --without-mt  --with-static --with-universal=i386,x86_64 --with-flat-makefile --without-ncbi-c
 
diff --git a/c++/scripts/projects/project_tree_builder/components.link b/c++/scripts/projects/project_tree_builder/components.link
index ea68b5f..e34864e 100644
--- a/c++/scripts/projects/project_tree_builder/components.link
+++ b/c++/scripts/projects/project_tree_builder/components.link
@@ -1,3 +1,3 @@
 [components]
-infrastructure  16.0
-core            16.0
+infrastructure  17.0
+core            17.0
diff --git a/c++/scripts/projects/public/Manifest b/c++/scripts/projects/public/Manifest
index 5a345af..aed3142 100644
--- a/c++/scripts/projects/public/Manifest
+++ b/c++/scripts/projects/public/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 483955 2015-11-05 15:16:36Z fukanchi $
+# $Id: Manifest 500492 2016-05-04 22:25:11Z fukanchi $
 #
 # Author:
 #
@@ -11,6 +11,8 @@
 
 USE_COMPONENTS
 
+TAG_PRE_COMMIT: tagprecommit/use_embedded_ptb.py
+
 # Each line describes a single configuration
 # The format is as follows:
 # <HardwareIdentifier> : <ReleaseSuffix> : <CompilerConfigurationScriptWithKeys>
@@ -24,25 +26,20 @@ Win64_13       : MSVC13-64 : static 64 ReleaseDLL
 
 Cygwin64       : GCC       : GCC.sh --without-debug --with-mt --with-flat-makefile
 
-Linux64-Centos : GCC442    : GCC.sh 4.4.2 --without-debug --with-mt --with-distcc
-Linux64-Centos : GCC442d   : GCC.sh 4.4.2 --with-mt --with-distcc --with-3psw=system
-Linux64-Centos : GCC463    : GCC.sh 4.6.3 --with-distcc
-Linux64-Centos : GCC472    : GCC.sh 4.7.2 --without-debug --with-mt --with-dll
 Linux64-Centos : GCC481    : GCC.sh 4.8.1 --without-debug --without-flat-makefile
-Linux64-Centos : GCC491d   : GCC.sh 4.9.1 --with-debug --with-mt --with-flat-makefile
+Linux64-Centos : GCC493d   : GCC.sh 4.9.3 --with-debug --with-mt --with-flat-makefile
 Linux64-Centos : GCC510    : GCC.sh 5.1.0 --without-debug --with-mt --with-flat-makefile
-Linux64-Centos : ICC130    : ICC.sh 13.0  --without-debug --with-mt --with-dll
-Linux64-Centos : ICC130d   : ICC.sh 13.0  --with-debug --with-mt --with-3psw=system
-Linux64-Centos : Clang     : Clang.sh --with-debug --with-mt --with-flat-makefile
+Linux64-Centos : GCC530    : GCC.sh 5.3.0 --without-debug --with-mt --with-flat-makefile
+Linux64-Centos : ICC150    : ICC.sh 15.0  --without-debug --with-mt --with-dll
+Linux64-Centos : ICC150d   : ICC.sh 15.0  --with-debug --with-mt --with-3psw=system
+Linux64-Centos7 : Clang    : Clang.sh 3.8.0 --with-debug --with-mt --with-flat-makefile
 
 Linux64-Ubuntu : plain-GCC : GCC.sh --without-debug --with-mt --with-flat-makefile
 Linux32-Ubuntu : plain-GCC : GCC.sh --without-debug --with-mt --with-flat-makefile
 
-FreeBSD32      : plain     : Clang.sh --without-debug --with-mt --with-flat-makefile
-#FreeBSD64      : plain     : Clang.sh --without-debug --with-mt --with-flat-makefile
+FreeBSD64      : plain     : Clang.sh --without-debug --with-mt --with-flat-makefile
 
 IntelMAC       : Debug     : GCC.sh --with-debug --with-dll --with-mt --with-universal=i386,x86_64 --with-flat-makefile
 IntelMAC       : Release   : GCC.sh --without-debug --with-dll --with-mt --with-universal=i386,x86_64 --with-flat-makefile
 
 XCode          : plain     : Xcode.sh 30 --without-debug --with-64
-
diff --git a/c++/scripts/projects/public/components.link b/c++/scripts/projects/public/components.link
index daf3cff..60b57d0 100644
--- a/c++/scripts/projects/public/components.link
+++ b/c++/scripts/projects/public/components.link
@@ -1,13 +1,12 @@
 [components]
-algo            16.1
-app             16.1
-blast           16.1
-core            16.1
-dbase           16.1
-infrastructure  16.1
-misc            16.1
-objects         16.1
-objtools        16.1
-sample          16.1
-sra             16.1
-web             16.1
+algo            17.0
+app             17.0
+core            17.0
+dbase           17.0
+infrastructure  17.0
+misc            17.0
+objects         17.0
+objtools        17.0
+sample          17.0
+sra             17.0
+web             17.0
diff --git a/c++/scripts/projects/public/tagprecommit/use_embedded_ptb.py b/c++/scripts/projects/public/tagprecommit/use_embedded_ptb.py
new file mode 100755
index 0000000..28b7df6
--- /dev/null
+++ b/c++/scripts/projects/public/tagprecommit/use_embedded_ptb.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+import sys, os.path
+
+if len(sys.argv) != 1:
+    print >> sys.stderr, "Wrong number of arguments. Usage:\n" \
+                         "use_embedded_ptb.py"
+    sys.exit(1)
+
+build_system = os.path.join( "c++", "src", "build-system" )
+
+if not os.path.exists(build_system):
+    print >> sys.stderr, "Can't find build-system at %s" % build_system
+    sys.exit(2)
+
+def patch(path, name):
+    fname = os.path.join(build_system, name)
+    if not os.path.exists(fname):
+        print >> sys.stderr, "Can't find ptb_version.txt at %s" % fname
+        sys.exit(3)
+
+    f = open( fname, "wb" )
+    try:
+        f.write("embedded\n")
+    finally:
+        f.close()
+
+patch(build_system, "ptb_version.txt")
+patch(build_system, "datatool_version.txt")
+
+sys.exit( 0 )
+
diff --git a/c++/scripts/projects/python_ncbi_dbapi/ChangeLog b/c++/scripts/projects/python_ncbi_dbapi/ChangeLog
index 56a9257..4eceb85 100644
--- a/c++/scripts/projects/python_ncbi_dbapi/ChangeLog
+++ b/c++/scripts/projects/python_ncbi_dbapi/ChangeLog
@@ -1,3 +1,6 @@
+Version 1.16.1 (2016-01-15):
+* Cover Python 3.4 in addition to 2.7.
+
 Version 1.16.0 (2015-09-22):
 * Advance to version 16.1 of the stable C++ Toolkit components, and
   GCC 4.8.1.
diff --git a/c++/scripts/projects/python_ncbi_dbapi/post_build/post_build.py b/c++/scripts/projects/python_ncbi_dbapi/post_build/post_build.py
index f742080..dfab9fb 100755
--- a/c++/scripts/projects/python_ncbi_dbapi/post_build/post_build.py
+++ b/c++/scripts/projects/python_ncbi_dbapi/post_build/post_build.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# $Id: post_build.py 479510 2015-09-21 18:29:09Z ucko $
+# $Id: post_build.py 489116 2016-01-08 16:17:22Z ucko $
 
 import glob, os, shutil, subprocess, sys
 
@@ -8,7 +8,7 @@ common_stems  = ('python_ncbi_dbapi', 'ncbi_xdbapi_*')
 unix_stems    = ('dbapi', 'dbapi_driver', 'ct_ftds64', 'tds_ftds64',
                  'xconne?t', 'xutil', 'xncbi')
 windows_stems = ('ncbi_core', 'ncbi_dbapi', 'ncbi_dbapi_driver')
-installations = ('2.7env',)
+installations = ('2.7env', '3.4')
 
 os.mkdir(install_dir + '/lib')
 if os.path.exists(lib_dir + '/python_ncbi_dbapi.so'):
diff --git a/c++/scripts/projects/python_ncbi_dbapi/project.lst b/c++/scripts/projects/python_ncbi_dbapi/project.lst
index c8444ba..5d5fd66 100644
--- a/c++/scripts/projects/python_ncbi_dbapi/project.lst
+++ b/c++/scripts/projects/python_ncbi_dbapi/project.lst
@@ -19,6 +19,4 @@ dbapi/driver/ftds64/freetds/replacements$
 dbapi/driver/ftds64/freetds/ctlib$
 dbapi/driver/ftds64/ctlib$
 dbapi/lang_bind$
-dbapi/lang_bind/python$
-dbapi/lang_bind/python/pythonpp$
-dbapi/lang_bind/python/tests$
+dbapi/lang_bind/python
diff --git a/c++/scripts/projects/xmlwrapp/Manifest b/c++/scripts/projects/xmlwrapp/Manifest
index 8feb35b..2d8df7f 100644
--- a/c++/scripts/projects/xmlwrapp/Manifest
+++ b/c++/scripts/projects/xmlwrapp/Manifest
@@ -1,7 +1,7 @@
 #
 # Filename: Manifest
 #
-# $Id: Manifest 482132 2015-10-20 21:07:25Z fukanchi $
+# $Id: Manifest 491986 2016-02-10 22:03:08Z fukanchi $
 #
 # Author: Sergey Satskiy
 #
@@ -10,7 +10,7 @@
 #
 
 
-APP: event_parsing test_attributes test_document test_event test_namespace test_node test_tree
+APP: event_parsing test_attributes test_document test_event test_namespace test_node
 APP: test_xslt tree_parsing xml_generation xslt_transformation
 
 LIB: libxmlwrapp.a
@@ -27,12 +27,14 @@ DEFAULT_CONFIGURE_FLAGS: --without-debug --with-mt
 # to it. So some standard options may be added by release configurator, such as --build-root-sfx, --with-projects,
 # --with-distcc, --with-action etc.
 
-FreeBSD32         : plain          : Clang.sh         --without-debug --with-mt    --without-runpath --with-flat-makefile
 FreeBSD64         : plain          : Clang.sh         --without-debug --with-mt    --without-runpath --with-flat-makefile
 
 Linux64-Centos    : plain-GCC      : GCC.sh           --without-debug --with-mt    --without-runpath --with-flat-makefile
 Linux64-Centos    : GCC-nomt       : GCC.sh           --without-debug --without-mt --without-runpath --with-flat-makefile
-Linux64-Centos    : plain-ICC      : ICC.sh           --without-debug --with-mt    --without-runpath --with-flat-makefile
+Linux64-Centos    : ICC-13      : ICC.sh 13.0      --without-debug --with-mt    --without-runpath --with-flat-makefile
+Linux64-Centos    : ICC-135      : ICC.sh 13.5      --without-debug --with-mt    --without-runpath --with-flat-makefile
+Linux64-Centos    : ICC-15      : ICC.sh 15.0      --without-debug --with-mt    --without-runpath --with-flat-makefile
+Linux64-Centos    : plain-ICC      : ICC.sh      --without-debug --with-mt    --without-runpath --with-flat-makefile
 
 Linux64-Ubuntu    : plain-GCC      : GCC.sh           --without-debug --with-mt    --without-runpath --with-flat-makefile
 Linux32-Ubuntu    : plain-GCC      : GCC.sh           --without-debug --with-mt    --without-runpath --with-flat-makefile
@@ -47,3 +49,6 @@ Win64_13          : 13-static-64   : static 64 ReleaseDLL
 
 XCode             : plain          : Xcode.sh 30
 
+
+
+IntelMAC-Clang36  : clang : Clang.sh           --without-debug --with-mt    --without-runpath --with-flat-makefile --with-universal=i386,x86_64 --with-3psw=system:netopt --without-ncbi-public
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 091bb09..86fd134 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in 485953 2015-11-30 17:53:34Z blastadm $
+# $Id: Makefile.in 500618 2016-05-05 19:15:27Z blastadm $
 
 # Master (top-level) makefile for all NCBI C++ projects
 ##################################################################
diff --git a/c++/src/algo/Makefile.in b/c++/src/algo/Makefile.in
index 66d9094..048b0c8 100644
--- a/c++/src/algo/Makefile.in
+++ b/c++/src/algo/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in 485953 2015-11-30 17:53:34Z blastadm $
+# $Id: Makefile.in 402006 2013-06-04 17:15:26Z meric $
 
 # Meta-makefile("ALGO" project)
 #################################
diff --git a/c++/src/algo/blast/api/bl2seq.cpp b/c++/src/algo/blast/api/bl2seq.cpp
index 1c3f261..a02dada 100644
--- a/c++/src/algo/blast/api/bl2seq.cpp
+++ b/c++/src/algo/blast/api/bl2seq.cpp
@@ -1,4 +1,4 @@
-/*  $Id: bl2seq.cpp 478803 2015-09-14 15:44:45Z ivanov $
+/*  $Id: bl2seq.cpp 478658 2015-09-11 14:30:02Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/algo/blast/api/blast_objmgr_tools.cpp b/c++/src/algo/blast/api/blast_objmgr_tools.cpp
index d7e23e3..200f216 100644
--- a/c++/src/algo/blast/api/blast_objmgr_tools.cpp
+++ b/c++/src/algo/blast/api/blast_objmgr_tools.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: blast_objmgr_tools.cpp 416011 2013-10-23 14:02:46Z fongah2 $";
+    "$Id: blast_objmgr_tools.cpp 495292 2016-03-16 14:52:49Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 /* ===========================================================================
@@ -409,6 +409,65 @@ SetupSubjects(TSeqLocVector& subjects,
     SetupSubjects_OMF(subj_src, prog, seqblk_vec, max_subjlen);
 }
 
+
+static unsigned char ctable[16] = {0xFF, 0x00, 0x01, 0xFF, 0x02, 0xFF, 0xFF, 0xFF,
+		                           0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+
+void s_Ncbi4naToNcbi2na(const string & ncbi4na, int base_length,
+                        unsigned char * ncbi2na)
+{
+    int inp_bytes   = base_length;
+    CRandom random(base_length);
+
+    for(int i = 0; i < inp_bytes; i++) {
+        // one input byte
+        unsigned char inp = ncbi4na[i];
+
+        // represents 2 bases
+        unsigned char b = inp & 0xF;
+
+        // compress each to 2 bits
+        unsigned char c = ctable[b];
+
+        if (c  != 0xFF) {
+            // No ambiguities, so we can do this the easy way.
+        	ncbi2na[i] = c;
+
+        } else {
+            if (b == 0 || b == 0x0F) {
+            	//gap or N
+                ncbi2na[i] = random.GetRand() & 0x3;
+            }
+            else {
+
+            	int bitcount = ((b & 1) + ((b >> 1) & 1) +
+            	               ((b >> 2) & 1) + ((b >> 3) & 1));
+
+            	// 1-bit ambiguities here, indicate an error in this class.
+            	_ASSERT(bitcount >= 2);
+            	_ASSERT(bitcount <= 3);
+
+            	int pick = random.GetRand() % bitcount;
+
+            	for(int j = 0; j < 4; j++) {
+            		// skip 0 bits in input.
+            	    if ((b & (1 << j)) == 0)
+            	    	continue;
+
+            	    // If the bitcount is zero, this is the bit we want.
+            	    if (! pick) {
+            	    	ncbi2na[i] = j;
+            	    	break;
+            	    }
+            	    // Else, decrement.
+            	    pick--;
+            	}
+            }
+        }
+    }
+
+}
+
 /// Implementation of the IBlastSeqVector interface which obtains data from a
 /// CSeq_loc and a CScope relying on the CSeqVector class
 class CBlastSeqVectorOM : public IBlastSeqVector
@@ -443,14 +502,10 @@ public:
 
     /** @inheritDoc */
     virtual SBlastSequence GetCompressedPlusStrand() {
-        CSeqVector_CI iter(m_SeqVector);
-        iter.SetRandomizeAmbiguities();
-        iter.SetCoding(CSeq_data::e_Ncbi2na);
-
         SBlastSequence retval(size());
-        for (TSeqPos i = 0; i < size(); i++) {
-            retval.data.get()[i] = *iter++;
-        }
+        string ncbi4na = kEmptyStr;
+        m_SeqVector.GetSeqData(m_SeqVector.begin(), m_SeqVector.end(), ncbi4na);
+        s_Ncbi4naToNcbi2na(ncbi4na, size(), retval.data.get());
         return retval;
     }
 
diff --git a/c++/src/algo/blast/api/blast_options_builder.cpp b/c++/src/algo/blast/api/blast_options_builder.cpp
index ef8904f..97b701a 100644
--- a/c++/src/algo/blast/api/blast_options_builder.cpp
+++ b/c++/src/algo/blast/api/blast_options_builder.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_options_builder.cpp 482876 2015-10-27 11:29:01Z ivanov $
+/*  $Id: blast_options_builder.cpp 482563 2015-10-23 20:19:28Z fongah2 $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -118,7 +118,7 @@ CBlastOptionsBuilder::ComputeProgram(const string & program,
         }
     }
     
-    if (s != "plain" && (! found)) {
+    if (!found && !(s=="plain" || s=="multi_blast")) {
         string msg = "Unsupported combination of program (";
         msg += program;
         msg += ") and service (";
diff --git a/c++/src/algo/blast/api/blast_results.cpp b/c++/src/algo/blast/api/blast_results.cpp
index 23d4b2d..04f695b 100644
--- a/c++/src/algo/blast/api/blast_results.cpp
+++ b/c++/src/algo/blast/api/blast_results.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_results.cpp 456936 2015-01-16 15:44:23Z fongah2 $
+/*  $Id: blast_results.cpp 475845 2015-08-12 14:12:44Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_results.cpp 456936 2015-01-16 15:44:23Z fongah2 $";
+    "$Id: blast_results.cpp 475845 2015-08-12 14:12:44Z fongah2 $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -338,6 +338,11 @@ CSearchResults::SetSubjectMasks(const TSeqLocInfoVector& subj_masks)
 
 void CSearchResults::TrimSeqAlign(CSeq_align_set::Tdata::size_type max_size)
 {
+	if (!HasAlignments())
+	{
+		return;
+	}
+
 	if(max_size == 0)
 	{
 		m_Alignment.Reset();
diff --git a/c++/src/algo/blast/api/blast_seqalign.cpp b/c++/src/algo/blast/api/blast_seqalign.cpp
index ef56238..0276ad2 100644
--- a/c++/src/algo/blast/api/blast_seqalign.cpp
+++ b/c++/src/algo/blast/api/blast_seqalign.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_seqalign.cpp 456652 2015-01-14 14:54:51Z fongah2 $
+/*  $Id: blast_seqalign.cpp 499810 2016-04-28 15:43:25Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1374,11 +1374,24 @@ BlastHitList2SeqAlign_OMF(const BlastHitList     * hit_list,
                                                gi_list,
                                                hit_align);
         }
-        
-        NON_CONST_ITERATE(vector<CRef<CSeq_align > >, iter, hit_align) {
-           RemapToQueryLoc(*iter, query_loc);
-           seq_aligns->Set().push_back(*iter);
+
+	if (seqinfo_src->CanReturnPartialSequence() == true)
+	{
+        	CConstRef<CSeq_loc> subj_loc = seqinfo_src->GetSeqLoc(kOid);
+        	NON_CONST_ITERATE(vector<CRef<CSeq_align > >, iter, hit_align) {
+             	   RemapToQueryLoc(*iter, query_loc);
+             	   if ( !is_ooframe )
+                   	s_RemapToSubjectLoc(*iter, *subj_loc); 
+             	   seq_aligns->Set().push_back(*iter);
+		}
         }
+	else
+	{
+		NON_CONST_ITERATE(vector<CRef<CSeq_align > >, iter, hit_align) {
+           	    RemapToQueryLoc(*iter, query_loc);
+           	    seq_aligns->Set().push_back(*iter);
+		}
+	}
     }
     return seq_aligns;
 }
diff --git a/c++/src/algo/blast/api/blast_setup_cxx.cpp b/c++/src/algo/blast/api/blast_setup_cxx.cpp
index ae3f5ea..9f44c7b 100644
--- a/c++/src/algo/blast/api/blast_setup_cxx.cpp
+++ b/c++/src/algo/blast/api/blast_setup_cxx.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: blast_setup_cxx.cpp 451176 2014-11-04 15:26:36Z fongah2 $";
+    "$Id: blast_setup_cxx.cpp 500367 2016-05-04 12:06:01Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 /* ===========================================================================
@@ -863,9 +863,15 @@ GetSequenceProtein(IBlastSeqVector& sv, string* warnings = 0)
     safe_buf.reset(buf);
     *buf_var++ = GetSentinelByte(eBlastEncodingProtein);
     for (i = 0; i < sv.size(); i++) {
+        // Silently change Selenocysteine (U) to Cysteine (C)
+        // This is needed because composition based stats works with 20 amino
+        // acids, and computes residue frequencies for a query before
+        // converting U to C.
+        if (sv[i] == AMINOACID_TO_NCBISTDAA[(int)'U']) {
+            *buf_var++ = AMINOACID_TO_NCBISTDAA[(int)'C'];
+
         // Change unsupported residues to X
-        if (sv[i] == AMINOACID_TO_NCBISTDAA[(int)'U'] ||
-            sv[i] == AMINOACID_TO_NCBISTDAA[(int)'O']) {
+        } else if (sv[i] == AMINOACID_TO_NCBISTDAA[(int)'O']) {
             replaced_residues.push_back(i);
             *buf_var++ = AMINOACID_TO_NCBISTDAA[(int)'X'];
         } else if (!s_IsValidResidue(sv[i])) {
diff --git a/c++/src/algo/blast/api/dust_filter.cpp b/c++/src/algo/blast/api/dust_filter.cpp
index b7a269f..9165118 100644
--- a/c++/src/algo/blast/api/dust_filter.cpp
+++ b/c++/src/algo/blast/api/dust_filter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dust_filter.cpp 161402 2009-05-27 17:35:47Z camacho $
+/*  $Id: dust_filter.cpp 500379 2016-05-04 13:50:05Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
 /// Calls sym dust lib in algo/dustmask and returns CSeq_locs for use by BLAST.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: dust_filter.cpp 161402 2009-05-27 17:35:47Z camacho $";
+static char const rcsid[] = "$Id: dust_filter.cpp 500379 2016-05-04 13:50:05Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -118,6 +118,7 @@ void s_CombineDustMasksWithUserProvidedMasks(CSeqVector& data,
         query_masks->Add(*seq_interval);
     }
 
+    SetDiagFilter(eDiagFilter_Post, "!(1305.31)");
     CRef<CSeq_loc_Mapper> mapper = s_CreateSeqLocMapper(*query_id, seqloc,
                                                         scope);
     query_masks.Reset(mapper->Map(*query_masks));
diff --git a/c++/src/algo/blast/api/local_blast.cpp b/c++/src/algo/blast/api/local_blast.cpp
index b11962e..1ecbe88 100644
--- a/c++/src/algo/blast/api/local_blast.cpp
+++ b/c++/src/algo/blast/api/local_blast.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: local_blast.cpp 478802 2015-09-14 15:44:22Z ivanov $";
+    "$Id: local_blast.cpp 500119 2016-05-02 16:12:14Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 /* ===========================================================================
  *
@@ -86,6 +86,10 @@ SplitQuery_GetChunkSize(EProgram program)
             // then each of these chunks is translated
             retval = 10002;
             break;
+        case eVecScreen:
+        	// Disable query splitting for vecscreen
+        	retval =1;
+        	break;
         case eBlastp:
         default:
             retval = 10000;
diff --git a/c++/src/algo/blast/api/local_db_adapter.cpp b/c++/src/algo/blast/api/local_db_adapter.cpp
index fdc0913..e00919d 100644
--- a/c++/src/algo/blast/api/local_db_adapter.cpp
+++ b/c++/src/algo/blast/api/local_db_adapter.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: local_db_adapter.cpp 478802 2015-09-14 15:44:22Z ivanov $";
+    "$Id: local_db_adapter.cpp 478540 2015-09-10 12:56:25Z madden $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 /* ===========================================================================
  *
diff --git a/c++/src/algo/blast/api/msa_pssm_input.cpp b/c++/src/algo/blast/api/msa_pssm_input.cpp
index dea2df7..f749013 100644
--- a/c++/src/algo/blast/api/msa_pssm_input.cpp
+++ b/c++/src/algo/blast/api/msa_pssm_input.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: msa_pssm_input.cpp 483267 2015-10-29 16:09:03Z ivanov $";
+    "$Id: msa_pssm_input.cpp 483145 2015-10-28 17:43:30Z boratyng $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 /* ===========================================================================
  *
diff --git a/c++/src/algo/blast/api/prelim_stage.cpp b/c++/src/algo/blast/api/prelim_stage.cpp
index 4a82a09..32ad399 100644
--- a/c++/src/algo/blast/api/prelim_stage.cpp
+++ b/c++/src/algo/blast/api/prelim_stage.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: prelim_stage.cpp 479619 2015-09-22 15:43:07Z ivanov $";
+    "$Id: prelim_stage.cpp 479444 2015-09-21 13:43:44Z fongah2 $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 /* ===========================================================================
  *
diff --git a/c++/src/algo/blast/api/psiblast_aux_priv.cpp b/c++/src/algo/blast/api/psiblast_aux_priv.cpp
index bdf1634..14b117a 100644
--- a/c++/src/algo/blast/api/psiblast_aux_priv.cpp
+++ b/c++/src/algo/blast/api/psiblast_aux_priv.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: psiblast_aux_priv.cpp 402754 2013-06-10 18:21:47Z boratyng $";
+    "$Id: psiblast_aux_priv.cpp 488748 2016-01-05 16:40:40Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 /* ===========================================================================
@@ -655,7 +655,7 @@ CPsiBlastValidate::QueryFactory(CRef<IQueryFactory> query_factory,
     BLAST_SequenceBlk* sblk = NULL;
     try { sblk = query_data->GetSequenceBlk(); }
     catch (const CBlastException& e) {
-        if (e.GetMsg().find("Incompatible sequence codings") != ncbi::NPOS) {
+        if (e.GetMsg().find("Incompatible sequence codings") != NPOS) {
             NCBI_THROW(CBlastException, eInvalidArgument, excpt_msg);
         }
     }
diff --git a/c++/src/algo/blast/api/remote_blast.cpp b/c++/src/algo/blast/api/remote_blast.cpp
index 0609944..6746517 100644
--- a/c++/src/algo/blast/api/remote_blast.cpp
+++ b/c++/src/algo/blast/api/remote_blast.cpp
@@ -1,4 +1,4 @@
-/*  $Id: remote_blast.cpp 482051 2015-10-20 14:16:32Z ivanov $ 
+/*  $Id: remote_blast.cpp 495288 2016-03-16 14:51:11Z ivanov $ 
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1655,8 +1655,45 @@ CRemoteBlast::LoadFromArchive()
 
       m_Archive.Reset(new CBlast4_archive);
       *m_ObjectStream >> *m_Archive;
-      x_GetRequestInfoFromFile(); // update info.
 
+      m_Errs.empty();
+      if(m_Archive->IsSetMessages()) {
+    	  const list< CRef< CBlast4_error > >  & msgs = m_Archive->GetMessages();
+    	  ITERATE(list< CRef< CBlast4_error > >, itr, msgs) {
+    		  if((*itr)->IsSetMessage()) {
+    			  string msg = (*itr)->GetMessage();
+    			  if((*itr)->IsSetCode()) {
+    				  switch ((*itr)->GetCode()) {
+    			  	  case EDiagSev::eDiag_Info :
+    			  		  LOG_POST(Info << msg);
+    			  		  break;
+    			  	  case EDiagSev::eDiag_Warning :
+    			  		  LOG_POST(Warning << msg);
+    			  		  break;
+    			  	  case EDiagSev::eDiag_Error :
+    			  		  LOG_POST(Error << msg);
+    			  		  break;
+    			  	  case EDiagSev::eDiag_Critical :
+    			  		  LOG_POST(Critical << msg);
+    			  		  break;
+    				  case EDiagSev::eDiag_Fatal :
+    			  		  LOG_POST(Fatal << msg);
+    					  break;
+    				  case EDiagSev::eDiag_Trace :
+    			  		  LOG_POST(Trace << msg);
+    					  break;
+    				  default :
+    			  		  LOG_POST(Error <<"Unknown Error Code: " << msg);
+    					  break;
+    				  }
+    			  }
+    		  }
+    	  }
+      }
+
+      if (!IsErrMsgArchive()) {
+    	  x_GetRequestInfoFromFile(); // update info.
+      }
       return true;
 }
 
@@ -2627,6 +2664,17 @@ unsigned int CRemoteBlast::x_GetPsiIterationsFromServer()
      return retval;
 }
 
+bool CRemoteBlast::IsErrMsgArchive(void)
+{
+	if((m_Archive) != NULL && m_Archive->IsSetRequest() && m_Archive->GetRequest().CanGetBody() &&
+	   m_Archive->GetRequest().GetBody().IsGet_request_info() &&
+	   m_Archive->GetRequest().GetBody().GetGet_request_info().IsSetRequest_id() &&
+	   (m_Archive->GetRequest().GetBody().GetGet_request_info().GetRequest_id()  == "Error")) {
+		return true;
+	}
+	return false;
+}
+
 
 END_SCOPE(blast)
 END_NCBI_SCOPE
diff --git a/c++/src/algo/blast/api/remote_search.cpp b/c++/src/algo/blast/api/remote_search.cpp
index 44b2668..dea41f1 100644
--- a/c++/src/algo/blast/api/remote_search.cpp
+++ b/c++/src/algo/blast/api/remote_search.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: remote_search.cpp 482051 2015-10-20 14:16:32Z ivanov $";
+    "$Id: remote_search.cpp 481634 2015-10-14 15:21:43Z fongah2 $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 /* ===========================================================================
  *
diff --git a/c++/src/algo/blast/api/search_strategy.cpp b/c++/src/algo/blast/api/search_strategy.cpp
index 945efee..ac282ea 100644
--- a/c++/src/algo/blast/api/search_strategy.cpp
+++ b/c++/src/algo/blast/api/search_strategy.cpp
@@ -1,4 +1,4 @@
-/*  $Id: search_strategy.cpp 482051 2015-10-20 14:16:32Z ivanov $
+/*  $Id: search_strategy.cpp 481634 2015-10-14 15:21:43Z fongah2 $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/algo/blast/api/seqinfosrc_bioseq.hpp b/c++/src/algo/blast/api/seqinfosrc_bioseq.hpp
index f8ae742..1f6e70b 100644
--- a/c++/src/algo/blast/api/seqinfosrc_bioseq.hpp
+++ b/c++/src/algo/blast/api/seqinfosrc_bioseq.hpp
@@ -1,7 +1,7 @@
 #ifndef ALGO_BLAST_API__SEQINFOSRC_BIOSEQ__HPP
 #define ALGO_BLAST_API__SEQINFOSRC_BIOSEQ__HPP
 
-/*  $Id: seqinfosrc_bioseq.hpp 170794 2009-09-16 18:53:03Z maning $
+/*  $Id: seqinfosrc_bioseq.hpp 499810 2016-04-28 15:43:25Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -108,6 +108,13 @@ public:
     virtual bool GetMasks(Uint4 index, 
                           const vector<TSeqRange>& target_ranges,
                           TMaskedSubjRegions& retval) const;
+
+    /// Return true if the implementation can return anything besides a seq-loc
+    /// for the entire sequence.  If in doubt, the implementation must
+    /// return true.
+    /// GetSeqLoc use CreateWholeSeqLocFromIds, so false is returned for this implementation.
+    virtual bool CanReturnPartialSequence() const {return false;}
+
 private:
     CBlastQuerySourceBioseqSet m_DataSource;
 };
diff --git a/c++/src/algo/blast/api/seqsrc_multiseq.cpp b/c++/src/algo/blast/api/seqsrc_multiseq.cpp
index 890f352..62afb38 100644
--- a/c++/src/algo/blast/api/seqsrc_multiseq.cpp
+++ b/c++/src/algo/blast/api/seqsrc_multiseq.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqsrc_multiseq.cpp 481976 2015-10-19 16:59:52Z ivanov $
+/*  $Id: seqsrc_multiseq.cpp 481666 2015-10-14 18:09:27Z madden $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/algo/blast/api/seqsrc_seqdb.cpp b/c++/src/algo/blast/api/seqsrc_seqdb.cpp
index f94112c..92054bc 100644
--- a/c++/src/algo/blast/api/seqsrc_seqdb.cpp
+++ b/c++/src/algo/blast/api/seqsrc_seqdb.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqsrc_seqdb.cpp 482051 2015-10-20 14:16:32Z ivanov $
+/*  $Id: seqsrc_seqdb.cpp 481634 2015-10-14 15:21:43Z fongah2 $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/algo/blast/api/uniform_search.cpp b/c++/src/algo/blast/api/uniform_search.cpp
index 71e863a..3c44368 100644
--- a/c++/src/algo/blast/api/uniform_search.cpp
+++ b/c++/src/algo/blast/api/uniform_search.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: uniform_search.cpp 482051 2015-10-20 14:16:32Z ivanov $";
+    "$Id: uniform_search.cpp 481634 2015-10-14 15:21:43Z fongah2 $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 /* ===========================================================================
  *
diff --git a/c++/src/algo/blast/api/version.cpp b/c++/src/algo/blast/api/version.cpp
index 422b333..be9bf90 100644
--- a/c++/src/algo/blast/api/version.cpp
+++ b/c++/src/algo/blast/api/version.cpp
@@ -1,4 +1,4 @@
-/*  $Id: version.cpp 363242 2012-05-15 15:00:29Z madden $
+/*  $Id: version.cpp 479011 2015-09-15 18:15:16Z zaretska $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -86,24 +86,24 @@ accelerated BLAST\", Biology Direct 7:12.",
 /// Pubmed URLs to retrieve the references defined above
 static const string kPubMedUrls[(int)CReference::eMaxPublications+1] = {
     // eGappedBlast
-    "http://www.ncbi.nlm.nih.gov/\
+    "//www.ncbi.nlm.nih.gov/\
 entrez/query.fcgi?db=PubMed&cmd=Retrieve&list_uids=9254694&dopt=Citation",
     // ePhiBlast
-    "http://www.ncbi.nlm.nih.gov/\
+    "//www.ncbi.nlm.nih.gov/\
 entrez/query.fcgi?db=PubMed&cmd=Retrieve&list_uids=9705509&dopt=Citation",
     // eMegaBlast
-    "http://www.ncbi.nlm.nih.gov/\
+    "//www.ncbi.nlm.nih.gov/\
 entrez/query.fcgi?db=PubMed&cmd=Retrieve&list_uids=10890397&dopt=Citation",
     // eCompBasedStats
-    "http://www.ncbi.nlm.nih.gov/\
+    "//www.ncbi.nlm.nih.gov/\
 entrez/query.fcgi?db=PubMed&cmd=Retrieve&list_uids=11452024&dopt=Citation",
     // eCompAdjustedMatrices
-    "http://www.ncbi.nlm.nih.gov/\
+    "//www.ncbi.nlm.nih.gov/\
 entrez/query.fcgi?db=PubMed&cmd=Retrieve&list_uids=16218944&dopt=Citation",
     // eIndexedMegablast
-    "http://www.ncbi.nlm.nih.gov/pubmed/18567917",
+    "//www.ncbi.nlm.nih.gov/pubmed/18567917",
     // eDeltaBlast
-    "http://www.ncbi.nlm.nih.gov/pubmed/22510480",
+    "//www.ncbi.nlm.nih.gov/pubmed/22510480",
     // eMaxPublications
     kEmptyStr
 };
diff --git a/c++/src/algo/blast/blastinput/blast_args.cpp b/c++/src/algo/blast/blastinput/blast_args.cpp
index 2c259dc..ca39587 100644
--- a/c++/src/algo/blast/blastinput/blast_args.cpp
+++ b/c++/src/algo/blast/blastinput/blast_args.cpp
@@ -1,4 +1,4 @@
-/* $Id: blast_args.cpp 485060 2015-11-18 16:07:34Z ivanov $
+/* $Id: blast_args.cpp 499246 2016-04-25 11:32:24Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -37,7 +37,7 @@ Author: Jason Papadopoulos
 */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: blast_args.cpp 485060 2015-11-18 16:07:34Z ivanov $";
+static char const rcsid[] = "$Id: blast_args.cpp 499246 2016-04-25 11:32:24Z ivanov $";
 #endif
 
 #include <ncbi_pch.hpp>
@@ -164,7 +164,7 @@ CGenericSearchArgs::SetArgumentDescriptions(CArgDescriptions& arg_desc)
     }
 
 
-    if (m_ShowPercentIdentity) {
+    if (m_ShowPercentIdentity && !m_IsIgBlast) {
         arg_desc.SetCurrentGroup("Restrict search or results");
         arg_desc.AddOptionalKey(kArgPercentIdentity, "float_value",
                                 "Percent identity",
@@ -343,7 +343,7 @@ CFilteringArgs::x_TokenizeFilteringArgs(const string& filtering_args,
                                         vector<string>& output) const
 {
     output.clear();
-    NStr::Tokenize(filtering_args, " ", output);
+    NStr::Split(filtering_args, " ", output, NStr::fSplit_NoMergeDelims);
     if (output.size() != 3) {
         NCBI_THROW(CInputException, eInvalidInput,
                    "Invalid number of arguments to filtering option");
@@ -1454,6 +1454,7 @@ CIgBlastArgs::SetArgumentDescriptions(CArgDescriptions& arg_desc)
 
         arg_desc.SetConstraint(kArgDPenalty, 
                                new CArgAllowValuesBetween(-6, 0));
+       
     }
 
     arg_desc.AddDefaultKey(kArgGLOrigin, "germline_origin",
@@ -1463,7 +1464,7 @@ CIgBlastArgs::SetArgumentDescriptions(CArgDescriptions& arg_desc)
 
     arg_desc.AddDefaultKey(kArgGLDomainSystem, "domain_system",
                             "Domain system to be used for segment annotation",
-                            CArgDescriptions::eString, "kabat");
+                            CArgDescriptions::eString, "imgt");
     arg_desc.SetConstraint(kArgGLDomainSystem, &(*new CArgAllow_Strings, "kabat", "imgt"));
 
     arg_desc.AddDefaultKey(kArgIgSeqType, "sequence_type",
@@ -1474,6 +1475,14 @@ CIgBlastArgs::SetArgumentDescriptions(CArgDescriptions& arg_desc)
 
     arg_desc.AddFlag(kArgGLFocusV, "Should the search only be for V segment (effective only for non-germline database search using -db option)?", true);
 
+    arg_desc.AddFlag(kArgExtendAlign, "Extend V gene alignment at 5' end", true);
+
+    arg_desc.AddDefaultKey(kArgMinVLength, "Min_V_Length",
+                           "Minimal required V gene length",
+                           CArgDescriptions::eInteger, "9");
+    arg_desc.SetConstraint(kArgMinVLength, 
+                           new CArgAllowValuesGreaterThanOrEqual(9));
+    
     if (! m_IsProtein) {
         arg_desc.AddFlag(kArgTranslate, "Show translated alignments", true);
     }
@@ -1525,6 +1534,9 @@ CIgBlastArgs::ExtractAlgorithmOptions(const CArgs& args,
     m_IgOptions->m_Origin = args[kArgGLOrigin].AsString();
     m_IgOptions->m_DomainSystem = args[kArgGLDomainSystem].AsString();
     m_IgOptions->m_FocusV = args.Exist(kArgGLFocusV) ? args[kArgGLFocusV] : false;
+    m_IgOptions->m_ExtendAlign = args.Exist(kArgExtendAlign) ? args[kArgExtendAlign] : false;
+    m_IgOptions->m_MinVLength = args[kArgMinVLength].AsInteger();
+   
     m_IgOptions->m_Translate = args.Exist(kArgTranslate) ? args[kArgTranslate] : false;
     if (!m_IsProtein) {
         string aux_file = (args.Exist(kArgGLChainType) && args[kArgGLChainType])
diff --git a/c++/src/algo/blast/blastinput/blast_fasta_input.cpp b/c++/src/algo/blast/blastinput/blast_fasta_input.cpp
index e038f30..1fba5b7 100644
--- a/c++/src/algo/blast/blastinput/blast_fasta_input.cpp
+++ b/c++/src/algo/blast/blastinput/blast_fasta_input.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_fasta_input.cpp 477844 2015-09-02 13:12:06Z ivanov $
+/*  $Id: blast_fasta_input.cpp 489949 2016-01-20 12:32:48Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_fasta_input.cpp 477844 2015-09-02 13:12:06Z ivanov $";
+    "$Id: blast_fasta_input.cpp 489949 2016-01-20 12:32:48Z madden $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -136,7 +136,12 @@ public:
         const string line = NStr::TruncateSpaces_Unsafe(*++GetLineReader());
         if ( !line.empty() && isalnum(line.data()[0]&0xff) ) {
             try {
-                CRef<CSeq_id> id(new CSeq_id(line));
+                CRef<CSeq_id> id(new CSeq_id(line, (CSeq_id::fParse_AnyRaw | 
+							CSeq_id::fParse_ValidLocal)));
+		if (id->IsLocal()  &&  !NStr::StartsWith(line, "lcl|") ) {
+                    // Expected to throw an exception.
+                    id.Reset(new CSeq_id(line));
+		}
                 CRef<CBioseq> bioseq(x_CreateBioseq(id));
                 CRef<CSeq_entry> retval(new CSeq_entry());
                 retval->SetSeq(*bioseq);
@@ -196,12 +201,12 @@ private:
         if (!isProtein && m_ReadProteins)
         {
             NCBI_THROW(CInputException, eSequenceMismatch,
-               "Gi/accession mismatch: requested protein, found nucleotide");
+               "GI/accession/sequence mismatch: protein input required but nucleotide provided");
         }
         if (isProtein && !m_ReadProteins)
         {
             NCBI_THROW(CInputException, eSequenceMismatch,
-               "Gi/accession mismatch: requested nucleotide, found protein");
+               "GI/accession/sequence mismatch: nucleotide input required but protein provided");
         }
 
         if (!isProtein)  // Never seen a virtual protein sequence.
diff --git a/c++/src/algo/blast/blastinput/blast_input_aux.cpp b/c++/src/algo/blast/blastinput/blast_input_aux.cpp
index 93bff85..b216490 100644
--- a/c++/src/algo/blast/blastinput/blast_input_aux.cpp
+++ b/c++/src/algo/blast/blastinput/blast_input_aux.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_input_aux.cpp 483791 2015-11-04 11:12:47Z ivanov $
+/*  $Id: blast_input_aux.cpp 489109 2016-01-08 15:13:42Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_input_aux.cpp 483791 2015-11-04 11:12:47Z ivanov $";
+    "$Id: blast_input_aux.cpp 489109 2016-01-08 15:13:42Z fongah2 $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -144,7 +144,7 @@ ParseSequenceRange(const string& range_str,
     string error_msg(error_prefix ? error_prefix : kDfltErrorPrefix);
 
     vector<string> tokens;
-    NStr::Tokenize(range_str, kDelimiters, tokens);
+    NStr::Split(range_str, kDelimiters, tokens, NStr::fSplit_NoMergeDelims);
     if (tokens.size() != 2 || tokens.front().empty() || tokens.back().empty()) {
         error_msg += " (Format: start-stop)";
         NCBI_THROW(CBlastException, eInvalidArgument, error_msg);
@@ -180,7 +180,7 @@ ParseSequenceRangeOpenEnd(const string& range_str,
     string error_msg(error_prefix ? error_prefix : kDfltErrorPrefix);
 
     vector<string> tokens;
-    NStr::Tokenize(range_str, kDelimiters, tokens);
+    NStr::Split(range_str, kDelimiters, tokens);
     if (tokens.front().empty()) {
         error_msg += " (start cannot be empty)";
         NCBI_THROW(CBlastException, eInvalidArgument, error_msg);
diff --git a/c++/src/algo/blast/blastinput/blastn_args.cpp b/c++/src/algo/blast/blastinput/blastn_args.cpp
index ebe050d..6169370 100644
--- a/c++/src/algo/blast/blastinput/blastn_args.cpp
+++ b/c++/src/algo/blast/blastinput/blastn_args.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastn_args.cpp 474652 2015-07-30 16:37:40Z ivanov $
+/*  $Id: blastn_args.cpp 474565 2015-07-29 19:26:43Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] 
-    = "$Id: blastn_args.cpp 474652 2015-07-30 16:37:40Z ivanov $";
+    = "$Id: blastn_args.cpp 474565 2015-07-29 19:26:43Z fongah2 $";
 #endif
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/algo/blast/blastinput/cmdline_flags.cpp b/c++/src/algo/blast/blastinput/cmdline_flags.cpp
index 1774775..c5f5744 100644
--- a/c++/src/algo/blast/blastinput/cmdline_flags.cpp
+++ b/c++/src/algo/blast/blastinput/cmdline_flags.cpp
@@ -1,4 +1,4 @@
-/*  $Id: cmdline_flags.cpp 483791 2015-11-04 11:12:47Z ivanov $
+/*  $Id: cmdline_flags.cpp 499246 2016-04-25 11:32:24Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: cmdline_flags.cpp 483791 2015-11-04 11:12:47Z ivanov $";
+    "$Id: cmdline_flags.cpp 499246 2016-04-25 11:32:24Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -185,6 +185,8 @@ const string kArgGLChainType("auxiliary_data");
 const string kArgGLOrigin("organism");
 const string kArgGLDomainSystem("domain_system");
 const string kArgGLFocusV("focus_on_V_segment");
+const string kArgExtendAlign("extend_align5end");
+const string kArgMinVLength("min_V_length");
 const string kArgTranslate("show_translation");
 const string kArgMinDMatch("min_D_match");
 const string kArgDPenalty("D_penalty");
diff --git a/c++/src/algo/blast/blastinput/deltablast_args.cpp b/c++/src/algo/blast/blastinput/deltablast_args.cpp
index 3b955f6..fb7c457 100644
--- a/c++/src/algo/blast/blastinput/deltablast_args.cpp
+++ b/c++/src/algo/blast/blastinput/deltablast_args.cpp
@@ -1,4 +1,4 @@
-/*  $Id: deltablast_args.cpp 483793 2015-11-04 11:13:41Z ivanov $
+/*  $Id: deltablast_args.cpp 483573 2015-11-02 17:48:31Z boratyng $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: deltablast_args.cpp 483793 2015-11-04 11:13:41Z ivanov $";
+static char const rcsid[] = "$Id: deltablast_args.cpp 483573 2015-11-02 17:48:31Z boratyng $";
 #endif
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/algo/blast/blastinput/psiblast_args.cpp b/c++/src/algo/blast/blastinput/psiblast_args.cpp
index 9008626..3146f82 100644
--- a/c++/src/algo/blast/blastinput/psiblast_args.cpp
+++ b/c++/src/algo/blast/blastinput/psiblast_args.cpp
@@ -1,4 +1,4 @@
-/*  $Id: psiblast_args.cpp 483791 2015-11-04 11:12:47Z ivanov $
+/*  $Id: psiblast_args.cpp 483345 2015-10-30 14:04:13Z boratyng $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: psiblast_args.cpp 483791 2015-11-04 11:12:47Z ivanov $";
+static char const rcsid[] = "$Id: psiblast_args.cpp 483345 2015-10-30 14:04:13Z boratyng $";
 #endif
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/algo/blast/blastinput/unit_test/blast_scope_src_unit_test.cpp b/c++/src/algo/blast/blastinput/unit_test/blast_scope_src_unit_test.cpp
index 8b93c97..23c5063 100644
--- a/c++/src/algo/blast/blastinput/unit_test/blast_scope_src_unit_test.cpp
+++ b/c++/src/algo/blast/blastinput/unit_test/blast_scope_src_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_scope_src_unit_test.cpp 424465 2014-01-16 14:02:06Z camacho $
+/*  $Id: blast_scope_src_unit_test.cpp 481294 2015-10-08 14:03:49Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -29,6 +29,7 @@
 
 /** @file blast_scope_src_unit_test.cpp
  */
+#define NCBI_TEST_APPLICATION
 #include <ncbi_pch.hpp>
 #define NCBI_BOOST_NO_AUTO_TEST_MAIN
 #include <corelib/test_boost.hpp>
@@ -303,7 +304,7 @@ BOOST_AUTO_TEST_CASE(ConfigFileTest_UseNoDataLoaders)
 }
 
 static 
-void s_RetrieveSequenceLength(int gi, 
+void s_RetrieveSequenceLength(TGi gi, 
                               const string& dbname,
                               bool is_prot,
                               TSeqPos kExpectedLength) 
@@ -342,7 +343,7 @@ BOOST_AUTO_TEST_CASE(RetrieveFromGenbank_NewlyAddedSequenceToGenbank) {
 
     // Search sequences publishe recently
     CEntrez2Client entrez;
-    vector<int> results;
+    vector<TGi> results;
     entrez.Query(query_str, "nucleotide", results);
     if (results.empty()) {
         // No newly added sequences today :(
diff --git a/c++/src/algo/blast/blastinput/unit_test/blastinput_unit_test.cpp b/c++/src/algo/blast/blastinput/unit_test/blastinput_unit_test.cpp
index a874479..47a0896 100644
--- a/c++/src/algo/blast/blastinput/unit_test/blastinput_unit_test.cpp
+++ b/c++/src/algo/blast/blastinput/unit_test/blastinput_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastinput_unit_test.cpp 463574 2015-03-30 16:58:22Z camacho $
+/*  $Id: blastinput_unit_test.cpp 489949 2016-01-20 12:32:48Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE(ReadAccession_MismatchNuclProt)
     }
     catch (const CInputException& e) {
         string msg(e.what());
-        BOOST_REQUIRE(msg.find("Gi/accession mismatch: requested protein, found nucleotide")
+        BOOST_REQUIRE(msg.find("GI/accession/sequence mismatch: protein input required but nucleotide provided")
                     != NPOS);
         BOOST_REQUIRE_EQUAL(CInputException::eSequenceMismatch, e.GetErrCode());
         caught_exception = true;
@@ -132,7 +132,7 @@ BOOST_AUTO_TEST_CASE(ReadAccession_MismatchProtNucl)
     }
     catch (const CInputException& e) {
         string msg(e.what());
-        BOOST_REQUIRE(msg.find("Gi/accession mismatch: requested nucleotide, found protein")
+        BOOST_REQUIRE(msg.find("GI/accession/sequence mismatch: nucleotide input required but protein provided")
                     != NPOS);
         BOOST_REQUIRE_EQUAL(CInputException::eSequenceMismatch, e.GetErrCode());
         caught_exception = true;
@@ -158,7 +158,7 @@ BOOST_AUTO_TEST_CASE(ReadGi_MismatchNuclProt)
     }
     catch (const CInputException& e) {
         string msg(e.what());
-        BOOST_REQUIRE(msg.find("Gi/accession mismatch: requested protein, found nucleotide")
+        BOOST_REQUIRE(msg.find("GI/accession/sequence mismatch: protein input required but nucleotide provided")
                     != NPOS);
         BOOST_REQUIRE_EQUAL(CInputException::eSequenceMismatch, e.GetErrCode());
         caught_exception = true;
@@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(ReadGi_MismatchProtNucl)
     }
     catch (const CInputException& e) {
         string msg(e.what());
-        BOOST_REQUIRE(msg.find("Gi/accession mismatch: requested nucleotide, found protein")
+        BOOST_REQUIRE(msg.find("GI/accession/sequence mismatch: nucleotide input required but protein provided")
                     != NPOS);
         BOOST_REQUIRE_EQUAL(CInputException::eSequenceMismatch, e.GetErrCode());
         caught_exception = true;
@@ -786,7 +786,7 @@ void s_ReadAndTestQueryFromString(const string& input, TSeqPos expected_length,
     blast::TSeqLocVector query = qIn.GetAllSeqLocs(scope);
     BOOST_REQUIRE_EQUAL(expected_length, 
                         sequence::GetLength(*query.front().seqloc, &scope));
-    CRef<CSeqVector> sv(new CSeqVector(*query.front().seqloc, &scope));
+    CRef<CSeqVector> sv(new CSeqVector(*query.front().seqloc, scope));
     BOOST_REQUIRE_EQUAL(expected_length, sv->size());
     BOOST_REQUIRE_EQUAL(is_protein, sv->IsProtein());
     sv->SetIupacCoding();
@@ -1346,6 +1346,44 @@ BOOST_AUTO_TEST_CASE(ReadMultipleSequencesFromSequencer)
     BOOST_REQUIRE(blast::IsLocalId(query_vector.front().seqloc->GetId()));
 }
 
+BOOST_AUTO_TEST_CASE(ReadMultipleSequencesFromSequencerParseLocalIds)
+{
+    CNcbiIfstream infile("data/DF-1.txt");
+    const bool kIsProtein(false);
+    const bool kParseID(true);
+    SDataLoaderConfig dlconfig(kIsProtein);
+    CBlastInputSourceConfig iconfig(dlconfig, objects::eNa_strand_other, false, kParseID);
+    CRef<CBlastInput> source(s_DeclareBlastInput(infile, iconfig));
+    const size_t kNumQueries(96);
+
+    BOOST_REQUIRE(source->End() == false);
+
+    CScope scope(*CObjectManager::GetInstance());
+    blast::TSeqLocVector query_vector = source->GetAllSeqLocs(scope);
+    BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());
+    BOOST_REQUIRE(blast::IsLocalId(query_vector.front().seqloc->GetId()));
+    // Check that the first three IDs went through.
+    BOOST_REQUIRE_EQUAL(query_vector[0].seqloc->GetId()->AsFastaString(), string("lcl|seq#474_A03_564_c_T3+40.ab1"));
+    BOOST_REQUIRE_EQUAL(query_vector[1].seqloc->GetId()->AsFastaString(), string("lcl|seq#474_A01_564_a_T3+40.ab1"));
+    BOOST_REQUIRE_EQUAL(query_vector[2].seqloc->GetId()->AsFastaString(), string("lcl|seq#474_A02_564_b_T3+40.ab1"));
+}
+
+BOOST_AUTO_TEST_CASE(ReadSequenceWithlclID)
+{
+    CNcbiIfstream infile("data/localid.txt");
+    const bool kIsProtein(false);
+    const bool kParseID(true);
+    SDataLoaderConfig dlconfig(kIsProtein);
+    CBlastInputSourceConfig iconfig(dlconfig, objects::eNa_strand_other, false, kParseID);
+    CRef<CBlastInput> source(s_DeclareBlastInput(infile, iconfig));
+
+    CScope scope(*CObjectManager::GetInstance());
+    blast::TSeqLocVector query_vector = source->GetAllSeqLocs(scope);
+    BOOST_REQUIRE(blast::IsLocalId(query_vector.front().seqloc->GetId()));
+    // Check that the local ID went through.
+    BOOST_REQUIRE_EQUAL(query_vector[0].seqloc->GetId()->AsFastaString(), string("lcl|mylocalID555"));
+}
+
 // This input file contains several sequences in FASTA format, but one of them
 // is empty, this should proceed with no problems
 BOOST_AUTO_TEST_CASE(ReadMultipleSequences_OneEmpty)
@@ -2665,7 +2703,7 @@ private:
     /// Extract the arguments from a command line
     vector<string> x_TokenizeCmdLine(const string& cmd_line_args) {
         vector<string> retval;
-        NStr::Tokenize(cmd_line_args, " ", retval);
+        NStr::Split(cmd_line_args, " ", retval, NStr::fSplit_NoMergeDelims);
         vector<string>::iterator new_end = remove_if(retval.begin(), 
                                                      retval.end(), 
                                                      empty_string_remover());
diff --git a/c++/src/algo/blast/blastinput/unit_test/data/localid.txt b/c++/src/algo/blast/blastinput/unit_test/data/localid.txt
new file mode 100644
index 0000000..d0d59da
--- /dev/null
+++ b/c++/src/algo/blast/blastinput/unit_test/data/localid.txt
@@ -0,0 +1,9 @@
+>lcl|mylocalID555
+ACCTCCACTAGCTTTGTTTGTAGTGATGCTCTGTAGCACCACTGGGAAGCCCTTTAATGAATGTGCCTTTCCGCAAATCA
+CACACACACAAATACACTTATAGAAACAAGGTGATTTTCTTGAAATAATAAAACAAAATTTGGAAGAAGATTTTTACTGT
+CTTAGGAAAAGTAAGGCATTGGAAGGTGGCTAGGTATGACATATGAAGTTGCATTTTAAAACTGGAATTGGACAACTGAT
+ATTCAGTGATATTTATGCTACTACCTTCTAGAATCGAGAGCATGCACCCCACTCTGTACTCTTGCCTGGAGAATCCATGA
+TGAGAGCCTGGTAGGCTGCAGTCCATGGGGTCACACAGAGTCGGACATGACTGAGCGACTTCACTTTCACTTTTCAATTT
+CATGCATTGGAGCCGGAAATGGCAACCCACTCCAGTGTTCTTGCCTGGAGAATCCCAGGGATGGGGAAGCCTGGTGGGCT
+GCTGTCTATGGGGTCGCAGAGAGTCAGACACGACTGAAGTGACTTAGCAGCAACCTTCTGGAATAAACGCCTCAGGCTTT
+AAACTCTGGCTTGACCATTCACTAGCCATGGGATCCACTAGAGTCGACCTGCAGGCATGCAAGC
diff --git a/c++/src/algo/blast/composition_adjustment/composition_adjustment.c b/c++/src/algo/blast/composition_adjustment/composition_adjustment.c
index 7fdae3e..83ec1cd 100644
--- a/c++/src/algo/blast/composition_adjustment/composition_adjustment.c
+++ b/c++/src/algo/blast/composition_adjustment/composition_adjustment.c
@@ -30,7 +30,7 @@
  */
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: composition_adjustment.c 459367 2015-02-18 14:43:02Z madden $";
+    "$Id: composition_adjustment.c 500367 2016-05-04 12:06:01Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <limits.h>
@@ -693,11 +693,12 @@ s_SetXUOScores(double ** M, int alphsize,
         M[eXchar][eJchar] =
             s_CalcXScore(&M[0][eJchar], alphsize, cols, row_probs);
     }
-    /* Copy X scores to U and O */
-    memcpy(M[eSelenocysteine], M[eXchar], alphsize * sizeof(double));
+    /* Copy C scores to U */
+    memcpy(M[eSelenocysteine], M[eCchar], alphsize * sizeof(double));
     for (i = 0;  i < alphsize;  i++) {
-        M[i][eSelenocysteine] = M[i][eXchar];
+        M[i][eSelenocysteine] = M[i][eCchar];
     }
+    /* Copy X scores to O */
     if (alphsize > eOchar) {
         memcpy(M[eOchar], M[eXchar], alphsize * sizeof(double));
         for (i = 0;  i < alphsize;  i++) {
@@ -1042,7 +1043,8 @@ s_ScalePSSM(int **matrix, int rows, int cols, double ** freq_ratios,
 
         Blast_FreqRatioToScore(row_matrix, 1, cols, Lambda);
         row[eXchar] = Xscore = s_CalcXScore(row, cols, 1, col_prob);
-        row[eSelenocysteine] = Xscore;
+        /* use Cysteine score for Selenocysteine */
+        row[eSelenocysteine] = row[eCchar];
         if (cols > eOchar) {
             row[eOchar] = Xscore;
         }
diff --git a/c++/src/algo/blast/composition_adjustment/redo_alignment.c b/c++/src/algo/blast/composition_adjustment/redo_alignment.c
index 9a5a008..93e914b 100644
--- a/c++/src/algo/blast/composition_adjustment/redo_alignment.c
+++ b/c++/src/algo/blast/composition_adjustment/redo_alignment.c
@@ -31,7 +31,7 @@
  */
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: redo_alignment.c 474018 2015-07-24 13:27:53Z ivanov $";
+    "$Id: redo_alignment.c 496008 2016-03-23 11:29:15Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <stdlib.h>
@@ -55,7 +55,7 @@ static char const rcsid[] =
  *
  * This macro is usually used as part of a C-conditional
  * if (COMPO_INTENSE_DEBUG) {
- *     perform expensive tests 
+ *     perform expensive tests
  * }
  * The C compiler will then validate the code to perform the tests, but
  * will almost always strip the code if COMPO_INTENSE_DEBUG is false.
@@ -202,7 +202,7 @@ s_AlignmentsAreSorted(BlastCompo_Alignment * alignments)
 /** Calculate the length of a list of BlastCompo_Alignment objects.
  *  This is an O(n) operation */
 static int
-s_DistinctAlignmentsLength(BlastCompo_Alignment * list) 
+s_DistinctAlignmentsLength(BlastCompo_Alignment * list)
 {
     int length = 0;
     for ( ;  list != NULL;  list = list->next) {
@@ -213,7 +213,7 @@ s_DistinctAlignmentsLength(BlastCompo_Alignment * list)
 
 
 /**
- * Sort a list of Blast_Compo_Alignment objects, using s_AlignmentCmp 
+ * Sort a list of Blast_Compo_Alignment objects, using s_AlignmentCmp
  * comparison function.  The mergesort sorting algorithm is used.
  *
  * @param *plist        the list to be sorted
@@ -229,7 +229,7 @@ s_DistinctAlignmentsSort(BlastCompo_Alignment ** plist, int hspcnt)
         BlastCompo_Alignment * list = *plist;
         BlastCompo_Alignment *leftlist, *rightlist, **tail;
         int i, leftcnt, rightcnt;
-        
+
         /* Split the list in half */
         leftcnt = hspcnt/2;
         rightcnt = hspcnt - leftcnt;
@@ -250,7 +250,7 @@ s_DistinctAlignmentsSort(BlastCompo_Alignment ** plist, int hspcnt)
             assert(s_DistinctAlignmentsLength(leftlist) == leftcnt);
         }
         /* Sort the two lists */
-        if (leftcnt > 1) 
+        if (leftcnt > 1)
             s_DistinctAlignmentsSort(&leftlist, leftcnt);
         if (rightcnt > 1)
             s_DistinctAlignmentsSort(&rightlist, rightcnt);
@@ -301,7 +301,7 @@ s_AlignmentCopy(const BlastCompo_Alignment * align)
                                    align->matchStart,
                                    align->matchEnd, align->frame,
                                    align->context);
-    
+
 }
 
 /**
@@ -335,7 +335,7 @@ s_IsSimilarEndPoint(const BlastCompo_Alignment* newAlign,
                                align->matchStart, align->matchEnd,
                                newAlign->matchStart);
     /* is end of newAlign contained within align */
-    Boolean end_contained = 
+    Boolean end_contained =
         KAPPA_CONTAINED_IN_HSP(align->queryStart, align->queryEnd,
                                newAlign->queryEnd,
                                align->matchStart, align->matchEnd,
@@ -343,13 +343,13 @@ s_IsSimilarEndPoint(const BlastCompo_Alignment* newAlign,
 
     /* does either end point of newAlign lie on the same diagonal as the same
        end point of align */
-    Boolean result =  (start_contained && 
+    Boolean result =  (start_contained &&
                        (newAlign->queryStart - newAlign->matchStart ==
                         align->queryStart - align->matchStart)) ||
                       (end_contained &&
                        (newAlign->queryEnd - newAlign->matchEnd ==
                         align->queryEnd - align->matchEnd));
-       
+
     return result;
 }
 
@@ -377,7 +377,7 @@ s_IsSimilarEndPoint(const BlastCompo_Alignment* newAlign,
  *                          the list; on output NULL
  * @param p_oldAlignments   on input the existing list of alignments;
  *                          on output the new list
- * @param free_align_context    a routine to be used to free the context 
+ * @param free_align_context    a routine to be used to free the context
  *                              field of an alignment, if any alignment is
  *                              freed; may be NULL
  * @param is_same_adjustment    were all compared HSPs computed with the same
@@ -453,7 +453,7 @@ s_WithDistinctEnds(BlastCompo_Alignment **p_newAlign,
         BlastCompo_AlignmentsFree(&newAlign, free_align_context);
     } /* end else do not include newAlign */
 }
- 
+
 
 /** Release the data associated with this object. */
 static void s_SequenceDataRelease(BlastCompo_SequenceData * self)
@@ -543,7 +543,7 @@ static void
 s_WindowInfoJoin(s_WindowInfo * win1, s_WindowInfo ** pwin2)
 {
     /* the second window, which will be deleted when this routine exits */
-    s_WindowInfo * win2 = *pwin2;   
+    s_WindowInfo * win2 = *pwin2;
     BlastCompo_Alignment *align, **tail;
     /* subject ranges for the two windows */
     BlastCompo_SequenceRange * sbjct_range1 = &win1->subject_range;
@@ -587,7 +587,7 @@ s_LocationCompareWindows(const void * vp1, const void *vp2)
 
     int result;                   /* result of the comparison */
     if (0 == (result = CMP(qr1->context, qr2->context)) &&
-        0 == (result = CMP(sr1->context, sr2->context)) && 
+        0 == (result = CMP(sr1->context, sr2->context)) &&
         0 == (result = CMP(sr1->begin, sr2->begin)) &&
         0 == (result = CMP(sr1->end, sr2->end)) &&
         0 == (result = CMP(qr1->begin, qr2->begin))) {
@@ -600,7 +600,7 @@ s_LocationCompareWindows(const void * vp1, const void *vp2)
 /**
  * A comparison routine used to sort a list of windows by position in
  * the subject, ignoring strand and frame. Ties are broken
- * deterministically. 
+ * deterministically.
  */
 static int
 s_SubjectCompareWindows(const void * vp1, const void *vp2)
@@ -728,14 +728,14 @@ s_WindowsFromTranslatedAligns(BlastCompo_Alignment * alignments,
     for (k = length_joined;  k < hspcnt;  k++) {
         windows[k] = NULL;
     }
- 
+
     /* for blastx, swap query and subject range */
-    if (!subject_is_translated) {   
+    if (!subject_is_translated) {
         for (k=0; k<length_joined; k++) {
             s_WindowSwapRange(windows[k]);
         }
     }
-            
+
     for (k = 0;  k < length_joined;  k++) {
         s_DistinctAlignmentsSort(&windows[k]->align, windows[k]->hspcnt);
     }
@@ -745,7 +745,7 @@ s_WindowsFromTranslatedAligns(BlastCompo_Alignment * alignments,
 
 error_return:
     for (k = 0; k < *nWindows; k++) {
-        if (windows[k] != NULL) 
+        if (windows[k] != NULL)
             s_WindowInfoFree(&windows[k]);
     }
     free(windows);
@@ -790,13 +790,13 @@ s_WindowsFromProteinAligns(BlastCompo_Alignment * alignments,
 
         if (windows[query_index] == NULL) {
             windows[query_index] =
-                s_WindowInfoNew(0, sequence_length, 0, 
+                s_WindowInfoNew(0, sequence_length, 0,
                                 0, query_length, query_index, NULL);
-            if (windows[query_index] == NULL) 
+            if (windows[query_index] == NULL)
                 goto error_return;
         }
         copiedAlign = s_AlignmentCopy(align);
-        if (copiedAlign == NULL) 
+        if (copiedAlign == NULL)
             goto error_return;
         copiedAlign->next = windows[query_index]->align;
         windows[query_index]->align = copiedAlign;
@@ -863,7 +863,7 @@ s_WindowsFromAligns(BlastCompo_Alignment * alignments,
                 BlastCompo_QueryInfo * query_info, int hspcnt,
                 int numQueries, int border, int sequence_length,
                 s_WindowInfo ***pwindows, int * nWindows,
-                int query_is_translated, int subject_is_translated) 
+                int query_is_translated, int subject_is_translated)
 {
     if (subject_is_translated || query_is_translated) {
         return s_WindowsFromTranslatedAligns(alignments, query_info,
@@ -909,13 +909,13 @@ s_GetComposition(Blast_AminoAcidComposition * composition,
 
     data = seq->data;
     length = range->end - range->begin;
-   
+
     if (query_is_translated || subject_is_translated) {
-        int start;  
-        int end; 
-        start = ((query_is_translated) ?  
+        int start;
+        int end;
+        start = ((query_is_translated) ?
                  align->queryStart : align->matchStart) - range->begin;
-        end   = ((query_is_translated) ?  
+        end   = ((query_is_translated) ?
                  align->queryEnd   : align->matchEnd  ) - range->begin;
         Blast_GetCompositionRange(&left, &right, data, length, start, end);
     } else {
@@ -1101,6 +1101,7 @@ Blast_RedoOneMatch(BlastCompo_Alignment ** alignments,
                    double *LambdaRatio)
 {
     int status = 0;                  /* return status */
+
     s_WindowInfo **windows;      /* array of windows */
     int nWindows;                    /* length of windows */
     int window_index;                /* loop index */
@@ -1122,9 +1123,9 @@ Blast_RedoOneMatch(BlastCompo_Alignment ** alignments,
         alignments[query_index] = NULL;
     }
     status =
-        s_WindowsFromAligns(incoming_aligns, query_info, hspcnt, numQueries,
-                            kWindowBorder, matchingSeq->length, &windows,
-                            &nWindows, query_is_translated, subject_is_translated);
+            s_WindowsFromAligns(incoming_aligns, query_info, hspcnt, numQueries,
+                    kWindowBorder, matchingSeq->length, &windows,
+                    &nWindows, query_is_translated, subject_is_translated);
     if (status != 0) {
         goto function_level_cleanup;
     }
@@ -1135,9 +1136,9 @@ Blast_RedoOneMatch(BlastCompo_Alignment ** alignments,
         int hsp_index;               /* index of the current alignment */
         /* data for the current window */
         BlastCompo_SequenceData subject = {0,};
-        BlastCompo_SequenceData query = {0,}; 
+        BlastCompo_SequenceData query = {0,};
         /* the composition of this query */
-        Blast_AminoAcidComposition * query_composition;  
+        Blast_AminoAcidComposition * query_composition;
         Boolean nearIdenticalStatus = TRUE; /* are query and subject nearly
                                                identical in the aligned part?*/
         Boolean oldNearIdenticalStatus = FALSE; /* were query and subject nearly
@@ -1160,41 +1161,44 @@ Blast_RedoOneMatch(BlastCompo_Alignment ** alignments,
 
         /* for all alignments in this window */
         for (in_align = window->align, hsp_index = 0;
-             in_align != NULL;
-             in_align = in_align->next, hsp_index++) {
+                in_align != NULL;
+                in_align = in_align->next, hsp_index++) {
 
 
             /* if the fist HSP for the pair or subject may have biased
                segments; if the subject is not biased, then segging is not
                necessary so we do not have to check for near identical status */
             if (hsp_index == 0 || subject_maybe_biased) {
-
-                nearIdenticalStatus = s_preliminaryTestNearIdentical(query_info,  
-                                             window,
-                                             in_align,
-                                             params->near_identical_cutoff);
+                nearIdenticalStatus = s_preliminaryTestNearIdentical(query_info,
+                        window,
+                        in_align,
+                        params->near_identical_cutoff);
             }
 
             /* if the first HSP for the pair or subject may have biased
                segments and near identical status is different than for the
                previous HSP */
             if (hsp_index == 0 ||
-                (subject_maybe_biased &&
-                 (nearIdenticalStatus != oldNearIdenticalStatus))) {
- 
+                    (subject_maybe_biased &&
+                            (nearIdenticalStatus != oldNearIdenticalStatus))) {
+
                 /* release previously allocated sequence data */
                 s_SequenceDataRelease(&subject);
                 s_SequenceDataRelease(&query);
-                status =
-                    callbacks->get_range(matchingSeq, &window->subject_range,
-                                 &subject, 
-                                 &query_info[query_index].seq,
-                                 &window->query_range,
-                                 &query,
-                                 query_info[query_index].words,
-                                 window->align, nearIdenticalStatus,
-                                 compo_adjust_mode, FALSE,
-                                 &subject_maybe_biased);
+                status = callbacks->get_range(
+                        matchingSeq,
+                        &window->subject_range,
+                        &subject,
+                        &query_info[query_index].seq,
+                        &window->query_range,
+                        &query,
+                        query_info[query_index].words,
+                        window->align,
+                        nearIdenticalStatus,
+                        compo_adjust_mode,
+                        FALSE,
+                        &subject_maybe_biased
+                );
 
                 if (status != 0) {
                     goto window_index_loop_cleanup;
@@ -1204,9 +1208,9 @@ Blast_RedoOneMatch(BlastCompo_Alignment ** alignments,
             /* do frequency count for partial translated query */
             if (query_is_translated) {
                 s_GetComposition(query_composition,
-                                        alphsize, &query,
-                                        &window->query_range,
-                                        in_align, TRUE, FALSE);
+                        alphsize, &query,
+                        &window->query_range,
+                        in_align, TRUE, FALSE);
             }
             /* if in_align is not contained in a higher-scoring
              * alignment */
@@ -1216,25 +1220,25 @@ Blast_RedoOneMatch(BlastCompo_Alignment ** alignments,
                  * is called and returns a nonzero value */
                 int adjust_search_failed = 0;
                 if (compo_adjust_mode != eNoCompositionBasedStats &&
-                    (subject_is_translated || hsp_index == 0
-                     || (nearIdenticalStatus != oldNearIdenticalStatus))) {
+                        (subject_is_translated || hsp_index == 0
+                                || (nearIdenticalStatus != oldNearIdenticalStatus))) {
                     Blast_AminoAcidComposition subject_composition;
                     s_GetComposition(&subject_composition,
-                                            alphsize, &subject,
-                                            &window->subject_range,
-                                            in_align, FALSE, subject_is_translated);
+                            alphsize, &subject,
+                            &window->subject_range,
+                            in_align, FALSE, subject_is_translated);
                     adjust_search_failed =
-                        Blast_AdjustScores(matrix, query_composition,
-                                           query.length,
-                                           &subject_composition,
-                                           subject.length,
-                                           scaledMatrixInfo, compo_adjust_mode,
-                                           RE_pseudocounts, NRrecord,
-                                           &matrix_adjust_rule,
-                                           callbacks->calc_lambda,
-                                           pvalueForThisPair,
-                                           compositionTestIndex,
-                                           LambdaRatio);
+                            Blast_AdjustScores(matrix, query_composition,
+                                    query.length,
+                                    &subject_composition,
+                                    subject.length,
+                                    scaledMatrixInfo, compo_adjust_mode,
+                                    RE_pseudocounts, NRrecord,
+                                    &matrix_adjust_rule,
+                                    callbacks->calc_lambda,
+                                    pvalueForThisPair,
+                                    compositionTestIndex,
+                                    LambdaRatio);
                     if (adjust_search_failed < 0) { /* fatal error */
                         status = adjust_search_failed;
                         goto window_index_loop_cleanup;
@@ -1242,48 +1246,53 @@ Blast_RedoOneMatch(BlastCompo_Alignment ** alignments,
                     num_adjustments++;
                 }
 
+                // By this point there's a discrepancy in
+                //  gapping_params->context->gap_align->sbp->matrix->data
                 if ( !adjust_search_failed ) {
-                    newAlign =
-                        callbacks->
-                        redo_one_alignment(in_align, matrix_adjust_rule,
-                                           &query, &window->query_range,
-                                           ccat_query_length,
-                                           &subject, &window->subject_range,
-                                           matchingSeq->length,
-                                           gapping_params);
+                    newAlign = callbacks->redo_one_alignment(
+                            in_align,
+                            matrix_adjust_rule,
+                            &query,
+                            &window->query_range,
+                            ccat_query_length,
+                            &subject,
+                            &window->subject_range,
+                            matchingSeq->length,
+                            gapping_params
+                    );
                     if (newAlign && newAlign->score >= params->cutoff_s) {
                         s_WithDistinctEnds(&newAlign, &alignments[query_index],
-                                           callbacks->free_align_traceback,
-                                           num_adjustments == 1);
+                                callbacks->free_align_traceback,
+                                num_adjustments == 1);
                     } else {
                         BlastCompo_AlignmentsFree(&newAlign,
-                                                  callbacks->
-                                                  free_align_traceback);
+                                callbacks->
+                                free_align_traceback);
                     }
                 }
             } /* end if in_align is not contained...*/
             oldNearIdenticalStatus = nearIdenticalStatus;
         } /* end for all alignments in this window */
-window_index_loop_cleanup:
+        window_index_loop_cleanup:
         if (subject.data != NULL)
             s_SequenceDataRelease(&subject);
         if (query.data != NULL)
             s_SequenceDataRelease(&query);
-        if (status != 0) 
+        if (status != 0)
             goto function_level_cleanup;
     } /* end for all windows */
-function_level_cleanup:
+    function_level_cleanup:
     if (status != 0) {
         for (query_index = 0;  query_index < numQueries;  query_index++) {
-            BlastCompo_AlignmentsFree(&alignments[query_index], 
-                                         callbacks->free_align_traceback);
+            BlastCompo_AlignmentsFree(&alignments[query_index],
+                    callbacks->free_align_traceback);
         }
     }
     for (window_index = 0;  window_index < nWindows;  window_index++) {
         s_WindowInfoFree(&windows[window_index]);
     }
     free(windows);
-    
+
     return status;
 }
 
@@ -1338,16 +1347,16 @@ Blast_RedoOneMatchSmithWaterman(BlastCompo_Alignment ** alignments,
         s_WindowsFromAligns(incoming_aligns, query_info, hspcnt, numQueries,
                             kWindowBorder, matchingSeq->length, &windows,
                             &nWindows, query_is_translated, subject_is_translated);
-    if (status != 0) 
+    if (status != 0)
         goto function_level_cleanup;
     /* We are performing a Smith-Waterman alignment */
     for (window_index = 0;  window_index < nWindows;  window_index++) {
         /* for all window */
         s_WindowInfo * window = NULL; /* the current window */
-        BlastCompo_SequenceData subject = {0,}; 
+        BlastCompo_SequenceData subject = {0,};
         /* subject data for this window */
         BlastCompo_SequenceData query = {0,};       /* query data for this window */
-        Blast_AminoAcidComposition * query_composition;  
+        Blast_AminoAcidComposition * query_composition;
         double searchsp;                  /* effective search space */
 	Boolean nearIdenticalStatus; /*are query and subject nearly
 				       identical in the aligned part?*/
@@ -1355,7 +1364,7 @@ Blast_RedoOneMatchSmithWaterman(BlastCompo_Alignment ** alignments,
          * is called and returns a nonzero value */
         int adjust_search_failed = FALSE;
 
-        
+
         window = windows[window_index];
         query_index = window->query_range.context;
         query_composition = &query_info[query_index].composition;
@@ -1367,7 +1376,7 @@ Blast_RedoOneMatchSmithWaterman(BlastCompo_Alignment ** alignments,
 
         status =
             callbacks->get_range(matchingSeq, &window->subject_range,
-                                 &subject, 
+                                 &subject,
                                  &query_info[query_index].seq,
                                  &window->query_range,
                                  &query,
@@ -1376,9 +1385,9 @@ Blast_RedoOneMatchSmithWaterman(BlastCompo_Alignment ** alignments,
                                  compo_adjust_mode, TRUE,
                                  NULL);
 
-        if (status != 0) 
+        if (status != 0)
             goto window_index_loop_cleanup;
-            
+
         /* do frequency count for partial translated query */
         if (query_is_translated) {
             s_GetComposition(query_composition,
@@ -1518,10 +1527,10 @@ window_index_loop_cleanup:
             s_SequenceDataRelease(&subject);
         if (query.data != NULL)
             s_SequenceDataRelease(&query);
-        if (status != 0) 
+        if (status != 0)
             goto function_level_cleanup;
     } /* end for all windows */
-    
+
 function_level_cleanup:
     if (status != 0) {
         for (query_index = 0;  query_index < numQueries;  query_index++) {
@@ -1533,7 +1542,7 @@ function_level_cleanup:
         s_WindowInfoFree(&windows[window_index]);
     }
     free(windows);
-    
+
     return status;
 }
 
diff --git a/c++/src/algo/blast/core/Makefile.blast.lib b/c++/src/algo/blast/core/Makefile.blast.lib
index e775ed8..574ebb9 100644
--- a/c++/src/algo/blast/core/Makefile.blast.lib
+++ b/c++/src/algo/blast/core/Makefile.blast.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.blast.lib 456453 2015-01-12 20:01:35Z fongah2 $
+# $Id: Makefile.blast.lib 498856 2016-04-20 11:37:59Z ivanov $
 
 SRC_C = aa_ungapped blast_diagnostics blast_engine blast_extend \
         blast_filter blast_gapalign blast_hits blast_hspstream blast_itree \
@@ -11,16 +11,15 @@ SRC_C = aa_ungapped blast_diagnostics blast_engine blast_extend \
         ncbi_std ncbi_math blast_encoding pattern phi_extend phi_gapalign \
         phi_lookup blast_parameters blast_posit blast_program blast_query_info \
         blast_tune blast_sw blast_dynarray split_query gencode_singleton \
-        index_ungapped blast_traceback_mt_priv blast_hspstream_mt_utils
+        index_ungapped blast_traceback_mt_priv blast_hspstream_mt_utils boost_erf
     
 SRC   = $(SRC_C)
 
 LIB = blast
 
 #CFLAGS  = $(FAST_CFLAGS)  -pedantic -std=c99 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wundef -Winline -Wno-parentheses
-CFLAGS  = $(FAST_CFLAGS)  
-LDFLAGS = $(FAST_LDFLAGS) 
-
+CFLAGS  = $(FAST_CFLAGS)
+LDFLAGS = $(FAST_LDFLAGS)
 
 WATCHERS = madden camacho fongah2
 
diff --git a/c++/src/algo/blast/core/Makefile.blast.lib.unix b/c++/src/algo/blast/core/Makefile.blast.lib.unix
index 47e5009..a279021 100644
--- a/c++/src/algo/blast/core/Makefile.blast.lib.unix
+++ b/c++/src/algo/blast/core/Makefile.blast.lib.unix
@@ -1,4 +1,4 @@
-# $Id: Makefile.blast.lib.unix 397378 2013-04-26 14:12:18Z ucko $
+# $Id: Makefile.blast.lib.unix 471833 2015-07-01 18:26:13Z ucko $
 
 # Adjust ICC flags to avoid problematic references to proprietary functions
 # or outright compilation errors.
@@ -9,6 +9,9 @@ ifeq "$(COMPILER)-$(DEBUG_SFX)" "icc-Release"
   $(CORE)blast_aalookup.o: $(CORE_SRCDIR)/$(CORE)blast_aalookup.c
 	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-pow $< -o $@ \
 	    $(CC_FILTER)
+  $(CORE)blast_filter.o: $(CORE_SRCDIR)/$(CORE)blast_filter.c
+	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-strcat $< -o $@ \
+	    $(CC_FILTER)
   $(CORE)blast_hits.o $(CORE)blast_parameters.o: %.o: $(CORE_SRCDIR)/%.c
 	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-exp -fno-builtin-log \
 	    $< -o $@ $(CC_FILTER)
@@ -23,7 +26,7 @@ ifeq "$(COMPILER)-$(DEBUG_SFX)" "icc-Release"
 	    $< -o $@ $(CC_FILTER)
   $(CORE)blast_stat.o: $(CORE_SRCDIR)/$(CORE)blast_stat.c
 	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-exp -fno-builtin-log \
-	    -fno-builtin-strtok $< -o $@ $(CC_FILTER)
+	    -fno-builtin-strncat -fno-builtin-strtok $< -o $@ $(CC_FILTER)
   $(CORE)ncbi_math.o: $(CORE_SRCDIR)/$(CORE)ncbi_math.c
 	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-exp -fno-builtin-log \
 	    -fno-builtin-sin $< -o $@ $(CC_FILTER)
diff --git a/c++/src/algo/blast/core/blast_engine.c b/c++/src/algo/blast/core/blast_engine.c
index 8516f2d..a3f0153 100644
--- a/c++/src/algo/blast/core/blast_engine.c
+++ b/c++/src/algo/blast/core/blast_engine.c
@@ -1,4 +1,4 @@
-/* $Id: blast_engine.c 484536 2015-11-12 16:04:07Z ivanov $
+/* $Id: blast_engine.c 500531 2016-05-05 14:28:38Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -55,7 +55,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_engine.c 484536 2015-11-12 16:04:07Z ivanov $";
+    "$Id: blast_engine.c 500531 2016-05-05 14:28:38Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/blast_engine.h>
@@ -83,9 +83,9 @@ static char const rcsid[] =
 #define CONV_NUCL2PROT_COORDINATES(length) (length) / CODON_LENGTH
 
 NCBI_XBLAST_EXPORT const int   kBlastMajorVersion = 2;
-NCBI_XBLAST_EXPORT const int   kBlastMinorVersion = 3;
+NCBI_XBLAST_EXPORT const int   kBlastMinorVersion = 4;
 NCBI_XBLAST_EXPORT const int   kBlastPatchVersion = 0;
-NCBI_XBLAST_EXPORT const char* kBlastReleaseDate = "12-17-2015";
+NCBI_XBLAST_EXPORT const char* kBlastReleaseDate = "June-01-2016";
 
 /** Structure to be passed to s_BlastSearchEngineCore, containing pointers 
     to various preallocated structures and arrays. */
diff --git a/c++/src/algo/blast/core/blast_gapalign.c b/c++/src/algo/blast/core/blast_gapalign.c
index a141735..ebce005 100644
--- a/c++/src/algo/blast/core/blast_gapalign.c
+++ b/c++/src/algo/blast/core/blast_gapalign.c
@@ -1,4 +1,4 @@
-/* $Id: blast_gapalign.c 474016 2015-07-24 13:27:16Z ivanov $
+/* $Id: blast_gapalign.c 473564 2015-07-21 15:29:04Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_gapalign.c 474016 2015-07-24 13:27:16Z ivanov $";
+    "$Id: blast_gapalign.c 473564 2015-07-21 15:29:04Z madden $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/ncbi_math.h>
diff --git a/c++/src/algo/blast/core/blast_hits.c b/c++/src/algo/blast/core/blast_hits.c
index 79de6ab..2cf91cc 100644
--- a/c++/src/algo/blast/core/blast_hits.c
+++ b/c++/src/algo/blast/core/blast_hits.c
@@ -1,4 +1,4 @@
-/* $Id: blast_hits.c 461277 2015-03-09 14:02:47Z madden $
+/* $Id: blast_hits.c 500444 2016-05-04 17:46:06Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,8 +31,8 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = 
-    "$Id: blast_hits.c 461277 2015-03-09 14:02:47Z madden $";
+static char const rcsid[] =
+    "$Id: blast_hits.c 500444 2016-05-04 17:46:06Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/ncbi_math.h>
@@ -54,7 +54,7 @@ Int2 SBlastHitsParametersNew(const BlastHitSavingOptions* hit_options,
        *retval = NULL;
 
        if (hit_options == NULL ||
-           ext_options == NULL || 
+           ext_options == NULL ||
            scoring_options == NULL)
            return 1;
 
@@ -64,9 +64,9 @@ Int2 SBlastHitsParametersNew(const BlastHitSavingOptions* hit_options,
 
        prelim_hitlist_size = hit_options->hitlist_size;
        if (ext_options->compositionBasedStats)
-            prelim_hitlist_size = prelim_hitlist_size * 2 + 50;  
+            prelim_hitlist_size = prelim_hitlist_size * 2 + 50;
        else if (scoring_options->gapped_calculation)
-            prelim_hitlist_size = MIN(2 * prelim_hitlist_size, 
+            prelim_hitlist_size = MIN(2 * prelim_hitlist_size,
                                       prelim_hitlist_size + 50);
 
        (*retval)->prelim_hitlist_size = MAX(prelim_hitlist_size, 10);
@@ -76,7 +76,7 @@ Int2 SBlastHitsParametersNew(const BlastHitSavingOptions* hit_options,
        return 0;
 }
 
-SBlastHitsParameters* 
+SBlastHitsParameters*
 SBlastHitsParametersDup(const SBlastHitsParameters* hit_params)
 {
     SBlastHitsParameters* retval = (SBlastHitsParameters*)
@@ -126,10 +126,10 @@ BlastHSP* Blast_HSPNew(void)
    Comments in blast_hits.h
 */
 Int2
-Blast_HSPInit(Int4 query_start, Int4 query_end, Int4 subject_start, 
-              Int4 subject_end, Int4 query_gapped_start, 
-              Int4 subject_gapped_start, Int4 query_context, 
-              Int2 query_frame, Int2 subject_frame, Int4 score, 
+Blast_HSPInit(Int4 query_start, Int4 query_end, Int4 subject_start,
+              Int4 subject_end, Int4 query_gapped_start,
+              Int4 subject_gapped_start, Int4 query_context,
+              Int2 query_frame, Int2 subject_frame, Int4 score,
               GapEditScript* *gap_edit, BlastHSP* *ret_hsp)
 {
    BlastHSP* new_hsp = NULL;
@@ -188,16 +188,16 @@ Int4 BlastHspNumMax(Boolean gapped_calculation, const BlastHitSavingOptions* opt
  * @param hsp Original HSP [in]
  * @return New HSP, copied from the original.
  */
-static BlastHSP* 
+static BlastHSP*
 s_BlastHSPCopy(const BlastHSP* hsp)
 {
     BlastHSP* new_hsp = NULL;
-    /* Do not pass the edit script, because we don't want to tranfer 
+    /* Do not pass the edit script, because we don't want to tranfer
        ownership. */
-    Blast_HSPInit(hsp->query.offset, hsp->query.end, hsp->subject.offset, 
-                  hsp->subject.end, hsp->query.gapped_start, 
-                  hsp->subject.gapped_start, hsp->context, 
-                  hsp->query.frame, hsp->subject.frame, hsp->score, 
+    Blast_HSPInit(hsp->query.offset, hsp->query.end, hsp->subject.offset,
+                  hsp->subject.end, hsp->query.gapped_start,
+                  hsp->subject.gapped_start, hsp->context,
+                  hsp->query.frame, hsp->subject.frame, hsp->score,
                   NULL, &new_hsp);
     new_hsp->evalue = hsp->evalue;
     new_hsp->num = hsp->num;
@@ -210,14 +210,14 @@ s_BlastHSPCopy(const BlastHSP* hsp)
 
     if (hsp->pat_info) {
         /* Copy this HSP's pattern data. */
-        new_hsp->pat_info = 
+        new_hsp->pat_info =
             (SPHIHspInfo*) BlastMemDup(hsp->pat_info, sizeof(SPHIHspInfo));
     }
     return new_hsp;
 }
 
 /** Count the number of occurrences of pattern in sequence, which
- * do not overlap by more than half the pattern match length. 
+ * do not overlap by more than half the pattern match length.
  * @param query_info Query information structure, containing pattern info. [in]
  */
 Int4
@@ -259,14 +259,14 @@ PhiBlastGetEffectiveNumberOfPatterns(const BlastQueryInfo *query_info)
  * @param query_info Structure containing information about pattern counts [in]
  * @param pattern_blk Structure containing counts of PHI pattern hits [in]
  */
-static void 
-s_HSPPHIGetEvalue(BlastHSP* hsp, BlastScoreBlk* sbp, 
+static void
+s_HSPPHIGetEvalue(BlastHSP* hsp, BlastScoreBlk* sbp,
                   const BlastQueryInfo* query_info,
                   const SPHIPatternSearchBlk* pattern_blk)
 {
    double paramC;
    double Lambda;
-  
+
    ASSERT(query_info && hsp && sbp && pattern_blk);
 
    paramC = sbp->kbp[0]->paramC;
@@ -279,7 +279,7 @@ s_HSPPHIGetEvalue(BlastHSP* hsp, BlastScoreBlk* sbp,
                 exp(-Lambda*hsp->score);
 }
 
-/** Update HSP data after reevaluation with ambiguities. In particular this 
+/** Update HSP data after reevaluation with ambiguities. In particular this
  * function calculates number of identities and checks if the percent identity
  * criterion is satisfied.
  * @param hsp HSP to update [in] [out]
@@ -294,7 +294,7 @@ s_HSPPHIGetEvalue(BlastHSP* hsp, BlastScoreBlk* sbp,
  * @param best_s_end Pointer to end of the new alignment in subject [in]
  * @param best_start_esp_index index of the edit script array where the new alignment
  *                       starts. [in]
- * @param best_end_esp_index index in the edit script array where the new alignment 
+ * @param best_end_esp_index index in the edit script array where the new alignment
  *                     ends. [in]
  * @param best_end_esp_num Number of edit operations in the last edit script,
  *                         that are included in the alignment. [in]
@@ -303,9 +303,9 @@ s_HSPPHIGetEvalue(BlastHSP* hsp, BlastScoreBlk* sbp,
 static Boolean
 s_UpdateReevaluatedHSP(BlastHSP* hsp, Boolean gapped,
                        Int4 cutoff_score,
-                       Int4 score, const Uint1* query_start, const Uint1* subject_start, 
-                       const Uint1* best_q_start, const Uint1* best_q_end, 
-                       const Uint1* best_s_start, const Uint1* best_s_end, 
+                       Int4 score, const Uint1* query_start, const Uint1* subject_start,
+                       const Uint1* best_q_start, const Uint1* best_q_end,
+                       const Uint1* best_s_start, const Uint1* best_s_end,
                        int best_start_esp_index,
                        int best_end_esp_index,
                        int best_end_esp_num)
@@ -339,12 +339,12 @@ s_UpdateReevaluatedHSP(BlastHSP* hsp, Boolean gapped,
 
     return delete_hsp;
 }
-                               
-Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp, 
+
+Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
            const Uint1* q, const Int4 qlen,
            const Uint1* s, const Int4 slen,
-           const BlastHitSavingParameters* hit_params, 
-           const BlastScoringParameters* score_params, 
+           const BlastHitSavingParameters* hit_params,
+           const BlastScoringParameters* score_params,
            const BlastScoreBlk* sbp)
 {
    Int4 sum, score, gap_open, gap_extend;
@@ -361,11 +361,11 @@ Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
    const Uint1* best_s_start; /* Start of the best scoring part in subject. */
    const Uint1* best_q_end;   /* End of the best scoring part in query. */
    const Uint1* best_s_end;   /* End of the best scoring part in subject. */
-   
 
-   const Uint1* current_q_start; /* Start of the current part of the alignment in 
+
+   const Uint1* current_q_start; /* Start of the current part of the alignment in
                            query. */
-   const Uint1* current_s_start; /* Start of the current part of the alignment in 
+   const Uint1* current_s_start; /* Start of the current part of the alignment in
                            subject. */
 
    const Uint1* query,* subject;
@@ -376,20 +376,20 @@ Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
 
    matrix = sbp->matrix->data;
 
-   /* For a non-affine greedy case, calculate the real value of the gap 
+   /* For a non-affine greedy case, calculate the real value of the gap
       extension penalty. Multiply all scores by 2 if it is not integer. */
    if (score_params->gap_open == 0 && score_params->gap_extend == 0) {
-      if (score_params->reward % 2 == 1) 
+      if (score_params->reward % 2 == 1)
          factor = 2;
       gap_open = 0;
-      gap_extend = 
+      gap_extend =
          (score_params->reward - 2*score_params->penalty) * factor / 2;
    } else {
       gap_open = score_params->gap_open;
       gap_extend = score_params->gap_extend;
    }
 
-   query = q + hsp->query.offset; 
+   query = q + hsp->query.offset;
    subject = s + hsp->subject.offset;
    score = 0;
    sum = 0;
@@ -398,7 +398,7 @@ Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
    best_q_start = best_q_end = current_q_start = query;
    best_s_start = best_s_end = current_s_start = subject;
    /* There are no previous edit scripts at the beginning. */
-   
+
    best_end_esp_num = -1;
    esp = hsp->gap_info;
    if (!esp) return TRUE;
@@ -422,7 +422,7 @@ Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
               query += esp->num[index];
               op_index += esp->num[index];
           }
-      
+
           if (sum < 0) {
            /* Point current edit script chain start to the new place.
               If we are in the middle of an edit script, reduce its length and
@@ -449,8 +449,8 @@ Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
                   /* Start from new offset; discard all previous information. */
                   best_q_start = query;
                   best_s_start = subject;
-                  score = 0; 
-               
+                  score = 0;
+
                   /* Set best start and end edit script pointers to new start. */
                   best_start_esp_index = current_start_esp_index;
                   best_end_esp_index = current_start_esp_index;
@@ -460,19 +460,19 @@ Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
               /* Remember this point as the best scoring end point, and the current
               start of the alignment as the start of the best alignment. */
               score = sum;
-           
+
               best_q_start = current_q_start;
               best_s_start = current_s_start;
               best_q_end = query;
               best_s_end = subject;
-           
+
               best_start_esp_index = current_start_esp_index;
               best_end_esp_index = index;
               best_end_esp_num = op_index;
           }
        }
    } /* loop on edit scripts */
-   
+
    score /= factor;
 
    if (best_start_esp_index < esp->size && best_end_esp_index < esp->size) {
@@ -500,12 +500,12 @@ Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
       best_end_esp_num += ext;
       score += ext * score_params->reward;
    }
-   
+
    /* Update HSP data. */
    return
        s_UpdateReevaluatedHSP(hsp, TRUE, cutoff_score,
-                              score, q, s, best_q_start, 
-                              best_q_end, best_s_start, best_s_end, 
+                              score, q, s, best_q_start,
+                              best_q_end, best_s_start, best_s_end,
                               best_start_esp_index, best_end_esp_index,
                               best_end_esp_num);
 }
@@ -525,19 +525,19 @@ Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP* hsp,
  * @return TRUE if HSP is scheduled to be deleted.
  */
 static Boolean
-s_UpdateReevaluatedHSPUngapped(BlastHSP* hsp, Int4 cutoff_score, Int4 score, 
-                               const Uint1* query_start, const Uint1* subject_start, 
-                               const Uint1* best_q_start, const Uint1* best_q_end, 
+s_UpdateReevaluatedHSPUngapped(BlastHSP* hsp, Int4 cutoff_score, Int4 score,
+                               const Uint1* query_start, const Uint1* subject_start,
+                               const Uint1* best_q_start, const Uint1* best_q_end,
                                const Uint1* best_s_start, const Uint1* best_s_end)
 {
     return
-        s_UpdateReevaluatedHSP(hsp, FALSE, cutoff_score, score, query_start, 
-                               subject_start, best_q_start, best_q_end, 
+        s_UpdateReevaluatedHSP(hsp, FALSE, cutoff_score, score, query_start,
+                               subject_start, best_q_start, best_q_end,
                                best_s_start, best_s_end, 0, 0, 0);
 }
 
-Boolean 
-Blast_HSPReevaluateWithAmbiguitiesUngapped(BlastHSP* hsp, const Uint1* query_start, 
+Boolean
+Blast_HSPReevaluateWithAmbiguitiesUngapped(BlastHSP* hsp, const Uint1* query_start,
    const Uint1* subject_start, const BlastInitialWordParameters* word_params,
    BlastScoreBlk* sbp, Boolean translated)
 {
@@ -553,14 +553,14 @@ Blast_HSPReevaluateWithAmbiguitiesUngapped(BlastHSP* hsp, const Uint1* query_sta
 
    matrix = sbp->matrix->data;
 
-   query = query_start + hsp->query.offset; 
+   query = query_start + hsp->query.offset;
    subject = subject_start + hsp->subject.offset;
    score = 0;
    sum = 0;
    best_q_start = best_q_end = current_q_start = query;
    best_s_start = best_s_end = current_s_start = subject;
    index = 0;
-   
+
    for (index = 0; index < hsp_length; ++index) {
       sum += matrix[*query & kResidueMask][*subject];
       query++;
@@ -571,7 +571,7 @@ Blast_HSPReevaluateWithAmbiguitiesUngapped(BlastHSP* hsp, const Uint1* query_sta
           current_q_start = query;
           current_s_start = subject;
           /* If previous top score never reached the cutoff, discard the front
-             part of the alignment completely. Otherwise keep pointer to the 
+             part of the alignment completely. Otherwise keep pointer to the
              top-scoring front part. */
          if (score < cutoff_score) {
             best_q_start = best_q_end = query;
@@ -583,7 +583,7 @@ Blast_HSPReevaluateWithAmbiguitiesUngapped(BlastHSP* hsp, const Uint1* query_sta
          score = sum;
          best_q_end = query;
          best_s_end = subject;
-         /* Set start of alignment to the current start, dismissing the 
+         /* Set start of alignment to the current start, dismissing the
             previous top-scoring piece. */
          best_q_start = current_q_start;
          best_s_start = current_s_start;
@@ -595,7 +595,7 @@ Blast_HSPReevaluateWithAmbiguitiesUngapped(BlastHSP* hsp, const Uint1* query_sta
        s_UpdateReevaluatedHSPUngapped(hsp, cutoff_score, score,
                                       query_start, subject_start, best_q_start,
                                       best_q_end, best_s_start, best_s_end);
-} 
+}
 
 /** Calculate number of identities in a regular HSP.
  * @param query The query sequence [in]
@@ -643,7 +643,7 @@ s_Blast_HSPGetNumIdentitiesAndPositives(const Uint1* query, const Uint1* subject
          then count number of matches. */
       if (q_length != s_length)
          return -1;
-      align_length = q_length; 
+      align_length = q_length;
       for (i=0; i<align_length; i++) {
          if (*q == *s)
             num_ident++;
@@ -681,7 +681,7 @@ s_Blast_HSPGetNumIdentitiesAndPositives(const Uint1* query, const Uint1* subject
          case eGapAlignIns:
             q += esp->num[index];
             break;
-         default: 
+         default:
             s += esp->num[index];
             q += esp->num[index];
             break;
@@ -783,7 +783,7 @@ s_Blast_HSPGetOOFNumIdentitiesAndPositives(
       case eGapAlignIns2: /* Insertion of two nucleotides. */
          s += 2;
          break;
-      default: 
+      default:
          s += esp->num[index] * CODON_LENGTH;
          q += esp->num[index];
          break;
@@ -866,8 +866,8 @@ static Boolean s_HSPTest(const BlastHSP* hsp,
 }
 
 Boolean
-Blast_HSPTestIdentityAndLength(EBlastProgramType program_number, 
-                               BlastHSP* hsp, const Uint1* query, const Uint1* subject, 
+Blast_HSPTestIdentityAndLength(EBlastProgramType program_number,
+                               BlastHSP* hsp, const Uint1* query, const Uint1* subject,
                                const BlastScoringOptions* score_options,
                                const BlastHitSavingOptions* hit_options)
 {
@@ -882,7 +882,7 @@ Blast_HSPTestIdentityAndLength(EBlastProgramType program_number,
    ASSERT(status == 0);
    (void)status;    /* to pacify compiler warning */
 
-   /* Check whether this HSP passes the percent identity and minimal hit 
+   /* Check whether this HSP passes the percent identity and minimal hit
       length criteria, and delete it if it does not. */
    delete_hsp = s_HSPTest(hsp, hit_options, align_length);
 
@@ -916,7 +916,7 @@ Boolean Blast_HSPQueryCoverageTest(BlastHSP* hsp,
 }
 
 
-void 
+void
 Blast_HSPCalcLengthAndGaps(const BlastHSP* hsp, Int4* length_out,
                            Int4* gaps_out, Int4* gap_opens_out)
 {
@@ -949,13 +949,13 @@ Blast_HSPCalcLengthAndGaps(const BlastHSP* hsp, Int4* length_out,
 /** Adjust start and end of an HSP in a translated sequence segment.
  * @param segment BlastSeg structure (part of BlastHSP) [in]
  * @param seq_length Length of the full sequence [in]
- * @param start Start of the alignment in this segment in nucleotide 
+ * @param start Start of the alignment in this segment in nucleotide
  *              coordinates, 1-offset [out]
- * @param end End of the alignment in this segment in nucleotide 
+ * @param end End of the alignment in this segment in nucleotide
  *            coordinates, 1-offset [out]
  */
-static void 
-s_BlastSegGetTranslatedOffsets(const BlastSeg* segment, Int4 seq_length, 
+static void
+s_BlastSegGetTranslatedOffsets(const BlastSeg* segment, Int4 seq_length,
                               Int4* start, Int4* end)
 {
    if (segment->frame < 0)	{
@@ -970,8 +970,8 @@ s_BlastSegGetTranslatedOffsets(const BlastSeg* segment, Int4 seq_length,
    }
 }
 
-void 
-Blast_HSPGetAdjustedOffsets(EBlastProgramType program, BlastHSP* hsp, 
+void
+Blast_HSPGetAdjustedOffsets(EBlastProgramType program, BlastHSP* hsp,
                             Int4 query_length, Int4 subject_length,
                             Int4* q_start, Int4* q_end,
                             Int4* s_start, Int4* s_end)
@@ -987,7 +987,7 @@ Blast_HSPGetAdjustedOffsets(EBlastProgramType program, BlastHSP* hsp,
    if (!Blast_QueryIsTranslated(program) &&
        !Blast_SubjectIsTranslated(program)) {
       if (hsp->query.frame != hsp->subject.frame) {
-         /* Blastn: if different strands, flip offsets in query; leave 
+         /* Blastn: if different strands, flip offsets in query; leave
             offsets in subject as they are, but change order for correct
             correspondence. */
          *q_end = query_length - hsp->query.offset;
@@ -1002,13 +1002,13 @@ Blast_HSPGetAdjustedOffsets(EBlastProgramType program, BlastHSP* hsp,
       }
    } else {
       s_BlastSegGetTranslatedOffsets(&hsp->query, query_length, q_start, q_end);
-      s_BlastSegGetTranslatedOffsets(&hsp->subject, subject_length, 
+      s_BlastSegGetTranslatedOffsets(&hsp->subject, subject_length,
                                     q_start, s_end);
    }
 }
 
 
-const Uint1* 
+const Uint1*
 Blast_HSPGetTargetTranslation(SBlastTargetTranslation* target_t,
                               const BlastHSP* hsp, Int4* translated_length)
 {
@@ -1025,9 +1025,9 @@ Blast_HSPGetTargetTranslation(SBlastTargetTranslation* target_t,
     stop = target_t->range[2*context+1];
 
     /* skip translation if full translation has already been done */
-    if (target_t->partial && (start || 
-        (stop < target_t->subject_blk->length / CODON_LENGTH -3))) 
-    {  
+    if (target_t->partial && (start ||
+        (stop < target_t->subject_blk->length / CODON_LENGTH -3)))
+    {
     	 const int kMaxTranslation = 2100; /* Needs to be divisible by three (?) */
          Int4 nucl_length = 0;
          Int4 translation_length = 0;
@@ -1079,7 +1079,7 @@ Blast_HSPGetTargetTranslation(SBlastTargetTranslation* target_t,
                }
 
                length = BLAST_GetTranslation(nucl_seq, nucl_seq_rev,
-                       nucl_length, hsp->subject.frame, target_t->translations[context], 
+                       nucl_length, hsp->subject.frame, target_t->translations[context],
                        target_t->gen_code_string);
 
                target_t->range[2*context+1] = start_shift + length;
@@ -1101,12 +1101,12 @@ Blast_HSPGetTargetTranslation(SBlastTargetTranslation* target_t,
 }
 
 Int2
-Blast_HSPGetPartialSubjectTranslation(BLAST_SequenceBlk* subject_blk, 
+Blast_HSPGetPartialSubjectTranslation(BLAST_SequenceBlk* subject_blk,
                                       BlastHSP* hsp,
-                                      Boolean is_ooframe, 
-                                      const Uint1* gen_code_string, 
+                                      Boolean is_ooframe,
+                                      const Uint1* gen_code_string,
                                       Uint1** translation_buffer_ptr,
-                                      Uint1** subject_ptr, 
+                                      Uint1** subject_ptr,
                                       Int4* subject_length_ptr,
                                       Int4* start_shift_ptr)
 {
@@ -1124,10 +1124,10 @@ Blast_HSPGetPartialSubjectTranslation(BLAST_SequenceBlk* subject_blk,
    sfree(translation_buffer);
 
    if (!is_ooframe) {
-      start_shift = 
+      start_shift =
          MAX(0, 3*hsp->subject.offset - MAX_FULL_TRANSLATION);
       translation_length =
-         MIN(3*hsp->subject.end + MAX_FULL_TRANSLATION, 
+         MIN(3*hsp->subject.end + MAX_FULL_TRANSLATION,
              subject_blk->length) - start_shift;
       if (hsp->subject.frame > 0) {
          nucl_shift = start_shift;
@@ -1135,9 +1135,9 @@ Blast_HSPGetPartialSubjectTranslation(BLAST_SequenceBlk* subject_blk,
          nucl_shift = subject_blk->length - start_shift - translation_length;
       }
       status = (Int2)
-         Blast_GetPartialTranslation(subject_blk->sequence_start+nucl_shift, 
+         Blast_GetPartialTranslation(subject_blk->sequence_start+nucl_shift,
                                      translation_length, hsp->subject.frame,
-                                     gen_code_string, &translation_buffer, 
+                                     gen_code_string, &translation_buffer,
                                      subject_length_ptr, NULL);
       /* Below, the start_shift will be used for the protein
          coordinates, so need to divide it by 3 */
@@ -1145,8 +1145,8 @@ Blast_HSPGetPartialSubjectTranslation(BLAST_SequenceBlk* subject_blk,
    } else {
       Int4 oof_end;
       oof_end = subject_blk->length;
-      
-      start_shift = 
+
+      start_shift =
          MAX(0, hsp->subject.offset - MAX_FULL_TRANSLATION);
       translation_length =
          MIN(hsp->subject.end + MAX_FULL_TRANSLATION, oof_end) - start_shift;
@@ -1156,9 +1156,9 @@ Blast_HSPGetPartialSubjectTranslation(BLAST_SequenceBlk* subject_blk,
          nucl_shift = oof_end - start_shift - translation_length;
       }
       status = (Int2)
-         Blast_GetPartialTranslation(subject_blk->sequence_start+nucl_shift, 
-                                     translation_length, hsp->subject.frame, 
-                                     gen_code_string, NULL, 
+         Blast_GetPartialTranslation(subject_blk->sequence_start+nucl_shift,
+                                     translation_length, hsp->subject.frame,
+                                     gen_code_string, NULL,
                                      subject_length_ptr, &translation_buffer);
    }
    hsp->subject.offset -= start_shift;
@@ -1180,14 +1180,14 @@ Blast_HSPGetPartialSubjectTranslation(BLAST_SequenceBlk* subject_blk,
 void
 Blast_HSPAdjustSubjectOffset(BlastHSP* hsp, Int4 start_shift)
 {
-    /* Adjust subject offsets if shifted (partial) sequence was used 
+    /* Adjust subject offsets if shifted (partial) sequence was used
        for extension */
     if (start_shift > 0) {
         hsp->subject.offset += start_shift;
         hsp->subject.end += start_shift;
         hsp->subject.gapped_start += start_shift;
     }
-    
+
     return;
 }
 
@@ -1196,7 +1196,7 @@ ScoreCompareHSPs(const void* h1, const void* h2)
 {
    BlastHSP* hsp1,* hsp2;   /* the HSPs to be compared */
    int result = 0;      /* the result of the comparison */
-   
+
    hsp1 = *((BlastHSP**) h1);
    hsp2 = *((BlastHSP**) h2);
 
@@ -1220,15 +1220,15 @@ ScoreCompareHSPs(const void* h1, const void* h2)
    return result;
 }
 
-Boolean Blast_HSPListIsSortedByScore(const BlastHSPList* hsp_list) 
+Boolean Blast_HSPListIsSortedByScore(const BlastHSPList* hsp_list)
 {
     Int4 index;
-    
+
     if (!hsp_list || hsp_list->hspcnt <= 1)
         return TRUE;
 
     for (index = 0; index < hsp_list->hspcnt - 1; ++index) {
-        if (ScoreCompareHSPs(&hsp_list->hsp_array[index], 
+        if (ScoreCompareHSPs(&hsp_list->hsp_array[index],
                              &hsp_list->hsp_array[index+1]) > 0) {
             return FALSE;
         }
@@ -1247,32 +1247,32 @@ void Blast_HSPListSortByScore(BlastHSPList* hsp_list)
     }
 }
 
-/** Precision to which e-values are compared. */
-#define FUZZY_EVALUE_COMPARE_FACTOR 1e-6
-
-/** Compares 2 real numbers up to a fixed precision.
+/** Compares 2 evalues, consider them equal if both are close enough to zero.
  * @param evalue1 First evalue [in]
  * @param evalue2 Second evalue [in]
  */
-static int 
-s_FuzzyEvalueComp(double evalue1, double evalue2)
+static int
+s_EvalueComp(double evalue1, double evalue2)
 {
-   if (evalue1 < 1.0e-180 && evalue2 < 1.0e-180)
-	return 0;
+    const double epsilon = 1.0e-180;
+    if (evalue1 < epsilon && evalue2 < epsilon) {
+        return 0;
+    }
 
-   if (evalue1 < (1-FUZZY_EVALUE_COMPARE_FACTOR)*evalue2)
-      return -1;
-   else if (evalue1 > (1+FUZZY_EVALUE_COMPARE_FACTOR)*evalue2)
-      return 1;
-   else 
-      return 0;
+    if (evalue1 < evalue2) {
+        return -1;
+    } else if (evalue1 > evalue2) {
+        return 1;
+    } else {
+        return 0;
+    }
 }
 
 /** Comparison callback function for sorting HSPs by e-value and score, before
- * saving BlastHSPList in a BlastHitList. E-value has priority over score, 
+ * saving BlastHSPList in a BlastHitList. E-value has priority over score,
  * because lower scoring HSPs might have lower e-values, if they are linked
  * with sum statistics.
- * E-values are compared only up to a certain precision. 
+ * E-values are compared only up to a certain precision.
  * @param v1 Pointer to first HSP [in]
  * @param v2 Pointer to second HSP [in]
  */
@@ -1284,7 +1284,7 @@ s_EvalueCompareHSPs(const void* v1, const void* v2)
 
    h1 = *((BlastHSP**) v1);
    h2 = *((BlastHSP**) v2);
-   
+
    /* Check if one or both of these are null. Those HSPs should go to the end */
    if (!h1 && !h2)
       return 0;
@@ -1293,7 +1293,7 @@ s_EvalueCompareHSPs(const void* v1, const void* v2)
    else if (!h2)
       return -1;
 
-   if ((retval = s_FuzzyEvalueComp(h1->evalue, h2->evalue)) != 0)
+   if ((retval = s_EvalueComp(h1->evalue, h2->evalue)) != 0)
       return retval;
 
    return ScoreCompareHSPs(v1, v2);
@@ -1342,29 +1342,29 @@ s_HSPEndDiag(const BlastHSP *hsp)
     return hsp->query.end - hsp->subject.end;
 }
 
-/** Given two hits, check if the hits can be merged and do 
+/** Given two hits, check if the hits can be merged and do
  * the merge if so. Hits must not contain traceback
  * @param hsp1 The first hit. If merging happens, this hit is
  *             overwritten with the merged version [in][out]
  * @param hsp2 The second hit [in]
  * @return TRUE if a merge was performed, FALSE if not
  */
-static Boolean 
+static Boolean
 s_BlastMergeTwoHSPs(BlastHSP* hsp1, BlastHSP* hsp2, Boolean allow_gap)
 {
    ASSERT(!hsp1->gap_info || !hsp2->gap_info);
 
    /* do not merge off-diagonal hsps for ungapped search */
-   if (!allow_gap && 
-       hsp1->subject.offset - hsp2->subject.offset -hsp1->query.offset + hsp2->query.offset) 
-   {  
+   if (!allow_gap &&
+       hsp1->subject.offset - hsp2->subject.offset -hsp1->query.offset + hsp2->query.offset)
+   {
        return FALSE;
    }
 
    if(hsp1->subject.frame != hsp2->subject.frame)
 	   return FALSE;
 
-   /* combine the boundaries of the two HSPs, 
+   /* combine the boundaries of the two HSPs,
       assuming they intersect at all */
    if (CONTAINED_IN_HSP(hsp1->query.offset, hsp1->query.end,
                         hsp2->query.offset,
@@ -1375,6 +1375,9 @@ s_BlastMergeTwoHSPs(BlastHSP* hsp1, BlastHSP* hsp2, Boolean allow_gap)
                         hsp1->subject.offset, hsp1->subject.end,
                         hsp2->subject.end)) {
 
+	  double score_density =  (hsp1->score + hsp2->score) *(1.0) /
+			                  ((hsp1->query.end - hsp1->query.offset) +
+			                   (hsp2->query.end - hsp2->query.offset));
       hsp1->query.offset = MIN(hsp1->query.offset, hsp2->query.offset);
       hsp1->subject.offset = MIN(hsp1->subject.offset, hsp2->subject.offset);
       hsp1->query.end = MAX(hsp1->query.end, hsp2->query.end);
@@ -1382,16 +1385,18 @@ s_BlastMergeTwoHSPs(BlastHSP* hsp1, BlastHSP* hsp2, Boolean allow_gap)
       if (hsp2->score > hsp1->score) {
           hsp1->query.gapped_start = hsp2->query.gapped_start;
           hsp1->subject.gapped_start = hsp2->subject.gapped_start;
-          hsp1->score = hsp2->score;
+	  hsp1->score = hsp2->score;
       }
+
+      hsp1->score = MAX((int) (score_density *(hsp1->query.end - hsp1->query.offset)), hsp1->score);
       return TRUE;
    }
 
    return FALSE;
 }
 
-/** Maximal diagonal distance between HSP starting offsets, within which HSPs 
- * from search of different chunks of subject sequence are considered for 
+/** Maximal diagonal distance between HSP starting offsets, within which HSPs
+ * from search of different chunks of subject sequence are considered for
  * merging.
  */
 #define OVERLAP_DIAG_CLOSE 10
@@ -1420,15 +1425,15 @@ BlastHSPList* Blast_HSPListNew(Int4 hsp_max)
    BlastHSPList* hsp_list = (BlastHSPList*) calloc(1, sizeof(BlastHSPList));
    const Int4 kDefaultAllocated=100;
 
-   /* hsp_max is max number of HSP's allowed in an HSP list; 
+   /* hsp_max is max number of HSP's allowed in an HSP list;
       INT4_MAX taken as infinity. */
-   hsp_list->hsp_max = INT4_MAX; 
+   hsp_list->hsp_max = INT4_MAX;
    if (hsp_max > 0)
       hsp_list->hsp_max = hsp_max;
 
    hsp_list->allocated = MIN(kDefaultAllocated, hsp_list->hsp_max);
 
-   hsp_list->hsp_array = (BlastHSP**) 
+   hsp_list->hsp_array = (BlastHSP**)
       calloc(hsp_list->allocated, sizeof(BlastHSP*));
 
    return hsp_list;
@@ -1440,24 +1445,24 @@ Blast_HSPList_IsEmpty(const BlastHSPList* hsp_list)
     return (hsp_list && hsp_list->hspcnt == 0) ? TRUE : FALSE;
 }
 
-BlastHSPList* BlastHSPListDup(const BlastHSPList* hsp_list) 
+BlastHSPList* BlastHSPListDup(const BlastHSPList* hsp_list)
 {
     BlastHSPList * rv = 0;
-    
+
     if (hsp_list) {
         int index = 0;
         int num = hsp_list->hspcnt;
-        
+
         rv = malloc(sizeof(BlastHSPList));
         *rv = *hsp_list;
-        
+
         if (num) {
             rv->hsp_array = malloc(sizeof(BlastHSP*) * num);
-            
+
             for(index = 0; index < hsp_list->hspcnt; ++index) {
                 BlastHSP * h = hsp_list->hsp_array[index];
                 BlastHSP ** h2 = & rv->hsp_array[index];
-                
+
                 if (h) {
                     *h2 = malloc(sizeof(BlastHSP));
                     **h2 = *h;
@@ -1467,14 +1472,14 @@ BlastHSPList* BlastHSPListDup(const BlastHSPList* hsp_list)
             }
         }
     }
-    
+
     return rv;
 }
 
 void Blast_HSPListSwap(BlastHSPList* list1, BlastHSPList* list2)
 {
     BlastHSPList tmp;
-    
+
     tmp = *list1;
     *list1 = *list2;
     *list2 = tmp;
@@ -1489,7 +1494,7 @@ s_Heapify (char* base0, char* base, char* lim, char* last, size_t width, int (*c
    size_t i;
    char   ch;
    char* left_son,* large_son;
-   
+
    left_son = base0 + 2*(base-base0) + width;
    while (base <= lim) {
       if (left_son == last)
@@ -1516,17 +1521,17 @@ s_Heapify (char* base0, char* base, char* lim, char* last, size_t width, int (*c
  * @param width The size of each element [in]
  * @param compar Callback to compare two heap elements [in]
  */
-static void 
-s_CreateHeap (void* b, size_t nel, size_t width, 
-   int (*compar )(const void*, const void* ))   
+static void
+s_CreateHeap (void* b, size_t nel, size_t width,
+   int (*compar )(const void*, const void* ))
 {
    char*    base = (char*)b;
    size_t i;
    char*    base0 = (char*)base,* lim,* basef;
-   
+
    if (nel < 2)
       return;
-   
+
    lim = &base[((nel-2)/2)*width];
    basef = &base[(nel-1)*width];
    i = nel/2;
@@ -1536,15 +1541,15 @@ s_CreateHeap (void* b, size_t nel, size_t width,
    }
 }
 
-/** Given a BlastHSPList* with a heapified HSP array, check whether the 
- * new HSP is better than the worst scoring.  If it is, then remove the 
+/** Given a BlastHSPList* with a heapified HSP array, check whether the
+ * new HSP is better than the worst scoring.  If it is, then remove the
  * worst scoring and insert, otherwise free the new one.
- * HSP and insert the new HSP in the heap. 
+ * HSP and insert the new HSP in the heap.
  * @param hsp_list Contains all HSPs for a given subject. [in] [out]
  * @param hsp A pointer to new HSP to be inserted into the HSP list [in] [out]
  */
-static void 
-s_BlastHSPListInsertHSPInHeap(BlastHSPList* hsp_list, 
+static void
+s_BlastHSPListInsertHSPInHeap(BlastHSPList* hsp_list,
                              BlastHSP** hsp)
 {
     BlastHSP** hsp_array = hsp_list->hsp_array;
@@ -1558,7 +1563,7 @@ s_BlastHSPListInsertHSPInHeap(BlastHSPList* hsp_list,
 
     hsp_array[0] = *hsp;
     if (hsp_list->hspcnt >= 2) {
-        s_Heapify((char*)hsp_array, (char*)hsp_array, 
+        s_Heapify((char*)hsp_array, (char*)hsp_array,
                 (char*)&hsp_array[hsp_list->hspcnt/2 - 1],
                  (char*)&hsp_array[hsp_list->hspcnt-1],
                  sizeof(BlastHSP*), ScoreCompareHSPs);
@@ -1610,7 +1615,7 @@ s_BlastGetBestEvalue(const BlastHSPList* hsp_list)
 
 /* Comments in blast_hits.h
  */
-Int2 
+Int2
 Blast_HSPListSaveHSP(BlastHSPList* hsp_list, BlastHSP* new_hsp)
 {
    BlastHSP** hsp_array;
@@ -1621,7 +1626,7 @@ Blast_HSPListSaveHSP(BlastHSPList* hsp_list, BlastHSP* new_hsp)
    hspcnt = hsp_list->hspcnt;
    hsp_allocated = hsp_list->allocated;
    hsp_array = hsp_list->hsp_array;
-   
+
 
    /* Check if list is already full, then reallocate. */
    if (hspcnt >= hsp_allocated && hsp_list->do_not_reallocate == FALSE)
@@ -1632,7 +1637,7 @@ Blast_HSPListSaveHSP(BlastHSPList* hsp_list, BlastHSP* new_hsp)
             realloc(hsp_array, new_allocated*sizeof(BlastHSP*));
          if (hsp_array == NULL)
          {
-            hsp_list->do_not_reallocate = TRUE; 
+            hsp_list->do_not_reallocate = TRUE;
             hsp_array = hsp_list->hsp_array;
             /** Return a non-zero status, because restriction on number
                 of HSPs here is a result of memory allocation failure. */
@@ -1643,7 +1648,7 @@ Blast_HSPListSaveHSP(BlastHSPList* hsp_list, BlastHSP* new_hsp)
             hsp_allocated = new_allocated;
          }
       } else {
-         hsp_list->do_not_reallocate = TRUE; 
+         hsp_list->do_not_reallocate = TRUE;
       }
       /* If it is the first time when the HSP array is filled to capacity,
          create a heap now. */
@@ -1652,7 +1657,7 @@ Blast_HSPListSaveHSP(BlastHSPList* hsp_list, BlastHSP* new_hsp)
       }
    }
 
-   /* If there is space in the allocated HSP array, simply save the new HSP. 
+   /* If there is space in the allocated HSP array, simply save the new HSP.
       Othewise, if the new HSP has lower score than the worst HSP in the heap,
       then delete it, else insert it in the heap. */
    if (hspcnt < hsp_allocated)
@@ -1664,15 +1669,15 @@ Blast_HSPListSaveHSP(BlastHSPList* hsp_list, BlastHSP* new_hsp)
        /* Insert the new HSP in heap. */
        s_BlastHSPListInsertHSPInHeap(hsp_list, &new_hsp);
    }
-   
+
    return status;
 }
 
 Int2 Blast_HSPListGetEvalues(EBlastProgramType program_number,
                              const BlastQueryInfo* query_info,
                              Int4 subject_length,
-                             BlastHSPList* hsp_list, 
-                             Boolean gapped_calculation, 
+                             BlastHSPList* hsp_list,
+                             Boolean gapped_calculation,
                              Boolean RPS_prelim,
                              const BlastScoreBlk* sbp, double gap_decay_rate,
                              double scaling_factor)
@@ -1685,10 +1690,10 @@ Int2 Blast_HSPListGetEvalues(EBlastProgramType program_number,
    Int4 kbp_context;
    double gap_decay_divisor = 1.;
    Boolean isRPS = Blast_ProgramIsRpsBlast(program_number);
-   
+
    if (hsp_list == NULL || hsp_list->hspcnt == 0)
       return 0;
-   
+
    kbp = (gapped_calculation ? sbp->kbp_gap : sbp->kbp);
    hsp_cnt = hsp_list->hspcnt;
    hsp_array = hsp_list->hsp_array;
@@ -1703,7 +1708,7 @@ Int2 Blast_HSPListGetEvalues(EBlastProgramType program_number,
       ASSERT(scaling_factor != 0.0);
       ASSERT(sbp->round_down == FALSE || (hsp->score & 1) == 0);
 
-      /* Divide Lambda by the scaling factor, so e-value is 
+      /* Divide Lambda by the scaling factor, so e-value is
          calculated correctly from a scaled score. This is needed only
          for RPS BLAST, where scores are scaled, but Lambda is not. */
       kbp_context = hsp->context;
@@ -1723,20 +1728,20 @@ Int2 Blast_HSPListGetEvalues(EBlastProgramType program_number,
           /* Only try Spouge's method if gumbel parameters are available */
           if (!isRPS) {
               hsp->evalue =
-                  BLAST_SpougeStoE(hsp->score, kbp[kbp_context], sbp->gbp, 
-                               query_info->contexts[hsp->context].query_length, 
+                  BLAST_SpougeStoE(hsp->score, kbp[kbp_context], sbp->gbp,
+                               query_info->contexts[hsp->context].query_length,
                                subject_length);
           } else {
               /* for RPS blast, query and subject is swapped */
               hsp->evalue =
-                  BLAST_SpougeStoE(hsp->score, kbp[kbp_context], sbp->gbp, 
+                  BLAST_SpougeStoE(hsp->score, kbp[kbp_context], sbp->gbp,
                                subject_length,
                                query_info->contexts[hsp->context].query_length);
           }
       } else {
           /* Get effective search space from the query information block */
           hsp->evalue =
-              BLAST_KarlinStoE_simple(hsp->score, kbp[kbp_context], 
+              BLAST_KarlinStoE_simple(hsp->score, kbp[kbp_context],
                                query_info->contexts[hsp->context].eff_searchsp);
       }
 
@@ -1744,7 +1749,7 @@ Int2 Blast_HSPListGetEvalues(EBlastProgramType program_number,
       /* Put back the unscaled value of Lambda. */
       kbp[kbp_context]->Lambda *= scaling_factor;
    }
-   
+
    /* Assign the best e-value field. Here the best e-value will always be
       attained for the first HSP in the list. Check that the incoming
       HSP list is properly sorted by score. */
@@ -1754,37 +1759,37 @@ Int2 Blast_HSPListGetEvalues(EBlastProgramType program_number,
    return 0;
 }
 
-Int2 Blast_HSPListGetBitScores(BlastHSPList* hsp_list, 
-                               Boolean gapped_calculation, 
+Int2 Blast_HSPListGetBitScores(BlastHSPList* hsp_list,
+                               Boolean gapped_calculation,
                                const BlastScoreBlk* sbp)
 {
    BlastHSP* hsp;
    Blast_KarlinBlk** kbp;
    Int4 index;
-   
+
    if (hsp_list == NULL)
       return 1;
-   
+
    kbp = (gapped_calculation ? sbp->kbp_gap : sbp->kbp);
-   
+
    for (index=0; index<hsp_list->hspcnt; index++) {
       hsp = hsp_list->hsp_array[index];
       ASSERT(hsp != NULL);
       ASSERT(sbp->round_down == FALSE || (hsp->score & 1) == 0);
-      hsp->bit_score = 
-         (hsp->score*kbp[hsp->context]->Lambda - kbp[hsp->context]->logK) / 
+      hsp->bit_score =
+         (hsp->score*kbp[hsp->context]->Lambda - kbp[hsp->context]->logK) /
          NCBIMATH_LN2;
    }
-   
+
    return 0;
 }
 
 void Blast_HSPListPHIGetBitScores(BlastHSPList* hsp_list, BlastScoreBlk* sbp)
 {
     Int4 index;
-   
+
     double lambda, logC;
-    
+
     ASSERT(sbp && sbp->kbp_gap && sbp->kbp_gap[0]);
 
     lambda = sbp->kbp_gap[0]->Lambda;
@@ -1793,14 +1798,14 @@ void Blast_HSPListPHIGetBitScores(BlastHSPList* hsp_list, BlastScoreBlk* sbp)
     for (index=0; index<hsp_list->hspcnt; index++) {
         BlastHSP* hsp = hsp_list->hsp_array[index];
         ASSERT(hsp != NULL);
-        hsp->bit_score = 
+        hsp->bit_score =
             (hsp->score*lambda - logC - log(1.0 + hsp->score*lambda))
             / NCBIMATH_LN2;
     }
 }
 
-void 
-Blast_HSPListPHIGetEvalues(BlastHSPList* hsp_list, BlastScoreBlk* sbp, 
+void
+Blast_HSPListPHIGetEvalues(BlastHSPList* hsp_list, BlastScoreBlk* sbp,
                            const BlastQueryInfo* query_info,
                            const SPHIPatternSearchBlk* pattern_blk)
 {
@@ -1814,14 +1819,14 @@ Blast_HSPListPHIGetEvalues(BlastHSPList* hsp_list, BlastScoreBlk* sbp,
       hsp = hsp_list->hsp_array[index];
       s_HSPPHIGetEvalue(hsp, sbp, query_info, pattern_blk);
    }
-   /* The best e-value is the one for the highest scoring HSP, which 
+   /* The best e-value is the one for the highest scoring HSP, which
       must be the first in the list. Check that HSPs are sorted by score
       to make sure this assumption is correct. */
    ASSERT(Blast_HSPListIsSortedByScore(hsp_list));
    hsp_list->best_evalue = s_BlastGetBestEvalue(hsp_list);
 }
 
-Int2 Blast_HSPListReapByEvalue(BlastHSPList* hsp_list, 
+Int2 Blast_HSPListReapByEvalue(BlastHSPList* hsp_list,
         const BlastHitSavingOptions* hit_options)
 {
    BlastHSP* hsp;
@@ -1829,7 +1834,7 @@ Int2 Blast_HSPListReapByEvalue(BlastHSPList* hsp_list,
    Int4 hsp_cnt = 0;
    Int4 index;
    double cutoff;
-   
+
    if (hsp_list == NULL)
       return 0;
 
@@ -1840,7 +1845,7 @@ Int2 Blast_HSPListReapByEvalue(BlastHSPList* hsp_list,
       hsp = hsp_array[index];
 
       ASSERT(hsp != NULL);
-      
+
       if (hsp->evalue > cutoff) {
          hsp_array[index] = Blast_HSPFree(hsp_array[index]);
       } else {
@@ -1849,7 +1854,7 @@ Int2 Blast_HSPListReapByEvalue(BlastHSPList* hsp_list,
          hsp_cnt++;
       }
    }
-      
+
    hsp_list->hspcnt = hsp_cnt;
 
    return 0;
@@ -1913,7 +1918,7 @@ Int2 Blast_TrimHSPListByMaxHsps(BlastHSPList* hsp_list,
 
 /** Same as Blast_HSPListReapByEvalue() except that it uses
  *  the raw score of the hit and the HitSavingOptions->cutoff_score
- *  to filter out hits. -RMH- 
+ *  to filter out hits. -RMH-
  */
 Int2 Blast_HSPListReapByRawScore(BlastHSPList* hsp_list,
         const BlastHitSavingOptions* hit_options)
@@ -1985,11 +1990,11 @@ Int2 Blast_HitListMerge(BlastHitList** old_hit_list_ptr,
     /* sort the lists of HSPs by oid */
 
     if (num_hsplists1 > 1) {
-        qsort(hitlist1->hsplist_array, num_hsplists1, 
+        qsort(hitlist1->hsplist_array, num_hsplists1,
               sizeof(BlastHSPList*), s_SortHSPListByOid);
     }
     if (num_hsplists2 > 1) {
-        qsort(hitlist2->hsplist_array, num_hsplists2, 
+        qsort(hitlist2->hsplist_array, num_hsplists2,
               sizeof(BlastHSPList*), s_SortHSPListByOid);
     }
 
@@ -2099,8 +2104,8 @@ Blast_HSPListPurgeNullHSPs(BlastHSPList* hsp_list)
 
 /** Callback for sorting HSPs by starting offset in query. Sorting is by
  * increasing context, then increasing query start offset, then increasing
- * subject start offset, then decreasing score, then increasing query end 
- * offset, then increasing subject end offset. Null HSPs are moved to the 
+ * subject start offset, then decreasing score, then increasing query end
+ * offset, then increasing subject end offset. Null HSPs are moved to the
  * end of the array.
  * @param v1 pointer to first HSP [in]
  * @param v2 pointer to second HSP [in]
@@ -2119,13 +2124,13 @@ s_QueryOffsetCompareHSPs(const void* v1, const void* v2)
 
    if (!h1 && !h2)
       return 0;
-   else if (!h1) 
+   else if (!h1)
       return 1;
    else if (!h2)
       return -1;
 
    /* If these are from different contexts, don't compare offsets */
-   if (h1->context < h2->context) 
+   if (h1->context < h2->context)
       return -1;
    if (h1->context > h2->context)
       return 1;
@@ -2140,7 +2145,7 @@ s_QueryOffsetCompareHSPs(const void* v1, const void* v2)
    if (h1->subject.offset > h2->subject.offset)
       return 1;
 
-   /* tie breakers: sort by decreasing score, then 
+   /* tie breakers: sort by decreasing score, then
       by increasing size of query range, then by
       increasing subject range. */
 
@@ -2165,7 +2170,7 @@ s_QueryOffsetCompareHSPs(const void* v1, const void* v2)
 /** Callback for sorting HSPs by ending offset in query. Sorting is by
  * increasing context, then increasing query end offset, then increasing
  * subject end offset, then decreasing score, then decreasing query start
- * offset, then decreasing subject start offset. Null HSPs are moved to the 
+ * offset, then decreasing subject start offset. Null HSPs are moved to the
  * end of the array.
  * @param v1 pointer to first HSP [in]
  * @param v2 pointer to second HSP [in]
@@ -2184,13 +2189,13 @@ s_QueryEndCompareHSPs(const void* v1, const void* v2)
 
    if (!h1 && !h2)
       return 0;
-   else if (!h1) 
+   else if (!h1)
       return 1;
    else if (!h2)
       return -1;
 
    /* If these are from different contexts, don't compare offsets */
-   if (h1->context < h2->context) 
+   if (h1->context < h2->context)
       return -1;
    if (h1->context > h2->context)
       return 1;
@@ -2205,10 +2210,10 @@ s_QueryEndCompareHSPs(const void* v1, const void* v2)
    if (h1->subject.end > h2->subject.end)
       return 1;
 
-   /* tie breakers: sort by decreasing score, then 
+   /* tie breakers: sort by decreasing score, then
       by increasing size of query range, then by
-      increasing size of subject range. The shortest range 
-      means the *largest* sequence offset must come 
+      increasing size of subject range. The shortest range
+      means the *largest* sequence offset must come
       first */
    if (h1->score < h2->score)
       return 1;
@@ -2230,9 +2235,9 @@ s_QueryEndCompareHSPs(const void* v1, const void* v2)
 
 
 /* cut off the GapEditScript according to hsp offset and end */
-static void 
+static void
 s_CutOffGapEditScript(BlastHSP* hsp, Int4 q_cut, Int4 s_cut, Boolean cut_begin)
-{   
+{
    int index, opid, qid, sid;
    Boolean found = FALSE;
    GapEditScript *esp = hsp->gap_info;
@@ -2242,14 +2247,14 @@ s_CutOffGapEditScript(BlastHSP* hsp, Int4 q_cut, Int4 s_cut, Boolean cut_begin)
    q_cut -= hsp->query.offset;
    s_cut -= hsp->subject.offset;
    for (index=0; index < esp->size; index++) {
-       for(opid=0; opid < esp->num[index];){  
+       for(opid=0; opid < esp->num[index];){
           if (esp->op_type[index] == eGapAlignSub) {
              qid++;
              sid++;
              opid++;
           } else if (esp->op_type[index] == eGapAlignDel) {
              sid+=esp->num[index];
-             opid+=esp->num[index]; 
+             opid+=esp->num[index];
           } else if (esp->op_type[index] == eGapAlignIns) {
              qid+=esp->num[index];
              opid+=esp->num[index];
@@ -2259,7 +2264,7 @@ s_CutOffGapEditScript(BlastHSP* hsp, Int4 q_cut, Int4 s_cut, Boolean cut_begin)
        }
        if (found) break;
    }
-   
+
    // RMH: Unless both cut sites where found the following
    //      block would access memory outside the GapEditScript
    //      array.
@@ -2272,7 +2277,7 @@ s_CutOffGapEditScript(BlastHSP* hsp, Int4 q_cut, Int4 s_cut, Boolean cut_begin)
             esp->op_type[0] = esp->op_type[index];
             esp->num[0] = esp->num[index] - opid;
             new_index++;
-         } 
+         }
          ++index;
          for (; index < esp->size; index++, new_index++) {
             esp->op_type[new_index] = esp->op_type[index];
@@ -2285,7 +2290,7 @@ s_CutOffGapEditScript(BlastHSP* hsp, Int4 q_cut, Int4 s_cut, Boolean cut_begin)
          if (opid < esp->num[index]) {
             ASSERT(esp->op_type[index] == eGapAlignSub);
             esp->num[index] = opid;
-         } 
+         }
          esp->size = index+1;
          hsp->query.end = hsp->query.offset + qid;
          hsp->subject.end = hsp->subject.offset + sid;
@@ -2294,7 +2299,7 @@ s_CutOffGapEditScript(BlastHSP* hsp, Int4 q_cut, Int4 s_cut, Boolean cut_begin)
 }
 
 Int4
-Blast_HSPListPurgeHSPsWithCommonEndpoints(EBlastProgramType program, 
+Blast_HSPListPurgeHSPsWithCommonEndpoints(EBlastProgramType program,
                                           BlastHSPList* hsp_list,
                                           Boolean purge)
 
@@ -2304,7 +2309,7 @@ Blast_HSPListPurgeHSPsWithCommonEndpoints(EBlastProgramType program,
    Int4 i, j, k;
    Int4 hsp_count;
    purge |= (program != eBlastTypeBlastn);
-   
+
    /* If HSP list is empty, return immediately. */
    if (hsp_list == NULL || hsp_list->hspcnt == 0)
        return 0;
@@ -2341,7 +2346,7 @@ Blast_HSPListPurgeHSPsWithCommonEndpoints(EBlastProgramType program,
       }
       i += j;
    }
-   
+
    qsort(hsp_array, hsp_count, sizeof(BlastHSP*), s_QueryEndCompareHSPs);
    i = 0;
    while (i < hsp_count) {
@@ -2374,13 +2379,13 @@ Blast_HSPListPurgeHSPsWithCommonEndpoints(EBlastProgramType program,
    return hsp_count;
 }
 
-Int2 
-Blast_HSPListReevaluateUngapped(EBlastProgramType program, 
-   BlastHSPList* hsp_list, BLAST_SequenceBlk* query_blk, 
-   BLAST_SequenceBlk* subject_blk, 
+Int2
+Blast_HSPListReevaluateUngapped(EBlastProgramType program,
+   BlastHSPList* hsp_list, BLAST_SequenceBlk* query_blk,
+   BLAST_SequenceBlk* subject_blk,
    const BlastInitialWordParameters* word_params,
-   const BlastHitSavingParameters* hit_params, const BlastQueryInfo* query_info, 
-   BlastScoreBlk* sbp, const BlastScoringParameters* score_params, 
+   const BlastHitSavingParameters* hit_params, const BlastQueryInfo* query_info,
+   BlastScoreBlk* sbp, const BlastScoringParameters* score_params,
    const BlastSeqSrc* seq_src, const Uint1* gen_code_string)
 {
    BlastHSP** hsp_array,* hsp;
@@ -2405,12 +2410,12 @@ Blast_HSPListReevaluateUngapped(EBlastProgramType program,
       /* All HSPs have been deleted */
       return status;
 
-   /* Retrieve the unpacked subject sequence and save it in the 
+   /* Retrieve the unpacked subject sequence and save it in the
       sequence_start element of the subject structure.
-      NB: for the BLAST 2 Sequences case, the uncompressed sequence must 
+      NB: for the BLAST 2 Sequences case, the uncompressed sequence must
       already be there */
    if (seq_src) {
-      /* Wrap subject sequence block into a BlastSeqSrcGetSeqArg structure, which is 
+      /* Wrap subject sequence block into a BlastSeqSrcGetSeqArg structure, which is
          needed by the BlastSeqSrc API. */
       /* If this was a protein subject, leave as is. */
       if (kNucleotideSubject)
@@ -2442,7 +2447,7 @@ Blast_HSPListReevaluateUngapped(EBlastProgramType program,
       if (!gen_code_string)
          return -1;
       /* Get the translation buffer */
-      BlastTargetTranslationNew(subject_blk, gen_code_string, program, 
+      BlastTargetTranslationNew(subject_blk, gen_code_string, program,
                    score_params->options->is_ooframe, &target_t);
    } else {
       /* Store sequence in blastna encoding in sequence_start */
@@ -2469,11 +2474,11 @@ Blast_HSPListReevaluateUngapped(EBlastProgramType program,
          subject_start = Blast_HSPGetTargetTranslation(target_t, hsp, NULL);
 
       if (kNucleotideSubject) {
-         delete_hsp = 
-             Blast_HSPReevaluateWithAmbiguitiesUngapped(hsp, query_start, 
+         delete_hsp =
+             Blast_HSPReevaluateWithAmbiguitiesUngapped(hsp, query_start,
                 subject_start, word_params, sbp, kTranslateSubject);
       }
-   
+
       if (!delete_hsp) {
           const Uint1* query_nomask = query_blk->sequence_nomask +
               query_info->contexts[context].query_offset;
@@ -2505,17 +2510,17 @@ Blast_HSPListReevaluateUngapped(EBlastProgramType program,
    return 0;
 }
 
-/** Combine two HSP lists, without altering the individual HSPs, and without 
- * reallocating the HSP array. 
+/** Combine two HSP lists, without altering the individual HSPs, and without
+ * reallocating the HSP array.
  * @param hsp_list New HSP list [in]
  * @param combined_hsp_list Old HSP list, to which new HSPs are added [in] [out]
  * @param new_hspcnt How many HSPs to save in the combined list? The extra ones
  *                   are freed. The best scoring HSPs are saved. This argument
- *                   cannot be greater than the allocated size of the 
+ *                   cannot be greater than the allocated size of the
  *                   combined list's HSP array. [in]
  */
-static void 
-s_BlastHSPListsCombineByScore(BlastHSPList* hsp_list, 
+static void
+s_BlastHSPListsCombineByScore(BlastHSPList* hsp_list,
                              BlastHSPList* combined_hsp_list,
                              Int4 new_hspcnt)
 {
@@ -2526,7 +2531,7 @@ s_BlastHSPListsCombineByScore(BlastHSPList* hsp_list,
 
    if (new_hspcnt >= hsp_list->hspcnt + combined_hsp_list->hspcnt) {
       /* All HSPs from both arrays are saved */
-      for (index=combined_hsp_list->hspcnt, index1=0; 
+      for (index=combined_hsp_list->hspcnt, index1=0;
            index1<hsp_list->hspcnt; index1++) {
          if (hsp_list->hsp_array[index1] != NULL)
             combined_hsp_list->hsp_array[index++] = hsp_list->hsp_array[index1];
@@ -2535,10 +2540,10 @@ s_BlastHSPListsCombineByScore(BlastHSPList* hsp_list,
       Blast_HSPListSortByScore(combined_hsp_list);
    } else {
       /* Not all HSPs are be saved; sort both arrays by score and save only
-         the new_hspcnt best ones. 
-         For the merged set of HSPs, allocate array the same size as in the 
+         the new_hspcnt best ones.
+         For the merged set of HSPs, allocate array the same size as in the
          old HSP list. */
-      new_hsp_array = (BlastHSP**) 
+      new_hsp_array = (BlastHSP**)
          malloc(combined_hsp_list->allocated*sizeof(BlastHSP*));
 
       Blast_HSPListSortByScore(combined_hsp_list);
@@ -2558,11 +2563,11 @@ s_BlastHSPListsCombineByScore(BlastHSPList* hsp_list,
       }
       /* Free the extra HSPs that could not be saved */
       for ( ; index1 < combined_hsp_list->hspcnt; ++index1) {
-         combined_hsp_list->hsp_array[index1] = 
+         combined_hsp_list->hsp_array[index1] =
             Blast_HSPFree(combined_hsp_list->hsp_array[index1]);
       }
       for ( ; index2 < hsp_list->hspcnt; ++index2) {
-         hsp_list->hsp_array[index2] = 
+         hsp_list->hsp_array[index2] =
             Blast_HSPFree(hsp_list->hsp_array[index2]);
       }
       /* Point combined_hsp_list's HSP array to the new one */
@@ -2570,7 +2575,7 @@ s_BlastHSPListsCombineByScore(BlastHSPList* hsp_list,
       combined_hsp_list->hsp_array = new_hsp_array;
       combined_hsp_list->hspcnt = new_hspcnt;
    }
-   
+
    /* Second HSP list now does not own any HSPs */
    hsp_list->hspcnt = 0;
 }
@@ -2592,18 +2597,18 @@ Int2 Blast_HSPListAppend(BlastHSPList** old_hsp_list_ptr,
       return 0;
    }
 
-   /* Just append new list to the end of the old list, in case of 
+   /* Just append new list to the end of the old list, in case of
       multiple frames of the subject sequence */
-   new_hspcnt = MIN(combined_hsp_list->hspcnt + hsp_list->hspcnt, 
+   new_hspcnt = MIN(combined_hsp_list->hspcnt + hsp_list->hspcnt,
                     hsp_num_max);
-   if (new_hspcnt > combined_hsp_list->allocated && 
+   if (new_hspcnt > combined_hsp_list->allocated &&
        !combined_hsp_list->do_not_reallocate) {
       Int4 new_allocated = MIN(2*new_hspcnt, hsp_num_max);
       BlastHSP** new_hsp_array;
-      new_hsp_array = (BlastHSP**) 
-         realloc(combined_hsp_list->hsp_array, 
+      new_hsp_array = (BlastHSP**)
+         realloc(combined_hsp_list->hsp_array,
                  new_allocated*sizeof(BlastHSP*));
-      
+
       if (new_hsp_array) {
          combined_hsp_list->allocated = new_allocated;
          combined_hsp_list->hsp_array = new_hsp_array;
@@ -2617,15 +2622,15 @@ Int2 Blast_HSPListAppend(BlastHSPList** old_hsp_list_ptr,
 
    s_BlastHSPListsCombineByScore(hsp_list, combined_hsp_list, new_hspcnt);
 
-   hsp_list = Blast_HSPListFree(hsp_list); 
+   hsp_list = Blast_HSPListFree(hsp_list);
    *old_hsp_list_ptr = NULL;
 
    return 0;
 }
 
-Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr, 
+Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
                    BlastHSPList** combined_hsp_list_ptr,
-                   Int4 hsp_num_max, Int4 *split_offsets, 
+                   Int4 hsp_num_max, Int4 *split_offsets,
                    Int4 contexts_per_query, Int4 chunk_overlap_size,
                    Boolean allow_gap)
 {
@@ -2638,7 +2643,7 @@ Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
    Int4 start_diag, end_diag;
    Int4 offset_idx;
    BlastHSP** new_hsp_array;
-  
+
    if (!hsp_list || hsp_list->hspcnt == 0)
       return 0;
 
@@ -2650,7 +2655,7 @@ Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
    }
 
    /* Merge the two HSP lists for successive chunks of the subject sequence.
-      First put all HSPs that intersect the overlap region at the front of 
+      First put all HSPs that intersect the overlap region at the front of
       the respective HSP arrays. Note that if the query sequence is
       assumed split, each context of the query sequence can have a
       different split point */
@@ -2682,18 +2687,18 @@ Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
 
       /* An HSP can be a candidate for merging if it lies in the
          overlap region. Whether this is true depends on whether the
-         HSP starts to the left of the split point, or ends to the 
-         right of the overlap region. A complication is that 'left' 
-         and 'right' have opposite meaning when the HSP is on the 
+         HSP starts to the left of the split point, or ends to the
+         right of the overlap region. A complication is that 'left'
+         and 'right' have opposite meaning when the HSP is on the
          minus strand of the query sequence */
 
       for (index1 = 0; index1 < combined_hsp_list->hspcnt; index1++) {
          hsp1 = combined_hsp_list->hsp_array[index1];
          offset_idx = hsp1->context % contexts_per_query;
          if (split_offsets[offset_idx] < 0) continue;
-         if ((hsp1->query.frame >= 0 && hsp1->query.end > 
+         if ((hsp1->query.frame >= 0 && hsp1->query.end >
                          split_offsets[offset_idx]) ||
-             (hsp1->query.frame < 0 && hsp1->query.offset < 
+             (hsp1->query.frame < 0 && hsp1->query.offset <
                          split_offsets[offset_idx] + chunk_overlap_size)) {
             /* At least part of this HSP lies in the overlap strip. */
             hsp_var = combined_hsp_list->hsp_array[hspcnt1];
@@ -2706,9 +2711,9 @@ Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
          hsp2 = hsp_list->hsp_array[index2];
          offset_idx = hsp2->context % contexts_per_query;
          if (split_offsets[offset_idx] < 0) continue;
-         if ((hsp2->query.frame < 0 && hsp2->query.end > 
+         if ((hsp2->query.frame < 0 && hsp2->query.end >
                          split_offsets[offset_idx]) ||
-             (hsp2->query.frame >= 0 && hsp2->query.offset < 
+             (hsp2->query.frame >= 0 && hsp2->query.offset <
                          split_offsets[offset_idx] + chunk_overlap_size)) {
             /* At least part of this HSP lies in the overlap strip. */
             hsp_var = hsp_list->hsp_array[hspcnt2];
@@ -2725,15 +2730,15 @@ Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
    if (hspcnt1 > 0 && hspcnt2 > 0) {
       hspp1 = combined_hsp_list->hsp_array;
       hspp2 = hsp_list->hsp_array;
-   
+
       for (index1 = 0; index1 < hspcnt1; index1++) {
-   
+
          hsp1 = hspp1[index1];
-   
+
          for (index2 = 0; index2 < hspcnt2; index2++) {
 
             hsp2 = hspp2[index2];
-   
+
             /* Skip already deleted HSPs, or HSPs from different contexts */
             if (!hsp2 || hsp1->context != hsp2->context)
                continue;
@@ -2749,7 +2754,7 @@ Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
                end_diag = s_HSPEndDiag(hsp2);
                start_diag = s_HSPStartDiag(hsp1);
             }
-   
+
             if (ABS(end_diag - start_diag) < OVERLAP_DIAG_CLOSE) {
                if (s_BlastMergeTwoHSPs(hsp1, hsp2, allow_gap)) {
                   /* Free the second HSP. */
@@ -2758,26 +2763,26 @@ Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
             }
          }
       }
-   
+
       /* Purge the nulled out HSPs from the new HSP list */
       Blast_HSPListPurgeNullHSPs(hsp_list);
    }
 
-   /* The new number of HSPs is now the sum of the remaining counts in the 
+   /* The new number of HSPs is now the sum of the remaining counts in the
       two lists, but if there is a restriction on the number of HSPs to keep,
       it might have to be reduced. */
-   new_hspcnt = 
+   new_hspcnt =
       MIN(hsp_list->hspcnt + combined_hsp_list->hspcnt, hsp_num_max);
-   
-   if (new_hspcnt >= combined_hsp_list->allocated-1 && 
+
+   if (new_hspcnt >= combined_hsp_list->allocated-1 &&
        combined_hsp_list->do_not_reallocate == FALSE) {
       Int4 new_allocated = MIN(2*new_hspcnt, hsp_num_max);
       if (new_allocated > combined_hsp_list->allocated) {
-         new_hsp_array = (BlastHSP**) 
-            realloc(combined_hsp_list->hsp_array, 
+         new_hsp_array = (BlastHSP**)
+            realloc(combined_hsp_list->hsp_array,
                     new_allocated*sizeof(BlastHSP*));
          if (new_hsp_array == NULL) {
-            combined_hsp_list->do_not_reallocate = TRUE; 
+            combined_hsp_list->do_not_reallocate = TRUE;
          } else {
             combined_hsp_list->hsp_array = new_hsp_array;
             combined_hsp_list->allocated = new_allocated;
@@ -2790,7 +2795,7 @@ Int2 Blast_HSPListsMerge(BlastHSPList** hsp_list_ptr,
 
    s_BlastHSPListsCombineByScore(hsp_list, combined_hsp_list, new_hspcnt);
 
-   hsp_list = Blast_HSPListFree(hsp_list); 
+   hsp_list = Blast_HSPListFree(hsp_list);
    *hsp_list_ptr = NULL;
 
    return 0;
@@ -2812,17 +2817,17 @@ void Blast_HSPListAdjustOffsets(BlastHSPList* hsp_list, Int4 offset)
    }
 }
 
-void Blast_HSPListAdjustOddBlastnScores(BlastHSPList* hsp_list, 
-                                        Boolean gapped_calculation, 
+void Blast_HSPListAdjustOddBlastnScores(BlastHSPList* hsp_list,
+                                        Boolean gapped_calculation,
                                         const BlastScoreBlk* sbp)
 {
     int index;
-    
+
     if (!hsp_list || hsp_list->hspcnt == 0 ||
         gapped_calculation == FALSE ||
         sbp->round_down == FALSE)
        return;
-    
+
     for (index = 0; index < hsp_list->hspcnt; ++index)
         hsp_list->hsp_array[index]->score &= ~1;
 
@@ -2831,9 +2836,9 @@ void Blast_HSPListAdjustOddBlastnScores(BlastHSPList* hsp_list,
 }
 
 /** Callback for sorting hsp lists by their best evalue/score;
- * Evalues are compared only up to a relative error of 
- * FUZZY_EVALUE_COMPARE_FACTOR. 
- * It is assumed that the HSP arrays in each hit list are already sorted by 
+ * Evalues are compared with the condition that if both are close enough to
+ * zero (currently < 1.0e-180), they are considered equal.
+ * It is assumed that the HSP arrays in each hit list are already sorted by
  * e-value/score.
 */
 static int
@@ -2841,11 +2846,11 @@ s_EvalueCompareHSPLists(const void* v1, const void* v2)
 {
    BlastHSPList* h1,* h2;
    int retval = 0;
-   
+
    h1 = *(BlastHSPList**) v1;
    h2 = *(BlastHSPList**) v2;
-   
-   /* If any of the HSP lists is empty, it is considered "worse" than the 
+
+   /* If any of the HSP lists is empty, it is considered "worse" than the
       other, unless the other is also empty. */
    if (h1->hspcnt == 0 && h2->hspcnt == 0)
       return 0;
@@ -2854,7 +2859,7 @@ s_EvalueCompareHSPLists(const void* v1, const void* v2)
    else if (h2->hspcnt == 0)
       return -1;
 
-   if ((retval = s_FuzzyEvalueComp(h1->best_evalue, 
+   if ((retval = s_EvalueComp(h1->best_evalue,
                                    h2->best_evalue)) != 0)
       return retval;
 
@@ -2868,7 +2873,7 @@ s_EvalueCompareHSPLists(const void* v1, const void* v2)
    return BLAST_CMP(h2->oid, h1->oid);
 }
 
-/** Callback for sorting hsp lists by their best e-value/score, in 
+/** Callback for sorting hsp lists by their best e-value/score, in
  * reverse order - from higher e-value to lower (lower score to higher).
 */
 static int
@@ -2886,7 +2891,7 @@ s_EvalueCompareHSPListsRev(const void* v1, const void* v2)
  */
 BlastHitList* Blast_HitListNew(Int4 hitlist_size)
 {
-   BlastHitList* new_hitlist = (BlastHitList*) 
+   BlastHitList* new_hitlist = (BlastHitList*)
       calloc(1, sizeof(BlastHitList));
    new_hitlist->hsplist_max = hitlist_size;
    new_hitlist->low_score = INT4_MAX;
@@ -2912,7 +2917,7 @@ BlastHitList* Blast_HitListFree(BlastHitList* hitlist)
 Int2 Blast_HitListHSPListsFree(BlastHitList* hitlist)
 {
    Int4 index;
-   
+
    if (!hitlist)
 	return 0;
 
@@ -2927,21 +2932,21 @@ Int2 Blast_HitListHSPListsFree(BlastHitList* hitlist)
    return 0;
 }
 
-/** Purge a BlastHitList of empty HSP lists. 
+/** Purge a BlastHitList of empty HSP lists.
  * @param hit_list BLAST hit list structure. [in] [out]
  */
-static void 
+static void
 s_BlastHitListPurge(BlastHitList* hit_list)
 {
    Int4 index, hsplist_count;
-   
+
    if (!hit_list)
       return;
-   
+
    hsplist_count = hit_list->hsplist_count;
-   for (index = 0; index < hsplist_count && 
+   for (index = 0; index < hsplist_count &&
            hit_list->hsplist_array[index]->hspcnt > 0; ++index);
-   
+
    hit_list->hsplist_count = index;
    /* Free all empty HSP lists */
    for ( ; index < hsplist_count; ++index) {
@@ -2954,24 +2959,24 @@ s_BlastHitListPurge(BlastHitList* hit_list)
  * @param hit_list Contains all HSP lists for a given query [in] [out]
  * @param hsp_list A new HSP list to be inserted into the hit list [in]
  */
-static void 
-s_BlastHitListInsertHSPListInHeap(BlastHitList* hit_list, 
+static void
+s_BlastHitListInsertHSPListInHeap(BlastHitList* hit_list,
                                  BlastHSPList* hsp_list)
 {
       Blast_HSPListFree(hit_list->hsplist_array[0]);
       hit_list->hsplist_array[0] = hsp_list;
       if (hit_list->hsplist_count >= 2) {
-         s_Heapify((char*)hit_list->hsplist_array, (char*)hit_list->hsplist_array, 
+         s_Heapify((char*)hit_list->hsplist_array, (char*)hit_list->hsplist_array,
                  (char*)&hit_list->hsplist_array[hit_list->hsplist_count/2 - 1],
                  (char*)&hit_list->hsplist_array[hit_list->hsplist_count-1],
                  sizeof(BlastHSPList*), s_EvalueCompareHSPLists);
       }
-      hit_list->worst_evalue = 
+      hit_list->worst_evalue =
          hit_list->hsplist_array[0]->best_evalue;
       hit_list->low_score = hit_list->hsplist_array[0]->hsp_array[0]->score;
 }
 
-/** Given a BlastHitList pointer this function makes the 
+/** Given a BlastHitList pointer this function makes the
  * hsplist_array larger, up to a maximum size.
  * These incremental increases are mostly an issue for users who
  * put in a very large number for number of hits to save, but only save a few.
@@ -2993,7 +2998,7 @@ static Int2 s_Blast_HitListGrowHSPListArray(BlastHitList* hit_list)
     else
        hit_list->hsplist_current = MIN(2*hit_list->hsplist_current, hit_list->hsplist_max);
 
-    hit_list->hsplist_array = 
+    hit_list->hsplist_array =
        (BlastHSPList**) realloc(hit_list->hsplist_array, hit_list->hsplist_current*sizeof(BlastHSPList*));
 
     if (hit_list->hsplist_array == NULL)
@@ -3002,7 +3007,7 @@ static Int2 s_Blast_HitListGrowHSPListArray(BlastHitList* hit_list)
     return 0;
 }
 
-Int2 Blast_HitListUpdate(BlastHitList* hit_list, 
+Int2 Blast_HitListUpdate(BlastHitList* hit_list,
                          BlastHSPList* hsp_list)
 {
    hsp_list->best_evalue = s_BlastGetBestEvalue(hsp_list);
@@ -3010,9 +3015,9 @@ Int2 Blast_HitListUpdate(BlastHitList* hit_list,
 #ifndef NDEBUG
    ASSERT(s_BlastCheckBestEvalue(hsp_list) == TRUE); /* NCBI_FAKE_WARNING */
 #endif /* _DEBUG */
- 
+
    if (hit_list->hsplist_count < hit_list->hsplist_max) {
-      /* If the array of HSP lists for this query is not yet allocated, 
+      /* If the array of HSP lists for this query is not yet allocated,
          do it here */
       if (hit_list->hsplist_current == hit_list->hsplist_count)
       {
@@ -3022,25 +3027,25 @@ Int2 Blast_HitListUpdate(BlastHitList* hit_list,
       }
       /* Just add to the end; sort later */
       hit_list->hsplist_array[hit_list->hsplist_count++] = hsp_list;
-      hit_list->worst_evalue = 
+      hit_list->worst_evalue =
          MAX(hsp_list->best_evalue, hit_list->worst_evalue);
-      hit_list->low_score = 
+      hit_list->low_score =
          MIN(hsp_list->hsp_array[0]->score, hit_list->low_score);
    } else {
       int evalue_order = 0;
       /* make sure the hsp_list is sorted.  We actually do not need to sort
-         the full list: all that we need is the best score.   However, the 
+         the full list: all that we need is the best score.   However, the
          following code assumes hsp_list->hsp_array[0] has the best score. */
       Blast_HSPListSortByEvalue(hsp_list);
       /* Compare e-values only with a certain precision */
-      evalue_order = s_FuzzyEvalueComp(hsp_list->best_evalue,
+      evalue_order = s_EvalueComp(hsp_list->best_evalue,
                                        hit_list->worst_evalue);
-      if (evalue_order > 0 || 
+      if (evalue_order > 0 ||
           (evalue_order == 0 &&
            (hsp_list->hsp_array[0]->score < hit_list->low_score))) {
          /* This hit list is less significant than any of those already saved;
             discard it. Note that newer hits with score and e-value both equal
-            to the current worst will be saved, at the expense of some older 
+            to the current worst will be saved, at the expense of some older
             hit.
          */
          Blast_HSPListFree(hsp_list);
@@ -3048,10 +3053,10 @@ Int2 Blast_HitListUpdate(BlastHitList* hit_list,
          if (!hit_list->heapified) {
             /* make sure all hsp_list is sorted */
             int index;
-            for (index =0; index < hit_list->hsplist_count; index++) 
+            for (index =0; index < hit_list->hsplist_count; index++)
                 Blast_HSPListSortByEvalue(hit_list->hsplist_array[index]);
-     
-            s_CreateHeap(hit_list->hsplist_array, hit_list->hsplist_count, 
+
+            s_CreateHeap(hit_list->hsplist_array, hit_list->hsplist_count,
                        sizeof(BlastHSPList*), s_EvalueCompareHSPLists);
             hit_list->heapified = TRUE;
          }
@@ -3061,7 +3066,7 @@ Int2 Blast_HitListUpdate(BlastHitList* hit_list,
    return 0;
 }
 
-Int2 
+Int2
 Blast_HitListPurgeNullHSPLists(BlastHitList* hit_list)
 {
    Int4 index, index1; /* loop indices. */
@@ -3110,19 +3115,19 @@ BlastHSPResults* Blast_HSPResultsNew(Int4 num_queries)
 {
    BlastHSPResults* retval = NULL;
 
-   retval = (BlastHSPResults*) malloc(sizeof(BlastHSPResults));
+   retval = (BlastHSPResults*) calloc(1, sizeof(BlastHSPResults));
    if ( !retval ) {
        return NULL;
    }
 
    retval->num_queries = num_queries;
-   retval->hitlist_array = (BlastHitList**) 
+   retval->hitlist_array = (BlastHitList**)
       calloc(num_queries, sizeof(BlastHitList*));
 
    if ( !retval->hitlist_array ) {
        return Blast_HSPResultsFree(retval);
    }
-   
+
    return retval;
 }
 
@@ -3150,8 +3155,10 @@ Int2 Blast_HSPResultsSortByEvalue(BlastHSPResults* results)
 
    for (index = 0; index < results->num_queries; ++index) {
       hit_list = results->hitlist_array[index];
-      if (hit_list && hit_list->hsplist_count > 1) {
-         qsort(hit_list->hsplist_array, hit_list->hsplist_count, 
+      if (hit_list != NULL
+              && hit_list->hsplist_count > 1
+              && hit_list->hsplist_array != NULL) {
+         qsort(hit_list->hsplist_array, hit_list->hsplist_count,
                   sizeof(BlastHSPList*), s_EvalueCompareHSPLists);
       }
       s_BlastHitListPurge(hit_list);
@@ -3167,7 +3174,7 @@ Int2 Blast_HSPResultsReverseSort(BlastHSPResults* results)
    for (index = 0; index < results->num_queries; ++index) {
       hit_list = results->hitlist_array[index];
       if (hit_list && hit_list->hsplist_count > 1) {
-         qsort(hit_list->hsplist_array, hit_list->hsplist_count, 
+         qsort(hit_list->hsplist_array, hit_list->hsplist_count,
                sizeof(BlastHSPList*), s_EvalueCompareHSPListsRev);
       }
       s_BlastHitListPurge(hit_list);
@@ -3189,7 +3196,7 @@ Int2 Blast_HSPResultsReverseOrder(BlastHSPResults* results)
 	    etc. */
 	 for (index1 = 0; index1 < hit_list->hsplist_count/2; ++index1) {
 	    hsplist = hit_list->hsplist_array[index1];
-	    hit_list->hsplist_array[index1] = 
+	    hit_list->hsplist_array[index1] =
 	       hit_list->hsplist_array[hit_list->hsplist_count-index1-1];
 	    hit_list->hsplist_array[hit_list->hsplist_count-index1-1] =
 	       hsplist;
@@ -3206,7 +3213,7 @@ typedef struct SHspWrap {
 } SHspWrap;
 
 /** callback used to sort a list of encapsulated HSP
- *  structures in order of decreasing raw score 
+ *  structures in order of decreasing raw score
  *  -RMH-
  */
 static int s_SortHspWrapRawScore(const void *x, const void *y)
@@ -3290,7 +3297,7 @@ Int2 Blast_HSPResultsApplyMasklevel(BlastHSPResults *results,
       }
       sfree(hsp_array);
 
-      /* remove any HSPLists that are still empty after the 
+      /* remove any HSPLists that are still empty after the
          culling process. Sort any remaining lists by score */
       for (j = 0; j < hitlist->hsplist_count; j++) {
          BlastHSPList *hsplist = hitlist->hsplist_array[j];
@@ -3309,7 +3316,7 @@ Int2 Blast_HSPResultsApplyMasklevel(BlastHSPResults *results,
    return 0;
 }
 
-Int2 Blast_HSPResultsInsertHSPList(BlastHSPResults* results, 
+Int2 Blast_HSPResultsInsertHSPList(BlastHSPResults* results,
         BlastHSPList* hsp_list, Int4 hitlist_size)
 {
    if (!hsp_list || hsp_list->hspcnt == 0)
@@ -3318,30 +3325,30 @@ Int2 Blast_HSPResultsInsertHSPList(BlastHSPResults* results,
    ASSERT(hsp_list->query_index < results->num_queries);
 
    if (!results->hitlist_array[hsp_list->query_index]) {
-       results->hitlist_array[hsp_list->query_index] = 
+       results->hitlist_array[hsp_list->query_index] =
            Blast_HitListNew(hitlist_size);
    }
-   Blast_HitListUpdate(results->hitlist_array[hsp_list->query_index], 
+   Blast_HitListUpdate(results->hitlist_array[hsp_list->query_index],
                        hsp_list);
    return 0;
 }
 
-BlastHSPResults** 
-PHIBlast_HSPResultsSplit(const BlastHSPResults* results, 
+BlastHSPResults**
+PHIBlast_HSPResultsSplit(const BlastHSPResults* results,
                          const SPHIQueryInfo* pattern_info)
 {
     BlastHSPResults* *phi_results = NULL;
     int pattern_index, hit_index;
     int num_patterns;
     BlastHitList* hit_list = NULL;
-    BlastHSPList** hsplist_array; /* Temporary per-pattern HSP lists. */  
+    BlastHSPList** hsplist_array; /* Temporary per-pattern HSP lists. */
 
     if (!pattern_info || pattern_info->num_patterns == 0)
         return NULL;
 
     num_patterns = pattern_info->num_patterns;
-    
-    phi_results = 
+
+    phi_results =
         (BlastHSPResults**) calloc(num_patterns, sizeof(BlastHSPResults*));
 
     if (!results || !results->hitlist_array[0])
@@ -3363,10 +3370,10 @@ PHIBlast_HSPResultsSplit(const BlastHSPResults* results,
             hsplist_array[pattern_index]->oid = hsp_list->oid;
             Blast_HSPListSaveHSP(hsplist_array[pattern_index], hsp);
         }
-        
-        /* Save HSP lists corresponding to different pattern occurrences 
+
+        /* Save HSP lists corresponding to different pattern occurrences
            in separate results structures. */
-        for (pattern_index = 0; pattern_index < num_patterns; 
+        for (pattern_index = 0; pattern_index < num_patterns;
              ++pattern_index) {
             if (hsplist_array[pattern_index]) {
                 if (!phi_results[pattern_index])
@@ -3378,7 +3385,7 @@ PHIBlast_HSPResultsSplit(const BlastHSPResults* results,
             }
         }
     }
-    
+
     sfree(hsplist_array);
 
     /* Sort HSPLists in each of the results structures by e-value. */
@@ -3390,8 +3397,8 @@ PHIBlast_HSPResultsSplit(const BlastHSPResults* results,
 }
 
 BlastHSPResults*
-Blast_HSPResultsFromHSPStream(BlastHSPStream* hsp_stream, 
-                              size_t num_queries, 
+Blast_HSPResultsFromHSPStream(BlastHSPStream* hsp_stream,
+                              size_t num_queries,
                               SBlastHitsParameters* bhp)
 {
     BlastHSPResults* retval = NULL;
@@ -3400,15 +3407,15 @@ Blast_HSPResultsFromHSPStream(BlastHSPStream* hsp_stream,
     retval = Blast_HSPResultsNew((Int4) num_queries);
 
     while (BlastHSPStreamRead(hsp_stream, &hsp_list) != kBlastHSPStream_Eof) {
-        Blast_HSPResultsInsertHSPList(retval, hsp_list, 
+        Blast_HSPResultsInsertHSPList(retval, hsp_list,
                                       bhp->prelim_hitlist_size);
     }
     SBlastHitsParametersFree(bhp);
     return retval;
 }
 
-/** Comparison function for sorting HSP lists in increasing order of the 
- * number of HSPs in a hit. Needed for s_TrimResultsByTotalHSPLimit below. 
+/** Comparison function for sorting HSP lists in increasing order of the
+ * number of HSPs in a hit. Needed for s_TrimResultsByTotalHSPLimit below.
  * @param v1 Pointer to the first HSP list [in]
  * @param v2 Pointer to the second HSP list [in]
  */
@@ -3427,13 +3434,13 @@ s_CompareHsplistHspcnt(const void* v1, const void* v2)
 }
 
 /** Removes extra results if a limit is imposed on the total number of HSPs
- * returned. If the search involves multiple query sequences, the total HSP 
+ * returned. If the search involves multiple query sequences, the total HSP
  * limit is applied separately to each query.
  * The trimming algorithm makes sure that at least 1 HSP is returned for each
- * database sequence hit. Suppose results for a given query consist of HSP 
+ * database sequence hit. Suppose results for a given query consist of HSP
  * lists for N database sequences, and the limit is T. HSP lists are sorted in
  * order of increasing number of HSPs in each list. Then the algorithm proceeds
- * by leaving at most i*T/N HSPs for the first i HSP lists, for every 
+ * by leaving at most i*T/N HSPs for the first i HSP lists, for every
  * i = 1, 2, ..., N.
  * @param results Results after preliminary stage of a BLAST search [in|out]
  * @param total_hsp_limit Limit on total number of HSPs [in]
@@ -3444,7 +3451,7 @@ s_TrimResultsByTotalHSPLimit(BlastHSPResults* results, Uint4 total_hsp_limit)
 {
     int query_index;
     Boolean hsp_limit_exceeded = FALSE;
-    
+
     if (total_hsp_limit == 0) {
         return hsp_limit_exceeded;
     }
@@ -3460,16 +3467,16 @@ s_TrimResultsByTotalHSPLimit(BlastHSPResults* results, Uint4 total_hsp_limit)
         /* The count of HSPs is separate for each query. */
         hsplist_count = hit_list->hsplist_count;
 
-        hsplist_array = (BlastHSPList**) 
+        hsplist_array = (BlastHSPList**)
             malloc(hsplist_count*sizeof(BlastHSPList*));
-        
+
         for (subj_index = 0; subj_index < hsplist_count; ++subj_index) {
             hsplist_array[subj_index] = hit_list->hsplist_array[subj_index];
         }
- 
+
         qsort((void*)hsplist_array, hsplist_count,
               sizeof(BlastHSPList*), s_CompareHsplistHspcnt);
-        
+
         {
             Int4 tot_hsps = 0;  /* total number of HSPs */
             Uint4 hsp_per_seq = MAX(1, total_hsp_limit/hsplist_count);
@@ -3479,7 +3486,7 @@ s_TrimResultsByTotalHSPLimit(BlastHSPResults* results, Uint4 total_hsp_limit)
                 if (hsp_list->hspcnt > allowed_hsp_num) {
                     /* Free the extra HSPs */
                     int hsp_index;
-                    for (hsp_index = allowed_hsp_num; 
+                    for (hsp_index = allowed_hsp_num;
                          hsp_index < hsp_list->hspcnt; ++hsp_index) {
                         Blast_HSPFree(hsp_list->hsp_array[hsp_index]);
                     }
@@ -3528,7 +3535,7 @@ s_TrimResultsByTotalHSPLimitEx(BlastHSPResults* results,
 {
     int query_index;
     Boolean  any_hsp_limit_exceeded = FALSE;
-    
+
     if (total_hsp_limit == 0) {
         return any_hsp_limit_exceeded;
     }
@@ -3608,13 +3615,13 @@ s_TrimResultsByTotalHSPLimitEx(BlastHSPResults* results,
         	 free(everything_list);
         }
     }
-        
+
     return any_hsp_limit_exceeded;
 }
 
 BlastHSPResults*
-Blast_HSPResultsFromHSPStreamWithLimit(BlastHSPStream* hsp_stream, 
-                                   Uint4 num_queries, 
+Blast_HSPResultsFromHSPStreamWithLimit(BlastHSPStream* hsp_stream,
+                                   Uint4 num_queries,
                                    SBlastHitsParameters* hit_param,
                                    Uint4 max_num_hsps,
                                    Boolean* removed_hsps)
@@ -3631,8 +3638,8 @@ Blast_HSPResultsFromHSPStreamWithLimit(BlastHSPStream* hsp_stream,
     return retval;
 }
 BlastHSPResults*
-Blast_HSPResultsFromHSPStreamWithLimitEx(BlastHSPStream* hsp_stream, 
-                                   Uint4 num_queries, 
+Blast_HSPResultsFromHSPStreamWithLimitEx(BlastHSPStream* hsp_stream,
+                                   Uint4 num_queries,
                                    SBlastHitsParameters* hit_param,
                                    Uint4 max_num_hsps,
 				   Boolean *removed_hsps)
diff --git a/c++/src/algo/blast/core/blast_hspstream_mt_utils.c b/c++/src/algo/blast/core/blast_hspstream_mt_utils.c
index 61a3488..e46e3e5 100644
--- a/c++/src/algo/blast/core/blast_hspstream_mt_utils.c
+++ b/c++/src/algo/blast/core/blast_hspstream_mt_utils.c
@@ -1,4 +1,4 @@
-/*  $Id: blast_hspstream_mt_utils.c 419225 2013-11-22 17:08:29Z camacho $
+/*  $Id: blast_hspstream_mt_utils.c 496008 2016-03-23 11:29:15Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,8 +33,8 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = 
-    "$Id: blast_hspstream_mt_utils.c 419225 2013-11-22 17:08:29Z camacho $";
+static char const rcsid[] =
+    "$Id: blast_hspstream_mt_utils.c 496008 2016-03-23 11:29:15Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include "blast_hspstream_mt_utils.h"
@@ -83,7 +83,7 @@ s_BlastHSPStreamResultsBatchArrayNew(Uint4 num_elements)
     if ( !retval ) {
         return BlastHSPStreamResultsBatchArrayFree(retval);
     }
-    num_elements = !num_elements ? 10 : num_elements;
+    num_elements = (num_elements == 0) ? 10 : num_elements;
     retval->array_of_batches = (BlastHSPStreamResultBatch**)
         calloc(num_elements, sizeof(*retval->array_of_batches));
     if ( !retval->array_of_batches ) {
@@ -94,12 +94,18 @@ s_BlastHSPStreamResultsBatchArrayNew(Uint4 num_elements)
     return retval;
 }
 
+BlastHSPStreamResultsBatchArray*
+BlastHSPStreamResultsBatchNew(void)
+{
+    return s_BlastHSPStreamResultsBatchArrayNew(1);
+}
+
 /** Append a value to the array, reallocating it if necessary
  * @param batches array to append data to [in|out]
  * @param batch value to append to array [in]
  * @return 0 on success, otherwise non-zero */
 static int
-s_BlastHSPStreamResultsBatchArrayAppend(BlastHSPStreamResultsBatchArray* batches, 
+s_BlastHSPStreamResultsBatchArrayAppend(BlastHSPStreamResultsBatchArray* batches,
                                         BlastHSPStreamResultBatch* batch)
 {
     const size_t kResizeFactor = 2;
diff --git a/c++/src/algo/blast/core/blast_hspstream_mt_utils.h b/c++/src/algo/blast/core/blast_hspstream_mt_utils.h
index 3cf3e1b..cc752e4 100644
--- a/c++/src/algo/blast/core/blast_hspstream_mt_utils.h
+++ b/c++/src/algo/blast/core/blast_hspstream_mt_utils.h
@@ -1,4 +1,4 @@
-/*  $Id: blast_hspstream_mt_utils.h 419225 2013-11-22 17:08:29Z camacho $
+/*  $Id: blast_hspstream_mt_utils.h 496008 2016-03-23 11:29:15Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -54,13 +54,22 @@ typedef struct BlastHSPStreamResultsBatchArray {
 
 /** Extracts all data from the BlastHSPStream into its output parameters.
  * @param hsp_stream The BlastHSPStream object [in]
- * @param batches Each batch contains the results for a single OID [in|out] 
+ * @param batches Each batch contains the results for a single OID [in|out]
  * kBlastHSPStream_Success on successful conversion, otherwise an error code which explains the problem.
  */
 NCBI_XBLAST_EXPORT
 int BlastHSPStreamToHSPStreamResultsBatch(BlastHSPStream* hsp_stream,
                                           BlastHSPStreamResultsBatchArray** batches);
 
+/**
+ * Creates a BlastHSPStreamResultsBatchArray with a single element.
+ * Used to mimic BlastHSPStreamToHSPStreamResultsBatch when there is no
+ * hsp_stream.
+ */
+NCBI_XBLAST_EXPORT
+BlastHSPStreamResultsBatchArray*
+BlastHSPStreamResultsBatchNew(void);
+
 /** Releases memory acquired in BlastHSPStreamToHSPStreamResultsBatch
  */
 NCBI_XBLAST_EXPORT
diff --git a/c++/src/algo/blast/core/blast_kappa.c b/c++/src/algo/blast/core/blast_kappa.c
index 710fba2..8a37d1a 100644
--- a/c++/src/algo/blast/core/blast_kappa.c
+++ b/c++/src/algo/blast/core/blast_kappa.c
@@ -1,4 +1,4 @@
-/* $Id: blast_kappa.c 484535 2015-11-12 16:03:44Z ivanov $
+/* $Id: blast_kappa.c 500367 2016-05-04 12:06:01Z ivanov $
  * ==========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-"$Id: blast_kappa.c 484535 2015-11-12 16:03:44Z ivanov $";
+"$Id: blast_kappa.c 500367 2016-05-04 12:06:01Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <float.h>
@@ -51,6 +51,12 @@ static char const rcsid[] =
 #include "blast_gapalign_priv.h"
 #include "blast_hits_priv.h"
 #include "blast_posit.h"
+#include "blast_hspstream_mt_utils.h"
+#include "blast_traceback_mt_priv.h"
+
+#ifdef _OPENMP
+#include <omp.h>
+#endif
 
 #include <algo/blast/composition_adjustment/nlm_linear_algebra.h>
 #include <algo/blast/composition_adjustment/compo_heap.h>
@@ -144,7 +150,7 @@ s_AdjustEvaluesForComposition(
     double query_eff   = MAX((query_length - length_adjustment), 1);
     double subject_eff = MAX((subject_length - length_adjustment), 1.0);
     double dblen_eff = (double) query_context->eff_searchsp / query_eff;
-    
+
     /* Scale factor to convert the database E-value to the sequence E-value */
     double db_to_sequence_scale = subject_eff / dblen_eff;
 
@@ -313,11 +319,11 @@ s_HSPListFromDistinctAlignments(BlastHSPList *hsp_list,
         BlastHSP * new_hsp = NULL;
         GapEditScript * editScript = align->context;
         align->context = NULL;
-        
+
         status = Blast_HSPInit(align->queryStart, align->queryEnd,
                                align->matchStart, align->matchEnd,
                                unknown_value, unknown_value,
-                               align->queryIndex, 
+                               align->queryIndex,
                                frame, (Int2) align->frame, align->score,
                                &editScript, &new_hsp);
         switch (align->matrix_adjust_rule) {
@@ -364,7 +370,7 @@ s_HSPListFromDistinctAlignments(BlastHSPList *hsp_list,
  * @param subject_length   length of the subject sequence
  * @param program_number   the type of BLAST search being performed
  * @param queryInfo        information about the queries
- * @param context_index      the index of the query corresponding to 
+ * @param context_index      the index of the query corresponding to
  *                         the HSPs in hsp_list
  * @param sbp              the score block for this search
  * @param hitParams        parameters used to assign evalues and
@@ -429,7 +435,7 @@ s_HitlistEvaluateAndPurge(int * pbestScore, double *pbestEvalue,
 
 /** Compute the number of identities for the HSPs in the hsp_list
  * @note Should work for blastp and tblastn now.
- * 
+ *
  * @param query_blk the query sequence data [in]
  * @param query_info structure describing the query_blk structure [in]
  * @param seq_src source of subject sequence data [in]
@@ -492,9 +498,9 @@ s_ComputeNumIdentities(const BLAST_SequenceBlk* query_blk,
             query = query_blk->oof_sequence + CODON_LENGTH + context_offset;
             query_nomask = query_blk->oof_sequence + CODON_LENGTH + context_offset;
         } else {
-            query = query_blk->sequence + 
+            query = query_blk->sequence +
                 query_info->contexts[hsp->context].query_offset;
-            query_nomask = query_blk->sequence_nomask + 
+            query_nomask = query_blk->sequence_nomask +
                 query_info->contexts[hsp->context].query_offset;
         }
 
@@ -524,8 +530,8 @@ s_ComputeNumIdentities(const BLAST_SequenceBlk* query_blk,
 static double
 s_CalcLambda(double probs[], int min_score, int max_score, double lambda0)
 {
-   
-    int i;                 /* loop index */      
+
+    int i;                 /* loop index */
     int score_range;       /* range of possible scores */
     double avg;            /* expected score of aligning two characters */
     Blast_ScoreFreq freq;  /* score frequency data */
@@ -673,7 +679,7 @@ s_ScalePosMatrix(int ** fillPosMatrix,
                  BlastScoreBlk* sbp,
                  double scale_factor)
 {
-    /* Data used by scaling routines */    
+    /* Data used by scaling routines */
     Kappa_posSearchItems *posSearch = NULL;
     /* A reduced collection of search parameters used by PSI-blast */
     Kappa_compactSearchItems *compactSearch = NULL;
@@ -755,8 +761,8 @@ s_ResultHspToDistinctAlign(BlastCompo_Alignment **self,
     for (frame_index = 0; frame_index < 6; frame_index++) {
         tail[frame_index] = NULL;
         numAligns[frame_index] = 0;
-    } 
-    
+    }
+
     for (hsp_index = 0;  hsp_index < hspcnt;  hsp_index++) {
         BlastHSP * hsp = hsp_array[hsp_index]; /* current HSP */
         BlastCompo_Alignment * new_align;      /* newly-created alignment */
@@ -770,7 +776,7 @@ s_ResultHspToDistinctAlign(BlastCompo_Alignment **self,
             BlastCompo_AlignmentNew((int) (hsp->score * localScalingFactor),
                                     eDontAdjustMatrix,
                                     hsp->query.offset, hsp->query.end, hsp->context,
-                                    hsp->subject.offset, hsp->subject.end, 
+                                    hsp->subject.offset, hsp->subject.end,
                                     hsp->subject.frame, hsp);
         if (new_align == NULL) /* out of memory */
             return -1;
@@ -946,7 +952,7 @@ static int s_ExtendRight(Uint1* query_seq, int query_len,
             /* mismatches */
             if (query_seq[q_pos + n] == subject_seq[s_pos + n]
                 && query_seq[q_pos + n + 1] == subject_seq[s_pos + n + 1]) {
-                
+
                 /* we have already checked that two positions behind mismatches
                    match so we can advance further */
                 q_pos += n + 2;
@@ -958,7 +964,7 @@ static int s_ExtendRight(Uint1* query_seq, int query_len,
             /* gap in subject */
             if (!match && query_seq[q_pos + n] == subject_seq[s_pos]
                 && query_seq[q_pos + n + 1] == subject_seq[s_pos + 1]) {
-                
+
                 q_pos += n + 2;
                 s_pos += 2;
                 num_identical += 2;
@@ -993,7 +999,7 @@ static int s_ExtendRight(Uint1* query_seq, int query_len,
 }
 
 
-/** 
+/**
  * Extend left from the end of the sequence and subject ranges and count
  * identities. The extension stops when there are more than max_shift
  * mismatches or mismatches or gaps are not followed by two identical matches.
@@ -1081,7 +1087,7 @@ static int s_ExtendLeft(Uint1* query_seq, int query_len,
 }
 
 
-/** 
+/**
  * Get hash for a word of word_size residues assuming 28-letter alphabet
  *
  * @param data Sequence [in]
@@ -1100,7 +1106,7 @@ static Uint8 s_GetHash(const Uint1* data, int word_size)
 }
 
 
-/** 
+/**
  * Find a local number of identical residues in two aligned sequences by
  * finding word matches and doing a simple gapped extensions from the word hits
  *
@@ -1153,7 +1159,7 @@ static int s_FindNumIdentical(Uint1* query_seq,
             hash += subject_seq[s_pos + word_size - 1];
         }
 
-        /* find matching query word; index of hash is position of the word 
+        /* find matching query word; index of hash is position of the word
            the query */
         for (q_pos = query_from;q_pos < query_len - word_size; q_pos++) {
             if (query_hashes[q_pos] == hash) {
@@ -1169,7 +1175,7 @@ static int s_FindNumIdentical(Uint1* query_seq,
             int query_left_len, query_right_len;
             int subject_left_len, subject_right_len;
             int align_len_left=0, align_len_right=0;
-            
+
             match = TRUE;
             num_identical += word_size;
 
@@ -1468,7 +1474,7 @@ s_SequenceGetTranslatedRange(const BlastCompo_MatchingSequence * self,
     int translation_start;   /* location in na_sequence to start
                                 translating */
     int num_nucleotides;     /* the number of nucleotides to be translated */
-    
+
     local_data = self->local_data;
     na_sequence = local_data->seq_arg.seq->sequence_start;
 
@@ -1486,7 +1492,7 @@ s_SequenceGetTranslatedRange(const BlastCompo_MatchingSequence * self,
     }
     num_nucleotides =
         3 * (range->end - range->begin) + ABS(translation_frame) - 1;
-    
+
     status = Blast_GetPartialTranslation(na_sequence + translation_start,
                                          num_nucleotides,
                                          (Int2) translation_frame,
@@ -1533,7 +1539,7 @@ s_SequenceGetTranslatedRange(const BlastCompo_MatchingSequence * self,
  * @param seqData       the resulting data [out]
  * @param queryData     the query sequence [in]
  * @param queryOffset   offset for align if there are multiple queries
- * @param align          information about the alignment 
+ * @param align          information about the alignment
  *                         between query and subject [in]
  * @param shouldTestIdentical did alignment pass a preliminary test in
  *                       redo_alignment.c that indicates the sequence
@@ -1578,12 +1584,11 @@ s_SequenceGetProteinRange(const BlastCompo_MatchingSequence * self,
                             : seq->sequence;
     for (idx = 0;  idx < seqData->length;  idx++) {
         /* Copy the sequence data, replacing occurrences of amino acid
-         * number 24 (Selenocysteine) with number 21 (Undetermined or
-         * atypical). */
+         * number 24 (Selenocysteine) with number 3 (Cysteine). */
         if (origData[idx] != 24) {
             seqData->data[idx] = origData[idx];
         } else {
-            seqData->data[idx] = 21;
+            seqData->data[idx] = 3;
         }
     }
 
@@ -1656,9 +1661,8 @@ s_SequenceGetRange(const BlastCompo_MatchingSequence * self,
 
     for (idx = 0;  idx < queryData->length;  idx++) {
         /* Copy the sequence data, replacing occurrences of amino acid
-         * number 24 (Selenocysteine) with number 21 (Undetermined or
-         * atypical). */
-        queryData->data[idx] = (origData[idx] != 24) ? origData[idx] : 21;
+         * number 24 (Selenocysteine) with number 3 (Cysteine). */
+        queryData->data[idx] = (origData[idx] != 24) ? origData[idx] : 3;
     }
     if (seq_info && seq_info->prog_number ==  eBlastTypeTblastn) {
         /* The sequence must be translated. */
@@ -1668,7 +1672,7 @@ s_SequenceGetRange(const BlastCompo_MatchingSequence * self,
                                             compo_adjust_mode, isSmithWaterman,
                                             subject_maybe_biased);
     } else {
-        return s_SequenceGetProteinRange(self, s_range, seqData, 
+        return s_SequenceGetProteinRange(self, s_range, seqData,
                                          q_range, queryData, query_words,
                                          align, shouldTestIdentical,
                                          compo_adjust_mode, isSmithWaterman,
@@ -2031,7 +2035,7 @@ s_RecordInitialSearch(BlastKappa_SavedParameters * searchParams,
     searchParams->gapExtend    = scoring->gap_extend;
     searchParams->scale_factor = scoring->scale_factor;
 
-    for (i = 0;  i < searchParams->num_queries;  i++) { 
+    for (i = 0;  i < searchParams->num_queries;  i++) {
         if (sbp->kbp_gap[i] != NULL) {
             /* There is a kbp_gap for query i and it must be copied */
             searchParams->kbp_gap_orig[i] = Blast_KarlinBlkNew();
@@ -2223,7 +2227,7 @@ s_CreateWordArray(const Uint1* seq_data, Int4 seq_len, Uint8** words)
         return -1;
     }
 
-    
+
     /* find query word hashes */
     query_hashes[0] = s_GetHash(&seq_data[0], word_size);
     for (i = 1; i < seq_len - word_size; i++) {
@@ -2251,7 +2255,7 @@ static void s_FreeBlastCompo_QueryInfoArray(BlastCompo_QueryInfo** query_info,
             free((*query_info)[i].words);
         }
     }
-    
+
     free(*query_info);
     *query_info = NULL;
 }
@@ -2330,7 +2334,7 @@ s_GappingParamsNew(BlastKappa_GappingParamsContext * context,
         gapping_params->gap_extend = scoring->gap_extend;
         gapping_params->context = context;
     }
-    
+
     for (i = 0;  i < num_queries;  i++) {
         if (context->sbp->kbp_gap[i] != NULL &&
             context->sbp->kbp_gap[i]->Lambda < min_lambda) {
@@ -2356,9 +2360,9 @@ redo_align_callbacks = {
 
 /* Bit score per alignment position threshold for preliminaru near identical
    test */
-#define NEAR_IDENTICAL_BITS_PER_POSITION (1.8)
+#define NEAR_IDENTICAL_BITS_PER_POSITION (1.75)
 
-/** 
+/**
  * Read the parameters required for the Blast_RedoOneMatch* functions from
  * the corresponding parameters in standard BLAST datatypes.  Return a new
  * object representing these parameters.
@@ -2406,7 +2410,7 @@ s_GetAlignParams(BlastKappa_GappingParamsContext * context,
 		break;
 	}
     }
-    
+
     if (do_link_hsps) {
         ASSERT(hitParams->link_hsp_params != NULL);
         cutoff_s =
@@ -2457,7 +2461,7 @@ s_FillResultsFromCompoHeaps(BlastHSPResults * results,
     int query_index;   /* loop index */
     int num_queries;   /* Number of queries in this search */
 
-    num_queries = results->num_queries; 
+    num_queries = results->num_queries;
     for (query_index = 0;  query_index < num_queries;  query_index++) {
         BlastHSPList* hsp_list;
         BlastHitList* hitlist;
@@ -2486,13 +2490,423 @@ static void s_ClearHeap(BlastCompo_Heap * self)
 
 extern void
 BLAST_SetupPartialFetching(EBlastProgramType program_number,
-                           BlastSeqSrc* seq_src, 
+                           BlastSeqSrc* seq_src,
                            const BlastHSPList** hsp_list,
                            Int4 num_hsplists);
 
 /**
+ * Free a BlastGapAlignStruct copy created by s_BlastGapAlignStruct_Copy
+ *
+ * @param copy Pointer to BlastGapAlignStruct to be freed
+ */
+static void s_BlastGapAlignStruct_Free(BlastGapAlignStruct* copy)
+{
+    {
+        while (copy->state_struct != NULL) {
+            GapStateArrayStruct* cur = copy->state_struct;
+            copy->state_struct = copy->state_struct->next;
+            if (cur->state_array) {
+                sfree(cur->state_array);
+            }
+            if (cur) {
+                sfree(cur);
+            }
+        }
+    }
+    {
+        if (copy->edit_script != NULL) {
+            if (copy->edit_script->op_type) {
+                sfree(copy->edit_script->op_type);
+            }
+            if (copy->edit_script->num) {
+                sfree(copy->edit_script->num);
+            }
+            sfree(copy->edit_script);
+        }
+    }
+    {
+        if (copy->fwd_prelim_tback != NULL) {
+            if (copy->fwd_prelim_tback->edit_ops) {
+                sfree(copy->fwd_prelim_tback->edit_ops);
+            }
+            sfree(copy->fwd_prelim_tback);
+        }
+    }
+    {
+        if (copy->rev_prelim_tback != NULL) {
+            if (copy->rev_prelim_tback->edit_ops) {
+                sfree(copy->rev_prelim_tback->edit_ops);
+            }
+            sfree(copy->rev_prelim_tback);
+        }
+    }
+    {
+        if (copy->greedy_align_mem != NULL) {
+            sfree(copy->greedy_align_mem);
+        }
+    }
+    {
+        if (copy->dp_mem != NULL) {
+            sfree(copy->dp_mem);
+        }
+    }
+    {
+        if (copy->sbp != NULL) {
+            sfree(copy->sbp);
+        }
+    }
+    sfree(copy);
+}
+
+/**
+ * Create a "deep" copy of a BlastGapAlignStruct structure.
+ *
+ * Non-pointer structure members are copied.  Pointers to data which will
+ * only be read are copied.  For data which will be changing, memory for copies
+ * will be allocated and new pointers will be assigned to them.  The process
+ * repeats down the structure hierarchy until all pointers are dealt with.
+ *
+ * @param orig Pointer to BlastGapAlignStruct structure to be copied
+ * @param sbp  Pointer to BlastScoreBlk structure, required to set copy->sbp
+ *
+ * @return Pointer to copy of original BlastGapAlignStruct structure
+ */
+static BlastGapAlignStruct* s_BlastGapAlignStruct_Copy(
+        BlastGapAlignStruct* orig,
+        BlastScoreBlk* sbp
+)
+{
+    BlastGapAlignStruct* copy =
+            (BlastGapAlignStruct*) calloc(1, sizeof(BlastGapAlignStruct));
+
+    // Copy plain old data (ints, doubles, booleans, ...).
+    // Any pointer members will be processed separately.
+    memcpy(copy, orig, sizeof(BlastGapAlignStruct));
+
+    {
+        GapStateArrayStruct* o = orig->state_struct;
+        if (o != NULL) {
+            GapStateArrayStruct* c = (GapStateArrayStruct*) calloc(
+                    1,
+                    sizeof(GapStateArrayStruct)
+            );
+            copy->state_struct = c;
+            memcpy(c, o, sizeof(GapStateArrayStruct));
+            c->state_array = (Uint1*) calloc(c->length, sizeof(Uint1));
+            int i;
+            for (i = 0; i < c->length; ++i) {
+                c->state_array[i] = o->state_array[i];
+            }
+            while (o->next != NULL) {
+                c->next = (GapStateArrayStruct*)
+                        calloc(1, sizeof(GapStateArrayStruct));
+                c = c->next;
+                o = o->next;
+                memcpy(c, o, sizeof(GapStateArrayStruct));
+                c->state_array = (Uint1*) calloc(c->length, sizeof(Uint1));
+                int i;
+                for (i = 0; i < c->length; ++i) {
+                    c->state_array[i] = o->state_array[i];
+                }
+            }
+        }
+    }
+    {
+        GapEditScript* o = orig->edit_script;
+        if (o != NULL) {
+            GapEditScript* c = (GapEditScript*) calloc(
+                    1,
+                    sizeof(GapEditScript)
+            );
+            copy->edit_script = c;
+            memcpy(c, o, sizeof(GapEditScript));
+            c->op_type = (EGapAlignOpType*) calloc(
+                    o->size,
+                    sizeof(EGapAlignOpType)
+            );
+            c->num = (Int4*) calloc(o->size, sizeof(Int4));
+            int i;
+            for (i = 0; i < o->size; ++i) {
+                c->op_type[i] = o->op_type[i];
+                c->num[i] = o->num[i];
+            }
+        }
+    }
+    {
+        GapPrelimEditBlock* o = orig->fwd_prelim_tback;
+        if (o != NULL) {
+            GapPrelimEditBlock* c = (GapPrelimEditBlock*) calloc(
+                    1,
+                    sizeof(GapPrelimEditBlock)
+            );
+            copy->fwd_prelim_tback = c;
+            memcpy(c, o, sizeof(GapPrelimEditBlock));
+            c->edit_ops = calloc(
+                    o->num_ops_allocated,
+                    sizeof(GapPrelimEditScript)
+            );
+            int i;
+            for (i = 0; i < o->num_ops_allocated; ++i) {
+                c->edit_ops[i].op_type = o->edit_ops[i].op_type;
+                c->edit_ops[i].num = o->edit_ops[i].num;
+            }
+        }
+    }
+    {
+        GapPrelimEditBlock* o = orig->rev_prelim_tback;
+        if (o != NULL) {
+            GapPrelimEditBlock* c = (GapPrelimEditBlock*) calloc(
+                    1,
+                    sizeof(GapPrelimEditBlock)
+            );
+            copy->rev_prelim_tback = c;
+            memcpy(c, o, sizeof(GapPrelimEditBlock));
+            c->edit_ops = calloc(
+                    o->num_ops_allocated,
+                    sizeof(GapPrelimEditScript)
+            );
+            int i;
+            for (i = 0; i < o->num_ops_allocated; ++i) {
+                c->edit_ops[i].op_type = o->edit_ops[i].op_type;
+                c->edit_ops[i].num = o->edit_ops[i].num;
+            }
+        }
+    }
+    {
+        SGreedyAlignMem* o = orig->greedy_align_mem;
+        if (o != NULL) {
+            SGreedyAlignMem* c = (SGreedyAlignMem*) calloc(
+                    1,
+                    sizeof(SGreedyAlignMem)
+            );
+            copy->greedy_align_mem = c;
+            memcpy(c, o, sizeof(SGreedyAlignMem));
+        }
+    }
+    {
+        BlastGapDP* o = orig->dp_mem;
+        if (o != NULL) {
+            BlastGapDP* c = (BlastGapDP*) calloc(
+                    orig->dp_mem_alloc,
+                    sizeof(BlastGapDP)
+            );
+            copy->dp_mem = c;
+            memcpy(c, o, orig->dp_mem_alloc * sizeof(BlastGapDP));
+        }
+    }
+    {
+        copy->sbp = sbp;
+    }
+
+    return copy;
+}
+
+/**
+ * Free a BlastScoreBlk copy created by s_BlastScoreBlk_Copy
+ *
+ * BlastScoreBlk* pointer "bsb_ptr" should be passed as (&bsb_ptr);
+ * this function will set bsb_ptr to NULL before returning.
+ *
+ * @param copy Pointer to (pointer to BlastScoreBlk to be freed)
+ */
+static
+void s_BlastScoreBlk_Free(BlastScoreBlk** copy)
+{
+    BlastScoreBlkFree(*copy);
+    *copy = NULL;
+}
+
+/**
+ * Create a "deep" copy of a BlastScoreBlk structure.
+ *
+ * Non-pointer structure members are copied.  Pointers to data which will
+ * only be read are copied.  For data which will be changing, memory for copies
+ * will be allocated and new pointers will be assigned to them.  The process
+ * repeats down the structure hierarchy until all pointers are dealt with.
+ *
+ * @param program            The program type
+ * @param orig               Pointer to BlastScoreBlk structure to be copied
+ * @param alphabet_code      Alphabet code
+ * @param number_of_contexts Number of contexts
+ *
+ * @return Pointer to copy of original BlastScoreBlk structure
+ */
+static
+BlastScoreBlk* s_BlastScoreBlk_Copy(
+        EBlastProgramType program,
+        BlastScoreBlk* orig,
+        Uint1 alphabet_code,
+        Int4 number_of_contexts
+)
+{
+    BlastScoreBlk* copy = BlastScoreBlkNew(
+            orig->alphabet_code,
+            orig->number_of_contexts
+    );
+    if (copy == NULL) {
+        return NULL;
+    }
+
+    copy->alphabet_start = orig->alphabet_start;
+    copy->name = strdup(orig->name);
+    copy->comments = orig->comments;
+    /* Deep-copy orig->matrix */
+    if (orig->matrix != NULL) {
+        if (copy->matrix == NULL) {
+            return BlastScoreBlkFree(copy);
+        }
+        SBlastScoreMatrix* m = copy->matrix;
+        if (m->data != NULL  &&  orig->matrix->data != NULL) {
+            int i;
+            for (i = 0; i < orig->matrix->ncols; ++i) {
+                memcpy(
+                        m->data[i],
+                        orig->matrix->data[i],
+                        m->nrows * sizeof(int)
+                );
+            }
+        }
+        if (m->freqs != NULL  &&  orig->matrix->freqs != NULL) {
+            memcpy(
+                    m->freqs,
+                    orig->matrix->freqs,
+                    m->ncols * sizeof(double)
+            );
+        }
+        m->lambda = orig->matrix->lambda;
+    }
+    /* Deep-copy orig->psi_matrix */
+    if (orig->psi_matrix != NULL
+            &&  orig->psi_matrix->pssm != NULL) {
+        copy->psi_matrix = SPsiBlastScoreMatrixNew(orig->psi_matrix->pssm->ncols);
+        if (copy->psi_matrix == NULL) {
+            return BlastScoreBlkFree(copy);
+        }
+        SPsiBlastScoreMatrix* pm = copy->psi_matrix;
+        SBlastScoreMatrix* m = pm->pssm;
+        if (m->data != NULL  &&  orig->psi_matrix->pssm->data != NULL) {
+            int i;
+            for (i = 0; i < orig->psi_matrix->pssm->ncols; ++i) {
+                memcpy(
+                        m->data[i],
+                        orig->psi_matrix->pssm->data[i],
+                        m->nrows * sizeof(int)
+                );
+            }
+        }
+        if (m->freqs != NULL
+                &&  orig->psi_matrix->pssm->freqs != NULL) {
+            memcpy(
+                    m->freqs,
+                    orig->psi_matrix->pssm->freqs,
+                    m->ncols * sizeof(double)
+            );
+        }
+        m->lambda = orig->psi_matrix->pssm->lambda;
+        if (pm->freq_ratios != NULL
+                &&  orig->psi_matrix->freq_ratios != NULL) {
+            int i;
+            for (i = 0; i < orig->psi_matrix->pssm->ncols; ++i) {
+                memcpy(
+                        pm->freq_ratios[i],
+                        orig->psi_matrix->freq_ratios[i],
+                        orig->psi_matrix->pssm->nrows * sizeof(double)
+                );
+            }
+        }
+        if (orig->psi_matrix->kbp != NULL) {
+            memcpy(pm->kbp, orig->psi_matrix->kbp, sizeof(Blast_KarlinBlk));
+        }
+    }
+    copy->matrix_only_scoring = orig->matrix_only_scoring;
+    copy->complexity_adjusted_scoring = orig->complexity_adjusted_scoring;
+    copy->loscore = orig->loscore;
+    copy->hiscore = orig->hiscore;
+    copy->penalty = orig->penalty;
+    copy->reward = orig->reward;
+    copy->read_in_matrix = orig->read_in_matrix;
+    if (Blast_QueryIsPssm(program)) {
+        copy->kbp     = copy->kbp_psi;
+        copy->kbp_gap = copy->kbp_gap_psi;
+    } else {
+        copy->kbp     = copy->kbp_std;
+        copy->kbp_gap = copy->kbp_gap_std;
+    }
+    if (orig->gbp != NULL) {
+        memcpy(copy->gbp, orig->gbp, sizeof(Blast_GumbelBlk));
+    }
+    int ctx;
+    for (ctx = 0; ctx < orig->number_of_contexts; ++ctx) {
+        if (orig->sfp != NULL  &&  orig->sfp[ctx] != NULL) {
+            copy->sfp[ctx] = Blast_ScoreFreqNew(
+                    orig->sfp[ctx]->score_min,
+                    orig->sfp[ctx]->score_max
+            );
+            if (copy->sfp[ctx] == NULL) {
+                return BlastScoreBlkFree(copy);
+            }
+            copy->sfp[ctx]->obs_min = orig->sfp[ctx]->obs_min;
+            copy->sfp[ctx]->obs_max = orig->sfp[ctx]->obs_max;
+            copy->sfp[ctx]->score_avg = orig->sfp[ctx]->score_avg;
+            int r = orig->sfp[ctx]->score_max - orig->sfp[ctx]->score_min + 1;
+            memcpy(
+                    copy->sfp[ctx]->sprob0,
+                    orig->sfp[ctx]->sprob0,
+                    r * sizeof(double)
+            );
+        }
+        if (orig->kbp_std != NULL  &&  orig->kbp_std[ctx] != NULL) {
+            copy->kbp_std[ctx] = Blast_KarlinBlkNew();
+            if (Blast_KarlinBlkCopy(copy->kbp_std[ctx], orig->kbp_std[ctx]) != 0) {
+                return BlastScoreBlkFree(copy);
+            }
+        }
+        if (orig->kbp_gap_std != NULL  &&  orig->kbp_gap_std[ctx] != NULL) {
+            copy->kbp_gap_std[ctx] = Blast_KarlinBlkNew();
+            if (Blast_KarlinBlkCopy(copy->kbp_gap_std[ctx], orig->kbp_gap_std[ctx]) != 0) {
+                return BlastScoreBlkFree(copy);
+            }
+        }
+        if (orig->kbp_psi != NULL  &&  orig->kbp_psi[ctx] != NULL) {
+            copy->kbp_psi[ctx] = Blast_KarlinBlkNew();
+            if (Blast_KarlinBlkCopy(copy->kbp_psi[ctx], orig->kbp_psi[ctx]) != 0) {
+                return BlastScoreBlkFree(copy);
+            }
+        }
+        if (orig->kbp_gap_psi != NULL  &&  orig->kbp_gap_psi[ctx] != NULL) {
+            copy->kbp_gap_psi[ctx] = Blast_KarlinBlkNew();
+            if (Blast_KarlinBlkCopy(copy->kbp_gap_psi[ctx], orig->kbp_gap_psi[ctx]) != 0) {
+                return BlastScoreBlkFree(copy);
+            }
+        }
+        if (Blast_QueryIsPssm(program)) {
+            copy->kbp[ctx]     = copy->kbp_psi[ctx];
+            copy->kbp_gap[ctx] = copy->kbp_gap_psi[ctx];
+        } else {
+            copy->kbp[ctx]     = copy->kbp_std[ctx];
+            copy->kbp_gap[ctx] = copy->kbp_gap_std[ctx];
+        }
+    }
+    if (orig->kbp_ideal != NULL) {
+        copy->kbp_ideal = Blast_KarlinBlkNew();
+        if (Blast_KarlinBlkCopy(copy->kbp_ideal, orig->kbp_ideal) != 0) {
+            return BlastScoreBlkFree(copy);
+        }
+    }
+    copy->ambiguous_res = (Uint1*) calloc(orig->ambig_size, sizeof(Uint1));
+    if (orig->ambiguous_res != NULL) {
+        memcpy(copy->ambiguous_res, orig->ambiguous_res, orig->ambig_size);
+    }
+    copy->ambig_size = orig->ambig_size;
+    copy->ambig_occupy = orig->ambig_occupy;
+    copy->round_down = orig->round_down;
+
+    return copy;
+}
+
+/**
  *  Recompute alignments for each match found by the gapped BLAST
- *  algorithm.
+ *  algorithm.  Single-thread adapter to Blast_RedoAlignmentCore_MT.
  */
 Int2
 Blast_RedoAlignmentCore(EBlastProgramType program_number,
@@ -2510,29 +2924,61 @@ Blast_RedoAlignmentCore(EBlastProgramType program_number,
                         const PSIBlastOptions* psiOptions,
                         BlastHSPResults* results)
 {
+    return Blast_RedoAlignmentCore_MT(
+            program_number,
+            1,                  /* number of threads */
+            queryBlk,
+            queryInfo,
+            sbp,
+            subjectBlk,
+            seqSrc,
+            default_db_genetic_code,
+            thisMatch,
+            hsp_stream,
+            scoringParams,
+            extendParams,
+            hitParams,
+            psiOptions,
+            results
+    );
+}
+
+/**
+ *  Recompute alignments for each match found by the gapped BLAST
+ *  algorithm.
+ */
+Int2
+Blast_RedoAlignmentCore_MT(EBlastProgramType program_number,
+                           Uint4 num_threads,
+                           BLAST_SequenceBlk * queryBlk,
+                           const BlastQueryInfo* queryInfo,
+                           BlastScoreBlk* sbp,
+                           BLAST_SequenceBlk * subjectBlk,
+                           const BlastSeqSrc* seqSrc,
+                           Int4 default_db_genetic_code,
+                           BlastHSPList * thisMatch,
+                           BlastHSPStream* hsp_stream,
+                           BlastScoringParameters* scoringParams,
+                           const BlastExtensionParameters* extendParams,
+                           const BlastHitSavingParameters* hitParams,
+                           const PSIBlastOptions* psiOptions,
+                           BlastHSPResults* results)
+{
     int status_code = 0;                    /* return value code */
     /* the factor by which to scale the scoring system in order to
      * obtain greater precision */
     double localScalingFactor;
-    /* the values of the search parameters that will be recorded, altered
-     * in the search structure in this routine, and then restored before
-     * the routine exits. */
-    BlastKappa_SavedParameters *savedParams = NULL;
     /* forbidden ranges for each database position (used in
      * Smith-Waterman alignments) */
     Blast_ForbiddenRanges forbidden = {0,};
     /* a collection of alignments for each query sequence with
      * sequences from the database */
-    BlastCompo_Heap * redoneMatches = NULL;
+    BlastCompo_Heap* redoneMatches = NULL;
     /* stores all fields needed for computing a compositionally
      * adjusted score matrix using Newton's method */
-    Blast_CompositionWorkspace *NRrecord = NULL;
+    Blast_CompositionWorkspace** NRrecord_tld = NULL;
     /* loop index */
     int query_index;
-    /* context number */
-    int context_index;
-    /* frame number */
-    int frame_index;
     /* number of queries in the concatenated query */
     int numQueries = queryInfo->num_queries;
     /* number of contexts in the concatenated query */
@@ -2541,28 +2987,23 @@ Blast_RedoAlignmentCore(EBlastProgramType program_number,
     int numFrames = (program_number == eBlastTypeBlastx) ? 6:1;
     /* keeps track of gapped alignment params */
     BlastGapAlignStruct* gapAlign = NULL;
-    /* All alignments above this value will be reported, no matter how
-     * many. */
+    /* the values of the search parameters that will be recorded, altered
+     * in the search structure in this routine, and then restored before
+     * the routine exits. */
+    BlastKappa_SavedParameters *savedParams = NULL;
+    /* All alignments above this value will be reported, no matter how many. */
     double inclusion_ethresh;
-    /* array of lists of alignments for each query to this subject */
-    BlastCompo_Alignment ** alignments = NULL;
 
-    BlastCompo_QueryInfo * query_info = NULL;
-    Blast_RedoAlignParams * redo_align_params = NULL;
+    BlastHSPResults* local_results = NULL;
+
+    BlastCompo_QueryInfo** query_info_tld = NULL;
+    Blast_RedoAlignParams** redo_align_params_tld = NULL;
     Boolean positionBased = (Boolean) (sbp->psi_matrix != NULL);
     ECompoAdjustModes compo_adjust_mode =
         (ECompoAdjustModes) extendParams->options->compositionBasedStats;
     Boolean smithWaterman =
         (Boolean) (extendParams->options->eTbackExt == eSmithWatermanTbck);
-    /* existing alignments for a match */
-    BlastCompo_Alignment ** incoming_align_set = NULL;
-    BlastCompo_Alignment * incoming_aligns = NULL;
-    Int4      **matrix;                   /* score matrix */
-    BlastKappa_GappingParamsContext gapping_params_context;
-
-    double pvalueForThisPair = (-1); /* p-value for this match
-                                        for composition; -1 == no adjustment*/
-    double LambdaRatio; /*lambda ratio*/
+
     /* which test function do we use to see if a composition-adjusted
        p-value is desired; value needs to be passed in eventually*/
     int compositionTestIndex = extendParams->options->unifiedP;
@@ -2574,15 +3015,6 @@ Blast_RedoAlignmentCore(EBlastProgramType program_number,
            program_number == eBlastTypePsiBlast ||
            program_number == eBlastTypeRpsBlast);
 
-    if (positionBased) {
-        matrix = sbp->psi_matrix->pssm->data;
-    } else {
-        matrix = sbp->matrix->data;
-    }
-    /**** Validate parameters *************/
-    if (matrix == NULL) {
-        return -1;
-    }
     if (0 == strcmp(scoringParams->options->matrix, "BLOSUM62_20") &&
         compo_adjust_mode == eNoCompositionBasedStats) {
         return -1;                   /* BLOSUM62_20 only makes sense if
@@ -2605,10 +3037,15 @@ Blast_RedoAlignmentCore(EBlastProgramType program_number,
     }
     /*****************/
     inclusion_ethresh = (psiOptions /* this can be NULL for CBl2Seq */
-                         ? psiOptions->inclusion_ethresh 
+                         ? psiOptions->inclusion_ethresh
                          : PSI_INCLUSION_ETHRESH);
     ASSERT(inclusion_ethresh != 0.0);
 
+    int actual_num_threads = 1;
+#ifdef _OPENMP
+    actual_num_threads = num_threads;
+#endif
+
     /* Initialize savedParams */
     savedParams =
         s_SavedParametersNew(queryInfo->max_length, numContexts,
@@ -2624,6 +3061,7 @@ Blast_RedoAlignmentCore(EBlastProgramType program_number,
     if (status_code != 0) {
         goto function_cleanup;
     }
+
     if (compo_adjust_mode != eNoCompositionBasedStats) {
         if((0 == strcmp(scoringParams->options->matrix, "BLOSUM62_20"))) {
             localScalingFactor = SCALING_FACTOR / 10;
@@ -2636,31 +3074,12 @@ Blast_RedoAlignmentCore(EBlastProgramType program_number,
     s_RescaleSearch(sbp, scoringParams, numContexts, localScalingFactor);
     status_code =
         BLAST_GapAlignStructNew(scoringParams, extendParams,
-                                (seqSrc) ?  BlastSeqSrcGetMaxSeqLen(seqSrc) 
+                                (seqSrc) ?  BlastSeqSrcGetMaxSeqLen(seqSrc)
                                          :  subjectBlk->length,
                                 sbp, &gapAlign);
     if (status_code != 0) {
         return (Int2) status_code;
     }
-    gapping_params_context.gap_align = gapAlign;
-    gapping_params_context.scoringParams = scoringParams;
-    gapping_params_context.sbp = sbp;
-    gapping_params_context.localScalingFactor = localScalingFactor;
-    gapping_params_context.prog_number = program_number;
-    redo_align_params =
-        s_GetAlignParams(&gapping_params_context, queryBlk, queryInfo, 
-                         hitParams, extendParams);
-    if (redo_align_params == NULL) {
-        status_code = -1;
-        goto function_cleanup;
-    }
-
-    query_info = s_GetQueryInfo(queryBlk->sequence, queryInfo, 
-                                (program_number == eBlastTypeBlastx));
-    if (query_info == NULL) {
-        status_code = -1;
-        goto function_cleanup;
-    }
 
     if(smithWaterman) {
         status_code =
@@ -2683,219 +3102,684 @@ Blast_RedoAlignmentCore(EBlastProgramType program_number,
             goto function_cleanup;
         }
     }
-    if( (int) compo_adjust_mode > 1 && !positionBased ) {
-        NRrecord = Blast_CompositionWorkspaceNew();
-        status_code =
-            Blast_CompositionWorkspaceInit(NRrecord,
-                                           scoringParams->options->matrix);
-        if (status_code != 0) {
+
+    BlastCompo_Heap** redoneMatches_tld =
+            (BlastCompo_Heap**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastCompo_Heap*)
+            );
+    BlastCompo_Alignment*** alignments_tld =
+            (BlastCompo_Alignment***) calloc(
+                    actual_num_threads,
+                    sizeof(BlastCompo_Alignment**)
+            );
+    BlastCompo_Alignment*** incoming_align_set_tld =
+            (BlastCompo_Alignment***) calloc(
+                    actual_num_threads,
+                    sizeof(BlastCompo_Alignment**)
+            );
+    BlastKappa_SavedParameters** savedParams_tld =
+            (BlastKappa_SavedParameters**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastKappa_SavedParameters*)
+            );
+    BlastScoreBlk** sbp_tld =
+            (BlastScoreBlk**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastScoreBlk*)
+            );
+    BlastKappa_GappingParamsContext* gapping_params_context_tld =
+            (BlastKappa_GappingParamsContext*) calloc(
+                    actual_num_threads,
+                    sizeof(BlastKappa_GappingParamsContext)
+            );
+    Int4*** matrix_tld =
+            (Int4***) calloc(
+                    actual_num_threads,
+                    sizeof(Int4**)
+            );
+
+    NRrecord_tld =
+            (Blast_CompositionWorkspace**) calloc(
+                    actual_num_threads,
+                    sizeof(Blast_CompositionWorkspace*)
+            );
+
+    redo_align_params_tld =
+            (Blast_RedoAlignParams**) calloc(
+                    actual_num_threads,
+                    sizeof(Blast_RedoAlignParams*)
+            );
+    int* status_code_tld =
+            (int*) calloc(
+                    actual_num_threads,
+                    sizeof(int)
+            );
+    BlastSeqSrc** seqsrc_tld =
+            (BlastSeqSrc**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastSeqSrc*)
+            );
+    BlastGapAlignStruct** gap_align_tld =
+            (BlastGapAlignStruct**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastGapAlignStruct*)
+            );
+    BlastScoringParameters** score_params_tld =
+            (BlastScoringParameters**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastScoringParameters*)
+            );
+    BlastHitSavingParameters** hit_params_tld =
+            (BlastHitSavingParameters**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastHitSavingParameters*)
+            );
+    BlastHSPResults** results_tld =
+            (BlastHSPResults**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastHSPResults*)
+            );
+    query_info_tld =
+            (BlastCompo_QueryInfo**) calloc(
+                    actual_num_threads,
+                    sizeof(BlastCompo_QueryInfo*)
+            );
+
+    int i;
+    for (i = 0; i < actual_num_threads; ++i) {
+        query_info_tld[i] = s_GetQueryInfo(
+                queryBlk->sequence,
+                queryInfo,
+                (program_number == eBlastTypeBlastx)
+        );
+        if (query_info_tld[i] == NULL) {
+            status_code = -1;
             goto function_cleanup;
         }
-    }
-    alignments = calloc(numContexts, sizeof(BlastCompo_Alignment *));
-    incoming_align_set = calloc(numFrames, sizeof(BlastCompo_Alignment *));
-    if (alignments == NULL || incoming_align_set == NULL) {
-        status_code = -1;
-        goto function_cleanup;
-    }
-   
-    while (1) {
-        int numAligns[6];
-        Blast_KarlinBlk * kbp = NULL;
-        BlastCompo_MatchingSequence matchingSeq = {0,};
-        BlastHSPList * hsp_list = NULL; 
-        double best_evalue;   
-        Int4 best_score;
-        void * discarded_aligns = NULL;
-     
-        if (seqSrc
-           && BlastHSPStreamRead(hsp_stream, &thisMatch) == kBlastHSPStream_Eof) 
-           break;
-
-        if (thisMatch->hsp_array == NULL) {
-            if (seqSrc) continue;
-            break;
-        }
 
-        if (BlastCompo_EarlyTermination(thisMatch->best_evalue,
-                                        redoneMatches, numQueries)) {
-            Blast_HSPListFree(thisMatch);
-            if (seqSrc) continue;
-            break;
+        sbp_tld[i] = s_BlastScoreBlk_Copy(
+                program_number,
+                sbp,
+                sbp->alphabet_code,
+                sbp->number_of_contexts
+        );
+
+        seqsrc_tld[i]         = (BlastSeqSrc*) seqSrc;
+        gap_align_tld[i]      =
+                s_BlastGapAlignStruct_Copy(gapAlign, sbp_tld[i]);
+        score_params_tld[i]   = scoringParams;
+        hit_params_tld[i]     = (BlastHitSavingParameters*) hitParams;
+        results_tld[i]        = Blast_HSPResultsNew(queryInfo->num_queries);
+
+        redoneMatches_tld[i] =
+                (BlastCompo_Heap*) calloc(numQueries, sizeof(BlastCompo_Heap));
+        if (redoneMatches_tld[i] == NULL) {
+            status_code = -1;
+            goto function_cleanup;
+        }
+        for (query_index = 0; query_index < numQueries; query_index++) {
+            status_code =
+                BlastCompo_HeapInitialize(&redoneMatches_tld[i][query_index],
+                                          hitParams->options->hitlist_size,
+                                          inclusion_ethresh);
+            if (status_code != 0) {
+                goto function_cleanup;
+            }
         }
 
-        query_index = thisMatch->query_index;
-        context_index = query_index * numFrames;
-        /* Get the sequence for this match */
-        if (seqSrc && BlastSeqSrcGetSupportsPartialFetching(seqSrc)) {
-            BLAST_SetupPartialFetching(program_number, (BlastSeqSrc*)seqSrc, 
-                                       (const BlastHSPList**)&thisMatch, 1);
+        alignments_tld[i] = (BlastCompo_Alignment**) calloc(
+                numContexts,
+                sizeof(BlastCompo_Alignment*)
+        );
+        incoming_align_set_tld[i] = (BlastCompo_Alignment**) calloc(
+                numFrames,
+                sizeof(BlastCompo_Alignment*)
+        );
+
+        savedParams_tld[i] = s_SavedParametersNew(
+                queryInfo->max_length,
+                numContexts,
+                compo_adjust_mode,
+                positionBased
+        );
+        if (savedParams_tld[i] == NULL) {
+            status_code = -1;
+            goto function_cleanup;
+        }
+        status_code = s_RecordInitialSearch(
+                savedParams_tld[i],
+                sbp,
+                scoringParams,
+                queryInfo->max_length,
+                compo_adjust_mode,
+                positionBased
+        );
+        if (status_code != 0) {
+            goto function_cleanup;
         }
 
-        if (subjectBlk) {
-            matchingSeq.length = subjectBlk->length;
-            matchingSeq.index = -1;
-            matchingSeq.local_data = subjectBlk;
-        } else {
-            status_code =
-                s_MatchingSequenceInitialize(&matchingSeq, program_number,
-                                         seqSrc, default_db_genetic_code,
-                                         thisMatch->oid);
+        if ((int) compo_adjust_mode > 1 && !positionBased) {
+            NRrecord_tld[i] = Blast_CompositionWorkspaceNew();
+            status_code = Blast_CompositionWorkspaceInit(
+                    NRrecord_tld[i],
+                    scoringParams->options->matrix
+            );
             if (status_code != 0) {
-                /* some sequences may have been excluded by membit filtering 
-                   so this is not really an exception */
-                status_code = 0;
-                goto match_loop_cleanup;
+                goto function_cleanup;
             }
         }
-        status_code =
-            s_ResultHspToDistinctAlign(incoming_align_set, numAligns,
-                                       thisMatch->hsp_array, 
-                                       thisMatch->hspcnt, context_index,
-                                       queryInfo, localScalingFactor);
-        if (status_code != 0) {
-            goto match_loop_cleanup;
-        }
-
-        hsp_list = Blast_HSPListNew(0);
-        for (frame_index=0; frame_index<numFrames; frame_index++, context_index++) {
-            incoming_aligns = incoming_align_set[frame_index];
-            if (!incoming_aligns) continue;
-            /* All alignments in thisMatch should be to the same query */
-            kbp = sbp->kbp_gap[context_index];
-            if (smithWaterman) {
-                status_code =
-                    Blast_RedoOneMatchSmithWaterman(alignments,
-                                                redo_align_params,
-                                                incoming_aligns,
-                                                numAligns[frame_index],
-                                                kbp->Lambda, kbp->logK,
-                                                &matchingSeq, query_info,
-                                                numQueries,
-                                                matrix, BLASTAA_SIZE,
-                                                NRrecord, &forbidden,
-                                                redoneMatches,
-                                                &pvalueForThisPair,
-                                                compositionTestIndex,
-                                                &LambdaRatio);
+
+        gapping_params_context_tld[i].gap_align = gap_align_tld[i];
+        gapping_params_context_tld[i].scoringParams = score_params_tld[i];
+        gapping_params_context_tld[i].sbp = sbp_tld[i];
+        gapping_params_context_tld[i].localScalingFactor = localScalingFactor;
+        gapping_params_context_tld[i].prog_number = program_number;
+
+        redo_align_params_tld[i] =
+            s_GetAlignParams(
+                    &gapping_params_context_tld[i],
+                    queryBlk,
+                    queryInfo,
+                    hitParams,
+                    extendParams
+            );
+        if (redo_align_params_tld[i] == NULL) {
+            status_code = -1;
+            goto function_cleanup;
+        }
+
+        if (positionBased) {
+            matrix_tld[i] = sbp_tld[i]->psi_matrix->pssm->data;
+        } else {
+            matrix_tld[i] = sbp_tld[i]->matrix->data;
+        }
+        /**** Validate parameters *************/
+        if (matrix_tld[i] == NULL) {
+            goto function_cleanup;
+        }
+    }
+
+    /*
+     * There are two use cases here.
+     * (1) hsp_stream == NULL, so single match is passed in thisMatch.
+     *     Also, seqSrc == NULL and subjectBlk are != NULL.
+     * (2) hsp_stream != NULL, so one or more matches are taken from
+     *     hsp_stream, and thisMatch is (probably) NULL.
+     *     Also, seqSrc != NULL, subjectBlk and thisMatch are == NULL.
+     */
+    struct BlastHSPListLinkedList {
+        BlastHSPList* match;
+        struct BlastHSPListLinkedList* next;
+    };
+    typedef struct BlastHSPListLinkedList BlastHSPListLinkedList;
+
+    BlastHSPList** theseMatches = NULL;
+    int numMatches = 0;
+    if (hsp_stream == NULL) {
+        theseMatches = (BlastHSPList**) calloc(1, sizeof(BlastHSPList*));
+        *theseMatches = thisMatch;
+        numMatches = 1;
+    } else {
+        BlastHSPList* localMatch = NULL;
+        BlastHSPListLinkedList* head = NULL;
+        BlastHSPListLinkedList* tail = NULL;
+        /*
+         * Collect matches from stream into linked list, counting them
+         * along the way.
+         */
+        while (BlastHSPStreamRead(hsp_stream, &localMatch)
+                != kBlastHSPStream_Eof) {
+            BlastHSPListLinkedList* entry =
+                    (BlastHSPListLinkedList*) calloc(
+                            1,
+                            sizeof(BlastHSPListLinkedList)
+                    );
+            entry->match = localMatch;
+            if (head == NULL) {
+                head = entry;
             } else {
-                status_code =
-                    Blast_RedoOneMatch(alignments, redo_align_params,
-                                   incoming_aligns, numAligns[frame_index],
-                                   kbp->Lambda, &matchingSeq,
-                                   -1, query_info,
-                                   numContexts, matrix, BLASTAA_SIZE,
-                                   NRrecord, &pvalueForThisPair,
-                                   compositionTestIndex,
-                                   &LambdaRatio);
+                tail->next = entry;
+            }
+            tail = entry;
+            ++numMatches;
+        }
+        /*
+         * Convert linked list of matches into array.
+         */
+        theseMatches =
+                (BlastHSPList**) calloc(numMatches, sizeof(BlastHSPList*));
+        int i;
+        for (i = 0; i < numMatches; ++i) {
+            theseMatches[i] = head->match;
+            BlastHSPListLinkedList* here = head;
+            head = head->next;
+            sfree(here);
+        }
+    }
+
+    Boolean interrupt = FALSE;
+    int b;
+#pragma omp parallel for default(none) num_threads(actual_num_threads) \
+        schedule(static) \
+        if(actual_num_threads>1) \
+        shared(interrupt, seqsrc_tld, score_params_tld, hit_params_tld, \
+        gap_align_tld, results_tld, \
+        redoneMatches_tld, \
+        numQueries, numMatches, theseMatches, \
+        numFrames, program_number, subjectBlk, positionBased, \
+        default_db_genetic_code, localScalingFactor, queryInfo, \
+        sbp, smithWaterman, compositionTestIndex, forbidden, \
+        NRrecord_tld, actual_num_threads, sbp_tld, \
+        matrix_tld, query_info_tld, numContexts, \
+        genetic_code_string, queryBlk, compo_adjust_mode, \
+        alignments_tld, incoming_align_set_tld, savedParams_tld, \
+        scoringParams, redo_align_params_tld, \
+        status_code_tld)
+    for (b = 0; b < numMatches; ++b) {
+#pragma omp flush(interrupt)
+        if (!interrupt) {
+            BlastCompo_Alignment** alignments = NULL;
+            BlastCompo_Alignment** incoming_align_set = NULL;
+            Blast_CompositionWorkspace* NRrecord = NULL;
+            BlastCompo_QueryInfo* query_info = NULL;
+
+            int numAligns[6];
+            Blast_KarlinBlk* kbp = NULL;
+            BlastCompo_MatchingSequence matchingSeq = {0,};
+            BlastHSPList* hsp_list = NULL;
+            BlastCompo_Alignment* incoming_aligns = NULL;
+            Blast_RedoAlignParams* redo_align_params;
+            double best_evalue;
+            Int4 best_score;
+            int query_index;
+            int context_index;
+            int frame_index;
+            void* discarded_aligns = NULL;
+            int tid = 0;
+            BlastSeqSrc* seqSrc;
+            BlastScoringParameters* scoringParams;
+            BlastHitSavingParameters* hitParams;
+            BlastCompo_Heap* redoneMatches;
+            BlastScoreBlk* sbp;
+            /* existing alignments for a match */
+            Int4** matrix;                   /* score matrix */
+            int* pStatusCode;
+
+            double pvalueForThisPair = (-1); /* p-value for this match
+                                                for composition; -1 == no adjustment*/
+            double LambdaRatio; /*lambda ratio*/
+
+#ifdef _OPENMP
+            tid = omp_get_thread_num();
+#endif
+            seqSrc             = seqsrc_tld[tid];
+            scoringParams      = score_params_tld[tid];
+            hitParams          = hit_params_tld[tid];
+            redoneMatches      = redoneMatches_tld[tid];
+            alignments         = alignments_tld[tid];
+            incoming_align_set = incoming_align_set_tld[tid];
+            NRrecord           = NRrecord_tld[tid];
+            sbp                = sbp_tld[tid];
+            redo_align_params  = redo_align_params_tld[tid];
+            matrix             = matrix_tld[tid];
+            pStatusCode        = &status_code_tld[tid];
+            query_info         = query_info_tld[tid];
+
+            BlastHSPList* localMatch = theseMatches[b];
+
+            if (localMatch->hsp_array == NULL) {
+                if (seqSrc) {
+                    continue;
+                }
+#pragma omp critical(intrpt)
+                interrupt = TRUE;
+#pragma omp flush(interrupt)
+                continue;
             }
 
-            if (status_code != 0) {
+            if (BlastCompo_EarlyTermination(
+                    localMatch->best_evalue,
+                    redoneMatches,
+                    numQueries
+            )) {
+                Blast_HSPListFree(localMatch);
+                if (seqSrc) {
+                    continue;
+                }
+#pragma omp critical(intrpt)
+                interrupt = TRUE;
+#pragma omp flush(interrupt)
+                continue;
+            }
+
+            query_index = localMatch->query_index;
+            context_index = query_index * numFrames;
+            /* Get the sequence for this match */
+            if (seqSrc && BlastSeqSrcGetSupportsPartialFetching(seqSrc)) {
+                BLAST_SetupPartialFetching(
+                        program_number,
+                        (BlastSeqSrc*) seqSrc,
+                        (const BlastHSPList**)&localMatch,
+                        1
+                );
+            }
+
+            if (subjectBlk) {
+                matchingSeq.length = subjectBlk->length;
+                matchingSeq.index = -1;
+                matchingSeq.local_data = subjectBlk;
+            } else {
+                *pStatusCode = s_MatchingSequenceInitialize(
+                        &matchingSeq,
+                        program_number,
+                        seqSrc,
+                        default_db_genetic_code,
+                        localMatch->oid
+                );
+                if (*pStatusCode != 0) {
+                    /*
+                     * some sequences may have been excluded by membit filtering
+                     * so this is not really an exception
+                     */
+                    *pStatusCode = 0;
+                    goto match_loop_cleanup;
+                }
+            }
+            *pStatusCode = s_ResultHspToDistinctAlign(
+                    incoming_align_set,     /* o */
+                    numAligns,              /* o */
+                    localMatch->hsp_array,  /* i */
+                    localMatch->hspcnt,     /* i */
+                    context_index,          /* i */
+                    queryInfo,              /* i */
+                    localScalingFactor      /* i */
+            );
+            if (*pStatusCode != 0) {
                 goto match_loop_cleanup;
             }
 
-            if (alignments[context_index] != NULL) {
-                Int2 qframe = frame_index;
-                if (program_number == eBlastTypeBlastx) {
-                    if (qframe < 3) qframe++;
-                    else qframe = 2-qframe;
+            hsp_list = Blast_HSPListNew(0);
+            for (frame_index = 0;
+                    frame_index < numFrames;
+                    frame_index++, context_index++) {
+                incoming_aligns = incoming_align_set[frame_index];
+                if (!incoming_aligns) {
+                    continue;
                 }
-                status_code =             
-                    s_HSPListFromDistinctAlignments(hsp_list,
-                                          &alignments[context_index],
-                                          matchingSeq.index,
-                                          queryInfo, qframe);
-                if (status_code) {
+                /*
+                 * All alignments in thisMatch should be to the same query
+                 */
+                kbp = sbp->kbp_gap[context_index];
+                if (smithWaterman) {
+                    *pStatusCode =
+                            Blast_RedoOneMatchSmithWaterman(
+                                    alignments,
+                                    redo_align_params,
+                                    incoming_aligns,
+                                    numAligns[frame_index],
+                                    kbp->Lambda,
+                                    kbp->logK,
+                                    &matchingSeq,
+                                    query_info,
+                                    numQueries,
+                                    matrix,
+                                    BLASTAA_SIZE,
+                                    NRrecord,
+                                    &forbidden,
+                                    redoneMatches,
+                                    &pvalueForThisPair,
+                                    compositionTestIndex,
+                                    &LambdaRatio
+                            );
+                } else {
+                    *pStatusCode =
+                            Blast_RedoOneMatch(
+                                    alignments,             // thread-local
+                                    redo_align_params,      // thread-local
+                                    incoming_aligns,        // thread-local
+                                    numAligns[frame_index], // local
+                                    kbp->Lambda,            // thread-local
+                                    &matchingSeq,           // local
+                                    -1,                     // const
+                                    query_info,             // thread-local
+                                    numContexts,            // shared
+                                    matrix,                 // thread-local
+                                    BLASTAA_SIZE,           // const
+                                    NRrecord,               // thread-local
+                                    &pvalueForThisPair,     // local
+                                    compositionTestIndex,   // shared
+                                    &LambdaRatio            // local
+                            );
+                }
+
+                if (*pStatusCode != 0) {
                     goto match_loop_cleanup;
                 }
+
+                if (alignments[context_index] != NULL) {
+                    Int2 qframe = frame_index;
+                    if (program_number == eBlastTypeBlastx) {
+                        if (qframe < 3) {
+                            qframe++;
+                        } else {
+                            qframe = 2 - qframe;
+                        }
+                    }
+                    *pStatusCode =
+                            s_HSPListFromDistinctAlignments(hsp_list,
+                                    &alignments[context_index],
+                                    matchingSeq.index,
+                                    queryInfo, qframe);
+                    if (*pStatusCode) {
+                        goto match_loop_cleanup;
+                    }
+                }
+                BlastCompo_AlignmentsFree(&incoming_aligns, NULL);
+                incoming_align_set[frame_index] = NULL;
             }
-            BlastCompo_AlignmentsFree(&incoming_aligns, NULL);
-            incoming_align_set[frame_index] = NULL;
-        }
 
-        if (hsp_list->hspcnt > 1) {
-            s_HitlistReapContained(hsp_list->hsp_array,
-                                   &hsp_list->hspcnt);
-        }
-        status_code =
-            s_HitlistEvaluateAndPurge(&best_score, &best_evalue,
-                                              hsp_list,
-                                              seqSrc,
-                                              matchingSeq.length,
-                                              program_number,
-                                              queryInfo, context_index,
-                                              sbp, hitParams,
-                                              pvalueForThisPair, LambdaRatio,
-                                              matchingSeq.index);
-        if (status_code != 0) {
-            goto query_loop_cleanup;
-        }
-        if (best_evalue <= hitParams->options->expect_value) {
-            /* The best alignment is significant */
-            s_HSPListNormalizeScores(hsp_list, kbp->Lambda, kbp->logK,
-                                             localScalingFactor);
-            s_ComputeNumIdentities(queryBlk, queryInfo, subjectBlk, seqSrc,
-                                           hsp_list, scoringParams->options,
-                                           genetic_code_string, sbp);
-            if (!seqSrc) goto query_loop_cleanup;
-            if ( BlastCompo_HeapWouldInsert(&redoneMatches[query_index],
-                                               best_evalue, best_score,
-                                               thisMatch->oid)) {
-                status_code = BlastCompo_HeapInsert(&redoneMatches[query_index],
-                                              hsp_list, best_evalue,
-                                              best_score, thisMatch->oid,
-                                              &discarded_aligns);
-                if (status_code == 0) hsp_list = NULL;
-            } else {
-                hsp_list = Blast_HSPListFree(hsp_list);
+            if (hsp_list->hspcnt > 1) {
+                s_HitlistReapContained(hsp_list->hsp_array,
+                        &hsp_list->hspcnt);
             }
+            *pStatusCode =
+                    s_HitlistEvaluateAndPurge(&best_score, &best_evalue,
+                            hsp_list,
+                            seqSrc,
+                            matchingSeq.length,
+                            program_number,
+                            queryInfo, context_index,
+                            sbp, hitParams,
+                            pvalueForThisPair, LambdaRatio,
+                            matchingSeq.index);
+            if (*pStatusCode != 0) {
+                goto query_loop_cleanup;
+            }
+            if (best_evalue <= hitParams->options->expect_value) {
+                /* The best alignment is significant */
+                s_HSPListNormalizeScores(hsp_list, kbp->Lambda, kbp->logK,
+                        localScalingFactor);
+                s_ComputeNumIdentities(
+                        queryBlk,
+                        queryInfo,
+                        subjectBlk,
+                        seqSrc,
+                        hsp_list,
+                        scoringParams->options,
+                        genetic_code_string,
+                        sbp
+                );
+                if (!seqSrc) {
+                    goto query_loop_cleanup;
+                }
+                if (BlastCompo_HeapWouldInsert(
+                        &redoneMatches[query_index],
+                        best_evalue,
+                        best_score,
+                        localMatch->oid
+                )) {
+                    *pStatusCode =
+                            BlastCompo_HeapInsert(
+                                    &redoneMatches[query_index],
+                                    hsp_list,
+                                    best_evalue,
+                                    best_score,
+                                    localMatch->oid,
+                                    &discarded_aligns
+                            );
+                    if (*pStatusCode == 0) {
+                        hsp_list = NULL;
+                    }
+                } else {
+                    hsp_list = Blast_HSPListFree(hsp_list);
+                }
 
-            if (status_code) goto query_loop_cleanup;
-            if (discarded_aligns != NULL) {
-                Blast_HSPListFree(discarded_aligns);
+                if (*pStatusCode) {
+                    goto query_loop_cleanup;
+                }
+                if (discarded_aligns != NULL) {
+                    Blast_HSPListFree(discarded_aligns);
+                }
             }
-        }
 query_loop_cleanup:
 match_loop_cleanup:
-        if (seqSrc) {
-            thisMatch = Blast_HSPListFree(thisMatch);
+            if (seqSrc) {
+                localMatch = Blast_HSPListFree(localMatch);
+            } else {
+                Blast_HSPListSwap(localMatch, hsp_list);
+                localMatch->oid = hsp_list->oid;
+            }
+            hsp_list = Blast_HSPListFree(hsp_list);
+
+            if (*pStatusCode != 0) {
+                for (context_index = 0;
+                        context_index < numContexts;
+                        context_index++) {
+                    BlastCompo_AlignmentsFree(
+                            &alignments[context_index],
+                            s_FreeEditScript
+                    );
+                }
+            }
+            s_MatchingSequenceRelease(&matchingSeq);
+            BlastCompo_AlignmentsFree(&incoming_aligns, NULL);
+            if (*pStatusCode != 0 || !seqSrc) {
+#pragma omp critical(intrpt)
+                interrupt = TRUE;
+#pragma omp flush(interrupt)
+                continue;
+            }
+
+        } /* end of if(!interrupt) */
+    }
+    /*
+     * end of omp parallel section
+     */
+
+function_cleanup:
+
+    for (i = 0; i < actual_num_threads; ++i) {
+        if (status_code_tld[i] != 0) {
+            status_code = status_code_tld[i];
+        }
+    }
+    for (i = 0; i < actual_num_threads; ++i) {
+        if (seqSrc  &&  status_code == 0) {
+            s_FillResultsFromCompoHeaps(
+                    results_tld[i],
+                    redoneMatches_tld[i],
+                    hitParams->options->hitlist_size
+            );
+            if (redoneMatches_tld[i] != NULL) {
+                int qi;
+                for (qi = 0; qi < numQueries; ++qi) {
+                    sfree(redoneMatches_tld[i][qi].array);
+                    sfree(redoneMatches_tld[i][qi].heapArray);
+                }
+                s_ClearHeap(redoneMatches_tld[i]);
+            }
         } else {
-            Blast_HSPListSwap(thisMatch, hsp_list);
-            thisMatch->oid = hsp_list->oid;
+            if (redoneMatches_tld[i] != NULL) {
+                int qi;
+                for (qi = 0; qi < numQueries; ++qi) {
+                    sfree(redoneMatches_tld[i][qi].array);
+                    sfree(redoneMatches_tld[i][qi].heapArray);
+                }
+                s_ClearHeap(redoneMatches_tld[i]);
+            }
         }
-        hsp_list = Blast_HSPListFree(hsp_list);
-
-        if (status_code != 0) {
-            for (query_index = 0;  query_index < numContexts;  query_index++) {
-                BlastCompo_AlignmentsFree(&alignments[query_index],
-                                          s_FreeEditScript);
+        sfree(redoneMatches_tld[i]);
+    }
+    if (redoneMatches != NULL) {
+        int qi;
+        for (qi = 0; qi < numQueries; ++qi) {
+            sfree(redoneMatches[qi].array);
+            sfree(redoneMatches[qi].heapArray);
+        }
+        s_ClearHeap(redoneMatches);
+    }
+
+    if (hsp_stream != NULL) {
+        /* Reduce results from all threads and continue with business as usual */
+        SThreadLocalDataArray* thread_data =
+                SThreadLocalDataArrayNew(actual_num_threads);
+        int i;
+        for (i = 0; i < actual_num_threads; ++i) {
+            SThreadLocalData* tdi = thread_data->tld[i];
+            BlastHSPResults* rdi = results_tld[i];
+            tdi->hit_params = hit_params_tld[i];
+            hit_params_tld[i] = NULL;
+            tdi->results =
+                    (BlastHSPResults*) calloc(1, sizeof(BlastHSPResults));
+            tdi->results->num_queries = rdi->num_queries;
+            tdi->results->hitlist_array =
+                    (BlastHitList**) calloc(
+                            tdi->results->num_queries,
+                            sizeof(BlastHitList*)
+                    );
+            int j;
+            for (j = 0; j < tdi->results->num_queries; ++j) {
+                tdi->results->hitlist_array[j] = rdi->hitlist_array[j];
+                rdi->hitlist_array[j] = NULL;
             }
         }
-        s_MatchingSequenceRelease(&matchingSeq);
-        BlastCompo_AlignmentsFree(&incoming_aligns, NULL);
-        if (status_code != 0 || !seqSrc) {
-            goto function_cleanup;
+        local_results = SThreadLocalDataArrayConsolidateResults(thread_data);
+        ASSERT(local_results);
+
+        /* post-traceback pipes */
+        BlastHSPStreamTBackClose(hsp_stream, local_results);
+
+        for (i = 0; i < local_results->num_queries; ++i) {
+            results->hitlist_array[i] = local_results->hitlist_array[i];
+            local_results->hitlist_array[i] = NULL;
         }
-    }
-    /* end for all matching sequences */
-function_cleanup:
-    sfree(alignments);
-    sfree(incoming_align_set);
-    if (seqSrc && status_code == 0) {
-        s_FillResultsFromCompoHeaps(results, redoneMatches,
-                                    hitParams->options->hitlist_size);
-    } else {
-        if (redoneMatches != NULL) {
-            s_ClearHeap(&redoneMatches[0]);
+        for (i = 0; i < actual_num_threads; ++i) {
+            thread_data->tld[i]->hit_params = NULL;
+            int j;
+            for (j = 0; j < local_results->num_queries; ++j) {
+                thread_data->tld[i]->results->hitlist_array[j] =
+                        Blast_HitListFree(
+                                thread_data->tld[i]->results->hitlist_array[j]
+                        );
+            }
+            sfree(thread_data->tld[i]->results->hitlist_array);
+            sfree(thread_data->tld[i]->results);
+            thread_data->tld[i] = SThreadLocalDataFree(thread_data->tld[i]);
+            results_tld[i] = Blast_HSPResultsFree(results_tld[i]);
+            s_FreeBlastCompo_QueryInfoArray(&query_info_tld[i], numContexts);
         }
+        sfree(thread_data->tld);
+        sfree(thread_data);
+        Blast_HSPResultsFree(local_results);
     }
-    s_FreeBlastCompo_QueryInfoArray(&query_info, numContexts);
-    Blast_RedoAlignParamsFree(&redo_align_params);
+
     if (redoneMatches != NULL) {
         for (query_index = 0;  query_index < numQueries;  query_index++) {
             BlastCompo_HeapRelease(&redoneMatches[query_index]);
         }
-        sfree(redoneMatches); redoneMatches = NULL;
+        sfree(redoneMatches);
+        redoneMatches = NULL;
     }
     if (smithWaterman) {
         Blast_ForbiddenRangesRelease(&forbidden);
@@ -2906,7 +3790,34 @@ function_cleanup:
     s_RestoreSearch(sbp, scoringParams, savedParams, queryBlk->length,
                     positionBased, compo_adjust_mode);
     s_SavedParametersFree(&savedParams);
-    Blast_CompositionWorkspaceFree(&NRrecord);
+
+    for (i = 0; i < actual_num_threads; ++i) {
+        s_BlastScoreBlk_Free(&sbp_tld[i]);
+        gap_align_tld[i]->sbp = NULL;
+        s_BlastGapAlignStruct_Free(gap_align_tld[i]);
+        Blast_RedoAlignParamsFree(&redo_align_params_tld[i]);
+        sfree(alignments_tld[i]);
+        sfree(incoming_align_set_tld[i]);
+        Blast_CompositionWorkspaceFree(&NRrecord_tld[i]);
+        s_SavedParametersFree(&savedParams_tld[i]);
+    }
+    sfree(theseMatches);
+    sfree(NRrecord_tld);
+    sfree(alignments_tld);
+    sfree(incoming_align_set_tld);
+    sfree(savedParams_tld);
+    sfree(sbp_tld);
+    sfree(matrix_tld);
+    sfree(seqsrc_tld);
+    sfree(gap_align_tld);
+    sfree(score_params_tld);
+    sfree(hit_params_tld);
+    sfree(results_tld);
+    sfree(gapping_params_context_tld);
+    sfree(redo_align_params_tld);
+    sfree(redoneMatches_tld);
+    sfree(status_code_tld);
+    sfree(query_info_tld);
 
     return (Int2) status_code;
 }
diff --git a/c++/src/algo/blast/core/blast_options.c b/c++/src/algo/blast/core/blast_options.c
index 05bdd98..b930f0e 100644
--- a/c++/src/algo/blast/core/blast_options.c
+++ b/c++/src/algo/blast/core/blast_options.c
@@ -1,4 +1,4 @@
-/* $Id: blast_options.c 458581 2015-02-06 15:18:12Z boratyng $
+/* $Id: blast_options.c 493454 2016-02-26 19:57:55Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_options.c 458581 2015-02-06 15:18:12Z boratyng $";
+    "$Id: blast_options.c 493454 2016-02-26 19:57:55Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/blast_options.h>
@@ -43,6 +43,7 @@ static char const rcsid[] =
 #include <algo/blast/composition_adjustment/composition_constants.h>
 #include <algo/blast/core/hspfilter_collector.h>
 #include <algo/blast/core/hspfilter_besthit.h>
+#include <algo/blast/core/blast_util.h>
 
 const double kPSSM_NoImpalaScaling = 1.0;
 
@@ -1666,7 +1667,28 @@ Int2 BLAST_ValidateOptions(EBlastProgramType program_number,
                                                score_options, blast_msg)) != 0)
        return status;
 
-   
+   /* Word sizes larger than 5 are not suported for IDENTITY scoring matrix.
+    Identity matrix is only supported for blastp and tblastn. */
+    if (program_number == eBlastTypeBlastp ||
+        program_number == eBlastTypeTblastn) {
+
+       char* matrix = BLAST_StrToUpper(score_options->matrix);
+       Boolean is_identity = strcmp(matrix, "IDENTITY") == 0;
+
+       if (matrix) {
+           free(matrix);
+       }
+       
+       if (lookup_options->word_size > 5 && is_identity) {
+
+           Blast_MessageWrite(blast_msg, eBlastSevError,
+                              kBlastMessageNoContext,
+                              "Word size larger than 5 is not supported for "
+                              "the identity scoring matrix");
+
+           return BLASTERR_OPTION_VALUE_INVALID;
+       }
+   }
 
    return status;
 }
diff --git a/c++/src/algo/blast/core/blast_seg.c b/c++/src/algo/blast/core/blast_seg.c
index f12ce6f..f83223b 100644
--- a/c++/src/algo/blast/core/blast_seg.c
+++ b/c++/src/algo/blast/core/blast_seg.c
@@ -1,4 +1,4 @@
-/* $Id: blast_seg.c 474016 2015-07-24 13:27:16Z ivanov $
+/* $Id: blast_seg.c 473564 2015-07-21 15:29:04Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE                          
@@ -36,7 +36,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_seg.c 474016 2015-07-24 13:27:16Z ivanov $";
+    "$Id: blast_seg.c 473564 2015-07-21 15:29:04Z madden $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/blast_seg.h>
diff --git a/c++/src/algo/blast/core/blast_setup.c b/c++/src/algo/blast/core/blast_setup.c
index f7ae99a..4b072cf 100644
--- a/c++/src/algo/blast/core/blast_setup.c
+++ b/c++/src/algo/blast/core/blast_setup.c
@@ -1,4 +1,4 @@
-/* $Id: blast_setup.c 442853 2014-08-07 17:41:32Z camacho $
+/* $Id: blast_setup.c 496012 2016-03-23 11:30:57Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: blast_setup.c 442853 2014-08-07 17:41:32Z camacho $";
+    "$Id: blast_setup.c 496012 2016-03-23 11:30:57Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/blast_setup.h>
@@ -198,7 +198,6 @@ s_PHIScoreBlkFill(BlastScoreBlk* sbp, const BlastScoringOptions* options,
        } else if ((7 == options->gap_open) && (2 == options->gap_extend)) {
            kbp->Lambda = 0.306;
            kbp->K = 0.15;
-           return status;
        } else if ((6 == options->gap_open) && (2 == options->gap_extend)) {
            kbp->Lambda = 0.292;
            kbp->K = 0.13;
@@ -211,7 +210,6 @@ s_PHIScoreBlkFill(BlastScoreBlk* sbp, const BlastScoringOptions* options,
        } else if ((8 == options->gap_open) && (1 == options->gap_extend)) {
            kbp->Lambda = 0.270;
            kbp->K = 0.070;
-           return status;
        } else {
            status = -1;
        }
@@ -255,7 +253,6 @@ s_PHIScoreBlkFill(BlastScoreBlk* sbp, const BlastScoringOptions* options,
        } else if ((11 == options->gap_open) && (1 == options->gap_extend)) {
            kbp->Lambda = 0.314;
            kbp->K = 0.096;
-           return status;
        } else if ((9 == options->gap_open) && (1 == options->gap_extend)) {
            kbp->Lambda = 0.277;
            kbp->K = 0.046;
diff --git a/c++/src/algo/blast/core/blast_stat.c b/c++/src/algo/blast/core/blast_stat.c
index 911f978..771ca7a 100644
--- a/c++/src/algo/blast/core/blast_stat.c
+++ b/c++/src/algo/blast/core/blast_stat.c
@@ -1,4 +1,4 @@
-/* $Id: blast_stat.c 474016 2015-07-24 13:27:16Z ivanov $
+/* $Id: blast_stat.c 500367 2016-05-04 12:06:01Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -49,12 +49,13 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = 
-    "$Id: blast_stat.c 474016 2015-07-24 13:27:16Z ivanov $";
+static char const rcsid[] =
+    "$Id: blast_stat.c 500367 2016-05-04 12:06:01Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/blast_stat.h>
 #include <algo/blast/core/ncbi_math.h>
+#include "boost_erf.h"
 #include "blast_psi_priv.h"
 
 #define BLAST_SCORE_RANGE_MAX   (BLAST_SCORE_MAX - BLAST_SCORE_MIN) /**< maximum allowed range of BLAST scores. */
@@ -94,8 +95,8 @@ typedef struct MatrixInfo {
 
 How the statistical parameters for the matrices are stored:
 -----------------------------------------------------------
-They parameters are stored in a two-dimensional array double (i.e., 
-doubles, which has as it's first dimensions the number of different 
+They parameters are stored in a two-dimensional array double (i.e.,
+doubles, which has as it's first dimensions the number of different
 gap existence and extension combinations and as it's second dimension 8.
 The eight different columns specify:
 
@@ -120,8 +121,8 @@ more parameters:
 10.) alpha_v
 11.) sigma
 
-where C is the prefactor to the p-value expression, alpha_v is the alpha parameter 
-for the variance of length correction:   
+where C is the prefactor to the p-value expression, alpha_v is the alpha parameter
+for the variance of length correction:
    var(L) = alpha_v * score + beta_v
 in contrast, the original alpha is the alpha parameter for the mean of length correction:
    avg(L) = alpha * score + beta.
@@ -134,7 +135,7 @@ http://www.ncbi.nlm.nih.gov/CBBresearch/Spouge/html.ncbi/blast/index.html
 
 Take BLOSUM45 (below) as an example.  Currently (5/17/02) there are
 14 different allowed combinations (specified by "#define BLOSUM45_VALUES_MAX 14").
-The first row in the array "blosum45_values" has INT2_MAX (i.e., 32767) for gap 
+The first row in the array "blosum45_values" has INT2_MAX (i.e., 32767) for gap
 existence, extension, and decline-to-align penalties.  For all practical purposes
 this value is large enough to be infinite, so the alignments will be ungapped.
 BLAST may also use this value (INT2_MAX) as a signal to skip gapping, so a
@@ -146,7 +147,7 @@ set to INT2_MAX.
 
 How to add a new matrix to blast_stat.c:
 --------------------------------------
-To add a new matrix to blast_stat.c it is necessary to complete 
+To add a new matrix to blast_stat.c it is necessary to complete
 four steps.  As an example consider adding the matrix
 called TESTMATRIX
 
@@ -161,7 +162,7 @@ if 14 values were to be allowed.
 
 static array_of_8 testmatrix_values[TESTMATRIX_VALUES_MAX] ={ ...
 
-3.) add a "prefs" array that should hint about the "optimal" 
+3.) add a "prefs" array that should hint about the "optimal"
 gap existence and extension penalties:
 
 static Int4 testmatrix_prefs[TESTMATRIX_VALUES_MAX] = {
@@ -170,7 +171,7 @@ BLAST_MATRIX_NOMINAL,
 };
 
 4.) Go to the function BlastLoadMatrixValues (in this file) and
-add two lines before the return at the end of the function: 
+add two lines before the return at the end of the function:
 
         matrix_info = MatrixInfoNew("TESTMATRIX", testmatrix_values, testmatrix_prefs, TESTMATRIX_VALUES_MAX);
         ListNodeAddPointer(&retval, 0, matrix_info);
@@ -180,8 +181,8 @@ add two lines before the return at the end of the function:
 ***************************************************************************************/
 
 
-   
-   
+
+
 
 #define BLOSUM45_VALUES_MAX 14 /**< Number of different combinations supported for BLOSUM45. */
 static array_of_8 blosum45_values[BLOSUM45_VALUES_MAX] = {
@@ -391,7 +392,7 @@ static array_of_8 pam30_values[PAM30_VALUES_MAX] = {
     {15, 3, (double) INT2_MAX, 0.339, 0.28, 1.70, 0.20, -0.5, 0.437688, 0.157089, 0.155299},
     {14, 2, (double) INT2_MAX, 0.337, 0.27, 1.62, 0.21, -0.8, 0.440010, 0.206970, 0.198524},
     {14, 1, (double) INT2_MAX, 0.333, 0.27, 1.43, 0.23, -1.4, 0.444817, 0.436301, 0.361947},
-    {13, 3, (double) INT2_MAX, 0.338, 0.27, 1.69, 0.20, -0.5, 0.439086, 0.178973, 0.175436},    
+    {13, 3, (double) INT2_MAX, 0.338, 0.27, 1.69, 0.20, -0.5, 0.439086, 0.178973, 0.175436},
 }; /**< Supported values (gap-existence, extension, etc.) for PAM30. */
 
 static Int4 pam30_prefs[PAM30_VALUES_MAX] = {
@@ -593,12 +594,12 @@ static Int4 prot_identity_prefs[PROT_IDENTITY_VALUES_MAX] = {
 /** Supported substitution and gap costs with corresponding quality values
  * for nucleotide sequence comparisons.
  * NB: the values 0 and 0 for the gap costs are treated as the defaults used for
- * the greedy gapped extension, i.e. 
- * gap opening = 0, 
+ * the greedy gapped extension, i.e.
+ * gap opening = 0,
  * gap extension = 1/2 match - mismatch.
- * 
+ *
  * The fields are:
- * 
+ *
  * 1. Gap opening cost,
  * 2. Gap extension cost,
  * 3. Lambda,
@@ -620,19 +621,19 @@ static const array_of_8 blastn_values_1_5[] = {
 /** Karlin-Altschul parameter values for substitution scores 1 and -4. */
 static const array_of_8 blastn_values_1_4[] = {
     { 0, 0, 1.383, 0.738, 1.36, 1.02,  0, 100 },
-    { 1, 2,  1.36,  0.67,  1.2,  1.1,  0,  98 }, 
+    { 1, 2,  1.36,  0.67,  1.2,  1.1,  0,  98 },
     { 0, 2,  1.26,  0.43, 0.90,  1.4, -1,  91 },
     { 2, 1,  1.35,  0.61,  1.1,  1.2, -1,  98 },
     { 1, 1,  1.22,  0.35, 0.72,  1.7, -3,  88 }
 };
 
-/** Karlin-Altschul parameter values for substitution scores 2 and -7. 
+/** Karlin-Altschul parameter values for substitution scores 2 and -7.
  * These parameters can only be applied to even scores. Any odd score must be
  * rounded down to the nearest even number before calculating the e-value.
  */
 static const array_of_8 blastn_values_2_7[] = {
     { 0, 0,  0.69, 0.73, 1.34, 0.515,  0, 100 },
-    { 2, 4,  0.68, 0.67,  1.2,  0.55,  0,  99 }, 
+    { 2, 4,  0.68, 0.67,  1.2,  0.55,  0,  99 },
     { 0, 4,  0.63, 0.43, 0.90,   0.7, -1,  91 },
     { 4, 2, 0.675, 0.62,  1.1,   0.6, -1,  98 },
     { 2, 2,  0.61, 0.35, 0.72,   1.7, -3,  88 }
@@ -664,10 +665,10 @@ static const array_of_8 blastn_values_2_5[] = {
 static const array_of_8 blastn_values_1_2[] = {
     { 0, 0, 1.28, 0.46, 0.85, 1.5, -2, 96 },
     { 2, 2, 1.33, 0.62,  1.1, 1.2,  0, 99 },
-    { 1, 2, 1.30, 0.52, 0.93, 1.4, -2, 97 }, 
+    { 1, 2, 1.30, 0.52, 0.93, 1.4, -2, 97 },
     { 0, 2, 1.19, 0.34, 0.66, 1.8, -3, 89 },
-    { 3, 1, 1.32, 0.57,  1.0, 1.3, -1, 99 }, 
-    { 2, 1, 1.29, 0.49, 0.92, 1.4, -1, 96 }, 
+    { 3, 1, 1.32, 0.57,  1.0, 1.3, -1, 99 },
+    { 2, 1, 1.29, 0.49, 0.92, 1.4, -1, 96 },
     { 1, 1, 1.14, 0.26, 0.52, 2.2, -5, 85 }
 };
 
@@ -709,11 +710,11 @@ static const array_of_8 blastn_values_4_5[] = {
 /** Karlin-Altschul parameter values for substitution scores 1 and -1. */
 static const array_of_8 blastn_values_1_1[] = {
     { 3,  2, 1.09,  0.31, 0.55, 2.0,  -2, 99 },
-    { 2,  2, 1.07,  0.27, 0.49, 2.2,  -3, 97 }, 
-    { 1,  2, 1.02,  0.21, 0.36, 2.8,  -6, 92 }, 
+    { 2,  2, 1.07,  0.27, 0.49, 2.2,  -3, 97 },
+    { 1,  2, 1.02,  0.21, 0.36, 2.8,  -6, 92 },
     { 0,  2, 0.80, 0.064, 0.17, 4.8, -16, 72 },
-    { 4,  1, 1.08,  0.28, 0.54, 2.0,  -2, 98 }, 
-    { 3,  1, 1.06,  0.25, 0.46, 2.3,  -4, 96 }, 
+    { 4,  1, 1.08,  0.28, 0.54, 2.0,  -2, 98 },
+    { 3,  1, 1.06,  0.25, 0.46, 2.3,  -4, 96 },
     { 2,  1, 0.99,  0.17, 0.30, 3.3, -10, 90 }
 };
 
@@ -732,7 +733,7 @@ static const array_of_8 blastn_values_5_4[] = {
  * @param matrix structure to deallocate [in]
  * @return NULL
  */
-static SBlastScoreMatrix*
+SBlastScoreMatrix*
 SBlastScoreMatrixFree(SBlastScoreMatrix* matrix)
 {
     if ( !matrix ) {
@@ -740,7 +741,7 @@ SBlastScoreMatrixFree(SBlastScoreMatrix* matrix)
     }
 
     if (matrix->data) {
-        matrix->data = (int**) _PSIDeallocateMatrix((void**) matrix->data, 
+        matrix->data = (int**) _PSIDeallocateMatrix((void**) matrix->data,
                                                     matrix->ncols);
     }
 
@@ -760,7 +761,7 @@ SBlastScoreMatrixFree(SBlastScoreMatrix* matrix)
  * @return NULL in case of memory allocation failure, else new
  * SBlastScoreMatrix structure
  */
-static SBlastScoreMatrix*
+SBlastScoreMatrix*
 SBlastScoreMatrixNew(size_t ncols, size_t nrows)
 {
     SBlastScoreMatrix* retval = NULL;
@@ -835,7 +836,7 @@ SPsiBlastScoreMatrixNew(size_t ncols)
     return retval;
 }
 
-/* 
+/*
    allocate space for gumbel block
 */
 static Blast_GumbelBlk*
@@ -843,7 +844,7 @@ s_BlastGumbelBlkNew() {
    return (Blast_GumbelBlk*) calloc(1, sizeof(Blast_GumbelBlk));
 }
 
-/* 
+/*
    free space for gumbel blcok
 */
 static Blast_GumbelBlk*
@@ -861,7 +862,7 @@ BlastScoreBlkCheck(BlastScoreBlk* sbp)
 
     if (sbp == NULL)
        return -1;
-    
+
     if (sbp->kbp == NULL || sbp->sfp == NULL)
       return 1;
 
@@ -927,7 +928,7 @@ BlastScoreBlkNew(Uint1 alphabet, Int4 number_of_contexts)
     if (!use_old_fsc) sbp->gbp = s_BlastGumbelBlkNew();
 
     sbp->number_of_contexts = number_of_contexts;
-    sbp->sfp = (Blast_ScoreFreq**) 
+    sbp->sfp = (Blast_ScoreFreq**)
      calloc(sbp->number_of_contexts, sizeof(Blast_ScoreFreq*));
     sbp->kbp_std = (Blast_KarlinBlk**)
      calloc(sbp->number_of_contexts, sizeof(Blast_KarlinBlk*));
@@ -972,7 +973,7 @@ BlastScoreBlkFree(BlastScoreBlk* sbp)
     Int4 index;
     if (sbp == NULL)
         return NULL;
-    
+
     for (index=0; index<sbp->number_of_contexts; index++) {
         if (sbp->sfp)
             sbp->sfp[index] = Blast_ScoreFreqFree(sbp->sfp[index]);
@@ -987,24 +988,28 @@ BlastScoreBlkFree(BlastScoreBlk* sbp)
     }
     if (sbp->kbp_ideal)
         sbp->kbp_ideal = Blast_KarlinBlkFree(sbp->kbp_ideal);
-    if (sbp->gbp) 
+    if (sbp->gbp)
         sbp->gbp = s_BlastGumbelBlkFree(sbp->gbp);
     sfree(sbp->sfp);
+    sbp->kbp = NULL;
+    sbp->kbp_gap = NULL;
     sfree(sbp->kbp_std);
     sfree(sbp->kbp_psi);
     sfree(sbp->kbp_gap_std);
     sfree(sbp->kbp_gap_psi);
     sbp->matrix = SBlastScoreMatrixFree(sbp->matrix);
     sbp->comments = ListNodeFreeData(sbp->comments);
-    sfree(sbp->name);
+    if (sbp->name) {
+        sfree(sbp->name);
+    }
     sbp->psi_matrix = SPsiBlastScoreMatrixFree(sbp->psi_matrix);
     sfree(sbp->ambiguous_res);
     sfree(sbp);
-    
+
     return NULL;
 }
 
-/* 
+/*
    Set the ambiguous residue (e.g, 'N', 'X') in the BlastScoreBlk*.
    Convert from ncbieaa to sbp->alphabet_code (i.e., ncbistdaa) first.
 */
@@ -1032,19 +1037,19 @@ BLAST_ScoreSetAmbigRes(BlastScoreBlk* sbp, char ambiguous_res)
 
    if (sbp->alphabet_code == BLASTAA_SEQ_CODE)
    {
-      sbp->ambiguous_res[sbp->ambig_occupy] = 
+      sbp->ambiguous_res[sbp->ambig_occupy] =
          AMINOACID_TO_NCBISTDAA[toupper((unsigned char) ambiguous_res)];
    }
    else {
       if (sbp->alphabet_code == BLASTNA_SEQ_CODE)
-         sbp->ambiguous_res[sbp->ambig_occupy] = 
+         sbp->ambiguous_res[sbp->ambig_occupy] =
             IUPACNA_TO_BLASTNA[toupper((unsigned char) ambiguous_res)];
       else if (sbp->alphabet_code == NCBI4NA_SEQ_CODE)
-         sbp->ambiguous_res[sbp->ambig_occupy] = 
+         sbp->ambiguous_res[sbp->ambig_occupy] =
             IUPACNA_TO_NCBI4NA[toupper((unsigned char) ambiguous_res)];
    }
    (sbp->ambig_occupy)++;
-   
+
 
    return 0;
 }
@@ -1065,7 +1070,7 @@ Int2 BlastScoreBlkNuclMatrixCreate(BlastScoreBlk* sbp)
     Int4 penalty; /* cost for mismatch of bases. */
     Int4** matrix; /* matrix to be populated. */
     /* How many of the first bases are ambiguous (four, of course). */
-    const int k_number_non_ambig_bp = 4; 
+    const int k_number_non_ambig_bp = 4;
 
     ASSERT(sbp);
     ASSERT(sbp->alphabet_size == BLASTNA_SIZE);
@@ -1081,7 +1086,7 @@ Int2 BlastScoreBlkNuclMatrixCreate(BlastScoreBlk* sbp)
         for (index2 = 0; index2<BLASTNA_SIZE; index2++)
             matrix[index1][index2] = 0;
 
-    /* In blastna the 1st four bases are A, C, G, and T, exactly as it is 
+    /* In blastna the 1st four bases are A, C, G, and T, exactly as it is
        ncbi2na. */
     /* ncbi4na gives them the value 1, 2, 4, and 8.  */
     /* Set the first four bases to degen. one */
@@ -1101,10 +1106,10 @@ Int2 BlastScoreBlkNuclMatrixCreate(BlastScoreBlk* sbp)
 
     for (index1=0; index1<BLASTNA_SIZE; index1++) {
         for (index2=index1; index2<BLASTNA_SIZE; index2++) {
-            if (BLASTNA_TO_NCBI4NA[index1] & BLASTNA_TO_NCBI4NA[index2]) { 
+            if (BLASTNA_TO_NCBI4NA[index1] & BLASTNA_TO_NCBI4NA[index2]) {
                 /* round up for positive scores, down for negatives. */
-                matrix[index1][index2] = 
-                    BLAST_Nint( (double) ((degeneracy[index2]-1)*penalty + 
+                matrix[index1][index2] =
+                    BLAST_Nint( (double) ((degeneracy[index2]-1)*penalty +
                                           reward)/ (double) degeneracy[index2]);
                 if (index1 != index2)
                 {
@@ -1119,7 +1124,7 @@ Int2 BlastScoreBlkNuclMatrixCreate(BlastScoreBlk* sbp)
         }
     }
 
-    /* The value of 15 is a gap, which is a sentinel between strands in 
+    /* The value of 15 is a gap, which is a sentinel between strands in
     the ungapped extension algorithm */
     for (index1=0; index1<BLASTNA_SIZE; index1++)
         matrix[BLASTNA_SIZE-1][index1] = INT4_MIN / 2;
@@ -1129,11 +1134,11 @@ Int2 BlastScoreBlkNuclMatrixCreate(BlastScoreBlk* sbp)
     return 0;
 }
 
-/** 
+/**
  * Read in a custom nucleotide matrix from the FILE *fp.
- * This function ASSUMES that the matrices are in the 
+ * This function ASSUMES that the matrices are in the
  * format:
- *          
+ *
  * # FREQS A 0.255 C 0.245 G 0.245 T 0.255
  *    A   R   G   C   Y   T   K   M   S   W   N   X
  * A  9   1  -5 -12 -12 -13  -9  -1  -8  -2  -1 -27
@@ -1143,13 +1148,13 @@ Int2 BlastScoreBlkNuclMatrixCreate(BlastScoreBlk* sbp)
  * @param sbp the BlastScoreBlk with the matrix to be populated [in|out]
  * @param fp the file pointer to read from [in]
  * @return zero on success
- *              
- * -RMH-        
- */                 
-                                          
-static Int2     
+ *
+ * -RMH-
+ */
+
+static Int2
 BlastScoreBlkNucleotideMatrixRead(BlastScoreBlk* sbp, FILE *fp)
-{                     
+{
     Int4 ** matrix;
     double* freqs;
     Int4 i = 0;
@@ -1327,7 +1332,7 @@ BlastScoreBlkNucleotideMatrixRead(BlastScoreBlk* sbp, FILE *fp)
    }
    sbp->matrix->lambda = lambda;
 
-   /* The value of 15 is a gap, which is a sentinel between strands in 
+   /* The value of 15 is a gap, which is a sentinel between strands in
       the ungapped extension algorithm. */
    for (index1=0; index1<BLASTNA_SIZE; index1++)
      matrix[BLASTNA_SIZE-1][index1] = INT4_MIN / 2;
@@ -1362,23 +1367,23 @@ BlastScoreBlkProteinMatrixRead(BlastScoreBlk* sbp, FILE *fp)
     long lineno = 0;
     double  xscore;
     register int  index1, index2;
-    int x_index, u_index, o_index;
+    int x_index, u_index, o_index, c_index;
     const char kCommentChar = '#';
     const char* kTokenStr = " \t\n\r";
-    
+
     ASSERT(sbp->alphabet_size == BLASTAA_SIZE);
     ASSERT(sbp->matrix);
     ASSERT(sbp->matrix->ncols == BLASTAA_SIZE);
     ASSERT(sbp->matrix->nrows == BLASTAA_SIZE);
 
-    matrix = sbp->matrix->data;  
-    
+    matrix = sbp->matrix->data;
+
     if (sbp->alphabet_code != BLASTNA_SEQ_CODE) {
         for (index1 = 0; index1 < sbp->alphabet_size; index1++)
             for (index2 = 0; index2 < sbp->alphabet_size; index2++)
                 matrix[index1][index2] = BLAST_SCORE_MIN;
     }
-    
+
     /* Read the residue names for the second alphabet */
     while (fgets(buf, sizeof(buf), fp) != NULL) {
         ++lineno;
@@ -1408,11 +1413,11 @@ BlastScoreBlkProteinMatrixRead(BlastScoreBlk* sbp, FILE *fp)
             a2chars[a2cnt++] = ch;
             lp = (char*)strtok(NULL, kTokenStr);
         }
-        
+
         break; /* Exit loop after reading one line. */
     }
-    
-    if (a2cnt <= 1) { 
+
+    if (a2cnt <= 1) {
         return 2;
     }
 
@@ -1449,7 +1454,7 @@ BlastScoreBlkProteinMatrixRead(BlastScoreBlk* sbp, FILE *fp)
                 return 2;
             }
             strcpy(temp, cp);
-            
+
             if (strcasecmp(temp, "na") == 0)  {
                 score = BLAST_SCORE_MIN;
             } else  {
@@ -1463,25 +1468,26 @@ BlastScoreBlkProteinMatrixRead(BlastScoreBlk* sbp, FILE *fp)
                 xscore += (xscore >= 0. ? 0.5 : -0.5);
                 score = (Int4)xscore;
             }
-            
+
             m[(int)a2chars[index2++]] = score;
-            
+
             cp = strtok(NULL, kTokenStr);
         }
     }
-    
+
     if (a1cnt <= 1) {
         return 2;
     }
-    
-    /* Use the X scores for the more exotic ncbistdaa characters; 
+
+    /* Use the C scores for U and X scores for O characters;
        if this is not done then they will never align to non-gap residues */
     x_index = AMINOACID_TO_NCBISTDAA['X'];
     u_index = AMINOACID_TO_NCBISTDAA['U'];
     o_index = AMINOACID_TO_NCBISTDAA['O'];
+    c_index = AMINOACID_TO_NCBISTDAA['C'];
     for (index1 = 0; index1 < sbp->alphabet_size; index1++) {
-        matrix[u_index][index1] = matrix[x_index][index1];
-        matrix[index1][u_index] = matrix[index1][x_index];
+        matrix[u_index][index1] = matrix[c_index][index1];
+        matrix[index1][u_index] = matrix[index1][c_index];
         matrix[o_index][index1] = matrix[x_index][index1];
         matrix[index1][o_index] = matrix[index1][x_index];
     }
@@ -1489,9 +1495,9 @@ BlastScoreBlkProteinMatrixRead(BlastScoreBlk* sbp, FILE *fp)
     return 0;
 }
 
-/** Sets maximum and minimum scores on the BlastScoreBlk for a 
+/** Sets maximum and minimum scores on the BlastScoreBlk for a
  * given matrix
- * @param sbp the BlastScoreBlk on which loscore and hiscore 
+ * @param sbp the BlastScoreBlk on which loscore and hiscore
  *   will be set [in|out]
  * @return zero on success
  */
@@ -1500,7 +1506,7 @@ static Int2
 BlastScoreBlkMaxScoreSet(BlastScoreBlk* sbp)
 {
     Int4 score;
-    Int4 ** matrix; 
+    Int4 ** matrix;
     Int2 index1, index2;
 
     sbp->loscore = BLAST_SCORE_MAX;
@@ -1533,7 +1539,7 @@ BlastScoreBlkMaxScoreSet(BlastScoreBlk* sbp)
 /** Sets sbp->matrix->data field using sbp->name field using
  * the matrices in the toolkit (util/tables/raw_scoremat.h).
  * @param sbp the object containing matrix and name [in|out]
- * @return 0 on success, 1 if matrix could not be loaded 
+ * @return 0 on success, 1 if matrix could not be loaded
  */
 static Int2
 BlastScoreBlkProteinMatrixLoad(BlastScoreBlk* sbp)
@@ -1541,11 +1547,11 @@ BlastScoreBlkProteinMatrixLoad(BlastScoreBlk* sbp)
     Int2 status = 0;
     Int4** matrix = NULL;
     int i, j;   /* loop indices */
-    int x_index, u_index, o_index;
+    int x_index, u_index, o_index, c_index;
     const SNCBIPackedScoreMatrix* psm;
 
     ASSERT(sbp);
-    psm = NCBISM_GetStandardMatrix(sbp->name); 
+    psm = NCBISM_GetStandardMatrix(sbp->name);
     if (psm == NULL)
        return 1;
 
@@ -1566,11 +1572,11 @@ BlastScoreBlkProteinMatrixLoad(BlastScoreBlk* sbp)
     for (i = 0; i < sbp->alphabet_size; i++) {
         for (j = 0; j < sbp->alphabet_size; j++) {
             /* skip special characters */
-            if (i == AMINOACID_TO_NCBISTDAA['U'] || 
+            if (i == AMINOACID_TO_NCBISTDAA['U'] ||
                 i == AMINOACID_TO_NCBISTDAA['O'] ||
                 i == AMINOACID_TO_NCBISTDAA['-'] ||
-                j == AMINOACID_TO_NCBISTDAA['U'] || 
-                j == AMINOACID_TO_NCBISTDAA['O'] || 
+                j == AMINOACID_TO_NCBISTDAA['U'] ||
+                j == AMINOACID_TO_NCBISTDAA['O'] ||
                 j == AMINOACID_TO_NCBISTDAA['-']) {
                 continue;
             }
@@ -1579,14 +1585,15 @@ BlastScoreBlkProteinMatrixLoad(BlastScoreBlk* sbp)
         }
     }
 
-    /* Use the X scores for the more exotic ncbistdaa characters; 
+    /* Use the C scores for U and X scores for the O characters;
        if this is not done then they will never align to non-gap residues */
     x_index = AMINOACID_TO_NCBISTDAA['X'];
     u_index = AMINOACID_TO_NCBISTDAA['U'];
     o_index = AMINOACID_TO_NCBISTDAA['O'];
+    c_index = AMINOACID_TO_NCBISTDAA['C'];
     for (i = 0; i < sbp->alphabet_size; i++) {
-        matrix[u_index][i] = matrix[x_index][i];
-        matrix[i][u_index] = matrix[i][x_index];
+        matrix[u_index][i] = matrix[c_index][i];
+        matrix[i][u_index] = matrix[i][c_index];
         matrix[o_index][i] = matrix[x_index][i];
         matrix[i][o_index] = matrix[i][x_index];
     }
@@ -1599,13 +1606,13 @@ Blast_ScoreBlkMatrixFill(BlastScoreBlk* sbp, GET_MATRIX_PATH get_path)
 {
     Boolean matrix_found = FALSE;
     Int2 status = 0;
-    
-    /* For nucleotide case we first create a default matrix, based on the 
+
+    /* For nucleotide case we first create a default matrix, based on the
        match and mismatch scores. */
     if (sbp->alphabet_code == BLASTNA_SEQ_CODE) {
         /* RMBLASTN supports reading a custom matrix.  Currently
          * I am using the sbp->read_in_matrix parameter to tell if
-         * we should invoke the matrix reader. 
+         * we should invoke the matrix reader.
          * -RMH-
          */
         if ( sbp->read_in_matrix && get_path )
@@ -1671,7 +1678,7 @@ Blast_ScoreBlkMatrixFill(BlastScoreBlk* sbp, GET_MATRIX_PATH get_path)
 
                 fclose(fp);
                 matrix_found = TRUE;
-            } 
+            }
     }
 
     if (matrix_found == FALSE)
@@ -1679,7 +1686,7 @@ Blast_ScoreBlkMatrixFill(BlastScoreBlk* sbp, GET_MATRIX_PATH get_path)
 
     if ( (status=BlastScoreBlkMaxScoreSet(sbp)) != 0)
          return status;
-    
+
     return status;
 }
 
@@ -1700,7 +1707,7 @@ Blast_ResFreqFree(Blast_ResFreq* rfp)
 /*
    Allocates the Blast_ResFreq* and then fills in the frequencies
    in the probabilities.
-*/ 
+*/
 
 Blast_ResFreq*
 Blast_ResFreqNew(const BlastScoreBlk* sbp)
@@ -1719,7 +1726,7 @@ Blast_ResFreqNew(const BlastScoreBlk* sbp)
    rfp->alphabet_code = sbp->alphabet_code;
 
    rfp->prob0 = (double*) calloc(sbp->alphabet_size, sizeof(double));
-   if (rfp->prob0 == NULL) 
+   if (rfp->prob0 == NULL)
    {
       rfp = Blast_ResFreqFree(rfp);
       return rfp;
@@ -1865,11 +1872,11 @@ Blast_GetStdAlphabet(Uint1 alphabet_code, Uint1* residues, Uint4 residues_size)
    if (residues_size < DIM(STD_AMINO_ACID_FREQS))
       return -2;
 
-   for (index=0; index<(int)DIM(STD_AMINO_ACID_FREQS); index++) 
+   for (index=0; index<(int)DIM(STD_AMINO_ACID_FREQS); index++)
    {
       if (alphabet_code == BLASTAA_SEQ_CODE)
       {
-         residues[index] = 
+         residues[index] =
             AMINOACID_TO_NCBISTDAA[toupper((unsigned char) STD_AMINO_ACID_FREQS[index].ch)];
       }
       else
@@ -1894,7 +1901,7 @@ Blast_ResFreqStdComp(const BlastScoreBlk* sbp, Blast_ResFreq* rfp)
       if (retval < 1)
          return retval;
 
-      for (index=0; index<DIM(STD_AMINO_ACID_FREQS); index++) 
+      for (index=0; index<DIM(STD_AMINO_ACID_FREQS); index++)
       {
          rfp->prob[residues[index]] = STD_AMINO_ACID_FREQS[index].p;
       }
@@ -1903,7 +1910,7 @@ Blast_ResFreqStdComp(const BlastScoreBlk* sbp, Blast_ResFreq* rfp)
    else
    {  /* beginning of blastna and ncbi2na are the same. */
       /* Only blastna used  for nucleotides. */
-      for (index=0; index<DIM(nt_prob); index++) 
+      for (index=0; index<DIM(nt_prob); index++)
       {
          rfp->prob[index] = nt_prob[index].p;
       }
@@ -1914,7 +1921,7 @@ Blast_ResFreqStdComp(const BlastScoreBlk* sbp, Blast_ResFreq* rfp)
    return 0;
 }
 
-/** 
+/**
 Intermediate structure to store the composition of a sequence
 */
 typedef struct Blast_ResComp {
@@ -1923,7 +1930,7 @@ typedef struct Blast_ResComp {
     Int4*   comp0;   /**< Same array as above, starts at zero. */
 } Blast_ResComp;
 
-/** Deallocates Blast_ResComp structure and 
+/** Deallocates Blast_ResComp structure and
  * associated arrays.
  * @param rcp the object to be freed [in|out]
  * @return NULL
@@ -1957,10 +1964,10 @@ BlastResCompNew(const BlastScoreBlk* sbp)
 
    rcp->alphabet_code = sbp->alphabet_code;
 
-/* comp0 has zero offset, comp starts at 0, only one 
+/* comp0 has zero offset, comp starts at 0, only one
 array is allocated.  */
    rcp->comp0 = (Int4*) calloc(sbp->alphabet_size, sizeof(Int4));
-   if (rcp->comp0 == NULL) 
+   if (rcp->comp0 == NULL)
    {
       rcp = BlastResCompDestruct(rcp);
       return rcp;
@@ -1971,7 +1978,7 @@ array is allocated.  */
    return rcp;
 }
 
-/** Store the composition of a (query) string.  
+/** Store the composition of a (query) string.
  * @param sbp needed for alphabet information [in]
  * @param rcp object to be filled in [in|out]
  * @param str sequence to have composition calculated for [in]
@@ -1994,7 +2001,7 @@ BlastResCompStr(const BlastScoreBlk* sbp, Blast_ResComp* rcp, char* str, Int4 le
         /* For megablast, check only the first 4 bits of the sequence values */
         mask = (sbp->protein_alphabet ? 0xff : 0x0f);
 
-/* comp0 starts at zero and extends for "num", comp is the same array, but 
+/* comp0 starts at zero and extends for "num", comp is the same array, but
 "start_at" offset. */
    for (index=0; index<(sbp->alphabet_size); index++)
       rcp->comp0[index] = 0;
@@ -2022,11 +2029,11 @@ static Int2
 Blast_ResFreqClr(const BlastScoreBlk* sbp, Blast_ResFreq* rfp)
 {
    Int2  alphabet_max, index;
- 
+
    alphabet_max = sbp->alphabet_start + sbp->alphabet_size;
    for (index=sbp->alphabet_start; index<alphabet_max; index++)
                 rfp->prob[index] = 0.0;
- 
+
         return 0;
 }
 
@@ -2039,7 +2046,7 @@ Blast_ResFreqClr(const BlastScoreBlk* sbp, Blast_ResFreq* rfp)
  * @return zero on success, 1 on failure
 */
 static Int2
-Blast_ResFreqResComp(const BlastScoreBlk* sbp, Blast_ResFreq* rfp, 
+Blast_ResFreqResComp(const BlastScoreBlk* sbp, Blast_ResFreq* rfp,
                      const Blast_ResComp* rcp)
 {
    Int2  alphabet_max, index;
@@ -2076,7 +2083,7 @@ static Int2
 Blast_ResFreqString(const BlastScoreBlk* sbp, Blast_ResFreq* rfp, char* string, Int4 length)
 {
    Blast_ResComp* rcp;
-   
+
    rcp = BlastResCompNew(sbp);
 
    BlastResCompStr(sbp, rcp, string, length);
@@ -2122,7 +2129,7 @@ Blast_ScoreFreqNew(Int4 score_min, Int4 score_max)
 
    range = score_max - score_min + 1;
    sfp->sprob = (double*) calloc(range, sizeof(double));
-   if (sfp->sprob == NULL) 
+   if (sfp->sprob == NULL)
    {
       Blast_ScoreFreqFree(sfp);
       return NULL;
@@ -2171,7 +2178,7 @@ BlastScoreFreqCalc(const BlastScoreBlk* sbp, Blast_ScoreFreq* sfp, Blast_ResFreq
       for (index2=alphabet_start; index2<alphabet_end; index2++)
       {
          score = matrix[index1][index2];
-         if (score >= sbp->loscore) 
+         if (score >= sbp->loscore)
          {
             sfp->sprob[score] += rfp1->prob[index1] * rfp2->prob[index2];
          }
@@ -2182,7 +2189,7 @@ BlastScoreFreqCalc(const BlastScoreBlk* sbp, Blast_ScoreFreq* sfp, Blast_ResFreq
    obs_min = obs_max = BLAST_SCORE_MIN;
    for (score = sfp->score_min; score <= sfp->score_max; score++)
    {
-      if (sfp->sprob[score] > 0.) 
+      if (sfp->sprob[score] > 0.)
       {
          score_sum += sfp->sprob[score];
          obs_max = score;
@@ -2196,7 +2203,7 @@ BlastScoreFreqCalc(const BlastScoreBlk* sbp, Blast_ScoreFreq* sfp, Blast_ResFreq
    score_avg = 0.0;
    if (score_sum > 0.0001 || score_sum < -0.0001)
    {
-      for (score = obs_min; score <= obs_max; score++) 
+      for (score = obs_min; score <= obs_max; score++)
       {
          sfp->sprob[score] /= score_sum;
          score_avg += score * sfp->sprob[score];
@@ -2418,15 +2425,15 @@ BlastKarlinLHtoK(Blast_ScoreFreq* sfp, double lambda, double H)
 
 
 /**
- * Find positive solution to 
+ * Find positive solution to
  *
  *     sum_{i=low}^{high} exp(i lambda) * probs[i] = 1.
- * 
+ *
  * Note that this solution does not exist unless the average score is
  * negative and the largest score that occurs with nonzero probability
  * is positive.
- * 
- * @param probs         probabilities of a score occurring 
+ *
+ * @param probs         probabilities of a score occurring
  * @param d             the gcd of the possible scores. This equals 1 if
  *                      the scores are not a lattice
  * @param low           the lowest possible score that occurs with
@@ -2454,7 +2461,7 @@ BlastKarlinLHtoK(Blast_ScoreFreq* sfp, double lambda, double H)
  * know that for x, a solution lies in [0,1], and because Newton's
  * method is generally more stable and efficient for polynomials than
  * it is for exponentials.
- * 
+ *
  * For the most part, this function is a standard safeguarded Newton
  * iteration: define an interval of uncertainty [a,b] with f(a) > 0
  * and f(b) < 0 (except for the initial value b = 1, where f(b) = 0);
@@ -2485,9 +2492,9 @@ BlastKarlinLHtoK(Blast_ScoreFreq* sfp, double lambda, double H)
  * more difficult.  So (despite the length of this comment) the Newton
  * iteration on f(x) is the simpler solution.
  */
-static double 
+static double
 NlmKarlinLambdaNR(double* probs, Int4 d, Int4 low, Int4 high, double lambda0,
-                  double tolx, Int4 itmax, Int4 maxNewton, Int4 * itn ) 
+                  double tolx, Int4 itmax, Int4 maxNewton, Int4 * itn )
 {
   Int4 k;
   double x0, x, a = 0, b = 1;
@@ -2498,14 +2505,14 @@ NlmKarlinLambdaNR(double* probs, Int4 d, Int4 low, Int4 high, double lambda0,
 
    x0 = exp( -lambda0 );
   x = ( 0 < x0 && x0 < 1 ) ? x0 : .5;
-  
+
   for( k = 0; k < itmax; k++ ) { /* all iteration indices k */
     Int4 i;
     double g, fold = f;
     Int4 wasNewton = isNewton; /* If true, then the previous step was a */
                               /* Newton step */
     isNewton  = 0;            /* Assume that this step is not */
-    
+
     /* Horner's rule for evaluating a polynomial and its derivative */
     g = 0;
     f = probs[low];
@@ -2523,7 +2530,7 @@ NlmKarlinLambdaNR(double* probs, Int4 d, Int4 low, Int4 high, double lambda0,
 
     if( f > 0 ) {
       a = x; /* move the left endpoint */
-    } else if( f < 0 ) { 
+    } else if( f < 0 ) {
       b = x; /* move the right endpoint */
     } else { /* f == 0 */
       break; /* x is an exact solution */
@@ -2535,10 +2542,10 @@ NlmKarlinLambdaNR(double* probs, Int4 d, Int4 low, Int4 high, double lambda0,
 
     if( k >= maxNewton ||
         /* If convergence of Newton's method appears to be failing; or */
-            ( wasNewton && fabs( f ) > .9 * fabs(fold) ) ||  
-        /* if the previous iteration was a Newton step but didn't decrease 
+            ( wasNewton && fabs( f ) > .9 * fabs(fold) ) ||
+        /* if the previous iteration was a Newton step but didn't decrease
          * f sufficiently; or */
-        g >= 0 
+        g >= 0
         /* if a Newton step will move us away from the desired solution */
         ) { /* then */
       /* bisect */
@@ -2554,9 +2561,9 @@ NlmKarlinLambdaNR(double* probs, Int4 d, Int4 low, Int4 high, double lambda0,
         x = y;
         if( fabs( p ) < tolx * x * (1-x) ) break; /* Converged */
       } /* else the proposed iterate is in (a,b) */
-    } /* else try a Newton step. */ 
+    } /* else try a Newton step. */
   } /* end for all iteration indices k */
-   *itn = k; 
+   *itn = k;
   return -log(x)/d;
 }
 
@@ -2577,7 +2584,7 @@ Blast_KarlinLambdaNR(Blast_ScoreFreq* sfp, double initialLambdaGuess)
       return -1.0;
    }
    if (BlastScoreChk(low, high) != 0) return -1.;
-   
+
    sprob = sfp->sprob;
    /* Find greatest common divisor of all scores */
    for (i = 1, d = -low; i <= high-low && d > 1; ++i) {
@@ -2601,7 +2608,7 @@ Blast_KarlinLambdaNR(Blast_ScoreFreq* sfp, double initialLambdaGuess)
  * @param lambda a Karlin-Altschul parameter [in]
  * @return H, a Karlin-Altschul parameter
  */
-static double 
+static double
 BlastKarlinLtoH(Blast_ScoreFreq* sfp, double lambda)
 {
    Int4  score;
@@ -2696,7 +2703,7 @@ See:  Karlin, S. & Altschul, S.F. "Methods for Assessing the Statistical
 Int2
 Blast_KarlinBlkUngappedCalc(Blast_KarlinBlk* kbp, Blast_ScoreFreq* sfp)
 {
-   
+
 
    if (kbp == NULL || sfp == NULL)
       return 1;
@@ -2732,8 +2739,8 @@ ErrExit:
 }
 
 Int2
-Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program, 
-                              BlastScoreBlk* sbp, Uint1* query, 
+Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program,
+                              BlastScoreBlk* sbp, Uint1* query,
                               const BlastQueryInfo* query_info,
                               Blast_Message* *blast_message)
 {
@@ -2741,7 +2748,7 @@ Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program,
    Int4 context; /* loop variable. */
    Blast_ResFreq* rfp,* stdrfp;
    BlastContextInfo* contexts = query_info->contexts;
-   Boolean check_ideal = 
+   Boolean check_ideal =
       (program == eBlastTypeBlastx || program == eBlastTypeTblastx ||
        program == eBlastTypeRpsTblastn);
    Boolean valid_context = FALSE;
@@ -2759,20 +2766,20 @@ Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program,
 
    for (context = query_info->first_context;
         context <= query_info->last_context; ++context) {
-      
+
       Int4 context_offset;
       Int4 query_length;
       Uint1 *buffer;              /* holds sequence */
       Blast_KarlinBlk* kbp;
       Int2 loop_status; /* status flag for functions in this loop. */
-      
+
       if ( !contexts[context].is_valid )
           continue;
 
       query_length = contexts[context].query_length;
       context_offset = contexts[context].query_offset;
       buffer = &query[context_offset];
-      
+
       Blast_ResFreqString(sbp, rfp, (char*)buffer, query_length);
       sbp->sfp[context] = Blast_ScoreFreqNew(sbp->loscore, sbp->hiscore);
       BlastScoreFreqCalc(sbp, sbp->sfp[context], rfp, stdrfp);
@@ -2789,13 +2796,13 @@ Blast_ScoreBlkKbpUngappedCalc(EBlastProgramType program,
           continue;
       }
       /* For searches with translated queries, check whether ideal values
-         should be substituted instead of calculated values, so a more 
+         should be substituted instead of calculated values, so a more
          conservative (smaller) Lambda is used. */
       if (check_ideal && kbp->Lambda >= sbp->kbp_ideal->Lambda)
          Blast_KarlinBlkCopy(kbp, sbp->kbp_ideal);
 
       sbp->kbp_psi[context] = Blast_KarlinBlkNew();
-      loop_status = Blast_KarlinBlkUngappedCalc(sbp->kbp_psi[context], 
+      loop_status = Blast_KarlinBlkUngappedCalc(sbp->kbp_psi[context],
                                            sbp->sfp[context]);
       if (loop_status) {
           contexts[context].is_valid = FALSE;
@@ -2946,7 +2953,7 @@ BlastMatrixValuesDestruct(ListNode* vnp)
  * @return list of MatrixInfos.
  *
 */
-static ListNode* 
+static ListNode*
 BlastLoadMatrixValues (Boolean standard_only)
 
 {
@@ -3043,10 +3050,10 @@ Blast_GetMatrixValues(const char* matrix, Int4** open, Int4** extension, double*
       if (open)
          *open = open_array = (Int4 *) calloc(max_number_values, sizeof(Int4));
       if (extension)
-         *extension = extension_array = 
+         *extension = extension_array =
             (Int4 *) calloc(max_number_values, sizeof(Int4));
       if (lambda)
-         *lambda = lambda_array = 
+         *lambda = lambda_array =
             (double*) calloc(max_number_values, sizeof(double));
       if (K)
          *K = K_array = (double*) calloc(max_number_values, sizeof(double));
@@ -3057,7 +3064,7 @@ Blast_GetMatrixValues(const char* matrix, Int4** open, Int4** extension, double*
       if (beta)
          *beta = beta_array = (double*) calloc(max_number_values, sizeof(double));
       if (pref_flags)
-         *pref_flags = pref_flags_array = 
+         *pref_flags = pref_flags_array =
             (Int4 *) calloc(max_number_values, sizeof(Int4));
 
       for (index=0; index<max_number_values; index++)
@@ -3090,7 +3097,7 @@ Blast_GetMatrixValues(const char* matrix, Int4** open, Int4** extension, double*
 /*Extract the alpha and beta settings for this matrixName, and these
   gap open and gap extension costs*/
 void BLAST_GetAlphaBeta(const char* matrixName, double *alpha,
-                        double *beta, Boolean gapped, Int4 gap_open, 
+                        double *beta, Boolean gapped, Int4 gap_open,
                         Int4 gap_extend, const Blast_KarlinBlk* kbp_ungapped)
 {
    Int4* gapOpen_arr,* gapExtend_arr,* pref_flags;
@@ -3098,8 +3105,8 @@ void BLAST_GetAlphaBeta(const char* matrixName, double *alpha,
    Int2 num_values;
    Int4 i; /*loop index*/
 
-   num_values = Blast_GetMatrixValues(matrixName, &gapOpen_arr, 
-     &gapExtend_arr, NULL, NULL, NULL,  &alpha_arr, &beta_arr, 
+   num_values = Blast_GetMatrixValues(matrixName, &gapOpen_arr,
+     &gapExtend_arr, NULL, NULL, NULL,  &alpha_arr, &beta_arr,
      &pref_flags);
 
    if (gapped) {
@@ -3138,7 +3145,7 @@ void BLAST_GetAlphaBeta(const char* matrixName, double *alpha,
    sfree(beta_arr);
 }
 
-/** Splits an ArrayOf8 into two arrays of supported gap costs.  One is for non-affine 
+/** Splits an ArrayOf8 into two arrays of supported gap costs.  One is for non-affine
  * (megablast linear values) and the other is for standard (typically affine) values.
  * @param input the array to be split [in]
  * @param normal the standard (typically affine) values [out]
@@ -3195,7 +3202,7 @@ s_AdjustGapParametersByGcd(array_of_8* normal, array_of_8* linear, int size, Int
     if (normal)
     {
          int i;
-   
+
          for (i=0; i<size; i++)
          {  /* divide lambda and alpha by divisor. */
             /* multiply gap existence and extension by divisor. */
@@ -3217,7 +3224,7 @@ s_AdjustGapParametersByGcd(array_of_8* normal, array_of_8* linear, int size, Int
 }
 
 /** Returns the array of values corresponding to the given match/mismatch
- * scores, the number of supported gap cost combinations and thresholds for 
+ * scores, the number of supported gap cost combinations and thresholds for
  * the gap costs, beyond which the ungapped statistics can be applied.
  * @param reward Match reward score [in]
  * @param penalty Mismatch penalty score [in]
@@ -3259,36 +3266,36 @@ s_GetNuclValuesArray(Int4 reward, Int4 penalty, Int4* array_size,
     if (reward == 1 && penalty == -5) {
         if ((status=s_SplitArrayOf8(blastn_values_1_5, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *array_size = sizeof(blastn_values_1_5)/sizeof(array_of_8);
         *gap_open_max = 3;
         *gap_extend_max = 3;
     } else if (reward == 1 && penalty == -4) {
         if ((status=s_SplitArrayOf8(blastn_values_1_4, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *array_size = sizeof(blastn_values_1_4)/sizeof(array_of_8);
         *gap_open_max = 2;
         *gap_extend_max = 2;
     } else if (reward == 2 && penalty == -7) {
         if ((status=s_SplitArrayOf8(blastn_values_2_7, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *round_down = TRUE;
         *array_size = sizeof(blastn_values_2_7)/sizeof(array_of_8);
         *gap_open_max = 4;
         *gap_extend_max = 4;
-    } else if (reward == 1 && penalty == -3) { 
+    } else if (reward == 1 && penalty == -3) {
         if ((status=s_SplitArrayOf8(blastn_values_1_3, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *array_size = sizeof(blastn_values_1_3)/sizeof(array_of_8);
         *gap_open_max = 2;
         *gap_extend_max = 2;
     } else if (reward == 2 && penalty == -5) {
         if ((status=s_SplitArrayOf8(blastn_values_2_5, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *round_down = TRUE;
         *array_size = sizeof(blastn_values_2_5)/sizeof(array_of_8);
         *gap_open_max = 4;
@@ -3296,14 +3303,14 @@ s_GetNuclValuesArray(Int4 reward, Int4 penalty, Int4* array_size,
     } else if (reward == 1 && penalty == -2) {
         if ((status=s_SplitArrayOf8(blastn_values_1_2, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *array_size = sizeof(blastn_values_1_2)/sizeof(array_of_8);
         *gap_open_max = 2;
         *gap_extend_max = 2;
     } else if (reward == 2 && penalty == -3) {
         if ((status=s_SplitArrayOf8(blastn_values_2_3, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *round_down = TRUE;
         *array_size = sizeof(blastn_values_2_3)/sizeof(array_of_8);
         *gap_open_max = 6;
@@ -3311,7 +3318,7 @@ s_GetNuclValuesArray(Int4 reward, Int4 penalty, Int4* array_size,
     } else if (reward == 3 && penalty == -4) {
         if ((status=s_SplitArrayOf8(blastn_values_3_4, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *round_down = TRUE;
         *array_size = sizeof(blastn_values_3_4)/sizeof(array_of_8);
         *gap_open_max = 6;
@@ -3319,28 +3326,28 @@ s_GetNuclValuesArray(Int4 reward, Int4 penalty, Int4* array_size,
     } else if (reward == 1 && penalty == -1) {
         if ((status=s_SplitArrayOf8(blastn_values_1_1, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *array_size = sizeof(blastn_values_1_1)/sizeof(array_of_8);
         *gap_open_max = 4;
         *gap_extend_max = 2;
     } else if (reward == 3 && penalty == -2) {
         if ((status=s_SplitArrayOf8(blastn_values_3_2, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *array_size = sizeof(blastn_values_3_2)/sizeof(array_of_8);
         *gap_open_max = 5;
         *gap_extend_max = 5;
     } else if (reward == 4 && penalty == -5) {
         if ((status=s_SplitArrayOf8(blastn_values_4_5, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *array_size = sizeof(blastn_values_4_5)/sizeof(array_of_8);
         *gap_open_max = 12;
         *gap_extend_max = 8;
     } else if (reward == 5 && penalty == -4) {
         if ((status=s_SplitArrayOf8(blastn_values_5_4, &kValues, &kValues_non_affine, &split)))
            return status;
-        
+
         *array_size = sizeof(blastn_values_5_4)/sizeof(array_of_8);
         *gap_open_max = 25;
         *gap_extend_max = 10;
@@ -3348,7 +3355,7 @@ s_GetNuclValuesArray(Int4 reward, Int4 penalty, Int4* array_size,
         status = -1;
         if (error_return) {
             char buffer[256];
-            sprintf(buffer, "Substitution scores %d and %d are not supported", 
+            sprintf(buffer, "Substitution scores %d and %d are not supported",
                 reward, penalty);
             Blast_MessageWrite(error_return, eBlastSevError, kBlastMessageNoContext, buffer);
         }
@@ -3369,18 +3376,18 @@ s_GetNuclValuesArray(Int4 reward, Int4 penalty, Int4* array_size,
     return status;
 }
 
-Int2 BLAST_GetProteinGapExistenceExtendParams(const char* matrixName, 
-                                       Int4* gap_existence, 
+Int2 BLAST_GetProteinGapExistenceExtendParams(const char* matrixName,
+                                       Int4* gap_existence,
                                        Int4* gap_extension)
 {
      Int4* gapOpen_arr,* gapExtend_arr,* pref_flags;
      Int4 i; /*loop index*/
-     Int2 num_values = Blast_GetMatrixValues(matrixName, &gapOpen_arr, 
+     Int2 num_values = Blast_GetMatrixValues(matrixName, &gapOpen_arr,
        &gapExtend_arr, NULL, NULL, NULL,  NULL, NULL, &pref_flags);
 
      if (num_values <= 0)
          return -1;
-   
+
      for(i = 1; i < num_values; i++) {
          if(pref_flags[i]==BLAST_MATRIX_BEST) {
              (*gap_existence) = gapOpen_arr[i];
@@ -3388,7 +3395,7 @@ Int2 BLAST_GetProteinGapExistenceExtendParams(const char* matrixName,
              break;
          }
      }
-   
+
      sfree(gapOpen_arr);
      sfree(gapExtend_arr);
      sfree(pref_flags);
@@ -3437,7 +3444,7 @@ Int2 BLAST_GetNucleotideGapExistenceExtendParams(Int4 reward,
          if (!found)
          {   /* If values are above max, then use. Otherwise set max values. */
              if (*gap_existence < gap_existence_max || *gap_extension < gap_extension_max)
-             { 
+             {
                  *gap_existence = gap_existence_max;
                  *gap_extension = gap_extension_max;
              }
@@ -3473,7 +3480,7 @@ Boolean BLAST_CheckRewardPenaltyScores(Int4 reward, Int4 penalty)
  * @return zero on success.
  */
 static Int2
-BlastKarlinReportAllowedValues(const char *matrix_name, 
+BlastKarlinReportAllowedValues(const char *matrix_name,
    Blast_Message** error_return)
 {
    array_of_8 *values = NULL;
@@ -3516,7 +3523,7 @@ BlastKarlinReportAllowedValues(const char *matrix_name,
 }
 
 /*
-   Supplies lambda, H, and K values, as calcualted by Stephen Altschul 
+   Supplies lambda, H, and K values, as calcualted by Stephen Altschul
    in Methods in Enzy. (vol 266, page 474).
 
    if kbp is NULL, then a validation is perfomed.
@@ -3526,8 +3533,8 @@ Blast_KarlinBlkGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open, Int4 gap_extend,
 
 {
    char buffer[256];
-   Int2 status = 
-      Blast_KarlinBlkGappedLoadFromTables(kbp, gap_open, 
+   Int2 status =
+      Blast_KarlinBlkGappedLoadFromTables(kbp, gap_open,
                                           gap_extend, matrix_name, FALSE);
 
    if (status && error_return)
@@ -3535,7 +3542,7 @@ Blast_KarlinBlkGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open, Int4 gap_extend,
       if (status == 1)
       {
          MatrixInfo* matrix_info;
-         ListNode* vnp,* head;      
+         ListNode* vnp,* head;
 
          vnp = head = BlastLoadMatrixValues(FALSE);
 
@@ -3564,7 +3571,7 @@ Blast_KarlinBlkGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open, Int4 gap_extend,
 }
 
 /*
-   Attempts to fill KarlinBlk for given gap opening, extensions etc.  
+   Attempts to fill KarlinBlk for given gap opening, extensions etc.
    Will return non-zero status if that fails.
 
    return values: -1 if matrix_name is NULL;
@@ -3572,7 +3579,7 @@ Blast_KarlinBlkGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open, Int4 gap_extend,
          2 if matrix found, but open, extend etc. values not supported.
 */
 Int2
-Blast_KarlinBlkGappedLoadFromTables(Blast_KarlinBlk* kbp, Int4 gap_open, 
+Blast_KarlinBlkGappedLoadFromTables(Blast_KarlinBlk* kbp, Int4 gap_open,
                                     Int4 gap_extend, const char* matrix_name,
                                     Boolean standard_only)
 {
@@ -3582,7 +3589,7 @@ Blast_KarlinBlkGappedLoadFromTables(Blast_KarlinBlk* kbp, Int4 gap_open,
    Int4 max_number_values=0;
    MatrixInfo* matrix_info;
    ListNode* vnp,* head;
-   
+
    if (matrix_name == NULL)
       return -1;
 
@@ -3647,17 +3654,17 @@ Blast_KarlinBlkGappedLoadFromTables(Blast_KarlinBlk* kbp, Int4 gap_open,
    Supplies Gumbel parameters for p-value estimation with FSC
 */
 Int2
-Blast_GumbelBlkCalc(Blast_GumbelBlk* gbp, Int4 gap_open, 
+Blast_GumbelBlkCalc(Blast_GumbelBlk* gbp, Int4 gap_open,
       Int4 gap_extend, const char* matrix_name, Blast_Message** error_return)
 {
    char buffer[256];
-   Int2 status = 
+   Int2 status =
       Blast_GumbelBlkLoadFromTables(gbp, gap_open, gap_extend, matrix_name);
 
    if (status && error_return) {
       if (status == 1) {
          MatrixInfo* matrix_info;
-         ListNode* vnp,* head;      
+         ListNode* vnp,* head;
 
          vnp = head = BlastLoadMatrixValues(FALSE);
 
@@ -3691,7 +3698,7 @@ Blast_GumbelBlkCalc(Blast_GumbelBlk* gbp, Int4 gap_open,
          2 if matrix found, but open, extend etc. values not supported.
 */
 Int2
-Blast_GumbelBlkLoadFromTables(Blast_GumbelBlk* gbp, Int4 gap_open, 
+Blast_GumbelBlkLoadFromTables(Blast_GumbelBlk* gbp, Int4 gap_open,
                               Int4 gap_extend, const char* matrix_name)
 {
    Boolean found_matrix=FALSE;
@@ -3700,7 +3707,7 @@ Blast_GumbelBlkLoadFromTables(Blast_GumbelBlk* gbp, Int4 gap_open,
    Int4 max_number_values=0;
    MatrixInfo* matrix_info;
    ListNode* vnp,* head;
-   
+
    if (matrix_name == NULL)
       return -1;
 
@@ -3782,7 +3789,7 @@ BLAST_PrintMatrixMessage(const char *matrix_name, Boolean standard_only)
 }
 
 char*
-BLAST_PrintAllowedValues(const char *matrix_name, 
+BLAST_PrintAllowedValues(const char *matrix_name,
                          Int4 gap_open, Int4 gap_extend)
 {
    array_of_8 *values = NULL;
@@ -3794,7 +3801,7 @@ BLAST_PrintAllowedValues(const char *matrix_name,
 
    ptr = buffer = (char *) calloc(2048, sizeof(char));
 
-   sprintf(ptr, "Gap existence and extension values of %ld and %ld not supported for %s\nsupported values are:\n", 
+   sprintf(ptr, "Gap existence and extension values of %ld and %ld not supported for %s\nsupported values are:\n",
       (long) gap_open, (long) gap_extend, matrix_name);
 
    ptr += strlen(ptr);
@@ -3831,7 +3838,7 @@ BLAST_PrintAllowedValues(const char *matrix_name,
 }
 
 Int2
-Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open, 
+Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open,
                               Int4 gap_extend, Int4 reward, Int4 penalty,
                               Blast_KarlinBlk* kbp_ungap,
                               Boolean* round_down,
@@ -3845,7 +3852,7 @@ Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open,
     int num_combinations = 0;
     int gap_open_max, gap_extend_max;
     array_of_8* normal=NULL;
-    array_of_8* linear=NULL; 
+    array_of_8* linear=NULL;
     Int2 status = s_GetNuclValuesArray(reward,
                                        penalty,
                                        &num_combinations,
@@ -3887,7 +3894,7 @@ Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open,
                 break;
             }
         }
-    
+
         /* If gap costs are not found in the table, check if they belong to the
         infinite domain, where ungapped values of the parameters can be used. */
         if (index == num_combinations) {
@@ -3901,19 +3908,19 @@ Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open,
                 int len=0;
                 /* Unsupported gap costs combination. */
                 sprintf(buffer, "Gap existence and extension values %ld and %ld "
-                        "are not supported for substitution scores %ld and %ld\n", 
+                        "are not supported for substitution scores %ld and %ld\n",
                         (long) gap_open, (long) gap_extend, (long) reward, (long) penalty);
                 for (i = 0; i < num_combinations; ++i)
                 {
                      len = strlen(buffer);
-                     sprintf(buffer+len, "%ld and %ld are supported existence and extension values\n", 
+                     sprintf(buffer+len, "%ld and %ld are supported existence and extension values\n",
                         (long) normal[i][kGapOpenIndex],  (long) normal[i][kGapExtIndex]);
                 }
                 len = strlen(buffer);
-                sprintf(buffer+len, "%ld and %ld are supported existence and extension values\n", 
+                sprintf(buffer+len, "%ld and %ld are supported existence and extension values\n",
                      (long) gap_open_max, (long) gap_extend_max);
                 len = strlen(buffer);
-                sprintf(buffer+len, "Any values more stringent than %ld and %ld are supported\n", 
+                sprintf(buffer+len, "Any values more stringent than %ld and %ld are supported\n",
                      (long) gap_open_max, (long) gap_extend_max);
                 Blast_MessageWrite(error_return, eBlastSevError, kBlastMessageNoContext, buffer);
                 sfree(normal);
@@ -3928,7 +3935,7 @@ Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open,
     return 0;
 }
 
-/** Returns the beta statistical parameter value, given the nucleotide 
+/** Returns the beta statistical parameter value, given the nucleotide
  * substitution scores.
  * @param reward Match reward score [in]
  * @param penalty Mismatch penalty score [in]
@@ -3937,14 +3944,14 @@ Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk* kbp, Int4 gap_open,
 static double s_GetUngappedBeta(Int4 reward, Int4 penalty)
 {
     double beta = 0;
-    if ((reward == 1 && penalty == -1) || 
+    if ((reward == 1 && penalty == -1) ||
         (reward == 2 && penalty == -3))
         beta = -2;
-    
+
     return beta;
 }
 
-Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open, 
+Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open,
                             Int4 gap_extend, Blast_KarlinBlk* kbp,
                             Boolean gapped_calculation,
                             double *alpha, double *beta)
@@ -3957,19 +3964,19 @@ Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open,
     Int4 gap_open_max = 0, gap_extend_max = 0;
     Int4 index = 0;
     array_of_8* normal=NULL;
-    array_of_8* linear=NULL; 
+    array_of_8* linear=NULL;
     Boolean round_down = FALSE;
     Boolean found = FALSE;
     Int2 status = s_GetNuclValuesArray(reward,
                                        penalty,
-                                       &num_combinations, 
+                                       &num_combinations,
                                        &normal,
                                        &linear,
                                        &gap_open_max,
                                        &gap_extend_max,
                                        &round_down,
                                        NULL);
-    
+
     if (status)
        return status;
 
@@ -3985,9 +3992,9 @@ Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open,
         }
         else
         {
-      
+
             for (index = 0; index < num_combinations; ++index) {
-                if (normal[index][kGapOpenIndex] == gap_open && 
+                if (normal[index][kGapOpenIndex] == gap_open &&
                     normal[index][kGapExtIndex] == gap_extend) {
                     *alpha = normal[index][kAlphaIndex];
                     *beta = normal[index][kBetaIndex];
@@ -3996,7 +4003,7 @@ Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open,
                 }
             }
         }
-        
+
     }
 
     /* If input values not found in tables, or if this is an ungapped search,
@@ -4033,7 +4040,7 @@ BlastKarlinEtoS_simple(double E, /* Expect value */
    Lambda = kbp->Lambda;
    K = kbp->K;
    H = kbp->H;
-   if (Lambda < 0. || K < 0. || H < 0.0) 
+   if (Lambda < 0. || K < 0. || H < 0.0)
    {
       return BLAST_SCORE_MIN;
    }
@@ -4089,7 +4096,7 @@ BLAST_Cutoffs(Int4 *S, /* cutoff score */
    */
    es = 1;
    esave = e;
-   if (e > 0.) 
+   if (e > 0.)
    {
         if (dodecay) {
             /* Invert the adjustment to the e-value that will be applied
@@ -4113,7 +4120,7 @@ BLAST_Cutoffs(Int4 *S, /* cutoff score */
    /*
       Re-calculate E from the cutoff score, if E going in was too high
    */
-   if (esave <= 0. || !s_changed) 
+   if (esave <= 0. || !s_changed)
    {
       e = BLAST_KarlinStoE_simple(s, kbp, searchsp);
       if (dodecay) {
@@ -4186,14 +4193,14 @@ typedef struct SRombergCbackArgs {
 
 
 /** Callback for the Romberg integration function.
- *  This is the second of the double integrals that  
- *  BlastSumPCalc calculates This is eqn. 4 of Karlin 
+ *  This is the second of the double integrals that
+ *  BlastSumPCalc calculates This is eqn. 4 of Karlin
  *  and Altschul, PNAS USA, 90, 5873-5877 (1993).
- * 
+ *
  * @param x variable to integrate over [in]
  * @param vp pointer to parameters [in]
  * @return value of integrand
- */  
+ */
 static double
 s_OuterIntegralCback(double x, void* vp)
 {
@@ -4211,21 +4218,21 @@ s_OuterIntegralCback(double x, void* vp)
 }
 
 /** Callback for the Romberg integration function.
- *  This is the first of the double integrals that  
- *  BlastSumPCalc calculates.  This is the integral 
- *  described in the paragraph after eqn. 4 of Karlin 
+ *  This is the first of the double integrals that
+ *  BlastSumPCalc calculates.  This is the integral
+ *  described in the paragraph after eqn. 4 of Karlin
  *  and Altschul, PNAS USA, 90, 5873-5877 (1993).
- * 
+ *
  * @param s variable to integrate over [in]
  * @param vp pointer to parameters [in]
  * @return value of integrand
- */  
+ */
 static double
 s_InnerIntegralCback(double s, void* vp)
 {
    double   mx;
    SRombergCbackArgs* callback_args = (SRombergCbackArgs*) vp;
-   
+
    callback_args->adj2 = callback_args->adj1 - s;
    callback_args->sdvir = s / callback_args->num_hsps;
    mx = (s > 0. ? callback_args->sdvir + 3. : 3.);
@@ -4333,21 +4340,21 @@ s_BlastSumPCalc(int r, double s)
  * Approx. 2-1/2 digits accuracy minimum throughout the range of r, s.
  * @param r number of segments [in]
  * @param s total score (in nats), adjusted by -r*log(KN) [in]
- * @return p-value 
+ * @return p-value
 */
 static double
 s_BlastSumP(Int4 r, double s)
 {
     static const double  kTab2[] = { /* table for r == 2 */
-         0.01669,  0.0249,   0.03683,  0.05390,  0.07794,  0.1111,   0.1559,   0.2146,   
-         0.2890,   0.3794,   0.4836,   0.5965,   0.7092,   0.8114,   0.8931,   0.9490,   
+         0.01669,  0.0249,   0.03683,  0.05390,  0.07794,  0.1111,   0.1559,   0.2146,
+         0.2890,   0.3794,   0.4836,   0.5965,   0.7092,   0.8114,   0.8931,   0.9490,
          0.9806,   0.9944,   0.9989
-         };  
+         };
     static const double  kTab3[] = { /* table for r == 3 */
          0.9806,   0.9944,   0.9989,   0.0001682,0.0002542,0.0003829,0.0005745,0.0008587,
-         0.001278, 0.001893, 0.002789, 0.004088, 0.005958, 0.008627, 0.01240,  0.01770,  
-         0.02505,  0.03514,  0.04880,  0.06704,  0.09103,  0.1220,   0.1612,   0.2097,   
-         0.2682,   0.3368,   0.4145,   0.4994,   0.5881,   0.6765,   0.7596,   0.8326,   
+         0.001278, 0.001893, 0.002789, 0.004088, 0.005958, 0.008627, 0.01240,  0.01770,
+         0.02505,  0.03514,  0.04880,  0.06704,  0.09103,  0.1220,   0.1612,   0.2097,
+         0.2682,   0.3368,   0.4145,   0.4994,   0.5881,   0.6765,   0.7596,   0.8326,
          0.8922,   0.9367,   0.9667,   0.9846,   0.9939,   0.9980
          };
    static const double  kTab4[] = { /* table for r == 4 */
@@ -4359,7 +4366,7 @@ s_BlastSumP(Int4 r, double s)
          0.3254,   0.3906,   0.4612,   0.5355,   0.6110,   0.6849,   0.7544,   0.8168,
          0.8699,   0.9127,   0.9451,   0.9679,   0.9827,   0.9915,   0.9963
          };
-   const double* kTable[] = { kTab2, kTab3, kTab4 }; 
+   const double* kTable[] = { kTab2, kTab3, kTab4 };
    const int kTabsize[] = { DIM(kTab2)-1, DIM(kTab3)-1, DIM(kTab4)-1 };  /* sizes of tab2, tab3, tab4 */
 
    if (r == 1)
@@ -4425,7 +4432,7 @@ BLAST_SmallGapSumE(
         double pair_search_space;  /* The effective size of the search
                                  * space, for this query-subject pair */
         double sum_p;           /* The p-value of this set of alignments */
-      
+
         pair_search_space = (double)subject_length * (double)query_length;
 
         xsum -=
@@ -4464,8 +4471,8 @@ BLAST_SmallGapSumE(
  * @param query_length The effective len of the query seq [in]
  * @param subject_length The effective len of the database seq [in]
  * @param searchsp_eff effective size of the search space [in]
- * @param weight_divisor A divisor used to weight the e-value when multiple 
- *                       collections of alignments are being considered by 
+ * @param weight_divisor A divisor used to weight the e-value when multiple
+ *                       collections of alignments are being considered by
  *                       the calling routine [in]
  * @return Resulting e-value of a combined set.
  */
@@ -4541,9 +4548,9 @@ BLAST_LargeGapSumE(
     } else {
       xsum -= num*log(lcl_subject_length*lcl_query_length)
         - BLAST_LnFactorial((double) num);
-      
+
       sum_p = s_BlastSumP(num, xsum);
-      
+
       sum_e = BLAST_KarlinPtoE(sum_p) *
           ((double) searchsp_eff / (lcl_query_length * lcl_subject_length));
     }
@@ -4555,7 +4562,7 @@ BLAST_LargeGapSumE(
 }
 
 /* Please see comment in blast_stat.h */
-void 
+void
 Blast_FillResidueProbability(const Uint1* sequence, Int4 length, double * resProb)
 {
     Int4 frequency[BLASTAA_SIZE];  /*frequency of each letter*/
@@ -4605,14 +4612,14 @@ RPSfindUngappedLambda(const char *matrixName)
     }
 }
 
-/** 
+/**
  *  the routine RPSFillScores computes the probability of each score weighted
  *       by the probability of each query residue and fills those probabilities
  *       into scoreArray and puts scoreArray as a field in
  *       that in the structure that is returned
  *  for indexing convenience the field storing scoreArray points to the
  *       entry for score 0, so that referring to the -k index corresponds to
- *       score -k 
+ *       score -k
  *FIXME: This can be replaced by _PSIComputeScoreProbabilities??
  * @param matrix a position-specific score matrix with matrixLength positions [in]
  * @param matrixLength number of positions in the pssm (arg above) [in]
@@ -4628,8 +4635,8 @@ RPSfindUngappedLambda(const char *matrixName)
 */
 
 static void
-RPSFillScores(Int4 **matrix, Int4 matrixLength, 
-              double *queryProbArray, double *scoreArray,  
+RPSFillScores(Int4 **matrix, Int4 matrixLength,
+              double *queryProbArray, double *scoreArray,
               Blast_ScoreFreq* return_sfp, Int4 range,
               Int4 alphabet_size)
 {
@@ -4642,7 +4649,7 @@ RPSFillScores(Int4 **matrix, Int4 matrixLength,
         for (j = 0 ; j < alphabet_size; j++) {
             if (j == AMINOACID_TO_NCBISTDAA['X'])
                 continue;
-            if ((matrix[i][j] > BLAST_SCORE_MIN) && 
+            if ((matrix[i][j] > BLAST_SCORE_MIN) &&
                 (matrix[i][j] < minScore))
                 minScore = matrix[i][j];
             if (matrix[i][j] > maxScore)
@@ -4661,7 +4668,7 @@ RPSFillScores(Int4 **matrix, Int4 matrixLength,
             if (j == AMINOACID_TO_NCBISTDAA['X'])
                 continue;
             if(matrix[i][j] >= minScore)
-                return_sfp->sprob[matrix[i][j]] += recipLength * 
+                return_sfp->sprob[matrix[i][j]] += recipLength *
                                                 queryProbArray[j];
         }
     }
@@ -4672,20 +4679,20 @@ RPSFillScores(Int4 **matrix, Int4 matrixLength,
 }
 
 Int4 **
-RPSRescalePssm(double scalingFactor, Int4 rps_query_length, 
-               const Uint1* rps_query_seq, Int4 db_seq_length, 
+RPSRescalePssm(double scalingFactor, Int4 rps_query_length,
+               const Uint1* rps_query_seq, Int4 db_seq_length,
                Int4 **posMatrix, BlastScoreBlk *sbp)
 {
     double *scoreArray;         /*array of score probabilities*/
     double *resProb;            /*array of probabilities for each residue*/
     Blast_ScoreFreq * return_sfp;/*score frequency pointers to compute lambda*/
     Int4* * returnMatrix;        /*the PSSM to return */
-    double initialUngappedLambda; 
-    double scaledInitialUngappedLambda; 
+    double initialUngappedLambda;
+    double scaledInitialUngappedLambda;
     double correctUngappedLambda;
     double finalLambda;
     double temp;               /*intermediate variable for adjusting matrix*/
-    Int4 index, inner_index; 
+    Int4 index, inner_index;
     Int4 alphabet_size;
 
     resProb = (double *)malloc(BLASTAA_SIZE * sizeof(double));
@@ -4695,13 +4702,13 @@ RPSRescalePssm(double scalingFactor, Int4 rps_query_length,
     Blast_FillResidueProbability(rps_query_seq, rps_query_length, resProb);
 
     alphabet_size = sbp->psi_matrix->pssm->nrows;
-    RPSFillScores(posMatrix, db_seq_length, resProb, scoreArray, 
+    RPSFillScores(posMatrix, db_seq_length, resProb, scoreArray,
                  return_sfp, BLAST_SCORE_RANGE_MAX, alphabet_size);
 
     initialUngappedLambda = RPSfindUngappedLambda(sbp->name);
     ASSERT(initialUngappedLambda > 0.0);
     scaledInitialUngappedLambda = initialUngappedLambda / scalingFactor;
-    correctUngappedLambda = Blast_KarlinLambdaNR(return_sfp, 
+    correctUngappedLambda = Blast_KarlinLambdaNR(return_sfp,
                                               scaledInitialUngappedLambda);
     sfree(resProb);
     sfree(scoreArray);
@@ -4720,9 +4727,9 @@ RPSRescalePssm(double scalingFactor, Int4 rps_query_length,
 
     for (index = 0; index < db_seq_length; index++) {
         for (inner_index = 0; inner_index < alphabet_size; inner_index++) {
-            if (posMatrix[index][inner_index] <= BLAST_SCORE_MIN || 
+            if (posMatrix[index][inner_index] <= BLAST_SCORE_MIN ||
                 inner_index == AMINOACID_TO_NCBISTDAA['X']) {
-                returnMatrix[index][inner_index] = 
+                returnMatrix[index][inner_index] =
                     posMatrix[index][inner_index];
             }
             else {
@@ -4770,7 +4777,7 @@ static void s_BuildCompressedTranslation(const char *trans_string,
         table[i] = compressed_alphabet_size;
 
     for (i = j = compressed_letter = 0; trans_string[i] != 0; i++) {
-        
+
         Int4 c = trans_string[i];
 
         if (isspace(c)) {
@@ -4797,7 +4804,7 @@ static void s_BuildCompressedTranslation(const char *trans_string,
  *              row of the table ends with a negative value [in]
  */
 static Int2 s_GetCompressedProbs(BlastScoreBlk *sbp,
-                                 double* compressed_prob, 
+                                 double* compressed_prob,
                                  Int4 compressed_alphabet_size,
                                  CompressedReverseLookup rev_table)
 {
@@ -4817,7 +4824,7 @@ static Int2 s_GetCompressedProbs(BlastScoreBlk *sbp,
         compressed_prob[i] = 0.0;
 
     for (letter = 0; letter < compressed_alphabet_size; letter++) {
-        double prob_sum = 0.; 
+        double prob_sum = 0.;
 
         /* sum the frequencies of the protein letters making
            up this compressed letter */
@@ -4858,11 +4865,11 @@ static Int2 s_BuildCompressedScoreMatrix(BlastScoreBlk *sbp,
                                         double matrix_scale_factor,
                                         CompressedReverseLookup rev_table)
 {
-    double compressed_prob[BLASTAA_SIZE]; 
+    double compressed_prob[BLASTAA_SIZE];
     double lambda;
     SFreqRatios * std_freqs;
     SBlastScoreMatrix *new_matrix;
-    Int4 compressed_alphabet_size = 
+    Int4 compressed_alphabet_size =
                     new_alphabet->compressed_alphabet_size;
 
     /* get the ungapped lambda for the protein score matrix */
@@ -4881,8 +4888,8 @@ static Int2 s_BuildCompressedScoreMatrix(BlastScoreBlk *sbp,
 
     /* sum the background frequencies of each compressed letter */
 
-    if (s_GetCompressedProbs(sbp, compressed_prob, 
-                             compressed_alphabet_size, 
+    if (s_GetCompressedProbs(sbp, compressed_prob,
+                             compressed_alphabet_size,
                              rev_table) < 0) {
         _PSIMatrixFrequencyRatiosFree(std_freqs);
         return -3;
@@ -4894,12 +4901,12 @@ static Int2 s_BuildCompressedScoreMatrix(BlastScoreBlk *sbp,
         Int4 **scores = new_matrix->data;
         Int4 i, q, s;
         const double min_freq = BLAST_SCORE_MIN / matrix_scale_factor;
-    
+
         for (q = 0; q < BLASTAA_SIZE; q++) {
             for (s = 0; s < compressed_alphabet_size; s++) {
 
                 double val = 0; /* combined frequency ratio */
-                
+
                 for (i = 0; i < BLASTAA_SIZE; i++) {
 
                     Int4 aa = rev_table[s][i];
@@ -4911,19 +4918,19 @@ static Int2 s_BuildCompressedScoreMatrix(BlastScoreBlk *sbp,
 
                     val += std_freqs->data[q][aa] * compressed_prob[aa];
                 }
-                
+
                 val = (val < 1e-8) ? min_freq : log(val);
                 scores[q][s] = BLAST_Nint(val * matrix_scale_factor);
             }
         }
     }
-  
+
     _PSIMatrixFrequencyRatiosFree(std_freqs);
     return 0;
 }
 
-/* for more information see Edgar RC, "Local homology 
-   recognition and distance measures in linear time using 
+/* for more information see Edgar RC, "Local homology
+   recognition and distance measures in linear time using
    compressed amino acid alphabets." PMID: 14729922.
    The strings below have letter groups sorted in order
    of decreasing combined residue frequency */
@@ -4946,7 +4953,7 @@ SCompressedAlphabetNew(BlastScoreBlk *sbp,
     ASSERT(compressed_alphabet_size == 10 ||
            compressed_alphabet_size == 15);
 
-    new_alphabet = (SCompressedAlphabet*)calloc(1, 
+    new_alphabet = (SCompressedAlphabet*)calloc(1,
                                 sizeof(SCompressedAlphabet));
 
     /* parse the compressed alphabet */
@@ -4965,7 +4972,7 @@ SCompressedAlphabetNew(BlastScoreBlk *sbp,
                                  matrix_scale_factor, rev_table) < 0) {
         return SCompressedAlphabetFree(new_alphabet);
     }
-    
+
     return new_alphabet;
 }
 
@@ -4980,33 +4987,33 @@ SCompressedAlphabetFree(SCompressedAlphabet *alphabet)
     return NULL;
 }
 
-/** 
+/**
  * Computes the adjustment to the lengths of the query and database sequences
- * that is used to compensate for edge effects when computing evalues. 
+ * that is used to compensate for edge effects when computing evalues.
  *
  * The length adjustment is an integer-valued approximation to the fixed
  * point of the function
  *
- *    f(ell) = beta + 
+ *    f(ell) = beta +
  *               (alpha/lambda) * (log K + log((m - ell)*(n - N ell)))
  *
  * where m is the query length n is the length of the database and N is the
  * number of sequences in the database. The values beta, alpha, lambda and
  * K are statistical, Karlin-Altschul parameters.
- * 
- * The value of the length adjustment computed by this routine, A, 
+ *
+ * The value of the length adjustment computed by this routine, A,
  * will always be an integer smaller than the fixed point of
  * f(ell). Usually, it will be the largest such integer.  However, the
- * computed length adjustment, A, will also be so small that 
+ * computed length adjustment, A, will also be so small that
  *
  *    K * (m - A) * (n - N * A) > MAX(m,n).
  *
  * Moreover, an iterative method is used to compute A, and under
- * unusual circumstances the iterative method may not converge. 
+ * unusual circumstances the iterative method may not converge.
  *
  * @param K      the statistical parameter K
  * @param logK   the natural logarithm of K
- * @param alpha_d_lambda    the ratio of the statistical parameters 
+ * @param alpha_d_lambda    the ratio of the statistical parameters
  *                          alpha and lambda (for ungapped alignments, the
  *                          value 1/H should be used)
  * @param beta              the statistical parameter beta (for ungapped
@@ -5078,7 +5085,7 @@ BLAST_ComputeLengthAdjustment(double K,
         } else { /* else ell is greater than the true fixed point */
             ell_max = ell;
         }
-        if(ell_min <= ell_bar && ell_bar <= ell_max) { 
+        if(ell_min <= ell_bar && ell_bar <= ell_max) {
           /* ell_bar is in range. Accept it */
             ell_next = ell_bar;
         } else { /* else ell_bar is not in range. Reject it */
@@ -5108,7 +5115,7 @@ BLAST_ComputeLengthAdjustment(double K,
 }
 
 /* UNUSED
-static double s_CalculateNormalProbability(double x_, double eps_) 
+static double s_CalculateNormalProbability(double x_, double eps_)
 {
     double pi = 3.1415926535897932384626433832795;
     double x_max;
@@ -5158,14 +5165,14 @@ double
 BLAST_SpougeStoE(Int4 y_,
                  Blast_KarlinBlk* kbp,
                  Blast_GumbelBlk* gbp,
-                 Int4 m_, Int4 n_) 
+                 Int4 m_, Int4 n_)
 {
     // the score and lambda may have been rescaled.  We will compute the scaling factor
     // and use it to scale a, alpha, and Sigma similarly.
     double scale_factor = kbp->Lambda / gbp->Lambda;
 
     // the pair-wise e-value must be scaled back to db-wise e-value
-    double db_scale_factor = (gbp->db_length) ? 
+    double db_scale_factor = (gbp->db_length) ?
             (double)gbp->db_length/(double)n_ : 1.0;
 
     double lambda_    = kbp->Lambda;
@@ -5189,36 +5196,40 @@ BLAST_SpougeStoE(Int4 y_,
     double m_li_y, vi_y, sqrt_vi_y, m_F, P_m_F;
     double n_lj_y, vj_y, sqrt_vj_y, n_F, P_n_F;
     double c_y, p1, p2, area;
+    double e_value;
 
     m_li_y = m_ - (ai_hat_*y_ + bi_hat_);
     vi_y = MAX(2.0*alphai_hat_/lambda_, alphai_hat_*y_+betai_hat_);
     sqrt_vi_y = sqrt(vi_y);
     m_F = m_li_y/sqrt_vi_y;
-    P_m_F = 0.5 + 0.5 * BLAST_Erf(m_F);
+    P_m_F = ErfC(-m_F / sqrt(2.0)) / 2.0;
     p1 = m_li_y * P_m_F + sqrt_vi_y * const_val * exp(-0.5*m_F*m_F);
 
     n_lj_y = n_ - (aj_hat_*y_ + bj_hat_);
     vj_y = MAX(2.0*alphaj_hat_/lambda_, alphaj_hat_*y_+betaj_hat_);
     sqrt_vj_y = sqrt(vj_y);
     n_F = n_lj_y/sqrt_vj_y;
-    P_n_F = 0.5 + 0.5 * BLAST_Erf(n_F);
+    P_n_F = ErfC(-n_F / sqrt(2.0)) / 2.0;
     p2 = n_lj_y * P_n_F + sqrt_vj_y * const_val * exp(-0.5*n_F*n_F);
 
     c_y = MAX(2.0*sigma_hat_/lambda_, sigma_hat_*y_+tau_hat_);
     area = p1 * p2 + c_y * P_m_F * P_n_F;
 
-    return area * k_ * exp(-lambda_ * y_) * db_scale_factor;
+    e_value = area * k_ * exp(-lambda_ * y_) * db_scale_factor;
+    ASSERT(e_value >= 0.0);
+
+    return e_value;
 }
 
-Int4 
+Int4
 BLAST_SpougeEtoS(double e0,
                  Blast_KarlinBlk* kbp,
                  Blast_GumbelBlk* gbp,
-                 Int4 m, Int4 n) 
+                 Int4 m, Int4 n)
 {
     Int4 a=0, b, c;
     double e;
-    double db_scale_factor = (gbp->db_length) ? 
+    double db_scale_factor = (gbp->db_length) ?
             (double)gbp->db_length : 1.0;
 
     b = MAX((int)(log(db_scale_factor/e0) / kbp->Lambda), 2);
diff --git a/c++/src/algo/blast/core/blast_traceback.c b/c++/src/algo/blast/core/blast_traceback.c
index 122ad38..2c7299e 100644
--- a/c++/src/algo/blast/core/blast_traceback.c
+++ b/c++/src/algo/blast/core/blast_traceback.c
@@ -1,4 +1,4 @@
-/* $Id: blast_traceback.c 456407 2015-01-12 15:47:18Z fongah2 $
+/* $Id: blast_traceback.c 500444 2016-05-04 17:46:06Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -30,10 +30,10 @@
  * Functions responsible for the traceback stage of the BLAST algorithm.
  * <pre>
  * The hierarchy of function calls for performing traceback is:
- *    Blast_RunTracebackSearch 
+ *    Blast_RunTracebackSearch
  *        BLAST_GapAlignSetUp
  *        BLAST_ComputeTraceback
- *            if ( RPS BLAST ) 
+ *            if ( RPS BLAST )
  *                s_RPSComputeTraceback
  *                    for ( all HSP lists )
  *                        Blast_TracebackFromHSPList
@@ -41,7 +41,7 @@
  *                Blast_RedoAlignmentCore
  *            else
  *                for ( all HSP lists )
- *                    if ( PHI BLAST) 
+ *                    if ( PHI BLAST)
  *                        s_PHITracebackFromHSPList
  *                    else
  *                        Blast_TracebackFromHSPList
@@ -49,8 +49,8 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = 
-    "$Id: blast_traceback.c 456407 2015-01-12 15:47:18Z fongah2 $";
+static char const rcsid[] =
+    "$Id: blast_traceback.c 500444 2016-05-04 17:46:06Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/blast_traceback.h>
@@ -75,7 +75,7 @@ static char const rcsid[] =
 #endif
 
 /** Window size used to scan HSP for highest score region, where gapped
- * extension starts. 
+ * extension starts.
  */
 #define HSP_MAX_WINDOW 11
 
@@ -92,7 +92,7 @@ Blast_HSPUpdateWithTraceback(BlastGapAlignStruct* gap_align, BlastHSP* hsp)
    hsp->subject.end = gap_align->subject_stop;
    /* If editing block is non-NULL, transfer ownership to the HSP structure.
       Then fill the missing infomation in the editing block. */
-   if (gap_align->edit_script) { 
+   if (gap_align->edit_script) {
       hsp->gap_info = gap_align->edit_script;
       gap_align->edit_script = NULL;
    }
@@ -103,36 +103,36 @@ Blast_HSPUpdateWithTraceback(BlastGapAlignStruct* gap_align, BlastHSP* hsp)
 /** Remove scaling from scores previously calculated on the hsp_list.
  * @param hsp_list list of HPSs with the score field calculated [in|out]
  * @param scale_factor factor by which scores are scaled, for everything other
- * than RPS-BLAST this should be 1 [in] 
+ * than RPS-BLAST this should be 1 [in]
  * @todo rename to something which is more intention revealing, merge with
  * function of the same name in blast_kappa.c
  */
-static void 
+static void
 s_HSPListRescaleScores(BlastHSPList* hsp_list, double scale_factor)
 {
    Int4 index;
 
    for (index = 0; index < hsp_list->hspcnt; ++index) {
       BlastHSP* hsp = hsp_list->hsp_array[index];
-      
+
       /* Remove any scaling of the calculated score */
-      hsp->score = 
+      hsp->score =
          (Int4) ((hsp->score+(0.5*scale_factor)) / scale_factor);
    }
 
    /* Sort HSPs by score again because after the loop above scores that
     * were previously different can become equal, and then the order of HSPs
-    * should be determined by the tie-breaking criteria 
+    * should be determined by the tie-breaking criteria
     * (e.g.: subject offsets, ...) */
    Blast_HSPListSortByScore(hsp_list);
 }
 
-/** Swaps insertions and deletions in an edit script for RPS BLAST search. 
- * This is necessary because query and subject are switched during the 
+/** Swaps insertions and deletions in an edit script for RPS BLAST search.
+ * This is necessary because query and subject are switched during the
  * traceback alignment, and must be switched back.
  * @param hsp HSP structure to fix. [in] [out]
  */
-static void 
+static void
 s_BlastHSPRPSUpdate(BlastHSP *hsp)
 {
    GapEditScript *esp = hsp->gap_info;
@@ -156,7 +156,7 @@ s_BlastHSPRPSUpdate(BlastHSP *hsp)
  * @param program Program type: RPS or RPS tblastn [in]
  * @param hsplist List of HSPs [in] [out]
  */
-static void 
+static void
 s_BlastHSPListRPSUpdate(EBlastProgramType program, BlastHSPList *hsplist)
 {
    Int4 i;
@@ -175,12 +175,12 @@ s_BlastHSPListRPSUpdate(EBlastProgramType program, BlastHSPList *hsplist)
       hsp[i]->query = hsp[i]->subject;
       hsp[i]->subject = tmp;
 
-      /* Change the traceback information to reflect the query and subject 
+      /* Change the traceback information to reflect the query and subject
          sequences getting switched */
       s_BlastHSPRPSUpdate(hsp[i]);
 
-      /* If query was nucleotide, set context, because it is needed in order 
-         to pick correct Karlin block for calculating bit scores. There are 
+      /* If query was nucleotide, set context, because it is needed in order
+         to pick correct Karlin block for calculating bit scores. There are
          6 contexts corresponding to each nucleotide query sequence. */
       if (program == eBlastTypeRpsTblastn) {
           hsp[i]->context = BLAST_FrameToContext(hsp[i]->query.frame, program);
@@ -197,36 +197,36 @@ s_BlastHSPListRPSUpdate(EBlastProgramType program, BlastHSPList *hsplist)
  * @param score_params Scoring parameters [in]
  * @param hit_params Hit saving parameters [in]
  * @param sbp Scoring block [in]
- * @param subject_length Length of the subject sequence - needed for linking 
+ * @param subject_length Length of the subject sequence - needed for linking
  *                       HSPs [in]
  */
 static Int2
-s_HSPListPostTracebackUpdate(EBlastProgramType program_number, 
-   BlastHSPList* hsp_list, const BlastQueryInfo* query_info, 
-   const BlastScoringParameters* score_params, 
-   const BlastHitSavingParameters* hit_params, 
+s_HSPListPostTracebackUpdate(EBlastProgramType program_number,
+   BlastHSPList* hsp_list, const BlastQueryInfo* query_info,
+   const BlastScoringParameters* score_params,
+   const BlastHitSavingParameters* hit_params,
    const BlastScoreBlk* sbp, Int4 subject_length)
 {
    BlastScoringOptions* score_options = score_params->options;
    const Boolean kGapped = score_options->gapped_calculation;
-   
-   /* Revert query and subject to their traditional meanings. 
+
+   /* Revert query and subject to their traditional meanings.
       This involves switching the offsets around and reversing
       any traceback information */
    s_BlastHSPListRPSUpdate(program_number, hsp_list);
-   
+
    /* Relink and rereap the HSP list, if needed. */
    if (hit_params->link_hsp_params) {
       BLAST_LinkHsps(program_number, hsp_list, query_info, subject_length,
                      sbp, hit_params->link_hsp_params, kGapped);
    } else {
-      /* Only use the scaling factor from parameters structure for RPS BLAST, 
+      /* Only use the scaling factor from parameters structure for RPS BLAST,
        * because for other programs either there is no scaling at all, or, in
-       * case of composition based statistics, Lambda is scaled as well as 
-       * scores, and hence scaling factor should not be used for e-value 
-       * computations. 
+       * case of composition based statistics, Lambda is scaled as well as
+       * scores, and hence scaling factor should not be used for e-value
+       * computations.
        */
-      double scale_factor = 
+      double scale_factor =
          (Blast_ProgramIsRpsBlast(program_number) ?
          score_params->scale_factor : 1.0);
 
@@ -240,14 +240,14 @@ s_HSPListPostTracebackUpdate(EBlastProgramType program_number,
    }
 
    Blast_HSPListReapByEvalue(hsp_list, hit_params->options);
-   
+
    /* Rescale the scores by scaling factor, if necessary. This rescaling
     * should be done for all programs where scaling factor is not 1.
     */
    s_HSPListRescaleScores(hsp_list, score_params->scale_factor);
-   
-   /** Calculate and fill the bit scores. @todo: This is not the only time 
-    * when they are calculated, s_HSPListRescaleScores also does this in 
+
+   /** Calculate and fill the bit scores. @todo: This is not the only time
+    * when they are calculated, s_HSPListRescaleScores also does this in
     * blast_kappa.c.
     */
    Blast_HSPListGetBitScores(hsp_list, kGapped, sbp);
@@ -259,10 +259,10 @@ s_HSPListPostTracebackUpdate(EBlastProgramType program_number,
     Comments in blast_traceback.h
  */
 Int2
-Blast_TracebackFromHSPList(EBlastProgramType program_number, 
-   BlastHSPList* hsp_list, const BLAST_SequenceBlk* query_blk, 
+Blast_TracebackFromHSPList(EBlastProgramType program_number,
+   BlastHSPList* hsp_list, const BLAST_SequenceBlk* query_blk,
    BLAST_SequenceBlk* subject_blk, const BlastQueryInfo* query_info_in,
-   BlastGapAlignStruct* gap_align, const BlastScoreBlk* sbp, 
+   BlastGapAlignStruct* gap_align, const BlastScoreBlk* sbp,
    const BlastScoringParameters* score_params,
    const BlastExtensionOptions* ext_options,
    const BlastHitSavingParameters* hit_params, const Uint1* gen_code_string,
@@ -288,10 +288,10 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
    const Boolean is_rpsblast = Blast_ProgramIsRpsBlast(program_number);
    const Boolean kIsOutOfFrame = score_options->is_ooframe;
    const Boolean kGreedyTraceback = (ext_options->eTbackExt == eGreedyTbck);
-   const Boolean kTranslateSubject = 
+   const Boolean kTranslateSubject =
         (Blast_SubjectIsTranslated(program_number) || program_number == eBlastTypeRpsTblastn);
    const Boolean kFullTranslation = (fence_hit && *fence_hit);
-   const Boolean kSmithWaterman = (ext_options->eTbackExt == 
+   const Boolean kSmithWaterman = (ext_options->eTbackExt ==
                                    eSmithWatermanTbckFull);
    const BlastQueryInfo* query_info = query_info_in;
    Int4 stat_length = subject_blk->length;
@@ -302,19 +302,19 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
    Boolean fence_error = FALSE;
    SBlastTargetTranslation* target_t = NULL;
    Int2 status = 0;
-   
+
    if (num_initial_hsps == 0) {
       return 0;
    }
-   
+
    if (fence_hit) {
        orig_hsplist = BlastHSPListDup(hsp_list);
        *fence_hit = FALSE;  /* reset fence_hit */
    }
-   
+
    hsp_array = hsp_list->hsp_array;
-   
-   /* for Smith-Waterman, the results do not overwrite 
+
+   /* for Smith-Waterman, the results do not overwrite
       the input list of HSPs one by one; instead, hsp_list
       is rebuilt from scratch */
    if (kSmithWaterman) {
@@ -330,12 +330,12 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
           }
           return -1;
       }
-      
+
       if (program_number == eBlastTypeRpsTblastn) {
           translation_buffer = subject_blk->sequence - 1;
           frame_offsets_a = frame_offsets =
               ContextOffsetsToOffsetArray(query_info_in);
-      } 
+      }
       else
       	BlastTargetTranslationNew(subject_blk, gen_code_string, program_number, kIsOutOfFrame, &target_t);
       if (kIsOutOfFrame)
@@ -358,32 +358,37 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
       query_info = qi;
    }
 
-   /* Make sure the HSPs in the HSP list are sorted by score, as they should 
+   /* Make sure the HSPs in the HSP list are sorted by score, as they should
       be. */
+#ifdef _DEBUG
+   {
+       Blast_HSPListSortByScore(hsp_list);
+   }
+#endif
    ASSERT(Blast_HSPListIsSortedByScore(hsp_list));
 
-   /* set up the tree for HSP containment tests. subject_length 
+   /* set up the tree for HSP containment tests. subject_length
       is zero only for translated subject sequences, whose maximum
       length is bounded by the length of the first frame */
 
    tree = Blast_IntervalTreeInit(0, query_blk->length + 1,
                                  0, (subject_length > 0 ? subject_length :
                                  subject_blk->length / CODON_LENGTH) + 1);
-   
+
    for (index=0; index < num_initial_hsps; index++) {
       hsp = hsp_array[index];
       if (program_number == eBlastTypeBlastx && kIsOutOfFrame) {
           Int4 context = hsp->context - hsp->context % CODON_LENGTH;
           Int4 context_offset = query_info->contexts[context].query_offset;
-         
+
           query = query_blk->oof_sequence + CODON_LENGTH + context_offset;
           query_nomask = query;
           query_length = query_info->contexts[context+2].query_offset +
               query_info->contexts[context+2].query_length - context_offset;
       } else {
-          query = query_blk->sequence + 
+          query = query_blk->sequence +
               query_info->contexts[hsp->context].query_offset;
-          query_nomask = query_blk->sequence_nomask + 
+          query_nomask = query_blk->sequence_nomask +
               query_info->contexts[hsp->context].query_offset;
           query_length = query_info->contexts[hsp->context].query_length;
       }
@@ -431,9 +436,9 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
             if (subject_length > 0) stat_length = subject_length;
          }
 
-         if (!kIsOutOfFrame && hsp->query.gapped_start == 0 && 
+         if (!kIsOutOfFrame && hsp->query.gapped_start == 0 &&
                                hsp->subject.gapped_start == 0) {
-            Boolean retval = 
+            Boolean retval =
                BlastGetOffsetsForGappedAlignment(query, subject, sbp,
                    hsp, &q_start, &s_start);
             if (!retval)
@@ -452,19 +457,19 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
             } else if (program_number == eBlastTypeBlastn) {
                /* Find the optimal starting offset */
                BlastGetStartForGappedAlignmentNucl(query, subject, hsp);
-            } 
+            }
             q_start = hsp->query.gapped_start;
             s_start = hsp->subject.gapped_start;
          }
-         
+
          adjusted_s_length = subject_length;
          adjusted_subject = subject;
 
          if (!kTranslateSubject && !kSmithWaterman) {
-             AdjustSubjectRange(&s_start, &adjusted_s_length, q_start, 
+             AdjustSubjectRange(&s_start, &adjusted_s_length, q_start,
                                 query_length, &start_shift);
              adjusted_subject = subject + start_shift;
-             /* Shift the gapped start in HSP structure, to compensate for 
+             /* Shift the gapped start in HSP structure, to compensate for
                 a shift in the other direction later. */
              hsp->subject.gapped_start = s_start;
          }
@@ -492,26 +497,26 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
              SmithWatermanScoreWithTraceback(program_number,
                          query, query_length,
                          adjusted_subject, adjusted_s_length,
-                         hsp, hsp_list, score_params, 
+                         hsp, hsp_list, score_params,
                          hit_params, gap_align, start_shift, cutoff);
              /* remove the original HSP unconditionally */
              gap_align->score = INT4_MIN;
 
          } else if (kGreedyTraceback) {
-             BLAST_GreedyGappedAlignment(query, adjusted_subject, 
-                 query_length, adjusted_s_length, gap_align, 
+             BLAST_GreedyGappedAlignment(query, adjusted_subject,
+                 query_length, adjusted_s_length, gap_align,
                  score_params, q_start, s_start, FALSE, TRUE,
                  fence_hit);
          } else {
            BLAST_GappedAlignmentWithTraceback(program_number, query,
-                 adjusted_subject, gap_align, score_params, q_start, s_start, 
+                 adjusted_subject, gap_align, score_params, q_start, s_start,
                  query_length, adjusted_s_length,
                  fence_hit);
              ASSERT(!(kFullTranslation && *fence_hit));
          }
-         
+
          fence_error = (fence_hit && *fence_hit);
-         
+
          if (fence_error) {
              break;
          }
@@ -522,7 +527,7 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
               gap_align->edit_script ) {
 
              queryIdx = 0;
-             t_factor = 0;         
+             t_factor = 0;
              t_sum = 0;
              t_counts = 0;
 
@@ -545,7 +550,7 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
 
               for ( ridx = 0; ridx < sbp->alphabet_size; ridx++ )
                   if ( matcounts[ ridx ]  &&
-                       sbp->matrix->freqs[ ridx ] > 0 &&                       
+                       sbp->matrix->freqs[ ridx ] > 0 &&
                        log( sbp->matrix->freqs[ ridx ] ) != 0 ) {
                       count = matcounts[ ridx ];
                       t_factor += count * log( count );
@@ -559,21 +564,21 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
               if ( adj_score < 0 )
                   adj_score = 0;
              gap_align->score = adj_score;
-             
+
              // Due to a recent change in blast/core we need to free up
-             // the hit here now.  
+             // the hit here now.
              if (gap_align->score < cutoff)
              {
                /* Score is below threshold */
-               gap_align->edit_script = 
+               gap_align->edit_script =
                      GapEditScriptDelete(gap_align->edit_script);
                hsp_array[index] = Blast_HSPFree(hsp);
              }
          }
-         
+
          // RMH: The complexity adjustment/thresholding code in the
          //      above block may now remove the current hit.  Only
-         //      consider the following if we haven't freed the 
+         //      consider the following if we haven't freed the
          //      hit
          if ( hsp_array[index] )
          {
@@ -589,12 +594,12 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
                        							   score_options,
                        							   &align_length,
                        							   sbp);
-  
+
                delete_hsp = Blast_HSPTest(hsp, hit_options, align_length);
            }
            if (!delete_hsp) {
               Blast_HSPAdjustSubjectOffset(hsp, start_shift);
-              status = BlastIntervalTreeAddHSP(hsp, tree, query_info, 
+              status = BlastIntervalTreeAddHSP(hsp, tree, query_info,
                                          eQueryAndSubject);
               if (status) return status;
            } else {
@@ -616,7 +621,7 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
    }
 
    target_t = BlastTargetTranslationFree(target_t);
-   
+
    if (kSmithWaterman) {
        /* switch over to the result of the traceback */
        sfree(hsp_array);
@@ -626,7 +631,7 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
    if (frame_offsets_a) {
        sfree(frame_offsets_a);
    }
-   
+
    if (! fence_error) {
 
        /* Remove any HSPs that share a starting or ending diagonal
@@ -652,12 +657,12 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
           query_length = query_info->contexts[hsp->context].query_length;
           /* the remaining part of the hsp may be extended further */
           delete_hsp = Blast_HSPReevaluateWithAmbiguitiesGapped(hsp, query,
-                       query_length, subject, subject_length, hit_params, 
+                       query_length, subject, subject_length, hit_params,
                        score_params, sbp);
-          if (!delete_hsp) 
-              delete_hsp = Blast_HSPTestIdentityAndLength(program_number, hsp, query_nomask, 
+          if (!delete_hsp)
+              delete_hsp = Blast_HSPTestIdentityAndLength(program_number, hsp, query_nomask,
                                                        subject, score_options, hit_options);
-          if (delete_hsp) 
+          if (delete_hsp)
               hsp_array[index] = Blast_HSPFree(hsp);
        }
        Blast_HSPListPurgeNullHSPs(hsp_list);
@@ -672,47 +677,47 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
        Blast_IntervalTreeReset(tree);
        for (index = 0; index < hsp_list->hspcnt; index++) {
            hsp = hsp_array[index];
-       
+
            if (BlastIntervalTreeContainsHSP(tree, hsp, query_info,
                                      hit_options->min_diag_separation)) {
                hsp_array[index] = Blast_HSPFree(hsp);
            }
            else {
-               status = BlastIntervalTreeAddHSP(hsp, tree, query_info, 
+               status = BlastIntervalTreeAddHSP(hsp, tree, query_info,
                                        eQueryAndSubject);
                if (status)
                   return status;
            }
        }
    }
-   
+
    tree = Blast_IntervalTreeFree(tree);
-   
+
    /* Free the local query_info structure, if necessary (RPS tblastn only) */
    if (query_info != query_info_in)
       sfree(query_info);
-   
+
    if (fence_error) {
        /* Roll back this function by restoring the input HSP list. */
-       
+
        Blast_HSPListSwap(hsp_list, orig_hsplist);
        Blast_HSPListFree(orig_hsplist);
-       
+
        if (gap_align->edit_script) {
            gap_align->edit_script =
                GapEditScriptDelete(gap_align->edit_script);
        }
    } else {
        Blast_HSPListPurgeNullHSPs(hsp_list);
-       
+
        if (orig_hsplist) {
            Blast_HSPListFree(orig_hsplist);
        }
-       s_HSPListPostTracebackUpdate(program_number, hsp_list, query_info_in, 
-                                    score_params, hit_params, sbp, 
+       s_HSPListPostTracebackUpdate(program_number, hsp_list, query_info_in,
+                                    score_params, hit_params, sbp,
                                     stat_length);
    }
-   
+
    return 0;
 }
 
@@ -726,15 +731,15 @@ Blast_TracebackFromHSPList(EBlastProgramType program_number,
  * @param sbp Scoring block [in]
  * @param score_params Scoring parameters [in]
  * @param hit_params Hit saving parameters [in]
- * @param query_info Query information, including pattern occurrences in 
+ * @param query_info Query information, including pattern occurrences in
  *                   query [in]
  * @param pattern_blk Pattern information and auxiliary structures [in]
  */
 static Int2
-s_PHITracebackFromHSPList(EBlastProgramType program_number, 
-                          BlastHSPList* hsp_list, BLAST_SequenceBlk* query_blk, 
-                          BLAST_SequenceBlk* subject_blk, 
-                          BlastGapAlignStruct* gap_align, BlastScoreBlk* sbp, 
+s_PHITracebackFromHSPList(EBlastProgramType program_number,
+                          BlastHSPList* hsp_list, BLAST_SequenceBlk* query_blk,
+                          BLAST_SequenceBlk* subject_blk,
+                          BlastGapAlignStruct* gap_align, BlastScoreBlk* sbp,
                           const BlastScoringParameters* score_params,
                           const BlastHitSavingParameters* hit_params,
                           const BlastQueryInfo* query_info,
@@ -748,10 +753,10 @@ s_PHITracebackFromHSPList(EBlastProgramType program_number,
    BlastHSP** hsp_array;
    Int4 q_start, s_start;
    SPHIQueryInfo* pattern_info = NULL;
-   
+
    if ( !Blast_ProgramIsPhiBlast(program_number))
        return -1;
-   
+
    ASSERT(hsp_list && query_blk && subject_blk && gap_align && sbp &&
           score_params && hit_params && query_info && pattern_blk);
 
@@ -767,26 +772,26 @@ s_PHITracebackFromHSPList(EBlastProgramType program_number,
    subject_length = subject_blk->length;
    pattern_info = query_info->pattern_info;
 
-   /* Make sure the HSPs in the HSP list are sorted by score, as they should 
+   /* Make sure the HSPs in the HSP list are sorted by score, as they should
       be. */
    ASSERT(Blast_HSPListIsSortedByScore(hsp_list));
 
    for (index=0; index < hsp_list->hspcnt; index++) {
        Int4 query_pattern_length;
        hsp = hsp_array[index];
-       
+
        q_start = hsp->query.gapped_start;
        s_start = hsp->subject.gapped_start;
        query_pattern_length =
            pattern_info->occurrences[hsp->pat_info->index].length;
-       
+
        /* Perform the gapped extension with traceback */
-       PHIGappedAlignmentWithTraceback(query, subject, gap_align, 
-                                       score_params, q_start, s_start, 
+       PHIGappedAlignmentWithTraceback(query, subject, gap_align,
+                                       score_params, q_start, s_start,
                                        query_length, subject_length,
-                                       query_pattern_length, 
+                                       query_pattern_length,
                                        hsp->pat_info->length, pattern_blk);
-       
+
        if (gap_align->score >= hit_params->cutoff_score_min) {
            Blast_HSPUpdateWithTraceback(gap_align, hsp);
 
@@ -806,11 +811,11 @@ s_PHITracebackFromHSPList(EBlastProgramType program_number,
    Blast_HSPListReapByEvalue(hsp_list, hit_params->options);
 
    Blast_HSPListPHIGetBitScores(hsp_list, sbp);
-   
+
    return 0;
 }
 
-EBlastEncoding Blast_TracebackGetEncoding(EBlastProgramType program_number) 
+EBlastEncoding Blast_TracebackGetEncoding(EBlastProgramType program_number)
 {
     if (Blast_SubjectIsProtein(program_number)) {
         return eBlastEncodingProtein;
@@ -857,7 +862,7 @@ s_FilterBlastResults(BlastHSPResults* results, const BlastHitSavingOptions* hit_
  *                e-value [in] [out]
  * @param hitlist_size Final hit list size [in]
  */
-static void 
+static void
 s_BlastPruneExtraHits(BlastHSPResults* results, Int4 hitlist_size)
 {
    Int4 query_index, subject_index;
@@ -868,7 +873,7 @@ s_BlastPruneExtraHits(BlastHSPResults* results, Int4 hitlist_size)
          continue;
       for (subject_index = hitlist_size;
            subject_index < hit_list->hsplist_count; ++subject_index) {
-         hit_list->hsplist_array[subject_index] = 
+         hit_list->hsplist_array[subject_index] =
             Blast_HSPListFree(hit_list->hsplist_array[subject_index]);
       }
       hit_list->hsplist_count = MIN(hit_list->hsplist_count, hitlist_size);
@@ -883,7 +888,7 @@ void RPSPsiMatrixAttach(BlastScoreBlk* sbp, Int4** rps_pssm,
     /* Create a dummy PSI-BLAST matrix structure, only to then free it as we'd
      * like to piggy back on the already created structure to use the gapped
      * alignment routines */
-    sbp->psi_matrix = (SPsiBlastScoreMatrix*) 
+    sbp->psi_matrix = (SPsiBlastScoreMatrix*)
         calloc(1, sizeof(SPsiBlastScoreMatrix));
     ASSERT(sbp->psi_matrix);
 
@@ -901,19 +906,19 @@ void RPSPsiMatrixDetach(BlastScoreBlk* sbp)
     ASSERT(sbp);
     sbp->psi_matrix->pssm->data = NULL;
     sfree(sbp->psi_matrix->pssm);
-    sfree(sbp->psi_matrix->freq_ratios);
+    sbp->psi_matrix->freq_ratios = NULL;
     sfree(sbp->psi_matrix);
 }
 
-/** Prepares an auxiliary BlastQueryInfo structure for the concatenated 
+/** Prepares an auxiliary BlastQueryInfo structure for the concatenated
  * database and creates a memory mapped PSSM for RPS BLAST traceback.
  * @param concat_db_info BlastQueryInfo structure to fill. [out]
  * @param gap_align Gapped alignment structure to modify [in] [out]
  * @param rps_info RPS BLAST information structure [in]
  */
-static Int2 
-s_RPSGapAlignDataPrepare(BlastQueryInfo* concat_db_info, 
-                         BlastGapAlignStruct* gap_align, 
+static Int2
+s_RPSGapAlignDataPrepare(BlastQueryInfo* concat_db_info,
+                         BlastGapAlignStruct* gap_align,
                          const BlastRPSInfo* rps_info,
                          Int4 *** rps_freq)
 {
@@ -976,7 +981,7 @@ static void s_RPSFillFreqRatiosInPsiMatrix(SPsiBlastScoreMatrix* psi_matrix,
 {
    Int4 ic, ir;
    psi_matrix->pssm->ncols = ncol;
-   psi_matrix->freq_ratios = (double **) 
+   psi_matrix->freq_ratios = (double **)
            _PSIAllocateMatrix(ncol, BLASTAA_SIZE, sizeof(double));
    for (ic=0; ic<ncol; ic++) {
        for (ir=0; ir<psi_matrix->pssm->nrows; ir++) {
@@ -997,11 +1002,11 @@ static void s_RPSFillFreqRatiosInPsiMatrix(SPsiBlastScoreMatrix* psi_matrix,
  *  RPS blast search. This function performs two major tasks:
  *  - Computes a composition-specific PSSM to be used during the
  *    traceback computation (non-translated searches only)
- *  - After traceback is computed, switch query offsets with 
+ *  - After traceback is computed, switch query offsets with
  *    subject offsets and switch the edit blocks that describe
  *    the alignment. This is required because the entire RPS search
  *    was performed with these quatities reversed.
- * This call is also the first time that enough information 
+ * This call is also the first time that enough information
  * exists to compute E-values for alignments that are found.
  *
  * @param program_number Type of the BLAST program [in]
@@ -1009,12 +1014,12 @@ static void s_RPSFillFreqRatiosInPsiMatrix(SPsiBlastScoreMatrix* psi_matrix,
  * @param seq_src Source of RPS database consensus sequences; needed only
  *                to calculate number of identities in alignments [in]
  * @param query The original query sequence [in]
- * @param query_info Information associated with the original query. 
+ * @param query_info Information associated with the original query.
  *                   Only used for the search space [in]
  * @param gap_align The auxiliary structure for gapped alignment [in]
  * @param score_params Scoring parameters (esp. scale factor) [in]
  * @param ext_params Gapped extension parameters [in]
- * @param hit_params Parameters for saving hits. Can change if not a 
+ * @param hit_params Parameters for saving hits. Can change if not a
                      database search [in]
  * @param rps_info Extra information about RPS database. [in]
  * @param results Results structure containing all HSPs, with added
@@ -1025,21 +1030,21 @@ static void s_RPSFillFreqRatiosInPsiMatrix(SPsiBlastScoreMatrix* psi_matrix,
  *                   BLAST search [in|out]
  * @return nonzero indicates failure, otherwise zero
  */
-static 
-Int2 s_RPSComputeTraceback(EBlastProgramType program_number, 
-                           BlastHSPStream* hsp_stream, 
-                           const BlastSeqSrc* seq_src, 
+static
+Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
+                           BlastHSPStream* hsp_stream,
+                           const BlastSeqSrc* seq_src,
                            Int4  default_db_genetic_code,
-                           BLAST_SequenceBlk* query, 
-                           const BlastQueryInfo* query_info, 
+                           BLAST_SequenceBlk* query,
+                           const BlastQueryInfo* query_info,
                            BlastGapAlignStruct* gap_align,
                            BlastScoringParameters* score_params,
                            const BlastExtensionParameters* ext_params,
                            const BlastHitSavingParameters* hit_params,
-                           const BlastRPSInfo* rps_info,                
+                           const BlastRPSInfo* rps_info,
                            const PSIBlastOptions* psi_options,
                            BlastHSPResults* results,
-                           TInterruptFnPtr interrupt_search, 
+                           TInterruptFnPtr interrupt_search,
                            SBlastProgress* progress_info)
 {
    Int2 status = 0;
@@ -1060,11 +1065,11 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
    if (!hsp_stream || !seq_src || !results) {
       return -1;
    }
-   
+
    concat_db_info = BlastQueryInfoNew(program_number,
                                       rps_info->profile_header->num_profiles);
    // Note that if rpsblast_freqs is not NULL, memory has been allocated in s_RPSGAPAlignDataPrepare
-   if ((status = 
+   if ((status =
         s_RPSGapAlignDataPrepare(concat_db_info, gap_align, rps_info, &rpsblast_freqs)) != 0)
    {
 	  if(NULL != rpsblast_freqs)
@@ -1072,7 +1077,7 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
 
       return status;
    }
-      
+
    sbp = gap_align->sbp;
    rpsblast_pssms = gap_align->sbp->psi_matrix->pssm->data;
 
@@ -1089,7 +1094,7 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
       at a time, and as such only knows about the first six Karlin blocks. */
 
    /* find the first valid Karlin block */
-   for (index = query_info->first_context; 
+   for (index = query_info->first_context;
         index <= query_info->last_context; index++) {
       if (sbp->kbp_gap[index] != NULL) {
          valid_kb_index = index;
@@ -1125,7 +1130,7 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
       score_params->shift_pen /= scale_factor;
    }
 
-   while (BlastHSPStreamRead(hsp_stream, &hsp_list) 
+   while (BlastHSPStreamRead(hsp_stream, &hsp_list)
           != kBlastHSPStream_Eof) {
 
       /* check for interrupt */
@@ -1138,10 +1143,10 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
       if (!hsp_list)
          continue;
 
-      /* Restrict the query sequence block and information structures 
+      /* Restrict the query sequence block and information structures
          to the one query this HSP list corresponds to. */
-      if (Blast_GetOneQueryStructs(&one_query_info, &one_query, 
-                                   query_info, query, 
+      if (Blast_GetOneQueryStructs(&one_query_info, &one_query,
+                                   query_info, query,
                                    hsp_list->query_index) != 0)
       {
     	  if(NULL != rpsblast_freqs)
@@ -1149,10 +1154,10 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
           return -1;
       }
 
-      /* Pick out one of the sequences from the concatenated DB (given by the 
-         OID of this HSPList). The sequence length does not include the 
+      /* Pick out one of the sequences from the concatenated DB (given by the
+         OID of this HSPList). The sequence length does not include the
          trailing NULL. The sequence itself is only needed to calculate number
-         of identities, since scoring is done with a portion of the PSSM 
+         of identities, since scoring is done with a portion of the PSSM
          corresponding to this sequence. */
       seq_arg.oid = hsp_list->oid;
       seq_arg.encoding = encoding;
@@ -1160,10 +1165,10 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
           continue;
 
       db_seq_start = concat_db_info->contexts[hsp_list->oid].query_offset;
-      
+
       /* Update the statistics for this database sequence
          (if not a translated search) */
-      
+
       if (program_number == eBlastTypeRpsTblastn) {
          sbp->psi_matrix->pssm->data = rpsblast_pssms + db_seq_start;
       } else {
@@ -1183,9 +1188,9 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
              /* for no CBS option rescale PSSM matrix with the half-way CBS */
              /* replace the PSSM and the Karlin values for this DB sequence
                 and this query sequence. */
-             sbp->psi_matrix->pssm->data = 
+             sbp->psi_matrix->pssm->data =
                  RPSRescalePssm(score_params->scale_factor,
-                                one_query->length, one_query->sequence, 
+                                one_query->length, one_query->sequence,
                                 seq_arg.seq->length,
                                 rpsblast_pssms + db_seq_start, sbp);
              /* The composition of the query could have caused this one
@@ -1222,30 +1227,35 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
           hsp_list->query_index = 0;
           Blast_RedoAlignmentCore(program_number, seq_arg.seq, one_query_info, sbp,
                                   one_query, NULL, default_db_genetic_code,
-                                  hsp_list, NULL, score_params, ext_params, 
+                                  hsp_list, NULL, score_params, ext_params,
                                   hit_params, psi_options, NULL);
           hsp_list->query_index = query_index;
           s_BlastHSPListRPSUpdate(program_number, hsp_list);
       } else {
-          Blast_TracebackFromHSPList(program_number, hsp_list, seq_arg.seq, 
-             one_query, one_query_info, gap_align, sbp, score_params, 
+          Blast_TracebackFromHSPList(program_number, hsp_list, seq_arg.seq,
+             one_query, one_query_info, gap_align, sbp, score_params,
              ext_params->options, hit_params, NULL, NULL);
       }
 
       BlastSeqSrcReleaseSequence(seq_src, &seq_arg);
 
       if (program_number != eBlastTypeRpsTblastn) {
-         _PSIDeallocateMatrix((void**)sbp->psi_matrix->pssm->data, 
+         _PSIDeallocateMatrix((void**)sbp->psi_matrix->pssm->data,
                               seq_arg.seq->length);
       }
 
+      if (ext_params->options->compositionBasedStats > 0) {
+         _PSIDeallocateMatrix((void**)sbp->psi_matrix->freq_ratios,
+                              seq_arg.seq->length);
+
+      }
       if (hsp_list->hspcnt == 0) {
          hsp_list = Blast_HSPListFree(hsp_list);
          continue;
       }
 
       /* Save this HSP list in the results structure. */
-      Blast_HSPResultsInsertHSPList(results, hsp_list, 
+      Blast_HSPResultsInsertHSPList(results, hsp_list,
                                     hit_params->options->hitlist_size);
    }
 
@@ -1285,7 +1295,7 @@ Int2 s_RPSComputeTraceback(EBlastProgramType program_number,
  */
 void
 BLAST_SetupPartialFetching(EBlastProgramType program_number,
-                           BlastSeqSrc* seq_src, 
+                           BlastSeqSrc* seq_src,
                            const BlastHSPList** hsplist_array,
                            Int4 num_hsplists)
 {
@@ -1335,23 +1345,23 @@ BLAST_SetupPartialFetching(EBlastProgramType program_number,
     BlastSeqSrcSetRangesArgFree(arg);
 }
 
-Int2 
-BLAST_ComputeTraceback(EBlastProgramType program_number, 
-                       BlastHSPStream* hsp_stream, BLAST_SequenceBlk* query, 
-                       BlastQueryInfo* query_info, 
+Int2
+BLAST_ComputeTraceback(EBlastProgramType program_number,
+                       BlastHSPStream* hsp_stream, BLAST_SequenceBlk* query,
+                       BlastQueryInfo* query_info,
                        /* NB: seq_src is modified by this function */
-                       const BlastSeqSrc* seq_src,  
-                       BlastGapAlignStruct* gap_align, 
+                       const BlastSeqSrc* seq_src,
+                       BlastGapAlignStruct* gap_align,
                        BlastScoringParameters* score_params,
                        const BlastExtensionParameters* ext_params,
                        BlastHitSavingParameters* hit_params,
                        BlastEffectiveLengthsParameters* eff_len_params,
                        const BlastDatabaseOptions* db_options,
-                       const PSIBlastOptions* psi_options, 
-                       const BlastRPSInfo* rps_info, 
+                       const PSIBlastOptions* psi_options,
+                       const BlastRPSInfo* rps_info,
                        SPHIPatternSearchBlk* pattern_blk,
-                       BlastHSPResults** results_out, 
-                       TInterruptFnPtr interrupt_search, 
+                       BlastHSPResults** results_out,
+                       TInterruptFnPtr interrupt_search,
                        SBlastProgress* progress_info)
 {
     Int2 status = 0;
@@ -1359,17 +1369,17 @@ BLAST_ComputeTraceback(EBlastProgramType program_number,
     if ( !thread_data ) {
         return BLASTERR_MEMORY;
     }
-    status = SThreadLocalDataArraySetup(thread_data, program_number, 
+    status = SThreadLocalDataArraySetup(thread_data, program_number,
                                         score_params->options,
                                         eff_len_params->options,
-                                        ext_params->options, 
-                                        hit_params->options, query_info, 
+                                        ext_params->options,
+                                        hit_params->options, query_info,
                                         gap_align->sbp,
                                         (BlastSeqSrc*)seq_src);
     if (status) {
         return status;
     }
-    status = 
+    status =
         BLAST_ComputeTraceback_MT(program_number, hsp_stream, query,
                                   query_info, thread_data, db_options,
                                   psi_options, rps_info, pattern_blk,
@@ -1387,7 +1397,7 @@ s_SThreadLocalDataArraySetGapXDropoffFinal(SThreadLocalDataArray* array)
     if (array) {
         Uint4 i;
         for (i = 0; i < array->num_elems; i++) {
-            array->tld[i]->gap_align->gap_x_dropoff = 
+            array->tld[i]->gap_align->gap_x_dropoff =
                 array->tld[i]->ext_params->gap_x_dropoff_final;
         }
     }
@@ -1441,25 +1451,28 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
         retval =
             s_RPSComputeTraceback(program_number, hsp_stream, seq_src,
                                   default_db_genetic_code, query, query_info,
-                                  gap_align, score_params, ext_params, hit_params, 
+                                  gap_align, score_params, ext_params, hit_params,
                                   rps_info, psi_options, results,
                                   interrupt_search, progress_info);
     } else if (ext_params->options->compositionBasedStats > 0 ||
                ext_params->options->eTbackExt == eSmithWatermanTbck) {
+        Uint4 num_threads = MAX(1, thread_data->num_elems);
         results = Blast_HSPResultsNew(query_info->num_queries);
         /* FIXME partial sequence fetching/translation could lead to fence hit
            and seg fault */
         retval =
-            Blast_RedoAlignmentCore(program_number, query, query_info, sbp,
-                                    NULL, seq_src, default_db_genetic_code,
-                                    NULL, hsp_stream, score_params, ext_params,
-                                    hit_params, psi_options, results);
+                Blast_RedoAlignmentCore_MT(program_number,
+                        num_threads,
+                        query, query_info, sbp,
+                        NULL, seq_src, default_db_genetic_code,
+                        NULL, hsp_stream, score_params, ext_params,
+                        hit_params, psi_options, results);
     } else {
         Int4 i;
         Uint4 actual_num_threads = 0;
         BlastHSPStreamResultsBatchArray* batches = NULL;
         Boolean has_been_interrupted = FALSE;
-        
+
         if ( (retval = BlastHSPStreamToHSPStreamResultsBatch(hsp_stream, &batches))) {
             return retval;
         }
@@ -1472,7 +1485,7 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
         if (actual_num_threads != thread_data->num_elems) {
             SThreadLocalDataArrayTrim(thread_data, actual_num_threads);
         }
-        
+
 #pragma omp parallel for default(none) num_threads(actual_num_threads) schedule(guided) if (actual_num_threads > 1) \
         shared(retval, thread_data, batches, score_params, program_number, sbp, hit_params, pattern_blk, query, ext_params, query_info, default_db_genetic_code, has_been_interrupted, interrupt_search, progress_info)
         for (i = 0; i < batches->num_batches; i++) {
@@ -1498,9 +1511,9 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
             if (interrupt_search && (*interrupt_search)(progress_info) == TRUE) {
                 batches->array_of_batches[i] = Blast_HSPStreamResultBatchReset(batch);
 #pragma omp critical(retval)
-                { 
+                {
                     retval = BLASTERR_INTERRUPTED;
-                    has_been_interrupted = TRUE; 
+                    has_been_interrupted = TRUE;
                 }
             }
 #pragma omp flush(has_been_interrupted)
@@ -1532,11 +1545,11 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
                 /* If the subject is translated and the BlastSeqSrc implementation
                 * doesn't provide a genetic code string, use the default genetic
                 * code for all subjects (as in the C toolkit) */
-                if (Blast_SubjectIsTranslated(program_number) && 
+                if (Blast_SubjectIsTranslated(program_number) &&
                     seq_arg.seq->gen_code_string == NULL) {
 #pragma omp critical(tback_gen_code)
                     {
-                        seq_arg.seq->gen_code_string = 
+                        seq_arg.seq->gen_code_string =
                             GenCodeSingletonFind(default_db_genetic_code);
 #ifndef _OPENMP
                         ASSERT(seq_arg.seq->gen_code_string);
@@ -1548,26 +1561,26 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
                     BlastQueryInfo* qi = thread_data->tld[tid]->query_info;
                     BlastEffectiveLengthsParameters* elp =
                         thread_data->tld[tid]->eff_len_params;
-                    BlastHitSavingParameters* hp = 
+                    BlastHitSavingParameters* hp =
                         thread_data->tld[tid]->hit_params;
                     /* This is not a database search, so effective search spaces
-                    * need to be recalculated based on this subject sequence 
+                    * need to be recalculated based on this subject sequence
                     * length.
-                    * NB: The initial word parameters structure is not available 
-                    * here, so the small gap cutoff score for linking of HSPs will 
-                    * not be updated. Since by default linking is done with uneven 
-                    * gap statistics, this can only influence a corner non-default 
-                    * case, and is a tradeoff for a benefit of not having to deal 
+                    * NB: The initial word parameters structure is not available
+                    * here, so the small gap cutoff score for linking of HSPs will
+                    * not be updated. Since by default linking is done with uneven
+                    * gap statistics, this can only influence a corner non-default
+                    * case, and is a tradeoff for a benefit of not having to deal
                     * with ungapped extension parameters in the traceback stage.
                     */
-                    if ((status = BLAST_OneSubjectUpdateParameters(program_number, 
-                                seq_arg.seq->length, score_params->options, 
+                    if ((status = BLAST_OneSubjectUpdateParameters(program_number,
+                                seq_arg.seq->length, score_params->options,
                                 qi, sbp, hp, NULL, elp)) != 0) {
                         batches->array_of_batches[i] = Blast_HSPStreamResultBatchReset(batch);
 #pragma omp critical(retval)
-                        { 
+                        {
                             retval = status;
-                            has_been_interrupted = TRUE; 
+                            has_been_interrupted = TRUE;
                         }
                         continue;
                     }
@@ -1580,21 +1593,21 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
 
                 if (perform_traceback) {
                     if (Blast_ProgramIsPhiBlast(program_number)) {
-                        s_PHITracebackFromHSPList(program_number, hsp_list, query, 
-                                        seq_arg.seq, gap_align, sbp, 
-                                        score_params, hit_params, 
+                        s_PHITracebackFromHSPList(program_number, hsp_list, query,
+                                        seq_arg.seq, gap_align, sbp,
+                                        score_params, hit_params,
                                         query_info, pattern_blk);
                     } else {
                         Boolean fence_hit = FALSE;
                         Blast_TracebackFromHSPList(program_number, hsp_list, query,
-                                         seq_arg.seq, query_info, 
+                                         seq_arg.seq, query_info,
                                          gap_align, sbp, score_params,
                                          ext_params->options, hit_params,
                                          seq_arg.seq->gen_code_string,
                                          &fence_hit);
 
                         if (fence_hit) {
-                            /* Disable range support and refetch the 
+                            /* Disable range support and refetch the
                             (whole) subject sequence */
 
                             seq_arg.reset_ranges = TRUE;
@@ -1602,11 +1615,11 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
                             BlastSeqSrcGetSequence(seqsrc, &seq_arg);
 
                             /* The C toolkit will erase genetic_code, so do it again */
-                            if (Blast_SubjectIsTranslated(program_number) && 
+                            if (Blast_SubjectIsTranslated(program_number) &&
                                 seq_arg.seq->gen_code_string == NULL) {
 #pragma omp critical(tback_gen_code)
                                 {
-                                    seq_arg.seq->gen_code_string = 
+                                    seq_arg.seq->gen_code_string =
                                         GenCodeSingletonFind(default_db_genetic_code);
 #ifndef _OPENMP
                                     ASSERT(seq_arg.seq->gen_code_string);
@@ -1615,12 +1628,12 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
                             }
 
                             /* Retry the alignment with fence_hit set*/
-                            Blast_TracebackFromHSPList(program_number, hsp_list, 
-                                                query, seq_arg.seq, 
+                            Blast_TracebackFromHSPList(program_number, hsp_list,
+                                                query, seq_arg.seq,
                                                 query_info, gap_align,
-                                                sbp, score_params, 
-                                                ext_params->options, 
-                                                hit_params, 
+                                                sbp, score_params,
+                                                ext_params->options,
+                                                hit_params,
                                                 seq_arg.seq->gen_code_string,
                                                 &fence_hit);
 #ifndef _OPENMP
@@ -1630,8 +1643,8 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
                     }    /* !phi_blast */
 
                 } else {
-                    /* traceback skipped; compute bit scores for searches 
-                       where the traceback phase is seperated from the 
+                    /* traceback skipped; compute bit scores for searches
+                       where the traceback phase is seperated from the
                        preliminary search. */
                     Blast_HSPListGetBitScores(hsp_list, FALSE, sbp);
                 }
@@ -1643,7 +1656,7 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
                     hsp_list = Blast_HSPListFree(hsp_list);
                 }
                 else {
-                    Blast_HSPResultsInsertHSPList(thread_data->tld[tid]->results, hsp_list, 
+                    Blast_HSPResultsInsertHSPList(thread_data->tld[tid]->results, hsp_list,
                                   hit_params->options->hitlist_size);
                 }
             }      /* loop over one HSPList batch */
@@ -1703,8 +1716,9 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
 
     /* Re-sort the hit lists according to their best e-values, because they
        could have changed. Only do this for a database search. */
-    if (BlastSeqSrcGetTotLen(seq_src) > 0)
+    if (BlastSeqSrcGetTotLen(seq_src) > 0) {
         Blast_HSPResultsSortByEvalue(results);
+    }
 
     if(hit_params->options->query_cov_hsp_perc > 0 || hit_params->options->max_hsps_per_subject > 0) {
     	s_FilterBlastResults(results, hit_params->options, query_info, program_number);
@@ -1723,38 +1737,38 @@ BLAST_ComputeTraceback_MT(EBlastProgramType program_number,
     return retval;
 }
 
-Int2 
-Blast_RunTracebackSearch(EBlastProgramType program, 
-   BLAST_SequenceBlk* query, BlastQueryInfo* query_info, 
+Int2
+Blast_RunTracebackSearch(EBlastProgramType program,
+   BLAST_SequenceBlk* query, BlastQueryInfo* query_info,
    const BlastSeqSrc* seq_src, const BlastScoringOptions* score_options,
    const BlastExtensionOptions* ext_options,
    const BlastHitSavingOptions* hit_options,
    const BlastEffectiveLengthsOptions* eff_len_options,
-   const BlastDatabaseOptions* db_options, 
+   const BlastDatabaseOptions* db_options,
    const PSIBlastOptions* psi_options, BlastScoreBlk* sbp,
    BlastHSPStream* hsp_stream, const BlastRPSInfo* rps_info,
-                         SPHIPatternSearchBlk* pattern_blk, BlastHSPResults** results, 
+                         SPHIPatternSearchBlk* pattern_blk, BlastHSPResults** results,
                          size_t num_threads)
 {
    return Blast_RunTracebackSearchWithInterrupt(program,
           query, query_info, seq_src, score_options, ext_options,
           hit_options, eff_len_options, db_options, psi_options, sbp,
-                                                hsp_stream, rps_info, pattern_blk, results, NULL, NULL, 
+                                                hsp_stream, rps_info, pattern_blk, results, NULL, NULL,
                                                 num_threads);
 }
 
-Int2 
-Blast_RunTracebackSearchWithInterrupt(EBlastProgramType program, 
-   BLAST_SequenceBlk* query, BlastQueryInfo* query_info, 
+Int2
+Blast_RunTracebackSearchWithInterrupt(EBlastProgramType program,
+   BLAST_SequenceBlk* query, BlastQueryInfo* query_info,
    const BlastSeqSrc* seq_src, const BlastScoringOptions* score_options,
    const BlastExtensionOptions* ext_options,
    const BlastHitSavingOptions* hit_options,
    const BlastEffectiveLengthsOptions* eff_len_options,
-   const BlastDatabaseOptions* db_options, 
+   const BlastDatabaseOptions* db_options,
    const PSIBlastOptions* psi_options, BlastScoreBlk* sbp,
    BlastHSPStream* hsp_stream, const BlastRPSInfo* rps_info,
    SPHIPatternSearchBlk* pattern_blk, BlastHSPResults** results,
-                                      TInterruptFnPtr interrupt_search,  SBlastProgress* progress_info, 
+                                      TInterruptFnPtr interrupt_search,  SBlastProgress* progress_info,
                                       size_t num_threads)
 {
     const int N_T = ((num_threads == 0) ? 1 : num_threads);
@@ -1763,7 +1777,7 @@ Blast_RunTracebackSearchWithInterrupt(EBlastProgramType program,
 
     if (thread_data == NULL) {
         return BLASTERR_MEMORY;
-    } 
+    }
 
     status = SThreadLocalDataArraySetup(thread_data, program,
                                         score_options, eff_len_options,
@@ -1776,7 +1790,7 @@ Blast_RunTracebackSearchWithInterrupt(EBlastProgramType program,
     /* Prohibit any subsequent writing to the HSP stream. */
     BlastHSPStreamClose(hsp_stream);
 
-    status = 
+    status =
        BLAST_ComputeTraceback_MT(program, hsp_stream, query, query_info,
                                  thread_data, db_options, psi_options,
                                  rps_info, pattern_blk, results, interrupt_search, progress_info);
diff --git a/c++/src/algo/blast/core/blast_traceback_mt_priv.c b/c++/src/algo/blast/core/blast_traceback_mt_priv.c
index 15a58a7..571dec1 100644
--- a/c++/src/algo/blast/core/blast_traceback_mt_priv.c
+++ b/c++/src/algo/blast/core/blast_traceback_mt_priv.c
@@ -1,4 +1,4 @@
-/* $Id: blast_traceback_mt_priv.c 419225 2013-11-22 17:08:29Z camacho $
+/* $Id: blast_traceback_mt_priv.c 496008 2016-03-23 11:29:15Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,8 +31,8 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = 
-    "$Id: blast_traceback_mt_priv.c 419225 2013-11-22 17:08:29Z camacho $";
+static char const rcsid[] =
+    "$Id: blast_traceback_mt_priv.c 496008 2016-03-23 11:29:15Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/blast_setup.h>
@@ -48,7 +48,9 @@ SThreadLocalData* SThreadLocalDataFree(SThreadLocalData* tld)
 {
     if (tld) {
         /* Do not destruct score block here, it was just assigned */
-        tld->gap_align->sbp = NULL;
+        if (tld->gap_align != NULL) {
+            tld->gap_align->sbp = NULL;
+        }
         tld->gap_align = BLAST_GapAlignStructFree(tld->gap_align);
         tld->score_params = BlastScoringParametersFree(tld->score_params);
         tld->ext_params = BlastExtensionParametersFree(tld->ext_params);
@@ -115,11 +117,11 @@ static Uint4* s_CountHspListsPerQuery(const SThreadLocalDataArray* data, Int4* n
 {
     Uint4 i = 0;
     Uint4* retval = NULL;
-    
-    if (!data || !num_queries) 
+
+    if (!data || !num_queries)
         return retval;
     *num_queries = data->tld[0]->results->num_queries;
-    
+
     if ( !(retval = (Uint4*)calloc(*num_queries, sizeof(*retval))) ) {
         return NULL;
     }
@@ -144,7 +146,7 @@ BlastHSPResults* SThreadLocalDataArrayConsolidateResults(SThreadLocalDataArray*
     BlastHSPResults* retval = NULL;
     Int4 num_queries = 0, query_idx = 0, hitlist_size = 0;
     Uint4* num_hsplists_per_query = NULL;
-    
+
     if ( !array ) {
         return retval;
     }
@@ -185,12 +187,12 @@ BlastHSPResults* SThreadLocalDataArrayConsolidateResults(SThreadLocalDataArray*
             for (i = 0; i < thread_hitlist->hsplist_count; i++) {
                 if ( !Blast_HSPList_IsEmpty(thread_hitlist->hsplist_array[i])) {
                     hits4query->hsplist_array[hits4query->hsplist_count++] =
-                        thread_hitlist->hsplist_array[i]; 
+                        thread_hitlist->hsplist_array[i];
                     thread_hitlist->hsplist_array[i] = NULL;
                 }
             }
-            hits4query->worst_evalue = !tid 
-                ? thread_hitlist->worst_evalue 
+            hits4query->worst_evalue = !tid
+                ? thread_hitlist->worst_evalue
                 : MAX(thread_hitlist->worst_evalue, hits4query->worst_evalue);
             hits4query->low_score = !tid
                 ? thread_hitlist->low_score
@@ -202,9 +204,9 @@ BlastHSPResults* SThreadLocalDataArrayConsolidateResults(SThreadLocalDataArray*
     return retval;
 }
 
-Int2 SThreadLocalDataArraySetup(SThreadLocalDataArray* array, 
-                                EBlastProgramType program, 
-                                const BlastScoringOptions* score_options, 
+Int2 SThreadLocalDataArraySetup(SThreadLocalDataArray* array,
+                                EBlastProgramType program,
+                                const BlastScoringOptions* score_options,
                                 const BlastEffectiveLengthsOptions* eff_len_options,
                                 const BlastExtensionOptions* ext_options,
                                 const BlastHitSavingOptions* hit_options,
@@ -218,14 +220,14 @@ Int2 SThreadLocalDataArraySetup(SThreadLocalDataArray* array,
     if (!array)
         return BLASTERR_INVALIDPARAM;
 
-    for (i = 0; i < array->num_elems; i++) { 
-        status = 
-           BLAST_GapAlignSetUp(program, seqsrc, score_options, eff_len_options, 
-              ext_options, hit_options, query_info, sbp, 
-              &array->tld[i]->score_params, 
-              &array->tld[i]->ext_params, 
-              &array->tld[i]->hit_params, 
-              &array->tld[i]->eff_len_params, 
+    for (i = 0; i < array->num_elems; i++) {
+        status =
+           BLAST_GapAlignSetUp(program, seqsrc, score_options, eff_len_options,
+              ext_options, hit_options, query_info, sbp,
+              &array->tld[i]->score_params,
+              &array->tld[i]->ext_params,
+              &array->tld[i]->hit_params,
+              &array->tld[i]->eff_len_params,
               &array->tld[i]->gap_align);
         if (status)
            return status;
diff --git a/c++/src/algo/blast/core/blast_util.c b/c++/src/algo/blast/core/blast_util.c
index f0876ba..d5027f5 100644
--- a/c++/src/algo/blast/core/blast_util.c
+++ b/c++/src/algo/blast/core/blast_util.c
@@ -1,4 +1,4 @@
-/* $Id: blast_util.c 474016 2015-07-24 13:27:16Z ivanov $
+/* $Id: blast_util.c 473564 2015-07-21 15:29:04Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_util.c 474016 2015-07-24 13:27:16Z ivanov $";
+    "$Id: blast_util.c 473564 2015-07-21 15:29:04Z madden $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/blast_util.h>
diff --git a/c++/src/algo/blast/core/boost_erf.c b/c++/src/algo/blast/core/boost_erf.c
new file mode 100644
index 0000000..7ddf0fe
--- /dev/null
+++ b/c++/src/algo/blast/core/boost_erf.c
@@ -0,0 +1,256 @@
+/*  $Id: boost_erf.c 498724 2016-04-19 13:36:57Z ivanov $
+* ===========================================================================
+*
+* This code is ported from the open source C++ library Boost, for which
+* the following notice applies:
+*
+* (C) Copyright John Maddock 2006.
+* Use, modification and distribution are subject to the Boost Software
+* License, Version 1.0. (See below or copy at
+* http://www.boost.org/LICENSE_1_0.txt)
+*
+* Boost Software License - Version 1.0 - August 17th, 2003
+*
+* 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.
+*
+* ===========================================================================
+*
+* Author (editor, really):  Greg Boratyn, NCBI
+*
+* File Description:
+*   Error function and complementary error function for normal distribution.
+*   
+* ===========================================================================
+*/
+
+#include "boost_erf.h"
+#include <math.h>
+
+#define FALSE 0
+#define TRUE 1
+
+static double ErfImpl(double z, int invert)
+{
+    if (z < 0) {
+        if (!invert) {
+            return -ErfImpl(-z, invert);
+        }
+        else if (z < -0.5) {
+            return 2.0 - ErfImpl(-z, invert);
+        }
+        else {
+            return 1 + ErfImpl(-z, FALSE);
+        }
+    }
+
+    double result;
+
+    /* Big bunch of selection statements now to pick
+       which implementation to use,
+       try to put most likely options first: */
+    if (z < 0.5) {
+
+        /* We're going to calculate erf: */
+        if (z < 1e-10) {
+            if (z == 0) {
+                result = 0.0;
+            }
+            else {
+                static const double c = 0.003379167095512573896158903121545171688;
+                result = z * 1.125 + z * c;
+            }
+        }
+        else {
+
+            /* Maximum Deviation Found:                     1.561e-17
+               Expected Error Term:                         1.561e-17
+               Maximum Relative Change in Control Points:   1.155e-04
+               Max Error found at double precision =        2.961182e-17 */
+
+            static const double Y = 1.044948577880859375;
+            static const double P[] = {0.0834305892146531832907,
+                                       -0.338165134459360935041,
+                                       -0.0509990735146777432841,
+                                       -0.00772758345802133288487,
+                                       -0.000322780120964605683831};
+
+            static const double Q[] = {1.0,
+                                       0.455004033050794024546,
+                                       0.0875222600142252549554,
+                                       0.00858571925074406212772,
+                                       0.000370900071787748000569};
+
+            double zz = z * z;
+
+            double p = (((P[4] * zz + P[3]) * zz + P[2]) * zz + P[1]) * zz + P[0];
+            double q = (((Q[4] * zz + Q[3]) * zz + Q[2]) * zz + Q[1]) * zz + Q[0];
+
+            result = z * (Y + p / q);
+        }
+    }
+    else if (invert ? (z < 28.0) : (z < 5.8)) {
+
+        /* We'll be calculating erfc: */
+        invert = !invert;
+
+        if(z < 1.5) {
+
+            /* Maximum Deviation Found:                     3.702e-17
+               Expected Error Term:                         3.702e-17
+               Maximum Relative Change in Control Points:   2.845e-04
+               Max Error found at double precision =        4.841816e-17 */
+            static const double Y = 0.405935764312744140625;
+            static const double P[] = {-0.098090592216281240205,
+                                       0.178114665841120341155,
+                                       0.191003695796775433986,
+                                       0.0888900368967884466578,
+                                       0.0195049001251218801359,
+                                       0.00180424538297014223957};
+
+            static const double Q[] = {1.0,
+                                  1.84759070983002217845,
+                                  1.42628004845511324508,
+                                  0.578052804889902404909,
+                                  0.12385097467900864233,
+                                  0.0113385233577001411017,
+                                  0.337511472483094676155e-5};
+
+            double x = z - 0.5;
+            double p = ((((P[5] * x + P[4]) * x + P[3]) * x + P[2]) * x + P[1]) * x + P[0];
+            double q = ((((Q[5] * x + Q[4]) * x + Q[3]) * x + Q[2]) * x + Q[1]) * x + Q[0];
+            
+            result = Y + p / q;
+            result *= expl(-z * z) / z;
+        }
+        else if(z < 2.5) {
+
+            /* Max Error found at double precision =        6.599585e-18
+               Maximum Deviation Found:                     3.909e-18
+               Expected Error Term:                         3.909e-18
+               Maximum Relative Change in Control Points:   9.886e-05 */
+            static const double Y = 0.50672817230224609375;
+            static const double P[] = {-0.0243500476207698441272,
+                                       0.0386540375035707201728,
+                                       0.04394818964209516296,
+                                       0.0175679436311802092299,
+                                       0.00323962406290842133584,
+                                       0.000235839115596880717416};
+
+            static const double Q[] = {1.0,
+                                       1.53991494948552447182,
+                                       0.982403709157920235114,
+                                       0.325732924782444448493,
+                                       0.0563921837420478160373,
+                                       0.00410369723978904575884};
+
+            double x = z - 1.5;
+            double p = ((((P[5] * x + P[4]) * x + P[3]) * x + P[2]) * x + P[1]) * x + P[0];
+            double q = ((((Q[5] * x + Q[4]) * x + Q[3]) * x + Q[2]) * x + Q[1]) * x + Q[0];
+          
+            result = Y + p / q;
+            result *= expl(-z * z) / z;
+        }
+        else if(z < 4.5) {
+
+            /* Maximum Deviation Found:                     1.512e-17
+               Expected Error Term:                         1.512e-17
+               Maximum Relative Change in Control Points:   2.222e-04
+               Max Error found at double precision =        2.062515e-17 */
+            static const double Y = 0.5405750274658203125;
+            static const double P[] = {0.00295276716530971662634,
+                                       0.0137384425896355332126,
+                                       0.00840807615555585383007,
+                                       0.00212825620914618649141,
+                                       0.000250269961544794627958,
+                                       0.113212406648847561139e-4};
+
+            static const double Q[] = {1.0,
+                                       1.04217814166938418171,
+                                       0.442597659481563127003,
+                                       0.0958492726301061423444,
+                                       0.0105982906484876531489,
+                                       0.000479411269521714493907};
+
+            double x = z - 3.5;
+            double p = ((((P[5] * x + P[4]) * x + P[3]) * x + P[2]) * x + P[1]) * x + P[0];
+            double q = ((((Q[5] * x + Q[4]) * x + Q[3]) * x + Q[2]) * x + Q[1]) * x + Q[0];
+
+            result = Y + p / q;
+            result *= expl(-z * z) / z;
+        }
+        else {
+
+            /* Max Error found at double precision =        2.997958e-17
+               Maximum Deviation Found:                     2.860e-17
+               Expected Error Term:                         2.859e-17
+               Maximum Relative Change in Control Points:   1.357e-05 */
+            static const double Y = 0.5579090118408203125;
+            static const double P[] = {0.00628057170626964891937,
+                                       0.0175389834052493308818,
+                                       -0.212652252872804219852,
+                                       -0.687717681153649930619,
+                                       -2.5518551727311523996,
+                                       -3.22729451764143718517,
+                                       -2.8175401114513378771};
+
+            static const double Q[] = {1.0,
+                                       2.79257750980575282228,
+                                       11.0567237927800161565,
+                                       15.930646027911794143,
+                                       22.9367376522880577224,
+                                       13.5064170191802889145,
+                                       5.48409182238641741584};
+
+            double x = 1.0 / z;
+            double p = (((((P[6] * x + P[5]) * x + P[4]) * x + P[3]) * x + P[2]) * x + P[1]) * x + P[0];
+            double q = (((((Q[6] * x + Q[5]) * x + Q[4]) * x + Q[3]) * x + Q[2]) * x + Q[1]) * x + Q[0];
+
+            result = Y + p / q;
+            result *= expl(-z * z) / z;
+        }
+    }
+    else {
+
+        /* Any value of z larger than 28 will underflow to zero: */
+        result = 0;
+        invert = !invert;
+    }
+
+    if(invert) {
+        result = 1 - result;
+    }
+
+    return result;
+}
+
+
+double Erf(double z)
+{
+    return ErfImpl(z, FALSE);
+}
+
+double ErfC(double z)
+{
+    return ErfImpl(z, TRUE);
+}
+
diff --git a/c++/src/app/winmasker/main.cpp b/c++/src/algo/blast/core/boost_erf.h
similarity index 77%
copy from c++/src/app/winmasker/main.cpp
copy to c++/src/algo/blast/core/boost_erf.h
index 8534c0c..3b5f2ed 100644
--- a/c++/src/app/winmasker/main.cpp
+++ b/c++/src/algo/blast/core/boost_erf.h
@@ -1,4 +1,4 @@
-/*  $Id: main.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/*  $Id: boost_erf.h 498724 2016-04-19 13:36:57Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -23,20 +23,26 @@
  *
  * ===========================================================================
  *
- * Author:  Aleksandr Morgulis
- *
- * File Description:
- *   Main routine of the window based masker application.
+ * Author:  Greg Boratyn
  *
  */
 
-#include <ncbi_pch.hpp>
-#include "win_mask_app.hpp"
+#ifndef ALGO_BLAST_CORE__BOOST_ERF
+#define ALGO_BLAST_CORE__BOOST_ERF
+
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-USING_NCBI_SCOPE;
+/** Error function */
+double Erf(double z);
 
-int main( int argc, char * argv[] )
-{
-    return CWinMaskApplication().AppMain(argc, argv, 0, eDS_Default, 0);
+/** Complementary error function */
+double ErfC(double z);
+
+#ifdef __cplusplus
 }
+#endif
+
+#endif /* ALGO_BLAST_CORE__BOOST_ERF */
diff --git a/c++/src/algo/blast/core/greedy_align.c b/c++/src/algo/blast/core/greedy_align.c
index f966fda..3ae44a1 100644
--- a/c++/src/algo/blast/core/greedy_align.c
+++ b/c++/src/algo/blast/core/greedy_align.c
@@ -1,4 +1,4 @@
-/* $Id: greedy_align.c 392014 2013-03-13 14:36:38Z maning $
+/* $Id: greedy_align.c 480534 2015-10-01 15:21:48Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -36,7 +36,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: greedy_align.c 392014 2013-03-13 14:36:38Z maning $";
+    "$Id: greedy_align.c 480534 2015-10-01 15:21:48Z madden $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <algo/blast/core/greedy_align.h>
@@ -624,7 +624,7 @@ Int4 BLAST_GreedyAlign(const Uint1* seq1, Int4 len1,
         /* if this is the best score seen so far, update the
            statistics of the best alignment */
 
-        if (curr_score > max_score[d - 1]) {
+        if (curr_score >= max_score[d - 1]) {
             max_score[d] = curr_score;
             best_dist = d;
             best_diag = curr_diag;
diff --git a/c++/src/algo/blast/dbindex/makeindex/main.cpp b/c++/src/algo/blast/dbindex/makeindex/main.cpp
index 81d7287..ecf1a54 100644
--- a/c++/src/algo/blast/dbindex/makeindex/main.cpp
+++ b/c++/src/algo/blast/dbindex/makeindex/main.cpp
@@ -1,4 +1,4 @@
-/*  $Id: main.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/*  $Id: main.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -50,5 +50,5 @@ USING_NCBI_SCOPE;
 
 int main( int argc, char * argv[] )
 { 
-    return CMkIndexApplication().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CMkIndexApplication().AppMain(argc, argv, 0, eDS_Default, "");
 }
diff --git a/c++/src/algo/blast/format/Makefile.xblastformat.lib b/c++/src/algo/blast/format/Makefile.xblastformat.lib
index 5569e63..f8c7c03 100644
--- a/c++/src/algo/blast/format/Makefile.xblastformat.lib
+++ b/c++/src/algo/blast/format/Makefile.xblastformat.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.xblastformat.lib 474226 2015-07-27 17:10:07Z ivanov $
+# $Id: Makefile.xblastformat.lib 473553 2015-07-21 14:41:00Z fongah2 $
 
 ASN_DEP = blastdb blastxml blastxml2 xnetblast
 
diff --git a/c++/src/algo/blast/format/blast_format.cpp b/c++/src/algo/blast/format/blast_format.cpp
index 0905951..1721377 100644
--- a/c++/src/algo/blast/format/blast_format.cpp
+++ b/c++/src/algo/blast/format/blast_format.cpp
@@ -1,5 +1,5 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: blast_format.cpp 485947 2015-11-30 17:47:26Z ivanov $";
+static char const rcsid[] = "$Id: blast_format.cpp 495288 2016-03-16 14:51:11Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 /*
@@ -742,12 +742,15 @@ CBlastFormat::x_PrintTabularReport(const blast::CSearchResults& results,
         if (m_FormatType == CFormattingArgs::eTabularWithComments) {
             string strProgVersion =
                 NStr::ToUpper(m_Program) + " " + blast::CBlastVersion().Print();
-            CConstRef<CBioseq> subject_bioseq = x_CreateSubjectBioseq();
 	    string dbname;
 	    if (m_IsDbScan)
 		dbname = string("User specified sequence set (Input: ") + m_SubjectTag + string(")");
 	    else 
 		dbname = m_DbName;
+            CConstRef<CBioseq> subject_bioseq;
+            // dbname used in place of Bioseq in most cases.
+            if (dbname.empty())
+            	subject_bioseq.Reset(x_CreateSubjectBioseq());
             tabinfo.PrintHeader(strProgVersion, *(bhandle.GetBioseqCore()),
                                 dbname, results.GetRID(), itr_num, aln_set,
                                 subject_bioseq);
@@ -876,8 +879,7 @@ CConstRef<objects::CBioseq> CBlastFormat::x_CreateSubjectBioseq()
 }
 
 /// Auxiliary function to print the BLAST Archive in multiple output formats
-static void s_PrintArchive(CRef<objects::CBlast4_archive> archive,
-                         CNcbiOstream& out)
+void CBlastFormat::PrintArchive(CRef<objects::CBlast4_archive> archive, CNcbiOstream& out)
 {
     if (archive.Empty()) {
         return;
@@ -896,7 +898,8 @@ void
 CBlastFormat::WriteArchive(blast::IQueryFactory& queries,
                            blast::CBlastOptionsHandle& options_handle,
                            const CSearchResultSet& results,
-                           unsigned int num_iters)
+                           unsigned int num_iters,
+                           const list<CRef<CBlast4_error> > & msg)
 {
     CRef<objects::CBlast4_archive>  archive;
     if (m_IsBl2Seq)
@@ -923,17 +926,26 @@ CBlastFormat::WriteArchive(blast::IQueryFactory& queries,
     	else
     		archive = BlastBuildArchive(queries, options_handle, results,  m_DbName);
     }
-    s_PrintArchive(archive, m_Outfile);
+
+    if(msg.size() > 0) {
+    	archive->SetMessages() = msg;
+    }
+    PrintArchive(archive, m_Outfile);
 }
 
 void
 CBlastFormat::WriteArchive(objects::CPssmWithParameters & pssm,
                            blast::CBlastOptionsHandle& options_handle,
                            const CSearchResultSet& results,
-                           unsigned int num_iters)
+                           unsigned int num_iters,
+                           const list<CRef<CBlast4_error> > & msg)
 {
     CRef<objects::CBlast4_archive> archive(BlastBuildArchive(pssm, options_handle, results,  m_DbName, num_iters));
-    s_PrintArchive(archive, m_Outfile);
+
+    if(msg.size() > 0) {
+    	archive->SetMessages() = msg;
+    }
+    PrintArchive(archive, m_Outfile);
 }
 
 
@@ -1138,7 +1150,13 @@ CBlastFormat::PrintOneResultSet(blast::CIgBlastResults& results,
     if (results.GetIgAnnotation()->m_MinusStrand) {
         x_ReverseQuery(results);
     }
-
+    //set j domain
+    CRef<CIgAnnotation> & annots_edit = results.SetIgAnnotation();
+    if (annots_edit->m_JDomain[1] > 0 && annots_edit->m_DomainInfo[9] > 0 && 
+        annots_edit->m_JDomain[1] > annots_edit->m_DomainInfo[9]){      
+        annots_edit->m_JDomain[0] = annots_edit->m_DomainInfo[9] + 1 ;
+    }
+    
     if (m_FormatType == CFormattingArgs::eTabular ||
         m_FormatType == CFormattingArgs::eTabularWithComments ||
         m_FormatType == CFormattingArgs::eCommaSeparatedValues) {
@@ -1237,9 +1255,9 @@ CBlastFormat::PrintOneResultSet(blast::CIgBlastResults& results,
     }
 
     list < CRef<CDisplaySeqalign::DomainInfo> >  domain;
-    int domain_name_length = 5;
-    string kabat_domain_name[] = {"FR1", "CDR1", "FR2", "CDR2", "FR3"};
-    string imgt_domain_name[] = {"FR1-IMGT", "CDR1-IMGT", "FR2-IMGT", "CDR2-IMGT", "FR3-IMGT"};
+    int domain_name_length = 6;
+    string kabat_domain_name[] = {"FR1", "CDR1", "FR2", "CDR2", "FR3", "CDR3"};
+    string imgt_domain_name[] = {"FR1-IMGT", "CDR1-IMGT", "FR2-IMGT", "CDR2-IMGT", "FR3-IMGT", "CDR3-IMGT"};
     vector<string> domain_name;
     if (m_IgOptions->m_DomainSystem == "kabat") {
         for (int i = 0; i < domain_name_length; i ++) {
@@ -1275,6 +1293,28 @@ CBlastFormat::PrintOneResultSet(blast::CIgBlastResults& results,
         }
     }    
 
+    //J domain
+
+    if (annots->m_JDomain[0] > 0 && annots->m_JDomain[1] > 0){      
+        CRef<CDisplaySeqalign::DomainInfo> temp(new CDisplaySeqalign::DomainInfo);
+        int start = annots->m_JDomain[0];
+        int subject_start = -1;
+        int stop = annots->m_JDomain[1];
+        int subject_stop = -1;
+
+        temp->seqloc = new CSeq_loc((CSeq_loc::TId &) aln_set->Get().front()->GetSeq_id(0),
+                                        (CSeq_loc::TPoint) start,
+                                        (CSeq_loc::TPoint) stop);
+        CRef<CSeq_id> id_holder (new CSeq_id);
+        temp->subject_seqloc = new CSeq_loc(*id_holder,
+                                            (CSeq_loc::TPoint) subject_start,
+                                            (CSeq_loc::TPoint) subject_stop);
+        temp->is_subject_start_valid = subject_start > 0 ? true:false;
+        temp->is_subject_stop_valid = subject_stop > 0 ? true:false;
+        temp->domain_name = domain_name[5];
+        domain.push_back(temp); 
+    }
+    
 
     CDisplaySeqalign display(*aln_set, *m_Scope, &masklocs, NULL,  m_MatrixName);
     int num_align_to_show = results.m_NumActualV + results.m_NumActualD + 
diff --git a/c++/src/algo/blast/format/blastfmtutil.cpp b/c++/src/algo/blast/format/blastfmtutil.cpp
index 7cfdf77..9064084 100644
--- a/c++/src/algo/blast/format/blastfmtutil.cpp
+++ b/c++/src/algo/blast/format/blastfmtutil.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastfmtutil.cpp 482732 2015-10-26 16:31:57Z ivanov $
+/*  $Id: blastfmtutil.cpp 479455 2015-09-21 14:39:54Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: blastfmtutil.cpp 482732 2015-10-26 16:31:57Z ivanov $";
+static char const rcsid[] = "$Id: blastfmtutil.cpp 479455 2015-09-21 14:39:54Z fongah2 $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/algo/blast/format/blastxml2_format.cpp b/c++/src/algo/blast/format/blastxml2_format.cpp
index cf453d6..fe6a6b2 100644
--- a/c++/src/algo/blast/format/blastxml2_format.cpp
+++ b/c++/src/algo/blast/format/blastxml2_format.cpp
@@ -1,4 +1,4 @@
-/* $Id: blastxml2_format.cpp 485061 2015-11-18 16:07:54Z ivanov $
+/* $Id: blastxml2_format.cpp 484963 2015-11-17 18:10:43Z fongah2 $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/algo/blast/format/data4xml2format.cpp b/c++/src/algo/blast/format/data4xml2format.cpp
index 6150e3e..170db34 100644
--- a/c++/src/algo/blast/format/data4xml2format.cpp
+++ b/c++/src/algo/blast/format/data4xml2format.cpp
@@ -1,4 +1,4 @@
-/* $Id: data4xml2format.cpp 482740 2015-10-26 16:34:54Z ivanov $
+/* $Id: data4xml2format.cpp 481924 2015-10-19 13:58:31Z fongah2 $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/algo/blast/igblast/igblast.cpp b/c++/src/algo/blast/igblast/igblast.cpp
index 5c9d06c..d0e1ddd 100644
--- a/c++/src/algo/blast/igblast/igblast.cpp
+++ b/c++/src/algo/blast/igblast/igblast.cpp
@@ -1,6 +1,6 @@
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: igblast.cpp 425386 2014-01-28 19:44:58Z jianye $";
+    "$Id: igblast.cpp 499246 2016-04-25 11:32:24Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 /* ===========================================================================
  *
@@ -56,7 +56,8 @@ BEGIN_SCOPE(blast)
 
 static int max_allowed_VJ_distance_with_D = 90;
 static int max_allowed_VJ_distance_without_D = 40;
-static int max_allowed_VD_distance = 40;
+static int max_allowed_VD_distance = 55;
+static int extend_length = 30;
 
 static void s_ReadLinesFromFile(const string& fn, vector<string>& lines)
 {
@@ -124,11 +125,116 @@ CIgAnnotationInfo::CIgAnnotationInfo(CConstRef<CIgBlastOptions> &ig_opt)
             }
             if (tokens.size() == 3) { //just backward compatible as there was no such field
                 m_DJChainType[tokens[0]] = tokens[2];
+            } else if (tokens.size() == 4) { //just backward compatible as there was no such field
+                m_DJChainType[tokens[0]] = tokens[2];
+                m_JDomainInfo[tokens[0]] = NStr::StringToInt(tokens[3]);
             }
         }
     }
 };
 
+void CIgBlast::x_ScreenV(CRef<CSearchResultSet> & results){
+    NON_CONST_ITERATE(CSearchResultSet, result, *results) {
+        if ((*result)->HasAlignments()) {
+            CSeq_align_set::Tdata & align_list = (*result)->SetSeqAlign()->Set();
+            CSeq_align_set::Tdata::iterator it = align_list.begin();
+            while (it != align_list.end()) {
+                if((*it)->GetAlignLength() - (*it)->GetTotalGapCount(0) < m_IgOptions->m_MinVLength){
+                    it = align_list.erase(it);
+                } else {
+                    ++it;
+                }
+            }
+        }
+    }
+}
+
+
+void CIgBlast::x_ExtendAlign(CRef<CSearchResultSet> & results){
+    
+    NON_CONST_ITERATE(CSearchResultSet, result, *results) {
+
+        if ((*result)->HasAlignments()) {
+            CSeq_align_set::Tdata & align_list = (*result)->SetSeqAlign()->Set();
+            int desired_len = 0; 
+            int actual_len = 0;
+            int top_hit_actual_len = 0;
+            int count = 0;
+            ENa_strand extend_strand = eNa_strand_plus;
+            int highest_score = 0; 
+
+            NON_CONST_ITERATE(CSeq_align_set::Tdata, align, align_list) {
+
+                // cerr << "before=" << MSerial_AsnText << **align << endl;
+
+                //extend germline match up to some positions at 5' end.  Extend length is 
+                //set by comparing to top hit or top hit equivalents
+
+                int score = 0;
+                (*align)->GetNamedScore(CSeq_align::eScore_Score, score);
+                
+                if (score >= highest_score)  { //top hits
+                    highest_score = score;
+                    extend_strand = (*align)->GetSeqStrand(0);
+                    desired_len = min(extend_length, 
+                                      (*align)->GetSegs().GetDenseg().GetStarts()[1]);
+                    
+                    if ((*align)->GetSeqStrand(0) == eNa_strand_minus) {
+                        int query_len = m_Scope->GetBioseqHandle((*align)->GetSeq_id(0)).GetBioseqLength();
+                        int allowed_len = min ((*align)->GetSegs().GetDenseg().GetStarts()[1],
+                                               query_len - ((*align)->GetSegs().GetDenseg().GetStarts()[0] +
+                                                            (int)(*align)->GetSegs().GetDenseg().GetLens()[0]));
+                        top_hit_actual_len = min(desired_len, allowed_len);
+                        
+                        
+                    } else {
+                        
+                        top_hit_actual_len = min(desired_len,
+                                         min((*align)->GetSegs().GetDenseg().GetStarts()[0],
+                                             (*align)->GetSegs().GetDenseg().GetStarts()[1]));  
+                    
+                    }
+                } 
+                    
+                if ((*align)->GetSeqStrand(0) == eNa_strand_minus) {
+                    int query_len = m_Scope->GetBioseqHandle((*align)->GetSeq_id(0)).GetBioseqLength();
+                    int allowed_len = min ((*align)->GetSegs().GetDenseg().GetStarts()[1],
+                                           query_len - ((*align)->GetSegs().GetDenseg().GetStarts()[0] +
+                                                        (int)(*align)->GetSegs().GetDenseg().GetLens()[0]));
+                    actual_len = min(top_hit_actual_len, min(desired_len, allowed_len));
+                    
+                    
+                } else {
+                    
+                    actual_len = min(top_hit_actual_len, min(desired_len,
+                                                             min((*align)->GetSegs().GetDenseg().GetStarts()[0],
+                                                                 (*align)->GetSegs().GetDenseg().GetStarts()[1])));  
+                                     
+                }
+            
+                count ++;
+                //only extend if it has the same strand as the top hit
+                if (actual_len > 0 && (*align)->GetSeqStrand(0) == extend_strand) {
+                    if (extend_strand == eNa_strand_minus) {
+                       
+                        (*align)->SetSegs().SetDenseg().SetStarts()[1] -= actual_len;
+                        (*align)->SetSegs().SetDenseg().SetLens()[0] += actual_len; 
+
+                    } else {
+                    
+                        (*align)->SetSegs().SetDenseg().SetStarts()[0] -= actual_len;
+                        (*align)->SetSegs().SetDenseg().SetStarts()[1] -= actual_len;
+                        (*align)->SetSegs().SetDenseg().SetLens()[0] += actual_len;
+                       
+                    } 
+                }
+                // cerr << "after=" << MSerial_AsnText << **align << endl;
+            }
+               
+        }
+    }
+}
+
 CRef<CSearchResultSet>
 CIgBlast::Run()
 {
@@ -144,6 +250,10 @@ CIgBlast::Run()
         x_SetupVSearch(qf, opts_hndl);
         CLocalBlast blast(qf, opts_hndl, m_IgOptions->m_Db[0]);
         results[0] = blast.Run();
+        if (m_IgOptions->m_ExtendAlign){
+            x_ExtendAlign(results[0]);
+        }
+        x_ScreenV(results[0]);
         x_ConvertResultType(results[0]);
         s_SortResultsByEvalue(results[0]);
         x_AnnotateV(results[0], annots);
@@ -154,6 +264,10 @@ CIgBlast::Run()
         opts_hndl->SetHitlistSize(20);  // use a larger number to ensure annotation
         CLocalBlast blast(qf, opts_hndl, m_IgOptions->m_Db[3]);
         results[3] = blast.Run();
+        if (m_IgOptions->m_ExtendAlign){
+            x_ExtendAlign(results[3]);
+        }
+        x_ScreenV(results[3]);
         s_SortResultsByEvalue(results[3]);
         x_AnnotateDomain(results[0], results[3], annots);
     }
@@ -173,8 +287,9 @@ CIgBlast::Run()
                 break;
             }
         }
-        if (num_genes > 1) 
+        if (num_genes > 1){
             x_AnnotateDJ(results[1], results[2], annots);
+        }
     }
 
     /*** collect germline search results */
@@ -442,16 +557,19 @@ static bool s_CompareSeqAlignByScore(const CRef<CSeq_align> &x, const CRef<CSeq_
 };
 
 // Test if D and J annotation not compatible
-static bool s_DJNotCompatible(const CSeq_align &d, const CSeq_align &j, bool ms)
+static bool s_DJNotCompatible(const CSeq_align &d, const CSeq_align &j, bool ms, int margin)
 {
     int ds = d.GetSeqStart(0);
     int de = d.GetSeqStop(0);
     int js = j.GetSeqStart(0);
     int je = j.GetSeqStop(0);
+
+    //D gene needs to have minimal match in addition to overlap with J gene
+    //D gene needs to end before J gene ends
     if (ms) {
-        if (ds < js + 3 || de < je + 3) return true;
+        if (ds < js + 3 || de < je + margin) return true;
     } else { 
-        if (ds > js - 3 || de > je - 3) return true;
+        if (ds > js - margin || de > je + 3) return true;
     }
     return false;
 };
@@ -586,8 +704,8 @@ void CIgBlast::x_FindDJAln(CRef<CSeq_align_set>& align_D,
                 bool keep = false;
                 int q_ds = (*it)->GetSeqStart(0);
                 int q_de = (*it)->GetSeqStop(0);
-                if (q_ms) keep = (q_de >= q_ve - max_allowed_VD_distance && q_ds <= q_ve - 3);
-                else      keep = (q_ds <= q_ve + max_allowed_VD_distance && q_de >= q_ve + 3);
+                if (q_ms) keep = (q_de >= q_ve - max_allowed_VD_distance && q_ds <= q_ve - m_IgOptions->m_Min_D_match);
+                else      keep = (q_ds <= q_ve + max_allowed_VD_distance && q_de >= q_ve + m_IgOptions->m_Min_D_match);
                 if (!keep) it = align_list.erase(it);
                 else ++it;
             }
@@ -654,7 +772,7 @@ void CIgBlast::x_FindDJAln(CRef<CSeq_align_set>& align_D,
             if (keep_J) {
                 it = al_D.begin();
                 while (it != al_D.end()) {
-                    if (s_DJNotCompatible(**it, **(al_J.begin()), q_ms)) {
+                    if (s_DJNotCompatible(**it, **(al_J.begin()), q_ms, m_IgOptions->m_Min_D_match)) {
                         it = al_D.erase(it);
                     } else ++it;
                 }
@@ -662,7 +780,7 @@ void CIgBlast::x_FindDJAln(CRef<CSeq_align_set>& align_D,
                 if (align_D.NotEmpty() && !align_D->IsEmpty()){
                     it = al_J.begin();
                     while (it != al_J.end()) {
-                        if (s_DJNotCompatible(**(al_D.begin()), **it, q_ms)) {
+                        if (s_DJNotCompatible(**(al_D.begin()), **it, q_ms, m_IgOptions->m_Min_D_match)) {
                             it = al_J.erase(it);
                         } else ++it;
                     }
@@ -670,14 +788,14 @@ void CIgBlast::x_FindDJAln(CRef<CSeq_align_set>& align_D,
             } else {
                 it = al_J.begin();
                 while (it != al_J.end()) {
-                    if (s_DJNotCompatible(**(al_D.begin()), **it, q_ms)) {
+                    if (s_DJNotCompatible(**(al_D.begin()), **it, q_ms, m_IgOptions->m_Min_D_match)) {
                         it = al_J.erase(it);
                     } else ++it;
                 }
                 if (align_J.NotEmpty() && !align_J->IsEmpty()) {
                     it = al_D.begin();
                     while (it != al_D.end()) {
-                        if (s_DJNotCompatible(**it, **(al_J.begin()), q_ms)) {
+                        if (s_DJNotCompatible(**it, **(al_J.begin()), q_ms, m_IgOptions->m_Min_D_match)) {
                             it = al_D.erase(it);
                         } else ++it;
                     }
@@ -756,6 +874,34 @@ void CIgBlast::x_FindDJ(CRef<CSearchResultSet>& results_D,
         
 }
 
+void CIgBlast::x_FillJDomain(CRef<CSeq_align> & align, CRef <CIgAnnotation> & annot){
+    string sid = s_RemoveLocalPrefix(align->GetSeq_id(1).AsFastaString());
+    int j_cdr3end = m_AnnotationInfo.GetJDomain(sid);
+    int subject_start = align->GetSeqStart(1);
+    //don't try if j starts after cdr3 ends as we don't know for sure where the boundry is
+    if (j_cdr3end > 0 && subject_start - j_cdr3end <= 1) {
+        int subject_end = align->GetSeqStop(1);
+        CAlnMap j_map(align->GetSegs().GetDenseg());
+        
+        //+1 actaully is in fwr4 already...need to do this so that a insertion right in front
+        // of fwr4 can be handled.
+        annot->m_JDomain[1] = j_map.GetSeqPosFromSeqPos(0, 1, 
+                                                        max(subject_start, min(j_cdr3end + 1, 
+                                                                               subject_end)), 
+                                                        IAlnExplorer::eRight);
+        
+        if (align->GetSeqStrand(0) == eNa_strand_minus) {
+            annot->m_JDomain[1] = m_Scope->GetBioseqHandle(align->GetSeq_id(0)).GetBioseqLength() - annot->m_JDomain[1] - 1;
+        } 
+           
+        //deduct one back to in CDR3
+        if (subject_end > j_cdr3end) {
+            annot->m_JDomain[1] --;
+        }
+    }
+}
+
+
 void CIgBlast::x_AnnotateDJ(CRef<CSearchResultSet>        &results_D,
                             CRef<CSearchResultSet>        &results_J,
                             vector<CRef <CIgAnnotation> > &annots)
@@ -794,6 +940,7 @@ void CIgBlast::x_AnnotateDJ(CRef<CSearchResultSet>        &results_D,
         if (align_J.NotEmpty() && !align_J->IsEmpty()) {
             const CSeq_align_set::Tdata & align_list = align_J->Get();
             CRef<CSeq_align> align = align_list.front();
+            x_FillJDomain(align, *annot);
             (*annot)->m_GeneInfo[4] = align->GetSeqStart(0);
             (*annot)->m_GeneInfo[5] = align->GetSeqStop(0)+1;
             string sid = s_RemoveLocalPrefix(align->GetSeq_id(1).AsFastaString());
diff --git a/c++/src/algo/blast/unit_tests/api/Makefile.in b/c++/src/algo/blast/unit_tests/api/Makefile.in
index 0270bfb..5b7ae8a 100644
--- a/c++/src/algo/blast/unit_tests/api/Makefile.in
+++ b/c++/src/algo/blast/unit_tests/api/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in 454176 2014-12-11 16:00:59Z camacho $
+# $Id: Makefile.in 498724 2016-04-19 13:36:57Z ivanov $
 
 LIB_PROJ = blast_unit_test_util seqalign_util
 
@@ -46,7 +46,8 @@ uniform_search_unit_test \
 blastfilter_unit_test \
 blastoptions_unit_test \
 gencode_singleton_unit_test \
-bl2seq_unit_test
+bl2seq_unit_test \
+stat_unit_test
 
 REQUIRES = Boost.Test.Included
 
@@ -148,3 +149,5 @@ gencode_singleton_unit_test: lib
 	${MAKE} ${MFLAGS} -f Makefile.gencode_singleton_unit_test_app
 bl2seq_unit_test: lib
 	${MAKE} ${MFLAGS} -f Makefile.bl2seq_unit_test_app
+stat_unit_test: lib
+	${MAKE} ${MFLAGS} -f Makefile.stat_unit_test_app
diff --git a/c++/src/algo/blast/unit_tests/api/Makefile.stat_unit_test.app b/c++/src/algo/blast/unit_tests/api/Makefile.stat_unit_test.app
new file mode 100644
index 0000000..72de2e7
--- /dev/null
+++ b/c++/src/algo/blast/unit_tests/api/Makefile.stat_unit_test.app
@@ -0,0 +1,15 @@
+# $Id: Makefile.stat_unit_test.app 498724 2016-04-19 13:36:57Z ivanov $
+
+APP = stat_unit_test
+SRC = stat_unit_test 
+
+CPPFLAGS = -DNCBI_MODULE=BLAST $(ORIG_CPPFLAGS) $(BOOST_INCLUDE) -I$(srcdir)/../../api
+LIB = blast_unit_test_util test_boost $(BLAST_LIBS) xobjsimple $(OBJMGR_LIBS:ncbi_x%=ncbi_x%$(DLL))
+LIBS = $(NETWORK_LIBS) $(CMPRS_LIBS) $(DL_LIBS) $(ORIG_LIBS)
+
+CHECK_REQUIRES = MT in-house-resources
+CHECK_CMD = stat_unit_test
+CHECK_COPY = stat_unit_test.ini
+
+WATCHERS = boratyng madden camacho fongah2
+ 
\ No newline at end of file
diff --git a/c++/src/algo/blast/unit_tests/api/bl2seq_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/bl2seq_unit_test.cpp
index b630a48..427223d 100644
--- a/c++/src/algo/blast/unit_tests/api/bl2seq_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/bl2seq_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: bl2seq_unit_test.cpp 478802 2015-09-14 15:44:22Z ivanov $
+/*  $Id: bl2seq_unit_test.cpp 495292 2016-03-16 14:52:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -3301,7 +3301,7 @@ BOOST_AUTO_TEST_CASE(testOneSubjectResults2CSeqAlign)
 {
     const int num_subjects = 15;
     const int results_size[num_subjects] = 
-        { 1, 1, 0, 1, 1, 1, 2, 1, 2, 0, 0, 0, 0, 2, 0 };
+        { 1, 1, 0, 1, 1, 1, 2, 1, 2, 0, 0, 0, 0, 2, 1 };
     const int query_gi = 7274302;
     const int gi_diff = 28;
     CRef<CSeq_id> id(new CSeq_id(CSeq_id::e_Gi, query_gi));
@@ -3313,6 +3313,7 @@ BOOST_AUTO_TEST_CASE(testOneSubjectResults2CSeqAlign)
     int index;
     for (index = 0; index < num_subjects; ++index) {
         id.Reset(new CSeq_id(CSeq_id::e_Gi, (query_gi + gi_diff + index)));
+cerr << query_gi + gi_diff + index << endl;
         sl.reset(CTestObjMgr::Instance().CreateSSeqLoc(*id, 
                                                        eNa_strand_both));
         subjects.push_back(*sl);
@@ -3324,6 +3325,7 @@ BOOST_AUTO_TEST_CASE(testOneSubjectResults2CSeqAlign)
     index = 0;
     ITERATE(TSeqAlignVector, itr, seqalign_v)
     {
+cerr << index << endl;
         BOOST_REQUIRE_EQUAL(results_size[index], (int) (*itr)->Get().size());
         index++;
     }
diff --git a/c++/src/algo/blast/unit_tests/api/blastengine_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/blastengine_unit_test.cpp
index 0322324..077301a 100644
--- a/c++/src/algo/blast/unit_tests/api/blastengine_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/blastengine_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastengine_unit_test.cpp 415473 2013-10-17 13:43:48Z madden $
+/*  $Id: blastengine_unit_test.cpp 498724 2016-04-19 13:36:57Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -114,10 +114,10 @@ void testLongMatchDiagnostics(BlastDiagnostics* diagnostics)
     BlastGappedStats* gapped_stats = 
         diagnostics->gapped_stat;
 
-    BOOST_REQUIRE_EQUAL(22673097, (int)ungapped_stats->lookup_hits);
-    BOOST_REQUIRE_EQUAL(296138, ungapped_stats->init_extends);
-    BOOST_REQUIRE_EQUAL(1256, ungapped_stats->good_init_extends);
-    BOOST_REQUIRE_EQUAL(1252, gapped_stats->extensions);
+    BOOST_REQUIRE_EQUAL(22670293, (int)ungapped_stats->lookup_hits);
+    BOOST_REQUIRE_EQUAL(296326, ungapped_stats->init_extends);
+    BOOST_REQUIRE_EQUAL(1258, ungapped_stats->good_init_extends);
+    BOOST_REQUIRE_EQUAL(1254, gapped_stats->extensions);
     BOOST_REQUIRE_EQUAL(23, gapped_stats->good_extensions);
 }
 
@@ -179,7 +179,7 @@ BOOST_AUTO_TEST_CASE(testTBLASTNLongMatchBlastEngine) {
         { 368, 199, 160, 104, 99, 95, 94, 92, 94, 89, 108, 
           101, 97, 95, 89, 86, 84, 84, 83, 79, 75, 74, 74};
     const double kEvalueFinal[kNumHspsEnd] = 
-        {1.90868e-35, 4.47098e-34, 4.47098e-34, 4.47098e-34, 
+        {1.84467e-35, 4.47098e-34, 4.47098e-34, 4.47098e-34, 
          4.23245e-08, 4.23245e-08, 3.29958e-07, 3.29958e-07, 
          7.11395e-07, 7.11395e-07, 8.64076e-05, 0.000570668, 
          0.001678, 0.00287725, 0.0145032, 0.0325588, 
@@ -414,7 +414,7 @@ BOOST_AUTO_TEST_CASE(testBlastpPrelimSearch)
     const string kDbName("data/seqp");
     const TGi kQueryGi1 = GI_FROM(TIntId, 21282798);
     const TGi kQueryGi2 = GI_FROM(TIntId, 129295);
-    const int kNumHits = 28;
+    const int kNumHits = 31;
     const int kNumHitsToCheck = 3;
     const int kIndices[kNumHitsToCheck] = { 1, 4, 8 };
     const int kScores[kNumHitsToCheck] = { 519, 56, 54 };
diff --git a/c++/src/algo/blast/unit_tests/api/blastextend_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/blastextend_unit_test.cpp
index 38f4196..e051f4f 100644
--- a/c++/src/algo/blast/unit_tests/api/blastextend_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/blastextend_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastextend_unit_test.cpp 462040 2015-03-16 13:14:29Z vasilche $
+/*  $Id: blastextend_unit_test.cpp 480534 2015-10-01 15:21:48Z madden $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -439,9 +439,9 @@ BOOST_AUTO_TEST_CASE(testGreedyAlignment) {
 
 // Test for SB-666 fix
 BOOST_AUTO_TEST_CASE(testGreedyAlignmentWithBadStart) {
-    const int query_start = 2667;
+    const int query_start = 2612;
     const int query_end = 2754;
-    const int subject_start = 350;
+    const int subject_start = 291;
     const int subject_end = 438;
     const int q_offset = 2754;
     const int s_offset = 438;
diff --git a/c++/src/algo/blast/unit_tests/api/blastfilter_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/blastfilter_unit_test.cpp
index c2fcd62..ee5c005 100644
--- a/c++/src/algo/blast/unit_tests/api/blastfilter_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/blastfilter_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastfilter_unit_test.cpp 462040 2015-03-16 13:14:29Z vasilche $
+/*  $Id: blastfilter_unit_test.cpp 496425 2016-03-28 15:16:22Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -323,7 +323,7 @@ static void x_TestGetFilteredQueryRegions(ENa_strand strand) {
     masked_offsets.push_back(make_pair(7600U, 7672U));
     masked_offsets.push_back(make_pair(7766U, 7772U));
     masked_offsets.push_back(make_pair(8873U, 8880U));
-    masked_offsets.push_back(make_pair(9114U, 9179U));
+    masked_offsets.push_back(make_pair(9109U, 9179U));
 
     const size_t kNumQueries(1);
     const size_t kNumLocs(masked_offsets.size());
@@ -545,14 +545,14 @@ BOOST_AUTO_TEST_CASE(WindowMasker)
         { 0, 79,
           100, 122,
           146, 169,
-          225, 247,
+          225, 248,
           286, 329,
           348, 366,
           373, 688,
           701, 1303,
           1450, 1485,
           2858, 2887,
-          3103, 3212,
+          3086, 3212,
           3217, 3735,
           4142, 4162,
           5423, 5443,
@@ -564,8 +564,8 @@ BOOST_AUTO_TEST_CASE(WindowMasker)
           7170, 7189,
           7604, 7623,
           8454, 8476,
-          8829, 8851,
-          8860, 8889 };
+          8829, 8889 
+        };
     
     size_t num_locs = sizeof(intervals) / pair_size;
     BOOST_REQUIRE(0 == (sizeof(intervals) % pair_size));
@@ -1169,7 +1169,7 @@ BOOST_AUTO_TEST_CASE(CombineRepeatAndDustFilter) {
     const int kNumLocs = 13;
     const int kStarts[kNumLocs] = 
         { 0, 298, 380, 1449, 2851, 3113, 4704, 6364, 6512, 7600, 
-          7766, 8873, 9114};
+          7766, 8873, 9109};
     const int kEnds[kNumLocs] = 
         { 212, 305, 1297, 1479, 2953, 3764, 4710, 6373, 6573, 7672, 
           7772, 8880, 9179};
@@ -1202,7 +1202,7 @@ BOOST_AUTO_TEST_CASE(FilterLocNuclBoth) {
     const int kNumLocs = 15;
     const int kDustStarts[kNumLocs] = 
         { 298, 875, 1018, 1449, 3113, 3282, 3428, 3598, 4704, 6364, 
-          6512, 7600, 7766, 8873, 9114};
+          6512, 7600, 7766, 8873, 9109};
     const int kDustEnds[kNumLocs] = 
         { 305, 882, 1115, 1479, 3133, 3298, 3441, 3606, 4710, 6373, 
           6573, 7672, 7772, 8880 , 9179}; 
@@ -1232,7 +1232,7 @@ BOOST_AUTO_TEST_CASE(FilterLocNuclPlus) {
     const int kNumLocs = 15;
     const int kDustStarts[kNumLocs] = 
         { 298, 875, 1018, 1449, 3113, 3282, 3428, 3598, 4704, 6364, 
-          6512, 7600, 7766, 8873, 9114};
+          6512, 7600, 7766, 8873, 9109};
     const int kDustEnds[kNumLocs] = 
         { 305, 882, 1115, 1479, 3133, 3298, 3441, 3606, 4710, 6373, 
           6573, 7672, 7772, 8880 , 9179}; 
@@ -1262,7 +1262,7 @@ BOOST_AUTO_TEST_CASE(FilterLocNuclMinus) {
     const int kNumLocs = 15;
     const int kDustStarts[kNumLocs] = 
         { 298, 875, 1018, 1449, 3113, 3282, 3428, 3598, 4704, 6364, 
-          6512, 7600, 7766, 8873, 9114};
+          6512, 7600, 7766, 8873, 9109};
     const int kDustEnds[kNumLocs] = 
         { 305, 882, 1115, 1479, 3133, 3298, 3441, 3606, 4710, 6373, 
           6573, 7672, 7772, 8880 , 9179}; 
@@ -1444,7 +1444,7 @@ BOOST_AUTO_TEST_CASE(FilterMultipleQueriesLocNuclPlus) {
 
     int dust_starts0[kNumLocs0] = 
         { 298, 875, 1018, 1449, 3113, 3282, 3428, 3598, 4704, 6364, 
-          6512, 7600, 7766, 8873, 9114};
+          6512, 7600, 7766, 8873, 9109};
     int dust_ends0[kNumLocs0] = 
         { 305, 882, 1115, 1479, 3133, 3298, 3441, 3606, 4710, 6373, 
           6573, 7672, 7772, 8880 , 9179}; 
diff --git a/c++/src/algo/blast/unit_tests/api/blasthits_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/blasthits_unit_test.cpp
index 19d0b30..1611e4a 100644
--- a/c++/src/algo/blast/unit_tests/api/blasthits_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/blasthits_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blasthits_unit_test.cpp 462040 2015-03-16 13:14:29Z vasilche $
+/*  $Id: blasthits_unit_test.cpp 500125 2016-05-02 16:14:49Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -223,9 +223,9 @@ BOOST_AUTO_TEST_CASE(BlastTargetSequence)
         const int kOffsetIncrement = 9900;
         const int kTotalNumHsps = 12;
         const int kFinalScores[kTotalNumHsps] = 
-            { 120, 111, 80, 77, 75, 72, 70, 65, 62, 60, 44, 40 };
+            { 120, 111, 80, 77, 75, 72, 70, 70, 65, 60, 44, 40 };
         const int kFinalOffsets[kTotalNumHsps] = 
-            { 25000, 22000, 9950, 10400, 9850, 19750, 5000, 3000, 9970, 100, 
+            { 25000, 22000, 9950, 10400, 9850, 19750, 5000, 9970, 3000, 100, 
               19820, 9902 };
         const int kFinalLengths[kTotalNumHsps] = 
             { 200, 200, 100, 100, 100, 100, 100, 100, 100, 100, 60, 48 };
diff --git a/c++/src/algo/blast/unit_tests/api/blastsetup_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/blastsetup_unit_test.cpp
index 6724191..ed72206 100644
--- a/c++/src/algo/blast/unit_tests/api/blastsetup_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/blastsetup_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastsetup_unit_test.cpp 462040 2015-03-16 13:14:29Z vasilche $
+/*  $Id: blastsetup_unit_test.cpp 500367 2016-05-04 12:06:01Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -738,14 +738,15 @@ BOOST_AUTO_TEST_CASE(GetSequenceProteinWithSelenocysteine) {
     SBlastSequence seq(GetSequence(*seqloc, eBlastEncodingProtein, scope,
                                     eNa_strand_unknown, eSentinels, 
                                     &warnings));
-    BOOST_REQUIRE(!warnings.empty());
+    // Check that there are no warning
+    BOOST_REQUIRE(warnings.empty());
 
     // Check that the sequence has its selenocysteine residues replaced by
-    // X's (positions 10 and 15, without counting sentinels);
+    // C's (positions 10 and 15, without counting sentinels);
     const TSeqPos kReplacedPositions[] = { 10+1, 15+1 };
-    const Uint1 kXresidue = AMINOACID_TO_NCBISTDAA[(int)'X'];
+    const Uint1 kCresidue = AMINOACID_TO_NCBISTDAA[(int)'C'];
     for (TSeqPos i = 0; i < DIM(kReplacedPositions); i++) {
-        BOOST_REQUIRE_EQUAL((int)kXresidue, 
+        BOOST_REQUIRE_EQUAL((int)kCresidue, 
                                 (int)seq.data.get()[kReplacedPositions[i]]);
     }
 
@@ -800,7 +801,7 @@ BOOST_AUTO_TEST_CASE(GetGapOnlySequenceNCBI2NA) {
         sequence++;
     }
     
-    BOOST_REQUIRE_EQUAL(3302, hash_value);
+    BOOST_REQUIRE_EQUAL(3285, hash_value);
     BOOST_REQUIRE_EQUAL((TSeqPos) 26, seq.length); // 26 is (64000000-63999900+1)/4 + 1
 }
 
@@ -823,7 +824,7 @@ BOOST_AUTO_TEST_CASE(GetGapInSequenceNCBI2NA) {
         sequence++;
     }
     
-    BOOST_REQUIRE_EQUAL(6941565, hash_value);
+    BOOST_REQUIRE_EQUAL(6940529, hash_value);
     BOOST_REQUIRE_EQUAL((TSeqPos) 53830, seq.length); 
 }
 
diff --git a/c++/src/algo/blast/unit_tests/api/data/biased.fsa b/c++/src/algo/blast/unit_tests/api/data/biased.fsa
old mode 100755
new mode 100644
diff --git a/c++/src/algo/blast/unit_tests/api/data/msa.clustalw.txt b/c++/src/algo/blast/unit_tests/api/data/msa.clustalw.txt
old mode 100755
new mode 100644
diff --git a/c++/src/algo/blast/unit_tests/api/delta_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/delta_unit_test.cpp
index b26eb3f..3490642 100644
--- a/c++/src/algo/blast/unit_tests/api/delta_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/delta_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: delta_unit_test.cpp 440370 2014-07-11 18:26:19Z boratyng $
+/*  $Id: delta_unit_test.cpp 498724 2016-04-19 13:36:57Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -226,7 +226,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_CBS)
     // HSP # 1
     { 
         expected_domain_results[0].score = 742;
-        expected_domain_results[0].evalue = 1.99110e-100;
+        expected_domain_results[0].evalue = 5.21679e-102;
         expected_domain_results[0].bit_score = 2.89507e+02;
         expected_domain_results[0].num_ident = 111;
         int starts[] = {1, 139, 80, -1, 81, 218};
@@ -240,7 +240,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_CBS)
     // HSP # 2
     { 
         expected_domain_results[1].score = 713;
-        expected_domain_results[1].evalue = 4.81988e-96;
+        expected_domain_results[1].evalue = 1.33296e-97;
         expected_domain_results[1].bit_score = 2.78295e+02;
         expected_domain_results[1].num_ident = 107;
         int starts[] = {1, 135, 6, -1, 8, 140, -1, 190, 58, 191, 80, -1, 81,
@@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_CBS)
     // HSP # 3
     { 
         expected_domain_results[2].score = 673;
-        expected_domain_results[2].evalue = 5.35876e-90;
+        expected_domain_results[2].evalue = 1.63233e-91;
         expected_domain_results[2].bit_score = 2.62959e+02;
         expected_domain_results[2].num_ident = 106;
         int starts[] = {0, 137, 115, -1, 117, 252 };
@@ -305,7 +305,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_CBS)
     // HSP # 1
     { 
         expected_results[0].score = 861;
-        expected_results[0].evalue = 4.90290e-108;
+        expected_results[0].evalue = 2.80386e-109;
         expected_results[0].bit_score = 3.35656e+02;
         expected_results[0].num_ident = 101; 
         int starts[] = {0, 941, -1, 1094, 153, 1095};
@@ -319,7 +319,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_CBS)
     // HSP # 2
     {
         expected_results[1].score = 633;
-        expected_results[1].evalue = 1.59653e-76;
+        expected_results[1].evalue = 3.86624e-77;
         expected_results[1].bit_score = 2.47830e+02;
         expected_results[1].num_ident = 73; 
         int starts[] = {0, 154, -1, 307, 153, 308};
@@ -333,7 +333,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_CBS)
     // HSP # 3
     {
         expected_results[2].score = 645;
-        expected_results[2].evalue = 1.88887e-82;
+        expected_results[2].evalue = 6.62145e-84;
         expected_results[2].bit_score = 2.52452e+02;
         expected_results[2].num_ident = 80; 
         int starts[] = {0, 190, 68, -1, 70, 258, 92, -1, 93, 280, 118, -1, 
@@ -407,7 +407,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_CBS)
     // HSP # 8
     {
         expected_results[7].score = 48;
-        expected_results[7].evalue = 8.36262;
+        expected_results[7].evalue = 7.91913;
         expected_results[7].bit_score = 22.4884;
         expected_results[7].num_ident = 5;
         int starts[] = {155, 78};
@@ -487,7 +487,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_NoCBS)
     // HSP # 1
     { 
         expected_domain_results[0].score = 728;
-        expected_domain_results[0].evalue = 2.45396e-98;
+        expected_domain_results[0].evalue = 6.61511e-100;
         expected_domain_results[0].bit_score = 2841082571e-7;
         expected_domain_results[0].num_ident = 111;
         int starts[] = {1, 139, 80, -1, 81, 218, 162, -1, 163, 299};
@@ -501,7 +501,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_NoCBS)
     // HSP # 2
     { 
         expected_domain_results[1].score = 698;
-        expected_domain_results[1].evalue = 7.61355e-94;
+        expected_domain_results[1].evalue = 2.17510e-95;
         expected_domain_results[1].bit_score = 2725169055e-7;
         expected_domain_results[1].num_ident = 107;
         int starts[] = {1, 135, 6, -1, 8, 140, -1, 190, 58, 191, 80, -1, 81,
@@ -517,7 +517,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_NoCBS)
     // HSP # 3
     { 
         expected_domain_results[2].score = 661;
-        expected_domain_results[2].evalue = 2.92318e-88;
+        expected_domain_results[2].evalue = 9.15785e-90;
         expected_domain_results[2].bit_score = 2583366987e-7;
         expected_domain_results[2].num_ident = 106;
         int starts[] = {0, 137, 115, -1, 117, 252 };
@@ -566,7 +566,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_NoCBS)
     // HSP # 1
     { 
         expected_results[0].score = 876;
-        expected_results[0].evalue = 3.83527e-110;
+        expected_results[0].evalue = 2.04885e-111;
         expected_results[0].bit_score = 3414303038e-7;
         expected_results[0].num_ident = 101;
         int starts[] = {0, 941, -1, 1094, 153, 1095};
@@ -581,7 +581,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_NoCBS)
     // HSP # 2
     {
         expected_results[1].score = 642;
-        expected_results[1].evalue = 1.02795e-77;
+        expected_results[1].evalue = 2.54740e-78;
         expected_results[1].bit_score = 2512936031e-7;
         expected_results[1].num_ident = 73;
         int starts[] = {0, 154, -1, 307, 153, 308};
@@ -595,7 +595,7 @@ BOOST_AUTO_TEST_CASE(TestSingleQuery_NoCBS)
     // HSP # 3
     {
         expected_results[2].score = 736;
-        expected_results[2].evalue = 3.93428e-96;
+        expected_results[2].evalue = 1.10324e-97;
         expected_results[2].bit_score = 2875023632e-7;
         expected_results[2].num_ident = 83;
         int starts[] = {0, 190, 68, -1, 70, 258, 92, -1, 93, 280, 118, -1,
diff --git a/c++/src/algo/blast/unit_tests/api/psiblast_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/psiblast_unit_test.cpp
index d7bb03b..867c747 100644
--- a/c++/src/algo/blast/unit_tests/api/psiblast_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/psiblast_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: psiblast_unit_test.cpp 415473 2013-10-17 13:43:48Z madden $
+/*  $Id: psiblast_unit_test.cpp 498724 2016-04-19 13:36:57Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -341,7 +341,7 @@ BOOST_AUTO_TEST_CASE(TestSingleIteration_ProteinAsQuery_CBS) {
 
     // HSP # 4
     expected_results[3].score = 50;
-    expected_results[3].evalue = 7.15763;
+    expected_results[3].evalue = 6.81719;
     expected_results[3].bit_score = 23.8682;
     expected_results[3].starts.push_back(295);
     expected_results[3].starts.push_back(23);
@@ -468,12 +468,12 @@ BOOST_AUTO_TEST_CASE(TestSingleIteration_ProteinAsQuery_CBSUniversal) {
     CSearchResultSet results(*psiblast.Run());
     BOOST_REQUIRE(results[0].GetErrors().empty());
 
-    const int kNumExpectedMatchingSeqs = 5;
+    const int kNumExpectedMatchingSeqs = 6;
     CConstRef<CSeq_align_set> sas = results[0].GetSeqAlign();
 
     BOOST_REQUIRE_EQUAL(kNumExpectedMatchingSeqs, s_CountNumberUniqueGIs(sas));
 
-    const size_t kNumExpectedHSPs = 5;
+    const size_t kNumExpectedHSPs = 6;
     qa::TSeqAlignSet expected_results(kNumExpectedHSPs);
 
     // HSP # 1
@@ -625,7 +625,7 @@ BOOST_AUTO_TEST_CASE(TestSingleIteration_PssmAsQuery_NoCBS) {
         int starts[] = { 0, 154, -1, 308, 154, 309 };
         int lengths[] = { 154, 1, 24 };
         expected_results[1].score = 424;
-        expected_results[1].evalue = 5.17079e-48;
+        expected_results[1].evalue = 6.54598e-49;
         expected_results[1].bit_score = 167754171e-6;
         expected_results[1].num_ident = 73;
         copy(&starts[0], &starts[STATIC_ARRAY_SIZE(starts)],
@@ -643,7 +643,7 @@ BOOST_AUTO_TEST_CASE(TestSingleIteration_PssmAsQuery_NoCBS) {
         int lengths[] = 
             { 65, 2, 24, 1, 19, 2, 6, 1, 32, 1, 11, 1, 26, 6, 10, 2, 30 };
         expected_results[2].score = 372;
-        expected_results[2].evalue = 1.34154e-42;
+        expected_results[2].evalue = 1.67386e-43;
         expected_results[2].bit_score = 147723793e-6;
         expected_results[2].num_ident = 87;
         copy(&starts[0], &starts[STATIC_ARRAY_SIZE(starts)],
@@ -730,7 +730,7 @@ BOOST_AUTO_TEST_CASE(TestSingleIteration_PssmAsQuery_CBS) {
         int starts[] = { 0, 941, -1, 1093, 152, 1094 };
         int lengths[] = { 152, 1, 80 };
         expected_results[0].score = 593;
-        expected_results[0].evalue = 5.81663e-71;
+        expected_results[0].evalue = 1.15934e-71;
         expected_results[0].bit_score = 232843196e-6;
         expected_results[0].sequence_gis.SetQuery(129295);
         expected_results[0].sequence_gis.SetSubject(34878800);
@@ -746,7 +746,7 @@ BOOST_AUTO_TEST_CASE(TestSingleIteration_PssmAsQuery_CBS) {
         int starts[] = { 0, 154, -1, 308, 154, 309 };
         int lengths[] = { 154, 1, 24 };
         expected_results[1].score = 417;
-        expected_results[1].evalue = 4.07856e-47;
+        expected_results[1].evalue = 5.13954e-48;
         expected_results[1].bit_score = 165048071e-6;
         expected_results[1].sequence_gis.SetQuery(129295);
         expected_results[1].sequence_gis.SetSubject(34878800);
@@ -766,7 +766,7 @@ BOOST_AUTO_TEST_CASE(TestSingleIteration_PssmAsQuery_CBS) {
         int lengths[] = 
             { 65, 2, 26, 1, 17, 2, 6, 1, 34, 1, 10, 1, 29, 4, 38 };
         expected_results[2].score = 359;
-        expected_results[2].evalue = 8.35828e-41;
+        expected_results[2].evalue = 1.18595e-41;
         expected_results[2].bit_score = 142706496e-6;
         expected_results[2].sequence_gis.SetQuery(129295);
         expected_results[2].sequence_gis.SetSubject(20092202);
diff --git a/c++/src/algo/blast/unit_tests/api/pssmenginefreqratios_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/pssmenginefreqratios_unit_test.cpp
index 48b9d56..76561dc 100644
--- a/c++/src/algo/blast/unit_tests/api/pssmenginefreqratios_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/pssmenginefreqratios_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: pssmenginefreqratios_unit_test.cpp 483267 2015-10-29 16:09:03Z ivanov $
+/*  $Id: pssmenginefreqratios_unit_test.cpp 485863 2015-11-27 16:39:56Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(FreqRatiosFromMsa)
     string tmp_line;
     getline(raw_data, tmp_line);
     list<string>  ref_data;
-    NStr::Split(tmp_line,  " ", ref_data);
+    NStr::Split(tmp_line,  " ", ref_data, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     list<string>::iterator ref_pt=ref_data.begin();
     ITERATE(list<double>, pt, freq_ratios) {
     	if (*pt == 0) {
diff --git a/c++/src/algo/blast/unit_tests/api/redoalignment_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/redoalignment_unit_test.cpp
index 60c5595..1c7c750 100644
--- a/c++/src/algo/blast/unit_tests/api/redoalignment_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/redoalignment_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: redoalignment_unit_test.cpp 462040 2015-03-16 13:14:29Z vasilche $ 
+/*  $Id: redoalignment_unit_test.cpp 498724 2016-04-19 13:36:57Z ivanov $ 
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -477,7 +477,7 @@ BOOST_AUTO_TEST_CASE(testRedoAlignmentWithCompBasedStats) {
     const int subject_offset_final[k_num_hsps_end] = { 9, 327};
     const int subject_end_final[k_num_hsps_end] = { 512, 604};
     const int score_final[k_num_hsps_end] = { 510, 282};
-    const double evalue_final[k_num_hsps_end] = {3.9816e-60, 1.9935e-30};
+    const double evalue_final[k_num_hsps_end] = {7.0065e-61, 1.6958e-30};
     const int num_idents_final[k_num_hsps_end] = { 171, 94 };
 
     BlastHSPList* ending_hsp_list = 
@@ -537,7 +537,7 @@ BOOST_AUTO_TEST_CASE(testRedoAlignmentWithConditionalAdjust) {
     const int subject_offset_final[k_num_hsps_end] = { 9, 327};
     const int subject_end_final[k_num_hsps_end] = { 546, 604};
     const int score_final[k_num_hsps_end] = { 537, 298};
-    const double evalue_final[k_num_hsps_end] = {8.6649e-64, 1.8159e-32};
+    const double evalue_final[k_num_hsps_end] = {1.1954e-64, 1.5494e-32};
     const int num_idents_final[k_num_hsps_end] = { 177, 95 };
 
     BlastHSPList* ending_hsp_list = 
@@ -734,7 +734,7 @@ BOOST_AUTO_TEST_CASE(testRedoAlignmentWithSW) {
     const int subject_offset_final[k_num_hsps_end] = { 9, 523, 261, 585, 570 };
     const int subject_end_final[k_num_hsps_end]    = { 512, 604, 297, 604, 592 };    
     const int score_final[k_num_hsps_end]          = { 591, 39, 37, 33, 32 };
-    const double evalue_final[k_num_hsps_end]      = { 2.4581e-71, 0.387,      
+    const double evalue_final[k_num_hsps_end]      = { 2.3451e-72, 0.387,      
                                                        0.6692, 1.9988, 2.6256 };
     const int num_idents_final[k_num_hsps_end]     = { 172, 22, 9, 8, 7 };
 
@@ -790,7 +790,7 @@ BOOST_AUTO_TEST_CASE(testRedoAlignmentWithCompBasedStatsAndSW) {
     const int subject_offset_final[k_num_hsps_end] = { 9, 523, 585};
     const int subject_end_final[k_num_hsps_end] = { 512, 604, 604};
     const int score_final[k_num_hsps_end] = { 510, 34, 31};
-    const double evalue_final[k_num_hsps_end] = {3.9816e-60, 1.349, 3.7944};
+    const double evalue_final[k_num_hsps_end] = {7.0065e-61, 1.349, 3.7944};
     const int num_idents_final[k_num_hsps_end] = { 171, 22, 8 };
 
     BlastHSPList* ending_hsp_list = 
diff --git a/c++/src/algo/blast/unit_tests/api/rps_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/rps_unit_test.cpp
index 514ad58..f1a35ad 100644
--- a/c++/src/algo/blast/unit_tests/api/rps_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/rps_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: rps_unit_test.cpp 440370 2014-07-11 18:26:19Z boratyng $
+/*  $Id: rps_unit_test.cpp 498724 2016-04-19 13:36:57Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -56,33 +56,35 @@ using namespace ncbi::blast;
 
 void testNuclHitList(const CSeq_align_set& results, ENa_strand strand)
 {
-   const size_t num_hsps_total = 10;
+   const size_t num_hsps_total = 12;
    const size_t num_hsps_plus = 4;
    const int scores[num_hsps_total] = 
-     {62, 51, 49, 44, 44, 43, 43, 48, 45, 46};
+       {62, 51, 49, 44, 44, 44, 43, 43, 43, 48, 45, 46};
    const ENa_strand strands[num_hsps_total] = 
    {
        eNa_strand_minus,
        eNa_strand_plus,
        eNa_strand_minus,
        eNa_strand_minus,
+       eNa_strand_minus,
        eNa_strand_plus,
        eNa_strand_plus,
        eNa_strand_minus,
        eNa_strand_minus,
        eNa_strand_minus,
+       eNa_strand_minus,
        eNa_strand_plus,
    };
    const int q_offsets[num_hsps_total] =
-      {3244, 1045, 3133, 3163, 8179, 1090, 1328, 832, 6776, 3633};
+       {3244, 1045, 3133, 9204, 3163, 8179, 1090, 1328, 2300, 832, 6776, 3633};
    const int s_offsets[num_hsps_total] =
-      {700, 662, 812, 146, 538, 930, 1340, 1917, 1467, 966};
+       {700, 662, 812, 1385, 146, 538, 930, 1340, 1373, 1917, 1467, 966};
    const int q_ends[num_hsps_total] =
-      {3430, 1159, 3283, 3328, 8287, 1174, 1388, 937, 6968, 3759};
+       {3430, 1159, 3283, 9300, 3328, 8287, 1174, 1388, 2408, 937, 6968, 3759};
    const int s_ends[num_hsps_total] =
-      {761, 699, 861, 205, 564, 958, 1360, 1952, 1531, 1007};
+       {761, 699, 861, 1418, 205, 564, 958, 1360, 1403, 1952, 1531, 1007};
    const double evalues[num_hsps_total] =
-      {0.0546847, 1.0657, 2.00126, 7.83533, 8.12416, 9.05612, 9.84108, 2.53047, 5.47761, 3.70474};
+       {0.0546847, 1.0657, 2.00126, 7.04787, 7.83533, 8.12416, 9.05612, 9.84108, 9.90728, 2.53047, 5.47761, 3.70474};
 
    // compute the total number of alignments
    size_t num_hsps = results.Size();
diff --git a/c++/src/algo/blast/unit_tests/api/stat_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/stat_unit_test.cpp
new file mode 100644
index 0000000..3a555a6
--- /dev/null
+++ b/c++/src/algo/blast/unit_tests/api/stat_unit_test.cpp
@@ -0,0 +1,78 @@
+/*  $Id: stat_unit_test.cpp 498724 2016-04-19 13:36:57Z ivanov $
+* ===========================================================================
+*
+*                            PUBLIC DOMAIN NOTICE
+*               National Center for Biotechnology Information
+*
+*  This software/database is a "United States Government Work" under the
+*  terms of the United States Copyright Act.  It was written as part of
+*  the author's official duties as a United States Government employee and
+*  thus cannot be copyrighted.  This software/database is freely available
+*  to the public for use. The National Library of Medicine and the U.S.
+*  Government have not placed any restriction on its use or reproduction.
+*
+*  Although all reasonable efforts have been taken to ensure the accuracy
+*  and reliability of the software and data, the NLM and the U.S.
+*  Government do not and cannot warrant the performance or results that
+*  may be obtained by using this software or data. The NLM and the U.S.
+*  Government disclaim all warranties, express or implied, including
+*  warranties of performance, merchantability or fitness for any particular
+*  purpose.
+*
+*  Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* Author:  Greg Boratyn
+*
+* File Description:
+*   Unit test module for function related to BLAST statistics.
+*
+* ===========================================================================
+*/
+#include <ncbi_pch.hpp>
+#include <corelib/test_boost.hpp>
+
+#include <algo/blast/core/blast_stat.h>
+#include <vector>
+
+using namespace std;
+
+BOOST_AUTO_TEST_SUITE(stats)
+
+// Ensure that E-value computed with finite size correction is not negative
+BOOST_AUTO_TEST_CASE(EvalueForProteinFSC)
+{
+    Blast_KarlinBlk* kbp = NULL;
+    Blast_GumbelBlk* gbp = NULL;
+    Blast_Message* error = NULL;
+
+    const char* kMatrix = "BLOSUM62";
+    const int kGapOpen = 11;
+    const int kGapExtend = 1;    
+
+    // Try a few alignment scores and sequences lengths that used to cause
+    // problems
+    vector<int> score = {1201, 1204, 1179, 2332};
+    vector<int> len1 = {294, 294, 294, 1801};
+    vector<int> len2 = {422, 416, 418, 1671};
+
+    kbp = Blast_KarlinBlkNew();
+    gbp = (Blast_GumbelBlk*)calloc(1, sizeof(Blast_GumbelBlk));
+
+    Blast_KarlinBlkGappedCalc(kbp, kGapOpen, kGapExtend, kMatrix, &error);
+    Blast_GumbelBlkCalc(gbp, kGapOpen, kGapExtend, kMatrix, &error);
+
+    for (size_t i=0;i < score.size();i++) {
+        double evalue = BLAST_SpougeStoE(score[i], kbp, gbp, len1[i], len2[i]);
+        BOOST_REQUIRE(evalue >= 0.0);
+    }
+
+    kbp = Blast_KarlinBlkFree(kbp);
+    if (gbp) {
+        free(gbp);
+    }
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/c++/src/algo/blast/unit_tests/api/uniform_search_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/uniform_search_unit_test.cpp
index 73a7a47..cd20359 100644
--- a/c++/src/algo/blast/unit_tests/api/uniform_search_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/uniform_search_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: uniform_search_unit_test.cpp 188650 2010-04-13 16:11:28Z maning $
+/*  $Id: uniform_search_unit_test.cpp 482580 2015-10-23 21:21:09Z whlavina $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -239,8 +239,8 @@ BOOST_AUTO_TEST_CASE(MultipleProteinSearch) {
 BOOST_AUTO_TEST_CASE(SearchDatabase_RestrictionGiList)
 {
     CSeqDBGiList gis;
-    gis.AddGi(1);
-    gis.AddGi(5);
+    gis.AddGi(GI_CONST(1));
+    gis.AddGi(GI_CONST(5));
     CSearchDatabase db("junk", CSearchDatabase::eBlastDbIsProtein);
     db.SetGiList(&gis);
     BOOST_REQUIRE_THROW(db.SetNegativeGiList(&gis), CBlastException);
@@ -249,8 +249,8 @@ BOOST_AUTO_TEST_CASE(SearchDatabase_RestrictionGiList)
 BOOST_AUTO_TEST_CASE(SearchDatabase_Restriction)
 {
     CSeqDBGiList gis;
-    gis.AddGi(1);
-    gis.AddGi(5);
+    gis.AddGi(GI_CONST(1));
+    gis.AddGi(GI_CONST(5));
     CSearchDatabase db("junk", CSearchDatabase::eBlastDbIsProtein);
     db.SetNegativeGiList(&gis);
     BOOST_REQUIRE_THROW(db.SetGiList(&gis), CBlastException);
diff --git a/c++/src/algo/blast/unit_tests/api/version_reference_unit_test.cpp b/c++/src/algo/blast/unit_tests/api/version_reference_unit_test.cpp
index 336d11d..5f1bb6d 100644
--- a/c++/src/algo/blast/unit_tests/api/version_reference_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/api/version_reference_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: version_reference_unit_test.cpp 484536 2015-11-12 16:04:07Z ivanov $
+/*  $Id: version_reference_unit_test.cpp 500531 2016-05-05 14:28:38Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_SUITE(version_reference)
 
 BOOST_AUTO_TEST_CASE(testVersion) {
     const int kMajor = 2;
-    const int kMinor = 3;
+    const int kMinor = 4;
     const int kPatch = 0;
     blast::CBlastVersion v;
     BOOST_REQUIRE_EQUAL(kMajor, v.GetMajor());
diff --git a/c++/src/algo/blast/unit_tests/blast_format/seqalignfilter_unit_test.cpp b/c++/src/algo/blast/unit_tests/blast_format/seqalignfilter_unit_test.cpp
index 8b68dd4..b184d4a 100644
--- a/c++/src/algo/blast/unit_tests/blast_format/seqalignfilter_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/blast_format/seqalignfilter_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqalignfilter_unit_test.cpp 482678 2015-10-26 14:19:24Z ivanov $
+/*  $Id: seqalignfilter_unit_test.cpp 489876 2016-01-19 15:33:56Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -297,8 +297,8 @@ BOOST_AUTO_TEST_CASE(s_TestDBBasedFiltering)
     CSeqAlignFilter filter;
     CRef<CSeqDB> db;
 
-    BOOST_REQUIRE_NO_THROW(db = filter.PrepareSeqDB(db_name, use_prot, fname_gis);)
-    BOOST_REQUIRE_NO_THROW(filter.FilterSeqalignsExt(fname_in, fname_out, db);)
+    BOOST_REQUIRE_NO_THROW(db = filter.PrepareSeqDB(db_name, use_prot, fname_gis););
+    BOOST_REQUIRE_NO_THROW(filter.FilterSeqalignsExt(fname_in, fname_out, db););
 
     // check the results
 
diff --git a/c++/src/algo/blast/unit_tests/seqdb_reader/data/big_gi.pnd b/c++/src/algo/blast/unit_tests/seqdb_reader/data/big_gi.pnd
new file mode 100644
index 0000000..281b3b5
Binary files /dev/null and b/c++/src/algo/blast/unit_tests/seqdb_reader/data/big_gi.pnd differ
diff --git a/c++/src/algo/blast/unit_tests/seqdb_reader/data/big_gi.pni b/c++/src/algo/blast/unit_tests/seqdb_reader/data/big_gi.pni
new file mode 100644
index 0000000..d9cc0db
Binary files /dev/null and b/c++/src/algo/blast/unit_tests/seqdb_reader/data/big_gi.pni differ
diff --git a/c++/src/algo/blast/unit_tests/seqdb_reader/seqdb_unit_test.cpp b/c++/src/algo/blast/unit_tests/seqdb_reader/seqdb_unit_test.cpp
index 7dc2042..d98d545 100644
--- a/c++/src/algo/blast/unit_tests/seqdb_reader/seqdb_unit_test.cpp
+++ b/c++/src/algo/blast/unit_tests/seqdb_reader/seqdb_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdb_unit_test.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdb_unit_test.cpp 488259 2015-12-29 14:32:15Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -40,6 +40,7 @@
 #include <corelib/ncbifile.hpp>
 #include <util/sequtil/sequtil_convert.hpp>
 #include <objmgr/util/sequence.hpp>
+#include <objtools/blast/seqdb_reader/impl/seqdbisam.hpp>
 #include <math.h>
 
 #include <util/sequtil/sequtil_convert.hpp>
@@ -903,8 +904,8 @@ BOOST_AUTO_TEST_CASE(TranslateIdents)
 
 BOOST_AUTO_TEST_CASE(StringIdentSearch)
 {
-
-    CSeqDB nr("nr", CSeqDB::eProtein);
+    const string kDb("nr");
+    CSeqDB nr(kDb, CSeqDB::eProtein);
 
     // Sets of equivalent strings
 
@@ -1011,11 +1012,8 @@ BOOST_AUTO_TEST_CASE(StringIdentSearch)
             int oid1(-1);
             bool worked = nr.GiToOid(*gip, oid1);
 
-            if (! worked) {
-                cerr << "Failing GI is " << *gip << endl;
-            }
-
-            BOOST_REQUIRE(worked);
+            BOOST_REQUIRE_MESSAGE(worked, "Failed to find GI " << *gip 
+                                  << " in " << kDb);
 
             gi_oids.insert(oid1);
         }
@@ -1024,7 +1022,8 @@ BOOST_AUTO_TEST_CASE(StringIdentSearch)
             vector<int> oids;
             nr.AccessionToOids(*strp, oids);
 
-            BOOST_REQUIRE(! oids.empty());
+            BOOST_REQUIRE_MESSAGE(! oids.empty(), "Failed to find accession " 
+                                  << *strp << " in " << kDb);
 
             ITERATE(vector<int>, iter, oids) {
                 str_oids.insert(*iter);
@@ -3694,7 +3693,7 @@ BOOST_AUTO_TEST_CASE(FilteredHeaders)
 static void s_CheckIdLookup(CSeqDB & db, const string & acc, size_t exp_oids, size_t exp_size)
 {
     list<string> ids;
-    NStr::Split(acc, ", ", ids);
+    NStr::Split(acc, ", ", ids, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     vector<int> oids;
 
@@ -4339,7 +4338,7 @@ BOOST_AUTO_TEST_CASE(CWgsTrimmerLongExample)
     //const string wgs_dbs = s_ReadWgsDbs("dbs.txt");
     //const string gis_in_wgs_results = "gis.out";
     vector<string> tokens;
-    NStr::Tokenize(wgs_dbs, " ", tokens);
+    NStr::Split(wgs_dbs, " ", tokens, NStr::fSplit_NoMergeDelims);
     const int orig_num_dbs = tokens.size();
     tokens.clear();
 
@@ -4356,7 +4355,7 @@ BOOST_AUTO_TEST_CASE(CWgsTrimmerLongExample)
     //const string kExpectedResult = wgs_dbs;
     const string kExpectedResult = trimmer.GetDbList();
     const string kActualResult = trimmer.GetDbList();
-    NStr::Tokenize(kActualResult, " ", tokens);
+    NStr::Split(kActualResult, " ", tokens, NStr::fSplit_NoMergeDelims);
     const int actual_num_dbs = tokens.size();
     BOOST_CHECK_EQUAL(kExpectedNumDbs, actual_num_dbs);
     BOOST_CHECK_GE(orig_num_dbs, actual_num_dbs);
@@ -4417,6 +4416,58 @@ BOOST_AUTO_TEST_CASE(SingleTaxidBlastDefLine)
     BOOST_CHECK(bdl.GetLeafTaxIds().size() == 2);
 }
 
+BOOST_AUTO_TEST_CASE(CSeqDBIsam_32bit_GI)
+{
+    // OIDs stored in database.
+    const int oids[] = {
+            0x7acee466, 0x4cbc1ab0,
+            0x7d219922, 0x7e096431,
+            0x276283ea, 0x13cee382,
+            0x51f8b267, 0x37183674,
+            0x03559cd6, 0x6bdcfbb7
+    };
+    const Uint4 nrecs = (Uint4) (sizeof oids / sizeof oids[0]);
+
+    // Open database for reading.
+    CSeqDBAtlas atlas(true);
+    CSeqDBLockHold lock(atlas);
+    CRef<CSeqDBIsam> rdb(
+            new CSeqDBIsam(
+                    atlas,
+                    "data/big_gi",
+                    'p',
+                    'n',
+                    eGiId
+            )
+    );
+
+    // Define a value that's too large to fit in a signed int without rollover.
+    const Uint4 big_gi = 3L * 1024L * 1024L * 1024L;    // 3 "billion"
+
+    for (Uint4 i = 0; i < nrecs; ++i) {
+        TGi gi = GI_FROM(Uint4, (big_gi + i));
+#ifndef NCBI_INT8_GI
+        BOOST_REQUIRE_THROW(
+                CSeq_id(CSeq_id::e_Gi, GI_TO(TIntId, gi)),
+                CException
+        );
+        return;
+#else
+        try {
+            CRef<CSeq_id> seqid(
+                    new CSeq_id(CSeq_id::e_Gi, GI_TO(TIntId, gi))
+            );
+            int oid;
+            rdb->IdToOid(GI_TO(long, seqid->GetGi()), oid, lock);
+            BOOST_REQUIRE(oid == oids[i]);
+        } catch (...) {
+            BOOST_FAIL("CSeq_id constructor threw exception");
+            return;
+        }
+#endif
+    }
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
diff --git a/c++/src/algo/winmask/win_mask_gen_counts.cpp b/c++/src/algo/winmask/win_mask_gen_counts.cpp
index e99df7d..587b9a4 100644
--- a/c++/src/algo/winmask/win_mask_gen_counts.cpp
+++ b/c++/src/algo/winmask/win_mask_gen_counts.cpp
@@ -1,4 +1,4 @@
-/*  $Id: win_mask_gen_counts.cpp 462550 2015-03-19 14:07:19Z morgulis $
+/*  $Id: win_mask_gen_counts.cpp 484868 2015-11-16 19:29:56Z mozese2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -220,7 +220,7 @@ void CWinMaskCountsGenerator::operator()()
     vector< string > file_list;
 
     if( !use_list ) {
-        NStr::Tokenize(input, ",", file_list);
+        NStr::Split(input, ",", file_list);
     } else {
         string line;
         CNcbiIfstream fl_stream( input.c_str() );
diff --git a/c++/src/app/Makefile.in b/c++/src/app/Makefile.in
index 6ef8259..615e6e6 100644
--- a/c++/src/app/Makefile.in
+++ b/c++/src/app/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in 485953 2015-11-30 17:53:34Z blastadm $
+# $Id: Makefile.in 490144 2016-01-21 16:27:21Z bollin $
 
 # Miscellaneous applications
 #################################
@@ -12,9 +12,9 @@ SUB_PROJ = asn2asn asn2fasta asn2flat asnval asn_cleanup \
            multireader read_blast_result splign hfilter \
            annotwriter compart streamtest lds2_indexer \
            discrep_report discrepancy_report biosample_chk gap_stats table2asn \
-           srcchk tableval ncbi_encrypt
+           srcchk tableval ncbi_encrypt ssub_fork
 
-EXPENDABLE_SUB_PROJ = split_cache wig2table netcache rmblastn dblb
+EXPENDABLE_SUB_PROJ = split_cache wig2table netcache rmblastn dblb tls
 
 REQUIRES = app
 
diff --git a/c++/src/app/blast/Makefile.blastn.app b/c++/src/app/blast/Makefile.blastn.app
index 0692bf2..fd0e731 100644
--- a/c++/src/app/blast/Makefile.blastn.app
+++ b/c++/src/app/blast/Makefile.blastn.app
@@ -1,4 +1,4 @@
-# $Id: Makefile.blastn.app 475019 2015-08-04 13:26:53Z ivanov $
+# $Id: Makefile.blastn.app 474746 2015-07-31 13:51:46Z madden $
 
 WATCHERS = camacho madden fongah2
 
diff --git a/c++/src/app/blast/blast_app_util.cpp b/c++/src/app/blast/blast_app_util.cpp
index d52bef0..f40fa93 100644
--- a/c++/src/app/blast/blast_app_util.cpp
+++ b/c++/src/app/blast/blast_app_util.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_app_util.cpp 485060 2015-11-18 16:07:34Z ivanov $
+/*  $Id: blast_app_util.cpp 500374 2016-05-04 13:30:40Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_app_util.cpp 485060 2015-11-18 16:07:34Z ivanov $";
+    "$Id: blast_app_util.cpp 500374 2016-05-04 13:30:40Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -59,6 +59,8 @@ static char const rcsid[] =
 #include <objects/scoremat/Pssm.hpp>
 #include <serial/typeinfo.hpp>      // for CTypeInfo, needed by SerialClone
 #include <objtools/data_loaders/blastdb/bdbloader_rmt.hpp>
+#include <algo/blast/format/blast_format.hpp>
+#include <objtools/align_format/format_flags.hpp>
 
 BEGIN_NCBI_SCOPE
 USING_SCOPE(objects);
@@ -157,14 +159,14 @@ InitializeQueryDataLoaderConfiguration(bool query_is_protein,
         (query_is_protein == db_adapter->IsProtein())) { /* the same database type is used for both queries and subjects */
         // Make sure we don't add the same database more than once
         vector<string> default_dbs;
-        NStr::Tokenize(retval.m_BlastDbName, " ", default_dbs);
+        NStr::Split(retval.m_BlastDbName, " ", default_dbs, NStr::fSplit_NoMergeDelims);
         if (default_dbs.size() &&
             (find(default_dbs.begin(), default_dbs.end(),
                  db_adapter->GetDatabaseName()) == default_dbs.end())) {
-        CNcbiOstrstream oss;
-        oss << db_adapter->GetDatabaseName() << " " << retval.m_BlastDbName;
-        retval.m_BlastDbName = CNcbiOstrstreamToString(oss);
-    }
+            CNcbiOstrstream oss;
+            oss << db_adapter->GetDatabaseName() << " " << retval.m_BlastDbName;
+            retval.m_BlastDbName = CNcbiOstrstreamToString(oss);
+        }
     }
     if (retval.m_UseBlastDbs) {
         _TRACE("Initializing query data loader to '" << retval.m_BlastDbName 
@@ -808,7 +810,7 @@ CheckForFreqRatioFile(const string& rps_dbname, CRef<CBlastOptionsHandle>  & opt
     bool use_cbs = (opt_handle->GetOptions().GetCompositionBasedStats() == eNoCompositionBasedStats) ? false : true;
     if(use_cbs) {
         vector<string> db;
-        NStr::Tokenize(rps_dbname, " ", db);
+        NStr::Split(rps_dbname, " ", db, NStr::fSplit_NoMergeDelims);
         list<string> failed_db;
         for (unsigned int i=0; i < db.size(); i++) {
     	    string path;
@@ -901,6 +903,62 @@ GetSubjectFile(const CArgs& args)
 }
 
 
+void CBlastAppDiagHandler::Post(const SDiagMessage & mess)
+{
+	if(m_handler != NULL) {
+		m_handler->Post(mess);
+	}
+	if(m_save) {
+		CRef<CBlast4_error> d(new CBlast4_error);
+		string m;
+		mess.Write(m);
+		d->SetMessage(NStr::Sanitize(m));
+		d->SetCode((int)mess.m_Severity);
+		{
+			DEFINE_STATIC_MUTEX(mx);
+			CMutexGuard guard(mx);
+			m_messages.push_back(d);
+		}
+	}
+}
+
+void CBlastAppDiagHandler::ResetMessages()
+{
+	DEFINE_STATIC_MUTEX(mx);
+	CMutexGuard guard(mx);
+	m_messages.clear();
+}
+
+CBlastAppDiagHandler::~CBlastAppDiagHandler()
+{
+	if(m_handler) {
+		SetDiagHandler(m_handler);
+		m_handler = NULL;
+	}
+}
+
+void CBlastAppDiagHandler::DoNotSaveMessages(void)
+{
+	m_save = false;
+	ResetMessages();
+}
 
+void PrintErrorArchive(const CArgs & a, const list<CRef<CBlast4_error> > & msg)
+{
+	try {
+		if(NStr::StringToInt(NStr::TruncateSpaces(a[align_format::kArgOutputFormat].AsString())) == CFormattingArgs::eArchiveFormat) {
+			CRef<CBlast4_archive> archive (new CBlast4_archive);
+
+			CBlast4_request & req = archive->SetRequest();
+			CBlast4_get_request_info_request & info= req.SetBody().SetGet_request_info();
+			info.SetRequest_id("Error");
+			CBlast4_get_search_results_reply & results = archive->SetResults();
+                        // Pacify unused varaible warning, the set above is used to populate mandatory field
+			(void) results;
+			archive->SetMessages() = msg;
+			CBlastFormat::PrintArchive(archive, a[kArgOutput].AsOutputFile());
+		}
+	} catch (...) {}
+}
 
 END_NCBI_SCOPE
diff --git a/c++/src/app/blast/blast_app_util.hpp b/c++/src/app/blast/blast_app_util.hpp
index 0e3e0e9..6abed4f 100644
--- a/c++/src/app/blast/blast_app_util.hpp
+++ b/c++/src/app/blast/blast_app_util.hpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_app_util.hpp 482743 2015-10-26 16:39:57Z ivanov $
+/*  $Id: blast_app_util.hpp 495291 2016-03-16 14:52:25Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -302,6 +302,34 @@ UseXInclude(const blast::CFormattingArgs & f, const string & s);
 string
 GetSubjectFile(const CArgs& args);
 
+/// Class to capture message from diag handler
+class CBlastAppDiagHandler : public CDiagHandler
+{
+public:
+	/// Constructor
+	CBlastAppDiagHandler():m_handler(GetDiagHandler(true)), m_save (true) {}
+	/// Destructor
+	~CBlastAppDiagHandler();
+	/// Save and post diag message
+	virtual void Post (const SDiagMessage & mess);
+	/// Reset messgae buffer, erase all saved message
+	void ResetMessages(void);
+	/// Call to turn off saving diag message, discard all saved message
+	void DoNotSaveMessages(void);
+	/// Return list of saved diag messages
+	list<CRef<CBlast4_error> > & GetMessages(void) { return m_messages;}
+private :
+	CDiagHandler * m_handler;
+	list<CRef<CBlast4_error> > m_messages;
+	bool m_save;
+};
+
+/// Function to print blast archive with only error messages (search failed)
+/// to output stream
+/// @param a cmdline args [in]
+/// @param msg list of errors and warning to be added to blast4 archive for printing
+void PrintErrorArchive(const CArgs & a, const list<CRef<CBlast4_error> > & msg);
+
 END_NCBI_SCOPE
 
 #endif /* APP__BLAST_APP_UTIL__HPP */
diff --git a/c++/src/app/blast/blast_formatter.cpp b/c++/src/app/blast/blast_formatter.cpp
index 4ed21af..5eeaaa0 100644
--- a/c++/src/app/blast/blast_formatter.cpp
+++ b/c++/src/app/blast/blast_formatter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blast_formatter.cpp 485060 2015-11-18 16:07:34Z ivanov $
+/*  $Id: blast_formatter.cpp 495294 2016-03-16 14:53:17Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blast_formatter.cpp 485060 2015-11-18 16:07:34Z ivanov $";
+    "$Id: blast_formatter.cpp 495294 2016-03-16 14:53:17Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -402,6 +402,7 @@ int CBlastFormatterApp::Run(void)
     const CArgs& args = GetArgs();
 
     try {
+        SetDiagPostLevel(eDiag_Warning);
         if (args[kArgArchive].HasValue()) {
             CNcbiIstream& istr = args[kArgArchive].AsInputFile();
             try { m_RmtBlast.Reset(new CRemoteBlast(istr)); }
@@ -414,8 +415,11 @@ int CBlastFormatterApp::Run(void)
 
 	    m_LoadFromArchive = true;
             try {
-                while (m_RmtBlast->LoadFromArchive())
-                    status = PrintFormattedOutput();
+                while (m_RmtBlast->LoadFromArchive()) {
+                	if(!m_RmtBlast->IsErrMsgArchive()) {
+                		status = PrintFormattedOutput();
+                	}
+                }
             } catch (const CSerialException& e) {
                 NCBI_RETHROW(e, CInputException, eInvalidInput,
                              "Invalid input format for BLAST Archive.");
diff --git a/c++/src/app/blast/blastn_app.cpp b/c++/src/app/blast/blastn_app.cpp
index e9ce820..78ed419 100644
--- a/c++/src/app/blast/blastn_app.cpp
+++ b/c++/src/app/blast/blastn_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastn_app.cpp 484400 2015-11-10 18:12:56Z ivanov $
+/*  $Id: blastn_app.cpp 495294 2016-03-16 14:53:17Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-	"$Id: blastn_app.cpp 484400 2015-11-10 18:12:56Z ivanov $";
+	"$Id: blastn_app.cpp 495294 2016-03-16 14:53:17Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -86,15 +86,18 @@ void CBlastnApp::Init()
 int CBlastnApp::Run(void)
 {
     int status = BLAST_EXIT_SUCCESS;
+    CBlastAppDiagHandler bah;
 
     try {
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
         SetDiagPostPrefix("blastn");
+        SetDiagHandler(&bah, false);
 
         /*** Get the BLAST options ***/
         const CArgs& args = GetArgs();
+
         CRef<CBlastOptionsHandle> opts_hndl;
         if(RecoverSearchStrategy(args, m_CmdLineArgs)){
         	opts_hndl.Reset(&*m_CmdLineArgs->SetOptionsForSavedStrategy(args));
@@ -137,6 +140,10 @@ int CBlastnApp::Run(void)
         }
         /*** Get the formatting options ***/
         CRef<CFormattingArgs> fmt_args(m_CmdLineArgs->GetFormattingArgs());
+        bool isArchiveFormat = fmt_args->ArchiveFormatRequested(args);
+        if(!isArchiveFormat) {
+        	bah.DoNotSaveMessages();
+        }
         CBlastFormat formatter(opt, *db_adapter,
                                fmt_args->GetFormattedOutputChoice(),
                                query_opts->GetParseDeflines(),
@@ -202,8 +209,9 @@ int CBlastnApp::Run(void)
                     input.SetBatchSize(mixer.GetBatchSize(lcl_blast.GetNumExtensions()));
             }
 
-            if (fmt_args->ArchiveFormatRequested(args)) {
-                formatter.WriteArchive(*queries, *opts_hndl, *results);
+            if (isArchiveFormat) {
+                formatter.WriteArchive(*queries, *opts_hndl, *results, 0, bah.GetMessages());
+                bah.ResetMessages();
             } else {
                 BlastFormatter_PreFetchSequenceData(*results, scope);
                 ITERATE(CSearchResultSet, result, *results) {
@@ -219,6 +227,11 @@ int CBlastnApp::Run(void)
         }
 
     } CATCH_ALL(status)
+
+    if(!bah.GetMessages().empty()) {
+    	const CArgs & a = GetArgs();
+    	PrintErrorArchive(a, bah.GetMessages());
+    }
     return status;
 }
 
diff --git a/c++/src/app/blast/blastp_app.cpp b/c++/src/app/blast/blastp_app.cpp
index 7abf18b..5369ac3 100644
--- a/c++/src/app/blast/blastp_app.cpp
+++ b/c++/src/app/blast/blastp_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastp_app.cpp 484400 2015-11-10 18:12:56Z ivanov $
+/*  $Id: blastp_app.cpp 495295 2016-03-16 14:53:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-	"$Id: blastp_app.cpp 484400 2015-11-10 18:12:56Z ivanov $";
+	"$Id: blastp_app.cpp 495295 2016-03-16 14:53:41Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -86,12 +86,14 @@ void CBlastpApp::Init()
 int CBlastpApp::Run(void)
 {
     int status = BLAST_EXIT_SUCCESS;
+    CBlastAppDiagHandler bah;
 
     try {
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
         SetDiagPostPrefix("blastp");
+        SetDiagHandler(&bah, false);
 
         /*** Get the BLAST options ***/
         const CArgs& args = GetArgs();
@@ -133,6 +135,10 @@ int CBlastpApp::Run(void)
 
         /*** Get the formatting options ***/
         CRef<CFormattingArgs> fmt_args(m_CmdLineArgs->GetFormattingArgs());
+        bool isArchiveFormat = fmt_args->ArchiveFormatRequested(args);
+        if(!isArchiveFormat) {
+           	bah.DoNotSaveMessages();
+        }
         CBlastFormat formatter(opt, *db_adapter,
                                fmt_args->GetFormattedOutputChoice(),
                                query_opts->GetParseDeflines(),
@@ -183,7 +189,8 @@ int CBlastpApp::Run(void)
             }
 
             if (fmt_args->ArchiveFormatRequested(args)) {
-                formatter.WriteArchive(*queries, *opts_hndl, *results);
+                formatter.WriteArchive(*queries, *opts_hndl, *results,  0, bah.GetMessages());
+                bah.ResetMessages();
             } else {
                 BlastFormatter_PreFetchSequenceData(*results, scope);
                 ITERATE(CSearchResultSet, result, *results) {
@@ -199,6 +206,10 @@ int CBlastpApp::Run(void)
         }
 
     } CATCH_ALL(status)
+    if(!bah.GetMessages().empty()) {
+       	const CArgs & a = GetArgs();
+       	PrintErrorArchive(a, bah.GetMessages());
+    }
     return status;
 }
 
diff --git a/c++/src/app/blast/blastx_app.cpp b/c++/src/app/blast/blastx_app.cpp
index 3037eb9..b215164 100644
--- a/c++/src/app/blast/blastx_app.cpp
+++ b/c++/src/app/blast/blastx_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastx_app.cpp 484400 2015-11-10 18:12:56Z ivanov $
+/*  $Id: blastx_app.cpp 495295 2016-03-16 14:53:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-	"$Id: blastx_app.cpp 484400 2015-11-10 18:12:56Z ivanov $";
+	"$Id: blastx_app.cpp 495295 2016-03-16 14:53:41Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -86,12 +86,14 @@ void CBlastxApp::Init()
 int CBlastxApp::Run(void)
 {
     int status = BLAST_EXIT_SUCCESS;
+    CBlastAppDiagHandler bah;
 
     try {
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
-	SetDiagPostPrefix("blastx");
+        SetDiagPostPrefix("blastx");
+        SetDiagHandler(&bah, false);
 
         /*** Get the BLAST options ***/
         const CArgs& args = GetArgs();
@@ -131,6 +133,10 @@ int CBlastxApp::Run(void)
 
         /*** Get the formatting options ***/
         CRef<CFormattingArgs> fmt_args(m_CmdLineArgs->GetFormattingArgs());
+        bool isArchiveFormat = fmt_args->ArchiveFormatRequested(args);
+        if(!isArchiveFormat) {
+           	bah.DoNotSaveMessages();
+        }
         CBlastFormat formatter(opt, *db_adapter,
                                fmt_args->GetFormattedOutputChoice(),
                                query_opts->GetParseDeflines(),
@@ -181,7 +187,8 @@ int CBlastxApp::Run(void)
             }
 
             if (fmt_args->ArchiveFormatRequested(args)) {
-                formatter.WriteArchive(*queries, *opts_hndl, *results);
+                formatter.WriteArchive(*queries, *opts_hndl, *results, 0, bah.GetMessages());
+                bah.ResetMessages();
             } else {
                 BlastFormatter_PreFetchSequenceData(*results, scope);
             	ITERATE(CSearchResultSet, result, *results) {
@@ -197,6 +204,10 @@ int CBlastxApp::Run(void)
         }
 
     } CATCH_ALL(status)
+    if(!bah.GetMessages().empty()) {
+       	const CArgs & a = GetArgs();
+       	PrintErrorArchive(a, bah.GetMessages());
+    }
     return status;
 }
 
diff --git a/c++/src/app/blast/deltablast_app.cpp b/c++/src/app/blast/deltablast_app.cpp
index 8ca7455..c6f6d84 100644
--- a/c++/src/app/blast/deltablast_app.cpp
+++ b/c++/src/app/blast/deltablast_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: deltablast_app.cpp 483793 2015-11-04 11:13:41Z ivanov $
+/*  $Id: deltablast_app.cpp 495295 2016-03-16 14:53:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-        "$Id: deltablast_app.cpp 483793 2015-11-04 11:13:41Z ivanov $";
+        "$Id: deltablast_app.cpp 495295 2016-03-16 14:53:41Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -103,6 +103,8 @@ private:
     CRef<CDeltaBlastAppArgs> m_CmdLineArgs;
 
     CRef<CBlastAncillaryData> m_AncillaryData;
+
+    CBlastAppDiagHandler m_bah;
 };
 
 void CDeltaBlastApp::Init()
@@ -195,7 +197,8 @@ int CDeltaBlastApp::Run(void)
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
-	SetDiagPostPrefix("deltablast");
+	    SetDiagPostPrefix("deltablast");
+        SetDiagHandler(&m_bah, false);
 
         /*** Get the BLAST options ***/
         const CArgs& args = GetArgs();
@@ -351,7 +354,8 @@ int CDeltaBlastApp::Run(void)
                 }
 
                 if (fmt_args->ArchiveFormatRequested(args)) {
-                    formatter.WriteArchive(*queries, *opts_hndl, *results);
+                    formatter.WriteArchive(*queries, *opts_hndl, *results, 0, m_bah.GetMessages());
+                    m_bah.ResetMessages();
                 } else {
                     BlastFormatter_PreFetchSequenceData(*results, scope);
                     if (m_CmdLineArgs->GetShowDomainHits()) {
@@ -440,6 +444,10 @@ int CDeltaBlastApp::Run(void)
         }
 
     } CATCH_ALL(status)
+    if(!m_bah.GetMessages().empty()) {
+     	const CArgs & a = GetArgs();
+     	PrintErrorArchive(a, m_bah.GetMessages());
+    }
     return status;
 }
 
@@ -473,7 +481,8 @@ CDeltaBlastApp::DoPsiBlastIterations(CRef<CBlastOptionsHandle> opts_hndl,
     if (CFormattingArgs::eArchiveFormat ==
         m_CmdLineArgs->GetFormattingArgs()->GetFormattedOutputChoice()) {
         formatter.WriteArchive(*query_factory, *opts_hndl, *results,
-                               itr.GetIterationNumber());
+                               itr.GetIterationNumber(), m_bah.GetMessages());
+        m_bah.ResetMessages();
     }
     else {
         ITERATE(blast::CSearchResultSet, result, *results) {
diff --git a/c++/src/app/blast/psiblast_app.cpp b/c++/src/app/blast/psiblast_app.cpp
index b3a0eb6..0b33701 100644
--- a/c++/src/app/blast/psiblast_app.cpp
+++ b/c++/src/app/blast/psiblast_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: psiblast_app.cpp 483791 2015-11-04 11:12:47Z ivanov $
+/*  $Id: psiblast_app.cpp 495295 2016-03-16 14:53:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-        "$Id: psiblast_app.cpp 483791 2015-11-04 11:12:47Z ivanov $";
+        "$Id: psiblast_app.cpp 495295 2016-03-16 14:53:41Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -116,6 +116,8 @@ private:
     CRef<CPsiBlastAppArgs> m_CmdLineArgs;
     /// Ancillary results for the previously executed PSI-BLAST iteration
     CConstRef<CBlastAncillaryData> m_AncillaryData;
+
+    CBlastAppDiagHandler m_bah;
 };
 
 void CPsiBlastApp::Init()
@@ -259,11 +261,13 @@ CPsiBlastApp::x_RunLocalPsiBlastIterations(CRef<CBlastQueryVector> query,
                    {
                 	   if (pssm.Empty() && !query.Empty())
                 	   {
-                		   formatter.WriteArchive(*query_factory, *opts_hndl, *results, itr.GetIterationNumber());
+                		   formatter.WriteArchive(*query_factory, *opts_hndl, *results, itr.GetIterationNumber(), m_bah.GetMessages());
+                           m_bah.ResetMessages();
                 	   }
                 	   else if (!pssm.Empty())
                 	   {
-                		   formatter.WriteArchive(*pssm, *opts_hndl, *results, itr.GetIterationNumber());
+                		   formatter.WriteArchive(*pssm, *opts_hndl, *results, itr.GetIterationNumber(), m_bah.GetMessages());
+                           m_bah.ResetMessages();
                 	   }
                    }
                    else
@@ -345,11 +349,13 @@ CPsiBlastApp::DoIterations(CRef<CBlastOptionsHandle> opts_hndl,
         {
             if (pssm.Empty() && !query.Empty())
             {
-                formatter.WriteArchive(*query_factory, *opts_hndl, *results );
+                formatter.WriteArchive(*query_factory, *opts_hndl, *results, 0, m_bah.GetMessages());
+                m_bah.ResetMessages();
             }
             else if (!pssm.Empty())
             {
-                formatter.WriteArchive(*pssm, *opts_hndl, *results);
+                formatter.WriteArchive(*pssm, *opts_hndl, *results, 0, m_bah.GetMessages());
+                m_bah.ResetMessages();
             }
         }
         else
@@ -403,7 +409,8 @@ int CPsiBlastApp::Run(void)
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
-	SetDiagPostPrefix("psiblast");
+        SetDiagPostPrefix("psiblast");
+        SetDiagHandler(&m_bah, false);
 
         const CArgs& args = GetArgs();
         const bool recovered_from_search_strategy =
@@ -458,6 +465,10 @@ int CPsiBlastApp::Run(void)
 
         /*** Get the formatting options ***/
         CRef<CFormattingArgs> fmt_args(m_CmdLineArgs->GetFormattingArgs());
+        bool isArchiveFormat = fmt_args->ArchiveFormatRequested(args);
+        if(!isArchiveFormat) {
+        	m_bah.DoNotSaveMessages();
+        }
         CNcbiOstream& out_stream = m_CmdLineArgs->GetOutputStream();
         CBlastFormat formatter(opt, *db_adapter,
                                fmt_args->GetFormattedOutputChoice(),
@@ -545,6 +556,10 @@ int CPsiBlastApp::Run(void)
             opts_hndl->GetOptions().DebugDumpText(NcbiCerr, "BLAST options", 1);
 
     } CATCH_ALL(status)
+    if(!m_bah.GetMessages().empty()) {
+    	const CArgs & a = GetArgs();
+    	PrintErrorArchive(a, m_bah.GetMessages());
+    }
     return status;
 }
 
diff --git a/c++/src/app/blast/rpsblast_app.cpp b/c++/src/app/blast/rpsblast_app.cpp
index 52e30b6..37e5ca7 100644
--- a/c++/src/app/blast/rpsblast_app.cpp
+++ b/c++/src/app/blast/rpsblast_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: rpsblast_app.cpp 482743 2015-10-26 16:39:57Z ivanov $
+/*  $Id: rpsblast_app.cpp 495295 2016-03-16 14:53:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-	"$Id: rpsblast_app.cpp 482743 2015-10-26 16:39:57Z ivanov $";
+	"$Id: rpsblast_app.cpp 495295 2016-03-16 14:53:41Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -88,12 +88,14 @@ void CRPSBlastApp::Init()
 int CRPSBlastApp::Run(void)
 {
     int status = BLAST_EXIT_SUCCESS;
+    CBlastAppDiagHandler bah;
 
     try {
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
-	SetDiagPostPrefix("rpsblast");
+        SetDiagPostPrefix("rpsblast");
+        SetDiagHandler(&bah, false);
 
         /*** Get the BLAST options ***/
         const CArgs& args = GetArgs();
@@ -136,6 +138,10 @@ int CRPSBlastApp::Run(void)
 
         /*** Get the formatting options ***/
         CRef<CFormattingArgs> fmt_args(m_CmdLineArgs->GetFormattingArgs());
+        bool isArchiveFormat = fmt_args->ArchiveFormatRequested(args);
+        if(!isArchiveFormat) {
+        	bah.DoNotSaveMessages();
+        }
         CBlastFormat formatter(opt, *db_adapter,
                                fmt_args->GetFormattedOutputChoice(),
                                query_opts->GetParseDeflines(),
@@ -187,7 +193,8 @@ int CRPSBlastApp::Run(void)
             }
 
             if (fmt_args->ArchiveFormatRequested(args)) {
-                formatter.WriteArchive(*queries, *opts_hndl, *results);
+                formatter.WriteArchive(*queries, *opts_hndl, *results, 0, bah.GetMessages());
+                bah.ResetMessages();
             } else {
                BlastFormatter_PreFetchSequenceData(*results, scope);
                 ITERATE(CSearchResultSet, result, *results) {
@@ -203,6 +210,10 @@ int CRPSBlastApp::Run(void)
         }
 
     } CATCH_ALL(status)
+    if(!bah.GetMessages().empty()) {
+    	const CArgs & a = GetArgs();
+    	PrintErrorArchive(a, bah.GetMessages());
+    }
     return status;
 }
 
diff --git a/c++/src/app/blast/rpstblastn_app.cpp b/c++/src/app/blast/rpstblastn_app.cpp
index da3aba5..f30ad75 100644
--- a/c++/src/app/blast/rpstblastn_app.cpp
+++ b/c++/src/app/blast/rpstblastn_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: rpstblastn_app.cpp 482743 2015-10-26 16:39:57Z ivanov $
+/*  $Id: rpstblastn_app.cpp 495295 2016-03-16 14:53:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-	"$Id: rpstblastn_app.cpp 482743 2015-10-26 16:39:57Z ivanov $";
+	"$Id: rpstblastn_app.cpp 495295 2016-03-16 14:53:41Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -88,6 +88,7 @@ void CRPSTBlastnApp::Init()
 int CRPSTBlastnApp::Run(void)
 {
     int status = BLAST_EXIT_SUCCESS;
+    CBlastAppDiagHandler bah;
 
     try {
         // Limit the amount of memory used by CSeqDB so that the RPS-BLAST
@@ -96,7 +97,8 @@ int CRPSTBlastnApp::Run(void)
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
-	SetDiagPostPrefix("rpstblastn");
+        SetDiagPostPrefix("rpstblastn");
+        SetDiagHandler(&bah, false);
 
         /*** Get the BLAST options ***/
         const CArgs& args = GetArgs();
@@ -136,6 +138,10 @@ int CRPSTBlastnApp::Run(void)
 
         /*** Get the formatting options ***/
         CRef<CFormattingArgs> fmt_args(m_CmdLineArgs->GetFormattingArgs());
+        bool isArchiveFormat = fmt_args->ArchiveFormatRequested(args);
+        if(!isArchiveFormat) {
+        	bah.DoNotSaveMessages();
+        }
         CBlastFormat formatter(opt, *db_adapter,
                                fmt_args->GetFormattedOutputChoice(),
                                query_opts->GetParseDeflines(),
@@ -184,7 +190,8 @@ int CRPSTBlastnApp::Run(void)
             }
 
             if (fmt_args->ArchiveFormatRequested(args)) {
-                formatter.WriteArchive(*queries, *opts_hndl, *results);
+                formatter.WriteArchive(*queries, *opts_hndl, *results, 0, bah.GetMessages());
+                bah.ResetMessages();
             } else {
                 BlastFormatter_PreFetchSequenceData(*results, scope);
                 ITERATE(CSearchResultSet, result, *results) {
@@ -200,6 +207,10 @@ int CRPSTBlastnApp::Run(void)
         }
 
     } CATCH_ALL(status)
+    if(!bah.GetMessages().empty()) {
+    	const CArgs & a = GetArgs();
+    	PrintErrorArchive(a, bah.GetMessages());
+    }
     return status;
 }
 
diff --git a/c++/src/app/blast/seedtop_app.cpp b/c++/src/app/blast/seedtop_app.cpp
index 79f8a5b..0eb12c4 100644
--- a/c++/src/app/blast/seedtop_app.cpp
+++ b/c++/src/app/blast/seedtop_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seedtop_app.cpp 482743 2015-10-26 16:39:57Z ivanov $
+/*  $Id: seedtop_app.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-	"$Id: seedtop_app.cpp 482743 2015-10-26 16:39:57Z ivanov $";
+	"$Id: seedtop_app.cpp 473030 2015-07-15 19:29:59Z camacho $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/app/blast/tblastn_app.cpp b/c++/src/app/blast/tblastn_app.cpp
index b6dfca1..38e85a5 100644
--- a/c++/src/app/blast/tblastn_app.cpp
+++ b/c++/src/app/blast/tblastn_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: tblastn_app.cpp 484400 2015-11-10 18:12:56Z ivanov $
+/*  $Id: tblastn_app.cpp 495295 2016-03-16 14:53:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-	"$Id: tblastn_app.cpp 484400 2015-11-10 18:12:56Z ivanov $";
+	"$Id: tblastn_app.cpp 495295 2016-03-16 14:53:41Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -82,12 +82,14 @@ void CTblastnApp::Init()
 int CTblastnApp::Run(void)
 {
     int status = BLAST_EXIT_SUCCESS;
+    CBlastAppDiagHandler bah;
 
     try {
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
-	SetDiagPostPrefix("tblastn");
+        SetDiagPostPrefix("tblastn");
+        SetDiagHandler(&bah, false);
 
         /*** Get the BLAST options ***/
         const CArgs& args = GetArgs();
@@ -152,6 +154,10 @@ int CTblastnApp::Run(void)
 
         /*** Get the formatting options ***/
         CRef<CFormattingArgs> fmt_args(m_CmdLineArgs->GetFormattingArgs());
+        bool isArchiveFormat = fmt_args->ArchiveFormatRequested(args);
+        if(!isArchiveFormat) {
+        	bah.DoNotSaveMessages();
+        }
         CBlastFormat formatter(opt, *db_adapter,
                                fmt_args->GetFormattedOutputChoice(),
                                query_opts->GetParseDeflines(),
@@ -202,7 +208,8 @@ int CTblastnApp::Run(void)
                 }
 
                 if (fmt_args->ArchiveFormatRequested(args)) {
-                    formatter.WriteArchive(*query_factory, *opts_hndl, *results);
+                    formatter.WriteArchive(*query_factory, *opts_hndl, *results, 0, bah.GetMessages());
+                    bah.ResetMessages();
                 } else {
                     BlastFormatter_PreFetchSequenceData(*results, scope);
                     ITERATE(CSearchResultSet, result, *results) {
@@ -236,7 +243,8 @@ int CTblastnApp::Run(void)
             }
 
             if (fmt_args->ArchiveFormatRequested(args)) {
-                formatter.WriteArchive(*query_factory, *opts_hndl, *results);
+                formatter.WriteArchive(*query_factory, *opts_hndl, *results, 0, bah.GetMessages());
+                bah.ResetMessages();
             } else {
                 BlastFormatter_PreFetchSequenceData(*results, scope);
                 ITERATE(CSearchResultSet, result, *results) {
@@ -251,6 +259,10 @@ int CTblastnApp::Run(void)
             opts_hndl->GetOptions().DebugDumpText(NcbiCerr, "BLAST options", 1);
         }
     } CATCH_ALL(status)
+    if(!bah.GetMessages().empty()) {
+    	const CArgs & a = GetArgs();
+    	PrintErrorArchive(a, bah.GetMessages());
+    }
     return status;
 }
 
diff --git a/c++/src/app/blast/tblastx_app.cpp b/c++/src/app/blast/tblastx_app.cpp
index 6a8aa9e..808f133 100644
--- a/c++/src/app/blast/tblastx_app.cpp
+++ b/c++/src/app/blast/tblastx_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: tblastx_app.cpp 484400 2015-11-10 18:12:56Z ivanov $
+/*  $Id: tblastx_app.cpp 495295 2016-03-16 14:53:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-	"$Id: tblastx_app.cpp 484400 2015-11-10 18:12:56Z ivanov $";
+	"$Id: tblastx_app.cpp 495295 2016-03-16 14:53:41Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -86,12 +86,14 @@ void CTblastxApp::Init()
 int CTblastxApp::Run(void)
 {
     int status = BLAST_EXIT_SUCCESS;
+    CBlastAppDiagHandler bah;
 
     try {
 
         // Allow the fasta reader to complain on invalid sequence input
         SetDiagPostLevel(eDiag_Warning);
-	SetDiagPostPrefix("tblastx");
+        SetDiagPostPrefix("tblastx");
+        SetDiagHandler(&bah, false);
 
         /*** Get the BLAST options ***/
         const CArgs& args = GetArgs();
@@ -131,6 +133,10 @@ int CTblastxApp::Run(void)
 
         /*** Get the formatting options ***/
         CRef<CFormattingArgs> fmt_args(m_CmdLineArgs->GetFormattingArgs());
+        bool isArchiveFormat = fmt_args->ArchiveFormatRequested(args);
+        if(!isArchiveFormat) {
+           	bah.DoNotSaveMessages();
+        }
         CBlastFormat formatter(opt, *db_adapter,
                                fmt_args->GetFormattedOutputChoice(),
                                query_opts->GetParseDeflines(),
@@ -181,7 +187,8 @@ int CTblastxApp::Run(void)
             }
 
             if (fmt_args->ArchiveFormatRequested(args)) {
-                formatter.WriteArchive(*queries, *opts_hndl, *results);
+                formatter.WriteArchive(*queries, *opts_hndl, *results, 0, bah.GetMessages());
+                bah.ResetMessages();
             } else {
                 BlastFormatter_PreFetchSequenceData(*results, scope);
                 ITERATE(CSearchResultSet, result, *results) {
@@ -197,6 +204,10 @@ int CTblastxApp::Run(void)
         }
 
     } CATCH_ALL(status)
+    if(!bah.GetMessages().empty()) {
+    	const CArgs & a = GetArgs();
+    	PrintErrorArchive(a, bah.GetMessages());
+    }
     return status;
 }
 
diff --git a/c++/src/app/blastdb/blastdb_aliastool.cpp b/c++/src/app/blastdb/blastdb_aliastool.cpp
index 03c641d..304ab2a 100644
--- a/c++/src/app/blastdb/blastdb_aliastool.cpp
+++ b/c++/src/app/blastdb/blastdb_aliastool.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastdb_aliastool.cpp 442823 2014-08-07 14:40:27Z fongah2 $
+/*  $Id: blastdb_aliastool.cpp 488259 2015-12-29 14:32:15Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] = 
-    "$Id: blastdb_aliastool.cpp 442823 2014-08-07 14:40:27Z fongah2 $";
+    "$Id: blastdb_aliastool.cpp 488259 2015-12-29 14:32:15Z camacho $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -385,7 +385,7 @@ vector<string> CBlastDBAliasApp::x_GetDbsToAggregate(const string dbs, const str
     const CArgs& args = GetArgs();
     if (args[dbs].HasValue()) {
         const string dblist = args[dbs].AsString();
-        NStr::Tokenize(dblist, " ", retval);
+        NStr::Split(dblist, " ", retval, NStr::fSplit_NoMergeDelims);
     } else if (args[file].HasValue()) {
         CNcbiIstream& in(args[file].AsInputFile());
         string line;
@@ -425,6 +425,6 @@ int CBlastDBAliasApp::Run(void)
 #ifndef SKIP_DOXYGEN_PROCESSING
 int main(int argc, const char* argv[] /*, const char* envp[]*/)
 {
-    return CBlastDBAliasApp().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CBlastDBAliasApp().AppMain(argc, argv, 0, eDS_Default, "");
 }
 #endif /* SKIP_DOXYGEN_PROCESSING */
diff --git a/c++/src/app/blastdb/blastdbcheck.cpp b/c++/src/app/blastdb/blastdbcheck.cpp
index 66076c8..dd36992 100644
--- a/c++/src/app/blastdb/blastdbcheck.cpp
+++ b/c++/src/app/blastdb/blastdbcheck.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastdbcheck.cpp 461034 2015-03-05 14:22:52Z madden $
+/*  $Id: blastdbcheck.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1515,6 +1515,6 @@ void CBlastDbCheckApplication::Exit(void)
 int main(int argc, const char* argv[])
 {
     // Execute main application function
-    return CBlastDbCheckApplication().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CBlastDbCheckApplication().AppMain(argc, argv, 0, eDS_Default, "");
 #endif /* SKIP_DOXYGEN_PROCESSING */
 }
diff --git a/c++/src/app/blastdb/blastdbcmd.cpp b/c++/src/app/blastdb/blastdbcmd.cpp
index 2eecdf6..814e97a 100644
--- a/c++/src/app/blastdb/blastdbcmd.cpp
+++ b/c++/src/app/blastdb/blastdbcmd.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastdbcmd.cpp 479896 2015-09-24 14:50:02Z ivanov $
+/*  $Id: blastdbcmd.cpp 489108 2016-01-08 15:13:21Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: blastdbcmd.cpp 479896 2015-09-24 14:50:02Z ivanov $";
+    "$Id: blastdbcmd.cpp 489108 2016-01-08 15:13:21Z fongah2 $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -223,7 +223,7 @@ CBlastDBCmdApp::x_GetQueries(CBlastDBCmdApp::TQueries& retval) const
 
         if (entry.find(kDelim[0]) != string::npos) {
             vector<string> tokens;
-            NStr::Tokenize(entry, kDelim, tokens);
+            NStr::Split(entry, kDelim, tokens, NStr::fSplit_NoMergeDelims);
             ITERATE(vector<string>, itr, tokens) {
                 err_found += (err_here = x_AddSeqId(retval, *itr));
                 if (err_here) {
@@ -435,7 +435,7 @@ int CBlastDBCmdApp::x_ProcessBatchEntry(const CArgs& args, CSeqFormatter & seq_f
         NcbiGetlineEOL(input, line);
         if ( !line.empty() ) {
         	vector<string> tmp;
-        	NStr::Tokenize(line, " \t", tmp, NStr::fSplit_MergeDelims);
+        	NStr::Split(line, " \t", tmp, NStr::fSplit_MergeDelims);
         	if(tmp.empty())
         		continue;
 
@@ -732,6 +732,6 @@ int CBlastDBCmdApp::Run(void)
 #ifndef SKIP_DOXYGEN_PROCESSING
 int main(int argc, const char* argv[] /*, const char* envp[]*/)
 {
-    return CBlastDBCmdApp().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CBlastDBCmdApp().AppMain(argc, argv, 0, eDS_Default, "");
 }
 #endif /* SKIP_DOXYGEN_PROCESSING */
diff --git a/c++/src/app/blastdb/blastdbcp.cpp b/c++/src/app/blastdb/blastdbcp.cpp
index fbf4fe3..fed381d 100644
--- a/c++/src/app/blastdb/blastdbcp.cpp
+++ b/c++/src/app/blastdb/blastdbcp.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastdbcp.cpp 479896 2015-09-24 14:50:02Z ivanov $
+/*  $Id: blastdbcp.cpp 485504 2015-11-23 14:41:02Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -120,13 +120,6 @@ void BlastdbCopyApplication::Init(void)
 
     arg_desc->SetCurrentGroup("Configuration options");
 
-    arg_desc->AddOptionalKey(
-            kArgDbTitle,
-            "database_title",
-            "Title for BLAST database",
-            CArgDescriptions::eString
-    );
-
     arg_desc->AddKey(
             kArgGiList,
             "input_file",
@@ -135,6 +128,13 @@ void BlastdbCopyApplication::Init(void)
             CArgDescriptions::eString
     );
 
+    arg_desc->AddOptionalKey(
+            kArgDbTitle,
+            "database_title",
+            "Title for BLAST database",
+            CArgDescriptions::eString
+    );
+
     arg_desc->AddFlag(
             kMembershipBits,
             "Copy the membership bits",
@@ -189,20 +189,21 @@ public:
     CBlastDbBioseqSource(
             CRef<CSeqDBExpert> blastdb,
             CRef<CSeqDBGiList> gilist,
-            bool copy_membership_bits = false
+            bool               copy_membership_bits = false,
+            bool               copy_leaf_taxids     = true
     )
     {
-        CStopWatch total_timer, bioseq_timer, memb_timer;
+        CStopWatch total_timer, bioseq_timer, memb_timer, leaf_timer;
         total_timer.Start();
         for (int i = 0; i < gilist->GetNumGis(); i++) {
             const CSeqDBGiList::SGiOid& elem = gilist->GetGiOid(i);
             int oid = 0;
-            if ( !blastdb->GiToOid(GI_FROM(int, elem.gi), oid)) {
+            if (!blastdb->GiToOid(elem.gi, oid)) {
                 // not found on source BLASTDB, skip
                 continue;
             }
             if (m_Oids2Copy.insert(oid).second == false) {
-                // don't add the same OID twice to avoid duplicates
+                // don't add the same OID twice, to avoid duplicates
                 continue;
             }
 
@@ -219,27 +220,41 @@ public:
             m_Bioseqs.push_back(bs);
             bioseq_timer.Stop();
 
-            if (copy_membership_bits == false) {
-                // If we're not copying the membership bits, we're done
-                // with this gi, so loop back for the next one.
-                continue;
+            if (copy_membership_bits) {
+                memb_timer.Start();
+                CRef<CBlast_def_line_set> hdr =
+                        CSeqDB::ExtractBlastDefline(*bs);
+                ITERATE(CBlast_def_line_set::Tdata, itr, hdr->Get()) {
+                    CRef<CBlast_def_line> bdl = *itr;
+                    if (bdl->CanGetMemberships() &&
+                            !bdl->GetMemberships().empty()) {
+                        int memb_bits = bdl->GetMemberships().front();
+                        if (memb_bits == 0) {
+                            continue;
+                        }
+                        const string id =
+                                bdl->GetSeqid().front()->AsFastaString();
+                        m_MembershipBits[memb_bits].push_back(id);
+                    }
+                }
+                memb_timer.Stop();
             }
 
-            memb_timer.Start();
-            CRef<CBlast_def_line_set> hdr = CSeqDB::ExtractBlastDefline(*bs);
-            ITERATE(CBlast_def_line_set::Tdata, itr, hdr->Get()) {
-                CRef<CBlast_def_line> bdl = *itr;
-                if (bdl->CanGetMemberships() &&
-                        !bdl->GetMemberships().empty()) {
-                    int memb_bits = bdl->GetMemberships().front();
-                    if (memb_bits == 0) {
-                        continue;
-                    }
-                    const string id = bdl->GetSeqid().front()->AsFastaString();
-                    m_MembershipBits[memb_bits].push_back(id);
+            if (copy_leaf_taxids) {
+                leaf_timer.Start();
+                CRef<CBlast_def_line_set> hdr =
+                        CSeqDB::ExtractBlastDefline(*bs);
+                ITERATE(CBlast_def_line_set::Tdata, itr, hdr->Get()) {
+                    CRef<CBlast_def_line> bdl = *itr;
+                    CBlast_def_line::TTaxIds leafs = bdl->GetLeafTaxIds();
+                    const string id =
+                            bdl->GetSeqid().front()->AsFastaString();
+                    set<int> ids = m_LeafTaxids[id];
+                    ids.insert(leafs.begin(), leafs.end());
+                    m_LeafTaxids[id] = ids;
                 }
+                leaf_timer.Stop();
             }
-            memb_timer.Stop();
         }
         total_timer.Stop();
         ERR_POST(
@@ -258,12 +273,22 @@ public:
                 Info << "Processed membership bits in "
                 << memb_timer.AsSmartString()
         );
+        ERR_POST(
+                Info << "Processed leaf taxids in "
+                << leaf_timer.AsSmartString()
+        );
     }
 
-    const TLinkoutMap GetMembershipBits() const {
+    const TLinkoutMap GetMembershipBits() const
+    {
         return m_MembershipBits;
     }
 
+    const TIdToLeafs GetLeafTaxIds() const
+    {
+        return m_LeafTaxids;
+    }
+
     virtual CConstRef<CBioseq> GetNext()
     {
         if (m_Bioseqs.empty()) {
@@ -275,9 +300,11 @@ public:
     }
 private:
     typedef list< CConstRef<CBioseq> > TBioseqs;
-    TBioseqs m_Bioseqs;
-    set<int> m_Oids2Copy;
+
+    TBioseqs    m_Bioseqs;
+    set<int>    m_Oids2Copy;
     TLinkoutMap m_MembershipBits;
+    TIdToLeafs  m_LeafTaxids;
 };
 
 bool BlastdbCopyApplication::x_ShouldParseSeqIds(const string& dbname,
@@ -406,6 +433,7 @@ int BlastdbCopyApplication::Run(void)
         destdb.SetSourceDb(sourcedb);
         destdb.StartBuild();
         destdb.SetMembBits(bioseq_source.GetMembershipBits(), false);
+        destdb.SetLeafTaxIds(bioseq_source.GetLeafTaxIds(), false);
         destdb.AddSequences(bioseq_source, kCopyPIGs);
         destdb.EndBuild();
         timer.Stop();
@@ -442,5 +470,5 @@ void BlastdbCopyApplication::Exit(void)
 int main(int argc, const char* argv[])
 {
     // Execute main application function
-    return BlastdbCopyApplication().AppMain(argc, argv, 0, eDS_Default, 0);
+    return BlastdbCopyApplication().AppMain(argc, argv, 0, eDS_Default, "");
 }
diff --git a/c++/src/app/blastdb/convert2blastmask.cpp b/c++/src/app/blastdb/convert2blastmask.cpp
index 7cbfdd7..cdf2340 100644
--- a/c++/src/app/blastdb/convert2blastmask.cpp
+++ b/c++/src/app/blastdb/convert2blastmask.cpp
@@ -1,4 +1,4 @@
-/*  # $Id: convert2blastmask.cpp 477844 2015-09-02 13:12:06Z ivanov $
+/*  # $Id: convert2blastmask.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -230,7 +230,7 @@ void CConvert2BlastMaskApplication::Exit(void)
 int main(int argc, const char* argv[])
 {
     // Execute main application function
-    return CConvert2BlastMaskApplication().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CConvert2BlastMaskApplication().AppMain(argc, argv, 0, eDS_Default, "");
 }
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
diff --git a/c++/src/app/blastdb/makeblastdb.cpp b/c++/src/app/blastdb/makeblastdb.cpp
index e3e8bb1..a856a22 100644
--- a/c++/src/app/blastdb/makeblastdb.cpp
+++ b/c++/src/app/blastdb/makeblastdb.cpp
@@ -1,4 +1,4 @@
-/*  $Id: makeblastdb.cpp 483792 2015-11-04 11:13:19Z ivanov $
+/*  $Id: makeblastdb.cpp 488259 2015-12-29 14:32:15Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: makeblastdb.cpp 483792 2015-11-04 11:13:19Z ivanov $";
+    "$Id: makeblastdb.cpp 488259 2015-12-29 14:32:15Z camacho $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -824,7 +824,7 @@ void CMakeBlastDBApp::x_ProcessMaskData()
     }
 
     if (ids.HasValue()) {
-        NStr::Tokenize(NStr::TruncateSpaces(ids.AsString()), ",", id_list,
+        NStr::Split(NStr::TruncateSpaces(ids.AsString()), ",", id_list,
                    NStr::eNoMergeDelims);
         if (file_list.size() != id_list.size()) {
             NCBI_THROW(CInvalidDataException, eInvalidInput,
@@ -1040,7 +1040,7 @@ void CMakeBlastDBApp::x_BuildDatabase()
     }
 
     vector<string> input_files;
-    NStr::Tokenize(dbname, kInputSeparators, input_files);
+    NStr::Split(dbname, kInputSeparators, input_files, NStr::fSplit_NoMergeDelims);
     if (dbname == "-" || input_files.size() > 1) {
         NCBI_THROW(CInvalidDataException, eInvalidInput,
             "Please provide a database name using -" + kOutput);
@@ -1114,7 +1114,7 @@ void CMakeBlastDBApp::x_BuildDatabase()
 
     TLinkoutMap no_bits;
 
-    m_DB->SetLinkouts(no_bits, true);
+//    m_DB->SetLinkouts(no_bits, true);     // DEPRECATED
     m_DB->SetMembBits(no_bits, true);
 
     // Max file size
@@ -1163,6 +1163,6 @@ int CMakeBlastDBApp::Run(void)
 #ifndef SKIP_DOXYGEN_PROCESSING
 int main(int argc, const char* argv[] /*, const char* envp[]*/)
 {
-    return CMakeBlastDBApp().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CMakeBlastDBApp().AppMain(argc, argv, 0, eDS_Default, "");
 }
 #endif /* SKIP_DOXYGEN_PROCESSING */
diff --git a/c++/src/app/blastdb/makeprofiledb.cpp b/c++/src/app/blastdb/makeprofiledb.cpp
index be7501e..efe8480 100644
--- a/c++/src/app/blastdb/makeprofiledb.cpp
+++ b/c++/src/app/blastdb/makeprofiledb.cpp
@@ -1,4 +1,4 @@
-/*  $Id: makeprofiledb.cpp 452770 2014-11-24 19:17:41Z fongah2 $
+/*  $Id: makeprofiledb.cpp 489108 2016-01-08 15:13:21Z fongah2 $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -521,7 +521,7 @@ vector<string> CMakeProfileDBApp::x_GetSMPFilenames(void)
 		string line;
 		vector<string> tmp;
 		NcbiGetlineEOL(*m_InPssmList, line);
-		NStr::Tokenize(line, " \t\r", tmp, NStr::eMergeDelims);
+		NStr::Split(line, " \t\r", tmp, NStr::eMergeDelims);
 
 		if(tmp.size()  > 0)
 			filenames.insert(filenames.end(), tmp.begin(), tmp.end() );
@@ -1710,7 +1710,7 @@ int CMakeProfileDBApp::Run(void)
 #ifndef SKIP_DOXYGEN_PROCESSING
 int main(int argc, const char* argv[] /*, const char* envp[]*/)
 {
-		return CMakeProfileDBApp().AppMain(argc, argv, 0, eDS_Default, 0);
+		return CMakeProfileDBApp().AppMain(argc, argv, 0, eDS_Default, "");
 }
 
 
diff --git a/c++/src/app/dustmasker/main.cpp b/c++/src/app/dustmasker/main.cpp
index b47c80d..d5ea758 100644
--- a/c++/src/app/dustmasker/main.cpp
+++ b/c++/src/app/dustmasker/main.cpp
@@ -1,4 +1,4 @@
-/*  $Id: main.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/*  $Id: main.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -38,5 +38,5 @@ USING_NCBI_SCOPE;
 
 int main( int argc, char * argv[] )
 {
-    return CDustMaskApplication().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CDustMaskApplication().AppMain(argc, argv, 0, eDS_Default, "");
 }
diff --git a/c++/src/app/segmasker/segmasker.cpp b/c++/src/app/segmasker/segmasker.cpp
index 0954e8d..51cb183 100644
--- a/c++/src/app/segmasker/segmasker.cpp
+++ b/c++/src/app/segmasker/segmasker.cpp
@@ -1,4 +1,4 @@
-/*  $Id: segmasker.cpp 410973 2013-08-23 13:22:44Z fongah2 $
+/*  $Id: segmasker.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -269,7 +269,7 @@ void SegMaskerApplication::Exit(void)
 int main(int argc, const char* argv[])
 {
     // Execute main application function
-    return SegMaskerApplication().AppMain(argc, argv, 0, eDS_Default, 0);
+    return SegMaskerApplication().AppMain(argc, argv, 0, eDS_Default, "");
 }
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
diff --git a/c++/src/app/winmasker/main.cpp b/c++/src/app/winmasker/main.cpp
index 8534c0c..0ddf8ba 100644
--- a/c++/src/app/winmasker/main.cpp
+++ b/c++/src/app/winmasker/main.cpp
@@ -1,4 +1,4 @@
-/*  $Id: main.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/*  $Id: main.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -38,5 +38,5 @@ USING_NCBI_SCOPE;
 
 int main( int argc, char * argv[] )
 {
-    return CWinMaskApplication().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CWinMaskApplication().AppMain(argc, argv, 0, eDS_Default, "");
 }
diff --git a/c++/src/build-system/Makefile.app.in b/c++/src/build-system/Makefile.app.in
index 9182d74..7555933 100644
--- a/c++/src/build-system/Makefile.app.in
+++ b/c++/src/build-system/Makefile.app.in
@@ -1,6 +1,6 @@
 # -*- makefile-gmake -*-
 #################################
-# $Id: Makefile.app.in 478076 2015-09-03 17:21:47Z ivanov $
+# $Id: Makefile.app.in 492296 2016-02-16 17:41:47Z ivanov $
 # Author:  Denis Vakatov (vakatov at ncbi.nlm.nih.gov)
 #################################
 # This can be used to build/install/clean
@@ -33,7 +33,8 @@ SOURCES      = @UNIX_SRC@ $(SRC)
 XAPP = $(APP)@exe_ext@
 XOBJ = $(SOURCES:=@obj_ext@)
 XOBJ2 = $(OBJ:=@obj_ext@)
-XAPP_LIB = @APP_LIB_SETTING@
+XAPP_LIB_ = @APP_LIB_SETTING@
+XAPP_LIB = $(XAPP_LIB_:%$(STATIC)$(STATIC)=%$(STATIC))
 XAPP_LIBS = @APP_LIBS_SETTING@
 XLIB_FLAGS = $(runpath) @f_libpath@$(libdir)
 XLIB    = $(XLIB_FLAGS) $(XAPP_LIB:%=@lib_l_pre@%@lib_l_ext@)
diff --git a/c++/src/build-system/Makefile.dll.in b/c++/src/build-system/Makefile.dll.in
index 7a33022..0931175 100644
--- a/c++/src/build-system/Makefile.dll.in
+++ b/c++/src/build-system/Makefile.dll.in
@@ -1,6 +1,6 @@
 # -*- makefile-gmake -*-
 #################################
-# $Id: Makefile.dll.in 475041 2015-08-04 15:30:53Z ivanov $
+# $Id: Makefile.dll.in 474937 2015-08-03 15:51:23Z ucko $
 # Author:  Denis Vakatov (vakatov at ncbi.nlm.nih.gov)
 #################################
 # This can be used to build/install/clean
diff --git a/c++/src/build-system/Makefile.flat_tuneups b/c++/src/build-system/Makefile.flat_tuneups
index a51b2a9..1d07594 100644
--- a/c++/src/build-system/Makefile.flat_tuneups
+++ b/c++/src/build-system/Makefile.flat_tuneups
@@ -1,5 +1,5 @@
 # -*- makefile-gmake -*-
-# $Id: Makefile.flat_tuneups 441919 2014-07-29 15:07:28Z ucko $
+# $Id: Makefile.flat_tuneups 487476 2015-12-17 19:48:39Z ucko $
 
 all: ptb_all
 
@@ -55,10 +55,14 @@ all_dirs ?= $(expendable_dirs) $(spec_bearing_dirs) $(plain_dirs)
 # Lists of directories in any branch which can benefit from the
 # aforementioned hints because some of their projects have files in common.
 
+ftds95_ut = ctlib dblib odbc tds
+
 main_hintees = algo/cobalt/demo app/grid/remote_app cgi connect \
     connect/daemons connect/ext connect/test dbapi/driver/ctlib/samples \
-    dbapi/driver/ftds64/ctlib/samples dbapi/test dbapi/test/driver \
-    objmgr/test sample/app/cgi sample/app/cgi/cgires
+    dbapi/driver/ftds64/ctlib/samples dbapi/driver/ftds95/ctlib/samples \
+    $(ftds95_ut:%=dbapi/driver/ftds95/freetds/%/unittests) \
+    dbapi/test dbapi/test/driver objmgr/test \
+    sample/app/cgi sample/app/cgi/cgires
 
 gpipe_hintees_ = app/action_nodes app/aligndb app/fscr app/gbench \
     app/gencoll/altloci_load app/gencoll/ftp_reports app/gpinit app/kmer \
diff --git a/c++/src/build-system/Makefile.in b/c++/src/build-system/Makefile.in
index 057d71e..903fb92 100644
--- a/c++/src/build-system/Makefile.in
+++ b/c++/src/build-system/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in 129561 2008-06-03 14:30:27Z gouriano $
+# $Id: Makefile.in 484097 2015-11-06 15:11:22Z ucko $
 
-SUB_PROJ = project_tree_builder
+SUB_PROJ = helpers project_tree_builder
 
 srcdir = @srcdir@
 include @builddir@/Makefile.meta
diff --git a/c++/src/build-system/Makefile.meta.gmake=yes b/c++/src/build-system/Makefile.meta.gmake=yes
index e7f069a..e5d3b36 100644
--- a/c++/src/build-system/Makefile.meta.gmake=yes
+++ b/c++/src/build-system/Makefile.meta.gmake=yes
@@ -1,5 +1,5 @@
 # -*- makefile-gmake -*-
-# $Id: Makefile.meta.gmake=yes 470885 2015-06-19 18:58:22Z ivanov $
+# $Id: Makefile.meta.gmake=yes 470602 2015-06-17 16:00:59Z ucko $
 
 ifeq "" "$(findstring /,$(MAKE))"
   ABSMAKE := $(word 1,$(wildcard $(patsubst %,%/$(MAKE),$(subst :, ,$(PATH)))))
diff --git a/c++/src/build-system/Makefile.meta_l b/c++/src/build-system/Makefile.meta_l
index 43a47a5..d16157d 100644
--- a/c++/src/build-system/Makefile.meta_l
+++ b/c++/src/build-system/Makefile.meta_l
@@ -1,5 +1,5 @@
 # -*- makefile-gmake -*-
-# $Id: Makefile.meta_l 485100 2015-11-18 18:35:45Z ivanov $
+# $Id: Makefile.meta_l 487127 2015-12-15 17:04:00Z ivanov $
 
 ### Rules for building within a single directory
 
@@ -24,7 +24,13 @@ endif
 
 ### Protect against two MAKE processes running in the same dir
 
-RWL = $(abs_top_srcdir)/scripts/common/impl/run_with_lock.sh
+ifeq "$(wildcard $(build_root)/bin/run_with_lock)" ""
+  RWL = $(abs_top_srcdir)/scripts/common/impl/run_with_lock.sh
+else
+  RWL = $(build_root)/bin/run_with_lock \
+         -getter $(abs_top_srcdir)/scripts/common/impl/get_lock.sh \
+         -reviewer $(abs_top_srcdir)/scripts/common/impl/is_log_interesting.awk
+endif
 
 ifeq "$(srcdir)" "."
   PTB_ROOT      = /net/snowman/vol/export2/win-coremake/App/Ncbi/cppcore/ptb
@@ -66,6 +72,11 @@ make_tag = $(word 1,$(MAKE))$(patsubst %,[%],$(filter-out 0,$(MAKELEVEL)))
 ifneq "" "$(findstring k,$(MFLAGS))"
   ign = -
 endif
+ifeq "" "$(findstring s,$(MFLAGS))"
+  echo_unless_silent = echo
+else
+  echo_unless_silent = :
+endif
 
 # 1: proj_name, 2: lock_map?, 3: command, 4: target, 5: ext, 6: cleanup,
 # 7: error_status, 8: is_expendable?
@@ -73,8 +84,8 @@ define make_one_leaf_proj
 $(if $(8),NCBI_BUT_EXPENDABLE=$(but_exp);,) \
 if NCBICXX_TESTING_REQS=1 $(3) -q requirements; then \
     if $(3) -q depend >/dev/null 2>&1 && $(3) -q $(4) >/dev/null 2>&1; then \
-	echo "$(make_tag) (Makefile.$(1)$(5)): Nothing to be done for \`$(4)'."; \
-    elif echo $(3) $(4) && \
+	$(echo_unless_silent) "$(make_tag) (Makefile.$(1)$(5)): Nothing to be done for \`$(4)'."; \
+    elif $(echo_unless_silent) $(3) $(4) && \
       $(RWL) -base "make_$(1)" -log "make_$(1).log" $(2) ! $(3) $(4) ; then \
         echo "FAILED$$NCBI_BUT_EXPENDABLE: $(rel_srcdir)/Makefile.$(1)$(5)" ; \
 	$(6) ; \
@@ -120,7 +131,7 @@ MAKE_WSDL = $(builddir)/new_module.sh --wsdl "$$i"
 # 1: proj_name, 2: proj_type, 3: target
 define make_one_spec_proj
 $(ign)+ at i=$(1) ; \
-echo "cd $(abs_srcdir)  &&  $(MAKE_$(2)) $(3)" ; \
+$(echo_unless_silent) "cd $(abs_srcdir)  &&  $(MAKE_$(2)) $(3)" ; \
 cd $(abs_srcdir) && \
 if MAKE="$(MAKE) $(MFLAGS_NR)" \
      $(RWL) -base make_asn -log "$(CURDIR)/make_$(1)_src.log" $(MAKE_$(2)) $(3) \
@@ -195,7 +206,12 @@ endif
 
 # 1: proj_name
 define add_one_check
-+@$(check_add) $(abs_srcdir) $(1) $(signature) $(subdir)  ||  exit 5
+ at i=$(1) ; \
+if NCBICXX_TESTING_REQS=1 $(MAKE_APP) -q requirements >/dev/null 2>&1; then \
+    $(check_add) $(abs_srcdir) $(1) $(signature) $(subdir)  ||  exit 5 ; \
+else \
+    echo SKIP -- $(rel_srcdir)/$(1) \(unmet build REQUIRES\) ; \
+fi
 
 endef
 define add_each_check
diff --git a/c++/src/build-system/Makefile.meta_p b/c++/src/build-system/Makefile.meta_p
index 644ca01..ef83740 100644
--- a/c++/src/build-system/Makefile.meta_p
+++ b/c++/src/build-system/Makefile.meta_p
@@ -1,5 +1,5 @@
 # -*- makefile-gmake -*-
-# $Id: Makefile.meta_p 442076 2014-07-30 14:06:45Z ucko $
+# $Id: Makefile.meta_p 484984 2015-11-17 19:47:44Z ucko $
 
 ### Project-list-based recursive builds
 
@@ -93,7 +93,7 @@ auto-relevance.mk: $(RELEVANT_SUB_FILE) $(IRRELEVANT_SUB_FILE)
 # 1: name, 2: target, 3: is_expendable?
 define make_one_sub_proj_p
 + at if $(call is_relevant,$(1)/,)  ||  $(call is_relevant,$(1)/,_SUB) ; then \
-    echo $(MAKE) -C $(1) $(MFLAGS_NR) $(2) ; \
+    $(echo_unless_silent) $(MAKE) -C $(1) $(MFLAGS_NR) $(2) ; \
     $(call make_one_sub_proj_r_nonl,$(1),$(2),$(3)) ; \
 fi
 endef
diff --git a/c++/src/build-system/Makefile.mk.in b/c++/src/build-system/Makefile.mk.in
index a0b337e..755b876 100644
--- a/c++/src/build-system/Makefile.mk.in
+++ b/c++/src/build-system/Makefile.mk.in
@@ -1,5 +1,5 @@
- #################################
-# $Id: Makefile.mk.in 478150 2015-09-04 11:53:48Z ivanov $
+#################################
+# $Id: Makefile.mk.in 493416 2016-02-26 18:48:41Z ivanov $
 # Author:  Denis Vakatov (vakatov at ncbi.nlm.nih.gov)
 #################################
 #
@@ -101,6 +101,19 @@ CONF_DLL_LDFLAGS = @DLL_LDFLAGS@ $(DLL_UNDEF_FLAGS)
 CONF_LIBS     = @LIBS@
 CONF_C_LIBS   = @C_LIBS@
 
+# Settings for building tools that shouldn't be cross-compiled, even
+# if everything else is.
+#
+# NB: Code using these settings should not attempt to use any
+# third-party packages, or even rely on settings from ncbiconf.h.
+# Also, it should require unix and -XCODE, since these macros are
+# otherwise undefined at the moment.
+
+CC_FOR_BUILD       = @CC_FOR_BUILD@
+CPP_FOR_BUILD      = @CPP_FOR_BUILD@
+CFLAGS_FOR_BUILD   = @CFLAGS_FOR_BUILD@
+CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
+LDFLAGS_FOR_BUILD  = @LDFLAGS_FOR_BUILD@
 
 ### Configurable compiler/librarian/linker binaries and options
 ### (ORIG-Set:  not to be alternated, but can be used in the user makefiles
@@ -225,6 +238,8 @@ UNSAFE_MATH_FLAG = @UNSAFE_MATH_FLAG@
 SSE4_1_FLAG      = @SSE4_1_FLAG@
 AES_FLAG         = @AES_FLAG@
 
+COLOR_DIAGNOSTICS = @COLOR_DIAGNOSTICS@
+
 # Refrain from optimizations that assume no aliasing.
 NO_STRICT_ALIASING = @NO_STRICT_ALIASING@
 
@@ -317,6 +332,9 @@ BDB_CACHE_LIB = @BDB_CACHE_LIB@
 DBAPI_DRIVER  = @DBAPI_DRIVER@
 DBAPI_CTLIB   = @DBAPI_CTLIB@
 DBAPI_DBLIB   = @DBAPI_DBLIB@
+DBAPI_FTDS    = @DBAPI_FTDS@
+DBAPI_FTDS64  = @DBAPI_FTDS64@
+DBAPI_FTDS95  = @DBAPI_FTDS95@
 DBAPI_MYSQL   = @DBAPI_MYSQL@
 DBAPI_ODBC    = @DBAPI_ODBC@
 
@@ -369,8 +387,7 @@ SYBASE_LIBS    = @SYBASE_LIBS@
 SYBASE_DLLS    = @SYBASE_DLLS@
 SYBASE_DBLIBS  = @SYBASE_DBLIBS@
 
-# FreeTDS -- version v0.64, default
-ftds64               = @ftds64@
+# FreeTDS -- specific bundled versions, default
 FTDS64_CTLIB_LIBS    = @FTDS64_CTLIB_LIBS@
 FTDS64_CTLIB_LIB     = @FTDS64_CTLIB_LIB@
 FTDS64_CTLIB_INCLUDE = @FTDS64_CTLIB_INCLUDE@
@@ -378,6 +395,13 @@ FTDS64_LIBS          = @FTDS64_LIBS@
 FTDS64_LIB           = @FTDS64_LIB@
 FTDS64_INCLUDE       = @FTDS64_INCLUDE@
 
+FTDS95_CTLIB_LIBS    = @FTDS95_CTLIB_LIBS@
+FTDS95_CTLIB_LIB     = @FTDS95_CTLIB_LIB@
+FTDS95_CTLIB_INCLUDE = @FTDS95_CTLIB_INCLUDE@
+FTDS95_LIBS          = @FTDS95_LIBS@
+FTDS95_LIB           = @FTDS95_LIB@
+FTDS95_INCLUDE       = @FTDS95_INCLUDE@
+
 FTDS_LIBS    = @FTDS_LIBS@
 FTDS_LIB     = @FTDS_LIB@
 FTDS_INCLUDE = @FTDS_INCLUDE@
@@ -398,14 +422,16 @@ ODBC_INCLUDE = @ODBC_INCLUDE@
 ODBC_LIBS    = @ODBC_LIBS@
 
 # PYTHON: headers and libs (default + specific versions)
-PYTHON_INCLUDE = @PYTHON_INCLUDE@
-PYTHON_LIBS    = @PYTHON_LIBS@
+PYTHON_INCLUDE   = @PYTHON_INCLUDE@
+PYTHON_LIBS      = @PYTHON_LIBS@
 PYTHON25_INCLUDE = @PYTHON25_INCLUDE@
 PYTHON25_LIBS    = @PYTHON25_LIBS@
 PYTHON26_INCLUDE = @PYTHON26_INCLUDE@
 PYTHON26_LIBS    = @PYTHON26_LIBS@
 PYTHON27_INCLUDE = @PYTHON27_INCLUDE@
 PYTHON27_LIBS    = @PYTHON27_LIBS@
+PYTHON3_INCLUDE  = @PYTHON3_INCLUDE@
+PYTHON3_LIBS     = @PYTHON3_LIBS@
 
 # Perl: executable, headers and libs
 PERL         = @PERL@
@@ -613,6 +639,10 @@ AVROGENCPP       = @AVROGENCPP@
 # USC Cereal (header-only)
 CEREAL_INCLUDE = @CEREAL_INCLUDE@
 
+# SASL 2
+SASL2_INCLUDE = @SASL2_INCLUDE@
+SASL2_LIBS    = @SASL2_LIBS@
+
 # MongoDB
 MONGODB_INCLUDE     = @MONGODB_INCLUDE@
 MONGODB_LIBS        = @MONGODB_LIBS@
@@ -633,7 +663,7 @@ GENBANK_LDEP = \
     $(GENBANK_READER_PUBSEQOS_LIBS)
 GENBANK_LIBS = ncbi_xloader_genbank $(GENBANK_LDEP)
 
-GENBANK_READER_LDEP = $(XCONNEXT) xconnect id1 id2 seqsplit $(COMPRESS_LIBS) $(SOBJMGR_LIBS)
+GENBANK_READER_LDEP = $(XCONNEXT) xconnect id1 id2 $(SOBJMGR_LIBS) $(COMPRESS_LIBS)
 GENBANK_READER_LIBS = ncbi_xreader $(GENBANK_READER_LDEP)
 
 # In-house-only PubSeqOS loader (not always built)
@@ -658,8 +688,8 @@ GENBANK_READER_GICACHE_LIBS = ncbi_xreader_gicache \
 
 # Interdependent sequence libraries + seqcode.  Does not include seqset.
 SEQ_LIBS = seq seqcode sequtil
-SOBJMGR_LDEP = genome_collection seqedit seqset $(SEQ_LIBS) pub medline \
-    biblio general xser xutil xncbi
+SOBJMGR_LDEP = genome_collection seqedit seqsplit seqset $(SEQ_LIBS) \
+    pub medline biblio general xser xutil xncbi
 SOBJMGR_LIBS = xobjmgr $(SOBJMGR_LDEP)
 OBJMGR_LIBS = $(GENBANK_LIBS)
 
diff --git a/c++/src/build-system/Makefile.mk.in.msvc b/c++/src/build-system/Makefile.mk.in.msvc
index 219f2b0..4378d3a 100644
--- a/c++/src/build-system/Makefile.mk.in.msvc
+++ b/c++/src/build-system/Makefile.mk.in.msvc
@@ -8,6 +8,9 @@ PlatformToolset=v110
 [Configuration.1200]
 PlatformToolset=v120
 
+[Configuration.1400]
+PlatformToolset=v140
+
 
 [Compiler]
 PreprocessorDefinitions=
@@ -45,6 +48,9 @@ PreprocessorDefinitions=_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)
 [Compiler.1200]
 PreprocessorDefinitions=_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)
 
+[Compiler.1400]
+PreprocessorDefinitions=_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions)
+
 
 
 [Compiler.debug]
@@ -58,6 +64,7 @@ OmitFramePointers=false
 BasicRuntimeChecks=3
 BrowseInformation=0
 EnableFunctionLevelLinking=false
+AdditionalOptions=/bigobj
 
 [Compiler.debug.DebugDLL]
 RuntimeLibrary=3
@@ -120,6 +127,9 @@ AdditionalOptions=advapi32.lib ole32.lib user32.lib gdi32.lib shell32.lib
 # Remove next line if you dont link with any prebuild 3rd party libraries built with old/unknown compiler (like Sybase)
 ImageHasSafeExceptionHandlers=false
 
+[Linker.1400]
+ImageHasSafeExceptionHandlers=false
+
 [Linker.x64]
 TargetMachine=17
 
diff --git a/c++/src/build-system/Makefile.requirements b/c++/src/build-system/Makefile.requirements
index d3d7eeb..2c3e6b9 100644
--- a/c++/src/build-system/Makefile.requirements
+++ b/c++/src/build-system/Makefile.requirements
@@ -1,5 +1,5 @@
 # -*- makefile-gmake -*-
-# $Id: Makefile.requirements 485094 2015-11-18 18:33:06Z ivanov $
+# $Id: Makefile.requirements 480190 2015-09-28 18:20:43Z ucko $
 
 ### Requirements handling (at the subtree level)
 
diff --git a/c++/src/build-system/Makefile.rules.in b/c++/src/build-system/Makefile.rules.in
index a743787..37814f3 100644
--- a/c++/src/build-system/Makefile.rules.in
+++ b/c++/src/build-system/Makefile.rules.in
@@ -1,5 +1,5 @@
 #################################
-# $Id: Makefile.rules.in 440957 2014-07-18 15:02:43Z ucko $
+# $Id: Makefile.rules.in 493416 2016-02-26 18:48:41Z ivanov $
 # Author:  Denis Vakatov (vakatov at ncbi.nlm.nih.gov),
 #          Aaron Ucko    (ucko at ncbi.nlm.nih.gov)
 #################################
@@ -36,6 +36,17 @@ ifneq "" "$(filter @%@,$(ALL_SETTINGS))"
 	$(abs_top_srcdir)/scripts/common/impl/maybe_reconfigure.sh $(builddir)
 endif
 
+# Colored messages are nice, but not enough to require reconfiguration.
+ifneq "" "$(CC_WRAPPER)$(CXX_WRAPPER)"
+  ifneq "" "$(filter-out @%@,$(COLOR_DIAGNOSTICS))"
+    STDERR_IS_TTY := $(shell if [ -t 2 ]; then echo yes; else echo no; fi)
+    ifeq "yes" "$(STDERR_IS_TTY)"
+      CPPFLAGS += $(COLOR_DIAGNOSTICS)
+      LDFLAGS  += $(COLOR_DIAGNOSTICS)
+    endif
+  endif
+endif
+
 ###  C++ compilation
 make_cpp = $(CXX_WRAPPER) $(CXX) $(CXXFLAGS_ALL) $< @f_outobj@$@ $(CXX_FILTER)
 ###  C compilation
diff --git a/c++/src/build-system/NEWS b/c++/src/build-system/NEWS
index e7727af..d867b99 100644
--- a/c++/src/build-system/NEWS
+++ b/c++/src/build-system/NEWS
@@ -17,3 +17,5 @@ reconfigure after minor changes.
 installations.
 
 2015-06-01: additional @VDB_*@ variables @VDB_REQ@ and @VDB_POST_LINK at .
+
+2015-12-17: new variables for FreeTDS 0.95.
diff --git a/c++/src/build-system/aclocal.m4 b/c++/src/build-system/aclocal.m4
index 5666efc..58ac6e4 100644
--- a/c++/src/build-system/aclocal.m4
+++ b/c++/src/build-system/aclocal.m4
@@ -4,7 +4,8 @@ m4_copy([_AC_SRCDIRS], [NCBI_ORIG__AC_SRCDIRS])
 m4_define([_AC_SRCDIRS],
 [# Base source directories on path to *input* file.
 if test -n "$ac_f"; then
-   ac_dir_in=`AS_DIRNAME(["$ac_f"])`
+   ac_f_rel=`echo "$ac_f" | sed -e 's,^/.*/\./,,'`
+   ac_dir_in=`AS_DIRNAME(["$ac_f_rel"])`
 else
    ac_dir_in=$1
 fi
@@ -265,18 +266,19 @@ AC_DEFUN(NCBI_CHECK_PYTHON,
 
 AC_DEFUN(_NCBI_CHECK_PYTHON,
 [AC_PATH_PROG($1, python$2, [],
-    [$PYTHON_PATH/bin:$PATH:/usr/local/python-$2/bin])
+    [${PYTHON_PATH+$PYTHON_PATH/bin:}$PATH:/usr/local/python-$2/bin])
  if test -x "[$]$1"; then
-    $1_VERSION=`[$]$1 -c 'from distutils import sysconfig; print sysconfig.get_config_var("VERSION")' 2>/dev/null`
+    $1_VERSION=`[$]$1 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("VERSION"))' 2>/dev/null`
  else
     $1_VERSION=
     [ncbi_cv_lib_]m4_tolower($1)=no
  fi
  if test -n "[$]$1_VERSION"; then
-    $1_INCLUDE=`[$]$1 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print "-I%s -I%s" % (f(), f(True))'`
-    $1_LIBPATH=`[$]$1 -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL"))'`
-    $1_DEPS=`[$]$1 -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS"))'`
-    NCBI_RPATHIFY($1_LIBS, [$]$1_LIBPATH, [ ]-lpython[$]$1_VERSION [$]$1_DEPS)
+    $1_INCLUDE=`[$]$1 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print("-I%s -I%s" % (f(), f(True)))'`
+    $1_LIBPATH=`[$]$1 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL")))'`
+    $1_DEPS=`[$]$1 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS")))'`
+    $1_LDVERSION=`[$]$1 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("LDVERSION") or sysconfig.get_config_var("VERSION"))' 2>/dev/null`
+    NCBI_RPATHIFY($1_LIBS, [$]$1_LIBPATH, [ ]-lpython[$]$1_LDVERSION [$]$1_DEPS)
     CPPFLAGS="[$]$1_INCLUDE $orig_CPPFLAGS"
     LIBS="[$]$1_LIBS $orig_LIBS"
     AC_CACHE_CHECK([for usable Python [$]$1_VERSION libraries],
@@ -339,4 +341,17 @@ if test ! -f ${real_srcdir}/src/$1/Makefile.in  -o  \
 fi
 ])
 
-m4_include([ax_jni_include_dir.m4])
+# AS_VAR_IF(VARIABLE, VALUE, IF-TRUE, IF-FALSE)
+# ---------------------------------------------
+# Implement a shell `if test $VARIABLE = VALUE; then-else'.
+# Polymorphic, and avoids sh expansion error upon interrupt or term signal.
+# (Taken from Autoconf 2.64, for the sake of ax_check_gnu_make.m4.)
+m4_define([AS_VAR_IF],
+[AS_LITERAL_IF([$1],
+  [AS_IF([test "x$$1" = x""$2], [$3], [$4])],
+  [AS_VAR_COPY([as_val], [$1])
+   AS_IF([test "x$as_val" = x""$2], [$3], [$4])])])
+
+m4_include([m4/ax_check_gnu_make.m4])
+m4_include([m4/ax_jni_include_dir.m4])
+m4_include([m4/ax_prog_cc_for_build.m4])
diff --git a/c++/src/build-system/config.h.in b/c++/src/build-system/config.h.in
index b640293..422f58e 100644
--- a/c++/src/build-system/config.h.in
+++ b/c++/src/build-system/config.h.in
@@ -3,6 +3,9 @@
 /* Define to 1 if necessary to get FIONBIO (e.g., on Solaris) */
 #undef BSD_COMP
 
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #undef HAVE_ARPA_INET_H
 
@@ -98,6 +101,9 @@
 /* Define to 1 if you have the `fseeko' function. */
 #undef HAVE_FSEEKO
 
+/* Define to 1 if you have the `fstat' function. */
+#undef HAVE_FSTAT
+
 /* Define to 1 if you have the <fstream> header file. */
 #undef HAVE_FSTREAM
 
@@ -142,6 +148,9 @@
 /* Define to 1 if you have the `getnameinfo' function. */
 #undef HAVE_GETNAMEINFO
 
+/* Define to 1 if you have the `getopt' function. */
+#undef HAVE_GETOPT
+
 /* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
@@ -239,6 +248,9 @@
 /* Define to 1 if libgcrypt is available. */
 #undef HAVE_LIBGCRYPT
 
+/* Define to 1 if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_H
+
 /* Define to 1 if libgif is available. */
 #undef HAVE_LIBGIF
 
@@ -322,6 +334,9 @@
 /* Define to 1 if libsablot is available. */
 #undef HAVE_LIBSABLOT
 
+/* Define to 1 if libsasl2 is available. */
+#undef HAVE_LIBSASL2
+
 /* Define to 1 if libdrmaa is available. */
 #undef HAVE_LIBSGE
 
@@ -364,6 +379,12 @@
 /* Define to 1 if you have the <limits> header file. */
 #undef HAVE_LIMITS
 
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
 /* Define to 1 if you have the `localtime_r' function. */
 #undef HAVE_LOCALTIME_R
 
@@ -436,6 +457,9 @@
 /* Define to 1 if you have the `pthread_atfork' function. */
 #undef HAVE_PTHREAD_ATFORK
 
+/* Define to 1 if you have the `pthread_condattr_setclock' function. */
+#undef HAVE_PTHREAD_CONDATTR_SETCLOCK
+
 /* Define to 1 if pthread mutexes are available. */
 #undef HAVE_PTHREAD_MUTEX
 
@@ -445,6 +469,9 @@
 /* Define to 1 if the PUBSEQ service is available. */
 #undef HAVE_PUBSEQ_OS
 
+/* Define to 1 if you have the `putenv' function. */
+#undef HAVE_PUTENV
+
 /* Define to 1 if Python libraries are available. */
 #undef HAVE_PYTHON
 
@@ -480,12 +507,18 @@
 /* Define to 1 if you have `union semun'. */
 #undef HAVE_SEMUN
 
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
 /* Define to 1 if you have the <signal.h> header file. */
 #undef HAVE_SIGNAL_H
 
 /* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */
 #undef HAVE_SIN_LEN
 
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
 /* Define to 1 if the system has the type `socklen_t'. */
 #undef HAVE_SOCKLEN_T
 
@@ -501,12 +534,18 @@
 /* Define to 1 if the system has the type `SQLLEN'. */
 #undef HAVE_SQLLEN
 
+/* Define to 1 if the system has the type `SQLSETPOSIROW'. */
+#undef HAVE_SQLSETPOSIROW
+
 /* Define to 1 if you have the `statfs' function. */
 #undef HAVE_STATFS
 
 /* Define to 1 if you have the `statvfs' function. */
 #undef HAVE_STATVFS
 
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -537,6 +576,9 @@
 /* Define to 1 if you have the `strndup' function. */
 #undef HAVE_STRNDUP
 
+/* Define to 1 if you have the `strsep' function. */
+#undef HAVE_STRSEP
+
 /* Define to 1 if you have the <strstream> header file. */
 #undef HAVE_STRSTREAM
 
@@ -622,6 +664,9 @@
 /* Define to 1 if you have the `utimes' function. */
 #undef HAVE_UTIMES
 
+/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
+#undef HAVE_VALGRIND_MEMCHECK_H
+
 /* Define to 1 if you have the `vasprintf' function. */
 #undef HAVE_VASPRINTF
 
@@ -879,6 +924,9 @@
 /* The size of `void*', as computed by sizeof. */
 #undef SIZEOF_VOIDP
 
+/* The size of `wchar_t', as computed by sizeof. */
+#undef SIZEOF_WCHAR_T
+
 /* The size of `__int64', as computed by sizeof. */
 #undef SIZEOF___INT64
 
diff --git a/c++/src/build-system/configure b/c++/src/build-system/configure
index 98a50f5..5749672 100755
--- a/c++/src/build-system/configure
+++ b/c++/src/build-system/configure
@@ -664,6 +664,21 @@ CPPFLAGS
 ac_ct_CC
 EXEEXT
 OBJEXT
+CPP
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+CC_FOR_BUILD
+ac_ct_CC_FOR_BUILD
+CPP
+CPPFLAGS
+CPP_FOR_BUILD
+BUILD_EXEEXT
+BUILD_OBJEXT
+CFLAGS_FOR_BUILD
+CPPFLAGS_FOR_BUILD
+LDFLAGS_FOR_BUILD
 CXX
 CXXFLAGS
 ac_ct_CXX
@@ -676,6 +691,9 @@ UNLESS_WITH_DLL
 STATIC
 USUAL_AND_DLL
 USUAL_AND_LIB
+AWK
+ifGNUmake
+MAKE
 LN_S
 RANLIB
 AR
@@ -693,7 +711,6 @@ LDD
 CXXCPP
 TCHECK_CL
 AMQ
-CPP
 Z_INCLUDE
 Z_LIBS
 BZ2_INCLUDE
@@ -725,11 +742,16 @@ FTDS64_LIB
 FTDS64_CTLIB_INCLUDE
 FTDS64_CTLIB_LIBS
 FTDS64_CTLIB_LIB
+FTDS95_INCLUDE
+FTDS95_LIBS
+FTDS95_LIB
+FTDS95_CTLIB_INCLUDE
+FTDS95_CTLIB_LIBS
+FTDS95_CTLIB_LIB
 FTDS_INCLUDE
 FTDS_LIBS
 FTDS_LIB
 freetds
-ftds64
 mysql_config
 PYTHON
 PYTHON_INCLUDE
@@ -743,6 +765,9 @@ PYTHON26_LIBS
 PYTHON27
 PYTHON27_INCLUDE
 PYTHON27_LIBS
+PYTHON3
+PYTHON3_INCLUDE
+PYTHON3_LIBS
 PERL
 _ACJNI_JAVAC
 XMKMF
@@ -798,6 +823,8 @@ GSOAP_LIBS
 AVRO_INCLUDE
 AVRO_LIBS
 AVROGENCPP
+SASL2_INCLUDE
+SASL2_LIBS
 MONGODB_INCLUDE
 MONGODB_LIBS
 GMOCK_INCLUDE
@@ -882,6 +909,9 @@ BDB_CACHE_LIB
 DBAPI_DRIVER
 DBAPI_CTLIB
 DBAPI_DBLIB
+DBAPI_FTDS
+DBAPI_FTDS64
+DBAPI_FTDS95
 DBAPI_MYSQL
 DBAPI_ODBC
 THREAD_LIBS
@@ -890,6 +920,7 @@ OPENMP_FLAGS
 UNSAFE_MATH_FLAG
 SSE4_1_FLAG
 AES_FLAG
+COLOR_DIAGNOSTICS
 NETWORK_LIBS
 NETWORK_PURE_LIBS
 RESOLVER_LIBS
@@ -1055,11 +1086,17 @@ CC
 CFLAGS
 LDFLAGS
 CPPFLAGS
+CPP
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+CPP
+CPPFLAGS
 CXX
 CXXFLAGS
 CCC
 CXXCPP
-CPP
 XMKMF'
 
 
@@ -1560,14 +1597,15 @@ autodep suffix hostspec version execopy bincopy lib-rebuilds lib-rebuilds=ask \
 deactivation makefile-auto-update projects flat-makefile configure-dialog \
 check ncbi-public strip pch caution ccache distcc \
 ncbi-c wxwidgets wxwidgets-ucs fastcgi sss sssdb sssutils included-sss \
-geo included-geo vdb downloaded-vdb included-vdb \
+geo included-geo vdb downloaded-vdb \
 z bz2 lzo pcre gmp gcrypt nettle gnutls openssl krb5 \
 sybase sybase-local sybase-new ftds mysql \
 orbacus freetype ftgl opengl mesa glut glew glew-mx \
 bdb python perl jni sqlite3 icu boost boost-tag \
 sp expat sablot libxml libxslt libexslt xerces xalan zorba \
 oechem sge muparser hdf5 \
-gif jpeg tiff png xpm magic curl mimetic gsoap avro cereal mongodb gmock 3psw \
+gif jpeg tiff png xpm \
+magic curl mimetic gsoap avro cereal sasl2 mongodb gmock 3psw \
 local-lbsm ncbi-crypt connext \
 serial objects dbapi app ctools gui algo internal gbench"
 
@@ -1618,6 +1656,8 @@ for x_arg in "$@" ; do
       fi
       ;;
 
+      --with-vdb=rc ) ;;
+
       --srcdir=* | --x-includes=* | --x-libraries=* | --with-tcheck=* \
       | --with-ncbi-c=* | --with-sss=* | --with-vdb=* | --with-z=* \
       | --with-bz2=* | --with-lzo=* | --with-pcre=* \
@@ -1634,7 +1674,8 @@ for x_arg in "$@" ; do
       | --with-sge=* | --with-muparser=* | --with-hdf5=* | --with-gif=* \
       | --with-jpeg=* | --with-png=* | --with-tiff=* | --with-xpm=* \
       | --with-magic=* | --with-curl=* | --with-mimetic=* | --with-gsoap=* \
-      | --with-avro=* | --with-cereal=* | --with-mongodb=* | --with-gmock=* )
+      | --with-avro=* | --with-cereal=* | --with-sasl2* | --with-mongodb=* \
+      | --with-gmock=* )
       # Confirm that the specified directory exists and is readable.
       dir=`echo $x_arg | sed -e 's/^[^=]*=//'`
       case "$x_arg" in
@@ -1825,7 +1866,6 @@ Optional Packages:
  --with-vdb=DIR          use NCBI SRA/VDB Toolkit installation in DIR
  --without-vdb           do not use the NCBI SRA/VDB Toolkit
  --with-downloaded-vdb   download and build SRA/VDB from GitHub
- --with-included-vdb     use the DEPRECATED bundled SRA/VDB Toolkit copy
  --with-z=DIR            use zlib installation in DIR
  --without-z             use internal copy of zlib
  --with-bz2=DIR          use bzlib installation in DIR
@@ -1940,6 +1980,8 @@ Optional Packages:
  --without-avro          do not use Apache Avro
  --with-cereal=DIR       use USC Cereal installation in DIR
  --without-cereal        do not use USC Cereal
+ --with-sasl2=DIR        use SASL 2 installation in DIR
+ --without-sasl2         do not use SASL 2
  --with-mongodb=DIR      use MongoDB installation in DIR
  --without-mongodb       do not use MongoDB
  --with-gmock=DIR        use Google Mock installation in DIR
@@ -1970,10 +2012,10 @@ Some influential environment variables:
               nonstandard directory <lib dir>
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor
-  CPP         C preprocessor
   XMKMF       Path to xmkmf, Makefile generator for X Window System
 
 Use these variables to override the choices made by `configure' or to help
@@ -1990,12 +2032,13 @@ if test "$ac_init_help" = "recursive"; then
     test -d "$ac_dir" || continue
     # Base source directories on path to *input* file.
 if test -n "$ac_f"; then
-   ac_dir_in=`$as_dirname -- "$ac_f" ||
-$as_expr X"$ac_f" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_f" : 'X\(//\)[^/]' \| \
-	 X"$ac_f" : 'X\(//\)$' \| \
-	 X"$ac_f" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_f" |
+   ac_f_rel=`echo "$ac_f" | sed -e 's,^/.*/\./,,'`
+   ac_dir_in=`$as_dirname -- "$ac_f_rel" ||
+$as_expr X"$ac_f_rel" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_f_rel" : 'X\(//\)[^/]' \| \
+	 X"$ac_f_rel" : 'X\(//\)$' \| \
+	 X"$ac_f_rel" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_f_rel" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -2460,6 +2503,12 @@ case "$with_3psw" in
          else
             with_cereal=no
          fi
+        if test "${with_sasl2-no}" != "no"; then
+            { echo "$as_me: error: incompatible options: --with-sasl2 but --without-3psw" >&2
+   { (exit 1); exit 1; }; }
+         else
+            with_sasl2=no
+         fi
         if test "${with_mongodb-no}" != "no"; then
             { echo "$as_me: error: incompatible options: --with-mongodb but --without-3psw" >&2
    { (exit 1); exit 1; }; }
@@ -3229,12 +3278,6 @@ if test "${with_downloaded_vdb+set}" = set; then
 fi
 
 
-# Check whether --with-included-vdb was given.
-if test "${with_included_vdb+set}" = set; then
-  withval=$with_included_vdb;
-fi
-
-
 ## Third-party and system packages
 
 # Check whether --with-z was given.
@@ -3921,6 +3964,18 @@ if test "${with_cereal2+set}" = set; then
 fi
 
 
+# Check whether --with-sasl2 was given.
+if test "${with_sasl2+set}" = set; then
+  withval=$with_sasl2;
+fi
+
+
+# Check whether --with-sasl2b was given.
+if test "${with_sasl2b+set}" = set; then
+  withval=$with_sasl2b;
+fi
+
+
 # Check whether --with-mongodb was given.
 if test "${with_mongodb+set}" = set; then
   withval=$with_mongodb;
@@ -4169,29 +4224,15 @@ echo "$as_me: error: incompatible options: --without-mt but --with-openmp" >&2;}
    : ${with_mt=yes}
 fi
 
-case "$with_downloaded_vdb:$with_included_vdb:$with_vdb" in
-   yes:yes:* )
-      { { echo "$as_me:$LINENO: error: incompatible options: --with-downloaded-vdb and
-                    --with-included-vdb" >&5
-echo "$as_me: error: incompatible options: --with-downloaded-vdb and
-                    --with-included-vdb" >&2;}
-   { (exit 1); exit 1; }; }
-      ;;
-   yes:*:no )
+case "$with_downloaded_vdb:$with_vdb" in
+   yes:no )
       { { echo "$as_me:$LINENO: error: incompatible options: --without-vdb but
                     --with-downloaded-vdb" >&5
 echo "$as_me: error: incompatible options: --without-vdb but
                     --with-downloaded-vdb" >&2;}
    { (exit 1); exit 1; }; }
       ;;
-   *:yes:no )
-      { { echo "$as_me:$LINENO: error: incompatible options: --without-vdb but
-                    --with-included-vdb" >&5
-echo "$as_me: error: incompatible options: --without-vdb but
-                    --with-included-vdb" >&2;}
-   { (exit 1); exit 1; }; }
-      ;;
-   yes:*: | *:yes: )
+   yes: )
       with_vdb=yes
       ;;
 esac
@@ -4511,17 +4552,28 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 #### Point ICC at a suitable GCC version ASAP.
 case "/$CXX" in
    */icpc )
-      if test -d /usr/local/gcc; then
+      if test -d /opt/ncbi/gcc -o -d /usr/local/gcc; then
          case "`$CXX -dumpversion`:$host_cpu" in
             *:i?86)           v=4.4.5 ;;
             ?.* | 1[01].* ) v=4.0.1 ;;
-            *)                v=4.4.2 ;;
+            1[23].*)        v=4.4.2 ;;
+            *)                v=4.9.3 ;;
          esac
-         gcc=/usr/local/gcc/$v/bin/gcc
-         if test -x $gcc; then
-            CC="$CC -gcc-name=$gcc"
-            CXX="$CXX -gcc-name=$gcc"
-         fi
+         for gcc in /opt/ncbi/gcc/$v/bin/gcc /usr/local/gcc/$v/bin/gcc; do
+            if test -x $gcc; then
+               CC="$CC -gcc-name=$gcc"
+               CXX="$CXX -gcc-name=$gcc"
+               case $gcc in
+                  /opt/* )
+                     LDFLAGS="-Wl,-rpath,/opt/ncbi/gcc/$v/lib64 $LDFLAGS"
+                     ;;
+                  /usr/* )
+                     LDFLAGS="-Wl,-rpath,/usr/lib64/gcc-$v $LDFLAGS"
+                     ;;
+               esac
+               break
+            fi
+         done
       fi
       ;;
 esac
@@ -5497,7 +5549,1035 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_prog_cc_c89=$ac_arg
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+
+save_cross_compiling=$cross_compiling
+save_ac_tool_prefix=$ac_tool_prefix
+cross_compiling=no
+ac_tool_prefix=
+
+ac_ext=c
+ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD'
+ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5'
+ac_build_link='$CC_FOR_BUILD -o conftest$ac_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC_FOR_BUILD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC_FOR_BUILD"; then
+  ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD
+if test -n "$CC_FOR_BUILD"; then
+  { echo "$as_me:$LINENO: result: $CC_FOR_BUILD" >&5
+echo "${ECHO_T}$CC_FOR_BUILD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC_FOR_BUILD"; then
+  ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC_FOR_BUILD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC_FOR_BUILD"; then
+  ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC_FOR_BUILD="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD
+if test -n "$ac_ct_CC_FOR_BUILD"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC_FOR_BUILD" >&5
+echo "${ECHO_T}$ac_ct_CC_FOR_BUILD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_CC_FOR_BUILD" = x; then
+    CC_FOR_BUILD=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the build triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the build triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD
+  fi
+else
+  CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD"
+fi
+
+if test -z "$CC_FOR_BUILD"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC_FOR_BUILD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC_FOR_BUILD"; then
+  ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD
+if test -n "$CC_FOR_BUILD"; then
+  { echo "$as_me:$LINENO: result: $CC_FOR_BUILD" >&5
+echo "${ECHO_T}$CC_FOR_BUILD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC_FOR_BUILD"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC_FOR_BUILD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC_FOR_BUILD"; then
+  ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC_FOR_BUILD="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC_FOR_BUILD
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC_FOR_BUILD to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC_FOR_BUILD="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD
+if test -n "$CC_FOR_BUILD"; then
+  { echo "$as_me:$LINENO: result: $CC_FOR_BUILD" >&5
+echo "${ECHO_T}$CC_FOR_BUILD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC_FOR_BUILD"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC_FOR_BUILD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC_FOR_BUILD"; then
+  ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC_FOR_BUILD="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD
+if test -n "$CC_FOR_BUILD"; then
+  { echo "$as_me:$LINENO: result: $CC_FOR_BUILD" >&5
+echo "${ECHO_T}$CC_FOR_BUILD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CC_FOR_BUILD" && break
+  done
+fi
+if test -z "$CC_FOR_BUILD"; then
+  ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC_FOR_BUILD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC_FOR_BUILD"; then
+  ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD
+if test -n "$ac_ct_CC_FOR_BUILD"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC_FOR_BUILD" >&5
+echo "${ECHO_T}$ac_ct_CC_FOR_BUILD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC_FOR_BUILD" && break
+done
+
+  if test "x$ac_ct_CC_FOR_BUILD" = x; then
+    CC_FOR_BUILD=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the build triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the build triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD
+  fi
+fi
+
+fi
+
+
+test -z "$CC_FOR_BUILD" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_build_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_build_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS_FOR_BUILD+set}
+ac_save_CFLAGS=$CFLAGS_FOR_BUILD
+{ echo "$as_me:$LINENO: checking whether $CC_FOR_BUILD accepts -g" >&5
+echo $ECHO_N "checking whether $CC_FOR_BUILD accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_build_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_build_prog_cc_g=no
+   CFLAGS_FOR_BUILD="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_build_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_build_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS_FOR_BUILD=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_build_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS_FOR_BUILD="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_build_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_build_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_build_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS_FOR_BUILD=$ac_save_CFLAGS
+elif test $ac_cv_build_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS_FOR_BUILD="-g -O2"
+  else
+    CFLAGS_FOR_BUILD="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS_FOR_BUILD="-O2"
+  else
+    CFLAGS_FOR_BUILD=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC_FOR_BUILD option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC_FOR_BUILD option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_build_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_prog_cc_c89=no
+ac_save_CC=$CC_FOR_BUILD
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC_FOR_BUILD="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_build_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_build_prog_cc_c89=$ac_arg
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -5506,14 +6586,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
 fi
 
 rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
+  test "x$ac_cv_build_prog_cc_c89" != "xno" && break
 done
 rm -f conftest.$ac_ext
-CC=$ac_save_CC
+CC_FOR_BUILD=$ac_save_CC
 
 fi
 # AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
+case "x$ac_cv_build_prog_cc_c89" in
   x)
     { echo "$as_me:$LINENO: result: none needed" >&5
 echo "${ECHO_T}none needed" >&6; } ;;
@@ -5521,18 +6601,286 @@ echo "${ECHO_T}none needed" >&6; } ;;
     { echo "$as_me:$LINENO: result: unsupported" >&5
 echo "${ECHO_T}unsupported" >&6; } ;;
   *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+    CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_build_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_build_prog_cc_c89" >&6; } ;;
 esac
 
 
 ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_build_cpp='$CXXCPP $CPPFLAGS_FOR_BUILD'
+ac_build_compile='$CXX -c $CXXFLAGS $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5'
+ac_build_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
+ac_ext=c
+ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD'
+ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5'
+ac_build_link='$CC_FOR_BUILD -o conftest$ac_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP_FOR_BUILD" && test -d "$CPP_FOR_BUILD"; then
+  CPP_FOR_BUILD=
+fi
+if test -z "$CPP_FOR_BUILD"; then
+  if test "${ac_cv_build_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_build_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_build_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_build_prog_CPP=$CPP_FOR_BUILD
+
+fi
+  CPP_FOR_BUILD=$ac_cv_build_prog_CPP
+else
+  ac_cv_build_prog_CPP=$CPP_FOR_BUILD
+fi
+{ echo "$as_me:$LINENO: result: $CPP_FOR_BUILD" >&5
+echo "${ECHO_T}$CPP_FOR_BUILD" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_build_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_build_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_build_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP_FOR_BUILD\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP_FOR_BUILD\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cpp
+ac_build_cpp='$CXXCPP $CPPFLAGS_FOR_BUILD'
+ac_build_compile='$CXX -c $CXXFLAGS $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5'
+ac_build_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+ac_tool_prefix=$save_ac_tool_prefix
+cross_compiling=$save_cross_compiling
+
+
+
+BUILD_EXEEXT=$ac_build_exeext
+BUILD_OBJEXT=$ac_build_objext
+
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6301,7 +7649,6 @@ if test -x "$x_CXX" ; then
   echo "adjusted C++ compiler: $CXX"
 fi
 CXX_PATH="`dirname $x_CXX`"
-x_CXX=
 
 if test "$with_static_exe" = "yes"; then
    C_LINK='$(top_srcdir)/scripts/common/impl/favor-static $(CC)'
@@ -6313,7 +7660,8 @@ fi
 
 ### Which of these is better?
 #compiler_root=`dirname CXX_PATH`
-compiler_root=`echo $CXX | sed -ne 's:\(.*\)[/\\]bin[/\\].*:\1:p'`
+compiler_root=`echo $x_CXX | sed -ne 's:\(.*\)[/\\]bin[/\\].*:\1:p'`
+x_CXX=
 
 
 
@@ -6499,6 +7847,7 @@ case "$host_os:$compiler" in
    ;;
 
  cygwin*:GCC )
+   CPPFLAGS="-D_GLIBCXX_USE_C99 $CPPFLAGS"
    with_dll="no"
    # : ${NETWORK_LIBS:="-lws2_32"}
    CONF_exe_ext=".exe"
@@ -7806,6 +9155,12 @@ echo "$as_me: WARNING: Unable to find static libstdc++ requested by --with-bin-r
     LINK="$LINK -Kc++"
     ;;
   ICC:1???:* )
+    case "$host_cpu" in
+       i?86   ) intel_cpu_name=ia32      ;;
+       x86_64 ) intel_cpu_name=intel64   ;;
+       *      ) intel_cpu_name=$host_cpu ;;
+    esac
+    LDFLAGS="$CONF_f_runpath$compiler_root/lib/$intel_cpu_name $LDFLAGS"
     # Suppress "warning #10237: -lcilkrts linked in dynamically, static
     # library not available" which is not a problem in practice due to
     # as-needed linkage.
@@ -7969,6 +9324,121 @@ case "$compiler" in
    * ) NO_STRICT_ALIASING=
 esac
 
+  for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+  { echo "$as_me:$LINENO: checking for GNU make" >&5
+echo $ECHO_N "checking for GNU make... $ECHO_C" >&6; }
+if test "${_cv_gnu_make_command+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      _cv_gnu_make_command="" ;
+    for a in "$MAKE" make gmake gnumake ; do
+      if test -z "$a" ; then continue ; fi ;
+      if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then
+        _cv_gnu_make_command=$a ;
+        AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make")
+        ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }')
+        break ;
+      fi
+    done ;
+fi
+{ echo "$as_me:$LINENO: result: $_cv_gnu_make_command" >&5
+echo "${ECHO_T}$_cv_gnu_make_command" >&6; }
+  if test "x$_cv_gnu_make_command" = x""""; then
+  ifGNUmake="#"
+else
+  ifGNUmake=""
+fi
+
+  if test "x$_cv_gnu_make_command" = x""""; then
+  $as_unset ax_cv_gnu_make_command || test "${ax_cv_gnu_make_command+set}" != set || { ax_cv_gnu_make_command=; export ax_cv_gnu_make_command; }
+else
+  ax_cv_gnu_make_command=${_cv_gnu_make_command}
+fi
+
+
+
+# Extract the first word of "${ax_cv_gnu_make_command-make}", so it can be a program name with args.
+set dummy ${ax_cv_gnu_make_command-make}; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MAKE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAKE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+MAKE=$ac_cv_path_MAKE
+if test -n "$MAKE"; then
+  { echo "$as_me:$LINENO: result: $MAKE" >&5
+echo "${ECHO_T}$MAKE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+export MAKE
 
 #### Automatic generation of dependencies for/by the "make" utility
 case "$host_os" in
@@ -7979,7 +9449,7 @@ if test "$with_autodep" = "yes" ; then
    Rules="rules_with_autodep"
 elif test "$with_autodep" = "no" ; then
    Rules="rules"
-elif make --version 2>/dev/null | grep 'GNU Make' >/dev/null ; then
+elif $MAKE --version 2>/dev/null | grep 'GNU Make' >/dev/null ; then
    Rules="rules_with_autodep"
 else
    Rules="rules"
@@ -11922,7 +13392,8 @@ done
 
 
 
-for ac_header in inttypes.h limits
+
+for ac_header in inttypes.h limits limits.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -13059,7 +14530,7 @@ fi
 done
  ;;
 esac
-# for FreeTDS 0.6x
+# for FreeTDS
 
 
 
@@ -13073,9 +14544,14 @@ esac
 
 
 
-for ac_header in arpa/inet.h errno.h malloc.h netdb.h \
-                 netinet/in.h netinet/tcp.h paths.h signal.h \
-                 sys/ioctl.h sys/select.h sys/socket.h sys/time.h wchar.h
+
+
+
+
+for ac_header in arpa/inet.h errno.h libgen.h locale.h malloc.h netdb.h \
+                 netinet/in.h netinet/tcp.h paths.h signal.h stddef.h \
+                 sys/ioctl.h sys/select.h sys/socket.h sys/time.h \
+                 valgrind/memcheck.h wchar.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -14561,12 +16037,18 @@ done
 
 
 
-for ac_func in euidaccess atoll basename lchown fseeko getgrouplist \
-               getpagesize getpass getpassphrase getpwuid getrusage \
-               gettimeofday getuid memrchr readpassphrase readv usleep \
-               asprintf vasprintf vsnprintf select statfs statvfs \
-               strcasecmp strlcat strlcpy strdup strndup strtok_r \
-               sysmp timegm utimes lutimes writev
+
+
+
+
+
+
+for ac_func in alarm asprintf atoll basename euidaccess fseeko fstat \
+               getgrouplist getopt getpagesize getpass getpassphrase \
+               getpwuid getrusage gettimeofday getuid lchown lutimes memrchr \
+               putenv readpassphrase readv select setenv statfs statvfs \
+               strcasecmp strdup strlcat strlcpy strndup strsep strtok_r \
+               sysmp timegm usleep utimes vasprintf vsnprintf writev
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -15713,28 +17195,528 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_char_unsigned=no
+  ac_cv_c_char_unsigned=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_c_char_unsigned=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5
+echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; }
+if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define __CHAR_UNSIGNED__ 1
+_ACEOF
+
+fi
+
+   { echo "$as_me:$LINENO: checking for char" >&5
+echo $ECHO_N "checking for char... $ECHO_C" >&6; }
+if test "${ac_cv_type_char+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+typedef char ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_char=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_char=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
+echo "${ECHO_T}$ac_cv_type_char" >&6; }
+
+{ echo "$as_me:$LINENO: checking size of char" >&5
+echo $ECHO_N "checking size of char... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_char+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_char" = yes; then
+  # The cast to long int works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+		   typedef char ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+		   typedef char ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+		   typedef char ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+		   typedef char ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+		   typedef char ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_char_unsigned=yes
+	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5
-echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; }
-if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define __CHAR_UNSIGNED__ 1
+done
+case $ac_lo in
+?*) ac_cv_sizeof_char=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (char)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; } ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+		   typedef char ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_char=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (char)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_char=0
 fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
+echo "${ECHO_T}$ac_cv_sizeof_char" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_CHAR $ac_cv_sizeof_char
+_ACEOF
 
-   { echo "$as_me:$LINENO: checking for char" >&5
-echo $ECHO_N "checking for char... $ECHO_C" >&6; }
-if test "${ac_cv_type_char+set}" = set; then
+
+   { echo "$as_me:$LINENO: checking for double" >&5
+echo $ECHO_N "checking for double... $ECHO_C" >&6; }
+if test "${ac_cv_type_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -15744,7 +17726,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef char ac__type_new_;
+typedef double ac__type_new_;
 int
 main ()
 {
@@ -15790,25 +17772,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_char=yes
+  ac_cv_type_double=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_char=no
+	ac_cv_type_double=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
-echo "${ECHO_T}$ac_cv_type_char" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5
+echo "${ECHO_T}$ac_cv_type_double" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of char" >&5
-echo $ECHO_N "checking size of char... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_char+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of double" >&5
+echo $ECHO_N "checking size of double... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_char" = yes; then
+  if test "$ac_cv_type_double" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -15822,7 +17804,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef char ac__type_sizeof_;
+		   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -15876,7 +17858,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef char ac__type_sizeof_;
+		   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -15947,7 +17929,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef char ac__type_sizeof_;
+		   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -16001,7 +17983,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef char ac__type_sizeof_;
+		   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -16082,7 +18064,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef char ac__type_sizeof_;
+		   typedef double ac__type_sizeof_;
 int
 main ()
 {
@@ -16138,10 +18120,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_char=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
+?*) ac_cv_sizeof_double=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char)
+echo "$as_me: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -16153,7 +18135,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef char ac__type_sizeof_;
+		   typedef double ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -16205,16 +18187,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_char=`cat conftest.val`
+  ac_cv_sizeof_double=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char)
+echo "$as_me: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -16222,19 +18204,19 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_char=0
+  ac_cv_sizeof_double=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
-echo "${ECHO_T}$ac_cv_sizeof_char" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5
+echo "${ECHO_T}$ac_cv_sizeof_double" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR $ac_cv_sizeof_char
+#define SIZEOF_DOUBLE $ac_cv_sizeof_double
 _ACEOF
 
 
-   { echo "$as_me:$LINENO: checking for double" >&5
-echo $ECHO_N "checking for double... $ECHO_C" >&6; }
-if test "${ac_cv_type_double+set}" = set; then
+   { echo "$as_me:$LINENO: checking for float" >&5
+echo $ECHO_N "checking for float... $ECHO_C" >&6; }
+if test "${ac_cv_type_float+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -16244,7 +18226,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef double ac__type_new_;
+typedef float ac__type_new_;
 int
 main ()
 {
@@ -16290,25 +18272,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_double=yes
+  ac_cv_type_float=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_double=no
+	ac_cv_type_float=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5
-echo "${ECHO_T}$ac_cv_type_double" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5
+echo "${ECHO_T}$ac_cv_type_float" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of double" >&5
-echo $ECHO_N "checking size of double... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_double+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of float" >&5
+echo $ECHO_N "checking size of float... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_float+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_double" = yes; then
+  if test "$ac_cv_type_float" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -16322,7 +18304,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+		   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -16376,7 +18358,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+		   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -16447,7 +18429,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+		   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -16501,7 +18483,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+		   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -16582,7 +18564,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+		   typedef float ac__type_sizeof_;
 int
 main ()
 {
@@ -16638,10 +18620,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_double=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+?*) ac_cv_sizeof_float=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (double)
+echo "$as_me: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -16653,7 +18635,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef double ac__type_sizeof_;
+		   typedef float ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -16705,16 +18687,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_double=`cat conftest.val`
+  ac_cv_sizeof_float=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (double)
+echo "$as_me: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -16722,19 +18704,19 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_double=0
+  ac_cv_sizeof_float=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5
-echo "${ECHO_T}$ac_cv_sizeof_double" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5
+echo "${ECHO_T}$ac_cv_sizeof_float" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_DOUBLE $ac_cv_sizeof_double
+#define SIZEOF_FLOAT $ac_cv_sizeof_float
 _ACEOF
 
 
-   { echo "$as_me:$LINENO: checking for float" >&5
-echo $ECHO_N "checking for float... $ECHO_C" >&6; }
-if test "${ac_cv_type_float+set}" = set; then
+   { echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6; }
+if test "${ac_cv_type_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -16744,7 +18726,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef float ac__type_new_;
+typedef int ac__type_new_;
 int
 main ()
 {
@@ -16790,25 +18772,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_float=yes
+  ac_cv_type_int=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_float=no
+	ac_cv_type_int=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5
-echo "${ECHO_T}$ac_cv_type_float" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of float" >&5
-echo $ECHO_N "checking size of float... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_float+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_float" = yes; then
+  if test "$ac_cv_type_int" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -16822,7 +18804,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -16876,7 +18858,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -16947,7 +18929,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -17001,7 +18983,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -17082,7 +19064,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+		   typedef int ac__type_sizeof_;
 int
 main ()
 {
@@ -17138,10 +19120,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_float=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (float)
+echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -17153,7 +19135,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef float ac__type_sizeof_;
+		   typedef int ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -17205,16 +19187,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_float=`cat conftest.val`
+  ac_cv_sizeof_int=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (float)
+echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -17222,19 +19204,19 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_float=0
+  ac_cv_sizeof_int=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5
-echo "${ECHO_T}$ac_cv_sizeof_float" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_FLOAT $ac_cv_sizeof_float
+#define SIZEOF_INT $ac_cv_sizeof_int
 _ACEOF
 
 
-   { echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6; }
-if test "${ac_cv_type_int+set}" = set; then
+   { echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -17244,7 +19226,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef int ac__type_new_;
+typedef long ac__type_new_;
 int
 main ()
 {
@@ -17290,25 +19272,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_int=yes
+  ac_cv_type_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_int=no
+	ac_cv_type_long=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_int" = yes; then
+  if test "$ac_cv_type_long" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -17322,7 +19304,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -17376,7 +19358,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -17447,7 +19429,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -17501,7 +19483,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -17582,7 +19564,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+		   typedef long ac__type_sizeof_;
 int
 main ()
 {
@@ -17638,10 +19620,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
+echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -17653,7 +19635,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef int ac__type_sizeof_;
+		   typedef long ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -17705,16 +19687,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_int=`cat conftest.val`
+  ac_cv_sizeof_long=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
+echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -17722,19 +19704,19 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_int=0
+  ac_cv_sizeof_long=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
+#define SIZEOF_LONG $ac_cv_sizeof_long
 _ACEOF
 
 
-   { echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long+set}" = set; then
+   { echo "$as_me:$LINENO: checking for long double" >&5
+echo $ECHO_N "checking for long double... $ECHO_C" >&6; }
+if test "${ac_cv_type_long_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -17744,7 +19726,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef long ac__type_new_;
+typedef long double ac__type_new_;
 int
 main ()
 {
@@ -17790,25 +19772,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_long=yes
+  ac_cv_type_long_double=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_long=no
+	ac_cv_type_long_double=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5
+echo "${ECHO_T}$ac_cv_type_long_double" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of long double" >&5
+echo $ECHO_N "checking size of long double... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long" = yes; then
+  if test "$ac_cv_type_long_double" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -17822,7 +19804,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+		   typedef long double ac__type_sizeof_;
 int
 main ()
 {
@@ -17876,7 +19858,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+		   typedef long double ac__type_sizeof_;
 int
 main ()
 {
@@ -17947,7 +19929,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+		   typedef long double ac__type_sizeof_;
 int
 main ()
 {
@@ -18001,7 +19983,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+		   typedef long double ac__type_sizeof_;
 int
 main ()
 {
@@ -18082,7 +20064,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+		   typedef long double ac__type_sizeof_;
 int
 main ()
 {
@@ -18138,10 +20120,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+?*) ac_cv_sizeof_long_double=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
+echo "$as_me: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -18153,7 +20135,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long ac__type_sizeof_;
+		   typedef long double ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -18205,16 +20187,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_long=`cat conftest.val`
+  ac_cv_sizeof_long_double=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
+echo "$as_me: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -18222,19 +20204,19 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_long=0
+  ac_cv_sizeof_long_double=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
+#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
 _ACEOF
 
 
-   { echo "$as_me:$LINENO: checking for long double" >&5
-echo $ECHO_N "checking for long double... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_double+set}" = set; then
+   { echo "$as_me:$LINENO: checking for long long" >&5
+echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -18244,7 +20226,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef long double ac__type_new_;
+typedef long long ac__type_new_;
 int
 main ()
 {
@@ -18290,25 +20272,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_long_double=yes
+  ac_cv_type_long_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_long_double=no
+	ac_cv_type_long_long=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5
-echo "${ECHO_T}$ac_cv_type_long_double" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of long double" >&5
-echo $ECHO_N "checking size of long double... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long_double+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of long long" >&5
+echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long_double" = yes; then
+  if test "$ac_cv_type_long_long" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -18322,7 +20304,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long double ac__type_sizeof_;
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -18376,7 +20358,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long double ac__type_sizeof_;
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -18447,7 +20429,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long double ac__type_sizeof_;
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -18501,7 +20483,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long double ac__type_sizeof_;
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -18582,7 +20564,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long double ac__type_sizeof_;
+		   typedef long long ac__type_sizeof_;
 int
 main ()
 {
@@ -18638,10 +20620,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_long_double=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
+?*) ac_cv_sizeof_long_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long double)
+echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -18653,7 +20635,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long double ac__type_sizeof_;
+		   typedef long long ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -18705,16 +20687,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_long_double=`cat conftest.val`
+  ac_cv_sizeof_long_long=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long double)
+echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -18722,19 +20704,19 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_long_double=0
+  ac_cv_sizeof_long_long=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
 _ACEOF
 
 
-   { echo "$as_me:$LINENO: checking for long long" >&5
-echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_long+set}" = set; then
+   { echo "$as_me:$LINENO: checking for short" >&5
+echo $ECHO_N "checking for short... $ECHO_C" >&6; }
+if test "${ac_cv_type_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -18744,7 +20726,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef long long ac__type_new_;
+typedef short ac__type_new_;
 int
 main ()
 {
@@ -18790,25 +20772,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_long_long=yes
+  ac_cv_type_short=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_long_long=no
+	ac_cv_type_short=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
+echo "${ECHO_T}$ac_cv_type_short" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of long long" >&5
-echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of short" >&5
+echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long_long" = yes; then
+  if test "$ac_cv_type_short" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -18822,7 +20804,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -18876,7 +20858,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -18947,7 +20929,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -19001,7 +20983,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -19082,7 +21064,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+		   typedef short ac__type_sizeof_;
 int
 main ()
 {
@@ -19138,10 +21120,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_long_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+?*) ac_cv_sizeof_short=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
+echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -19153,7 +21135,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef long long ac__type_sizeof_;
+		   typedef short ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -19205,16 +21187,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_long_long=`cat conftest.val`
+  ac_cv_sizeof_short=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
+echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -19222,19 +21204,19 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_long_long=0
+  ac_cv_sizeof_short=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
+echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+#define SIZEOF_SHORT $ac_cv_sizeof_short
 _ACEOF
 
 
-   { echo "$as_me:$LINENO: checking for short" >&5
-echo $ECHO_N "checking for short... $ECHO_C" >&6; }
-if test "${ac_cv_type_short+set}" = set; then
+   { echo "$as_me:$LINENO: checking for void*" >&5
+echo $ECHO_N "checking for void*... $ECHO_C" >&6; }
+if test "${ac_cv_type_voidp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -19244,7 +21226,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef short ac__type_new_;
+typedef void* ac__type_new_;
 int
 main ()
 {
@@ -19290,25 +21272,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_short=yes
+  ac_cv_type_voidp=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_short=no
+	ac_cv_type_voidp=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
-echo "${ECHO_T}$ac_cv_type_short" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_voidp" >&5
+echo "${ECHO_T}$ac_cv_type_voidp" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of short" >&5
-echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_short+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of void*" >&5
+echo $ECHO_N "checking size of void*... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_voidp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_short" = yes; then
+  if test "$ac_cv_type_voidp" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -19322,7 +21304,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+		   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -19376,7 +21358,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+		   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -19447,7 +21429,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+		   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -19501,7 +21483,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+		   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -19582,7 +21564,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+		   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -19638,10 +21620,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_short=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+?*) ac_cv_sizeof_voidp=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short)
+echo "$as_me: error: cannot compute sizeof (void*)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -19653,7 +21635,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-		   typedef short ac__type_sizeof_;
+		   typedef void* ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -19705,16 +21687,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_short=`cat conftest.val`
+  ac_cv_sizeof_voidp=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void*)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short)
+echo "$as_me: error: cannot compute sizeof (void*)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -19722,19 +21704,19 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_short=0
+  ac_cv_sizeof_voidp=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
-echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5
+echo "${ECHO_T}$ac_cv_sizeof_voidp" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
+#define SIZEOF_VOIDP $ac_cv_sizeof_voidp
 _ACEOF
 
 
-   { echo "$as_me:$LINENO: checking for void*" >&5
-echo $ECHO_N "checking for void*... $ECHO_C" >&6; }
-if test "${ac_cv_type_voidp+set}" = set; then
+   { echo "$as_me:$LINENO: checking for wchar_t" >&5
+echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_wchar_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -19743,8 +21725,9 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-typedef void* ac__type_new_;
+#include <wchar.h>
+
+typedef wchar_t ac__type_new_;
 int
 main ()
 {
@@ -19790,25 +21773,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_voidp=yes
+  ac_cv_type_wchar_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_voidp=no
+	ac_cv_type_wchar_t=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_voidp" >&5
-echo "${ECHO_T}$ac_cv_type_voidp" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5
+echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; }
 
-{ echo "$as_me:$LINENO: checking size of void*" >&5
-echo $ECHO_N "checking size of void*... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_voidp+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of wchar_t" >&5
+echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_wchar_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_voidp" = yes; then
+  if test "$ac_cv_type_wchar_t" = yes; then
   # The cast to long int works around a bug in the HP C Compiler
   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -19821,8 +21804,9 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-		   typedef void* ac__type_sizeof_;
+#include <wchar.h>
+
+		   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -19875,8 +21859,9 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-		   typedef void* ac__type_sizeof_;
+#include <wchar.h>
+
+		   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -19946,8 +21931,9 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-		   typedef void* ac__type_sizeof_;
+#include <wchar.h>
+
+		   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -20000,8 +21986,9 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-		   typedef void* ac__type_sizeof_;
+#include <wchar.h>
+
+		   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -20081,8 +22068,9 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-		   typedef void* ac__type_sizeof_;
+#include <wchar.h>
+
+		   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
@@ -20138,10 +22126,10 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_voidp=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*)
+?*) ac_cv_sizeof_wchar_t=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void*)
+echo "$as_me: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; } ;;
 esac
@@ -20152,8 +22140,9 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-		   typedef void* ac__type_sizeof_;
+#include <wchar.h>
+
+		   typedef wchar_t ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -20205,16 +22194,16 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_voidp=`cat conftest.val`
+  ac_cv_sizeof_wchar_t=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void*)
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void*)
+echo "$as_me: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
@@ -20222,13 +22211,13 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 else
-  ac_cv_sizeof_voidp=0
+  ac_cv_sizeof_wchar_t=0
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5
-echo "${ECHO_T}$ac_cv_sizeof_voidp" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; }
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_VOIDP $ac_cv_sizeof_voidp
+#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
 _ACEOF
 
 
@@ -23619,6 +25608,83 @@ fi
 { echo "$as_me:$LINENO: result: $ncbi_cv_cc_aes" >&5
 echo "${ECHO_T}$ncbi_cv_cc_aes" >&6; }
 
+if test "$compiler" = ICC; then
+   # ICC noisily ignores this flag, so explicitly blacklist it.
+   ncbi_cv_cc_fdiagnostics_color_always=no
+fi
+{ echo "$as_me:$LINENO: checking whether $CC supports -fdiagnostics-color=always" >&5
+echo $ECHO_N "checking whether $CC supports -fdiagnostics-color=always... $ECHO_C" >&6; }
+if test "${ncbi_cv_cc_fdiagnostics_color_always+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  CFLAGS="$orig_CFLAGS -fdiagnostics-color=always"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ncbi_cv_cc_fdiagnostics_color_always=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ncbi_cv_cc_fdiagnostics_color_always=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ncbi_cv_cc_fdiagnostics_color_always" >&5
+echo "${ECHO_T}$ncbi_cv_cc_fdiagnostics_color_always" >&6; }
+if test $ncbi_cv_cc_fdiagnostics_color_always = yes; then
+   COLOR_DIAGNOSTICS=-fdiagnostics-color=always
+else
+   COLOR_DIAGNOSTICS=
+fi
+
 CFLAGS=$orig_CFLAGS
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -24175,8 +26241,9 @@ _ACEOF
 
 
 
+
 for ac_func in freehostent gethostent_r getipnodebyaddr getipnodebyname \
-               inet_ntop
+               inet_ntop socketpair
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -25288,7 +27355,8 @@ if test -n "$DEMANGLE_LIBS$RT_LIBS"; then
 fi
 
 
-for ac_func in nanosleep sched_yield
+
+for ac_func in nanosleep pthread_condattr_setclock sched_yield
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -25541,6 +27609,7 @@ fi
 { echo "$as_me:$LINENO: result: $ac_cv_search_iconv" >&5
 echo "${ECHO_T}$ac_cv_search_iconv" >&6; }
 if test "x$ac_cv_search_iconv" != xno; then
+             WithPackages="$WithPackages${WithPackagesSep}Iconv"; WithPackagesSep=" "
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_LIBICONV 1
@@ -28216,8 +30285,6 @@ _ACEOF
 ## SYBASE libraries
 
 NETWORK_PURE_LIBS="$NETWORK_LIBS"
-ncbi_xreader_pubseqos=
-UNLESS_PUBSEQOS=
 if test "$with_sybase" != "no" ; then
    resolve_sybase=true
    default_pointer=default-${NCBI_PLATFORM_BITS}bit
@@ -28573,32 +30640,6 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
       fi
-      if test "$with_dbapi" != no -a -f ${real_srcdir}/src/objtools/data_loaders/genbank/pubseq/Makefile.ncbi_xreader_pubseqos.lib ; then
-         { echo "$as_me:$LINENO: checking for PubSeq service availability" >&5
-echo $ECHO_N "checking for PubSeq service availability... $ECHO_C" >&6; }
-if test "${ncbi_cv_db_pubseq+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if grep PUBSEQ_OS $SYBASE_PATH/interfaces >/dev/null; then
-                ncbi_cv_db_pubseq=yes
-             else
-                ncbi_cv_db_pubseq=no
-             fi
-fi
-{ echo "$as_me:$LINENO: result: $ncbi_cv_db_pubseq" >&5
-echo "${ECHO_T}$ncbi_cv_db_pubseq" >&6; }
-         if test "$ncbi_cv_db_pubseq" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PUBSEQ_OS 1
-_ACEOF
-
-                      WithFeatures="$WithFeatures${WithFeaturesSep}PubSeqOS"; WithFeaturesSep=" "
-            ncbi_xreader_pubseqos=ncbi_xreader_pubseqos
-            ncbi_xreader_pubseqos2=ncbi_xreader_pubseqos2
-            UNLESS_PUBSEQOS=\#
-         fi
-      fi
 
       SYBASE_DBLIBS="$SYBASE_LPATH -lsybdb${bit64_sfx} $sybunic"
       { echo "$as_me:$LINENO: checking for Sybase DBLib" >&5
@@ -28717,12 +30758,13 @@ SYBASE_LIBPATH=
 ## FreeTDS libraries
 freetds=
 if test "$with_ftds" != "no" ; then
-   ftds64=ftds64
+   ftds_ver=64
    try_local=yes
    case "$with_ftds" in
-      64 | yes | '' )
-         ftds_ver=64
-         ftds64=ftds
+      64 | 0.64 | yes | '' )
+         ;;
+      95 | 0.95 )
+         ftds_ver=95
          ;;
       * )
          FTDS_PATH=$with_ftds
@@ -28777,6 +30819,22 @@ if test "$with_ftds" != "no" ; then
       FTDS64_LIBS='$(FTDS64_CTLIB_LIBS)'
       FTDS64_INCLUDE='$(FTDS64_CTLIB_INCLUDE)'
 
+   d="dbapi/driver/ftds95/freetds"
+      if test $try_local = yes -a -f "${real_srcdir}/src/$d/Makefile.in" ; then
+         test "$ftds_ver" = 95  &&  FTDS_PATH="<$d>"
+         FTDS95_CTLIB_LIB="ct_ftds95${STATIC} tds_ftds95${STATIC}"
+         FTDS95_CTLIB_LIBS='$(ICONV_LIBS) $(KRB5_LIBS)'
+         FTDS95_CTLIB_INCLUDE="-I\$(includedir)/$d -I\$(includedir0)/$d"
+         freetds=freetds
+      elif test -d "$FTDS_PATH" ; then
+         FTDS95_CTLIB_LIB=
+         FTDS95_CTLIB_LIBS=$FTDS_CTLIBS
+         FTDS95_CTLIB_INCLUDE=$FTDS_INCLUDE
+      fi
+      FTDS95_LIB='$(FTDS95_CTLIB_LIB)'
+      FTDS95_LIBS='$(FTDS95_CTLIB_LIBS)'
+      FTDS95_INCLUDE='$(FTDS95_CTLIB_INCLUDE)'
+
    if test -n "$freetds" ; then
       FTDS_LIB="\$(FTDS${ftds_ver}_LIB)"
       FTDS_LIBS="\$(FTDS${ftds_ver}_LIBS)"
@@ -28891,6 +30949,12 @@ if test "$with_ftds" = "no" ; then
    FTDS64_CTLIB_INCLUDE=
    FTDS64_CTLIB_LIBS=
    FTDS64_CTLIB_LIB=
+   FTDS95_INCLUDE=
+   FTDS95_LIBS=
+   FTDS95_LIB=
+   FTDS95_CTLIB_INCLUDE=
+   FTDS95_CTLIB_LIBS=
+   FTDS95_CTLIB_LIB=
    freetds=
 else
 
@@ -28913,6 +30977,11 @@ fi
 
 
 
+
+
+
+
+
 ## MySQL
 if test "$with_mysql" != "no" ; then
    case "$with_mysql" in
@@ -29628,142 +31697,221 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_func in SQLGetPrivateProfileString
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+      { echo "$as_me:$LINENO: checking for SQLLEN" >&5
+echo $ECHO_N "checking for SQLLEN... $ECHO_C" >&6; }
+if test "${ac_cv_type_SQLLEN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sqltypes.h>
+
+typedef SQLLEN ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_SQLLEN=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_Header=no"
+	ac_cv_type_SQLLEN=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_func in SQLGetPrivateProfileString
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
+{ echo "$as_me:$LINENO: result: $ac_cv_type_SQLLEN" >&5
+echo "${ECHO_T}$ac_cv_type_SQLLEN" >&6; }
+if test $ac_cv_type_SQLLEN = yes; then
 
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SQLLEN 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
 
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
 fi
-done
-
-      { echo "$as_me:$LINENO: checking for SQLLEN" >&5
-echo $ECHO_N "checking for SQLLEN... $ECHO_C" >&6; }
-if test "${ac_cv_type_SQLLEN+set}" = set; then
+{ echo "$as_me:$LINENO: checking for SQLSETPOSIROW" >&5
+echo $ECHO_N "checking for SQLSETPOSIROW... $ECHO_C" >&6; }
+if test "${ac_cv_type_SQLSETPOSIROW+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -29774,7 +31922,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sqltypes.h>
 
-typedef SQLLEN ac__type_new_;
+typedef SQLSETPOSIROW ac__type_new_;
 int
 main ()
 {
@@ -29820,22 +31968,22 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_SQLLEN=yes
+  ac_cv_type_SQLSETPOSIROW=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_SQLLEN=no
+	ac_cv_type_SQLSETPOSIROW=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_SQLLEN" >&5
-echo "${ECHO_T}$ac_cv_type_SQLLEN" >&6; }
-if test $ac_cv_type_SQLLEN = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_SQLSETPOSIROW" >&5
+echo "${ECHO_T}$ac_cv_type_SQLSETPOSIROW" >&6; }
+if test $ac_cv_type_SQLSETPOSIROW = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLLEN 1
+#define HAVE_SQLSETPOSIROW 1
 _ACEOF
 
 
@@ -29853,7 +32001,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sql.h>>
+#include <sql.h>
               SQLRETURN SQL_API SQLColAttribute
                 (SQLHSTMT sh, SQLUSMALLINT cn, SQLUSMALLINT fi, SQLPOINTER ca,
                  SQLSMALLINT bl, SQLSMALLINT *sl, SQLLEN *na);
@@ -29932,6 +32080,14 @@ case "$ODBC_PATH" in
 #define HAVE_SQLLEN 1
 _ACEOF
 
+   cat >>confdefs.h <<\_ACEOF
+#define HAVE_SQLSETPOSIROW 1
+_ACEOF
+
+   cat >>confdefs.h <<\_ACEOF
+#define NCBI_SQLCOLATTRIBUTE_SQLLEN 1
+_ACEOF
+
    ;;
  *)
              WithPackages="$WithPackages${WithPackagesSep}ODBC"; WithPackagesSep=" "
@@ -29962,7 +32118,7 @@ else
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$PYTHON_PATH/bin:$PATH:/usr/local/python-/bin"
+as_dummy="${PYTHON_PATH+$PYTHON_PATH/bin:}$PATH:/usr/local/python-/bin"
 for as_dir in $as_dummy
 do
   IFS=$as_save_IFS
@@ -29991,15 +32147,16 @@ fi
 
 
  if test -x "$PYTHON"; then
-    PYTHON_VERSION=`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var("VERSION")' 2>/dev/null`
+    PYTHON_VERSION=`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var("VERSION"))' 2>/dev/null`
  else
     PYTHON_VERSION=
     ncbi_cv_lib_python=no
  fi
  if test -n "$PYTHON_VERSION"; then
-    PYTHON_INCLUDE=`$PYTHON -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print "-I%s -I%s" % (f(), f(True))'`
-    PYTHON_LIBPATH=`$PYTHON -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL"))'`
-    PYTHON_DEPS=`$PYTHON -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS"))'`
+    PYTHON_INCLUDE=`$PYTHON -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print("-I%s -I%s" % (f(), f(True)))'`
+    PYTHON_LIBPATH=`$PYTHON -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL")))'`
+    PYTHON_DEPS=`$PYTHON -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS")))'`
+    PYTHON_LDVERSION=`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var("LDVERSION") or sysconfig.get_config_var("VERSION"))' 2>/dev/null`
     ncbi_rp_L_flags=
  ncbi_rp_L_sep=$CONF_f_libpath
  if test "x${CONF_f_runpath}" = "x${CONF_f_libpath}"; then
@@ -30012,7 +32169,7 @@ fi
        ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
        ncbi_rp_L_sep=" $CONF_f_libpath"
     done
-    PYTHON_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON_VERSION $PYTHON_DEPS"
+    PYTHON_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON_LDVERSION $PYTHON_DEPS"
  else
     ncbi_rp_R_flags=
     ncbi_rp_R_sep=" $CONF_f_runpath"
@@ -30028,7 +32185,7 @@ fi
        ncbi_rp_R_flags="${ncbi_rp_R_flags}${ncbi_rp_R_sep}$x"
        ncbi_rp_R_sep=:
     done
-    PYTHON_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON_VERSION $PYTHON_DEPS"
+    PYTHON_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON_LDVERSION $PYTHON_DEPS"
  fi
     CPPFLAGS="$PYTHON_INCLUDE $orig_CPPFLAGS"
     LIBS="$PYTHON_LIBS $orig_LIBS"
@@ -30136,7 +32293,7 @@ else
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$PYTHON_PATH/bin:$PATH:/usr/local/python-2.5/bin"
+as_dummy="${PYTHON_PATH+$PYTHON_PATH/bin:}$PATH:/usr/local/python-2.5/bin"
 for as_dir in $as_dummy
 do
   IFS=$as_save_IFS
@@ -30165,15 +32322,16 @@ fi
 
 
  if test -x "$PYTHON25"; then
-    PYTHON25_VERSION=`$PYTHON25 -c 'from distutils import sysconfig; print sysconfig.get_config_var("VERSION")' 2>/dev/null`
+    PYTHON25_VERSION=`$PYTHON25 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("VERSION"))' 2>/dev/null`
  else
     PYTHON25_VERSION=
     ncbi_cv_lib_python25=no
  fi
  if test -n "$PYTHON25_VERSION"; then
-    PYTHON25_INCLUDE=`$PYTHON25 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print "-I%s -I%s" % (f(), f(True))'`
-    PYTHON25_LIBPATH=`$PYTHON25 -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL"))'`
-    PYTHON25_DEPS=`$PYTHON25 -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS"))'`
+    PYTHON25_INCLUDE=`$PYTHON25 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print("-I%s -I%s" % (f(), f(True)))'`
+    PYTHON25_LIBPATH=`$PYTHON25 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL")))'`
+    PYTHON25_DEPS=`$PYTHON25 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS")))'`
+    PYTHON25_LDVERSION=`$PYTHON25 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("LDVERSION") or sysconfig.get_config_var("VERSION"))' 2>/dev/null`
     ncbi_rp_L_flags=
  ncbi_rp_L_sep=$CONF_f_libpath
  if test "x${CONF_f_runpath}" = "x${CONF_f_libpath}"; then
@@ -30186,7 +32344,7 @@ fi
        ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
        ncbi_rp_L_sep=" $CONF_f_libpath"
     done
-    PYTHON25_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON25_VERSION $PYTHON25_DEPS"
+    PYTHON25_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON25_LDVERSION $PYTHON25_DEPS"
  else
     ncbi_rp_R_flags=
     ncbi_rp_R_sep=" $CONF_f_runpath"
@@ -30202,7 +32360,7 @@ fi
        ncbi_rp_R_flags="${ncbi_rp_R_flags}${ncbi_rp_R_sep}$x"
        ncbi_rp_R_sep=:
     done
-    PYTHON25_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON25_VERSION $PYTHON25_DEPS"
+    PYTHON25_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON25_LDVERSION $PYTHON25_DEPS"
  fi
     CPPFLAGS="$PYTHON25_INCLUDE $orig_CPPFLAGS"
     LIBS="$PYTHON25_LIBS $orig_LIBS"
@@ -30310,7 +32468,7 @@ else
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$PYTHON_PATH/bin:$PATH:/usr/local/python-2.6/bin"
+as_dummy="${PYTHON_PATH+$PYTHON_PATH/bin:}$PATH:/usr/local/python-2.6/bin"
 for as_dir in $as_dummy
 do
   IFS=$as_save_IFS
@@ -30339,15 +32497,16 @@ fi
 
 
  if test -x "$PYTHON26"; then
-    PYTHON26_VERSION=`$PYTHON26 -c 'from distutils import sysconfig; print sysconfig.get_config_var("VERSION")' 2>/dev/null`
+    PYTHON26_VERSION=`$PYTHON26 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("VERSION"))' 2>/dev/null`
  else
     PYTHON26_VERSION=
     ncbi_cv_lib_python26=no
  fi
  if test -n "$PYTHON26_VERSION"; then
-    PYTHON26_INCLUDE=`$PYTHON26 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print "-I%s -I%s" % (f(), f(True))'`
-    PYTHON26_LIBPATH=`$PYTHON26 -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL"))'`
-    PYTHON26_DEPS=`$PYTHON26 -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS"))'`
+    PYTHON26_INCLUDE=`$PYTHON26 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print("-I%s -I%s" % (f(), f(True)))'`
+    PYTHON26_LIBPATH=`$PYTHON26 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL")))'`
+    PYTHON26_DEPS=`$PYTHON26 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS")))'`
+    PYTHON26_LDVERSION=`$PYTHON26 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("LDVERSION") or sysconfig.get_config_var("VERSION"))' 2>/dev/null`
     ncbi_rp_L_flags=
  ncbi_rp_L_sep=$CONF_f_libpath
  if test "x${CONF_f_runpath}" = "x${CONF_f_libpath}"; then
@@ -30360,7 +32519,7 @@ fi
        ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
        ncbi_rp_L_sep=" $CONF_f_libpath"
     done
-    PYTHON26_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON26_VERSION $PYTHON26_DEPS"
+    PYTHON26_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON26_LDVERSION $PYTHON26_DEPS"
  else
     ncbi_rp_R_flags=
     ncbi_rp_R_sep=" $CONF_f_runpath"
@@ -30376,7 +32535,7 @@ fi
        ncbi_rp_R_flags="${ncbi_rp_R_flags}${ncbi_rp_R_sep}$x"
        ncbi_rp_R_sep=:
     done
-    PYTHON26_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON26_VERSION $PYTHON26_DEPS"
+    PYTHON26_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON26_LDVERSION $PYTHON26_DEPS"
  fi
     CPPFLAGS="$PYTHON26_INCLUDE $orig_CPPFLAGS"
     LIBS="$PYTHON26_LIBS $orig_LIBS"
@@ -30484,7 +32643,7 @@ else
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$PYTHON_PATH/bin:$PATH:/usr/local/python-2.7/bin"
+as_dummy="${PYTHON_PATH+$PYTHON_PATH/bin:}$PATH:/usr/local/python-2.7/bin"
 for as_dir in $as_dummy
 do
   IFS=$as_save_IFS
@@ -30513,15 +32672,16 @@ fi
 
 
  if test -x "$PYTHON27"; then
-    PYTHON27_VERSION=`$PYTHON27 -c 'from distutils import sysconfig; print sysconfig.get_config_var("VERSION")' 2>/dev/null`
+    PYTHON27_VERSION=`$PYTHON27 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("VERSION"))' 2>/dev/null`
  else
     PYTHON27_VERSION=
     ncbi_cv_lib_python27=no
  fi
  if test -n "$PYTHON27_VERSION"; then
-    PYTHON27_INCLUDE=`$PYTHON27 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print "-I%s -I%s" % (f(), f(True))'`
-    PYTHON27_LIBPATH=`$PYTHON27 -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL"))'`
-    PYTHON27_DEPS=`$PYTHON27 -c 'from distutils import sysconfig; print " ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS"))'`
+    PYTHON27_INCLUDE=`$PYTHON27 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print("-I%s -I%s" % (f(), f(True)))'`
+    PYTHON27_LIBPATH=`$PYTHON27 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL")))'`
+    PYTHON27_DEPS=`$PYTHON27 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS")))'`
+    PYTHON27_LDVERSION=`$PYTHON27 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("LDVERSION") or sysconfig.get_config_var("VERSION"))' 2>/dev/null`
     ncbi_rp_L_flags=
  ncbi_rp_L_sep=$CONF_f_libpath
  if test "x${CONF_f_runpath}" = "x${CONF_f_libpath}"; then
@@ -30534,7 +32694,7 @@ fi
        ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
        ncbi_rp_L_sep=" $CONF_f_libpath"
     done
-    PYTHON27_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON27_VERSION $PYTHON27_DEPS"
+    PYTHON27_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON27_LDVERSION $PYTHON27_DEPS"
  else
     ncbi_rp_R_flags=
     ncbi_rp_R_sep=" $CONF_f_runpath"
@@ -30550,7 +32710,7 @@ fi
        ncbi_rp_R_flags="${ncbi_rp_R_flags}${ncbi_rp_R_sep}$x"
        ncbi_rp_R_sep=:
     done
-    PYTHON27_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON27_VERSION $PYTHON27_DEPS"
+    PYTHON27_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON27_LDVERSION $PYTHON27_DEPS"
  fi
     CPPFLAGS="$PYTHON27_INCLUDE $orig_CPPFLAGS"
     LIBS="$PYTHON27_LIBS $orig_LIBS"
@@ -30645,6 +32805,181 @@ _ACEOF
 
 
 
+   # Extract the first word of "python3", so it can be a program name with args.
+set dummy python3; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PYTHON3+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PYTHON3 in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHON3="$PYTHON3" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="${PYTHON_PATH+$PYTHON_PATH/bin:}$PATH:/usr/local/python-3/bin"
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PYTHON3="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PYTHON3=$ac_cv_path_PYTHON3
+if test -n "$PYTHON3"; then
+  { echo "$as_me:$LINENO: result: $PYTHON3" >&5
+echo "${ECHO_T}$PYTHON3" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ if test -x "$PYTHON3"; then
+    PYTHON3_VERSION=`$PYTHON3 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("VERSION"))' 2>/dev/null`
+ else
+    PYTHON3_VERSION=
+    ncbi_cv_lib_python3=no
+ fi
+ if test -n "$PYTHON3_VERSION"; then
+    PYTHON3_INCLUDE=`$PYTHON3 -c 'from distutils import sysconfig; f=sysconfig.get_python_inc; print("-I%s -I%s" % (f(), f(True)))'`
+    PYTHON3_LIBPATH=`$PYTHON3 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBDIR", "LIBPL")))'`
+    PYTHON3_DEPS=`$PYTHON3 -c 'from distutils import sysconfig; print(" ".join(sysconfig.get_config_vars("LIBS", "SYSLIBS")))'`
+    PYTHON3_LDVERSION=`$PYTHON3 -c 'from distutils import sysconfig; print(sysconfig.get_config_var("LDVERSION") or sysconfig.get_config_var("VERSION"))' 2>/dev/null`
+    ncbi_rp_L_flags=
+ ncbi_rp_L_sep=$CONF_f_libpath
+ if test "x${CONF_f_runpath}" = "x${CONF_f_libpath}"; then
+    for x in $PYTHON3_LIBPATH; do
+       case "$x" in
+          /lib | /usr/lib | /usr/lib32 | /usr/lib64 | /usr/lib/$multiarch )
+             continue
+             ;;
+       esac
+       ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
+       ncbi_rp_L_sep=" $CONF_f_libpath"
+    done
+    PYTHON3_LIBS="${ncbi_rp_L_flags} -lpython$PYTHON3_LDVERSION $PYTHON3_DEPS"
+ else
+    ncbi_rp_R_flags=
+    ncbi_rp_R_sep=" $CONF_f_runpath"
+    for x in $PYTHON3_LIBPATH; do
+       case "$x" in
+          /lib | /usr/lib | /usr/lib32 | /usr/lib64 | /usr/lib/$multiarch )
+             continue
+             ;;
+       esac
+       ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
+       ncbi_rp_L_sep=" $CONF_f_libpath"
+       x=`echo $x | sed -e "$ncbi_rpath_sed"`
+       ncbi_rp_R_flags="${ncbi_rp_R_flags}${ncbi_rp_R_sep}$x"
+       ncbi_rp_R_sep=:
+    done
+    PYTHON3_LIBS="${ncbi_rp_L_flags}${ncbi_rp_R_flags} -lpython$PYTHON3_LDVERSION $PYTHON3_DEPS"
+ fi
+    CPPFLAGS="$PYTHON3_INCLUDE $orig_CPPFLAGS"
+    LIBS="$PYTHON3_LIBS $orig_LIBS"
+    { echo "$as_me:$LINENO: checking for usable Python $PYTHON3_VERSION libraries" >&5
+echo $ECHO_N "checking for usable Python $PYTHON3_VERSION libraries... $ECHO_C" >&6; }
+if test "${ncbi_cv_lib_python3+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <Python.h>
+int
+main ()
+{
+Py_Initialize(); Py_Finalize();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ncbi_cv_lib_python3=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ncbi_cv_lib_python3=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ncbi_cv_lib_python3" >&5
+echo "${ECHO_T}$ncbi_cv_lib_python3" >&6; }
+ else
+    ncbi_cv_lib_python3=no
+ fi
+ if test "$ncbi_cv_lib_python3" = "no"; then
+    PYTHON3_INCLUDE=
+    PYTHON3_LIBS=
+ else
+              WithPackages="$WithPackages${WithPackagesSep}PYTHON3"; WithPackagesSep=" "
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PYTHON3 1
+_ACEOF
+
+ fi
+
+
+
    if test "$ncbi_cv_lib_python" = "no"; then
       if test "$ncbi_cv_lib_python27" = "yes"; then
          PYTHON_INCLUDE=$PYTHON27_INCLUDE
@@ -31285,7 +33620,7 @@ echo "$as_me: error: --with-boost:  Boost library is too old" >&2;}
          fi
          with_boost=no
          ;;
-      1_3[5-9] | 1_3[5-9]_* | 1_4* | 1_5[0-7] | 1_5[0-7]_* ) ;;
+      1_3[5-9] | 1_3[5-9]_* | 1_[45]* | 1_60 | 1_60_* ) ;;
       '' ) with_boost=no ;;
       * )
          { echo "$as_me:$LINENO: WARNING: Untested Boost version; may prove incompatible." >&5
@@ -31470,7 +33805,7 @@ echo $ECHO_N "checking for Boost.Spirit$in_path... $ECHO_C" >&6; }
 if test "${ncbi_cv_lib_boost_spirit+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  CPPFLAGS="$BOOST_INCLUDE $orig_CPPFLAGS"
+  CPPFLAGS="$BOOST_INCLUDE -DBOOST_ERROR_CODE_HEADER_ONLY $orig_CPPFLAGS"
       LIBS="$RT_LIBS $orig_LIBS"
       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -35226,7 +37561,7 @@ else
     done
     WXWIDGETS_LIBS="$WXWIDGETS_LIBS${ncbi_rp_R_flags}"
  fi
-   WXWIDGETS_STATIC_LIBS=`"$wxconf" $wxcfflags --libs --static $wxlibs \
+   WXWIDGETS_STATIC_LIBS=`"$wxconf" $wxcfflags --libs $wxlibs --static \
       2>/dev/null | sed -e "$basesed; s/ -lm / /g;"`
    if test -n "$WXWIDGETS_STATIC_LIBS"; then
       # Allow direct use of underlying libraries with strict linkers
@@ -38546,7 +40881,7 @@ See \`config.log' for more details." >&2;}
 echo "$as_me: WARNING: $message" >&2;}  ;;
       esac
    fi
-   if test "$with_included_vdb" != "yes"; then
+   # if test "$with_included_vdb" != "yes"; then
       if test -z "$VDB_PATH"; then
          in_path=
       else
@@ -38731,40 +41066,8 @@ echo "${ECHO_T}$ncbi_cv_lib_ncbi_vdb" >&6; }
          VDB_LIBS=
          VDB_STATIC_LIBS=
       fi
-   elif test -d "$real_srcdir/src/sra/sdk/interfaces"; then
-      case "$host_os" in
-         darwin* | linux* | solaris* )
-            { echo "$as_me:$LINENO: Using local NCBI SRA/VDB copy in src/sra/sdk" >&5
-echo "$as_me: Using local NCBI SRA/VDB copy in src/sra/sdk" >&6;}
-                      WithPackages="$WithPackages${WithPackagesSep}VDB"; WithPackagesSep=" "
-                      WithPackages="$WithPackages${WithPackagesSep}LocalVDB"; WithPackagesSep=" "
-            VDB_INCLUDE='-I$(includedir)/../src/sra/sdk/interfaces'
-            VDB_INCLUDE="$VDB_INCLUDE -I\$(includedir)/../src/sra/sdk/interfaces/C++Toolkit"
-            VDB_INCLUDE="$VDB_INCLUDE -I\$(top_srcdir)/src/sra/sdk/interfaces"
-            VDB_INCLUDE="$VDB_INCLUDE -I\$(top_srcdir)/src/sra/sdk/interfaces/C++Toolkit"
-            if test "$DEBUG_SFX" = Debug; then
-               VDB_INCLUDE="$VDB_INCLUDE -D_DEBUGGING"
-            fi
-            VDB_LIB=ncbi-vdb-read
-            VDB_LIBS=$vdb_deps
-            VDB_STATIC_LIBS=$VDB_LIBS
-            VDB_REQ=LocalVDB
-            ;;
-         * )
-            { { echo "$as_me:$LINENO: error: --with-included-vdb explicitly specified,
-                          but not supported on this platform." >&5
-echo "$as_me: error: --with-included-vdb explicitly specified,
-                          but not supported on this platform." >&2;}
-   { (exit 1); exit 1; }; }
-            ;;
-      esac
-   else
-      { { echo "$as_me:$LINENO: error: --with-included-vdb explicitly specified,
-                    but no local copy exists." >&5
-echo "$as_me: error: --with-included-vdb explicitly specified,
-                    but no local copy exists." >&2;}
-   { (exit 1); exit 1; }; }
-   fi
+   # else ...
+   # fi
    if test -z "$VDB_LIBS"; then
       if test "${with_vdb:=no}" != no; then
        { { echo "$as_me:$LINENO: error: --with-vdb explicitly specified, but no usable version found." >&5
@@ -42324,6 +44627,184 @@ echo "$as_me: error: --with-cereal explicitly specified, but no usable version f
 fi
 
 
+# SASL 2
+if test "$with_sasl2" != "no"; then
+    case "$with_sasl2" in
+       yes | "" ) ;;
+       *        ) SASL2_PATH=$with_sasl2 ;;
+    esac
+    if test "$SASL2_PATH" != /usr -a -d "$SASL2_PATH"; then
+       in_path=" in $SASL2_PATH"
+       if test -z "$SASL2_INCLUDE" -a -d "$SASL2_PATH/include"; then
+          SASL2_INCLUDE="-I$SASL2_PATH/include"
+       fi
+       if test -n "$SASL2_LIBPATH"; then
+          :
+       elif test -d "$SASL2_PATH/lib${bit64_sfx}"; then
+          ncbi_rp_L_flags=
+ ncbi_rp_L_sep=$CONF_f_libpath
+ if test "x${CONF_f_runpath}" = "x${CONF_f_libpath}"; then
+    for x in $SASL2_PATH/lib${bit64_sfx}; do
+       case "$x" in
+          /lib | /usr/lib | /usr/lib32 | /usr/lib64 | /usr/lib/$multiarch )
+             continue
+             ;;
+       esac
+       ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
+       ncbi_rp_L_sep=" $CONF_f_libpath"
+    done
+    SASL2_LIBPATH="${ncbi_rp_L_flags}"
+ else
+    ncbi_rp_R_flags=
+    ncbi_rp_R_sep=" $CONF_f_runpath"
+    for x in $SASL2_PATH/lib${bit64_sfx}; do
+       case "$x" in
+          /lib | /usr/lib | /usr/lib32 | /usr/lib64 | /usr/lib/$multiarch )
+             continue
+             ;;
+       esac
+       ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
+       ncbi_rp_L_sep=" $CONF_f_libpath"
+       x=`echo $x | sed -e "$ncbi_rpath_sed"`
+       ncbi_rp_R_flags="${ncbi_rp_R_flags}${ncbi_rp_R_sep}$x"
+       ncbi_rp_R_sep=:
+    done
+    SASL2_LIBPATH="${ncbi_rp_L_flags}${ncbi_rp_R_flags}"
+ fi
+       elif test -d "$SASL2_PATH/lib"; then
+          ncbi_rp_L_flags=
+ ncbi_rp_L_sep=$CONF_f_libpath
+ if test "x${CONF_f_runpath}" = "x${CONF_f_libpath}"; then
+    for x in $SASL2_PATH/lib; do
+       case "$x" in
+          /lib | /usr/lib | /usr/lib32 | /usr/lib64 | /usr/lib/$multiarch )
+             continue
+             ;;
+       esac
+       ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
+       ncbi_rp_L_sep=" $CONF_f_libpath"
+    done
+    SASL2_LIBPATH="${ncbi_rp_L_flags}"
+ else
+    ncbi_rp_R_flags=
+    ncbi_rp_R_sep=" $CONF_f_runpath"
+    for x in $SASL2_PATH/lib; do
+       case "$x" in
+          /lib | /usr/lib | /usr/lib32 | /usr/lib64 | /usr/lib/$multiarch )
+             continue
+             ;;
+       esac
+       ncbi_rp_L_flags="${ncbi_rp_L_flags}${ncbi_rp_L_sep}$x"
+       ncbi_rp_L_sep=" $CONF_f_libpath"
+       x=`echo $x | sed -e "$ncbi_rpath_sed"`
+       ncbi_rp_R_flags="${ncbi_rp_R_flags}${ncbi_rp_R_sep}$x"
+       ncbi_rp_R_sep=:
+    done
+    SASL2_LIBPATH="${ncbi_rp_L_flags}${ncbi_rp_R_flags}"
+ fi
+       fi
+       SASL2_LIBS="$SASL2_LIBPATH -lsasl2 "
+    else
+       SASL2_INCLUDE=""
+       SASL2_LIBS="-lsasl2 "
+       in_path=
+    fi
+    { echo "$as_me:$LINENO: checking for libsasl2$in_path" >&5
+echo $ECHO_N "checking for libsasl2$in_path... $ECHO_C" >&6; }
+if test "${ncbi_cv_lib_sasl2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  CPPFLAGS=" $SASL2_INCLUDE $orig_CPPFLAGS"
+       LIBS="$SASL2_LIBS  $orig_LIBS"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+                     #include <sasl/sasl.h>
+int
+main ()
+{
+sasl_client_init(NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ncbi_cv_lib_sasl2=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ncbi_cv_lib_sasl2=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ncbi_cv_lib_sasl2" >&5
+echo "${ECHO_T}$ncbi_cv_lib_sasl2" >&6; }
+    if test "$ncbi_cv_lib_sasl2" = "no"; then
+       if test "${with_sasl2:=no}" != no; then
+       { { echo "$as_me:$LINENO: error: --with-sasl2 explicitly specified, but no usable version found." >&5
+echo "$as_me: error: --with-sasl2 explicitly specified, but no usable version found." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    fi
+ fi
+ if test "$with_sasl2" = "no"; then
+    SASL2_PATH="No_SASL2"
+    SASL2_INCLUDE=
+    SASL2_LIBS=
+ else
+              WithPackages="$WithPackages${WithPackagesSep}SASL2"; WithPackagesSep=" "
+    SASL2_INCLUDE=" $SASL2_INCLUDE"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBSASL2 1
+_ACEOF
+
+ fi
+
+
+
+
+
 # MongoDB
 case "$with_mongodb" in
    yes | no | '' ) ;;
@@ -42456,10 +44937,10 @@ if test "$with_mongodb" != "no"; then
     MONGODB_LIBPATH="${ncbi_rp_L_flags}${ncbi_rp_R_flags}"
  fi
        fi
-       MONGODB_LIBS="$MONGODB_LIBPATH -lmongoclient $BOOST_LIBPATH $boost_fs_lib $BOOST_REGEX_LIBS $BOOST_THREAD_LIBS"
+       MONGODB_LIBS="$MONGODB_LIBPATH -lmongoclient $BOOST_LIBPATH $boost_fs_lib $BOOST_REGEX_LIBS $BOOST_THREAD_LIBS $OPENSSL_LIBS $SASL2_LIBS"
     else
        MONGODB_INCLUDE=""
-       MONGODB_LIBS="-lmongoclient $BOOST_LIBPATH $boost_fs_lib $BOOST_REGEX_LIBS $BOOST_THREAD_LIBS"
+       MONGODB_LIBS="-lmongoclient $BOOST_LIBPATH $boost_fs_lib $BOOST_REGEX_LIBS $BOOST_THREAD_LIBS $OPENSSL_LIBS $SASL2_LIBS"
        in_path=
     fi
     { echo "$as_me:$LINENO: checking for libmongoclient$in_path" >&5
@@ -42560,7 +45041,7 @@ _ACEOF
 # MongoDB's own library is normally static, but its supporting Boost
 # libraries might not be by default.
 if test -n "$MONGODB_LIBS"; then
-   MONGODB_STATIC_LIBS="$MONGODB_LIBPATH -lmongoclient $BOOST_LIBPATH $boost_fs_static_lib $BOOST_REGEX_STATIC_LIBS $BOOST_THREAD_STATIC_LIBS"
+   MONGODB_STATIC_LIBS="$MONGODB_LIBPATH -lmongoclient $BOOST_LIBPATH $boost_fs_static_lib $BOOST_REGEX_STATIC_LIBS $BOOST_THREAD_STATIC_LIBS $OPENSSL_LIBS $SASL2_LIBS"
 else
    MONGODB_STATIC_LIBS=
 fi
@@ -42936,6 +45417,26 @@ _ACEOF
 fi
 
 
+## direct PubSeqOS data loaders
+
+if test "$with_dbapi" != no -a \
+   -f ${real_srcdir}/src/objtools/data_loaders/genbank/pubseq/Makefile.ncbi_xreader_pubseqos.lib ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PUBSEQ_OS 1
+_ACEOF
+
+             WithFeatures="$WithFeatures${WithFeaturesSep}PubSeqOS"; WithFeaturesSep=" "
+   ncbi_xreader_pubseqos=ncbi_xreader_pubseqos
+   ncbi_xreader_pubseqos2=ncbi_xreader_pubseqos2
+   UNLESS_PUBSEQOS=\#
+else
+   ncbi_xreader_pubseqos=
+   ncbi_xreader_pubseqos2=
+   UNLESS_PUBSEQOS=
+fi
+
+
 ## `serial' projects
 
 if test "$with_serial" = "no" ; then
@@ -43001,6 +45502,9 @@ fi
 DBAPI_DRIVER=
 DBAPI_CTLIB=
 DBAPI_DBLIB=
+DBAPI_FTDS=
+DBAPI_FTDS64=
+DBAPI_FTDS95=
 DBAPI_MYSQL=
 DBAPI_ODBC=
 if test "$with_dbapi" = "no" ; then
@@ -43009,6 +45513,9 @@ else
              WithProjects="$WithProjects${WithProjectsSep}dbapi"; WithProjectsSep=" "
    dbapi="dbapi"
    DBAPI_DRIVER=dbapi_driver
+   DBAPI_FTDS=ncbi_xdbapi_ftds
+   DBAPI_FTDS64=ncbi_xdbapi_ftds64
+   DBAPI_FTDS95=ncbi_xdbapi_ftds95
    test -n "$SYBASE_LIBS"    &&  DBAPI_CTLIB=ncbi_xdbapi_ctlib
    test -n "$SYBASE_DBLIBS"  &&  DBAPI_DBLIB=ncbi_xdbapi_dblib
    test -n "$MYSQL_LIBS"     &&  DBAPI_MYSQL=ncbi_xdbapi_mysql
@@ -43216,7 +45723,7 @@ FEATURES="$WithFeatures $WithPackages $WithProjects"
 
 ### Compute Without{Features,Packages,Projects}.  Takes quadratic time,
 ### but that's life.
-for x in Int8GI StrictGI GCC KCC ICC VisualAge CompaqCompiler Cray WorkShop MIPSpro MSVC MT LFS DLL DLL_BUILD MaxDebug MSWin unix WinMain AIX BSD Cygwin CygwinMT Darwin XCODE IRIX Linux OSF Solaris MacOS in-house-resources PubSeqOS JDK Ncbi-JNI check Valgrind LimitedLinker; do
+for x in Int8GI StrictGI GCC KCC ICC VisualAge CompaqCompiler Cray WorkShop MIPSpro MSVC MT LFS DLL DLL_BUILD MaxDebug MSWin unix WinMain AIX BSD Cygwin CygwinMT Darwin XCODE IRIX Linux OSF Solaris MacOS in-house-resources JDK Ncbi-JNI PubSeqOS check Valgrind LimitedLinker; do
       case " $WithFeatures " in
          *" $x "*) ;;
          *) WithoutFeatures="$WithoutFeatures$WithoutFeaturesSep$x"
@@ -43225,7 +45732,7 @@ for x in Int8GI StrictGI GCC KCC ICC VisualAge CompaqCompiler Cray WorkShop MIPS
           ;;
       esac
    done
-  for x in UUID FUSE Z LocalZ BZ2 LocalBZ2 LZO PCRE LocalPCRE GMP GCRYPT NETTLE GNUTLS OPENSSL KRB5 CURL Sybase DBLib FreeTDS MySQL BerkeleyDB BerkeleyDB++ ODBC PYTHON PYTHON25 PYTHON26 PYTHON27 PERL Boost.Filesystem Boost.Iostreams Boost.Program-Options Boost.Regex Boost.Spirit Boost.System Boost.Test Boost.Test.Included Boost.Thread C-Toolkit OpenGL MESA GLUT GLEW wxWidgets wx2.8 Fast-CGI LocalSSS LocalMSGMAIL2 SSSUTILS LocalNCBILS NCBILS2 SSSDB SP ORBacus ICU EXPAT SABLOT LIBXML LIBXS [...]
+  for x in UUID FUSE Iconv Z LocalZ BZ2 LocalBZ2 LZO PCRE LocalPCRE GMP GCRYPT NETTLE GNUTLS OPENSSL KRB5 CURL Sybase DBLib FreeTDS MySQL BerkeleyDB BerkeleyDB++ ODBC PYTHON PYTHON25 PYTHON26 PYTHON27 PYTHON3 PERL Boost.Filesystem Boost.Iostreams Boost.Program-Options Boost.Regex Boost.Spirit Boost.System Boost.Test Boost.Test.Included Boost.Thread C-Toolkit OpenGL MESA GLUT GLEW wxWidgets wx2.8 Fast-CGI LocalSSS LocalMSGMAIL2 SSSUTILS LocalNCBILS NCBILS2 SSSDB SP ORBacus ICU EXPAT SABLO [...]
       case " $WithPackages " in
          *" $x "*) ;;
          *) WithoutPackages="$WithoutPackages$WithoutPackagesSep$x"
@@ -43602,6 +46109,10 @@ c_ncbi_runpath=`echo "$ncbi_runpath" | sed -e 's:\\$\\$:\\$:g'`
 
 
 
+
+
+
+
 #############################################################################
 ### Create output files and do some post-configuration
 
@@ -44185,6 +46696,7 @@ CXXFLAGS='$CXXFLAGS'
 CPPFLAGS='$CPPFLAGS'
 LDFLAGS='$LDFLAGS'
 LIB_OR_DLL='$LIB_OR_DLL'
+MAKE='$MAKE'
 with_dll='$with_dll'
 WithFeatures='$WithFeatures'
 WithoutFeatures='$WithoutFeatures'
@@ -44200,6 +46712,7 @@ with_saved_settings='$with_saved_settings'
 smart_pwd='$smart_pwd'
 real_srcdir='$real_srcdir'
 EGREP='$EGREP'
+export MAKE PATH
 
 
 _ACEOF
@@ -44332,6 +46845,21 @@ CPPFLAGS!$CPPFLAGS$ac_delim
 ac_ct_CC!$ac_ct_CC$ac_delim
 EXEEXT!$EXEEXT$ac_delim
 OBJEXT!$OBJEXT$ac_delim
+CPP!$CPP$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim
+ac_ct_CC_FOR_BUILD!$ac_ct_CC_FOR_BUILD$ac_delim
+CPP!$CPP$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+CPP_FOR_BUILD!$CPP_FOR_BUILD$ac_delim
+BUILD_EXEEXT!$BUILD_EXEEXT$ac_delim
+BUILD_OBJEXT!$BUILD_OBJEXT$ac_delim
+CFLAGS_FOR_BUILD!$CFLAGS_FOR_BUILD$ac_delim
+CPPFLAGS_FOR_BUILD!$CPPFLAGS_FOR_BUILD$ac_delim
+LDFLAGS_FOR_BUILD!$LDFLAGS_FOR_BUILD$ac_delim
 CXX!$CXX$ac_delim
 CXXFLAGS!$CXXFLAGS$ac_delim
 ac_ct_CXX!$ac_ct_CXX$ac_delim
@@ -44344,6 +46872,9 @@ UNLESS_WITH_DLL!$UNLESS_WITH_DLL$ac_delim
 STATIC!$STATIC$ac_delim
 USUAL_AND_DLL!$USUAL_AND_DLL$ac_delim
 USUAL_AND_LIB!$USUAL_AND_LIB$ac_delim
+AWK!$AWK$ac_delim
+ifGNUmake!$ifGNUmake$ac_delim
+MAKE!$MAKE$ac_delim
 LN_S!$LN_S$ac_delim
 RANLIB!$RANLIB$ac_delim
 AR!$AR$ac_delim
@@ -44355,24 +46886,6 @@ BASENAME!$BASENAME$ac_delim
 SED!$SED$ac_delim
 TOUCH!$TOUCH$ac_delim
 GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-VALGRIND_PATH!$VALGRIND_PATH$ac_delim
-LDD!$LDD$ac_delim
-CXXCPP!$CXXCPP$ac_delim
-TCHECK_CL!$TCHECK_CL$ac_delim
-AMQ!$AMQ$ac_delim
-CPP!$CPP$ac_delim
-Z_INCLUDE!$Z_INCLUDE$ac_delim
-Z_LIBS!$Z_LIBS$ac_delim
-BZ2_INCLUDE!$BZ2_INCLUDE$ac_delim
-BZ2_LIBS!$BZ2_LIBS$ac_delim
-LZO_INCLUDE!$LZO_INCLUDE$ac_delim
-LZO_LIBS!$LZO_LIBS$ac_delim
-PCRE_INCLUDE!$PCRE_INCLUDE$ac_delim
-PCRE_LIBS!$PCRE_LIBS$ac_delim
-GMP_INCLUDE!$GMP_INCLUDE$ac_delim
-GMP_LIBS!$GMP_LIBS$ac_delim
-LIBGCRYPT_CONFIG!$LIBGCRYPT_CONFIG$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -44414,6 +46927,23 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+EGREP!$EGREP$ac_delim
+VALGRIND_PATH!$VALGRIND_PATH$ac_delim
+LDD!$LDD$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+TCHECK_CL!$TCHECK_CL$ac_delim
+AMQ!$AMQ$ac_delim
+Z_INCLUDE!$Z_INCLUDE$ac_delim
+Z_LIBS!$Z_LIBS$ac_delim
+BZ2_INCLUDE!$BZ2_INCLUDE$ac_delim
+BZ2_LIBS!$BZ2_LIBS$ac_delim
+LZO_INCLUDE!$LZO_INCLUDE$ac_delim
+LZO_LIBS!$LZO_LIBS$ac_delim
+PCRE_INCLUDE!$PCRE_INCLUDE$ac_delim
+PCRE_LIBS!$PCRE_LIBS$ac_delim
+GMP_INCLUDE!$GMP_INCLUDE$ac_delim
+GMP_LIBS!$GMP_LIBS$ac_delim
+LIBGCRYPT_CONFIG!$LIBGCRYPT_CONFIG$ac_delim
 GCRYPT_INCLUDE!$GCRYPT_INCLUDE$ac_delim
 GCRYPT_LIBS!$GCRYPT_LIBS$ac_delim
 NETTLE_INCLUDE!$NETTLE_INCLUDE$ac_delim
@@ -44434,11 +46964,16 @@ FTDS64_LIB!$FTDS64_LIB$ac_delim
 FTDS64_CTLIB_INCLUDE!$FTDS64_CTLIB_INCLUDE$ac_delim
 FTDS64_CTLIB_LIBS!$FTDS64_CTLIB_LIBS$ac_delim
 FTDS64_CTLIB_LIB!$FTDS64_CTLIB_LIB$ac_delim
+FTDS95_INCLUDE!$FTDS95_INCLUDE$ac_delim
+FTDS95_LIBS!$FTDS95_LIBS$ac_delim
+FTDS95_LIB!$FTDS95_LIB$ac_delim
+FTDS95_CTLIB_INCLUDE!$FTDS95_CTLIB_INCLUDE$ac_delim
+FTDS95_CTLIB_LIBS!$FTDS95_CTLIB_LIBS$ac_delim
+FTDS95_CTLIB_LIB!$FTDS95_CTLIB_LIB$ac_delim
 FTDS_INCLUDE!$FTDS_INCLUDE$ac_delim
 FTDS_LIBS!$FTDS_LIBS$ac_delim
 FTDS_LIB!$FTDS_LIB$ac_delim
 freetds!$freetds$ac_delim
-ftds64!$ftds64$ac_delim
 mysql_config!$mysql_config$ac_delim
 PYTHON!$PYTHON$ac_delim
 PYTHON_INCLUDE!$PYTHON_INCLUDE$ac_delim
@@ -44452,6 +46987,9 @@ PYTHON26_LIBS!$PYTHON26_LIBS$ac_delim
 PYTHON27!$PYTHON27$ac_delim
 PYTHON27_INCLUDE!$PYTHON27_INCLUDE$ac_delim
 PYTHON27_LIBS!$PYTHON27_LIBS$ac_delim
+PYTHON3!$PYTHON3$ac_delim
+PYTHON3_INCLUDE!$PYTHON3_INCLUDE$ac_delim
+PYTHON3_LIBS!$PYTHON3_LIBS$ac_delim
 PERL!$PERL$ac_delim
 _ACJNI_JAVAC!$_ACJNI_JAVAC$ac_delim
 XMKMF!$XMKMF$ac_delim
@@ -44486,31 +47024,6 @@ JPEG_LIBS!$JPEG_LIBS$ac_delim
 PNG_INCLUDE!$PNG_INCLUDE$ac_delim
 PNG_LIBS!$PNG_LIBS$ac_delim
 TIFF_INCLUDE!$TIFF_INCLUDE$ac_delim
-TIFF_LIBS!$TIFF_LIBS$ac_delim
-UNGIF_INCLUDE!$UNGIF_INCLUDE$ac_delim
-UNGIF_LIBS!$UNGIF_LIBS$ac_delim
-GIF_INCLUDE!$GIF_INCLUDE$ac_delim
-GIF_LIBS!$GIF_LIBS$ac_delim
-XPM_INCLUDE!$XPM_INCLUDE$ac_delim
-XPM_LIBS!$XPM_LIBS$ac_delim
-freetype_config!$freetype_config$ac_delim
-FTGL_INCLUDE!$FTGL_INCLUDE$ac_delim
-FTGL_LIBS!$FTGL_LIBS$ac_delim
-MAGIC_INCLUDE!$MAGIC_INCLUDE$ac_delim
-MAGIC_LIBS!$MAGIC_LIBS$ac_delim
-MIMETIC_INCLUDE!$MIMETIC_INCLUDE$ac_delim
-MIMETIC_LIBS!$MIMETIC_LIBS$ac_delim
-GSOAP_SOAPCPP2!$GSOAP_SOAPCPP2$ac_delim
-GSOAP_WSDL2H!$GSOAP_WSDL2H$ac_delim
-GSOAP_INCLUDE!$GSOAP_INCLUDE$ac_delim
-GSOAP_LIBS!$GSOAP_LIBS$ac_delim
-AVRO_INCLUDE!$AVRO_INCLUDE$ac_delim
-AVRO_LIBS!$AVRO_LIBS$ac_delim
-AVROGENCPP!$AVROGENCPP$ac_delim
-MONGODB_INCLUDE!$MONGODB_INCLUDE$ac_delim
-MONGODB_LIBS!$MONGODB_LIBS$ac_delim
-GMOCK_INCLUDE!$GMOCK_INCLUDE$ac_delim
-GMOCK_LIBS!$GMOCK_LIBS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -44552,6 +47065,33 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+TIFF_LIBS!$TIFF_LIBS$ac_delim
+UNGIF_INCLUDE!$UNGIF_INCLUDE$ac_delim
+UNGIF_LIBS!$UNGIF_LIBS$ac_delim
+GIF_INCLUDE!$GIF_INCLUDE$ac_delim
+GIF_LIBS!$GIF_LIBS$ac_delim
+XPM_INCLUDE!$XPM_INCLUDE$ac_delim
+XPM_LIBS!$XPM_LIBS$ac_delim
+freetype_config!$freetype_config$ac_delim
+FTGL_INCLUDE!$FTGL_INCLUDE$ac_delim
+FTGL_LIBS!$FTGL_LIBS$ac_delim
+MAGIC_INCLUDE!$MAGIC_INCLUDE$ac_delim
+MAGIC_LIBS!$MAGIC_LIBS$ac_delim
+MIMETIC_INCLUDE!$MIMETIC_INCLUDE$ac_delim
+MIMETIC_LIBS!$MIMETIC_LIBS$ac_delim
+GSOAP_SOAPCPP2!$GSOAP_SOAPCPP2$ac_delim
+GSOAP_WSDL2H!$GSOAP_WSDL2H$ac_delim
+GSOAP_INCLUDE!$GSOAP_INCLUDE$ac_delim
+GSOAP_LIBS!$GSOAP_LIBS$ac_delim
+AVRO_INCLUDE!$AVRO_INCLUDE$ac_delim
+AVRO_LIBS!$AVRO_LIBS$ac_delim
+AVROGENCPP!$AVROGENCPP$ac_delim
+SASL2_INCLUDE!$SASL2_INCLUDE$ac_delim
+SASL2_LIBS!$SASL2_LIBS$ac_delim
+MONGODB_INCLUDE!$MONGODB_INCLUDE$ac_delim
+MONGODB_LIBS!$MONGODB_LIBS$ac_delim
+GMOCK_INCLUDE!$GMOCK_INCLUDE$ac_delim
+GMOCK_LIBS!$GMOCK_LIBS$ac_delim
 signature!$signature$ac_delim
 build_root!$build_root$ac_delim
 top_srcdir!$top_srcdir$ac_delim
@@ -44622,33 +47162,6 @@ loadable_ext!$loadable_ext$ac_delim
 lib_l_ext!$lib_l_ext$ac_delim
 exe_ext!$exe_ext$ac_delim
 f_compile!$f_compile$ac_delim
-f_outobj!$f_outobj$ac_delim
-f_outlib!$f_outlib$ac_delim
-f_libpath!$f_libpath$ac_delim
-f_runpath!$f_runpath$ac_delim
-f_outexe!$f_outexe$ac_delim
-BDB_LIB!$BDB_LIB$ac_delim
-BDB_CACHE_LIB!$BDB_CACHE_LIB$ac_delim
-DBAPI_DRIVER!$DBAPI_DRIVER$ac_delim
-DBAPI_CTLIB!$DBAPI_CTLIB$ac_delim
-DBAPI_DBLIB!$DBAPI_DBLIB$ac_delim
-DBAPI_MYSQL!$DBAPI_MYSQL$ac_delim
-DBAPI_ODBC!$DBAPI_ODBC$ac_delim
-THREAD_LIBS!$THREAD_LIBS$ac_delim
-NCBIATOMIC_LIB!$NCBIATOMIC_LIB$ac_delim
-OPENMP_FLAGS!$OPENMP_FLAGS$ac_delim
-UNSAFE_MATH_FLAG!$UNSAFE_MATH_FLAG$ac_delim
-SSE4_1_FLAG!$SSE4_1_FLAG$ac_delim
-AES_FLAG!$AES_FLAG$ac_delim
-NETWORK_LIBS!$NETWORK_LIBS$ac_delim
-NETWORK_PURE_LIBS!$NETWORK_PURE_LIBS$ac_delim
-RESOLVER_LIBS!$RESOLVER_LIBS$ac_delim
-MATH_LIBS!$MATH_LIBS$ac_delim
-KSTAT_LIBS!$KSTAT_LIBS$ac_delim
-RPCSVC_LIBS!$RPCSVC_LIBS$ac_delim
-CRYPT_LIBS!$CRYPT_LIBS$ac_delim
-DL_LIBS!$DL_LIBS$ac_delim
-RT_LIBS!$RT_LIBS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -44690,6 +47203,37 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+f_outobj!$f_outobj$ac_delim
+f_outlib!$f_outlib$ac_delim
+f_libpath!$f_libpath$ac_delim
+f_runpath!$f_runpath$ac_delim
+f_outexe!$f_outexe$ac_delim
+BDB_LIB!$BDB_LIB$ac_delim
+BDB_CACHE_LIB!$BDB_CACHE_LIB$ac_delim
+DBAPI_DRIVER!$DBAPI_DRIVER$ac_delim
+DBAPI_CTLIB!$DBAPI_CTLIB$ac_delim
+DBAPI_DBLIB!$DBAPI_DBLIB$ac_delim
+DBAPI_FTDS!$DBAPI_FTDS$ac_delim
+DBAPI_FTDS64!$DBAPI_FTDS64$ac_delim
+DBAPI_FTDS95!$DBAPI_FTDS95$ac_delim
+DBAPI_MYSQL!$DBAPI_MYSQL$ac_delim
+DBAPI_ODBC!$DBAPI_ODBC$ac_delim
+THREAD_LIBS!$THREAD_LIBS$ac_delim
+NCBIATOMIC_LIB!$NCBIATOMIC_LIB$ac_delim
+OPENMP_FLAGS!$OPENMP_FLAGS$ac_delim
+UNSAFE_MATH_FLAG!$UNSAFE_MATH_FLAG$ac_delim
+SSE4_1_FLAG!$SSE4_1_FLAG$ac_delim
+AES_FLAG!$AES_FLAG$ac_delim
+COLOR_DIAGNOSTICS!$COLOR_DIAGNOSTICS$ac_delim
+NETWORK_LIBS!$NETWORK_LIBS$ac_delim
+NETWORK_PURE_LIBS!$NETWORK_PURE_LIBS$ac_delim
+RESOLVER_LIBS!$RESOLVER_LIBS$ac_delim
+MATH_LIBS!$MATH_LIBS$ac_delim
+KSTAT_LIBS!$KSTAT_LIBS$ac_delim
+RPCSVC_LIBS!$RPCSVC_LIBS$ac_delim
+CRYPT_LIBS!$CRYPT_LIBS$ac_delim
+DL_LIBS!$DL_LIBS$ac_delim
+RT_LIBS!$RT_LIBS$ac_delim
 UUID_LIBS!$UUID_LIBS$ac_delim
 DEMANGLE_LIBS!$DEMANGLE_LIBS$ac_delim
 ICONV_LIBS!$ICONV_LIBS$ac_delim
@@ -44756,37 +47300,6 @@ WXWIDGETS_GL_LIBS!$WXWIDGETS_GL_LIBS$ac_delim
 WXWIDGETS_GL_STATIC_LIBS!$WXWIDGETS_GL_STATIC_LIBS$ac_delim
 WXWIDGETS_POST_LINK!$WXWIDGETS_POST_LINK$ac_delim
 FASTCGI_INCLUDE!$FASTCGI_INCLUDE$ac_delim
-FASTCGI_LIBS!$FASTCGI_LIBS$ac_delim
-FASTCGI_OBJS!$FASTCGI_OBJS$ac_delim
-NCBI_SSS_INCLUDE!$NCBI_SSS_INCLUDE$ac_delim
-NCBI_SSS_LIBPATH!$NCBI_SSS_LIBPATH$ac_delim
-LIBSSSUTILS!$LIBSSSUTILS$ac_delim
-LIBSSSDB!$LIBSSSDB$ac_delim
-sssutils!$sssutils$ac_delim
-VDB_INCLUDE!$VDB_INCLUDE$ac_delim
-VDB_LIB!$VDB_LIB$ac_delim
-VDB_LIBS!$VDB_LIBS$ac_delim
-VDB_STATIC_LIBS!$VDB_STATIC_LIBS$ac_delim
-VDB_REQ!$VDB_REQ$ac_delim
-VDB_POST_LINK!$VDB_POST_LINK$ac_delim
-SP_INCLUDE!$SP_INCLUDE$ac_delim
-SP_LIBS!$SP_LIBS$ac_delim
-ORBACUS_INCLUDE!$ORBACUS_INCLUDE$ac_delim
-ORBACUS_LIBPATH!$ORBACUS_LIBPATH$ac_delim
-LIBOB!$LIBOB$ac_delim
-LIBIMR!$LIBIMR$ac_delim
-ICU_CONFIG!$ICU_CONFIG$ac_delim
-ICU_INCLUDE!$ICU_INCLUDE$ac_delim
-ICU_LIBS!$ICU_LIBS$ac_delim
-ICU_STATIC_LIBS!$ICU_STATIC_LIBS$ac_delim
-EXPAT_STATIC_LIBS!$EXPAT_STATIC_LIBS$ac_delim
-SABLOT_STATIC_LIBS!$SABLOT_STATIC_LIBS$ac_delim
-LIBXML_STATIC_LIBS!$LIBXML_STATIC_LIBS$ac_delim
-LIBXSLT_STATIC_LIBS!$LIBXSLT_STATIC_LIBS$ac_delim
-LIBEXSLT_STATIC_LIBS!$LIBEXSLT_STATIC_LIBS$ac_delim
-XERCES_INCLUDE!$XERCES_INCLUDE$ac_delim
-XERCES_LIBS!$XERCES_LIBS$ac_delim
-XERCES_STATIC_LIBS!$XERCES_STATIC_LIBS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -44828,6 +47341,37 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+FASTCGI_LIBS!$FASTCGI_LIBS$ac_delim
+FASTCGI_OBJS!$FASTCGI_OBJS$ac_delim
+NCBI_SSS_INCLUDE!$NCBI_SSS_INCLUDE$ac_delim
+NCBI_SSS_LIBPATH!$NCBI_SSS_LIBPATH$ac_delim
+LIBSSSUTILS!$LIBSSSUTILS$ac_delim
+LIBSSSDB!$LIBSSSDB$ac_delim
+sssutils!$sssutils$ac_delim
+VDB_INCLUDE!$VDB_INCLUDE$ac_delim
+VDB_LIB!$VDB_LIB$ac_delim
+VDB_LIBS!$VDB_LIBS$ac_delim
+VDB_STATIC_LIBS!$VDB_STATIC_LIBS$ac_delim
+VDB_REQ!$VDB_REQ$ac_delim
+VDB_POST_LINK!$VDB_POST_LINK$ac_delim
+SP_INCLUDE!$SP_INCLUDE$ac_delim
+SP_LIBS!$SP_LIBS$ac_delim
+ORBACUS_INCLUDE!$ORBACUS_INCLUDE$ac_delim
+ORBACUS_LIBPATH!$ORBACUS_LIBPATH$ac_delim
+LIBOB!$LIBOB$ac_delim
+LIBIMR!$LIBIMR$ac_delim
+ICU_CONFIG!$ICU_CONFIG$ac_delim
+ICU_INCLUDE!$ICU_INCLUDE$ac_delim
+ICU_LIBS!$ICU_LIBS$ac_delim
+ICU_STATIC_LIBS!$ICU_STATIC_LIBS$ac_delim
+EXPAT_STATIC_LIBS!$EXPAT_STATIC_LIBS$ac_delim
+SABLOT_STATIC_LIBS!$SABLOT_STATIC_LIBS$ac_delim
+LIBXML_STATIC_LIBS!$LIBXML_STATIC_LIBS$ac_delim
+LIBXSLT_STATIC_LIBS!$LIBXSLT_STATIC_LIBS$ac_delim
+LIBEXSLT_STATIC_LIBS!$LIBEXSLT_STATIC_LIBS$ac_delim
+XERCES_INCLUDE!$XERCES_INCLUDE$ac_delim
+XERCES_LIBS!$XERCES_LIBS$ac_delim
+XERCES_STATIC_LIBS!$XERCES_STATIC_LIBS$ac_delim
 XALAN_INCLUDE!$XALAN_INCLUDE$ac_delim
 XALAN_LIBS!$XALAN_LIBS$ac_delim
 XALAN_STATIC_LIBS!$XALAN_STATIC_LIBS$ac_delim
@@ -44881,7 +47425,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 51; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -45065,12 +47609,13 @@ echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
   # Base source directories on path to *input* file.
 if test -n "$ac_f"; then
-   ac_dir_in=`$as_dirname -- "$ac_f" ||
-$as_expr X"$ac_f" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_f" : 'X\(//\)[^/]' \| \
-	 X"$ac_f" : 'X\(//\)$' \| \
-	 X"$ac_f" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_f" |
+   ac_f_rel=`echo "$ac_f" | sed -e 's,^/.*/\./,,'`
+   ac_dir_in=`$as_dirname -- "$ac_f_rel" ||
+$as_expr X"$ac_f_rel" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_f_rel" : 'X\(//\)[^/]' \| \
+	 X"$ac_f_rel" : 'X\(//\)$' \| \
+	 X"$ac_f_rel" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_f_rel" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -45398,6 +47943,8 @@ else
    echo "$ncbicfg" is not present
 fi
 
+(cd $builddir/build-system/helpers && $MAKE -k)
+
 if test "$with_configure_dialog" = yes; then
    if test "$with_flat_makefile" = no; then
       { { echo "$as_me:$LINENO: error: incompatible options: --without-flat-makefile but --with-configure-dialog." >&5
@@ -45430,7 +47977,7 @@ if test "$with_flat_makefile" != "no"; then
    fi
    if $real_srcdir/scripts/common/impl/create_flat_makefile.sh "$build_root" \
        -s "$real_srcdir" $cfm_flags  &&  test -f "$builddir/Makefile.flat"; then
-      build_flat="Alternatively, cd $builddir && make -f Makefile.flat"
+      build_flat="Alternatively, cd $builddir && $MAKE -f Makefile.flat"
    elif test -f "$builddir/Flat.configuration_log"; then
       $EGREP 'Error:|already defined' "$builddir/Flat.configuration_log"
       { { echo "$as_me:$LINENO: error: flat makefile generation failed." >&5
@@ -45466,7 +48013,7 @@ esac
 
 if test -n "$with_projects"; then
     build_proj="To build selected projects (as listed in \"$with_projects\"):
-  cd $builddir && make all_p"
+  cd $builddir && $MAKE all_p"
 fi
 
 cat << EOCONF
@@ -45493,8 +48040,8 @@ PROJECTS:
 Tools / flags / paths:  $builddir/Makefile.mk
 Configuration  header:  $ncbiconf
 
-To build everything:  cd $builddir && make all_r
-or simply run make in the current directory
+To build everything:  cd $builddir && $MAKE all_r
+or simply run $MAKE in the current directory
 $build_proj
 $build_flat
 ******* CONFIGURATION SUCCESSFUL *******
diff --git a/c++/src/build-system/configure.ac b/c++/src/build-system/configure.ac
index ef22cf2..fd0d72d 100644
--- a/c++/src/build-system/configure.ac
+++ b/c++/src/build-system/configure.ac
@@ -1,5 +1,5 @@
 #############################################################################
-#  $Id: configure.ac 485101 2015-11-18 18:36:07Z ivanov $
+#  $Id: configure.ac 500366 2016-05-04 12:05:44Z ivanov $
 #  Derived from configure.in version 1.173.
 # ==========================================================================
 #
@@ -71,7 +71,7 @@ case "$with_3psw" in
                      python, perl, jni, sqlite3, mimetic, sge, icu, sp, expat,
                      sablot, libxml, libxslt, libexslt, xerces, xalan, zorba,
                      oechem, muparser, hdf5, gif, jpeg, png, tiff, xpm,
-                     magic, curl, gsoap, avro, cereal, mongodb, gmock],
+                     magic, curl, gsoap, avro, cereal, sasl2, mongodb, gmock],
         [if test "${[with_]X-no}" != "no"; then
             AC_MSG_ERROR([incompatible options: --with-]X[ but --without-3psw])
          else
@@ -243,8 +243,6 @@ AC_ARG_WITH(vdb2,
    [ --without-vdb           do not use the NCBI SRA/VDB Toolkit])
 AC_ARG_WITH(downloaded-vdb,
    [ --with-downloaded-vdb   download and build SRA/VDB from GitHub])
-AC_ARG_WITH(included-vdb,
-   [ --with-included-vdb     use the DEPRECATED bundled SRA/VDB Toolkit copy])
 
 ## Third-party and system packages
 AC_ARG_WITH(z,
@@ -475,6 +473,10 @@ AC_ARG_WITH(cereal,
    [ --with-cereal=DIR       use USC Cereal installation in DIR])
 AC_ARG_WITH(cereal2,
    [ --without-cereal        do not use USC Cereal])
+AC_ARG_WITH(sasl2,
+   [ --with-sasl2=DIR        use SASL 2 installation in DIR])
+AC_ARG_WITH(sasl2b,
+   [ --without-sasl2         do not use SASL 2])
 AC_ARG_WITH(mongodb,
    [ --with-mongodb=DIR      use MongoDB installation in DIR])
 AC_ARG_WITH(mongodb2,
@@ -536,14 +538,15 @@ autodep suffix hostspec version execopy bincopy lib-rebuilds lib-rebuilds=ask \
 deactivation makefile-auto-update projects flat-makefile configure-dialog \
 check ncbi-public strip pch caution ccache distcc \
 ncbi-c wxwidgets wxwidgets-ucs fastcgi sss sssdb sssutils included-sss \
-geo included-geo vdb downloaded-vdb included-vdb \
+geo included-geo vdb downloaded-vdb \
 z bz2 lzo pcre gmp gcrypt nettle gnutls openssl krb5 \
 sybase sybase-local sybase-new ftds mysql \
 orbacus freetype ftgl opengl mesa glut glew glew-mx \
 bdb python perl jni sqlite3 icu boost boost-tag \
 sp expat sablot libxml libxslt libexslt xerces xalan zorba \
 oechem sge muparser hdf5 \
-gif jpeg tiff png xpm magic curl mimetic gsoap avro cereal mongodb gmock 3psw \
+gif jpeg tiff png xpm \
+magic curl mimetic gsoap avro cereal sasl2 mongodb gmock 3psw \
 local-lbsm ncbi-crypt connext \
 serial objects dbapi app ctools gui algo internal gbench"
 
@@ -593,6 +596,8 @@ for x_arg in "$@" ; do
       fi
       ;;
 
+      --with-vdb=rc ) ;;
+
       --srcdir=* | --x-includes=* | --x-libraries=* | --with-tcheck=* \
       | --with-ncbi-c=* | --with-sss=* | --with-vdb=* | --with-z=* \
       | --with-bz2=* | --with-lzo=* | --with-pcre=* \
@@ -609,7 +614,8 @@ for x_arg in "$@" ; do
       | --with-sge=* | --with-muparser=* | --with-hdf5=* | --with-gif=* \
       | --with-jpeg=* | --with-png=* | --with-tiff=* | --with-xpm=* \
       | --with-magic=* | --with-curl=* | --with-mimetic=* | --with-gsoap=* \
-      | --with-avro=* | --with-cereal=* | --with-mongodb=* | --with-gmock=* )
+      | --with-avro=* | --with-cereal=* | --with-sasl2* | --with-mongodb=* \
+      | --with-gmock=* )
       # Confirm that the specified directory exists and is readable.
       dir=`echo $x_arg | sed -e 's/^[[^=]]*=//'`
       case "$x_arg" in
@@ -696,20 +702,12 @@ if test "$with_openmp" = yes; then
    : ${with_mt=yes} 
 fi
 
-case "$with_downloaded_vdb:$with_included_vdb:$with_vdb" in
-   yes:yes:* )
-      AC_MSG_ERROR([incompatible options: --with-downloaded-vdb and
-                    --with-included-vdb])
-      ;;
-   yes:*:no )
+case "$with_downloaded_vdb:$with_vdb" in
+   yes:no )
       AC_MSG_ERROR([incompatible options: --without-vdb but
                     --with-downloaded-vdb])
       ;;
-   *:yes:no )
-      AC_MSG_ERROR([incompatible options: --without-vdb but
-                    --with-included-vdb])
-      ;;
-   yes:*: | *:yes: )
+   yes: )
       with_vdb=yes
       ;;
 esac
@@ -802,24 +800,35 @@ AC_PROG_INSTALL
 #### Point ICC at a suitable GCC version ASAP.
 case "/$CXX" in
    */icpc )
-      if test -d /usr/local/gcc; then
+      if test -d /opt/ncbi/gcc -o -d /usr/local/gcc; then
          case "`$CXX -dumpversion`:$host_cpu" in
             *:i?86)           v=4.4.5 ;;
             ?.* | 1[[01]].* ) v=4.0.1 ;;
-            *)                v=4.4.2 ;;
+            1[[23]].*)        v=4.4.2 ;;
+            *)                v=4.9.3 ;;
          esac
-         gcc=/usr/local/gcc/$v/bin/gcc
-         if test -x $gcc; then
-            CC="$CC -gcc-name=$gcc"
-            CXX="$CXX -gcc-name=$gcc"
-         fi
+         for gcc in /opt/ncbi/gcc/$v/bin/gcc /usr/local/gcc/$v/bin/gcc; do
+            if test -x $gcc; then
+               CC="$CC -gcc-name=$gcc"
+               CXX="$CXX -gcc-name=$gcc"
+               case $gcc in
+                  /opt/* )
+                     LDFLAGS="-Wl,-rpath,/opt/ncbi/gcc/$v/lib64 $LDFLAGS"
+                     ;;
+                  /usr/* )
+                     LDFLAGS="-Wl,-rpath,/usr/lib64/gcc-$v $LDFLAGS"
+                     ;;
+               esac
+               break
+            fi
+         done
       fi
       ;;
 esac
 
 #### C and C++ compilers
 AC_LANG(C++)
-AC_PROG_CC
+AX_PROG_CC_FOR_BUILD
 AC_PROG_CXX
 
 
@@ -1088,7 +1097,6 @@ if test -x "$x_CXX" ; then
   echo "adjusted C++ compiler: $CXX"
 fi
 CXX_PATH="`dirname $x_CXX`"
-x_CXX=
 
 if test "$with_static_exe" = "yes"; then
    C_LINK='$(top_srcdir)/scripts/common/impl/favor-static $(CC)'
@@ -1100,7 +1108,8 @@ fi
 
 ### Which of these is better?
 #compiler_root=`dirname CXX_PATH`
-compiler_root=`echo $CXX | sed -ne 's:\(.*\)[/\\]bin[/\\].*:\1:p'`
+compiler_root=`echo $x_CXX | sed -ne 's:\(.*\)[/\\]bin[/\\].*:\1:p'`
+x_CXX=
 
 changequote([, ])dnl
 
@@ -1284,6 +1293,7 @@ case "$host_os:$compiler" in
    ;;
 
  cygwin*:GCC )
+   CPPFLAGS="-D_GLIBCXX_USE_C99 $CPPFLAGS"
    with_dll="no"
    # : ${NETWORK_LIBS:="-lws2_32"}
    CONF_exe_ext=".exe"
@@ -1999,6 +2009,12 @@ case "$compiler:$compiler_version:$with_bin_release" in
     LINK="$LINK -Kc++"
     ;;
   ICC:1???:* )
+    case "$host_cpu" in
+       i?86   ) intel_cpu_name=ia32      ;;
+       x86_64 ) intel_cpu_name=intel64   ;;
+       *      ) intel_cpu_name=$host_cpu ;;
+    esac
+    LDFLAGS="$CONF_f_runpath$compiler_root/lib/$intel_cpu_name $LDFLAGS"
     # Suppress "warning #10237: -lcilkrts linked in dynamically, static
     # library not available" which is not a problem in practice due to
     # as-needed linkage.
@@ -2139,6 +2155,11 @@ case "$compiler" in
    * ) NO_STRICT_ALIASING=
 esac
 
+dnl Autoconf 2.62+ has an AC_PATH_PROGS_FEATURE_CHECK macro that could
+dnl also be useful, but we're still on 2.60.
+AX_CHECK_GNU_MAKE
+AC_PATH_PROG(MAKE, ${ax_cv_gnu_make_command-make})
+export MAKE
 
 #### Automatic generation of dependencies for/by the "make" utility
 case "$host_os" in
@@ -2149,7 +2170,7 @@ if test "$with_autodep" = "yes" ; then
    Rules="rules_with_autodep"
 elif test "$with_autodep" = "no" ; then
    Rules="rules"
-elif make --version 2>/dev/null | grep 'GNU Make' >/dev/null ; then
+elif $MAKE --version 2>/dev/null | grep 'GNU Make' >/dev/null ; then
    Rules="rules_with_autodep"
 else
    Rules="rules"
@@ -3038,7 +3059,7 @@ AC_CHECK_HEADERS(iostream  iostream.h)
 AC_CHECK_HEADERS(fstream   fstream.h)
 AC_CHECK_HEADERS(strstream strstream.h strstrea.h)
 
-AC_CHECK_HEADERS(inttypes.h limits)
+AC_CHECK_HEADERS(inttypes.h limits limits.h)
 
 ### Check for the platform (very roughly)
 AC_CHECK_HEADERS(unistd.h,  x_have_unistd="yes")
@@ -3129,10 +3150,11 @@ AC_CHECK_HEADERS(atomic.h cpuid.h dlfcn.h ieeefp.h poll.h sys/epoll.h \
 case "$host_os" in
    cygwin*) AC_CHECK_HEADERS(winternl.h) ;;
 esac
-# for FreeTDS 0.6x
-AC_CHECK_HEADERS(arpa/inet.h errno.h malloc.h netdb.h \
-                 netinet/in.h netinet/tcp.h paths.h signal.h \
-                 sys/ioctl.h sys/select.h sys/socket.h sys/time.h wchar.h)
+# for FreeTDS
+AC_CHECK_HEADERS(arpa/inet.h errno.h libgen.h locale.h malloc.h netdb.h \
+                 netinet/in.h netinet/tcp.h paths.h signal.h stddef.h \
+                 sys/ioctl.h sys/select.h sys/socket.h sys/time.h \
+                 valgrind/memcheck.h wchar.h)
 AC_HEADER_TIME
 
 ## gethostbyname_r() -- 2 different variants: 5-arg (Solaris), 6-arg (Linux).
@@ -3348,12 +3370,12 @@ fi
 ### Check for other standard library functions
 
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(euidaccess atoll basename lchown fseeko getgrouplist \
-               getpagesize getpass getpassphrase getpwuid getrusage \
-               gettimeofday getuid memrchr readpassphrase readv usleep \
-               asprintf vasprintf vsnprintf select statfs statvfs \
-               strcasecmp strlcat strlcpy strdup strndup strtok_r \
-               sysmp timegm utimes lutimes writev)
+AC_CHECK_FUNCS(alarm asprintf atoll basename euidaccess fseeko fstat \
+               getgrouplist getopt getpagesize getpass getpassphrase \
+               getpwuid getrusage gettimeofday getuid lchown lutimes memrchr \
+               putenv readpassphrase readv select setenv statfs statvfs \
+               strcasecmp strdup strlcat strlcpy strndup strsep strtok_r \
+               sysmp timegm usleep utimes vasprintf vsnprintf writev)
 AC_LANG_POP(C)
 
 AC_TYPE_SIGNAL
@@ -3463,6 +3485,7 @@ if test "${with_universal-no}" = "no"; then
    AC_CHECK_SIZEOF(long long)
    AC_CHECK_SIZEOF(short)
    AC_CHECK_SIZEOF(void*)
+   AC_CHECK_SIZEOF(wchar_t, [], [#include <wchar.h>])
    AC_CHECK_SIZEOF(__int64)
 fi
 AC_CHECK_TYPES([intptr_t, uintptr_t])
@@ -3901,6 +3924,22 @@ AC_CACHE_CHECK([whether $CC supports -maes], ncbi_cv_cc_aes,
            }], [])],
        [ncbi_cv_cc_aes=yes], [ncbi_cv_cc_aes=no])])
 
+if test "$compiler" = ICC; then
+   # ICC noisily ignores this flag, so explicitly blacklist it.
+   ncbi_cv_cc_fdiagnostics_color_always=no
+fi
+AC_CACHE_CHECK([whether $CC supports -fdiagnostics-color=always],
+   ncbi_cv_cc_fdiagnostics_color_always,
+   [CFLAGS="$orig_CFLAGS -fdiagnostics-color=always"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
+       [ncbi_cv_cc_fdiagnostics_color_always=yes],
+       [ncbi_cv_cc_fdiagnostics_color_always=no])])
+if test $ncbi_cv_cc_fdiagnostics_color_always = yes; then
+   COLOR_DIAGNOSTICS=-fdiagnostics-color=always
+else
+   COLOR_DIAGNOSTICS=
+fi
+
 CFLAGS=$orig_CFLAGS
 AC_LANG_POP(C)
 
@@ -3981,7 +4020,7 @@ test "$ac_cv_func_getnameinfo" = "yes" && \
   AC_DEFINE(HAVE_GETNAMEINFO, 1,
             [Define to 1 if you have the `getnameinfo' function.])
 AC_CHECK_FUNCS(freehostent gethostent_r getipnodebyaddr getipnodebyname \
-               inet_ntop)
+               inet_ntop socketpair)
 LIBS=$orig_LIBS
 
 
@@ -4035,7 +4074,7 @@ if test -n "$DEMANGLE_LIBS$RT_LIBS"; then
     LIBS="$DEMANGLE_LIBS $RT_LIBS $LIBS"
     orig_LIBS="$DEMANGLE_LIBS $RT_LIBS $orig_LIBS"
 fi
-AC_CHECK_FUNCS([nanosleep sched_yield])
+AC_CHECK_FUNCS([nanosleep pthread_condattr_setclock sched_yield])
 
 dnl NCBI_CHECK_LIBS(ICONV, iconv, iconv)
 # We need to include <iconv.h>, since some implementations rename the symbols.
@@ -4065,6 +4104,7 @@ AC_CACHE_CHECK(for library containing iconv, ac_cv_search_iconv, [
       done
    fi])
 if test "x$ac_cv_search_iconv" != xno; then
+   NCBI_PACKAGE(Iconv)
    AC_DEFINE(HAVE_LIBICONV, 1,
    [Define to 1 if ICONV is available, either in its own library or as part
     of the standard libraries.])
@@ -4405,8 +4445,6 @@ NCBI_CHECK_THIRD_PARTY_LIB(curl,
 ## SYBASE libraries
 
 NETWORK_PURE_LIBS="$NETWORK_LIBS"
-ncbi_xreader_pubseqos=
-UNLESS_PUBSEQOS=
 if test "$with_sybase" != "no" ; then
    resolve_sybase=true
    default_pointer=default-${NCBI_PLATFORM_BITS}bit
@@ -4628,22 +4666,6 @@ if test "$with_sybase" != "no" ; then
          AC_DEFINE(HAVE_SYBASE_REENTRANT, 1,
                    [Define to 1 if SYBASE has reentrant libraries.])
       fi
-      if test "$with_dbapi" != no -a -f ${real_srcdir}/src/objtools/data_loaders/genbank/pubseq/Makefile.ncbi_xreader_pubseqos.lib ; then
-         AC_CACHE_CHECK([for PubSeq service availability], ncbi_cv_db_pubseq,
-            [if grep PUBSEQ_OS $SYBASE_PATH/interfaces >/dev/null; then
-                ncbi_cv_db_pubseq=yes
-             else
-                ncbi_cv_db_pubseq=no
-             fi])
-         if test "$ncbi_cv_db_pubseq" = yes; then
-            AC_DEFINE(HAVE_PUBSEQ_OS, 1,
-                      [Define to 1 if the PUBSEQ service is available.])
-            NCBI_FEATURE(PubSeqOS)
-            ncbi_xreader_pubseqos=ncbi_xreader_pubseqos
-            ncbi_xreader_pubseqos2=ncbi_xreader_pubseqos2
-            UNLESS_PUBSEQOS=\#
-         fi
-      fi
 
       SYBASE_DBLIBS="$SYBASE_LPATH -lsybdb${bit64_sfx} $sybunic"
       AC_CACHE_CHECK([for Sybase DBLib], ncbi_cv_lib_sybdb,
@@ -4693,12 +4715,13 @@ SYBASE_LIBPATH=
 ## FreeTDS libraries
 freetds=
 if test "$with_ftds" != "no" ; then
-   ftds64=ftds64
+   ftds_ver=64
    try_local=yes
    case "$with_ftds" in
-      64 | yes | '' )
-         ftds_ver=64
-         ftds64=ftds
+      64 | 0.64 | yes | '' )
+         ;;
+      95 | 0.95 )
+         ftds_ver=95
          ;;
       * )
          FTDS_PATH=$with_ftds
@@ -4709,6 +4732,7 @@ if test "$with_ftds" != "no" ; then
    NCBI_RPATHIFY(FTDS_CTLIBS,   $FTDS_PATH/lib,      [ ]$FTDS_CTLIBS)
    FTDS_INCLUDE="-I$FTDS_PATH/include"
    NCBI_LOCAL_FTDS(64)
+   NCBI_LOCAL_FTDS(95)
    if test -n "$freetds" ; then
       FTDS_LIB="\$(FTDS${ftds_ver}_LIB)"
       FTDS_LIBS="\$(FTDS${ftds_ver}_LIBS)"
@@ -4754,6 +4778,12 @@ if test "$with_ftds" = "no" ; then
    FTDS64_CTLIB_INCLUDE=
    FTDS64_CTLIB_LIBS=
    FTDS64_CTLIB_LIB=
+   FTDS95_INCLUDE=
+   FTDS95_LIBS=
+   FTDS95_LIB=
+   FTDS95_CTLIB_INCLUDE=
+   FTDS95_CTLIB_LIBS=
+   FTDS95_CTLIB_LIB=
    freetds=
 else
    AC_DEFINE(HAVE_LIBFTDS, 1,
@@ -4766,11 +4796,16 @@ AC_SUBST(FTDS64_LIB)
 AC_SUBST(FTDS64_CTLIB_INCLUDE)
 AC_SUBST(FTDS64_CTLIB_LIBS)
 AC_SUBST(FTDS64_CTLIB_LIB)
+AC_SUBST(FTDS95_INCLUDE)
+AC_SUBST(FTDS95_LIBS)
+AC_SUBST(FTDS95_LIB)
+AC_SUBST(FTDS95_CTLIB_INCLUDE)
+AC_SUBST(FTDS95_CTLIB_LIBS)
+AC_SUBST(FTDS95_CTLIB_LIB)
 AC_SUBST(FTDS_INCLUDE)
 AC_SUBST(FTDS_LIBS)
 AC_SUBST(FTDS_LIB)
 AC_SUBST(freetds)
-AC_SUBST(ftds64)
 
 
 ## MySQL
@@ -4971,12 +5006,12 @@ case "$ODBC_PATH" in
       AC_CHECK_HEADERS(odbcss.h, [], [], [#include <sql.h>])
 
       AC_CHECK_FUNCS(SQLGetPrivateProfileString)
-      AC_CHECK_TYPES(SQLLEN,,,[#include <sqltypes.h>])
+      AC_CHECK_TYPES([SQLLEN, SQLSETPOSIROW],,,[#include <sqltypes.h>])
 
       AC_CACHE_CHECK([whether SQLColAttribute's last argument is an SQLLEN *],
          ncbi_cv_func_sqlcolattribute_sqllen,
          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-            [[#include <sql.h>>
+            [[#include <sql.h>
               SQLRETURN SQL_API SQLColAttribute
                 (SQLHSTMT sh, SQLUSMALLINT cn, SQLUSMALLINT fi, SQLPOINTER ca,
                  SQLSMALLINT bl, SQLSMALLINT *sl, SQLLEN *na);]],
@@ -4999,6 +5034,8 @@ case "$ODBC_PATH" in
    ODBC_LIBS=
    dnl AC_DEFINE(HAVE_SQLGETPRIVATEPROFILESTRING, 1)
    AC_DEFINE(HAVE_SQLLEN, 1)
+   AC_DEFINE(HAVE_SQLSETPOSIROW, 1)
+   AC_DEFINE(NCBI_SQLCOLATTRIBUTE_SQLLEN, 1)
    ;;
  *)
    NCBI_PACKAGE(ODBC)
@@ -5016,6 +5053,7 @@ if test "$with_python" != "no" ; then
    NCBI_CHECK_PYTHON(2.5)
    NCBI_CHECK_PYTHON(2.6)
    NCBI_CHECK_PYTHON(2.7)
+   NCBI_CHECK_PYTHON(3)
    if test "$ncbi_cv_lib_python" = "no"; then
       if test "$ncbi_cv_lib_python27" = "yes"; then
          PYTHON_INCLUDE=$PYTHON27_INCLUDE
@@ -5186,7 +5224,7 @@ ncbi_cv_lib_boost_version=BOOST_LIB_VERSION
          fi
          with_boost=no
          ;;
-      1_3[[5-9]] | 1_3[[5-9]]_* | 1_4* | 1_5[[0-7]] | 1_5[[0-7]]_* ) ;;
+      1_3[[5-9]] | 1_3[[5-9]]_* | 1_[[45]]* | 1_60 | 1_60_* ) ;;
       '' ) with_boost=no ;;
       * )
          AC_MSG_WARN(
@@ -5301,7 +5339,7 @@ ncbi_cv_lib_boost_version=BOOST_LIB_VERSION
           [ncbi_cv_lib_boost_regex=yes], [ncbi_cv_lib_boost_regex=no])])
 
    AC_CACHE_CHECK([for Boost.Spirit$in_path], ncbi_cv_lib_boost_spirit,
-      CPPFLAGS="$BOOST_INCLUDE $orig_CPPFLAGS"
+      CPPFLAGS="$BOOST_INCLUDE -DBOOST_ERROR_CODE_HEADER_ONLY $orig_CPPFLAGS"
       LIBS="$RT_LIBS $orig_LIBS"
       [AC_LINK_IFELSE(
           [AC_LANG_PROGRAM([[#include <boost/spirit.hpp>
@@ -5965,7 +6003,7 @@ else
    fi
    NCBI_RPATHIFY_OUTPUT(WXWIDGETS_LIBS, [$wxconf $wxcfflags --libs $wxlibs],
       [$libsed; s/ -lm / /g;])
-   WXWIDGETS_STATIC_LIBS=`"$wxconf" $wxcfflags --libs --static $wxlibs \
+   WXWIDGETS_STATIC_LIBS=`"$wxconf" $wxcfflags --libs $wxlibs --static \
       2>/dev/null | sed -e "$basesed; s/ -lm / /g;"`
    if test -n "$WXWIDGETS_STATIC_LIBS"; then
       # Allow direct use of underlying libraries with strict linkers
@@ -6723,7 +6761,7 @@ if test "$with_vdb" != "no" ; then
          *     ) AC_MSG_WARN([$message])  ;;
       esac
    fi
-   if test "$with_included_vdb" != "yes"; then
+   # if test "$with_included_vdb" != "yes"; then
       if test -z "$VDB_PATH"; then
          in_path=
       else
@@ -6799,33 +6837,8 @@ if test "$with_vdb" != "no" ; then
          VDB_LIBS=
          VDB_STATIC_LIBS=
       fi
-   elif test -d "$real_srcdir/src/sra/sdk/interfaces"; then
-      case "$host_os" in
-         darwin* | linux* | solaris* )
-            AC_MSG_NOTICE([Using local NCBI SRA/VDB copy in src/sra/sdk])
-            NCBI_PACKAGE(VDB)
-            NCBI_PACKAGE(LocalVDB)
-            VDB_INCLUDE='-I$(includedir)/../src/sra/sdk/interfaces'
-            VDB_INCLUDE="$VDB_INCLUDE -I\$(includedir)/../src/sra/sdk/interfaces/C++Toolkit"
-            VDB_INCLUDE="$VDB_INCLUDE -I\$(top_srcdir)/src/sra/sdk/interfaces"
-            VDB_INCLUDE="$VDB_INCLUDE -I\$(top_srcdir)/src/sra/sdk/interfaces/C++Toolkit"
-            if test "$DEBUG_SFX" = Debug; then
-               VDB_INCLUDE="$VDB_INCLUDE -D_DEBUGGING"
-            fi
-            VDB_LIB=ncbi-vdb-read
-            VDB_LIBS=$vdb_deps
-            VDB_STATIC_LIBS=$VDB_LIBS
-            VDB_REQ=LocalVDB
-            ;;
-         * )
-            AC_MSG_ERROR([--with-included-vdb explicitly specified,
-                          but not supported on this platform.])
-            ;;
-      esac
-   else
-      AC_MSG_ERROR([--with-included-vdb explicitly specified,
-                    but no local copy exists.])
-   fi
+   # else ...
+   # fi
    if test -z "$VDB_LIBS"; then
       NCBI_MISSING_PACKAGE(vdb)
    fi
@@ -7201,6 +7214,13 @@ if test "$with_cereal" != no; then
 fi
 
 
+# SASL 2
+NCBI_CHECK_THIRD_PARTY_LIB(sasl2,
+ [[AC_LANG_PROGRAM([[#include <stdlib.h>
+                     #include <sasl/sasl.h>]],
+   [[sasl_client_init(NULL);]])]])
+
+
 # MongoDB
 case "$with_mongodb" in
    yes | no | '' ) ;;
@@ -7221,12 +7241,12 @@ NCBI_CHECK_THIRD_PARTY_LIB_EX(mongodb, MONGODB, mongoclient,
       [std::vector<mongo::HostAndPort> v;
        mongo::DBClientReplicaSet client("foo", v);
        client.connect();])],
-   [$BOOST_LIBPATH $boost_fs_lib $BOOST_REGEX_LIBS $BOOST_THREAD_LIBS], [],
+   [$BOOST_LIBPATH $boost_fs_lib $BOOST_REGEX_LIBS $BOOST_THREAD_LIBS $OPENSSL_LIBS $SASL2_LIBS], [],
    [$BOOST_INCLUDE])
 # MongoDB's own library is normally static, but its supporting Boost
 # libraries might not be by default.
 if test -n "$MONGODB_LIBS"; then
-   MONGODB_STATIC_LIBS="$MONGODB_LIBPATH -lmongoclient $BOOST_LIBPATH $boost_fs_static_lib $BOOST_REGEX_STATIC_LIBS $BOOST_THREAD_STATIC_LIBS"
+   MONGODB_STATIC_LIBS="$MONGODB_LIBPATH -lmongoclient $BOOST_LIBPATH $boost_fs_static_lib $BOOST_REGEX_STATIC_LIBS $BOOST_THREAD_STATIC_LIBS $OPENSSL_LIBS $SASL2_LIBS"
 else
    MONGODB_STATIC_LIBS=
 fi
@@ -7356,6 +7376,23 @@ else
 fi
 
 
+## direct PubSeqOS data loaders
+
+if test "$with_dbapi" != no -a \
+   -f ${real_srcdir}/src/objtools/data_loaders/genbank/pubseq/Makefile.ncbi_xreader_pubseqos.lib ; then
+   AC_DEFINE(HAVE_PUBSEQ_OS, 1,
+      [Define to 1 if the PUBSEQ service is available.])
+   NCBI_FEATURE(PubSeqOS)
+   ncbi_xreader_pubseqos=ncbi_xreader_pubseqos
+   ncbi_xreader_pubseqos2=ncbi_xreader_pubseqos2
+   UNLESS_PUBSEQOS=\#
+else
+   ncbi_xreader_pubseqos=
+   ncbi_xreader_pubseqos2=
+   UNLESS_PUBSEQOS=
+fi
+
+
 ## `serial' projects
 
 if test "$with_serial" = "no" ; then
@@ -7414,6 +7451,9 @@ fi
 DBAPI_DRIVER=
 DBAPI_CTLIB=
 DBAPI_DBLIB=
+DBAPI_FTDS=
+DBAPI_FTDS64=
+DBAPI_FTDS95=
 DBAPI_MYSQL=
 DBAPI_ODBC=
 if test "$with_dbapi" = "no" ; then
@@ -7422,6 +7462,9 @@ else
    NCBI_PROJECT(dbapi)
    dbapi="dbapi"
    DBAPI_DRIVER=dbapi_driver
+   DBAPI_FTDS=ncbi_xdbapi_ftds
+   DBAPI_FTDS64=ncbi_xdbapi_ftds64
+   DBAPI_FTDS95=ncbi_xdbapi_ftds95
    test -n "$SYBASE_LIBS"    &&  DBAPI_CTLIB=ncbi_xdbapi_ctlib
    test -n "$SYBASE_DBLIBS"  &&  DBAPI_DBLIB=ncbi_xdbapi_dblib
    test -n "$MYSQL_LIBS"     &&  DBAPI_MYSQL=ncbi_xdbapi_mysql
@@ -7817,6 +7860,9 @@ AC_SUBST(BDB_CACHE_LIB)
 AC_SUBST(DBAPI_DRIVER)
 AC_SUBST(DBAPI_CTLIB)
 AC_SUBST(DBAPI_DBLIB)
+AC_SUBST(DBAPI_FTDS)
+AC_SUBST(DBAPI_FTDS64)
+AC_SUBST(DBAPI_FTDS95)
 AC_SUBST(DBAPI_MYSQL)
 AC_SUBST(DBAPI_ODBC)
 
@@ -7826,6 +7872,7 @@ AC_SUBST(OPENMP_FLAGS)
 AC_SUBST(UNSAFE_MATH_FLAG)
 AC_SUBST(SSE4_1_FLAG)
 AC_SUBST(AES_FLAG)
+AC_SUBST(COLOR_DIAGNOSTICS)
 AC_SUBST(NETWORK_LIBS)
 AC_SUBST(NETWORK_PURE_LIBS)
 AC_SUBST(RESOLVER_LIBS)
@@ -8103,6 +8150,9 @@ else
    echo "$ncbicfg" is not present
 fi
 
+dnl Try to build simple helpers
+(cd $builddir/build-system/helpers && $MAKE -k)
+
 dnl Create Makefile.flat if requested
 if test "$with_configure_dialog" = yes; then
    if test "$with_flat_makefile" = no; then
@@ -8132,7 +8182,7 @@ if test "$with_flat_makefile" != "no"; then
    fi
    if $real_srcdir/scripts/common/impl/create_flat_makefile.sh "$build_root" \
        -s "$real_srcdir" $cfm_flags  &&  test -f "$builddir/Makefile.flat"; then
-      build_flat="Alternatively, cd $builddir && make -f Makefile.flat"
+      build_flat="Alternatively, cd $builddir && $MAKE -f Makefile.flat"
    elif test -f "$builddir/Flat.configuration_log"; then
       $EGREP 'Error:|already defined' "$builddir/Flat.configuration_log"
       AC_MSG_ERROR([flat makefile generation failed.])
@@ -8167,7 +8217,7 @@ esac
 
 if test -n "$with_projects"; then
     build_proj="To build selected projects (as listed in \"$with_projects\"):
-  cd $builddir && make all_p"
+  cd $builddir && $MAKE all_p"
 fi
 
 cat << EOCONF
@@ -8194,8 +8244,8 @@ PROJECTS:
 Tools / flags / paths:  $builddir/Makefile.mk
 Configuration  header:  $ncbiconf
 
-To build everything:  cd $builddir && make all_r
-or simply run make in the current directory
+To build everything:  cd $builddir && $MAKE all_r
+or simply run $MAKE in the current directory
 $build_proj
 $build_flat
 ******* CONFIGURATION SUCCESSFUL *******
@@ -8212,6 +8262,7 @@ CXXFLAGS='$CXXFLAGS'
 CPPFLAGS='$CPPFLAGS'
 LDFLAGS='$LDFLAGS'
 LIB_OR_DLL='$LIB_OR_DLL'
+MAKE='$MAKE'
 with_dll='$with_dll'
 WithFeatures='$WithFeatures'
 WithoutFeatures='$WithoutFeatures'
@@ -8227,6 +8278,7 @@ with_saved_settings='$with_saved_settings'
 smart_pwd='$smart_pwd'
 real_srcdir='$real_srcdir'
 EGREP='$EGREP'
+export MAKE PATH
 ])
 
 AC_WARNING([*** Please don't forget to update .../src/build-system/NEWS if appropriate! ***])dnl
diff --git a/c++/src/build-system/helpers/Makefile.in b/c++/src/build-system/helpers/Makefile.in
new file mode 100644
index 0000000..ba5a743
--- /dev/null
+++ b/c++/src/build-system/helpers/Makefile.in
@@ -0,0 +1,6 @@
+# $Id: Makefile.in 484097 2015-11-06 15:11:22Z ucko $
+
+APP_PROJ = run_with_lock
+
+srcdir = @srcdir@
+include @builddir@/Makefile.meta
diff --git a/c++/src/build-system/helpers/Makefile.run_with_lock.app b/c++/src/build-system/helpers/Makefile.run_with_lock.app
new file mode 100644
index 0000000..97317f4
--- /dev/null
+++ b/c++/src/build-system/helpers/Makefile.run_with_lock.app
@@ -0,0 +1,19 @@
+# $Id: Makefile.run_with_lock.app 493416 2016-02-26 18:48:41Z ivanov $
+APP = run_with_lock
+SRC = run_with_lock
+
+CC          = $(CC_FOR_BUILD)
+CC_WRAPPER  =
+CXX_WRAPPER =
+CPP         = $(CPP_FOR_BUILD)
+CFLAGS      = $(CFLAGS_FOR_BUILD)
+CPPFLAGS    = $(CPPFLAGS_FOR_BUILD)
+LDFLAGS     = $(LDFLAGS_FOR_BUILD)
+LIBS        = $(C_LIBS)
+LINK        = $(CC)
+LINK_WRAPPER =
+APP_LDFLAGS = 
+
+APP_OR_NULL = app
+REQUIRES    = unix -XCODE
+WATCHERS    = ucko
diff --git a/c++/src/build-system/helpers/run_with_lock.c b/c++/src/build-system/helpers/run_with_lock.c
new file mode 100644
index 0000000..f492fb5
--- /dev/null
+++ b/c++/src/build-system/helpers/run_with_lock.c
@@ -0,0 +1,537 @@
+/*  $Id: run_with_lock.c 500280 2016-05-03 17:21:37Z ivanov $
+* ===========================================================================
+*
+*                            PUBLIC DOMAIN NOTICE
+*               National Center for Biotechnology Information
+*
+*  This software/database is a "United States Government Work" under the
+*  terms of the United States Copyright Act.  It was written as part of
+*  the author's official duties as a United States Government employee and
+*  thus cannot be copyrighted.  This software/database is freely available
+*  to the public for use. The National Library of Medicine and the U.S.
+*  Government have not placed any restriction on its use or reproduction.
+*
+*  Although all reasonable efforts have been taken to ensure the accuracy
+*  and reliability of the software and data, the NLM and the U.S.
+*  Government do not and cannot warrant the performance or results that
+*  may be obtained by using this software or data. The NLM and the U.S.
+*  Government disclaim all warranties, express or implied, including
+*  warranties of performance, merchantability or fitness for any particular
+*  purpose.
+*
+*  Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* Author:  Aaron Ucko
+*
+* File Description:
+*   Run a portion of the build under a filesystem-based lock,
+*   optionally logging any resulting output (both stdout and stderr).
+*
+* ===========================================================================
+*/
+
+
+#ifndef _GNU_SOURCE
+#  define _GNU_SOURCE 1
+#endif
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/select.h>
+#include <sys/wait.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include <assert.h>
+
+#ifndef PATH_MAX
+#  define PATH_MAX 4096
+#endif
+
+#ifndef W_EXITCODE
+#  define W_EXITCODE(x, y) (((x) << 8) | (y))
+#endif
+
+static const char* s_AppName;
+static char        s_LockName[PATH_MAX];
+static int         s_MainChildDone;
+static int         s_FinishingInBackground;
+static int         s_CaughtSignal;
+static sig_t       s_OrigHandlers[NSIG + 1];
+
+
+typedef struct {
+    const char* base;
+    const char* getter;
+    const char* logfile;
+    const char* map;
+    const char* reviewer;
+    int         error_status;
+} SOptions;
+
+typedef enum {
+    eFS_off,
+    eFS_on,
+    eFS_esc,
+    eFS_csi,
+} EFilterState;
+
+
+static
+void s_ApplyMap(SOptions* options)
+{
+    char line[1024];
+    FILE* map_file;
+
+    assert(options->map != NULL);
+    map_file = fopen(options->map, "r");
+    if (map_file == NULL) {
+        if (errno != ENOENT) {
+            fprintf(stderr,
+                    "%s: Unable to open lock map %s: %s; leaving base as %s.\n",
+                    s_AppName, options->map, strerror(errno), options->base);
+        }
+        return;
+    }
+    while (fgets(line, sizeof(line), map_file) != NULL) {
+        char key[1024], value[1024];
+        if (sscanf(line, " %s %s", key, value) == 2
+            &&  strcmp(key, options->base + 5) == 0) {
+            char *new_base = malloc(strlen(value) + 6);
+            sprintf(new_base, "make_%s", value);
+            fprintf(stderr, "%s: Adjusting base from %s to %s per %s.\n",
+                    s_AppName, options->base, new_base, options->map);
+            options->base = new_base;
+            break;
+        }
+    }
+    
+    fclose(map_file);
+}
+
+
+static
+void s_ParseOptions(SOptions* options, int* argc, const char* const** argv)
+{
+    options->base         = NULL;
+    options->getter       = NULL;
+    options->logfile      = NULL;
+    options->map          = NULL;
+    options->reviewer     = NULL;
+    options->error_status = 1;
+        
+    while (*argc > 1) {
+        if (strcmp((*argv)[1], "-base") == 0  &&  *argc > 2) {
+            options->base = (*argv)[2];
+            *argv += 2;
+            *argc -= 2;
+        } else if (strcmp((*argv)[1], "-getter") == 0  &&  *argc > 2) {
+            options->getter = (*argv)[2];
+            *argv += 2;
+            *argc -= 2;
+        } else if (strcmp((*argv)[1], "-log") == 0  &&  *argc > 2) {
+            options->logfile = (*argv)[2];
+            *argv += 2;
+            *argc -= 2;
+        } else if (strcmp((*argv)[1], "-map") == 0  &&  *argc > 2) {
+            options->map = (*argv)[2];
+            *argv += 2;
+            *argc -= 2;
+        } else if (strcmp((*argv)[1], "-reviewer") == 0  &&  *argc > 2) {
+            options->reviewer = (*argv)[2];
+            *argv += 2;
+            *argc -= 2;
+        } else if ((*argv)[1][0] == '-') {
+            fprintf(stderr, "%s: Unsupported option %s.\n",
+                    s_AppName, (*argv)[1]);
+            exit(options->error_status);
+        } else if (strcmp((*argv)[1], "!") == 0) {
+            options->error_status = 0;
+            ++*argv;
+            --*argc;
+        } else {
+            break;
+        }
+    }
+
+    if (options->base == NULL  &&  *argc > 1) {
+        const char* p = strrchr((*argv)[1], '/');
+        if (p != NULL) {
+            options->base = p + 1;
+        } else {
+            options->base = (*argv)[1];
+        }
+    }
+}
+
+
+static
+int s_Tee(int in, FILE* out1, FILE* out2, EFilterState* state)
+{
+    char    buffer[1024];
+    ssize_t n;
+    while ((n = read(in, buffer, sizeof(buffer))) > 0) {
+        char* p = buffer;
+        if (fwrite(buffer, 1, n, out1) < n) {
+            fprintf(stderr, "%s: Error propagating process output: %s.\n",
+                    s_AppName, strerror(errno));
+        }
+        if (*state == eFS_esc) {
+            if (*p == '[') {
+                ++p;
+                --n;
+                *state = eFS_csi;
+            } else {
+                fputc('\033', out2);
+                *state = eFS_on;
+            }
+        } else if (*state == eFS_csi) {
+            p = memchr(buffer, 'm', n);
+            if (p == NULL) {
+                continue;
+            } else {
+                ++p;
+                n -= (p - buffer);
+                *state = eFS_on;
+            }
+        }
+        if (*state == eFS_on) {
+            const char* start   = p;
+            const char* src     = p;
+            char*       dest    = p;
+            while (src - p < n
+                   &&  (start = memchr(src, '\033', n - (src - p))) != NULL
+                   &&  (start == p + n - 1  ||  start[1] == '[')) {
+                if (src > dest  &&  start > src) {
+                    memmove(dest, src, start - src);
+                }
+                if (start == p + n - 1) {
+                    *state = eFS_esc;
+                    n = start - p;
+                    break;
+                }
+                dest += start - src;
+                const char* end = memchr(start + 2, 'm', n - 2 - (start - p));
+                if (end == NULL) {
+                    *state = eFS_csi;
+                    n = start - p;
+                    break;
+                } else {
+                    src = end + 1;
+                }
+            }
+            memmove(dest, src, n - (src - p));
+            n -= src - dest;
+        }
+        if (fwrite(p, 1, n, out2) < n) {
+            fprintf(stderr, "%s: Error logging process output: %s.\n",
+                    s_AppName, strerror(errno));
+        }
+    }
+    if (n < 0  &&  errno != EAGAIN  &&  errno != EWOULDBLOCK) {
+        if (*state == eFS_off  ||  errno != EIO) {
+            fprintf(stderr, "%s: Error reading from process: %s.\n",
+                    s_AppName, strerror(errno));
+        }
+        return 1;
+    }
+    return n == 0;
+}
+
+
+static
+void s_OnSIGCHLD(int n)
+{
+    s_MainChildDone = 1;
+}
+
+
+static
+int s_OpenPipeOrPty(int fd_to_mimic, const char* label, int fds[2],
+                    EFilterState* state)
+{
+    if (isatty(fd_to_mimic)) {
+        struct termios attr;
+        const char*    name;
+        *state = eFS_on;
+        if ((fds[0] = posix_openpt(O_RDONLY | O_NOCTTY)) < 0) {
+            fprintf(stderr, "%s: Error allocating pty master for %s: %s.\n",
+                    s_AppName, label, strerror(errno));
+            return -1;
+        } else if (grantpt(fds[0]) < 0  ||  unlockpt(fds[0]) < 0
+                   ||  (name = ptsname(fds[0])) == NULL
+                   ||  (fds[1] = open(name, O_WRONLY)) < 0) {
+            fprintf(stderr, "%s: Error opening pty slave for %s: %s.\n",
+                    s_AppName, label, strerror(errno));
+            close(fds[0]);
+            return -1;
+        }
+        if (tcgetattr(fds[1], &attr) < 0) {
+            fprintf(stderr,
+                    "%s: Warning: unable to get attributes for %s: %s.\n",
+                    s_AppName, label, strerror(errno));
+        } else {
+            attr.c_oflag |= ONLRET;
+#ifdef ONLCR
+            attr.c_oflag &= ~ONLCR;
+#endif
+            /* XXX -- propagate anything from fd_to_mimic? */
+            if (tcsetattr(fds[1], TCSADRAIN, &attr) < 0) {
+                fprintf(stderr,
+                    "%s: Warning: unable to set attributes for %s: %s.\n",
+                        s_AppName, label, strerror(errno));
+            }
+        }
+    } else {
+        if (pipe(fds) < 0) {
+            fprintf(stderr, "%s: Error creating pipe for %s: %s.n",
+                    s_AppName, label, strerror(errno));
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+
+static
+int s_Run(const char* const* args, FILE* log)
+{
+    int   stdout_fds[2], stderr_fds[2];
+    int   status = W_EXITCODE(126, 0);
+    pid_t pid;
+    EFilterState stdout_state = eFS_off, stderr_state = eFS_off;
+    if (log != NULL) {
+        if (s_OpenPipeOrPty(STDOUT_FILENO, "stdout", stdout_fds, &stdout_state)
+            < 0) {
+            return status;
+        }
+        if (s_OpenPipeOrPty(STDERR_FILENO, "stderr", stderr_fds, &stderr_state)
+            < 0) {
+            close(stdout_fds[0]);
+            close(stdout_fds[1]);
+            return status;
+        }
+        s_MainChildDone = 0;
+        signal(SIGCHLD, s_OnSIGCHLD);
+    }
+    
+    pid = fork();
+    if (pid < 0) { /* error */
+        fprintf(stderr, "%s: Fork failed: %s.\n", s_AppName, strerror(errno));
+    } else if (pid == 0) { /* child */
+        int n;
+        if (log != NULL) {
+            close(stdout_fds[0]);
+            close(stderr_fds[0]);
+            dup2(stdout_fds[1], STDOUT_FILENO);
+            dup2(stderr_fds[1], STDERR_FILENO);
+        }
+        for (n = 1;  n <= NSIG;  ++n) {
+            if (n != SIGKILL  &&  n != SIGSTOP) {
+                signal(n, s_OrigHandlers[n]);
+            }
+        }
+        execvp(args[0], (char* const*) args);
+        fprintf(stderr, "%s: Unable to exec %s: %s.\n",
+                s_AppName, args[0], strerror(errno));
+        _exit(127);
+    } else { /* parent */
+        if (log != NULL) {
+            int stdout_done = 0, stderr_done = 0;
+            close(stdout_fds[1]);
+            close(stderr_fds[1]);
+            fcntl(stdout_fds[0], F_SETFL,
+                  fcntl(stdout_fds[0], F_GETFL) | O_NONBLOCK);
+            fcntl(stderr_fds[0], F_SETFL,
+                  fcntl(stderr_fds[0], F_GETFL) | O_NONBLOCK);
+            while ( !stdout_done  ||  !stderr_done ) {
+                fd_set rfds, efds;
+                unsigned int nfds = 0;
+                FD_ZERO(&rfds);
+                FD_ZERO(&efds);
+                if ( !stderr_done ) {
+                    FD_SET(stderr_fds[0], &rfds);
+                    FD_SET(stderr_fds[0], &efds);
+                    nfds = stderr_fds[0] + 1;
+                }
+                if ( !stdout_done ) {
+                    FD_SET(stdout_fds[0], &rfds);
+                    FD_SET(stdout_fds[0], &efds);
+                    if (stdout_fds[0] >= nfds) {
+                        nfds = stdout_fds[0] + 1;
+                    }
+                }
+                if (select(nfds, &rfds, NULL, &efds, NULL) < 0
+                    &&  errno != EINTR  &&  errno != EAGAIN) {
+                    fprintf(stderr,
+                            "%s: Error checking for output to log: %s.\n",
+                            s_AppName, strerror(errno));
+                    break;
+                }
+                if (FD_ISSET(stdout_fds[0], &rfds)
+                    ||  FD_ISSET(stdout_fds[0], &efds)) {
+                    stdout_done = s_Tee(stdout_fds[0], stdout, log,
+                                        &stdout_state);
+                }
+                if (FD_ISSET(stderr_fds[0], &rfds)
+                    ||  FD_ISSET(stderr_fds[0], &efds)) {
+                    stderr_done = s_Tee(stderr_fds[0], stderr, log,
+                                        &stderr_state);
+                }
+                if (s_MainChildDone  &&  ( !stdout_done  ||  !stderr_done )
+                    &&  waitpid(pid, &status, WNOHANG) != 0) {
+                    s_MainChildDone = 0;
+                    fflush(log);
+                    if (fork() > 0) {
+                        s_FinishingInBackground = 1;
+                        break;
+                    }
+                }
+            }
+            signal(SIGCHLD, s_OrigHandlers[SIGCHLD]);
+        }
+        if (log == NULL  ||  !s_FinishingInBackground ) {
+            waitpid(pid, &status, 0);
+        }
+    }
+
+    if (log != NULL) {
+        close(stdout_fds[0]);
+        close(stderr_fds[0]);
+    }
+    return status;
+}
+
+
+static
+void s_CleanUp(void)
+{
+    const char* args[] = { "/bin/rm", "-rf", s_LockName, NULL };
+    if ( !s_FinishingInBackground ) {
+        s_Run(args, NULL);
+    }
+}
+
+
+static
+void s_OnSignal(int n)
+{
+    /* Propagate to child?  The shell version doesn't. */
+    fprintf(stderr, "%s: Caught signal %d\n", s_AppName, n);
+    /*
+    s_CleanUp();
+    _exit(n | 0x80);
+    */
+    s_CaughtSignal = n;
+    signal(n, s_OnSignal);
+}
+
+
+typedef enum {
+    eOldLogMissing,
+    eNewLogBoring,
+    eNewLogInteresting
+} ELogStatus;
+
+
+int main(int argc, const char* const* argv)
+{
+    SOptions    options;
+    char        pid_str[sizeof(pid_t) * 3 + 1], new_log[PATH_MAX];
+    const char* getter_args[] = { "get_lock", "BASE", pid_str, NULL };
+    FILE*       log = NULL;
+    int         status = 0, n;
+
+    s_AppName = argv[0];
+    s_ParseOptions(&options, &argc, &argv);
+
+    if (options.map != NULL  &&  strncmp(options.base, "make_", 5) == 0) {
+        s_ApplyMap(&options);
+    }
+
+    if (options.getter != NULL) {
+        getter_args[0] = options.getter;
+    }
+    getter_args[1] = options.base;
+    sprintf(pid_str, "%ld", (long)getpid());
+    sprintf(s_LockName, "%s.lock", options.base);
+    for (n = 1;  n <= NSIG;  ++n) {
+        switch (n) {
+            /* Blacklist some signals for various reasons. */
+        case SIGQUIT: case SIGILL: case SIGABRT: case SIGFPE: case SIGSEGV:
+        case SIGBUS: case SIGSYS: case SIGTRAP: case SIGXCPU: case SIGXFSZ:
+            /* Don't touch anything severe enough to cause a core dump. */
+        case SIGPIPE:
+            /* Should react immediately here too. */
+        case SIGKILL: case SIGSTOP:
+            /* Uncatchable. */
+        case SIGTSTP: case SIGTTIN: case SIGTTOU:
+            /* Harmless temporary suspension; don't overreact. */
+        case SIGCHLD: case SIGCONT: case SIGURG: case SIGWINCH:
+            /* Totally harmless; don't overreact. */
+            break;
+        default:
+            s_OrigHandlers[n] = signal(n, s_OnSignal);
+        }
+    }
+    s_Run(getter_args, NULL);
+    if (s_CaughtSignal) {
+        goto cleanup;
+    }
+
+    if (options.logfile != NULL) {
+        sprintf(new_log, "%s.new", options.logfile);
+        log = fopen(new_log, "w");
+        if (log == NULL) {
+            fprintf(stderr, "%s: Couldn't open log file %s: %s.\n",
+                    s_AppName, options.logfile, strerror(errno));
+            return options.error_status;
+        }
+    }
+
+    if ( !s_CaughtSignal ) {
+        status = s_Run(argv + 1, log);
+    }
+
+    if (log != NULL  &&  !s_CaughtSignal  &&  access(new_log, F_OK) == 0) {
+        ELogStatus log_status = eNewLogInteresting;
+        fclose(log);
+        if (access(options.logfile, F_OK) != 0) {
+            log_status = eOldLogMissing;
+        } else if (options.reviewer != NULL) {
+            const char* reviewer_args[] = { options.reviewer, new_log, NULL };
+            if (s_Run(reviewer_args, NULL) != 0) {
+                log_status = eNewLogBoring;
+            }
+        }
+        if (log_status != eNewLogBoring) {
+            if (rename(new_log, options.logfile) < 0) {
+                fprintf(stderr, "%s: Unable to rename log file %s: %s.\n",
+                        s_AppName, new_log, strerror(errno));
+            }
+        }
+    }
+
+ cleanup:
+    s_CleanUp();
+
+    if (s_CaughtSignal) {
+        status = s_CaughtSignal | 0x80;
+    } else if (WIFSIGNALED(status)) {
+        status = WTERMSIG(status) | 0x80;
+    } else {
+        status = WEXITSTATUS(status);
+    }
+    if (options.error_status == 0) {
+        status = !status;
+    }
+
+    return status;
+}
diff --git a/c++/src/build-system/install.sh.in b/c++/src/build-system/install.sh.in
index 9ea7b71..65791ce 100644
--- a/c++/src/build-system/install.sh.in
+++ b/c++/src/build-system/install.sh.in
@@ -17,7 +17,7 @@
 
 echo "[`date`]"
 
-svn_location=`echo '$HeadURL: https://svn.ncbi.nlm.nih.gov/repos/toolkit/release/blast/2.3.0/c++/src/build-system/install.sh.in $' | sed "s%\\$[H]eadURL: *\\([^$][^$]*\\) \\$.*%\\1%"`
+svn_location=`echo '$HeadURL: https://svn.ncbi.nlm.nih.gov/repos/toolkit/release/blast/2.4.0/c++/src/build-system/install.sh.in $' | sed "s%\\$[H]eadURL: *\\([^$][^$]*\\) \\$.*%\\1%"`
 svn_revision=`echo '$Revision: 117476 $' | sed "s%\\$[R]evision: *\\([^$][^$]*\\) \\$.*%\\1%"`
 
 script_name=`basename $0`
diff --git a/c++/src/build-system/library_relations.txt b/c++/src/build-system/library_relations.txt
index bf463ce..45ad8ab 100644
--- a/c++/src/build-system/library_relations.txt
+++ b/c++/src/build-system/library_relations.txt
@@ -1,4 +1,4 @@
-# $Id: library_relations.txt 477362 2015-08-28 13:25:29Z fukanchi $
+# $Id: library_relations.txt 490610 2016-01-27 15:05:28Z syncbot $
 # Pregenerated summary of library relations, for use by project_tree_builder.
 $(ORIG_LIBS) needs3party
 16S_common needs seqset
@@ -30,7 +30,7 @@ GLU needs3party Xext
 GMA needs $(SDBAPI_LIB)
 GMA needs xconnect
 GMA needs xutil
-GMC needs softparse
+GMC needs geomyncbi
 GMC needs xgridcgi
 GMU needs $(COMPRESS_LIBS)
 GMU needs geoauth
@@ -60,9 +60,12 @@ align_format needs $(OBJREAD_LIBS)
 align_format needs blast_services
 align_format needs gene_info
 align_format needs seqdb
+align_format needs taxon1
 align_format needs xalnmgr
 align_format needs xcgi
 align_format needs xhtml
+align_part_ci needs $(SEQ_LIBS)
+align_part_ci needs pub
 aligndb_client needs $(SEQ_LIBS)
 aligndb_client needs pub
 aligndb_reader needs $(COMPRESS_LIBS)
@@ -79,7 +82,7 @@ an_core needs gc_util_sdbapi
 an_core needs gpinit_bag_util
 an_core needs gpipe_an_base
 an_core needs gpipe_kmer
-an_core needs gpipe_val
+an_core needs gpipe_xmlutil
 an_core needs ncbi_xcache_netcache
 an_core needs pathogen_connection
 an_core needs reftrack_access
@@ -92,14 +95,15 @@ an_euk_pipeline needs3party $(BOOST_FILESYSTEM_LIBS)
 an_euk_pipeline needs3party $(BOOST_SYSTEM_LIBS)
 an_prok_pipeline needs $(GPIPE_COMMON_LIBS)
 an_prok_pipeline needs gpipe_an_base
+an_prok_pipeline needs gpipe_asn_proc
 an_prok_pipeline needs pathogen_connection
+an_prok_pipeline needs tax_xml
 an_prok_pipeline needs xobjwrite
-an_rnaseq needs gpipe_an_base
-an_rnaseq needs matchhits
 an_worker_nodes needs gpipe_an_base
 asn_cache includes id_dump
 asn_config needs build_config_base
 asn_config needs config_access
+asn_config needs gpipe_objutil
 asn_config needs reftrack_access
 asn_sample_lib needs xser
 asngendefs needs xser
@@ -114,7 +118,9 @@ auxnet_g needs generic_db_utils
 backendcommon needs $(SDBAPI_LIB)
 backendcommon needs txxmldoc
 backendcommon needs xconnect
+bacterial_pipeline_proc needs gencoll_client
 bacterial_pipeline_proc needs gpipe_objutil
+bacterial_pipeline_proc needs prok_align_monomer
 bacterial_pipeline_proc needs xalgoalignutil
 bag_access needs $(SEQ_LIBS)
 bag_access needs gpipe_common
@@ -163,9 +169,6 @@ blastinput needs align_format
 blaststoreasncpp_g needs bl2seqasn_g
 blastxml needs xser
 blastxml2 needs xser
-blk64 needs3party $(ORIG_LIBS)
-blk64 needs3party comn64
-blk64 needs3party intl64
 bob_g needs splitdbasn_g
 bob_g needs3party netblast
 boost_filesystem-gcc44-mt-d-64 needs3party $(BOOST_SYSTEM_LIBS)
@@ -176,6 +179,7 @@ build_config needs $(GPIPE_COMMON_LIBS)
 build_config needs $(GPIPE_GENCOLL_LIBS)
 build_config needs bacterial_pipeline_proc
 build_config needs build_config_base
+build_config needs gpipe_xmlutil
 build_config needs reftrack_access
 build_config_base needs gencoll_client
 build_config_base needs gpinit_bag_util
@@ -189,6 +193,7 @@ cdd needs scoremat
 clog needs3party $(ORIG_LIBS)
 cluster needs3party $(ORIG_LIBS)
 cluster_assignment needs xser
+cluster_utils needs gpipe_objutil
 clustering needs cobalt
 cn3d needs mmdb
 cobalt needs $(BLAST_LIBS)
@@ -198,8 +203,6 @@ cobaltasn_g needs $(SEQ_LIBS)
 cobaltasn_g needs biotree
 cobaltasn_g needs pub
 com_err needs3party $(ORIG_LIBS)
-comn64 needs3party $(ORIG_LIBS)
-comn64 needs3party intl64
 composition_adjustment needs3party $(ORIG_LIBS)
 config_access needs gpinit_obj
 config_access needs gpipe_common
@@ -214,19 +217,15 @@ creaders needs3party $(ORIG_LIBS)
 crypto needs $(Z_LIB)
 crypto needs3party $(ORIG_LIBS)
 crypto needs3party $(Z_LIBS)
-cs64 needs3party $(ORIG_LIBS)
-cs64 needs3party comn64
-cs64 needs3party intl64
-ct64 needs3party $(ORIG_LIBS)
-ct64 needs3party comn64
-ct64 needs3party intl64
 ct_ftds64 needs tds_ftds64
+ct_ftds95 needs tds_ftds95
 ctransition needs xncbi
 ctutils needs $(VDB_LIB)
 ctutils needs3party $(SYBASE_DLLS)
 ctutils needs3party $(SYBASE_LIBS)
 ctutils needs3party $(VDB_LIBS)
 ctutils needs3party ncbiobj
+ctutils needs3party sybunic64
 curl needs3party $(ORIG_LIBS)
 db needs3party $(ORIG_LIBS)
 dbapi needs dbapi_driver
@@ -236,6 +235,8 @@ dbapi_sample_base needs $(DBAPI_CTLIB)
 dbapi_sample_base needs $(DBAPI_ODBC)
 dbapi_sample_base needs $(XCONNEXT)
 dbapi_sample_base needs ncbi_xdbapi_ftds
+dbapi_sample_base needs ncbi_xdbapi_ftds64
+dbapi_sample_base needs ncbi_xdbapi_ftds95
 dbapi_sample_base needs xconnect
 dbapi_sample_base needs xutil
 dbapi_sample_base needs3party $(SYBASE_DLLS)
@@ -254,6 +255,7 @@ dbloadb needs asnmuxdblb
 dbloadb needs tea_crypt
 dbloadb_asn needs asngendefs
 ddvlib needs3party ncbidesk
+distance needs xalgophytree
 docsum needs xser
 drmaa needs3party $(ORIG_LIBS)
 dtd_sample_lib needs xser
@@ -317,10 +319,12 @@ ftgl needs3party $(ORIG_LIBS)
 gbproj needs submit
 gbproj needs xconnect
 gbseq needs xser
-gc_ftp_ctl needs gpipe_objutil
 gc_load_utils needs $(GPIPE_COMMON_LIBS)
+gc_load_utils needs gc_organism
 gc_load_utils needs gc_utils
-gc_load_utils needs xid_utils
+gc_organism needs gpipe_attr
+gc_organism needs taxon1
+gc_schedule needs xconnserv
 gc_util_sdbapi needs gencoll_client
 gc_util_sdbapi needs gpipe_common
 gc_utils needs gpipe_objutil
@@ -329,6 +333,7 @@ gcedit needs agp_lookup
 gcedit needs gc_load_utils
 gcrypt needs3party $(ORIG_LIBS)
 gdsutil needs xncbi
+gencoll_client needs $(COMPRESS_LIBS)
 gencoll_client needs genome_collection
 gencoll_client needs xconnect
 gencoll_load needs xser
@@ -339,6 +344,7 @@ gene_info needs xncbi
 gene_info_writer needs gene_info
 gene_info_writer needs seqdb
 genemark_proc needs bacterial_pipeline_proc
+genemark_proc needs genomic_repeat_region
 general needs xser
 generic_db_asn needs xser
 generic_db_core needs $(CONNEXT)
@@ -351,6 +357,10 @@ generic_db_utils_cgi includes generic_db_utils
 genesbyloc needs xser
 genome_collection needs $(SEQ_LIBS)
 genome_collection needs pub
+genome_size needs $(COMPRESS_LIBS)
+genome_size needs xconnect
+genome_size needs xutil
+genomic_repeat_region needs $(SOBJMGR_LIBS)
 gensvc_g needs xser
 geoauth needs GMA
 geobrowse needs xser
@@ -373,8 +383,8 @@ geomyncbi needs xmlwrapp
 geostat needs xncbi
 gif needs3party $(ORIG_LIBS)
 gif needs3party X11
-gmap needs xlinear_prog
 gmap needs xmlwrapp
+gmap needs xncbi
 gmp needs3party $(ORIG_LIBS)
 gnomon_access needs sqlitewrapp
 gnomon_access needs xalgognomon
@@ -385,25 +395,24 @@ gnutls needs3party $(GMP_LIBS)
 gnutls needs3party $(NETTLE_LIBS)
 gnutls needs3party $(ORIG_LIBS)
 gnutls needs3party $(Z_LIBS)
-gp_python_attr needs gpipe_attr
-gp_python_attr needs3party $(PYTHON_LIBS)
 gpcgi needs $(SDBAPI_LIB)
+gpcgi needs gpipe_xmlutil
 gpcgi needs xcgi
 gpcgi needs xconnect
-gpcgi needs xmlwrapp
 gpcgi needs xregexp
 gpexec_query needs gpipe_common
 gpexec_query needs monitor_buildrun
 gpg-error needs3party $(ORIG_LIBS)
 gpinit includes gpinit_obj
 gpinit needs entrez2cli
-gpinit needs gc_utils
+gpinit needs gc_organism
 gpinit needs gpinit_access
+gpinit needs gpipe_objutil
 gpinit_access needs gpipe_common
 gpinit_bag_util needs bag_access
 gpinit_bag_util needs gpinit_access
 gpinit_obj needs general
-gpinit_register needs gc_utils
+gpinit_register needs gc_organism
 gpinit_register needs gpinit_access
 gpinit_reports needs xmlwrapp
 gpinit_reports needs xregexp
@@ -429,31 +438,41 @@ gpipe_asn_proc needs xmergetree
 gpipe_attr needs gpipe_property
 gpipe_best_placement needs gpipe_alnutil
 gpipe_best_placement needs xalgoalignutil
+gpipe_blast needs $(BLAST_INPUT_LIBS)
+gpipe_blast needs gpipe_alnutil
 gpipe_clean_prot_names needs $(SDBAPI_LIB)
 gpipe_clean_prot_names needs xdiscrepancy_report
-gpipe_common includes eutils_client
 gpipe_common needs $(SDBAPI_LIB)
+gpipe_common needs eutils_client
 gpipe_common needs xcgi
+gpipe_common needs xregexp
 gpipe_dateutil needs xregexp
+gpipe_ftp needs gc_utils
 gpipe_ftp needs gcaccess_utils
 gpipe_ftp needs gpinit
 gpipe_ftp needs gpipe_alnutil
 gpipe_ftp needs xalgoalignutil
 gpipe_ftp needs xobjwrite
 gpipe_ftp needs xrepeatdb
+gpipe_ftp_new needs $(GPIPE_COMMON_LIBS)
+gpipe_ftp_new needs gc_utils
 gpipe_ftp_new needs gcaccess_utils
 gpipe_ftp_new needs gpinit
+gpipe_ftp_new needs gpipe_alnutil
 gpipe_ftp_new needs xalgoalignutil
 gpipe_ftp_new needs xobjwrite
 gpipe_ftp_new needs xrepeatdb
+gpipe_jira needs connssl
 gpipe_jira needs gpinit_access
 gpipe_jira needs gpipe_attr
+gpipe_jira needs3party $(CURL_LIBS)
 gpipe_jira needs3party $(GSOAP_LIBS)
 gpipe_kmer needs gpipe_objutil
 gpipe_kmer needs sampling
 gpipe_kpi needs xmlwrapp
 gpipe_kpi needs xncbi
 gpipe_meta_access needs gpipe_common
+gpipe_object_edit needs xalgoalignutil
 gpipe_objutil needs $(GPIPE_LOADER_LIBS)
 gpipe_objutil needs $(OBJEDIT_LIBS)
 gpipe_objutil needs $(OBJMGR_LIBS)
@@ -463,8 +482,9 @@ gpipe_objutil needs taxon1
 gpipe_objutil needs writedb
 gpipe_objutil needs3party $(GPIPE_LOADER_THIRDPARTY_LIBS)
 gpipe_objutil needs3party $(UUID_LIBS)
+gpipe_prok_clean_prot_names needs gpipe_attr
+gpipe_prok_clean_prot_names needs gpipe_clean_prot_names
 gpipe_property needs gpipe_common
-gpipe_property needs xregexp
 gpipe_remap needs xobjreadex
 gpipe_resource_req needs xncbi
 gpipe_sadb needs $(COMPRESS_LIBS)
@@ -484,14 +504,14 @@ gpipe_type_verifier needs gpipe_asn_cleanup
 gpipe_type_verifier needs xalgognomon
 gpipe_type_verifier needs xalgowinmask
 gpipe_val needs $(SEQ_LIBS)
-gpipe_val needs gpipe_common
 gpipe_val needs pub
 gpipe_val needs valerr
+gpipe_val needs xmlwrapp
+gpipe_xml needs $(SEQ_LIBS)
 gpipe_xml needs connssl
 gpipe_xml needs gpipe_attr
 gpipe_xml needs gpipe_dateutil
-gpipe_xml needs taxon1
-gpipe_xml needs taxon3
+gpipe_xml needs pub
 gpipe_xmlutil needs xmlwrapp
 gpipe_xmlutil needs xutil
 gpxapi needs general
@@ -528,11 +548,9 @@ gui_glmesa needs ximage
 gui_glmesa needs3party $(OSMESA_LIBS)
 gui_graph needs gui_opengl
 gui_objects needs gui_objutils
-gui_objutils needs $(COMPRESS_LIBS)
-gui_objutils needs $(EUTILS_LIBS)
 gui_objutils needs biotree
-gui_objutils needs entrez2cli
 gui_objutils needs entrezgene
+gui_objutils needs eutils_client
 gui_objutils needs gbproj
 gui_objutils needs gencoll_client
 gui_objutils needs gui_utils
@@ -540,7 +558,6 @@ gui_objutils needs macro
 gui_objutils needs snputil
 gui_objutils needs xalgoalignutil
 gui_objutils needs xcgi
-gui_objutils needs xmlwrapp
 gui_objutils needs xobjwrite
 gui_objutils needs xvalidate
 gui_opengl needs gui_utils
@@ -572,9 +589,7 @@ hogweed needs3party $(GMP_LIBS)
 hogweed needs3party $(ORIG_LIBS)
 homologene needs $(SEQ_LIBS)
 homologene needs pub
-htbbase needs txxmldoc
-htbcli includes htbcon
-htbcon needs htbbase
+htbcli needs txserv
 htbcon needs txserv
 icudata needs3party $(ORIG_LIBS)
 icui18n needs3party $(ORIG_LIBS)
@@ -585,7 +600,6 @@ id1cli needs xconnect
 id2 needs seqsplit
 id2_split needs $(COMPRESS_LIBS)
 id2_split needs $(SOBJMGR_LIBS)
-id2_split needs seqsplit
 id2cli needs id2
 id2cli needs xconnect
 id_dump needs bdb
@@ -599,6 +613,7 @@ ideocoord needs ideocli
 idgen needs dbassist
 idload needs3party ctutils
 idload_utils needs gpipe_common
+idload_utils needs xid_utils
 idload_utils needs xobjutil
 idx needs $(CONNEXT)
 idx needs dbapi_driver
@@ -628,7 +643,6 @@ ilink needs dbapi_driver
 ilink needs spellsrvbase
 ilink needs xutil
 insdseq needs xser
-intl64 needs3party $(ORIG_LIBS)
 jiracli needs jirasvc
 jiracli needs xconnect
 jirasvc needs xser
@@ -662,8 +676,6 @@ mapview needs mv_entrez
 mapview needs mvobjutil
 mapview needs seqset
 mapviewcli needs mapview
-matchhits needs $(COMPRESS_LIBS)
-matchhits needs seqdb
 medlars needs biblio
 medline needs biblio
 mghbn needs connect
@@ -698,8 +710,7 @@ muxex_g needs dbinfoasncpp_g
 muxex_g needs gensvc_g
 muxex_g needs rcobaltasn_g
 mv_admin needs mv_types
-mv_admincli needs xconnect
-mv_admincli needs xser
+mv_admincli needs mv_admin
 mv_align needs mv_types
 mv_cgi needs mv_types
 mv_entrez needs mv_types
@@ -730,6 +741,10 @@ ncbiCacc includes3party ncbiacc
 ncbiCacc needs3party netentr
 ncbiNacc includes3party ncbiacc
 ncbiNacc needs3party netentr
+ncbi_id2proc_wgs needs $(COMPRESS_LIBS)
+ncbi_id2proc_wgs needs $(SOBJMGR_LIBS)
+ncbi_id2proc_wgs needs $(SRAREAD_LIBS)
+ncbi_id2proc_wgs needs id2
 ncbi_xblobstorage_netcache needs xconnserv
 ncbi_xcache_bdb needs bdb
 ncbi_xcache_dbapi needs dbapi
@@ -744,9 +759,16 @@ ncbi_xdbapi_dblib needs dbapi_driver
 ncbi_xdbapi_dblib needs3party $(NETWORK_LIBS)
 ncbi_xdbapi_dblib needs3party $(SYBASE_DBLIBS)
 ncbi_xdbapi_dblib needs3party $(SYBASE_DLLS)
+ncbi_xdbapi_dblib needs3party $(SYBASE_LIBS)
 ncbi_xdbapi_ftds needs $(FTDS_LIB)
 ncbi_xdbapi_ftds needs dbapi_driver
 ncbi_xdbapi_ftds needs3party $(FTDS_LIBS)
+ncbi_xdbapi_ftds64 needs $(FTDS_LIB)
+ncbi_xdbapi_ftds64 needs dbapi_driver
+ncbi_xdbapi_ftds64 needs3party $(FTDS_LIBS)
+ncbi_xdbapi_ftds95 needs $(FTDS95_LIB)
+ncbi_xdbapi_ftds95 needs dbapi_driver
+ncbi_xdbapi_ftds95 needs3party $(FTDS95_LIBS)
 ncbi_xdbapi_mysql needs dbapi_driver
 ncbi_xdbapi_mysql needs3party $(MYSQL_LIBS)
 ncbi_xdbapi_mysql needs3party $(NETWORK_LIBS)
@@ -860,10 +882,15 @@ objmmail needs3party $(NCBI_C_ncbi)
 objprt needs xser
 objtax1 needs3party ncbiobj
 odbc_ftds64 needs tds_ftds64
+odbc_ftds95 needs tds_ftds95
 omssa needs $(SEQ_LIBS)
 omssa needs pub
 osutils needs3party $(RT_LIBS)
 osutils needs3party ctutils
+pathogen_cluster_loader needs $(SDBAPI_LIB)
+pathogen_cluster_loader needs xasmcompare
+pathogen_cluster_loader needs xconnect
+pathogen_cluster_loader needs xutil
 pathogen_connection needs connssl
 pathogen_connection needs gpipe_common
 pathogen_connection needs gpipe_dateutil
@@ -885,15 +912,18 @@ pepXML needs xser
 phytree_format needs taxon1
 phytree_format needs xalgophytree
 pn_ctl needs $(GPIPE_GENCOLL_LIBS)
+pn_ctl needs gpipe_prok_clean_prot_names
 pn_ctl needs hmm_file
 pn_ctl needs hmm_hit_handle
 pn_ctl needs idload_utils
-pn_ctl needs xid_utils
+pn_ctl needs third_party
 png needs $(Z_LIB)
 png needs3party $(ORIG_LIBS)
 png needs3party $(Z_LIBS)
 proj needs pubmed
 proj needs seqset
+prok_align_monomer needs $(SOBJMGR_LIBS)
+prok_align_monomer needs align_part_ci
 prosplign needs xalgoalignutil
 proxsort needs taxoscli
 pstub needs3party $(ORIG_LIBS)
@@ -909,7 +939,8 @@ refseq_aln_source needs dbapi
 refseq_aln_source needs ncbi_xdbapi_ftds
 refseq_aln_source needs xalgoalignsplign
 refseq_ctl needs bacterial_pipeline_proc
-refseq_ctl needs gencoll_client
+refseq_ctl needs bag_access
+refseq_ctl needs gpinit_access
 refseq_ctl needs xid_utils
 reftrack_access needs gpipe_common
 reftrack_admin needs reftrack_access
@@ -940,6 +971,9 @@ seqcode needs xser
 seqdb needs $(SOBJMGR_LIBS)
 seqdb needs blastdb
 seqedit needs seqset
+seqgapscan needs $(SDBAPI_LIB)
+seqgapscan needs xconnect
+seqgapscan needs xobjutil
 seqmasks_io needs $(OBJREAD_LIBS)
 seqmasks_io needs seqdb
 seqmasks_io needs xobjutil
@@ -961,11 +995,7 @@ snphgvs needs3party $(GPIPE_LOADER_THIRDPARTY_LIBS)
 snputil needs $(SOBJMGR_LIBS)
 snputil needs variation
 soap_dataobj needs xser
-softparse needs $(COMPRESS_LIBS)
-softparse needs affy
-softparse needs geomyncbi
-softparse needs taxon1
-spcgi needs softparse
+spcgi needs geomyncbi
 spcgi needs xgridcgi
 spellsrvbase needs txservbase
 splitdbasn_g needs gendefasn_g
@@ -975,8 +1005,8 @@ splitdbasncpp_g needs xnetblast
 sqlite3 needs3party $(ORIG_LIBS)
 sqlitewrapp needs xncbi
 sqlitewrapp needs3party $(SQLITE3_LIBS)
+sraread needs $(SOBJMGR_LIBS)
 sraread needs $(VDB_LIB)
-sraread needs seqset
 sraread needs3party $(VDB_LIBS)
 srprism needs srprism_seq
 srprism_common needs $(COMPRESS_LIBS)
@@ -1009,14 +1039,36 @@ sybase_os needs3party $(NETWORK_LIBS)
 sybase_os needs3party $(ORIG_LIBS)
 sybase_os needs3party $(SYBASE_DLLS)
 sybase_os needs3party $(SYBASE_LIBS)
-sybdb64 includes3party comn64
-sybdb64 includes3party intl64
+sybblk64 needs3party $(ORIG_LIBS)
+sybblk64 needs3party sybcomn64
+sybblk64 needs3party sybintl64
+sybblk64 needs3party sybunic64
+sybcomn64 needs3party $(ORIG_LIBS)
+sybcomn64 needs3party sybintl64
+sybcomn64 needs3party sybunic64
+sybcs64 needs3party $(ORIG_LIBS)
+sybcs64 needs3party sybcomn64
+sybcs64 needs3party sybintl64
+sybcs64 needs3party sybunic64
+sybct64 needs3party $(ORIG_LIBS)
+sybct64 needs3party sybcomn64
+sybct64 needs3party sybintl64
+sybct64 needs3party sybunic64
+sybdb64 includes3party sybcomn64
+sybdb64 includes3party sybintl64
 sybdb64 needs3party $(ORIG_LIBS)
+sybdb64 needs3party sybunic64
 sybdb_ftds64 needs tds_ftds64
+sybdb_ftds95 needs tds_ftds95
+sybintl64 needs3party $(ORIG_LIBS)
 sybtcl64 needs3party $(ORIG_LIBS)
-sybtcl64 needs3party comn64
-sybtcl64 needs3party intl64
+sybtcl64 needs3party sybcomn64
+sybtcl64 needs3party sybintl64
+sybtcl64 needs3party sybunic64
+sybunic64 needs3party $(ORIG_LIBS)
 tables needs3party $(ORIG_LIBS)
+tax_assignment_region needs gpipe_objutil
+tax_xml needs gpipe_objutil
 taxon needs xser
 taxon1 needs $(SEQ_LIBS)
 taxon1 needs pub
@@ -1031,6 +1083,10 @@ taxutl needs taxon1
 tds_ftds64 needs3party $(KRB5_LIBS)
 tds_ftds64 needs3party $(NETWORK_LIBS)
 tds_ftds64 needs3party $(ORIG_LIBS)
+tds_ftds95 needs3party $(KRB5_LIBS)
+tds_ftds95 needs3party $(NETWORK_LIBS)
+tds_ftds95 needs3party $(ORIG_LIBS)
+tds_ftds95 needs3party $(RT_LIBS)
 tea_crypt needs generic_db_utils
 test_boost includes3party $(BOOST_TEST_LIBS)
 test_boost needs xncbi
@@ -1042,6 +1098,8 @@ test_stat_ext needs dbapi
 test_stat_ext needs ncbi_xdbapi_ftds
 test_stat_ext needs xconnect
 test_stat_ext needs xutil
+third_party needs xmlwrapp
+third_party needs xregexp
 tiff needs $(Z_LIB)
 tiff needs3party $(JPEG_LIBS)
 tiff needs3party $(ORIG_LIBS)
@@ -1120,7 +1178,6 @@ w_aln_score needs w_wx
 w_aln_table needs w_wx
 w_data needs w_wx
 w_edit needs align_format
-w_edit needs ncbi_xloader_blastdb
 w_edit needs prosplign
 w_edit needs w_loaders
 w_feat_table needs w_wx
@@ -1133,6 +1190,7 @@ w_loaders needs $(SRAREAD_LIBS)
 w_loaders needs bamread
 w_loaders needs gui_objects
 w_loaders needs hgvs
+w_loaders needs ncbi_xloader_blastdb
 w_loaders needs w_wx
 w_loaders needs xalgophytree
 w_loaders needs xobjreadex
@@ -1148,6 +1206,7 @@ w_seq_graphic needs gui_config
 w_seq_graphic needs gui_graph
 w_seq_graphic needs gui_objects
 w_seq_graphic needs hgvs
+w_seq_graphic needs ncbi_xcache_netcache
 w_seq_graphic needs w_aln_score
 w_seq_graphic needs w_gl
 w_seq_graphic needs w_seq
@@ -1225,8 +1284,7 @@ xalan-c needs3party $(ICU_LIBS)
 xalan-c needs3party $(ORIG_LIBS)
 xalan-c needs3party $(XERCES_LIBS)
 xalanMsg needs3party $(ORIG_LIBS)
-xalgoalignnw needs $(SEQ_LIBS)
-xalgoalignnw needs pub
+xalgoalignnw needs $(SOBJMGR_LIBS)
 xalgoalignnw needs tables
 xalgoalignsplign needs xalgoalignnw
 xalgoalignsplign needs xalgoalignutil
@@ -1264,10 +1322,15 @@ xalnmgr needs xobjutil
 xalntool needs xhtml
 xalntool needs xobjutil
 xannot_builder needs gpipe_asn_proc
-xasmcompare needs $(SEQ_LIBS)
-xasmcompare needs pub
+xasmcompare needs xncbi
 xasn needs xhtml
 xasn needs3party $(NCBI_C_ncbi)
+xassembly_svc needs gcaccess_utils
+xassembly_svc needs xgencollstats
+xbiosample_util needs $(OBJEDIT_LIBS)
+xbiosample_util needs $(XFORMAT_LIBS)
+xbiosample_util needs xalnmgr
+xbiosample_util needs xmlwrapp
 xblast includes blast
 xblast needs xalgoblastdbindex
 xblast needs xalgodustmask
@@ -1292,6 +1355,7 @@ xcgi needs xutil
 xcgi_redirect needs xcgi
 xcgi_redirect needs xhtml
 xcleanup needs submit
+xcleanup needs taxon3
 xcleanup needs valid
 xcleanup needs xobjutil
 xcompress needs $(CMPRS_LIB)
@@ -1302,19 +1366,14 @@ xconnect needs xncbi
 xconnext includes $(CONNEXT)
 xconnext needs xconnect
 xconnserv needs xthrserv
-xcontigdb needs dbapi
-xcontigdb needs ncbi_xdbapi_ftds
-xcontigdb needs xalnmgr
 xcser needs xser
 xcser needs3party $(NCBI_C_ncbi)
 xctools needs xncbi
 xctools needs3party $(NCBI_C_ncbi)
 xdb needs xncbi
 xdiff needs xncbi
-xdiscrepancy needs $(OBJEDIT_LIBS)
-xdiscrepancy needs $(XFORMAT_LIBS)
 xdiscrepancy needs macro
-xdiscrepancy needs xalnmgr
+xdiscrepancy needs xvalidate
 xdiscrepancy_report needs $(OBJMGR_LIBS)
 xdiscrepancy_report needs macro
 xdiscrepancy_report needs xmlwrapp
@@ -1358,9 +1417,9 @@ xgpsubmit needs gpinit_access
 xgpsubmit needs gpipe_asn_cleanup
 xgpsubmit needs grid_wrapper
 xgpsubmit needs xasmcompare
+xgpsubmit needs xid_utils
 xgraphiccgi needs gui_glmesa
 xgraphiccgi needs gui_opengl
-xgraphiccgi needs ncbi_xloader_csra
 xgraphiccgi needs xsvcgi
 xgridcgi needs xcgi
 xgridcgi needs xconnserv
@@ -1383,7 +1442,6 @@ xid_utils_noncorelib needs xid_utils
 xid_wgsdb needs xid_utils
 ximage needs xncbi
 ximage needs3party $(IMAGE_LIBS)
-xlinear_prog needs xncbi
 xmergetree needs $(SOBJMGR_LIBS)
 xml2 needs3party $(ORIG_LIBS)
 xmlreaders needs xmlwrapp
@@ -1407,11 +1465,11 @@ xngalign needs xalgoalignutil
 xngalign needs xmergetree
 xobjedit needs $(OBJREAD_LIBS)
 xobjedit needs $(XFORMAT_LIBS)
-xobjedit needs taxon3
 xobjedit needs xalnmgr
 xobjmanip needs general
 xobjmgr needs genome_collection
 xobjmgr needs seqedit
+xobjmgr needs seqsplit
 xobjread needs creaders
 xobjread needs submit
 xobjreadex needs $(OBJREAD_LIBS)
@@ -1453,8 +1511,6 @@ xslt_xalan needs3party $(CURL_LIBS)
 xslt_xalan needs3party $(ICU_LIBS)
 xslt_xalan needs3party $(XALAN_LIBS)
 xslt_xalan needs3party $(XERCES_LIBS)
-xsmall_assembly needs gcaccess_utils
-xsmall_assembly needs xgencollstats
 xsoap needs xconnect
 xsoap needs xser
 xsoap_server needs xcgi
@@ -1468,6 +1524,7 @@ xsvcgi needs $(OBJMGR_LIBS)
 xsvcgi needs $(ncbi_xreader_pubseqos2)
 xsvcgi needs gui_objutils
 xsvcgi needs ncbi_xcache_netcache
+xsvcgi needs ncbi_xloader_csra
 xsvcgi needs ncbi_xloader_vdbgraph
 xsvcgi needs ncbi_xloader_wgs
 xsvcgi needs uudutil
diff --git a/c++/src/build-system/m4/ax_check_gnu_make.m4 b/c++/src/build-system/m4/ax_check_gnu_make.m4
new file mode 100644
index 0000000..6762e9e
--- /dev/null
+++ b/c++/src/build-system/m4/ax_check_gnu_make.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_GNU_MAKE()
+#
+# DESCRIPTION
+#
+#   This macro searches for a GNU version of make. If a match is found:
+#
+#     * The makefile variable `ifGNUmake' is set to the empty string, otherwise
+#       it is set to "#". This is useful for including a special features in a
+#       Makefile, which cannot be handled by other versions of make.
+#     * The variable `_cv_gnu_make_command` is set to the command to invoke
+#       GNU make if it exists, the empty string otherwise.
+#     * The variable `ax_cv_gnu_make_command` is set to the command to invoke
+#       GNU make by copying `_cv_gnu_make_command`, otherwise it is unset.
+#     * If GNU Make is found, its version is extracted from the output of
+#       `make --version` as the last field of a record of space-separated
+#       columns and saved into the variable `ax_check_gnu_make_version`.
+#
+#   Here is an example of its use:
+#
+#   Makefile.in might contain:
+#
+#     # A failsafe way of putting a dependency rule into a makefile
+#     $(DEPEND):
+#             $(CC) -MM $(srcdir)/*.c > $(DEPEND)
+#
+#     @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
+#     @ifGNUmake@ include $(DEPEND)
+#     @ifGNUmake@ endif
+#
+#   Then configure.in would normally contain:
+#
+#     AX_CHECK_GNU_MAKE()
+#     AC_OUTPUT(Makefile)
+#
+#   Then perhaps to cause gnu make to override any other make, we could do
+#   something like this (note that GNU make always looks for GNUmakefile
+#   first):
+#
+#     if  ! test x$_cv_gnu_make_command = x ; then
+#             mv Makefile GNUmakefile
+#             echo .DEFAULT: > Makefile ;
+#             echo \  $_cv_gnu_make_command \$@ >> Makefile;
+#     fi
+#
+#   Then, if any (well almost any) other make is called, and GNU make also
+#   exists, then the other make wraps the GNU make.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 John Darrington <j.darrington at elvis.murdoch.edu.au>
+#   Copyright (c) 2015 Enrico M. Crisostomo <enrico.m.crisostomo at gmail.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 8
+
+AC_DEFUN([AX_CHECK_GNU_MAKE],dnl
+  [AC_PROG_AWK
+  AC_CACHE_CHECK([for GNU make],[_cv_gnu_make_command],[dnl
+    _cv_gnu_make_command="" ;
+dnl Search all the common names for GNU make
+    for a in "$MAKE" make gmake gnumake ; do
+      if test -z "$a" ; then continue ; fi ;
+      if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then
+        _cv_gnu_make_command=$a ;
+        AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make")
+        ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }')
+        break ;
+      fi
+    done ;])
+dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
+  AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])],   [AS_VAR_SET([ifGNUmake], [""])])
+  AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])])
+  AC_SUBST([ifGNUmake])
+])
diff --git a/c++/src/build-system/ax_jni_include_dir.m4 b/c++/src/build-system/m4/ax_jni_include_dir.m4
similarity index 100%
rename from c++/src/build-system/ax_jni_include_dir.m4
rename to c++/src/build-system/m4/ax_jni_include_dir.m4
diff --git a/c++/src/build-system/m4/ax_prog_cc_for_build.m4 b/c++/src/build-system/m4/ax_prog_cc_for_build.m4
new file mode 100644
index 0000000..1a56876
--- /dev/null
+++ b/c++/src/build-system/m4/ax_prog_cc_for_build.m4
@@ -0,0 +1,131 @@
+# ===========================================================================
+#   http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PROG_CC_FOR_BUILD
+#
+# DESCRIPTION
+#
+#   This macro searches for a C compiler that generates native executables,
+#   that is a C compiler that surely is not a cross-compiler. This can be
+#   useful if you have to generate source code at compile-time like for
+#   example GCC does.
+#
+#   The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
+#   needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).
+#   The value of these variables can be overridden by the user by specifying
+#   a compiler with an environment variable (like you do for standard CC).
+#
+#   It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object
+#   file extensions for the build platform, and GCC_FOR_BUILD to `yes' if
+#   the compiler we found is GCC. All these variables but GCC_FOR_BUILD are
+#   substituted in the Makefile.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Paolo Bonzini <bonzini at gnu.org>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 8
+
+AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
+AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_CPP])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+dnl Use the standard macros, but make them use other variable names
+dnl
+pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
+pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
+pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
+pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
+pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
+dnl pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
+dnl pushdef([ac_cv_objext], ac_cv_build_objext)dnl
+dnl pushdef([ac_exeext], ac_build_exeext)dnl
+dnl pushdef([ac_objext], ac_build_objext)dnl
+pushdef([CC], CC_FOR_BUILD)dnl
+pushdef([CPP], CPP_FOR_BUILD)dnl
+pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
+pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
+pushdef([host], build)dnl
+pushdef([host_alias], build_alias)dnl
+pushdef([host_cpu], build_cpu)dnl
+pushdef([host_vendor], build_vendor)dnl
+pushdef([host_os], build_os)dnl
+pushdef([ac_cv_host], ac_cv_build)dnl
+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
+pushdef([ac_cv_host_os], ac_cv_build_os)dnl
+pushdef([ac_cpp], ac_build_cpp)dnl
+pushdef([ac_compile], ac_build_compile)dnl
+pushdef([ac_link], ac_build_link)dnl
+
+dnl pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)
+pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl
+
+save_cross_compiling=$cross_compiling
+save_ac_tool_prefix=$ac_tool_prefix
+cross_compiling=no
+ac_tool_prefix=
+
+AC_PROG_CC
+AC_PROG_CPP
+AC_EXEEXT
+
+ac_tool_prefix=$save_ac_tool_prefix
+cross_compiling=$save_cross_compiling
+
+dnl Restore the old definitions
+dnl
+popdef([ac_cv_prog_cc_c89])dnl
+dnl popdef([ac_cv_c_compiler_gnu])
+
+popdef([ac_link])dnl
+popdef([ac_compile])dnl
+popdef([ac_cpp])dnl
+popdef([ac_cv_host_os])dnl
+popdef([ac_cv_host_vendor])dnl
+popdef([ac_cv_host_cpu])dnl
+popdef([ac_cv_host_alias])dnl
+popdef([ac_cv_host])dnl
+popdef([host_os])dnl
+popdef([host_vendor])dnl
+popdef([host_cpu])dnl
+popdef([host_alias])dnl
+popdef([host])dnl
+popdef([LDFLAGS])dnl
+popdef([CPPFLAGS])dnl
+popdef([CFLAGS])dnl
+popdef([CPP])dnl
+popdef([CC])dnl
+dnl popdef([ac_objext])dnl
+dnl popdef([ac_exeext])dnl
+dnl popdef([ac_cv_objext])dnl
+dnl popdef([ac_cv_exeext])dnl
+popdef([ac_cv_prog_cc_g])dnl
+popdef([ac_cv_prog_cc_cross])dnl
+popdef([ac_cv_prog_cc_works])dnl
+popdef([ac_cv_prog_gcc])dnl
+popdef([ac_cv_prog_CPP])dnl
+
+dnl Finally, set Makefile variables
+dnl
+BUILD_EXEEXT=$ac_build_exeext
+BUILD_OBJEXT=$ac_build_objext
+AC_SUBST(BUILD_EXEEXT)dnl
+AC_SUBST(BUILD_OBJEXT)dnl
+AC_SUBST([CFLAGS_FOR_BUILD])dnl
+AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
+AC_SUBST([LDFLAGS_FOR_BUILD])dnl
+])
diff --git a/c++/src/build-system/ncbi_package_version b/c++/src/build-system/ncbi_package_version
index cc6612c..9183195 100644
--- a/c++/src/build-system/ncbi_package_version
+++ b/c++/src/build-system/ncbi_package_version
@@ -1 +1 @@
-2.3.0
\ No newline at end of file
+2.4.0
\ No newline at end of file
diff --git a/c++/src/build-system/new_module.sh.in b/c++/src/build-system/new_module.sh.in
index 6d36a64..4995368 100644
--- a/c++/src/build-system/new_module.sh.in
+++ b/c++/src/build-system/new_module.sh.in
@@ -1,6 +1,6 @@
 @script_shell@
 #
-# $Id: new_module.sh.in 406038 2013-07-10 15:41:44Z ucko $
+# $Id: new_module.sh.in 484944 2015-11-17 16:42:34Z ucko $
 # Authors:  Eugene Vasilchenko, NCBI;  Aaron Ucko, NCBI
 
 top_srcdir="@abs_top_srcdir@"
@@ -202,5 +202,15 @@ else
 fi
 
 # run command
-echo $MAKE -f "$makemodule" "MODULE=$module" "MODULE_PATH=$mp" "MODULE_ASN=$spec" "MODULE_IMPORT='$imports'" "IMPDEPS='$impdeps'" "IMPFILES='$impfiles'" "top_srcdir=$p" "DATATOOL=$datatool" "MODULE_SEARCH=$search" "$@"
-$MAKE -f "$makemodule" "MODULE=$module" "MODULE_PATH=$mp" "MODULE_ASN=$spec" "MODULE_IMPORT=$imports" "IMPDEPS=$impdeps" "IMPFILES=$impfiles" "top_srcdir=$p" "DATATOOL=$datatool" "MODULE_SEARCH=$search" "$@"
+case "$MAKE" in
+    *\ -s* ) ;;
+    * )
+        echo $MAKE -f "$makemodule" "MODULE=$module" "MODULE_PATH=$mp" \
+             "MODULE_ASN=$spec" "MODULE_IMPORT='$imports'" \
+             "IMPDEPS='$impdeps'" "IMPFILES='$impfiles'" "top_srcdir=$p" \
+             "DATATOOL=$datatool" "MODULE_SEARCH=$search" "$@"
+        ;;
+esac
+$MAKE -f "$makemodule" "MODULE=$module" "MODULE_PATH=$mp" "MODULE_ASN=$spec" \
+      "MODULE_IMPORT=$imports" "IMPDEPS=$impdeps" "IMPFILES=$impfiles" \
+      "top_srcdir=$p" "DATATOOL=$datatool" "MODULE_SEARCH=$search" "$@"
diff --git a/c++/src/build-system/project_tree_builder.ini b/c++/src/build-system/project_tree_builder.ini
index 2c72592..0077005 100644
--- a/c++/src/build-system/project_tree_builder.ini
+++ b/c++/src/build-system/project_tree_builder.ini
@@ -1,4 +1,4 @@
-#  $Id: project_tree_builder.ini 484252 2015-11-09 16:45:11Z ivanov $
+#  $Id: project_tree_builder.ini 498370 2016-04-15 17:19:18Z ivanov $
 ###############################################################################
 
 
@@ -35,13 +35,12 @@ ProvidedRequests = CXX_Toolkit \
                    LocalBZ2  \
                    LocalPCRE \
                    LocalZ    \
-                   LocalVDB  \
                    MT
 
 # These requiremenst are also met
 # Unlike 'ProvidedRequests', this list is also used when generating
 # features_and_packages.txt file
-StandardFeatures = MSWin MSVC DBLib FreeTDS algo app dbapi gui objects serial gbench -Cygwin in-house-resources
+StandardFeatures = MSWin MSVC DBLib FreeTDS algo app dbapi gui objects serial -Cygwin in-house-resources
 
 # The following requirement are never met
 # If the same entry is present both in 'ProvidedRequests' and 'NotProvidedRequests'
@@ -136,8 +135,8 @@ Macros = BDB_LIB BDB_CACHE_LIB NCBI_CRYPT CONNEXT XCONNEXT \
 # Depending on the availability of 3rd party library,
 # the toolkit will use either external or internal one
 # See section in this file with the name of the latter entry in each pair
-LibChoices = z/Z bz2/BZ2 regexp/PCRE lzo/LZO ncbi-vdb-read/VDB
-ComponentChoices = LocalZ/Z LocalBZ2/BZ2 LocalPCRE/PCRE LocalVDB/VDB
+LibChoices = z/Z bz2/BZ2 regexp/PCRE lzo/LZO
+ComponentChoices = LocalZ/Z LocalBZ2/BZ2 LocalPCRE/PCRE
 
 #----------------------------------------------------------------------------
 # Some toolkit applications require 3rd party DLLs
@@ -178,7 +177,7 @@ ThirdPartyLibsToInstall     = BerkeleyDB \
 ThirdParty_BerkeleyDB   = $(ThirdPartyBasePath)\\berkeleydb\\$(msvc_3rd)\\4.6.21.NC
 ThirdParty_Boost_Test   = $(ThirdPartyBasePath)\\boost\\$(msvc_3rd)\\1.56.0
 ThirdParty_Boost_Spirit = $(ThirdPartyBasePath)\\boost\\$(msvc_3rd)\\1.56.0
-ThirdParty_BZ2          = $(ThirdPartyBasePath)\\bzip2\\$(msvc_3rd)\\1.0.2
+ThirdParty_BZ2          = $(ThirdPartyBasePath)\\bzip2\\$(msvc_3rd)\\1.0.6
 ThirdParty_fastcgi      = $(ThirdPartyBasePath)\\fastcgi\\$(msvc_3rd)\\2.4.0
 ThirdParty_FreeType     = $(ThirdPartyBasePath)\\freetype\\$(msvc_3rd)\\2.4.10
 ThirdParty_FTGL         = $(ThirdPartyBasePath)\\ftgl\\$(msvc_3rd)\\2.1.3-rc5
@@ -196,7 +195,7 @@ ThirdParty_OpenSSL      = $(ThirdPartyBasePath)\\openssl\\$(msvc_3rd)\\1.0.1g
 ThirdParty_PCRE         = $(ThirdPartyBasePath)\\pcre\\$(msvc_3rd)\\7.9
 ThirdParty_PNG          = $(ThirdPartyBasePath)\\png\\$(msvc_3rd)\\1.2.7
 ThirdParty_SQLITE3      = $(ThirdPartyBasePath)\\sqlite\\$(msvc_3rd)\\3.6.14.2
-ThirdParty_Sybase       = $(ThirdPartyBasePath)\\sybase\\$(msvc_3rd)\\12.5
+ThirdParty_Sybase       = $(ThirdPartyBasePath)\\sybase\\$(msvc_3rd)\\15.5
 ThirdParty_TIFF         = $(ThirdPartyBasePath)\\tiff\\$(msvc_3rd)\\3.6.1
 ThirdParty_wxWidgets    = $(ThirdPartyBasePath)\\wxwidgets\\$(msvc_3rd)\\3.0.1
 ThirdParty_Xalan        = $(ThirdPartyBasePath)\\xalan\\$(msvc_3rd)\\1.10.0-20080814
@@ -205,7 +204,7 @@ ThirdParty_XML          = $(ThirdPartyBasePath)\\xml\\$(msvc_3rd)\\2.7.8
 ThirdParty_XSLT         = $(ThirdPartyBasePath)\\xslt\\$(msvc_3rd)\\1.1.26
 ThirdParty_Z            = $(ThirdPartyBasePath)\\z\\$(msvc_3rd)\\1.2.8
 ThirdParty_JDK          = $(ThirdPartyBasePath)\\jdk\\1.6.0_25
-ThirdParty_VDB          = $(ThirdPartyVDBBasePath)\\vdb\\vdb-versions\\2.5.4
+ThirdParty_VDB          = $(ThirdPartyVDBBasePath)\\vdb\\vdb-versions\\2.6.1
 
 PYTHON_PATH = $(ThirdPartyAppsBasePath)\\Python252\\$(msvc_3rd)
 
@@ -367,7 +366,7 @@ DllBuildDefine    = NCBI_DLL_BUILD
 msvc_prj       = vs2013
 # Macro
 msvc_3rd       = vs2013
-vdb_arch       = i386
+vdb_arch       = i386/vs2013.32
 
 
 #----------------------------------------------------------------------------
@@ -383,7 +382,39 @@ DllBuildDefine    = NCBI_DLL_BUILD
 msvc_prj       = vs2013
 # Macro
 msvc_3rd       = vs2013.64
-vdb_arch       = x86_64
+vdb_arch       = x86_64/vs2013.64
+
+
+#----------------------------------------------------------------------------
+# Settings for MSVC 2015 (v.14, Win32)
+
+[msvc1400]
+Version=12.00\n# Visual Studio 14
+# Build configurations
+Configurations = DebugDLL,DebugMT,ReleaseDLL,ReleaseMT
+DllConfigurations = DebugDLL ReleaseDLL
+DllBuildDefine    = NCBI_DLL_BUILD
+# Name of a subdirectory of 'compilers'
+msvc_prj       = vs2015
+# Macro
+msvc_3rd       = vs2015
+vdb_arch       = i386/vs2013.32
+
+
+#----------------------------------------------------------------------------
+# Settings for MSVC 2015 (v.14, x64)
+
+[msvc1400.x64]
+Version=12.00\n# Visual Studio 14
+# Build configurations
+Configurations = DebugDLL,DebugMT,ReleaseDLL,ReleaseMT
+DllConfigurations = DebugDLL ReleaseDLL
+DllBuildDefine    = NCBI_DLL_BUILD
+# Name of a subdirectory of 'compilers'
+msvc_prj       = vs2015
+# Macro
+msvc_3rd       = vs2015.64
+vdb_arch       = x86_64/vs2013.64
 
 
 #============================================================================
@@ -416,7 +447,7 @@ Projects       = build
 # XCODE specific metadata
 # It describes default settings of compiler, linker etc
 MetaMakefile   = build-system/Makefile.mk.in.xcode
-StandardFeatures = unix Darwin XCODE GCC LFS DBLib algo app dbapi gui objects serial gbench FreeTDS
+StandardFeatures = unix Darwin XCODE GCC LFS DBLib algo app dbapi gui objects serial FreeTDS
 NotProvidedRequests = MSWin MSVC KCC ICC VisualAge CompaqCompiler WorkShop MIPSpro -LimitedLinker MaxDebug LocalSSS SSSUTILS MESA GEO SSSDB SP ODBC LIBMAGIC GIF
 DefinesPath = common/config/ncbiconf_xcode_site.h
 
@@ -431,10 +462,10 @@ ThirdParty_SQLITE3    = $(XCode_ThirdPartyBasePath)/sqlite-3.6.14.2-ncbi1
 ThirdParty_XML        = $(XCode_ThirdPartyBasePath)/libxml-2.7.8
 ThirdParty_XSLT       = $(XCode_ThirdPartyBasePath)/libxml-2.7.8
 ThirdParty_GLEW       = $(XCode_ThirdPartyBasePath)/glew-1.5.8
-ThirdParty_wxWidgets  = $(XCode_ThirdPartyBasePath)/wxWidgets-3.0.1-ncbi1
+ThirdParty_wxWidgets  = $(XCode_ThirdPartyBasePath)/wxWidgets-3.0.2-ncbi1
 ThirdParty_FreeType   = /opt/X11
 ThirdParty_FTGL       = $(XCode_ThirdPartyBasePath)/ftgl-2.1.3-rc5
-ThirdParty_VDB        = $(XCode_ThirdPartyVDBBasePath)/vdb/vdb-versions/2.5.4
+ThirdParty_VDB        = $(XCode_ThirdPartyVDBBasePath)/vdb/vdb-versions/2.6.1
 ThirdParty_GMP        = $(Xcode_ThirdPartyBasePath)/gmp-6.0.0a
 ThirdParty_Nettle     = $(Xcode_ThirdPartyBasePath)/nettle-3.1.1
 ThirdParty_GNUTLS     = $(Xcode_ThirdPartyBasePath)/gnutls-3.4.0
@@ -482,8 +513,6 @@ Z_INCLUDE = z util/compress/zlib/
 BZ2_INCLUDE = bz2 util/compress/bzip2/
 LZO_INCLUDE = lzo .
 PCRE_INCLUDE = regexp util/regexp/
-VDB_INCLUDE = ncbi-vdb-read ../src/sra/sdk/interfaces \
-              ncbi-vdb-read ../src/sra/sdk/interfaces/C++Toolkit
 
 
 #============================================================================
@@ -508,11 +537,14 @@ LZO_LIB          = lzo
 PCRE_LIB         = regexp
 VDB_LIB          = ncbi-vdb-read
 
-ftds64           = ftds
 FTDS64_INCLUDE   = dbapi/driver/ftds64/ dbapi/driver/ftds64/freetds/
-FTDS64_LIB       = sybdb_ftds64 tds_ftds64
+FTDS64_LIB       = ct_ftds64 tds_ftds64
 FTDS64_CTLIB_LIB = ct_ftds64 tds_ftds64
 
+FTDS95_INCLUDE   = dbapi/driver/ftds95/ dbapi/driver/ftds95/freetds/
+FTDS95_LIB       = ct_ftds95 tds_ftds95
+FTDS95_CTLIB_LIB = ct_ftds95 tds_ftds95
+
 FTDS_INCLUDE     = dbapi/driver/ftds64/ dbapi/driver/ftds64/freetds/
 FTDS_LIB         = ct_ftds64 tds_ftds64
 FTDS_LIBS        =
@@ -699,15 +731,15 @@ Component=LIBXSLT
 Component=LIBEXSLT
 
 [HAVE_PUBSEQ_OS]
-Component=PubSeqOS, Sybase
+Component=PubSeqOS, dbapi
 [UNLESS_PUBSEQOS]
-Component=PubSeqOS, Sybase
+Component=PubSeqOS, dbapi
 Value="#"
 [ncbi_xreader_pubseqos]
-Component=PubSeqOS, Sybase
+Component=PubSeqOS, dbapi
 Value=ncbi_xreader_pubseqos
 [ncbi_xreader_pubseqos2]
-Component=PubSeqOS, Sybase
+Component=PubSeqOS, dbapi
 Value=ncbi_xreader_pubseqos2
 
 [HAVE_LIBFASTCGI]
@@ -737,6 +769,18 @@ Value=ncbi_xdbapi_ctlib
 Component=Sybase
 Value=ncbi_xdbapi_dblib
 
+[DBAPI_FTDS]
+Component=dbapi
+Value=ncbi_xdbapi_ftds
+
+[DBAPI_FTDS64]
+Component=dbapi
+Value=ncbi_xdbapi_ftds64
+
+[DBAPI_FTDS95]
+Component=dbapi
+Value=ncbi_xdbapi_ftds95
+
 [DBAPI_ODBC]
 Component=ODBC
 Value=ncbi_xdbapi_odbc
@@ -762,6 +806,11 @@ Component=Iconv
 [FTDS64_LIBS]
 Component=Iconv, KRB5
 
+[FTDS95_CTLIB_LIBS]
+Component=Iconv, KRB5
+[FTDS95_LIBS]
+Component=Iconv, KRB5
+
 [FTDS_CTLIB_LIBS]
 Component=Iconv, KRB5
 [FTDS_LIBS]
@@ -796,7 +845,7 @@ Component=FTGL
 
 [gbench]
 Component = gbench
-FILES = src\\app\\gbench\\Makefile.in
+FILES = src\\app\\gbench\\gbench\\Makefile.in
 CONFS = DebugMT DebugDLL ReleaseMT ReleaseDLL
 
 
@@ -1214,13 +1263,15 @@ FILES     = $(ThirdParty_SQLITE3)\\include\\sqlite3async.h
 [Sybase]
 INCLUDE = $(ThirdParty_Sybase)\\include
 LIBPATH =
-LIB     = libsybdb.lib libct.lib libblk.lib libcs.lib
+LIB     = libsybdb.lib libsybct.lib libsybblk.lib libsybcs.lib
 ;LIB=
 CONFS   = DebugMT DebugDLL ReleaseMT ReleaseDLL
 [Sybase.debug.DebugMT]
-LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugmt
+;LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugmt
+LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasemt
 [Sybase.debug.DebugDLL]
-LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugdll
+;LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugdll
+LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasedll
 [Sybase.release.ReleaseMT]
 LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasemt
 [Sybase.release.ReleaseDLL]
@@ -1234,9 +1285,11 @@ LIBPATH =
 LIB     = libsybdb.lib
 CONFS   = DebugMT DebugDLL ReleaseMT ReleaseDLL
 [SybaseDBLIB.debug.DebugMT]
-LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugmt
+;LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugmt
+LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasemt
 [SybaseDBLIB.debug.DebugDLL]
-LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugdll
+;LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugdll
+LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasedll
 [SybaseDBLIB.release.ReleaseMT]
 LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasemt
 [SybaseDBLIB.release.ReleaseDLL]
@@ -1250,12 +1303,14 @@ Component=SybaseDBLIB
 [SybaseCTLIB]
 INCLUDE = $(ThirdParty_Sybase)\\include
 LIBPATH =
-LIB     = libct.lib libblk.lib libcs.lib
+LIB     = libsybct.lib libsybblk.lib libsybcs.lib
 CONFS   = DebugMT DebugDLL ReleaseMT ReleaseDLL
 [SybaseCTLIB.debug.DebugMT]
-LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugmt
+;LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugmt
+LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasemt
 [SybaseCTLIB.debug.DebugDLL]
-LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugdll
+;LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\debugdll
+LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasedll
 [SybaseCTLIB.release.ReleaseMT]
 LIBPATH = $(ThirdParty_Sybase)\\lib_dll\\releasemt
 [SybaseCTLIB.release.ReleaseDLL]
@@ -1758,12 +1813,10 @@ LIBPATH = $(ThirdParty_VDB)/mac/release/$(vdb_arch)/lib
 Component=VDB,LIBXML,BZ2,Z
 [VDB_STATIC_LIBS]
 Component=VDB,LIBXML,BZ2,Z
-[LocalVDBReq]
-FILES = src\\sra\\sdk\\Makefile.ncbi-vdb-read.lib
 [VDB_REQ]
 Component=VDB
 Value=VDB
-DefValue=LocalVDBReq
+#DefValue=LocalVDBReq
 
 # CURL
 
diff --git a/c++/src/build-system/project_tree_builder/file_contents.cpp b/c++/src/build-system/project_tree_builder/file_contents.cpp
index 44778f9..f63c6c9 100644
--- a/c++/src/build-system/project_tree_builder/file_contents.cpp
+++ b/c++/src/build-system/project_tree_builder/file_contents.cpp
@@ -1,4 +1,4 @@
-/* $Id: file_contents.cpp 426678 2014-02-12 16:26:31Z gouriano $
+/* $Id: file_contents.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -487,12 +487,12 @@ void CSimpleMakeFileContents::AddReadyKV(const SKeyValue& kv)
             NStr::FindCase(kv.m_Value," -l") != NPOS ||
             NStr::FindCase(kv.m_Value,"-rpath") != NPOS ||
             NStr::FindCase(kv.m_Value,"-framework") != NPOS) {
-            NStr::Split(kv.m_Value, LIST_SEPARATOR_LIBS, values);
+            NStr::Split(kv.m_Value, LIST_SEPARATOR_LIBS, values, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         } else {
             if (m_ValueSeparator.empty()) {
                 m_ValueSeparator = LIST_SEPARATOR;
             }
-            NStr::Split(kv.m_Value, m_ValueSeparator, values);
+            NStr::Split(kv.m_Value, m_ValueSeparator, values, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         }
 // change '{' into '(', because I rely on that in many places
         NON_CONST_ITERATE(list<string>, v, values) {
@@ -528,7 +528,7 @@ void CSimpleMakeFileContents::AddReadyKV(const SKeyValue& kv)
                     NStr::SplitInTwo(CSymResolver::StripDefine(value), ",", first, second);
                     NStr::SplitInTwo(first, " ", func, arg);
                     list<string> tmp;
-                    NStr::Split(second, " ", tmp);
+                    NStr::Split(second, " ", tmp, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                     ITERATE(list<string>, t, tmp) {
                         dest.push_back(*t+arg);
                     }
diff --git a/c++/src/build-system/project_tree_builder/mac_prj_generator.cpp b/c++/src/build-system/project_tree_builder/mac_prj_generator.cpp
index 6deb63e..3585126 100644
--- a/c++/src/build-system/project_tree_builder/mac_prj_generator.cpp
+++ b/c++/src/build-system/project_tree_builder/mac_prj_generator.cpp
@@ -1,4 +1,4 @@
-/* $Id: mac_prj_generator.cpp 467273 2015-05-12 15:09:49Z gouriano $
+/* $Id: mac_prj_generator.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -714,13 +714,13 @@ string CMacProjectGenerator::CreateProjectCustomScriptPhase(
         CRef<CArray> inputs(  new CArray);
         CRef<CArray> outputs( new CArray);
         list<string> in_list;
-        NStr::Split(info.m_Input, LIST_SEPARATOR, in_list);
+        NStr::Split(info.m_Input, LIST_SEPARATOR, in_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         ITERATE( list<string>, i, in_list) {
             AddString( *inputs,
                 GetRelativePath(CDirEntry::ConcatPath(script_loc,*i)));
         }
         list<string> out_list;
-        NStr::Split(info.m_Output, LIST_SEPARATOR, out_list);
+        NStr::Split(info.m_Output, LIST_SEPARATOR, out_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         ITERATE( list<string>, o, out_list) {
             AddString( *outputs,
                 GetRelativePath(CDirEntry::ConcatPath(script_loc,*o)));
@@ -1057,7 +1057,7 @@ void CMacProjectGenerator::CreateBuildSettings(CDict& dict_cfg, const SConfigInf
         tmp_str = GetApp().GetMetaMakefile().GetCompilerOpt("ARCHS", cfg);
     }
     tmp_list.clear();
-    NStr::Split(tmp_str, LIST_SEPARATOR, tmp_list);
+    NStr::Split(tmp_str, LIST_SEPARATOR, tmp_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     CRef<CArray> archs( AddArray( *settings, "ARCHS"));
     ITERATE( list<string>, a, tmp_list) {
         AddString( *archs, *a);
@@ -1243,10 +1243,10 @@ void CMacProjectGenerator::CreateProjectBuildSettings(
     list<string> tmp_list = prj.m_Defines;
     tmp_list = prj_files.GetProjectContext().Defines(cfg);
     string tmp_str = metamake.GetCompilerOpt("GCC_PREPROCESSOR_DEFINITIONS", cfg);
-    NStr::Split(tmp_str, LIST_SEPARATOR, tmp_list);
+    NStr::Split(tmp_str, LIST_SEPARATOR, tmp_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     if (dll_build) {
         tmp_str = GetApp().GetConfig().Get(CMsvc7RegSettings::GetMsvcSection(), "DllBuildDefine");
-        NStr::Split(tmp_str, LIST_SEPARATOR, tmp_list);
+        NStr::Split(tmp_str, LIST_SEPARATOR, tmp_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     }
 
     tmp_list.sort();
diff --git a/c++/src/build-system/project_tree_builder/msvc_configure.cpp b/c++/src/build-system/project_tree_builder/msvc_configure.cpp
index 57d209b..249366f 100644
--- a/c++/src/build-system/project_tree_builder/msvc_configure.cpp
+++ b/c++/src/build-system/project_tree_builder/msvc_configure.cpp
@@ -1,4 +1,4 @@
-/* $Id: msvc_configure.cpp 455052 2014-12-22 18:23:09Z gouriano $
+/* $Id: msvc_configure.cpp 474851 2015-07-31 19:50:36Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -276,6 +276,10 @@ void CMsvcConfigure::AnalyzeDefines(
     signature += "_";
     signature += CMsvc7RegSettings::GetMsvcVersionName();
     signature += "-" + config.GetConfigFullName();
+    if (config.m_rtType == SConfigInfo::rtMultiThreadedDLL ||
+        config.m_rtType == SConfigInfo::rtMultiThreadedDebugDLL) {
+        signature += "MT";
+    }
 #ifdef NCBI_XCODE_BUILD
     string tmp = CMsvc7RegSettings::GetRequestedArchs();
     NStr::ReplaceInPlace(tmp, " ", "_");
diff --git a/c++/src/build-system/project_tree_builder/msvc_dlls_info_utils.hpp b/c++/src/build-system/project_tree_builder/msvc_dlls_info_utils.hpp
index 40752b2..1e969f1 100644
--- a/c++/src/build-system/project_tree_builder/msvc_dlls_info_utils.hpp
+++ b/c++/src/build-system/project_tree_builder/msvc_dlls_info_utils.hpp
@@ -1,7 +1,7 @@
 #ifndef PROJECT_TREE_BUILDER__MSVC_DLLS_INDO_UTILS__HPP
 #define PROJECT_TREE_BUILDER__MSVC_DLLS_INDO_UTILS__HPP
 
-/* $Id: msvc_dlls_info_utils.hpp 122761 2008-03-25 16:45:09Z gouriano $
+/* $Id: msvc_dlls_info_utils.hpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -45,7 +45,7 @@ inline void GetDllsList   (const CPtbRegistry& registry,
     string dlls_ids_str = 
         registry.GetString("DllBuild", "DLLs");
     
-    NStr::Split(dlls_ids_str, LIST_SEPARATOR, *dlls_ids);
+    NStr::Split(dlls_ids_str, LIST_SEPARATOR, *dlls_ids, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 
@@ -55,7 +55,7 @@ inline void GetHostedLibs (const CPtbRegistry& registry,
                            list<string>*        lib_ids)
 {
     string hosting_str = registry.GetString(dll_id, "Hosting");
-    NStr::Split(hosting_str, LIST_SEPARATOR, *lib_ids);
+    NStr::Split(hosting_str, LIST_SEPARATOR, *lib_ids, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
 }
 
diff --git a/c++/src/build-system/project_tree_builder/msvc_makefile.cpp b/c++/src/build-system/project_tree_builder/msvc_makefile.cpp
index db3f031..54d10c5 100644
--- a/c++/src/build-system/project_tree_builder/msvc_makefile.cpp
+++ b/c++/src/build-system/project_tree_builder/msvc_makefile.cpp
@@ -1,4 +1,4 @@
-/* $Id: msvc_makefile.cpp 460951 2015-03-04 17:33:43Z gouriano $
+/* $Id: msvc_makefile.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -212,7 +212,7 @@ const CMsvcMetaMakefile::SPchInfo& CMsvcMetaMakefile::GetPchInfo(void) const
     m_PchInfo->m_PchUsageDefine = m_MakeFile.GetString("UsePch", "PchUsageDefine");
     m_PchInfo->m_DefaultPch     = m_MakeFile.GetString("UsePch", "DefaultPch");
     string do_not_use_pch_str   = m_MakeFile.GetString("UsePch", "DoNotUsePch");
-    NStr::Split(do_not_use_pch_str, LIST_SEPARATOR, m_PchInfo->m_DontUsePchList);
+    NStr::Split(do_not_use_pch_str, LIST_SEPARATOR, m_PchInfo->m_DontUsePchList, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     string irrelevant[] = {"UsePch","PchUsageDefine","DefaultPch","DoNotUsePch",""};
 
     list<string> projects_with_pch_dirs;
@@ -331,7 +331,7 @@ bool CMsvcProjectMakefile::Redefine(const string& value, list<string>& redef) co
         string new_val = m_MakeFile.GetString("Redefine", value);
         if (!new_val.empty()) {
             redef.clear();
-            NStr::Split(new_val, LIST_SEPARATOR, redef);
+            NStr::Split(new_val, LIST_SEPARATOR, redef, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             _TRACE(m_FilePath << " redefines:  " << value << " = " << new_val);
             return true;
         }
@@ -401,7 +401,7 @@ void CMsvcProjectMakefile::GetAdditionalSourceFiles(const SConfigInfo& config,
     string files_string = 
         GetOpt(m_MakeFile, "AddToProject", "SourceFiles", config);
     
-    NStr::Split(files_string, LIST_SEPARATOR, *files);
+    NStr::Split(files_string, LIST_SEPARATOR, *files, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 
@@ -411,7 +411,7 @@ void CMsvcProjectMakefile::GetAdditionalLIB(const SConfigInfo& config,
     string lib_string = 
         GetOpt(m_MakeFile, "AddToProject", "LIB", config);
     
-    NStr::Split(lib_string, LIST_SEPARATOR, *lib_ids);
+    NStr::Split(lib_string, LIST_SEPARATOR, *lib_ids, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 
@@ -422,7 +422,7 @@ void CMsvcProjectMakefile::GetExcludedSourceFiles(const SConfigInfo& config,
         GetOpt(m_MakeFile, 
                "ExcludedFromProject", "SourceFiles", config);
     
-    NStr::Split(files_string, LIST_SEPARATOR, *files);
+    NStr::Split(files_string, LIST_SEPARATOR, *files, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 
@@ -433,7 +433,7 @@ void CMsvcProjectMakefile::GetExcludedLIB(const SConfigInfo& config,
         GetOpt(m_MakeFile, 
                "ExcludedFromProject", "LIB", config);
     
-    NStr::Split(lib_string, LIST_SEPARATOR, *lib_ids);
+    NStr::Split(lib_string, LIST_SEPARATOR, *lib_ids, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 
@@ -443,7 +443,7 @@ void CMsvcProjectMakefile::GetAdditionalIncludeDirs(const SConfigInfo& config,
     string dirs_string = 
         GetOpt(m_MakeFile, "AddToProject", "IncludeDirs", config);
     
-    NStr::Split(dirs_string, LIST_SEPARATOR, *dirs);
+    NStr::Split(dirs_string, LIST_SEPARATOR, *dirs, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 void CMsvcProjectMakefile::GetHeadersInInclude(const SConfigInfo& config, 
@@ -468,7 +468,7 @@ void CMsvcProjectMakefile::x_GetHeaders(
     dirs_string = NStr::Replace(dirs_string,"\\",separator);
     
     files->clear();
-    NStr::Split(dirs_string, LIST_SEPARATOR, *files);
+    NStr::Split(dirs_string, LIST_SEPARATOR, *files, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     if (files->empty() && !m_Compound) {
         files->push_back("*.h");
         files->push_back("*.hpp");
@@ -501,7 +501,7 @@ CMsvcProjectMakefile::GetCustomBuildInfo(list<SCustomBuildInfo>* info) const
     }
     
     list<string> source_files;
-    NStr::Split(source_files_str, LIST_SEPARATOR, source_files);
+    NStr::Split(source_files_str, LIST_SEPARATOR, source_files, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     ITERATE(list<string>, p, source_files){
         const string& source_file = *p;
@@ -544,7 +544,7 @@ void CMsvcProjectMakefile::GetResourceFiles(const SConfigInfo& config,
     string files_string = 
         GetOpt(m_MakeFile, "AddToProject", "ResourceFiles", config);
     
-    NStr::Split(files_string, LIST_SEPARATOR, *files);
+    NStr::Split(files_string, LIST_SEPARATOR, *files, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 void CMsvcProjectMakefile::GetExtraFiles(map<string, list<string> >*  files_map) const
@@ -558,7 +558,7 @@ void CMsvcProjectMakefile::GetExtraFiles(map<string, list<string> >*  files_map)
             string group_name = NStr::Replace(s->substr(prefix.size()),"_"," ");
             string files_string = m_MakeFile.Get(section, "Files");
             list<string> raw_files, files;
-            NStr::Split(files_string, LIST_SEPARATOR, raw_files);
+            NStr::Split(files_string, LIST_SEPARATOR, raw_files, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             string fname;
             bool started = false;
             ITERATE(list<string>, f, raw_files) {
diff --git a/c++/src/build-system/project_tree_builder/msvc_prj_utils.cpp b/c++/src/build-system/project_tree_builder/msvc_prj_utils.cpp
index ba18f69..43e2f58 100644
--- a/c++/src/build-system/project_tree_builder/msvc_prj_utils.cpp
+++ b/c++/src/build-system/project_tree_builder/msvc_prj_utils.cpp
@@ -1,4 +1,4 @@
-/* $Id: msvc_prj_utils.cpp 460951 2015-03-04 17:33:43Z gouriano $
+/* $Id: msvc_prj_utils.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -728,7 +728,7 @@ string CMsvc7RegSettings::GetMsvcSection(void)
         if (arch != "i386") {
             NStr::ReplaceInPlace(arch, ",", " ");
             list<string> lst;
-            NStr::Split(arch, " ", lst);
+            NStr::Split(arch, " ", lst, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             lst.sort();
             arch = NStr::Join(lst,"_");
             s += "." + arch;
diff --git a/c++/src/build-system/project_tree_builder/msvc_site.cpp b/c++/src/build-system/project_tree_builder/msvc_site.cpp
index 64e8c52..78a25af 100644
--- a/c++/src/build-system/project_tree_builder/msvc_site.cpp
+++ b/c++/src/build-system/project_tree_builder/msvc_site.cpp
@@ -1,4 +1,4 @@
-/* $Id: msvc_site.cpp 465021 2015-04-16 13:03:34Z gouriano $
+/* $Id: msvc_site.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -58,7 +58,7 @@ CMsvcSite::CMsvcSite(const string& reg_path)
         // Provided requests
         str = x_GetConfigureEntry("ProvidedRequests");
         list<string> provided;
-        NStr::Split(str, LIST_SEPARATOR, provided);
+        NStr::Split(str, LIST_SEPARATOR, provided, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         ITERATE (list<string>, it, provided) {
             m_ProvidedThing.insert(*it);
         }
@@ -74,7 +74,7 @@ CMsvcSite::CMsvcSite(const string& reg_path)
         // Not provided requests
         str = x_GetConfigureEntry("NotProvidedRequests");
         list<string> not_provided;
-        NStr::Split(str, LIST_SEPARATOR, not_provided);
+        NStr::Split(str, LIST_SEPARATOR, not_provided, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         ITERATE (list<string>, it, not_provided) {
             m_NotProvidedThing.insert(*it);
         }
@@ -134,7 +134,7 @@ void CMsvcSite::InitializeLibChoices(void)
 
     str = x_GetConfigureEntry("ComponentChoices");
     list<string> comp_choices;
-    NStr::Split(str, LIST_SEPARATOR, comp_choices);
+    NStr::Split(str, LIST_SEPARATOR, comp_choices, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     if (CMsvc7RegSettings::GetMsvcPlatform() != CMsvc7RegSettings::eUnix) {
         // special cases
@@ -174,7 +174,7 @@ void CMsvcSite::InitializeLibChoices(void)
     // Lib choices
     str = x_GetConfigureEntry("LibChoices");
     list<string> lib_choices_list;
-    NStr::Split(str, LIST_SEPARATOR, lib_choices_list);
+    NStr::Split(str, LIST_SEPARATOR, lib_choices_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(list<string>, p, lib_choices_list) {
         const string& choice_str = *p;
         string lib_id;
@@ -269,7 +269,7 @@ void CMsvcSite::GetComponents(const string& entry,
                               list<string>* components) const
 {
     components->clear();
-    NStr::Split(m_Registry.Get(entry, "Component"), " ,\t", *components);
+    NStr::Split(m_Registry.Get(entry, "Component"), " ,\t", *components, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 string CMsvcSite::ProcessMacros(string raw_data, bool preserve_unresolved) const
@@ -334,10 +334,10 @@ void CMsvcSite::GetLibInfo(const string& lib,
     } else {
         string include_str    = ToOSPath(
             ProcessMacros(GetOpt(m_Registry, section, "INCLUDE", config),false));
-        NStr::Split(include_str, LIST_SEPARATOR, libinfo->m_IncludeDir);
+        NStr::Split(include_str, LIST_SEPARATOR, libinfo->m_IncludeDir, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
         string defines_str    = GetOpt(m_Registry, section, "DEFINES", config);
-        NStr::Split(defines_str, LIST_SEPARATOR, libinfo->m_LibDefines);
+        NStr::Split(defines_str, LIST_SEPARATOR, libinfo->m_LibDefines, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
         libinfo->m_LibPath    = ToOSPath(
             ProcessMacros(GetOpt(m_Registry, section, "LIBPATH", config),false));
@@ -345,17 +345,17 @@ void CMsvcSite::GetLibInfo(const string& lib,
             ProcessMacros(GetOpt(m_Registry, section, "BINPATH", config),false));
 
         string libs_str = GetOpt(m_Registry, section, "LIB", config);
-        NStr::Split(libs_str, LIST_SEPARATOR, libinfo->m_Libs);
+        NStr::Split(libs_str, LIST_SEPARATOR, libinfo->m_Libs, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
         libs_str = GetOpt(m_Registry, section, "STDLIB", config);
-        NStr::Split(libs_str, LIST_SEPARATOR, libinfo->m_StdLibs);
+        NStr::Split(libs_str, LIST_SEPARATOR, libinfo->m_StdLibs, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
         string macro_str = GetOpt(m_Registry, section, "MACRO", config);
-        NStr::Split(macro_str, LIST_SEPARATOR, libinfo->m_Macro);
+        NStr::Split(macro_str, LIST_SEPARATOR, libinfo->m_Macro, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
         string files_str    = ProcessMacros(GetOpt(m_Registry, section, "FILES", config),false);
         list<string> tmp;
-        NStr::Split(files_str, "|", tmp);
+        NStr::Split(files_str, "|", tmp, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         ITERATE( list<string>, f, tmp) {
             libinfo->m_Files.push_back( ToOSPath(*f));
         }
@@ -385,7 +385,7 @@ bool CMsvcSite::IsLibEnabledInConfig(const string&      lib,
     }
     list<string> enabled_configs;
     NStr::Split(enabled_configs_str, 
-                LIST_SEPARATOR, enabled_configs);
+                LIST_SEPARATOR, enabled_configs, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     return find(enabled_configs.begin(), 
                 enabled_configs.end(), 
@@ -409,7 +409,7 @@ bool CMsvcSite::ResolveDefine(const string& define, string& resolved) const
         if (CMsvc7RegSettings::GetMsvcPlatform() != CMsvc7RegSettings::eUnix) {
             if (m_UnixMakeDef.GetValue(define,resolved)) {
                 list<string> lst, res;
-                NStr::Split(resolved, LIST_SEPARATOR_LIBS, lst);
+                NStr::Split(resolved, LIST_SEPARATOR_LIBS, lst, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                 ITERATE(list<string>, l, lst) {
                     if (SMakeProjectT::IsConfigurableDefine(*l)) {
                         resolved = x_GetDefinesEntry(SMakeProjectT::StripConfigurableDefine(*l));
@@ -441,7 +441,7 @@ void CMsvcSite::GetConfigureDefines(list<string>* defines) const
 {
     defines->clear();
     NStr::Split(x_GetConfigureEntry("Defines"), LIST_SEPARATOR,
-                *defines);
+                *defines, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 
@@ -563,7 +563,7 @@ void CMsvcSite::GetLibChoiceIncludes(
                                                cpp_flags_define);
     //split on parts
     list<string> parts;
-    NStr::Split(include_str, LIST_SEPARATOR, parts);
+    NStr::Split(include_str, LIST_SEPARATOR, parts, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     string lib_id;
     ITERATE(list<string>, p, parts) {
@@ -659,7 +659,7 @@ void CMsvcSite::GetThirdPartyLibsToInstall(list<string>* libs) const
     libs->clear();
 
     string libs_str = x_GetConfigureEntry("ThirdPartyLibsToInstall");
-    NStr::Split(libs_str, LIST_SEPARATOR, *libs);
+    NStr::Split(libs_str, LIST_SEPARATOR, *libs, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 
@@ -690,7 +690,7 @@ void CMsvcSite::GetStandardFeatures(list<string>& features) const
 {
     features.clear();
     NStr::Split(x_GetConfigureEntry("StandardFeatures"),
-                LIST_SEPARATOR, features);
+                LIST_SEPARATOR, features, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 //-----------------------------------------------------------------------------
@@ -749,7 +749,7 @@ string CMsvcSite::GetPlatformInfo(const string& sysname,
     string result(orig), syn, res;
     if (!str.empty() && NStr::SplitInTwo(str, ":", syn, res)) {
         list< string > entries;
-        NStr::Split(syn, LIST_SEPARATOR, entries);
+        NStr::Split(syn, LIST_SEPARATOR, entries, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         if (find(entries.begin(), entries.end(), orig) != entries.end()) {
             result = res;
         }
@@ -847,7 +847,7 @@ bool CMsvcSite::IsLibOk(const SLibInfo& lib_info, bool silent) const
         bool group_exists = false;
         ITERATE(list<string>, g, lib_info.m_Files) {
             list<string> tmp;
-            NStr::Split(*g, LIST_SEPARATOR, tmp);
+            NStr::Split(*g, LIST_SEPARATOR, tmp, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             bool file_exists = true;
             ITERATE( list<string>, p, tmp) {
                 string file = *p;
@@ -885,7 +885,7 @@ bool CMsvcSite::IsLibOk(const SLibInfo& lib_info, bool silent) const
 void CMsvcSite::ProcessMacros(const list<SConfigInfo>& configs)
 {
     list<string> macros;
-    NStr::Split(x_GetConfigureEntry("Macros"), LIST_SEPARATOR, macros);
+    NStr::Split(x_GetConfigureEntry("Macros"), LIST_SEPARATOR, macros, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     ITERATE(list<string>, m, macros) {
         const string& macro = *m;
diff --git a/c++/src/build-system/project_tree_builder/prj_file_collector.cpp b/c++/src/build-system/project_tree_builder/prj_file_collector.cpp
index 69c7482..c62a03f 100644
--- a/c++/src/build-system/project_tree_builder/prj_file_collector.cpp
+++ b/c++/src/build-system/project_tree_builder/prj_file_collector.cpp
@@ -1,4 +1,4 @@
-/* $Id: prj_file_collector.cpp 340244 2011-10-06 15:30:51Z gouriano $
+/* $Id: prj_file_collector.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -244,7 +244,7 @@ bool CProjectFileCollector::GetIncludeDirs(list<string>& inc_dirs, const SConfig
     inc_dirs.clear();
     string alldirs = m_ProjContext.AdditionalIncludeDirectories(cfg);
     list<string> dirs;
-    NStr::Split(alldirs, LIST_SEPARATOR, dirs);
+    NStr::Split(alldirs, LIST_SEPARATOR, dirs, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE( list<string>, i, dirs) {
         string dir;
 #ifdef PSEUDO_XCODE
@@ -267,7 +267,7 @@ bool CProjectFileCollector::GetLibraryDirs(list<string>& lib_dirs, const SConfig
     lib_dirs.clear();
     string alldirs = m_ProjContext.AdditionalLibraryDirectories(cfg);
     list<string> dirs;
-    NStr::Split(alldirs, LIST_SEPARATOR, dirs);
+    NStr::Split(alldirs, LIST_SEPARATOR, dirs, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE( list<string>, i, dirs) {
         string dir;
 #ifdef PSEUDO_XCODE
diff --git a/c++/src/build-system/project_tree_builder/proj_builder_app.cpp b/c++/src/build-system/project_tree_builder/proj_builder_app.cpp
index 7503d85..536ed60 100644
--- a/c++/src/build-system/project_tree_builder/proj_builder_app.cpp
+++ b/c++/src/build-system/project_tree_builder/proj_builder_app.cpp
@@ -1,4 +1,4 @@
-/* $Id: proj_builder_app.cpp 469083 2015-06-01 15:28:15Z gouriano $
+/* $Id: proj_builder_app.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -2216,7 +2216,7 @@ void CProjBulderApp::GetMetaDataFiles(list<string>* files) const
     *files = m_CustomMetaData;
     if (CMsvc7RegSettings::GetMsvcPlatform() != CMsvc7RegSettings::eUnix) {
         NStr::Split(GetConfig().Get("ProjectTree", "MetaData"), LIST_SEPARATOR,
-                    *files);
+                    *files, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     } else {
         string name(GetApp().GetSite().GetConfigureEntry("MetaData"));
         if (!name.empty()) {
@@ -2243,7 +2243,7 @@ void CProjBulderApp::GetBuildConfigs(list<SConfigInfo>* configs)
     const string& config_str
       = GetConfig().Get(CMsvc7RegSettings::GetMsvcSection(), name);
     list<string> configs_list;
-    NStr::Split(config_str, LIST_SEPARATOR, configs_list);
+    NStr::Split(config_str, LIST_SEPARATOR, configs_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     LoadConfigInfoByNames(GetConfig(), configs_list, configs);
 }
 
@@ -2382,7 +2382,7 @@ const SProjectTreeInfo& CProjBulderApp::GetProjectTreeInfo(void)
     list<string> implicit_exclude_list;
     NStr::Split(implicit_exclude_str, 
                 LIST_SEPARATOR, 
-                implicit_exclude_list);
+                implicit_exclude_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(list<string>, p, implicit_exclude_list) {
         const string& subdir = *p;
         string dir = CDirEntry::ConcatPath(m_ProjectTreeInfo->m_Src, 
@@ -2540,7 +2540,7 @@ void CProjBulderApp::LoadProjectTags(const string& filename)
             }
             list<string> values;
             if (line.find('=') != string::npos) {
-                NStr::Split(line, "=", values);
+                NStr::Split(line, "=", values, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                 if (values.size() > 1) {
                     string first = NStr::TruncateSpaces(values.front());
                     string second = NStr::TruncateSpaces(values.back());
@@ -2549,7 +2549,7 @@ void CProjBulderApp::LoadProjectTags(const string& filename)
                 }
                 continue;
             }
-            NStr::Split(line, LIST_SEPARATOR, values);
+            NStr::Split(line, LIST_SEPARATOR, values, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             ITERATE(list<string>,v,values) {
                 m_RegisteredProjectTags.insert(*v);
             }
@@ -2567,7 +2567,7 @@ bool  CProjBulderApp::FindDepGraph(const string& root, list<string>& found) cons
     found.clear();
     list<string> locations;
     string locstr(GetConfig().Get("ProjectTree", "DepGraph"));
-    NStr::Split(locstr, LIST_SEPARATOR, locations);
+    NStr::Split(locstr, LIST_SEPARATOR, locations, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     for (list<string>::const_iterator l = locations.begin(); l != locations.end(); ++l) {
         CDirEntry fileloc(CDirEntry::ConcatPath(root,CDirEntry::ConvertToOSPath(*l)));
         if (fileloc.Exists() && fileloc.IsFile()) {
@@ -2588,7 +2588,7 @@ void   CProjBulderApp::LoadDepGraph(const string& filename)
                 continue;
             }
             list<string> values;
-            NStr::Split(line, " ", values);
+            NStr::Split(line, " ", values, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             if (values.size() < 2) {
                 continue;
             }
@@ -2603,7 +2603,7 @@ void   CProjBulderApp::LoadDepGraph(const string& filename)
                 site.ResolveDefine(CSymResolver::StripDefine(first), resolved);
                 first = resolved;
             }
-            NStr::Split(first, LIST_SEPARATOR_LIBS, first_list);
+            NStr::Split(first, LIST_SEPARATOR_LIBS, first_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
             list<string> third_list;
 #if DO_PATCHTREEMAKEFILES
@@ -2626,7 +2626,7 @@ void   CProjBulderApp::LoadDepGraph(const string& filename)
                 }
                 third = resolved;
             }
-            NStr::Split(third, LIST_SEPARATOR_LIBS, third_list);
+            NStr::Split(third, LIST_SEPARATOR_LIBS, third_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 #endif
             ITERATE(list<string>, f, first_list) {
                 string f_name(*f);
@@ -2634,7 +2634,7 @@ void   CProjBulderApp::LoadDepGraph(const string& filename)
                     f_name = f->substr(2);
                 } else if (NStr::FindCase(*f,"-framework") != NPOS) {
                     list<string> f_list;
-                    NStr::Split(f_name, ",", f_list);
+                    NStr::Split(f_name, ",", f_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                     f_name = f_list.back();
                 } else if (f->at(0) == '-') {
                     continue;
@@ -2763,7 +2763,7 @@ void CProjBulderApp::UpdateDepGraph( CProjectTreeBuilder::TFiles& files)
                     }
                     dep = resolved;
                 }
-                NStr::Split(dep, LIST_SEPARATOR_LIBS, dep_list);
+                NStr::Split(dep, LIST_SEPARATOR_LIBS, dep_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                 ITERATE(list<string>, d, dep_list) {
                     string dep_name = NStr::StartsWith(*d, "-l") ? d->substr(2) : *d;
                     CSymResolver::StripSuffix(dep_name);
diff --git a/c++/src/build-system/project_tree_builder/proj_projects.cpp b/c++/src/build-system/project_tree_builder/proj_projects.cpp
index f99185b..c624e80 100644
--- a/c++/src/build-system/project_tree_builder/proj_projects.cpp
+++ b/c++/src/build-system/project_tree_builder/proj_projects.cpp
@@ -1,4 +1,4 @@
-/* $Id: proj_projects.cpp 433836 2014-04-30 13:53:21Z gouriano $
+/* $Id: proj_projects.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -181,8 +181,8 @@ bool CProjectsLstFileFilter::CheckProject(const string& project_base_dir, bool*
                 break;
             } else if (weak) {
                 list<string> splitmask, splitdir;
-                NStr::Split( str, "/", splitmask);
-                NStr::Split( proj_dir, "/", splitdir);
+                NStr::Split( str, "/", splitmask, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
+                NStr::Split( proj_dir, "/", splitdir, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                 if (splitmask.size() > splitdir.size()) {
                     splitmask.resize(splitdir.size());
                     string reduced( NStr::Join(splitmask,"/"));
diff --git a/c++/src/build-system/project_tree_builder/proj_tree.cpp b/c++/src/build-system/project_tree_builder/proj_tree.cpp
index 6059029..7d59f3c 100644
--- a/c++/src/build-system/project_tree_builder/proj_tree.cpp
+++ b/c++/src/build-system/project_tree_builder/proj_tree.cpp
@@ -1,4 +1,4 @@
-/* $Id: proj_tree.cpp 430129 2014-03-24 12:52:42Z gouriano $
+/* $Id: proj_tree.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -640,7 +640,7 @@ void CProjectTreeFolders::CreatePath(const string& root_src_dir,
     string rel_dir = 
         CDirEntry::CreateRelativePath(root_src_dir, project_base_dir);
     string sep(1, CDirEntry::GetPathSeparator());
-    NStr::Split(rel_dir, sep, *path);
+    NStr::Split(rel_dir, sep, *path, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 /////////////////////////////////////////////////////////////////////////////
@@ -1020,7 +1020,7 @@ void CMakeGenerator::GenerateCMakeTree(CProjectItemsTree& projects_tree)
                 CDirEntry::CreateRelativePath(src_root, 
                     CDirEntry::ConvertToOSPath(prj.m_SourcesBaseDir)));
         list<string> pathnodes;
-        NStr::Split(relpath, separator, pathnodes);
+        NStr::Split(relpath, separator, pathnodes, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
 // subdirectories/ build tree
         string curpath;
@@ -1188,7 +1188,7 @@ cerr << "Unhandled source: " << *s << " in " << prj.m_Name << endl;
                                     }
                                     if (NStr::FindCase( value,"general") != NPOS) {
                                         list<string> vv_lst;
-                                        NStr::Split(value, LIST_SEPARATOR_LIBS, vv_lst);
+                                        NStr::Split(value, LIST_SEPARATOR_LIBS, vv_lst, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                                         NON_CONST_ITERATE( list<string>, vv, vv_lst) {
                                             if (*vv == "general") {
                                                 *vv = "general-lib";
@@ -1253,7 +1253,7 @@ cerr << "Found ConfigurableDefine: " << *s << " in " << prj.m_Name << endl;
                         string resolved;
                         site.ResolveDefine(value, resolved);
                         list<string> resolved_list;
-                        NStr::Split(resolved, " ", resolved_list);
+                        NStr::Split(resolved, " ", resolved_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                         ITERATE( list<string>, r, resolved_list) {
                             if (NStr::StartsWith(*r, "-D")) {
                                 defines.push_back(*r);
diff --git a/c++/src/build-system/project_tree_builder/proj_tree_builder.cpp b/c++/src/build-system/project_tree_builder/proj_tree_builder.cpp
index 691a5ef..fa816c3 100644
--- a/c++/src/build-system/project_tree_builder/proj_tree_builder.cpp
+++ b/c++/src/build-system/project_tree_builder/proj_tree_builder.cpp
@@ -1,4 +1,4 @@
-/* $Id: proj_tree_builder.cpp 468328 2015-05-21 18:47:59Z gouriano $
+/* $Id: proj_tree_builder.cpp 485908 2015-11-30 14:28:08Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -294,7 +294,7 @@ void SMakeProjectT::DoResolveDefs(CSymResolver& resolver,
                                         list<string> resolved_defs;
                                         NStr::Split(resolved_def_str, 
                                                     LIST_SEPARATOR, 
-                                                    resolved_defs);
+                                                    resolved_defs, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                                         if (msvc_empty) {
                                             copy(resolved_defs.begin(),
                                                 resolved_defs.end(),
@@ -446,7 +446,7 @@ void SMakeProjectT::CreateIncludeDirs(const list<string>& cpp_flags,
             GetApp().GetSite().ResolveDefine(CSymResolver::StripDefine(flag), dir_all);
             if ( !dir_all.empty() ) {
                 list<string> dir_list;
-                NStr::Split(dir_all, LIST_SEPARATOR, dir_list);
+                NStr::Split(dir_all, LIST_SEPARATOR, dir_list, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                 ITERATE(list<string>, dir_item, dir_list) {
                     const string& dir = *dir_item;
                     if ( CDirEntry(dir).IsDir() ) {
@@ -1013,7 +1013,7 @@ void SMakeProjectT::ConvertLibDepends(const list<string>& depends,
             string def;
             GetApp().GetSite().ResolveDefine(CSymResolver::StripDefine(id), def);
             list<string> resolved_def;
-            NStr::Split(def, LIST_SEPARATOR, resolved_def);
+            NStr::Split(def, LIST_SEPARATOR, resolved_def, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             ITERATE(list<string>, r, resolved_def) {
                 id = *r;
                 if (!site.IsLibWithChoice(id) ||
@@ -1056,7 +1056,7 @@ void SMakeProjectT::ConvertLibDependsMacro(const list<string>& depends,
             if (CSymResolver::IsDefine(id) &&
                 site.GetMacros().GetValue(CSymResolver::StripDefine(id),lib)) {
                 list<string> res;
-                NStr::Split(lib, LIST_SEPARATOR, res);
+                NStr::Split(lib, LIST_SEPARATOR, res, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                 ITERATE( list<string>, r, res) {
                     if (NStr::StartsWith(*r, "-l")) {
                         depends_libs.push_back(r->substr(2));
diff --git a/c++/src/build-system/project_tree_builder/resolver.cpp b/c++/src/build-system/project_tree_builder/resolver.cpp
index d006c62..57c7769 100644
--- a/c++/src/build-system/project_tree_builder/resolver.cpp
+++ b/c++/src/build-system/project_tree_builder/resolver.cpp
@@ -1,4 +1,4 @@
-/* $Id: resolver.cpp 455247 2014-12-24 15:36:34Z gouriano $
+/* $Id: resolver.cpp 481503 2015-10-13 14:22:20Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -422,7 +422,7 @@ string CExpansionRule::ApplyRule( const string& value) const
     } else if (m_Rule == eReplace && !m_Lvalue.empty()) {
         if (NStr::EndsWith(value, m_Lvalue)) {
             return NStr::Replace(value, m_Lvalue, m_Rvalue,
-                NStr::Find(value, m_Lvalue, 0, NPOS, NStr::eLast));
+                NStr::Find(value, m_Lvalue, NStr::eCase, NStr::eReverseSearch));
         }
         return value;
     }
diff --git a/c++/src/build-system/relocate.sh.in b/c++/src/build-system/relocate.sh.in
index 77f6724..a1039bb 100644
--- a/c++/src/build-system/relocate.sh.in
+++ b/c++/src/build-system/relocate.sh.in
@@ -1,6 +1,6 @@
 @script_shell@
 
-# $Id: relocate.sh.in 485955 2015-11-30 17:54:14Z blastadm $
+# $Id: relocate.sh.in 500620 2016-05-05 19:16:05Z blastadm $
 # Author:  Denis Vakatov, NCBI 
 # 
 #  Adjust paths to this build tree and the relevant source tree
diff --git a/c++/src/cgi/cgiapp.cpp b/c++/src/cgi/cgiapp.cpp
index e3e034b..cd6cff4 100644
--- a/c++/src/cgi/cgiapp.cpp
+++ b/c++/src/cgi/cgiapp.cpp
@@ -1,4 +1,4 @@
-/*  $Id: cgiapp.cpp 483521 2015-11-02 14:44:40Z ivanov $
+/*  $Id: cgiapp.cpp 492273 2016-02-16 15:26:05Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -142,41 +142,304 @@ ERW_Result CCGIStreamReader::Read(void*   buf,
 }
 
 
-class CCGIStreamWriter : public IWriter
+///////////////////////////////////////////////////////
+// CCgiStreamWrapper, CCgiStreamWrapperWriter
+//
+
+NCBI_PARAM_DECL(bool, CGI, Count_Transfered);
+NCBI_PARAM_DEF_EX(bool, CGI, Count_Transfered, true, eParam_NoThread,
+                  CGI_COUNT_TRANSFERED);
+typedef NCBI_PARAM_TYPE(CGI, Count_Transfered) TCGI_Count_Transfered;
+
+
+// Helper writer used to:
+// - count bytes read/written to the stream;
+// - disable output stream during HEAD requests after sending headers
+//   so that the application can not output more data or clear 'bad' bit;
+// - send chunked data to the client;
+// - copy data to cache stream when necessary.
+class CCgiStreamWrapperWriter : public IWriter
 {
 public:
-    CCGIStreamWriter(ostream& os) : m_OStr(os) { }
+    CCgiStreamWrapperWriter(CNcbiOstream& out);
+    virtual ~CCgiStreamWrapperWriter(void);
 
     virtual ERW_Result Write(const void* buf,
                              size_t      count,
                              size_t*     bytes_written = 0);
 
-    virtual ERW_Result Flush(void)
-    { return m_OStr.flush() ? eRW_Success : eRW_Error; }
+    virtual ERW_Result Flush(void);
 
-protected:
-    ostream& m_OStr;
+    CCgiStreamWrapper::EStreamMode GetMode(void) const { return m_Mode; }
+
+    void SetMode(CCgiStreamWrapper::EStreamMode mode);
+    void SetCacheStream(CNcbiOstream& stream);
+
+    void FinishChunkedTransfer(const CCgiStreamWrapper::TTrailer* trailer);
+    void AbortChunkedTransfer(void);
+
+private:
+    void x_SetChunkSize(size_t sz);
+    void x_WriteChunk(const char* buf, size_t count);
+
+    CCgiStreamWrapper::EStreamMode m_Mode;
+    CNcbiOstream* m_Out;
+    // block mode
+    bool m_ErrorReported;
+    // chunked mode
+    size_t m_ChunkSize;
+    char* m_Chunk;
+    size_t m_Count;
+    bool m_UsedChunkedTransfer; // remember if chunked transfer was enabled.
 };
 
 
-ERW_Result CCGIStreamWriter::Write(const void* buf,
-                                   size_t      count,
-                                   size_t*     bytes_written)
+CCgiStreamWrapperWriter::CCgiStreamWrapperWriter(CNcbiOstream& out)
+    : m_Mode(CCgiStreamWrapper::eNormal),
+      m_Out(&out),
+      m_ErrorReported(false),
+      m_ChunkSize(0),
+      m_Chunk(0),
+      m_Count(0),
+      m_UsedChunkedTransfer(false)
 {
-    ERW_Result result;
-    if (!m_OStr.write((char*)buf, count)) {
-        result = eRW_Error;
+}
+
+
+CCgiStreamWrapperWriter::~CCgiStreamWrapperWriter(void)
+{
+    if (m_Mode == CCgiStreamWrapper::eChunkedWrites) {
+        x_SetChunkSize(0); // cleanup
     }
-    else {
-        result = eRW_Success;
+}
+
+
+void CCgiStreamWrapperWriter::x_WriteChunk(const char* buf, size_t count)
+{
+    if (!buf || count == 0) return;
+    *m_Out << NStr::NumericToString(count, 0, 16) << HTTP_EOL;
+    m_Out->write(buf, count);
+    *m_Out << HTTP_EOL;
+}
+
+
+ERW_Result CCgiStreamWrapperWriter::Write(const void* buf,
+                                          size_t      count,
+                                          size_t*     bytes_written)
+{
+    ERW_Result result = eRW_Success;
+    size_t written = 0;
+
+    switch (m_Mode) {
+    case CCgiStreamWrapper::eNormal:
+        {
+            if (!m_Out->write((char*)buf, count)) {
+                result = eRW_Error;
+            }
+            else {
+                result = eRW_Success;
+                written = count;
+            }
+            break;
+        }
+    case CCgiStreamWrapper::eBlockWrites:
+        {
+            if ( !m_ErrorReported ) {
+                if ( m_UsedChunkedTransfer ) {
+                    ERR_POST_X(16, "CCgiStreamWrapperWriter::Write() -- attempt to "
+                        "write data after finishing chunked transfer.");
+                }
+                else {
+                    ERR_POST_X(15, "CCgiStreamWrapperWriter::Write() -- attempt to "
+                        "write data after sending headers on HEAD request.");
+                }
+                m_ErrorReported = true;
+            }
+            // Pretend the operation was successfull so that applications
+            // which check I/O result do not fail.
+            written = count;
+            break;
+        }
+    case CCgiStreamWrapper::eChunkedWrites:
+        {
+            const char* cbuf = static_cast<const char*>(buf);
+            if (m_Chunk  &&  m_ChunkSize > 0) {
+                // Copy data to own buffer
+                while (count && result == eRW_Success) {
+                    size_t chunk_count = min(count, m_ChunkSize - m_Count);
+                    memcpy(m_Chunk + m_Count, cbuf, chunk_count);
+                    cbuf += chunk_count;
+                    m_Count += chunk_count;
+                    count -= chunk_count;
+                    written += chunk_count;
+                    if (m_Count >= m_ChunkSize) {
+                        x_WriteChunk(m_Chunk, m_Count);
+                        if (!m_Out->good()) {
+                            result = eRW_Error;
+                            written -= chunk_count;
+                        }
+                        m_Count = 0;
+                    }
+                }
+            }
+            else {
+                // If chunk size is zero, use the whole original buffer.
+                x_WriteChunk(cbuf, count);
+                if (m_Out->good()) {
+                    written = count;
+                }
+                else {
+                    result = eRW_Error;
+                }
+            }
+            break;
+        }
     }
+
     if (bytes_written) {
-        *bytes_written = result == eRW_Success ? count : 0;
+        *bytes_written = written;
     }
     return result;
 }
 
 
+ERW_Result CCgiStreamWrapperWriter::Flush(void)
+{
+    switch (m_Mode) {
+    case CCgiStreamWrapper::eNormal:
+        break;
+    case CCgiStreamWrapper::eBlockWrites:
+        // Report success
+        return eRW_Success;
+    case CCgiStreamWrapper::eChunkedWrites:
+        if (m_Count) {
+            x_WriteChunk(m_Chunk, m_Count);
+            m_Count = 0;
+        }
+        break;
+    }
+    return m_Out->flush() ? eRW_Success : eRW_Error;
+}
+
+
+void CCgiStreamWrapperWriter::SetMode(CCgiStreamWrapper::EStreamMode mode)
+{
+    switch (mode) {
+    case CCgiStreamWrapper::eNormal:
+        break;
+    case CCgiStreamWrapper::eBlockWrites:
+        _ASSERT(m_Mode == CCgiStreamWrapper::eNormal);
+        m_Out->flush();
+        // Prevent output from writing anything, disable exceptions -
+        // an attemp to write will be reported by the wrapper.
+        m_Out->exceptions(ios_base::goodbit);
+        m_Out->setstate(ios_base::badbit);
+        break;
+    case CCgiStreamWrapper::eChunkedWrites:
+        _ASSERT(m_Mode == CCgiStreamWrapper::eNormal);
+        // Use default chunk size.
+        x_SetChunkSize(CCgiResponse::GetChunkSize());
+        m_UsedChunkedTransfer = true;
+        break;
+    }
+    m_Mode = mode;
+}
+
+
+void CCgiStreamWrapperWriter::SetCacheStream(CNcbiOstream& stream)
+{
+    list<CNcbiOstream*> slist;
+    slist.push_back(m_Out);
+    slist.push_back(&stream);
+    m_Out = new CWStream(new CMultiWriter(slist), 1, 0,
+        CRWStreambuf::fOwnWriter);
+}
+
+
+void CCgiStreamWrapperWriter::FinishChunkedTransfer(
+    const CCgiStreamWrapper::TTrailer* trailer)
+{
+    if (m_Mode == CCgiStreamWrapper::eChunkedWrites) {
+        Flush();
+        // Zero chunk indicates end of chunked data.
+        *m_Out << "0" << HTTP_EOL;
+        x_SetChunkSize(0);
+        // Allow to write trailers after the last chunk.
+        SetMode(CCgiStreamWrapper::eNormal);
+        if ( trailer ) {
+            ITERATE(CCgiStreamWrapper::TTrailer, it, *trailer) {
+                *m_Out << it->first << ": " << it->second << HTTP_EOL;
+            }
+        }
+        // Finish chunked data/trailer.
+        *m_Out << HTTP_EOL;
+    }
+}
+
+
+void CCgiStreamWrapperWriter::AbortChunkedTransfer(void)
+{
+    if (m_Mode == CCgiStreamWrapper::eChunkedWrites) {
+        x_SetChunkSize(0);
+    }
+    // Disable any writes.
+    SetMode(CCgiStreamWrapper::eBlockWrites);
+}
+
+
+void CCgiStreamWrapperWriter::x_SetChunkSize(size_t sz)
+{
+    if (m_Chunk) {
+        x_WriteChunk(m_Chunk, m_Count);
+        delete[](m_Chunk);
+        m_Chunk = 0;
+    }
+    m_Count = 0;
+    m_ChunkSize = sz;
+    if (m_ChunkSize) {
+        m_Chunk = new char[m_ChunkSize];
+    }
+}
+
+
+CCgiStreamWrapper::CCgiStreamWrapper(CNcbiOstream& out)
+    : CWStream(m_Writer = new CCgiStreamWrapperWriter(out),
+    1, 0, CRWStreambuf::fOwnWriter) // '1, 0' disables buffering by the wrapper
+{
+}
+
+
+CCgiStreamWrapper::EStreamMode CCgiStreamWrapper::GetWriterMode(void)
+{
+    return m_Writer->GetMode();
+}
+
+
+void CCgiStreamWrapper::SetWriterMode(CCgiStreamWrapper::EStreamMode mode)
+{
+    flush();
+    m_Writer->SetMode(mode);
+}
+
+
+void CCgiStreamWrapper::SetCacheStream(CNcbiOstream& stream)
+{
+    m_Writer->SetCacheStream(stream);
+}
+
+
+void CCgiStreamWrapper::FinishChunkedTransfer(const TTrailer* trailer)
+{
+    m_Writer->FinishChunkedTransfer(trailer);
+}
+
+
+void CCgiStreamWrapper::AbortChunkedTransfer(void)
+{
+    m_Writer->AbortChunkedTransfer();
+}
+
+
 ///////////////////////////////////////////////////////
 // CCgiApplication
 //
@@ -273,13 +536,20 @@ int CCgiApplication::Run(void)
             }
             if (!skip_process_request) {
                 if( m_Cache.get() ) {
-                    list<CNcbiOstream*> slist;
-                    orig_stream = m_Context->GetResponse().GetOutput();
-                    slist.push_back(orig_stream);
-                    slist.push_back(&result_copy);
-                    new_stream.reset(new CWStream(new CMultiWriter(slist), 0,0,
-                                                  CRWStreambuf::fOwnWriter));
-                    m_Context->GetResponse().SetOutput(new_stream.get());
+                    CCgiStreamWrapper* wrapper = dynamic_cast<CCgiStreamWrapper*>(
+                        m_Context->GetResponse().GetOutput());
+                    if ( wrapper ) {
+                        wrapper->SetCacheStream(result_copy);
+                    }
+                    else {
+                        list<CNcbiOstream*> slist;
+                        orig_stream = m_Context->GetResponse().GetOutput();
+                        slist.push_back(orig_stream);
+                        slist.push_back(&result_copy);
+                        new_stream.reset(new CWStream(new CMultiWriter(slist), 1, 0,
+                                                      CRWStreambuf::fOwnWriter));
+                        m_Context->GetResponse().SetOutput(new_stream.get());
+                    }
                 }
                 GetDiagContext().SetAppState(eDiagAppState_Request);
                 result = CCgiContext::ProcessCORSRequest(
@@ -290,7 +560,9 @@ int CCgiApplication::Run(void)
                 if (result != 0) {
                     SetHTTPStatus(500);
                     m_ErrorStatus = true;
+                    m_Context->GetResponse().AbortChunkedTransfer();
                 } else {
+                    m_Context->GetResponse().FinishChunkedTransfer();
                     if (m_Cache.get()) {
                         m_Context->GetResponse().Flush();
                         if (m_IsResultReady) {
@@ -318,6 +590,7 @@ int CCgiApplication::Run(void)
                      e.GetStatusCode() >= CCgiException::e400_BadRequest ) {
                     throw;
                 }
+                m_Context->GetResponse().FinishChunkedTransfer();
                 GetDiagContext().SetAppState(eDiagAppState_RequestEnd);
                 // If for some reason exception with status 2xx was thrown,
                 // set the result to 0, update HTTP status and continue.
@@ -343,6 +616,9 @@ int CCgiApplication::Run(void)
         x_OnEvent(eExit, result);
     }
     catch (exception& e) {
+        if ( m_Context.get() ) {
+            m_Context->GetResponse().AbortChunkedTransfer();
+        }
         GetDiagContext().SetAppState(eDiagAppState_RequestEnd);
         if ( x_DoneHeadRequest() ) {
             // Ignore errors after HEAD request has been finished.
@@ -535,12 +811,6 @@ CCgiServerContext* CCgiApplication::LoadServerContext(CCgiContext& /*context*/)
 }
 
 
-NCBI_PARAM_DECL(bool, CGI, Count_Transfered);
-NCBI_PARAM_DEF_EX(bool, CGI, Count_Transfered, true, eParam_NoThread,
-                  CGI_COUNT_TRANSFERED);
-typedef NCBI_PARAM_TYPE(CGI, Count_Transfered) TCGI_Count_Transfered;
-
-
 CCgiContext* CCgiApplication::CreateContext
 (CNcbiArguments*   args,
  CNcbiEnvironment* env,
@@ -568,6 +838,13 @@ CCgiContext* CCgiApplication::CreateContextWithFlags
         GetConfig().GetInt("CGI", "RequestErrBufSize", 256, 0,
                            CNcbiRegistry::eReturn);
 
+    bool need_output_wrapper =
+        TCGI_Count_Transfered::GetDefault()  ||
+        (env && CCgiResponse::x_ClientSupportsChunkedTransfer(*env))  ||
+        (env &&
+        NStr::EqualNocase("HEAD",
+        env->Get(CCgiRequest::GetPropertyName(eCgi_RequestMethod))));
+
     if ( TCGI_Count_Transfered::GetDefault() ) {
         if ( !inp ) {
             if ( !m_InputStream.get() ) {
@@ -578,11 +855,11 @@ CCgiContext* CCgiApplication::CreateContextWithFlags
             inp = m_InputStream.get();
             ifd = 0;
         }
+    }
+    if ( need_output_wrapper ) {
         if ( !out ) {
             if ( !m_OutputStream.get() ) {
-                m_OutputStream.reset(
-                    new CWStream(new CCGIStreamWriter(std::cout), 0, 0,
-                                CRWStreambuf::fOwnWriter));
+                m_OutputStream.reset(new CCgiStreamWrapper(std::cout));
             }
             out = m_OutputStream.get();
             ofd = 1;
@@ -591,6 +868,10 @@ CCgiContext* CCgiApplication::CreateContextWithFlags
                 inp->tie(out);
             }
         }
+        else {
+            m_OutputStream.reset(new CCgiStreamWrapper(*out));
+            out = m_OutputStream.get();
+        }
     }
     return
         new CCgiContext(*this, args, env, inp, out, ifd, ofd,
@@ -1037,7 +1318,8 @@ void CCgiApplication::ConfigureDiagFormat(CCgiContext& context)
         flagmap["uid"]         = eDPF_UID;
     }
     list<string> flags;
-    NStr::Split(format, " ", flags);
+    NStr::Split(format, " ", flags,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(list<string>, flag, flags) {
         TFlagMap::const_iterator it;
         if ((it = flagmap.find(*flag)) != flagmap.end()) {
@@ -1487,7 +1769,8 @@ string CCgiStatistics::Compose_Entries(void)
         return kEmptyStr;
 
     list<string> vars;
-    NStr::Split(log_args, ",; \t", vars);
+    NStr::Split(log_args, ",; \t", vars,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     string msg;
     ITERATE (list<string>, i, vars) {
diff --git a/c++/src/cgi/cgictx.cpp b/c++/src/cgi/cgictx.cpp
index 315b9e4..306cfc9 100644
--- a/c++/src/cgi/cgictx.cpp
+++ b/c++/src/cgi/cgictx.cpp
@@ -1,4 +1,4 @@
-/*  $Id: cgictx.cpp 464979 2015-04-15 18:52:49Z grichenk $
+/*  $Id: cgictx.cpp 492269 2016-02-16 15:24:58Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -122,6 +122,7 @@ CCgiContext::CCgiContext(CCgiApplication&        app,
       m_StatusCode(CCgiException::eStatusNotSet)
 {
     m_Response.SetRequestMethod(m_Request->GetRequestMethod());
+    m_Response.SetCgiRequest(*m_Request);
 
     if (flags & CCgiRequest::fDisableTrackingCookie) {
         m_Response.DisableTrackingCookie();
@@ -623,7 +624,8 @@ static bool s_IsAllowedOrigin(const string& origin)
     }
 
     TStringList origins;
-    NStr::Split(allowed, ", ", origins);
+    NStr::Split(allowed, ", ", origins,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(TStringList, it, origins) {
         if (NStr::EndsWith(origin, *it, NStr::eCase)) {
             return true;
@@ -641,7 +643,8 @@ static bool s_IsAllowedMethod(const string& method)
         return false;
     }
     TStringList methods;
-    NStr::Split(TCORS_AllowMethods::GetDefault(), ", ", methods);
+    NStr::Split(TCORS_AllowMethods::GetDefault(), ", ", methods,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(TStringList, it, methods) {
         // Methods are case-sensitive.
         if (*it == method) return true;
@@ -672,12 +675,14 @@ static bool s_IsAllowedHeaderList(const string& headers)
     ah += kSimpleHeaders;
     ah += kDefaultHeaders;
     NStr::ToUpper(ah);
-    NStr::Split(ah, ", ", allowed);
+    NStr::Split(ah, ", ", allowed,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     allowed.sort();
 
     string rh = headers;
     NStr::ToUpper(rh);
-    NStr::Split(rh, ", ", requested);
+    NStr::Split(rh, ", ", requested,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     requested.sort();
 
     TStringList::const_iterator ait = allowed.begin();
diff --git a/c++/src/cgi/fcgi_run.cpp b/c++/src/cgi/fcgi_run.cpp
index 0cf677e..7eeaad3 100644
--- a/c++/src/cgi/fcgi_run.cpp
+++ b/c++/src/cgi/fcgi_run.cpp
@@ -1,4 +1,4 @@
-/*  $Id: fcgi_run.cpp 433624 2014-04-28 15:39:19Z grichenk $
+/*  $Id: fcgi_run.cpp 497377 2016-04-06 13:21:42Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -111,9 +111,9 @@ class CAutoCgiContext
 public:
     CAutoCgiContext(void) : m_Ctx(NULL) {}
     ~CAutoCgiContext(void) { if (m_Ctx) m_Ctx->reset(); }
-    void Reset(auto_ptr<CCgiContext>& ctx) { m_Ctx = &ctx; }
+    void Reset(unique_ptr<CCgiContext>& ctx) { m_Ctx = &ctx; }
 private:
-    auto_ptr<CCgiContext>* m_Ctx;
+    unique_ptr<CCgiContext>* m_Ctx;
 };
 
 
@@ -132,8 +132,8 @@ public:
     void SetErrorStream(FCGX_Stream* pferr);
 
 private:
-    auto_ptr<CCgiObuffer>  m_Buffer;
-    auto_ptr<CNcbiOstream> m_SavedCerr;
+    unique_ptr<CCgiObuffer>  m_Buffer;
+    unique_ptr<CNcbiOstream> m_SavedCerr;
 #ifdef HAVE_FCGX_ACCEPT_R
     FCGX_Request           m_Request;
 #endif
@@ -354,7 +354,7 @@ bool CCgiApplication::x_RunFastCGI(int* result, unsigned int def_iter)
     // Statistics
     bool is_stat_log = reg.GetBool("CGI", "StatLog", false, 0,
                                    CNcbiRegistry::eReturn);
-    auto_ptr<CCgiStatistics> stat(is_stat_log ? CreateStat() : 0);
+    unique_ptr<CCgiStatistics> stat(is_stat_log ? CreateStat() : 0);
 
     Uint8 total_memory_limit =
         NStr::StringToUInt8_DataSize(
@@ -383,7 +383,7 @@ bool CCgiApplication::x_RunFastCGI(int* result, unsigned int def_iter)
     }}
 
     // Watcher file -- to allow for stopping the Fast-CGI loop "prematurely"
-    auto_ptr<CCgiWatchFile> watcher(0);
+    unique_ptr<CCgiWatchFile> watcher;
     {{
         const string& orig_filename = reg.Get("FastCGI", "WatchFile.Name");
         if ( !orig_filename.empty() ) {
@@ -568,7 +568,7 @@ bool CCgiApplication::x_RunFastCGI(int* result, unsigned int def_iter)
             CNcbiOstream* orig_stream = NULL;
             //int orig_fd = -1;
             CNcbiStrstream result_copy;
-            auto_ptr<CNcbiOstream> new_stream;
+            unique_ptr<CNcbiOstream> new_stream;
 
             auto_context.Reset(m_Context);
 
@@ -620,17 +620,24 @@ bool CCgiApplication::x_RunFastCGI(int* result, unsigned int def_iter)
                 bool caching_needed = IsCachingNeeded(m_Context->GetRequest());
                 if (m_Cache.get() && caching_needed) {
                     skip_process_request = GetResultFromCache(m_Context->GetRequest(),
-                                                           m_Context->GetResponse().out());
+                        m_Context->GetResponse().out());
                 }
                 if (!skip_process_request) {
                     if( m_Cache.get() ) {
-                        list<CNcbiOstream*> slist;
-                        orig_stream = m_Context->GetResponse().GetOutput();
-                        slist.push_back(orig_stream);
-                        slist.push_back(&result_copy);
-                        new_stream.reset(new CWStream(new CMultiWriter(slist), 0,0,
-                                                      CRWStreambuf::fOwnWriter));
-                        m_Context->GetResponse().SetOutput(new_stream.get());
+                        CCgiStreamWrapper* wrapper =
+                            dynamic_cast<CCgiStreamWrapper*>(m_Context->GetResponse().GetOutput());
+                        if ( wrapper ) {
+                            wrapper->SetCacheStream(result_copy);
+                        }
+                        else {
+                            list<CNcbiOstream*> slist;
+                            orig_stream = m_Context->GetResponse().GetOutput();
+                            slist.push_back(orig_stream);
+                            slist.push_back(&result_copy);
+                            new_stream.reset(new CWStream(new CMultiWriter(slist), 1, 0,
+                                                          CRWStreambuf::fOwnWriter));
+                            m_Context->GetResponse().SetOutput(new_stream.get());
+                        }
                     }
                     GetDiagContext().SetAppState(eDiagAppState_Request);
                     x_result = CCgiContext::ProcessCORSRequest(
@@ -645,7 +652,7 @@ bool CCgiApplication::x_RunFastCGI(int* result, unsigned int def_iter)
                                 if(caching_needed)
                                     SaveResultToCache(m_Context->GetRequest(), result_copy);
                                 else {
-                                    auto_ptr<CCgiRequest> request(GetSavedRequest(m_RID));
+                                    unique_ptr<CCgiRequest> request(GetSavedRequest(m_RID));
                                     if (request.get())
                                         SaveResultToCache(*request, result_copy);
                                 }
diff --git a/c++/src/cgi/ncbicgi.cpp b/c++/src/cgi/ncbicgi.cpp
index 3485a84..bbe0271 100644
--- a/c++/src/cgi/ncbicgi.cpp
+++ b/c++/src/cgi/ncbicgi.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbicgi.cpp 464189 2015-04-06 18:54:37Z grichenk $
+/*  $Id: ncbicgi.cpp 497377 2016-04-06 13:21:42Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1011,7 +1011,6 @@ CCgiRequest::CCgiRequest
       m_OwnInput(false),
       m_ErrBufSize(errbuf_size),
       m_QueryStringParsed(false),
-      m_TrackingEnvHolder(NULL), 
       m_Session(NULL),
       m_EntryReaderContext(NULL)
 {
@@ -1036,7 +1035,6 @@ CCgiRequest::CCgiRequest
       m_OwnInput(false),
       m_ErrBufSize(errbuf_size),
       m_QueryStringParsed(false),
-      m_TrackingEnvHolder(NULL),
       m_Session(NULL),
       m_EntryReaderContext(NULL)
 {
@@ -1061,7 +1059,6 @@ CCgiRequest::CCgiRequest
       m_OwnInput(false),
       m_ErrBufSize(errbuf_size),
       m_QueryStringParsed(false),
-      m_TrackingEnvHolder(NULL), 
       m_Session(NULL),
       m_EntryReaderContext(NULL)
 {
@@ -1071,7 +1068,7 @@ CCgiRequest::CCgiRequest
 
     x_SetClientIpProperty(flags);
 
-    x_SetPageHitId(flags);
+    x_InitRequestContext(flags);
 }
 
 
@@ -1134,7 +1131,7 @@ void CCgiRequest::x_Init
 
     x_ProcessInputStream(flags, istr, ifd);
 
-    x_SetPageHitId(flags);
+    x_InitRequestContext(flags);
 
     // Check for an IMAGEMAP input entry like: "Command.x=5&Command.y=3" and
     // put them with empty string key for better access
@@ -1171,16 +1168,17 @@ void CCgiRequest::x_Init
 }
 
 
-static CTempStringEx x_LastWord(const CTempStringEx& forward)
+static CTempString x_LastWord(const CTempStringEx& forward)
 {
     if ( forward.empty() ) {
-        return kEmptyStr;
+        return CTempString();
     }
 
     vector<CTempStringEx> words;
-    NStr::Tokenize(forward, ", \t", words, NStr::eMergeDelims);
+    NStr::Split(forward, ", \t", words,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     if ( !words.size() ) {
-        return kEmptyStr;
+        return CTempString();
     }
 
     size_t i;
@@ -1227,30 +1225,43 @@ void CCgiRequest::x_SetClientIpProperty(TFlags flags) const
 }
 
 
-void CCgiRequest::x_SetPageHitId(TFlags flags)
+void CCgiRequest::x_InitRequestContext(TFlags flags)
 {
-    CRequestContext& rctx = CDiagContext::GetRequestContext();
-    if ( rctx.IsSetHitID(CRequestContext::eHitID_Request) ) {
-        return;
+    // NOTE: NCBI_CONTEXT is parsed before individual properties (e.g. NCBI_PHID)
+    // so that their values can override those from NCBI_CONTEXT.
+    CRequestContext_PassThrough pt;
+    string pt_data = GetRandomProperty("NCBI_CONTEXT", true);
+    if ( !pt_data.empty() ) {
+        pt.Deserialize(pt_data, CRequestContext_PassThrough::eFormat_UrlEncoded);
     }
-    if ((flags & fIgnorePageHitId) == 0) {
-        string phid;
-        // Check if pageviewid is present. If not, generate one.
-        TCgiEntries::iterator phid_it = m_Entries.find(
-            g_GetNcbiString(eNcbiStrings_PHID));
-        if (phid_it != m_Entries.end()) {
-            phid = phid_it->second;
-        }
-        else {
-            // Try HTTP_NCBI_PHID
-            phid = CRequestContext::SelectLastHitID(
-                GetRandomProperty("NCBI_PHID", true));
-        }
-        if ( phid.empty() ) {
-            rctx.SetHitID();
+
+    CRequestContext& rctx = CDiagContext::GetRequestContext();
+    if ( !rctx.IsSetHitID(CRequestContext::eHitID_Request) ) {
+        if ((flags & fIgnorePageHitId) == 0) {
+            string phid;
+            // Check if pageviewid is present. If not, generate one.
+            TCgiEntries::iterator phid_it = m_Entries.find(
+                g_GetNcbiString(eNcbiStrings_PHID));
+            if (phid_it != m_Entries.end()) {
+                phid = phid_it->second;
+            }
+            else {
+                // Try HTTP_NCBI_PHID
+                phid = CRequestContext::SelectLastHitID(
+                    GetRandomProperty("NCBI_PHID", true));
+            }
+            if ( phid.empty() ) {
+                rctx.SetHitID();
+            }
+            else {
+                rctx.SetHitID(phid);
+            }
         }
-        else {
-            rctx.SetHitID(phid);
+    }
+    if ( !rctx.IsSetDtab() ) {
+        string dtab = x_GetPropertyByName("HTTP_DTAB_LOCAL");
+        if ( !dtab.empty() ) {
+            rctx.SetDtab(dtab);
         }
     }
 }
@@ -1289,7 +1300,8 @@ void CCgiRequest::x_ProcessInputStream(TFlags flags, CNcbiIstream* istr, int ifd
 {
     m_Content.reset();
     // POST method?
-    if ( AStrEquiv(GetProperty(eCgi_RequestMethod), "POST", PNocase()) ) {
+    if (AStrEquiv(GetProperty(eCgi_RequestMethod), "POST", PNocase())  ||
+        AStrEquiv(GetProperty(eCgi_RequestMethod), "PUT", PNocase())) {
 
         if ( !istr ) {
             istr = &NcbiCin;  // default input stream
@@ -1325,7 +1337,7 @@ void CCgiRequest::x_ProcessInputStream(TFlags flags, CNcbiIstream* istr, int ifd
                 // or application/x-www-form-urlencoded
                 try {
                     ParseRemainingContent();
-                } NCBI_CATCH_ALL_X(8, "CCgiRequest: POST with no content type");
+                } NCBI_CATCH_ALL_X(8, "CCgiRequest: POST/PUT with no content type");
                 CStreamUtils::Pushback(*istr, pstr->data(), pstr->length());
                 m_Input    = istr;
                 // m_InputFD  = ifd; // would be exhausted
@@ -1615,7 +1627,8 @@ void CCgiRequest::GetCGIEntries(CEntryCollector_Base& collector) const
     TArgLimits arg_limits;
     int lim_unlisted = -1;
 
-    NStr::Split(TCGI_LogLimitArgs::GetDefault(), "&", limited);
+    NStr::Split(TCGI_LogLimitArgs::GetDefault(), "&", limited,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(list<string>, it, limited) {
         string arg, val;
         NStr::SplitInTwo(*it, ":", arg, val);
@@ -1643,7 +1656,8 @@ void CCgiRequest::GetCGIEntries(CEntryCollector_Base& collector) const
         arg_limits[arg] = ival;
     }
 
-    NStr::Split(TCGI_LogExcludeArgs::GetDefault(), "&", excluded);
+    NStr::Split(TCGI_LogExcludeArgs::GetDefault(), "&", excluded,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(list<string>, it, excluded) {
         if (*it == "*") {
             return;
diff --git a/c++/src/cgi/ncbicgir.cpp b/c++/src/cgi/ncbicgir.cpp
index e2b891d..f6ce191 100644
--- a/c++/src/cgi/ncbicgir.cpp
+++ b/c++/src/cgi/ncbicgir.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbicgir.cpp 483517 2015-11-02 14:43:32Z ivanov $
+/*  $Id: ncbicgir.cpp 492273 2016-02-16 15:26:05Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -75,79 +75,6 @@ NCBI_PARAM_DEF_IN_SCOPE(bool, CGI, ThrowOnBadOutput, true, CCgiResponse);
 NCBI_PARAM_DEF_IN_SCOPE(bool, CGI, ExceptionAfterHEAD, false, CCgiResponse);
 
 
-// Helper writer and stream used to disable real output stream during
-// HEAD requests after sending headers so that the application can not
-// output more data or clear 'bad' bit.
-class CCgiStreamWrapperWriter : public IWriter
-{
-public:
-    CCgiStreamWrapperWriter(void)
-        : m_ErrorReported(false) {}
-
-    virtual ERW_Result Write(const void* buf,
-                             size_t      count,
-                             size_t*     bytes_written = 0)
-    {
-        if ( !m_ErrorReported ) {
-            ERR_POST_X(4, "CCgiStreamWrapperWriter::Write() -- attempt to "
-                "write data after sending headers on HEAD request.");
-            m_ErrorReported = true;
-        }
-        // Pretend the operation was successfull so that applications
-        // which check I/O result do not fail.
-        if ( bytes_written ) {
-            *bytes_written = count;
-        }
-        return eRW_Success;
-    }
-
-    virtual ERW_Result Flush(void)
-    {
-        return eRW_Success;
-    }
-
-private:
-    bool m_ErrorReported;
-};
-
-
-class CCgiStreamWrapper : public CWStream
-{
-public:
-    CCgiStreamWrapper(CNcbiOstream* out)
-        : CWStream(new CCgiStreamWrapperWriter, 1, 0, CRWStreambuf::fOwnWriter),
-          m_Output(out),
-          m_OldBuf(0),
-          m_NewBuf(rdbuf())
-    {
-        if ( m_Output ) {
-            // Prevent output from writing anything, disable exceptions -
-            // an attemp to write will be reported by the wrapper.
-            m_Output->exceptions(ios_base::goodbit);
-            m_Output->setstate(ios_base::badbit);
-            // Replace rdbuf with the customized one, which does not
-            // write anything, but reports an error (once).
-            m_Output->flush();
-            m_OldBuf = m_Output->rdbuf();
-            m_Output->rdbuf(m_NewBuf);
-        }
-    }
-
-    virtual ~CCgiStreamWrapper(void)
-    {
-        // Restore the original rdbuf so that it can be safely destroyed.
-        if (m_Output  &&  m_Output->rdbuf() == m_NewBuf) {
-            m_Output->rdbuf(m_OldBuf);
-        }
-    }
-
-private:
-    CNcbiOstream*           m_Output;
-    CNcbiStreambuf*         m_OldBuf;
-    CNcbiStreambuf*         m_NewBuf;
-};
-
-
 inline bool s_ZeroTime(const tm& date)
 {
     static const tm kZeroTime = { 0 };
@@ -165,7 +92,9 @@ CCgiResponse::CCgiResponse(CNcbiOstream* os, int ofd)
       m_RequireWriteHeader(true),
       m_RequestMethod(CCgiRequest::eMethod_Other),
       m_Session(NULL),
-      m_DisableTrackingCookie(false)
+      m_DisableTrackingCookie(false),
+      m_Request(0),
+      m_ChunkedTransfer(false)
 {
     SetOutput(os ? os  : &NcbiCout,
               os ? ofd : STDOUT_FILENO  // "os" on this line is NOT a typo
@@ -228,7 +157,7 @@ void CCgiResponse::SetHeaderValue(const string& name, const string& value)
             m_HeaderValues[name] = value;
         }
         else {
-            NCBI_THROW(CCgiResponseException, eDoubleHeader,
+            NCBI_THROW(CCgiResponseException, eBadHeaderValue,
                        "CCgiResponse::SetHeaderValue() -- "
                        "invalid header name or value: " +
                        name + "=" + value);
@@ -378,7 +307,9 @@ CNcbiOstream& CCgiResponse::WriteHeader(CNcbiOstream& os) const
     // Default content type (if it's not specified by user already)
     switch (m_IsMultipart) {
     case eMultipart_none:
-        if ( !HaveHeaderValue(sm_ContentTypeName) ) {
+        if (!HaveHeaderValue(sm_ContentTypeName)  &&
+            // Do not set content type if status is '204 No Content'
+            CDiagContext::GetRequestContext().GetRequestStatus() != CRequestStatus::e204_NoContent) {
             os << sm_ContentTypeName << ": " << sm_ContentTypeDefault
                << HTTP_EOL;
         }
@@ -451,6 +382,22 @@ CNcbiOstream& CCgiResponse::WriteHeader(CNcbiOstream& os) const
         }
         os << i->first << ": " << i->second << HTTP_EOL;
     }
+    bool chunked_transfer = GetChunkedTransferEnabled();
+    if ( chunked_transfer ) {
+        // Chunked encoding must be the last one.
+        os << "Transfer-Encoding: chunked" << HTTP_EOL;
+        // Add Trailer if necessary.
+        if ( !m_TrailerValues.empty() ) {
+            string trailer;
+            ITERATE(TMap, it, m_TrailerValues) {
+                if ( !trailer.empty() ) {
+                    trailer.append(", ");
+                }
+                trailer.append(it->first);
+            }
+            os << "Trailer: " << trailer << HTTP_EOL;
+        }
+    }
 
     if (m_IsMultipart != eMultipart_none) { // proceed with first part
         os << HTTP_EOL << "--" << m_Boundary << HTTP_EOL;
@@ -474,19 +421,30 @@ CNcbiOstream& CCgiResponse::WriteHeader(CNcbiOstream& os) const
         os << m_JQuery_Callback << '(';
     }
 
-    if (m_RequestMethod == CCgiRequest::eMethod_HEAD  &&  &os == m_Output
-        &&  !m_OutputWrapper.get()) {
-        try {
-            m_OutputWrapper.reset(new CCgiStreamWrapper(m_Output));
-        }
-        catch (ios_base::failure&) {
+    CCgiStreamWrapper* wrapper = dynamic_cast<CCgiStreamWrapper*>(m_Output);
+    if ( wrapper ) {
+        if (m_RequestMethod == CCgiRequest::eMethod_HEAD  &&  &os == m_Output) {
+            try {
+                wrapper->SetWriterMode(CCgiStreamWrapper::eBlockWrites);
+            }
+            catch (ios_base::failure&) {
+            }
+            if ( m_ExceptionAfterHEAD.Get() ) {
+                // Optionally stop processing request immediately. The exception
+                // should not be handles by ProcessRequest, but must go up to
+                // the Run() to work correctly.
+                NCBI_CGI_THROW_WITH_STATUS(CCgiHeadException, eHeaderSent,
+                    "HEAD response sent.", CCgiException::e200_Ok);
+            }
         }
-        if ( m_ExceptionAfterHEAD.Get() ) {
-            // Optionally stop processing request immediately. The exception
-            // should not be handles by ProcessRequest, but must go up to
-            // the Run() to work correctly.
-            NCBI_CGI_THROW_WITH_STATUS(CCgiHeadException, eHeaderSent,
-                "HEAD response sent.", CCgiException::e200_Ok);
+        else if ( chunked_transfer ) {
+            // Chunked encoding is enabled either through the environment,
+            // or due to a header set by the user.
+            try {
+                wrapper->SetWriterMode(CCgiStreamWrapper::eChunkedWrites);
+            }
+            catch (ios_base::failure&) {
+            }
         }
     }
 
@@ -645,4 +603,156 @@ void CCgiResponse::SetRetryContext(const CRetryContext& ctx)
 }
 
 
+enum ECgiChunkedTransfer {
+    eChunked_Default,   // Use the hardcoded settings.
+    eChunked_Disable,   // Don't use chunked encoding.
+    eChunked_Enable     // Enable chunked encoding for HTTP/1.1.
+};
+
+NCBI_PARAM_ENUM_ARRAY(ECgiChunkedTransfer, CGI, ChunkedTransfer)
+{
+    {"Disable", eChunked_Disable},
+    {"Enable", eChunked_Enable},
+};
+
+NCBI_PARAM_ENUM_DECL(ECgiChunkedTransfer, CGI, ChunkedTransfer);
+NCBI_PARAM_ENUM_DEF_EX(ECgiChunkedTransfer, CGI, ChunkedTransfer, eChunked_Default,
+    eParam_NoThread, CGI_CHUNKED_TRANSFER);
+typedef NCBI_PARAM_TYPE(CGI, ChunkedTransfer) TCGI_ChunkedTransfer;
+
+NCBI_PARAM_DECL(size_t, CGI, ChunkSize);
+NCBI_PARAM_DEF_EX(size_t, CGI, ChunkSize, 4096,
+    eParam_NoThread, CGI_CHUNK_SIZE);
+typedef NCBI_PARAM_TYPE(CGI, ChunkSize) TCGI_ChunkSize;
+
+
+size_t CCgiResponse::GetChunkSize(void)
+{
+    return TCGI_ChunkSize::GetDefault();
+}
+
+
+bool CCgiResponse::x_ClientSupportsChunkedTransfer(const CNcbiEnvironment& env)
+{
+    // Auto-enable chunked output for HTTP/1.1.
+    const string& protocol = env.Get("SERVER_PROTOCOL");
+    return !protocol.empty()  &&  !NStr::StartsWith(protocol, "HTTP/1.0", NStr::eNocase);
+}
+
+
+bool CCgiResponse::GetChunkedTransferEnabled(void) const
+{
+    switch ( TCGI_ChunkedTransfer::GetDefault() ) {
+    case eChunked_Default:
+        if ( !m_ChunkedTransfer ) return false;
+        break;
+    case eChunked_Disable:
+        return false;
+    default:
+        break;
+    }
+    return m_Request  &&
+        x_ClientSupportsChunkedTransfer(m_Request->GetEnvironment());
+}
+
+
+void CCgiResponse::SetChunkedTransferEnabled(bool value)
+{
+    if ( m_HeaderWritten ) {
+        // Ignore attempts to enable chunked transfer if HTTP header
+        // have been written.
+        ERR_POST_X(6, "Attempt to enable chunked transfer after writing "
+            "HTTP header");
+        return;
+    }
+    m_ChunkedTransfer = value;
+}
+
+
+void CCgiResponse::FinishChunkedTransfer(void)
+{
+    CCgiStreamWrapper* wrapper = dynamic_cast<CCgiStreamWrapper*>(m_Output);
+    if (wrapper  &&  wrapper->GetWriterMode() == CCgiStreamWrapper::eChunkedWrites) {
+        // Reset wrapper mode to normal if it was chunked. This will write end chunk
+        // and trailer.
+        wrapper->FinishChunkedTransfer(&m_TrailerValues);
+        // Block writes.
+        wrapper->SetWriterMode(CCgiStreamWrapper::eBlockWrites);
+    }
+}
+
+
+void CCgiResponse::AbortChunkedTransfer(void)
+{
+    CCgiStreamWrapper* wrapper = dynamic_cast<CCgiStreamWrapper*>(m_Output);
+    if (wrapper  &&  wrapper->GetWriterMode() == CCgiStreamWrapper::eChunkedWrites) {
+        wrapper->AbortChunkedTransfer();
+    }
+}
+
+
+bool CCgiResponse::CanSendTrailer(void) const
+{
+    if (m_HeaderWritten  ||  !GetChunkedTransferEnabled()) return false;
+    if ( !m_TrailerEnabled.get() ) {
+        m_TrailerEnabled.reset(new bool(false));
+        const string& te = m_Request->GetRandomProperty("TE");
+        list<string> parts;
+        NStr::Split(te, " ,", parts, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
+        ITERATE(list<string>, it, parts) {
+            if (NStr::EqualNocase(*it, "trailers")) {
+                *m_TrailerEnabled = true;
+                break;
+            }
+        }
+    }
+    return *m_TrailerEnabled;
+}
+
+
+void CCgiResponse::AddTrailer(const string& name)
+{
+    if ( !CanSendTrailer() ) return;
+    m_TrailerValues[name] = "";
+}
+
+
+void CCgiResponse::RemoveTrailer(const string& name)
+{
+    m_TrailerValues.erase(name);
+}
+
+
+bool CCgiResponse::HaveTrailer(const string& name) const
+{
+    return m_TrailerValues.find(name) != m_TrailerValues.end();
+}
+
+
+string CCgiResponse::GetTrailerValue(const string &name) const
+{
+    TMap::const_iterator ptr = m_TrailerValues.find(name);
+    return (ptr == m_TrailerValues.end()) ? kEmptyStr : ptr->second;
+}
+
+
+void CCgiResponse::SetTrailerValue(const string& name, const string& value)
+{
+    if ( !HaveTrailer(name) ) {
+        ERR_POST_X(7, "Can not set trailer not announced in HTTP header: "
+            << name);
+        return;
+    }
+    if ( x_ValidateHeader(name, value) ) {
+        m_TrailerValues[name] = value;
+    }
+    else {
+        NCBI_THROW(CCgiResponseException, eBadHeaderValue,
+                    "CCgiResponse::SetTrailerValue() -- "
+                    "invalid trailer name or value: " +
+                    name + "=" + value);
+    }
+}
+
+
 END_NCBI_SCOPE
diff --git a/c++/src/cgi/ref_args.cpp b/c++/src/cgi/ref_args.cpp
index 4423a2c..dc2f8ef 100644
--- a/c++/src/cgi/ref_args.cpp
+++ b/c++/src/cgi/ref_args.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ref_args.cpp 180884 2010-01-13 19:54:31Z grichenk $
+/*  $Id: ref_args.cpp 486112 2015-12-01 17:18:30Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -73,7 +73,8 @@ void CRefArgs::AddDefinitions(const string& definitions)
 {
     typedef list<string> TDefList;
     TDefList defs;
-    NStr::Split(definitions, "\n", defs);
+    NStr::Split(definitions, "\n", defs,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(TDefList, def, defs) {
         string host, args;
         if ( NStr::SplitInTwo(*def, " ", host, args) ) {
@@ -88,7 +89,8 @@ void CRefArgs::AddDefinitions(const string& host_mask,
 {
     typedef list<string> TArgList;
     TArgList arg_list;
-    NStr::Split(arg_names, ",", arg_list);
+    NStr::Split(arg_names, ",", arg_list,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(TArgList, arg, arg_list) {
         m_HostMap.insert(
             THostMap::value_type(host_mask, NStr::TruncateSpaces(*arg)));
diff --git a/c++/src/cgi/user_agent.cpp b/c++/src/cgi/user_agent.cpp
index 60b99c6..f5c4af9 100644
--- a/c++/src/cgi/user_agent.cpp
+++ b/c++/src/cgi/user_agent.cpp
@@ -1,4 +1,4 @@
-/*  $Id: user_agent.cpp 466541 2015-05-04 14:38:31Z ivanov $
+/*  $Id: user_agent.cpp 485509 2015-11-23 14:51:37Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -323,26 +323,32 @@ bool CCgiUserAgent::x_CheckPattern(int /*EPattern*/ what,
     // External patterns
     if ( !external_patterns.empty() ) {
         if (external_patterns.find_first_of(kMultiLinePatternDelimiters) != NPOS) {
-            NStr::Split(external_patterns, kMultiLinePatternDelimiters, patterns);
+            NStr::Split(external_patterns, kMultiLinePatternDelimiters, patterns,
+                        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         } else {
-            NStr::Split(external_patterns, kSingleLinePatternDelimiters, patterns);
+            NStr::Split(external_patterns, kSingleLinePatternDelimiters, patterns,
+                        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         }
     }
     // User-defined patterns
     if (current_status) {
         if ( !exclude_patterns.empty() ) {
             if (external_patterns.find_first_of(kMultiLinePatternDelimiters) != NPOS) {
-                NStr::Split(USTR(exclude_patterns), kMultiLinePatternDelimiters, patterns);
+                NStr::Split(USTR(exclude_patterns), kMultiLinePatternDelimiters, patterns,
+                            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             } else {
-                NStr::Split(USTR(exclude_patterns), kSingleLinePatternDelimiters, patterns);
+                NStr::Split(USTR(exclude_patterns), kSingleLinePatternDelimiters, patterns,
+                            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             }
         }
     } else {
         if ( !include_patterns.empty() ) {
             if (external_patterns.find_first_of(kMultiLinePatternDelimiters) != NPOS) {
-                NStr::Split(USTR(include_patterns), kMultiLinePatternDelimiters, patterns);
+                NStr::Split(USTR(include_patterns), kMultiLinePatternDelimiters, patterns,
+                            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             } else {
-                NStr::Split(USTR(include_patterns), kSingleLinePatternDelimiters, patterns);
+                NStr::Split(USTR(include_patterns), kSingleLinePatternDelimiters, patterns,
+                            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             }
         }
     }
diff --git a/c++/src/connect/Makefile.connect.lib b/c++/src/connect/Makefile.connect.lib
index 0d49408..f943b2e 100644
--- a/c++/src/connect/Makefile.connect.lib
+++ b/c++/src/connect/Makefile.connect.lib
@@ -1,11 +1,12 @@
-# $Id: Makefile.connect.lib 466062 2015-04-28 18:05:57Z lavr $
+# $Id: Makefile.connect.lib 472369 2015-07-09 14:09:43Z elisovdn $
 
 SRC_C    = ncbi_ansi_ext ncbi_buffer ncbi_types ncbi_priv ncbi_core ncbi_util \
            ncbi_socket ncbi_connutil ncbi_connection ncbi_connector           \
            ncbi_socket_connector ncbi_file_connector ncbi_http_connector      \
            ncbi_memory_connector ncbi_heapmgr ncbi_server_info ncbi_service   \
            ncbi_host_info ncbi_dispd ncbi_service_connector ncbi_sendmail     \
-           ncbi_ftp_connector ncbi_lb ncbi_local ncbi_base64 ncbi_version
+           ncbi_ftp_connector ncbi_lb ncbi_local ncbi_base64 ncbi_version     \
+           ncbi_lbos
 
 SRC      = $(SRC_C)
 UNIX_SRC = $(LOCAL_LBSM)
@@ -17,4 +18,4 @@ LIBS     = $(NETWORK_LIBS) $(ORIG_C_LIBS)
 
 USES_LIBRARIES = $(NETWORK_LIBS) $(ORIG_LIBS)
 
-WATCHERS = lavr
+WATCHERS = lavr elisovdn
diff --git a/c++/src/connect/Makefile.connect.lib.unix b/c++/src/connect/Makefile.connect.lib.unix
index b391268..5183a51 100644
--- a/c++/src/connect/Makefile.connect.lib.unix
+++ b/c++/src/connect/Makefile.connect.lib.unix
@@ -1,27 +1,29 @@
-# $Id: Makefile.connect.lib.unix 468572 2015-05-26 16:26:11Z ucko $
+# $Id: Makefile.connect.lib.unix 486618 2015-12-08 03:51:15Z ucko $
 
 # Adjust ICC flags to avoid problematic references to
 # __intel_sse2_str* functions (as of ICC [20]13)
 
 ifeq "$(COMPILER)-$(DEBUG_SFX)$(DLL)" "icc-Release"
-  strcspn=ftp_connector http_connector lbsmd local server_info version
-  $(strcspn:%=ncbi_%.o): %.o: $(srcdir)/%.c
-	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) \
-	    -fno-builtin-strcspn -fno-builtin-strspn $< -o $@ $(CC_FILTER)
-
-  ncbi_ansi_ext.o: $(srcdir)/ncbi_ansi_ext.c
-	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-strncat $< -o $@ \
-	    $(CC_FILTER)
-
-  ncbi_connutil.o: $(srcdir)/ncbi_connutil.c
-	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-strcat \
-	    -fno-builtin-strcspn -fno-builtin-strspn $< -o $@ $(CC_FILTER)
-
-  ncbi_service.o: $(srcdir)/ncbi_service.c
-	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-strcat \
-            -fno-builtin-strpbrk $< -o $@ $(CC_FILTER)
-
-  ncbi_socket.o: $(srcdir)/ncbi_socket.c
-	$(CC_WRAPPER) $(CC) $(CFLAGS_ALL) -fno-builtin-strcat $< -o $@ \
-	    $(CC_FILTER)
+  ncbi_ansi_ext.o:       CFLAGS += -fno-builtin-strncat
+  ncbi_connutil.o:       CFLAGS += -fno-builtin-strcat -fno-builtin-strcpy \
+                                   -fno-builtin-strcspn -fno-builtin-strspn
+  ncbi_ftp_connector.o:  CFLAGS += -fno-builtin-strcpy -fno-builtin-strcspn \
+                                   -fno-builtin-strncmp -fno-builtin-strspn
+  ncbi_http_connector.o: CFLAGS += -fno-builtin-strcpy -fno-builtin-strcspn \
+                                   -fno-builtin-strspn
+  ncbi_lbos.o:           CFLAGS += -fno-builtin-strcat
+  ncbi_lbsm.o:           CFLAGS += -fno-builtin-strcpy
+  ncbi_lbsmd.o:          CFLAGS += -fno-builtin-strcspn -fno-builtin-strspn
+  ncbi_local.o:          CFLAGS += -fno-builtin-strcspn -fno-builtin-strspn
+  ncbi_sendmail.o:       CFLAGS += -fno-builtin-strcpy
+  ncbi_server_info.o:    CFLAGS += -fno-builtin-strcpy -fno-builtin-strcspn \
+                                   -fno-builtin-strspn
+  ncbi_service.o:        CFLAGS += -fno-builtin-strcat -fno-builtin-strcpy \
+                                   -fno-builtin-strpbrk
+  ncbi_service_connector.o: CFLAGS += -fno-builtin-strcpy -fno-builtin-strncmp
+  ncbi_socket.o:         CFLAGS += -fno-builtin-strcat -fno-builtin-strcpy
+  ncbi_socket_connector.o: CFLAGS += -fno-builtin-strcpy
+  ncbi_util.o:           CFLAGS += -fno-builtin-strncmp
+  ncbi_version.o:        CFLAGS += -fno-builtin-strcpy -fno-builtin-strcspn \
+                                   -fno-builtin-strspn
 endif
diff --git a/c++/src/connect/Makefile.xconnect.lib b/c++/src/connect/Makefile.xconnect.lib
index 25e35cd..07f6f97 100644
--- a/c++/src/connect/Makefile.xconnect.lib
+++ b/c++/src/connect/Makefile.xconnect.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.xconnect.lib 427428 2014-02-20 13:41:02Z gouriano $
+# $Id: Makefile.xconnect.lib 472369 2015-07-09 14:09:43Z elisovdn $
 #
 # XCONNECT -- includes:
 #    CONNECT API (C-only, sources shared with the C Toolkit), plus
@@ -16,7 +16,7 @@ PROJ_TAG = core
 
 LIBS = $(NETWORK_LIBS) $(ORIG_LIBS)
 
-WATCHERS = lavr
+WATCHERS = lavr elisovdn
 
 
 USES_LIBRARIES =  \
diff --git a/c++/src/connect/Makefile.xxconnect.lib b/c++/src/connect/Makefile.xxconnect.lib
index 5386611..372ee84 100644
--- a/c++/src/connect/Makefile.xxconnect.lib
+++ b/c++/src/connect/Makefile.xxconnect.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.xxconnect.lib 440221 2014-07-10 15:16:25Z gouriano $
+# $Id: Makefile.xxconnect.lib 478813 2015-09-14 15:54:56Z elisovdn $
 #
 # XXCONNECT -- includes C++-only part of connection library
 
@@ -6,7 +6,7 @@ SRC_CXX = ncbi_socket_cxx ncbi_core_cxx email_diag_handler \
           ncbi_conn_streambuf ncbi_conn_stream ncbi_conn_test \
           ncbi_misc ncbi_namedpipe ncbi_namedpipe_connector \
           ncbi_pipe ncbi_pipe_connector ncbi_conn_reader_writer \
-          ncbi_userhost ncbi_http_session
+          ncbi_userhost ncbi_http_session ncbi_lbos_cxx
 
 SRC      = $(SRC_CXX)
 
@@ -15,7 +15,7 @@ PROJ_TAG = core
 
 LIBS     = $(NETWORK_LIBS) $(ORIG_LIBS)
 
-WATCHERS = lavr
+WATCHERS = lavr elisovdn
 
 
 USES_LIBRARIES =  \
diff --git a/c++/src/connect/Makefile.xxconnect.lib.unix b/c++/src/connect/Makefile.xxconnect.lib.unix
index da44635..e247d17 100644
--- a/c++/src/connect/Makefile.xxconnect.lib.unix
+++ b/c++/src/connect/Makefile.xxconnect.lib.unix
@@ -1,6 +1,5 @@
-# $Id: Makefile.xxconnect.lib.unix 454221 2014-12-11 18:59:10Z ucko $
+# $Id: Makefile.xxconnect.lib.unix 486618 2015-12-08 03:51:15Z ucko $
 ifeq "$(COMPILER)-$(DEBUG_SFX)$(DLL)" "icc-Release"
-  ncbi_conn_stream.o: $(srcdir)/ncbi_conn_stream.cpp
-	$(CXX_WRAPPER) $(CXX) $(CXXFLAGS_ALL) -fno-builtin-strspn $< -o $@ \
-	    $(CXX_FILTER)
+  ncbi_conn_stream.o: CXXFLAGS += -fno-builtin-strspn
+  ncbi_conn_test.o:   CXXFLAGS += -fno-builtin-strcpy
 endif
diff --git a/c++/src/connect/ncbi_base64.c b/c++/src/connect/ncbi_base64.c
index c8efaec..6aeccc8 100644
--- a/c++/src/connect/ncbi_base64.c
+++ b/c++/src/connect/ncbi_base64.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_base64.c 394628 2013-04-04 15:46:39Z kazimird $
+/* $Id: ncbi_base64.c 488618 2016-01-04 12:52:59Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -79,7 +79,7 @@ extern void BASE64_Encode
         if (i >= src_size) {
             break;
         }
-        shift += 2;
+        shift = (unsigned char)(shift + 2);  // shift += 2;
         shift &= 7;
         temp = (c << (8 - shift)) & 0x3F;
         if (shift) {
@@ -129,11 +129,11 @@ extern int/*bool*/ BASE64_Decode
         if (c == '=') {
             c  = 64; /*end*/
         } else if (c >= 'A'  &&  c <= 'Z') {
-            c -= 'A';
+            c = (unsigned char)(c - 'A');         /* c -= 'A'; */
         } else if (c >= 'a'  &&  c <= 'z') {
-            c -= 'a' - 26;
+            c = (unsigned char)(c - ('a' - 26));  /* c -= 'a' - 26; */
         } else if (c >= '0'  &&  c <= '9') {
-            c -= '0' - 52;
+            c = (unsigned char)(c - ('0' - 52));  /* c -= '0' - 52; */
         } else if (c == '+') {
             c  = 62;
         } else if (c == '/') {
@@ -182,13 +182,13 @@ extern int/*bool*/ BASE64_Decode
             }
             switch (k) {
             case 0:
-                dst[j++] = (temp & 0xFF0000) >> 16;
+                dst[j++] = (unsigned char)((temp & 0xFF0000) >> 16);
                 /*FALLTHRU*/;
             case 4:
-                dst[j++] = (temp & 0xFF00) >> 8;
+                dst[j++] = (unsigned char)((temp & 0xFF00) >> 8);
                 /*FALLTHRU*/
             case 3:
-                dst[j++] = (temp & 0xFF);
+                dst[j++] = (unsigned char)(temp & 0xFF);
                 break;
             default:
                 break;
@@ -313,21 +313,21 @@ extern EBase64_Result base64url_decode(const void* src_buf, size_t src_size,
     while (src_size > 3) {
         XLAT_BASE64_CHAR(src_ch0);
         XLAT_BASE64_CHAR(src_ch1);
-        *dst++ = src_ch0 << 2 | src_ch1 >> 4;
+        *dst++ = (unsigned char)(src_ch0 << 2 | src_ch1 >> 4);
         XLAT_BASE64_CHAR(src_ch0);
-        *dst++ = src_ch1 << 4 | src_ch0 >> 2;
+        *dst++ = (unsigned char)(src_ch1 << 4 | src_ch0 >> 2);
         XLAT_BASE64_CHAR(src_ch1);
-        *dst++ = src_ch0 << 6 | src_ch1;
+        *dst++ = (unsigned char)(src_ch0 << 6 | src_ch1);
         src_size -= 4;
     }
 
     if (src_size > 1) {
         XLAT_BASE64_CHAR(src_ch0);
         XLAT_BASE64_CHAR(src_ch1);
-        *dst++ = src_ch0 << 2 | src_ch1 >> 4;
+        *dst++ = (unsigned char)(src_ch0 << 2 | src_ch1 >> 4);
         if (src_size > 2) {
             XLAT_BASE64_CHAR(src_ch0);
-            *dst = src_ch1 << 4 | src_ch0 >> 2;
+            *dst = (unsigned char)(src_ch1 << 4 | src_ch0 >> 2);
         }
     } else if (src_size == 1)
         return eBase64_InvalidInput;
diff --git a/c++/src/connect/ncbi_buffer.c b/c++/src/connect/ncbi_buffer.c
index c2de9c4..4c7161d 100644
--- a/c++/src/connect/ncbi_buffer.c
+++ b/c++/src/connect/ncbi_buffer.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_buffer.c 463881 2015-04-01 21:51:06Z lavr $
+/* $Id: ncbi_buffer.c 471594 2015-06-29 17:51:13Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -36,6 +36,10 @@
 #include <string.h>
 
 
+#define _BUF_ALIGN(a, b)  (((a) + ((b) - 1)) & ~((b) - 1))
+#define  BUF_ALIGN(s)     _BUF_ALIGN((s), sizeof(double))
+
+
 /* Buffer chunk
  */
 typedef struct SBufChunkTag {
@@ -60,6 +64,9 @@ struct SNcbiBuf {
 
 extern size_t BUF_SetChunkSize(BUF* buf, size_t chunk_size)
 {
+    assert(!(sizeof(double) & (sizeof(double) - 1)));
+    assert(!(BUF_ALIGN(BUF_DEF_CHUNK_SIZE) ^ BUF_DEF_CHUNK_SIZE));
+
     /* create buffer internals, if not created yet */
     if (!*buf) {
         if (!(*buf = (struct SNcbiBuf*) malloc(sizeof(**buf))))
@@ -69,7 +76,7 @@ extern size_t BUF_SetChunkSize(BUF* buf, size_t chunk_size)
     }
 
     /* and set the min. mem. chunk unit size */
-    (*buf)->unit = chunk_size ? chunk_size : BUF_DEF_CHUNK_SIZE;
+    (*buf)->unit = chunk_size ? BUF_ALIGN(chunk_size) : BUF_DEF_CHUNK_SIZE;
     return (*buf)->unit;
 }
 
@@ -96,17 +103,23 @@ extern size_t BUF_Size(BUF buf)
 }
 
 
-/* Create a new chunk.
- * Allocate at least "chunk_size" bytes, but no less than "data_size" bytes.
+/* Create a new buffer chunk.
+ * Allocate at least "unit_size" bytes, but no less than "data_size" bytes.
  * Special case: "data_size" == 0 results in no data storage allocation.
  */
-static SBufChunk* s_AllocChunk(size_t data_size, size_t chunk_size)
+static SBufChunk* s_AllocChunk(size_t data_size, size_t unit_size)
 {
-    size_t alloc_size = ((data_size + chunk_size - 1)
-                         / chunk_size) * chunk_size;
-    SBufChunk* chunk = (SBufChunk*) malloc(sizeof(*chunk) + alloc_size);
+    size_t chunk_size, alloc_size;
+    SBufChunk* chunk;
+    if (!data_size) {
+        chunk_size = sizeof(*chunk);
+        alloc_size = 0;
+    } else {
+        chunk_size = BUF_ALIGN(sizeof(*chunk));
+        alloc_size = ((data_size + unit_size - 1) / unit_size) * unit_size;
+    }
     assert(!data_size == !alloc_size);
-    if (!chunk)
+    if (!(chunk = (SBufChunk*) malloc(chunk_size + alloc_size)))
         return 0;
 
     /* NB: leave chunk->next uninited! */
@@ -114,7 +127,7 @@ static SBufChunk* s_AllocChunk(size_t data_size, size_t chunk_size)
     chunk->skip   = 0;
     chunk->size   = 0;
     chunk->base   = 0;
-    chunk->data   = alloc_size ? (char*) chunk + sizeof(*chunk) : 0;
+    chunk->data   = alloc_size ? (char*) chunk + chunk_size : 0;
     return chunk;
 }
 
diff --git a/c++/src/connect/ncbi_conn_stream.cpp b/c++/src/connect/ncbi_conn_stream.cpp
index 26b46be..428b6fe 100644
--- a/c++/src/connect/ncbi_conn_stream.cpp
+++ b/c++/src/connect/ncbi_conn_stream.cpp
@@ -1,4 +1,4 @@
-/* $Id: ncbi_conn_stream.cpp 465077 2015-04-16 17:34:16Z lavr $
+/* $Id: ncbi_conn_stream.cpp 500356 2016-05-04 09:48:20Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -99,6 +99,7 @@ CConn_IOStream::CConn_IOStream(CONN conn, bool close,
 
 CConn_IOStream::~CConn_IOStream()
 {
+    // Explicitly destroy so that the callbacks are not called out of context.
     x_Destroy();
 }
 
@@ -426,7 +427,7 @@ s_HttpConnectorBuilder(const SConnNetInfo* net_info,
                        const STimeout*     timeout)
 {
     size_t len;
-    AutoPtr<SConnNetInfo>
+    AutoPtr<SConnNetInfo, CDeleter<SConnNetInfo> >
         x_net_info(net_info
                    ? ConnNetInfo_Clone(net_info) : ConnNetInfo_Create(0));
     if (!x_net_info.get()) {
@@ -582,7 +583,7 @@ CConn_HttpStream::CConn_HttpStream(const string&       url,
                                             0,
                                             user_header.c_str(),
                                             this,
-                                            adjust ? x_Adjust  : 0,
+                                            adjust  ? x_Adjust  : 0,
                                             cleanup ? x_Cleanup : 0,
                                             x_ParseHeader,
                                             flags,
@@ -613,7 +614,7 @@ CConn_HttpStream::CConn_HttpStream(const SConnNetInfo* net_info,
                                             0,
                                             user_header.c_str(),
                                             this,
-                                            adjust ? x_Adjust  : 0,
+                                            adjust  ? x_Adjust  : 0,
                                             cleanup ? x_Cleanup : 0,
                                             x_ParseHeader,
                                             flags,
@@ -626,6 +627,12 @@ CConn_HttpStream::CConn_HttpStream(const SConnNetInfo* net_info,
 }
 
 
+CConn_HttpStream::~CConn_HttpStream()
+{
+    x_Destroy();
+}
+
+
 // NB: see CConn_ServiceStream::Fetch()
 EIO_Status CConn_HttpStream::Fetch(const STimeout* timeout)
 {
@@ -703,7 +710,7 @@ s_ServiceConnectorBuilder(const char*                           service,
                           FSERVICE_GetNextInfo                  get_next_info,
                           const STimeout*                       timeout)
 {
-    AutoPtr<SConnNetInfo>
+    AutoPtr<SConnNetInfo, CDeleter<SConnNetInfo> >
         x_net_info(net_info ?
                    ConnNetInfo_Clone(net_info) : ConnNetInfo_Create(service));
     if (!x_net_info.get()) {
@@ -796,6 +803,13 @@ CConn_ServiceStream::CConn_ServiceStream(const string&         service,
 }
 
 
+CConn_ServiceStream::~CConn_ServiceStream()
+{
+    // Explicitly destroy so that the callbacks are not called out of context.
+    x_Destroy();
+}
+
+
 // NB: see CConn_HttpStream::Fetch()
 EIO_Status CConn_ServiceStream::Fetch(const STimeout* timeout)
 {
@@ -1255,7 +1269,8 @@ CConn_IOStream* NcbiOpenURL(const string& url, size_t buf_size)
     }
     bool svc = s_IsIdentifier(url);
 
-    AutoPtr<SConnNetInfo> net_info = ConnNetInfo_Create(svc ? url.c_str() : 0);
+    AutoPtr<SConnNetInfo, CDeleter<SConnNetInfo> > net_info
+        (ConnNetInfo_Create(svc ? url.c_str() : 0));
 
     if (svc)
         return new CConn_ServiceStream(url, fSERV_Any, net_info.get());
diff --git a/c++/src/connect/ncbi_conn_test.cpp b/c++/src/connect/ncbi_conn_test.cpp
index ed588e6..6f0131b 100644
--- a/c++/src/connect/ncbi_conn_test.cpp
+++ b/c++/src/connect/ncbi_conn_test.cpp
@@ -1,4 +1,4 @@
-/* $Id: ncbi_conn_test.cpp 465077 2015-04-16 17:34:16Z lavr $
+/* $Id: ncbi_conn_test.cpp 484889 2015-11-16 21:56:43Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -611,7 +611,7 @@ EIO_Status CConnTest::x_GetFirewallConfiguration(const SConnNetInfo* net_info)
     while (fwdcgi.getline(line, sizeof(line))) {
         responded = true;
         CTempString hostport, state;
-        if (!NStr::SplitInTwo(line, "\t", hostport, state, NStr::eMergeDelims))
+        if (!NStr::SplitInTwo(line, "\t", hostport, state))
             continue;
         bool fb;
         if (NStr::Compare(state, 0, 3, "FB-") == 0) {
@@ -752,13 +752,21 @@ EIO_Status CConnTest::GetFWConnections(string* reason)
                 stable_sort(m_Fwd.begin(),   m_Fwd.end());
                 temp += NStr::UInt8ToString(m_Fwd.size());
             }
+            size_t down = 0;
             if (!m_FwdFB.empty()) {
                 stable_sort(m_FwdFB.begin(), m_FwdFB.end());
                 if (!m_Fwd.empty())
                     temp += " + ";
                 temp += NStr::UInt8ToString(m_FwdFB.size());
+                ITERATE(vector<CConnTest::CFWConnPoint>, cp, m_FwdFB) {
+                    if (cp->status != eIO_Success)
+                        ++down;
+                }
+                if (down)
+                    temp += " - " + NStr::UInt8ToString(down);
             }
-            temp += m_Fwd.size() + m_FwdFB.size() == 1 ? " port" : " ports";
+            temp +=
+                m_Fwd.size() + m_FwdFB.size() - down == 1 ? " port" : " ports";
         } else {
             status = eIO_Unknown;
             temp = "No connection ports found, please contact " + HELP_EMAIL;
@@ -1264,7 +1272,8 @@ void CConnTest::PreCheck(EStage/*stage*/, unsigned int/*step*/,
         return;
 
     list<string> stmt;
-    NStr::Split(title, "\n", stmt);
+    NStr::Split(title, "\n", stmt,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     SIZE_TYPE size = stmt.size();
     *m_Output << NcbiEndl << stmt.front() << '.';
     stmt.pop_front();
@@ -1303,7 +1312,8 @@ void CConnTest::PostCheck(EStage/*stage*/, unsigned int/*step*/,
         return;
 
     list<string> stmt;
-    NStr::Split(reason, "\n", stmt);
+    NStr::Split(reason, "\n", stmt,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ERASE_ITERATE(list<string>, str, stmt) {
         if (str->empty())
             stmt.erase(str);
diff --git a/c++/src/connect/ncbi_connection.c b/c++/src/connect/ncbi_connection.c
index 23f2dc4..3c1a31e 100644
--- a/c++/src/connect/ncbi_connection.c
+++ b/c++/src/connect/ncbi_connection.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_connection.c 463881 2015-04-01 21:51:06Z lavr $
+/* $Id: ncbi_connection.c 480536 2015-10-01 15:22:53Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -150,6 +150,8 @@ typedef struct SConnectionTag {
 
     BUF             buf;         /* storage for peek data                    */
 
+    void*           data;        /* user data pointer                        */
+
     /* "[o|r|w|c]_timeout" is either 0 (kInfiniteTimeout), kDefaultTimeout
        (to use connector-specific one), or points to "[oo|rr|ww|cc]_timeout" */
     const STimeout* o_timeout;   /* timeout on open                          */
@@ -441,7 +443,7 @@ extern EIO_Status CONN_ReInit
 {
     CONN_NOT_NULL(1, ReInit);
 
-    return x_ReInit(conn, connector, 0);
+    return x_ReInit(conn, connector, 0/*reinit*/);
 }
 
 
@@ -1105,9 +1107,10 @@ extern EIO_Status CONN_Close(CONN conn)
 
     CONN_NOT_NULL(27, Close);
 
-    status = x_ReInit(conn, 0, 1);
+    status = x_ReInit(conn, 0, 1/*close*/);
     BUF_Destroy(conn->buf);
     conn->magic = 0;
+    conn->data = 0;
     conn->buf = 0;
     free(conn);
     return status == eIO_Closed ? eIO_Success : status;
@@ -1195,3 +1198,23 @@ extern TCONN_Flags CONN_GetFlags(CONN conn)
 
     return conn ? conn->flags & ~fCONN_Flush : 0;
 }
+
+
+extern EIO_Status CONN_SetUserData(CONN conn, void* data)
+{
+    CONN_CALLTRACE(SetUserPtr);
+
+    if (!conn)
+        return eIO_InvalidArg;
+
+    conn->data = data;
+    return eIO_Success;
+}
+
+
+extern void* CONN_GetUserData(CONN conn)
+{
+    CONN_CALLTRACE(GetUserPtr);
+
+    return conn ? conn->data : 0;
+}
diff --git a/c++/src/connect/ncbi_connutil.c b/c++/src/connect/ncbi_connutil.c
index 49314c5..17875b1 100644
--- a/c++/src/connect/ncbi_connutil.c
+++ b/c++/src/connect/ncbi_connutil.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_connutil.c 468423 2015-05-22 16:08:55Z lavr $
+/* $Id: ncbi_connutil.c 488578 2016-01-01 00:35:35Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -125,10 +125,14 @@ static const char* x_GetValue(const char* service, const char* param,
             *s++ = '_';
         }
         memcpy(s, param, plen);
+        CORE_LOCK_READ;
         if ((val = getenv(strupr((char*) memcpy(temp, buf, len)))) != 0
             ||  (memcmp(temp, buf, len) != 0  &&  (val = getenv(buf)) != 0)) {
-            return strncpy0(value, val, value_size - 1);
+            strncpy0(value, val, value_size - 1);
+            CORE_UNLOCK;
+            return value;
         }
+        CORE_UNLOCK;
 
         /* Next, search for 'CONN_param' in '[service]' registry section */
         buf[slen++] = '\0';
@@ -158,8 +162,13 @@ static const char* x_GetValue(const char* service, const char* param,
 
     *generic = 1/*true*/;
     /* Environment search for 'CONN_param' */
-    if ((val = getenv(s)) != 0)
-        return strncpy0(value, val, value_size - 1);
+    CORE_LOCK_READ;
+    if ((val = getenv(s)) != 0) {
+        strncpy0(value, val, value_size - 1);
+        CORE_UNLOCK;
+        return value;
+    }
+    CORE_UNLOCK;
 
     /* Last resort: Search for 'param' in default registry section */
     s += sizeof(DEF_CONN_REG_SECTION);
@@ -1124,15 +1133,15 @@ extern SConnNetInfo* ConnNetInfo_Clone(const SConnNetInfo* info)
     x_info->http_referer = 0;
 
     if (info->timeout) {
-        x_info->tmo = *info->timeout;
+        x_info->tmo     = *info->timeout;
         x_info->timeout = &x_info->tmo;
     }
-    if (info->http_user_header
+    if (info->http_user_header  &&  *info->http_user_header
         &&  !(x_info->http_user_header = strdup(info->http_user_header))) {
         ConnNetInfo_Destroy(x_info);
         return 0;
     }
-    if (x_info->http_referer
+    if (info->http_referer  &&  *info->http_referer
         &&  !(x_info->http_referer = strdup(info->http_referer))) {
         ConnNetInfo_Destroy(x_info);
         return 0;
@@ -1167,6 +1176,8 @@ static const char* x_ReqMethod(TReqMethod req_method, char buf[])
         return v1 ? "CONNECT/1.1" : "CONNECT";
     case eReqMethod_Put:
         return "PUT";
+    case eReqMethod_Patch:
+        return "PATCH";
     case eReqMethod_Trace:
         return "TRACE";
     case eReqMethod_Delete:
@@ -1854,8 +1865,8 @@ static EIO_Status s_StripToPattern
                     if (memcmp(b, pattern, pattern_size) == 0)
                         break; /*found*/
                 }
-                /* pattern found */
                 if ( n_check ) {
+                    /* pattern found */
                     size_t x_discarded = (size_t)(b - buf) + pattern_size;
                     if ( discard )
                         BUF_Write(discard, buf + n_read, x_discarded - n_read);
diff --git a/c++/src/connect/ncbi_core.c b/c++/src/connect/ncbi_core.c
index 17e932b..05697a5 100644
--- a/c++/src/connect/ncbi_core.c
+++ b/c++/src/connect/ncbi_core.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_core.c 424634 2014-01-17 18:57:34Z lavr $
+/* $Id: ncbi_core.c 491622 2016-02-08 14:51:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,6 +34,10 @@
 #include "ncbi_priv.h"
 #include <stdlib.h>
 
+#ifdef NCBI_OS_UNIX
+#  include <unistd.h>
+#endif /*NCBI_OS_UNIX*/
+
 #if defined(NCBI_CXX_TOOLKIT)  &&  defined(_MT)  &&  !defined(NCBI_WITHOUT_MT)
 #  if defined(NCBI_OS_MSWIN)
 #    define WIN32_LEAN_AND_MEAN
@@ -374,7 +378,8 @@ extern void LOG_WriteInternal
     /* unconditional exit/abort on fatal error */
     if (call_data->level == eLOG_Fatal) {
 #ifdef NDEBUG
-        exit(1);
+        fflush(0);
+        _exit(255);
 #else
         abort();
 #endif /*NDEBUG*/
diff --git a/c++/src/connect/ncbi_core_cxx.cpp b/c++/src/connect/ncbi_core_cxx.cpp
index b59835f..0022b90 100644
--- a/c++/src/connect/ncbi_core_cxx.cpp
+++ b/c++/src/connect/ncbi_core_cxx.cpp
@@ -1,4 +1,4 @@
-/* $Id: ncbi_core_cxx.cpp 451104 2014-11-03 19:33:10Z grichenk $
+/* $Id: ncbi_core_cxx.cpp 488838 2016-01-06 13:45:11Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,10 +77,17 @@ static int s_REG_Set(void* user_data,
 {
     int result = 0;
     try {
-        result = static_cast<IRWRegistry*> (user_data)->
-            Set(section, name, value ? string(value) : kEmptyStr,
-                (storage == eREG_Persistent ? CNcbiRegistry::ePersistent : 0) |
-                CNcbiRegistry::eOverride | CNcbiRegistry::eTruncate);
+        IRWRegistry* reg = static_cast<IRWRegistry*> (user_data);
+        result = value
+            ? reg->Set  (section, name, value, 
+                         (storage == eREG_Persistent
+                          ? CNcbiRegistry::fPersistent
+                          | CNcbiRegistry::fTruncate
+                          : CNcbiRegistry::fTruncate))
+            : reg->Unset(section, name,
+                         (storage == eREG_Persistent
+                          ? CNcbiRegistry::fPersistent
+                          : CNcbiRegistry::fTransient));
     }
     NCBI_CATCH_ALL_X(2, "s_REG_Set() failed");
     return result;
@@ -290,6 +297,20 @@ static char* s_GetRequestID(ENcbiRequestID reqid)
 
 
 /***********************************************************************
+ *                          NCBI Request DTab                          *
+ ***********************************************************************/
+extern "C" {
+static const char* s_GetRequestDTab(void)
+{
+    if (!CDiagContext::GetRequestContext().IsSetDtab()) {
+        CDiagContext::GetRequestContext().SetDtab("");
+    }
+    return CDiagContext::GetRequestContext().GetDtab().c_str();
+}
+}
+
+
+/***********************************************************************
  *                                 Init                                *
  ***********************************************************************/
 
@@ -327,6 +348,9 @@ static void s_Init(IRWRegistry*      reg  = 0,
     /* setup app name retrieval callback */
     g_CORE_GetAppName = s_GetAppName;
 
+    /* setup DTab-Local retrieval */
+    g_CORE_GetRequestDtab = s_GetRequestDTab;
+    
     /* done! */
     s_ConnectInit = how;
 }
diff --git a/c++/src/connect/ncbi_dispd.c b/c++/src/connect/ncbi_dispd.c
index d72cac6..f8c01fe 100644
--- a/c++/src/connect/ncbi_dispd.c
+++ b/c++/src/connect/ncbi_dispd.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_dispd.c 451391 2014-11-06 15:31:05Z lavr $
+/* $Id: ncbi_dispd.c 482179 2015-10-21 15:02:35Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -56,14 +56,14 @@
 #ifdef __cplusplus
 extern "C" {
 #endif /*__cplusplus*/
-    static SSERV_Info* s_GetNextInfo(SERV_ITER, HOST_INFO*);
-    static int/*bool*/ s_Update     (SERV_ITER, const char*, int);
-    static void        s_Reset      (SERV_ITER);
-    static void        s_Close      (SERV_ITER);
-
-    static const SSERV_VTable s_op = {
-        s_GetNextInfo, 0/*Feedback*/, s_Update, s_Reset, s_Close, "DISPD"
-    };
+static SSERV_Info* s_GetNextInfo(SERV_ITER, HOST_INFO*);
+static int/*bool*/ s_Update     (SERV_ITER, const char*, int);
+static void        s_Reset      (SERV_ITER);
+static void        s_Close      (SERV_ITER);
+
+static const SSERV_VTable s_op = {
+    s_GetNextInfo, 0/*Feedback*/, s_Update, s_Reset, s_Close, "DISPD"
+};
 #ifdef __cplusplus
 } /* extern "C" */
 #endif /*__cplusplus*/
@@ -304,7 +304,6 @@ static int/*bool*/ s_IsUpdateNeeded(TNCBI_Time now, struct SDISPD_Data *data)
             }
         }
     }
-
     return total == 0.0 ? 1 : status/total < DISPD_STALE_RATIO_OK;
 }
 
diff --git a/c++/src/connect/ncbi_gnutls.c b/c++/src/connect/ncbi_gnutls.c
index af791ec..2d32bbf 100644
--- a/c++/src/connect/ncbi_gnutls.c
+++ b/c++/src/connect/ncbi_gnutls.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_gnutls.c 474202 2015-07-27 15:06:58Z ivanov $
+/* $Id: ncbi_gnutls.c 500354 2016-05-04 09:47:08Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -361,6 +361,8 @@ static EIO_Status s_GnuTlsOpen(void* session, int* error, char** desc)
     EIO_Status status;
     int x_error;
 
+    *desc = 0;
+
     do {
         x_error = gnutls_handshake((gnutls_session_t) session);
     } while (x_error  &&  x_error == GNUTLS_E_REHANDSHAKE);
@@ -369,12 +371,13 @@ static EIO_Status s_GnuTlsOpen(void* session, int* error, char** desc)
         status = x_ErrorToStatus(&x_error,
                                  (gnutls_session_t) session, eIO_Open);
         *error = x_error;
-        *desc = 0;
     } else {
-#  if LIBGNUTLS_VERSION_NUMBER < 0x030110
-        *desc = 0;
-#  else
-        *desc = gnutls_session_get_desc(session);
+#  if LIBGNUTLS_VERSION_NUMBER >= 0x030110
+        char* temp = gnutls_session_get_desc(session);
+        if (temp) {
+            *desc = strdup(temp);
+            gnutls_free(temp);
+        }
 #  endif /*LIBGNUTLS_VERSION_NUMBER<3.1.10*/
         status = eIO_Success;
     }
@@ -415,8 +418,9 @@ static ssize_t x_GnuTlsPull(gnutls_transport_ptr_t ptr,
         size_t x_read = 0;
         status = pull(sock, buf, size, &x_read, x_IfToLog());
         if (x_read > 0  ||  status == eIO_Success/*&& x_read==0*/) {
-            x_set_errno((gnutls_session_t) sock->session, 0);
+            assert(status == eIO_Success);
             assert(x_read <= size);
+            x_set_errno((gnutls_session_t) sock->session, 0);
             return x_read;
         }
     } else
@@ -445,8 +449,9 @@ static ssize_t x_GnuTlsPush(gnutls_transport_ptr_t ptr,
             if (!x_written) {
                 assert(!size  ||  status != eIO_Success);
                 if (size  ||  status != eIO_Success)
-                    goto err;
+                    goto out;
             } else {
+                assert(status == eIO_Success);
                 assert(x_written <= size);
                 n_written += x_written;
                 size      -= x_written;
@@ -458,7 +463,7 @@ static ssize_t x_GnuTlsPush(gnutls_transport_ptr_t ptr,
     } else
         status = eIO_NotSupported;
 
- err:
+ out:
     x_error = x_StatusToError(status, sock, eIO_Write);
     if (x_error)
         x_set_errno((gnutls_session_t) sock->session, x_error);
@@ -475,6 +480,7 @@ static EIO_Status s_GnuTlsRead(void* session, void* buf, size_t n_todo,
     assert(session);
 
     x_read = gnutls_record_recv((gnutls_session_t) session, buf, n_todo);
+    assert(x_read < 0  ||  x_read <= n_todo);
 
     if (x_read <= 0) {
         status = x_ErrorToStatus(&x_read,
@@ -489,7 +495,7 @@ static EIO_Status s_GnuTlsRead(void* session, void* buf, size_t n_todo,
 }
 
 
-static EIO_Status s_GnuTlsWrite(void* session, const void* data, size_t n_todo,
+static EIO_Status x_GnuTlsWrite(void* session, const void* data, size_t n_todo,
                                 size_t* n_done, int* error)
 {
     EIO_Status status;
@@ -498,6 +504,7 @@ static EIO_Status s_GnuTlsWrite(void* session, const void* data, size_t n_todo,
     assert(session);
 
     x_written = gnutls_record_send((gnutls_session_t) session, data, n_todo);
+    assert(x_written < 0  ||  x_written <= n_todo);
 
     if (x_written <= 0) {
         status = x_ErrorToStatus(&x_written,
@@ -512,6 +519,34 @@ static EIO_Status s_GnuTlsWrite(void* session, const void* data, size_t n_todo,
 }
 
 
+static EIO_Status s_GnuTlsWrite(void* session, const void* data, size_t n_todo,
+                                size_t* n_done, int* error)
+{
+    size_t max_size = gnutls_record_get_max_size((gnutls_session_t) session);
+    EIO_Status status;
+
+    *n_done = 0;
+
+    do {
+        size_t x_todo = n_todo > max_size ? max_size : n_todo;
+        size_t x_done;
+        status = x_GnuTlsWrite(session, data, x_todo, &x_done, error);
+        assert((status == eIO_Success) == (x_done > 0));
+        assert(status == eIO_Success  ||  *error);
+        assert(x_done <= x_todo);
+        if (status != eIO_Success)
+            break;
+        *n_done += x_done;
+        if (x_todo != x_done)
+            break;
+        n_todo  -= x_done;
+        data     = (const char*) data + x_done;
+    } while (n_todo);
+
+    return *n_done ? eIO_Success : status;
+}
+
+
 static EIO_Status s_GnuTlsClose(void* session, int how, int* error)
 {
     int x_error;
@@ -559,10 +594,12 @@ static EIO_Status s_GnuTlsInit(FSSLPull pull, FSSLPush push)
     }
 
     val = ConnNetInfo_GetValue(0, "GNUTLS_LOGLEVEL", buf, sizeof(buf), 0);
+    CORE_LOCK_READ;
     if (!val  ||  !*val)
         val = getenv("GNUTLS_DEBUG_LEVEL");
     if (val  &&  *val) {
         s_GnuTlsLogLevel = atoi(val);
+        CORE_UNLOCK;
         if (s_GnuTlsLogLevel) {
             gnutls_global_set_log_function(x_GnuTlsLogger);
             if (val != buf)
@@ -570,15 +607,16 @@ static EIO_Status s_GnuTlsInit(FSSLPull pull, FSSLPush push)
             CORE_LOGF(eLOG_Note, ("GNUTLS V%s (Loglevel=%d)",
                                   version, s_GnuTlsLogLevel));
         }
-    }
+    } else
+        CORE_UNLOCK;
 
 #  ifdef HAVE_LIBGCRYPT
 #    if   defined(NCBI_POSIX_THREADS)
     if (gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread) != 0)
-        goto errout;
+        goto out;
 #    elif defined(NCBI_THREADS)
     if (gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_user) != 0)
-        goto errout;
+        goto out;
 #    elif defined(_MT)
     CORE_LOG(eLOG_Critical,"LIBGCRYPT uninitialized: Unknown threading model");
 #    endif /*NCBI_POSIX_THREADS*/
@@ -586,16 +624,16 @@ static EIO_Status s_GnuTlsInit(FSSLPull pull, FSSLPush push)
 
     if (!pull  ||  !push  ||  !gnutls_check_version(LIBGNUTLS_VERSION)
         ||  gnutls_global_init() != GNUTLS_E_SUCCESS/*0*/) {
-        goto errout;
+        goto out;
     }
     if (gnutls_anon_allocate_client_credentials(&acred) != 0) {
         gnutls_global_deinit();
-        goto errout;
+        goto out;
     }
     if (gnutls_certificate_allocate_credentials(&xcred) != 0) {
         gnutls_anon_free_client_credentials(acred);
         gnutls_global_deinit();
-        goto errout;
+        goto out;
     }
 
     s_GnuTlsCredAnon = acred;
@@ -605,7 +643,7 @@ static EIO_Status s_GnuTlsInit(FSSLPull pull, FSSLPush push)
 
     return eIO_Success;
 
- errout:
+ out:
     gnutls_global_set_log_level(s_GnuTlsLogLevel = 0);
     gnutls_global_set_log_function(0);
     return eIO_NotSupported;
diff --git a/c++/src/connect/ncbi_http_connector.c b/c++/src/connect/ncbi_http_connector.c
index b331421..69af0b7 100644
--- a/c++/src/connect/ncbi_http_connector.c
+++ b/c++/src/connect/ncbi_http_connector.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_http_connector.c 468415 2015-05-22 15:38:30Z lavr $
+/* $Id: ncbi_http_connector.c 500357 2016-05-04 09:48:45Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -50,16 +50,18 @@
  ***********************************************************************/
 
 
-/* "READ" mode states, see table below
+/* Connection states, see table below
  */
-enum EReadState {
-    eRS_WriteRequest = 0,
-    eRS_ReadHeader   = 1,
-    eRS_ReadBody     = 2,
-    eRS_DoneBody     = 3, /* NB: |eRS_ReadBody */
-    eRS_DropBody     = 7  /* NB: |eRS_DoneBody */
+enum EConnState {
+    eCS_WriteRequest =   0,
+    eCS_FlushRequest =   1,
+    eCS_ReadHeader   =   2,
+    eCS_ReadBody     =   4,
+    eCS_DoneBody     =   5,  /* NB: |eCS_ReadBody */
+    eCS_Discard      =   7,  /* NB: |eCS_DoneBody */
+    eCS_Eom          = 0xF   /* NB: |eCS_Discard  */
 };
-typedef unsigned       EBReadState;  /* packed EReadState */
+typedef unsigned       EBConnState;   /* packed EConnState */
 
 
 /* Whether the connector is allowed to connect
@@ -67,29 +69,30 @@ typedef unsigned       EBReadState;  /* packed EReadState */
  */
 enum ECanConnect {
     fCC_None,      /* 0   */
-    fCC_Once,      /* 1   */
+    fCC_Once,      /*   1 */
     fCC_Unlimited  /* 0|2 */
 };
 typedef unsigned       EBCanConnect;  /* packed ECanConnect */
 
 typedef unsigned short TBHTTP_Flags;  /* packed THTTP_Flags */
 
+typedef unsigned       EBSwitch;      /* packed ESwitch     */
 
 typedef enum {
-    eEM_Drop,  /* 0   */
+    eEM_Drop,  /*   0 */
     eEM_Wait,  /* 1   */
-    eEM_Read,  /* 2   */
+    eEM_Read,  /*   2 */
     eEM_Flush  /* 1|2 */
 } EExtractMode;
 
 
 typedef enum {
-    eRetry_None = 0,              /* 0   */
-    eRetry_Unused = 1,            /* yet */
-    eRetry_Redirect = 2,          /* 2   */
-    eRetry_Redirect303 = 3,       /* 2|1 */
-    eRetry_Authenticate = 4,      /* 4   */
-    eRetry_ProxyAuthenticate = 5  /* 4|1 */
+    eRetry_None              = 0,  /* 0   */
+    eRetry_Unused            = 1,  /* yet */
+    eRetry_Redirect          = 2,  /* 2   */
+    eRetry_Redirect303       = 3,  /* 2|1 */
+    eRetry_Authenticate      = 4,  /* 4   */
+    eRetry_ProxyAuthenticate = 5   /* 4|1 */
 } ERetry;
 
 typedef struct {
@@ -98,35 +101,41 @@ typedef struct {
 } SRetry;
 
 
-/* All internal data necessary to perform the (re)connect and I/O
+/* All internal data necessary to perform the (re)connect and I/O:
  *
- * WRITE:  sock == NULL  AND  (can_connect & fCC_Once)  [store data in w_buf]
- * READ:   otherwise                         [read from either sock or r_buf]
+ * IDLE:  sock == NULL  AND  (can_connect & fCC_Once)  [store data in w_buf]
+ * CONN:  otherwise                         [read from either sock or r_buf]
  *
- * The following states are defined in READ mode when sock != NULL:
+ * The following connection states are defined (sock != NULL):
  * --------------+--------------------------------------------------
  *  WriteRequest | HTTP request body is being written
+ *  FlushRequest | HTTP request is being completed and flushed out
  *   ReadHeader  | HTTP response header is being read
  *    ReadBody   | HTTP response body is being read
- *    DoneBody   | HTTP body is finishing (EOF seen)
+ *    DoneBody   | HTTP body is all read out of the connection
+ *    Discard    | HTTP data (if any) to be discarded
+ *      Eom      | HTTP connection is closing
  * --------------+--------------------------------------------------
- * When sock == NULL, ReadBody is assumed until there's data in r_buf.
  */
 typedef struct {
     SConnNetInfo*     net_info;       /* network configuration parameters    */
+    FHTTP_ParseHeader parse_header;   /* callback to parse HTTP reply header */
     void*             user_data;      /* user data handle for callbacks (CB) */
     FHTTP_Adjust      adjust;         /* on-the-fly net_info adjustment CB   */
     FHTTP_Cleanup     cleanup;        /* cleanup callback                    */
-    FHTTP_ParseHeader parse_header;   /* callback to parse HTTP reply header */
 
     TBHTTP_Flags      flags;          /* as passed to constructor            */
-    unsigned          error_header:1; /* only err.HTTP header on SOME debug  */
+    EBSwitch          unsafe_redir:2; /* if unsafe redirects are allowed     */
+    EBSwitch          error_header:2; /* only err.HTTP header on SOME debug  */
     EBCanConnect      can_connect:2;  /* whether more connections permitted  */
-    EBReadState       read_state:3;   /* "READ" mode state per table above   */
+    EBConnState       conn_state:4;   /* connection state per table above    */
     unsigned          auth_done:1;    /* website authorization sent          */
     unsigned    proxy_auth_done:1;    /* proxy authorization sent            */
     unsigned          skip_host:1;    /* do *not* add the "Host:" header tag */
-    unsigned          reserved:4;     /* MBZ                                 */
+    unsigned          keepalive:1;    /* connection keep-alive               */
+    unsigned          chunked:1;      /* if writing/reading chunked, HTTP/1.1*/
+    unsigned          entity:1;       /* if there's entity payload (body)/1.1*/
+    unsigned          unused:5;
     unsigned          minor_fault:3;  /* incr each minor failure since majo  */
     unsigned short    major_fault;    /* incr each major failure since open  */
     unsigned short    http_code;      /* last http code response             */
@@ -142,7 +151,7 @@ typedef struct {
     BUF               w_buf;          /* storage to accumulate output data   */
     size_t            w_len;          /* pending message body size           */
 
-    TNCBI_BigCount    expected;       /* expected to receive before EOF      */
+    TNCBI_BigCount    expected;       /* expected to receive before end/EOF  */
     TNCBI_BigCount    received;       /* actually received so far            */
 } SHttpConnector;
 
@@ -226,18 +235,41 @@ static int/*tri-state*/ x_Authenticate(SHttpConnector* uuu,
 }
 
 
+static int/*bool*/ x_UnsafeRedirectOK(SHttpConnector* uuu)
+{
+    if (uuu->unsafe_redir == eDefault) {
+        if (!(uuu->flags & fHTTP_UnsafeRedirects)) {
+            char val[32];
+            ConnNetInfo_GetValue(0, "HTTP_UNSAFE_REDIRECTS",
+                                 val, sizeof(val), 0);
+            uuu->unsafe_redir = ConnNetInfo_Boolean(val) ? eOn : eOff;
+        } else
+            uuu->unsafe_redir = eOn;
+    }
+    return uuu->unsafe_redir == eOn ? 1/*true*/ : 0/*false*/;
+}
+
+
+#ifdef __GNUC__
+inline
+#endif /*__GNUC__*/
+static int/*bool*/ x_IsWriteThru(const SHttpConnector* uuu)
+{
+    return uuu->net_info->version  &&  (uuu->flags & fHTTP_WriteThru)
+        ? 1/*true*/ : 0/*false*/;
+}
+
+
 /* -1=prohibited;  0=okay;  1=failure */
 static int/*bool tri-state inverted*/ x_RetryAuth(SHttpConnector* uuu,
                                                   const SRetry*   retry)
 {
     int result;
 
-    assert(retry  &&  retry->data);
-    assert(strncasecmp(retry->data, "basic", strcspn(retry->data," \t")) == 0);
     switch (retry->mode) {
     case eRetry_Authenticate:
         if (uuu->net_info->scheme != eURL_Https
-            &&  !(uuu->flags & fHTTP_InsecureRedirect)) {
+            &&  !x_UnsafeRedirectOK(uuu)) {
             return -1/*prohibited*/;
         }
         break;
@@ -283,14 +315,17 @@ static EIO_Status s_Adjust(SHttpConnector* uuu,
         int   fail = 0;
         switch (retry->mode) {
         case eRetry_Redirect:
+            if (uuu->entity)
+                fail = -2;
+            /*FALLTHRU*/
         case eRetry_Redirect303:
-            if (uuu->net_info->req_method == eReqMethod_Connect)
+            if (!fail &&  uuu->net_info->req_method == eReqMethod_Connect)
                 fail = 2;
-            else if (retry->data  &&  *retry->data != '?') {
+            else if (!fail  &&  retry->data  &&  *retry->data != '?') {
                 if (uuu->net_info->req_method != eReqMethod_Post
                     ||  retry->mode == eRetry_Redirect303
-                    ||  (uuu->flags & fHTTP_InsecureRedirect)
-                    ||  !BUF_Size(uuu->w_buf)) {
+                    ||  x_UnsafeRedirectOK(uuu)
+                    ||  !(x_IsWriteThru(uuu)  ||  BUF_Size(uuu->w_buf))) {
                     char           host[sizeof(uuu->net_info->host)];
                     unsigned short port =      uuu->net_info->port;
                     strcpy(host, uuu->net_info->host);
@@ -300,7 +335,7 @@ static EIO_Status s_Adjust(SHttpConnector* uuu,
                     fail = !ConnNetInfo_ParseURL(uuu->net_info, retry->data);
                     if (!fail) {
                         if (secure  &&  uuu->net_info->scheme != eURL_Https
-                            &&  !(uuu->flags & fHTTP_InsecureRedirect)) {
+                            &&  !x_UnsafeRedirectOK(uuu)) {
                             fail = -1;
                         } else {
                             if (port !=    uuu->net_info->port  ||
@@ -308,11 +343,15 @@ static EIO_Status s_Adjust(SHttpConnector* uuu,
                                 /* drop the flag on host / port replaced */
                                 uuu->skip_host = 0/*false*/;
                             }
-                            if (uuu->net_info->req_method == eReqMethod_Post
-                                &&  retry->mode == eRetry_Redirect303) {
-                                uuu->net_info->req_method  = eReqMethod_Get;
+                            if (retry->mode == eRetry_Redirect303) {
+                                if (uuu->net_info->req_method ==
+                                    eReqMethod_Post) {
+                                    uuu->net_info->req_method  =
+                                    eReqMethod_Get;
+                                } else
+                                    fail = -2;
                             }
-                            if ((uuu->flags & fHTTP_AdjustOnRedirect)
+                            if (!fail && (uuu->flags & fHTTP_AdjustOnRedirect)
                                 &&   uuu->adjust
                                 &&  !uuu->adjust(uuu->net_info,
                                                  uuu->user_data, 0)) {
@@ -321,19 +360,20 @@ static EIO_Status s_Adjust(SHttpConnector* uuu,
                         }
                     }
                 } else
-                    fail = -1;
-            } else
+                    fail = -1 - x_IsWriteThru(uuu);
+            } else if (!fail)
                 fail = 1;
             if (fail) {
                 CORE_LOGF_X(2, eLOG_Error,
                             ("[HTTP%s%s]  %s %s%s to %s%s%s",
                              url ? "; " : "",
                              url ? url  : "",
-                             fail < 0 ? "Prohibited" :
-                             fail > 1 ? "Spurious tunnel" : "Cannot",
-                             fail < 0  &&  secure ? "insecure " : "",
-                             retry->mode == eRetry_Redirect303
-                             ? "submission" : "redirect",
+                             fail < -1 ? "Invalid" :
+                             fail <  0 ? "Prohibited" :
+                             fail >  1 ? "Spurious tunnel" : "Cannot",
+                             fail == -1  &&  secure ? "insecure " : "",
+                             fail > 1  ||  retry->mode != eRetry_Redirect303
+                             ? "redirect" : "submission",
                              retry->data ? "\""        : "<",
                              retry->data ? retry->data : "NULL",
                              retry->data ? "\""        : ">"));
@@ -351,13 +391,18 @@ static EIO_Status s_Adjust(SHttpConnector* uuu,
             break;
         case eRetry_Authenticate:
             if (uuu->net_info->req_method == eReqMethod_Connect)
-                fail = 2;
+                fail = 3;
             /*FALLTHRU*/
         case eRetry_ProxyAuthenticate:
             if (!fail) {
-                fail =
-                    retry->data  &&  strncasecmp(retry->data, "basic ", 6) == 0
-                    ? x_RetryAuth(uuu, retry) : -2;
+                if (!retry->data
+                    ||  strncasecmp(retry->data, "basic",
+                                    strcspn(retry->data, " \t")) != 0) {
+                    fail = -2;
+                } else if (!(fail = x_RetryAuth(uuu, retry))
+                           &&  x_IsWriteThru(uuu)) {
+                    fail =  2;
+                }
             }
             if (fail) {
                 CORE_LOGF_X(3, eLOG_Error,
@@ -366,9 +411,10 @@ static EIO_Status s_Adjust(SHttpConnector* uuu,
                              url ? url  : "",
                              retry->mode == eRetry_Authenticate
                              ? "Authorization" : "Proxy authorization",
-                             fail >  1 ? "not allowed with CONNECT" :
+                             fail >  2 ? "not allowed with CONNECT" :
                              fail < -1 ? "not implemented" :
-                             fail >  0 ? "failed" : "prohibited",
+                             fail >  1 ? "must be pushed with write-through" :
+                             fail <  0 ? "prohibited" : "failed",
                              "(["[!retry->data],
                              retry->data ? retry->data : "NULL",
                              ")]"[!retry->data]));
@@ -420,7 +466,7 @@ static EIO_Status s_Adjust(SHttpConnector* uuu,
 }
 
 
-static char* s_HostPort(size_t reserve, const char* host, unsigned short xport)
+static char* x_HostPort(size_t reserve, const char* host, unsigned short xport)
 {
     size_t hostlen = strlen(host), portlen;
     char*  hostport, port[16];
@@ -440,12 +486,12 @@ static char* s_HostPort(size_t reserve, const char* host, unsigned short xport)
 }
 
 
-static int/*bool*/ s_SetHttpHostTag(SConnNetInfo* net_info)
+static int/*bool*/ x_SetHttpHostTag(SConnNetInfo* net_info)
 {
     char*       tag;
     int/*bool*/ retval;
 
-    tag = s_HostPort(sizeof(kHttpHostTag)-1, net_info->host, net_info->port);
+    tag = x_HostPort(sizeof(kHttpHostTag)-1, net_info->host, net_info->port);
     if (tag) {
         memcpy(tag, kHttpHostTag, sizeof(kHttpHostTag)-1);
         retval = ConnNetInfo_OverrideUserHeader(net_info, tag);
@@ -499,6 +545,7 @@ static void x_SetRequestIDs(SConnNetInfo* net_info)
  * and then re-try the connection attempt.
  */
 static EIO_Status s_Connect(SHttpConnector* uuu,
+                            const STimeout* timeout,
                             EExtractMode    extract)
 {
     EIO_Status status;
@@ -520,6 +567,7 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
         return eIO_Closed;
     }
 
+    uuu->entity = 0;
     /* the re-try loop... */
     for (;;) {
         TSOCK_Flags flags
@@ -527,6 +575,7 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
                ? fSOCK_KeepAlive | fSOCK_LogOn
                : fSOCK_KeepAlive | fSOCK_LogDefault);
         sock = 0;
+        uuu->chunked = 0;
         if (uuu->net_info->req_method != eReqMethod_Connect
             &&  uuu->net_info->scheme == eURL_Https
             &&  uuu->net_info->http_proxy_host[0]
@@ -536,12 +585,12 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
                 status = eIO_Unknown;
                 break;
             }
-            net_info->scheme   = eURL_Http;
-            net_info->user[0]  = '\0';
-            net_info->pass[0]  = '\0';
-            if (!net_info->port)
-                net_info->port = CONN_PORT_HTTPS;
-            net_info->firewall = 0/*false*/;
+            net_info->scheme    = eURL_Http;
+            net_info->user[0]   = '\0';
+            net_info->pass[0]   = '\0';
+            if (net_info->port == 0)
+                net_info->port  = CONN_PORT_HTTPS;
+            net_info->firewall  = 0/*false*/;
             ConnNetInfo_DeleteUserHeader(net_info, kHttpHostTag);
             status = HTTP_CreateTunnel(net_info, fHTTP_NoUpread, &sock);
             assert((status == eIO_Success) ^ !sock);
@@ -549,6 +598,7 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
         } else
             status  = eIO_Success;
         if (status == eIO_Success) {
+            EReqMethod     req_method = uuu->net_info->req_method;
             int/*bool*/    reset_user_header;
             char*          http_user_header;
             const char*    host;
@@ -558,8 +608,29 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
             char*          temp;
             size_t         len;
 
-            len = BUF_Size(uuu->w_buf);
-            if (uuu->net_info->req_method == eReqMethod_Connect
+            /* RFC7230 now requires Host: for CONNECT as well */
+            if (!uuu->skip_host  &&  !x_SetHttpHostTag(uuu->net_info)) {
+                status = eIO_Unknown;
+                break;
+            }
+            if (x_IsWriteThru(uuu)) {
+                assert(req_method != eReqMethod_Connect);
+                if (req_method == eReqMethod_Any)
+                    req_method  = BUF_Size(uuu->w_buf)
+                        ? eReqMethod_Post : eReqMethod_Get;
+                if (req_method != eReqMethod_Head  &&
+                    req_method != eReqMethod_Get) {
+                    if (!ConnNetInfo_OverrideUserHeader
+                        (uuu->net_info, "Transfer-Encoding: chunked")) {
+                        status = eIO_Unknown;
+                        break;
+                    }
+                    uuu->chunked = 1;
+                }
+                len = 0;
+            } else
+                len = BUF_Size(uuu->w_buf);
+            if (req_method == eReqMethod_Connect
                 ||  (uuu->net_info->scheme != eURL_Https
                      &&  uuu->net_info->http_proxy_host[0]
                      &&  uuu->net_info->http_proxy_port)) {
@@ -575,8 +646,9 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
                     status = eIO_Unknown;
                     break;
                 }
-                if (uuu->net_info->req_method == eReqMethod_Connect) {
+                if (req_method == eReqMethod_Connect) {
                     /* Tunnel */
+                    assert(!uuu->net_info->version);
                     if (!len) {
                         args = 0;
                     } else if (!(temp = (char*) malloc(len))
@@ -591,12 +663,6 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
                 } else {
                     /* Proxied HTTP */
                     assert(uuu->net_info->scheme == eURL_Http);
-                    if (!uuu->skip_host  &&  !s_SetHttpHostTag(uuu->net_info)){
-                        status = eIO_Unknown;
-                        assert(!sock);
-                        free(path);
-                        break;
-                    }
                     if (uuu->flags & fHCC_UrlEncodeArgs) {
                         /* args added to path not valid(unencoded), remove */
                         if ((temp = strchr(path, '?')) != 0)
@@ -609,15 +675,11 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
                 /* Direct HTTP[S] or tunneled HTTPS */
                 if (uuu->net_info->http_push_auth
                     &&  (uuu->net_info->scheme == eURL_Https
-                         ||  (uuu->flags & fHTTP_InsecureRedirect))
+                         ||  x_UnsafeRedirectOK(uuu))
                     &&  !x_Authenticate(uuu, eRetry_Authenticate)) {
                     status = eIO_Unknown;
                     break;
                 }
-                if (!uuu->skip_host  &&  !s_SetHttpHostTag(uuu->net_info)) {
-                    status = eIO_Unknown;
-                    break;
-                }
                 host = uuu->net_info->host;
                 port = uuu->net_info->port;
                 path = uuu->net_info->path;
@@ -625,7 +687,7 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
             }
 
             /* encode args (obsolete feature) */
-            if (uuu->net_info->req_method != eReqMethod_Connect
+            if (req_method != eReqMethod_Connect
                 &&  args  &&  (uuu->flags & fHCC_UrlEncodeArgs)) {
                 size_t args_len = strcspn(args, "#");
                 assert(args == uuu->net_info->args);
@@ -688,11 +750,10 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
                 flags |= fSOCK_ReadOnWrite;
 
             status = URL_ConnectEx(host, port, path, args,
-                                   uuu->net_info->req_method
-                                   | (uuu->net_info->version
-                                      ? eReqMethod_v1
-                                      : 0), len,
-                                   uuu->o_timeout, uuu->w_timeout,
+                                   req_method | (uuu->net_info->version
+                                                 ? eReqMethod_v1
+                                                 : 0), len,
+                                   uuu->o_timeout, timeout,
                                    uuu->net_info->http_user_header,
                                    uuu->net_info->credentials,
                                    flags, &sock);
@@ -709,8 +770,8 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
 
             if (sock) {
                 assert(status == eIO_Success);
-                uuu->w_len = (uuu->net_info->req_method != eReqMethod_Connect
-                              ? len : 0);
+                uuu->w_len = req_method != eReqMethod_Connect
+                    ? BUF_Size(uuu->w_buf) : 0;
                 break;
             }
         } else
@@ -723,7 +784,7 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
     }
 
     if (status == eIO_Success) {
-        uuu->read_state = eRS_WriteRequest;
+        uuu->conn_state = eCS_WriteRequest;
         uuu->sock = sock;
         assert(sock);
     } else if (sock) {
@@ -737,9 +798,8 @@ static EIO_Status s_Connect(SHttpConnector* uuu,
 /* Unconditionally drop the connection w/o any wait */
 static void s_DropConnection(SHttpConnector* uuu)
 {
-    /*"READ" mode*/
     assert(uuu->sock);
-    if (!(uuu->read_state & eRS_ReadBody)  ||  uuu->read_state == eRS_DropBody)
+    if (!(uuu->conn_state & eCS_ReadBody)  ||  uuu->conn_state == eCS_Discard)
         SOCK_Abort(uuu->sock);
     else
         SOCK_SetTimeout(uuu->sock, eIO_Close, &kZeroTimeout);
@@ -748,15 +808,15 @@ static void s_DropConnection(SHttpConnector* uuu)
 }
 
 
-struct XWriteBufCtx {
+typedef struct {
     SOCK       sock;
     EIO_Status status;
-};
+} XBUF_PeekCBCtx;
 
 
 static size_t x_WriteBuf(void* data, const void* buf, size_t size)
 {
-    struct XWriteBufCtx* ctx = (struct XWriteBufCtx*) data;
+    XBUF_PeekCBCtx* ctx = (XBUF_PeekCBCtx*) data;
     size_t written;
 
     assert(buf  &&  size);
@@ -770,81 +830,92 @@ static size_t x_WriteBuf(void* data, const void* buf, size_t size)
 
 /* Connect to the server specified by uuu->net_info, then compose and form
  * relevant HTTP header, and flush the accumulated output data(uuu->w_buf)
- * after the HTTP header. If connection/write unsuccessful, retry to reconnect
- * and send the data again until permitted by s_Adjust().
+ * after the HTTP header.
+ * If connection/write unsuccessful, retry to reconnect and send the data
+ * again until permitted by s_Adjust().
  */
 static EIO_Status s_ConnectAndSend(SHttpConnector* uuu,
+                                   const STimeout* timeout,
                                    EExtractMode    extract)
 {
     EIO_Status status;
 
     for (;;) {
         char   buf[80];
-        size_t temp;
+        int    error;
+        size_t off;
         char*  url;
 
         if (uuu->sock)
             status = eIO_Success;
-        else if ((status = s_Connect(uuu, extract)) != eIO_Success)
+        else if ((status = s_Connect(uuu, timeout, extract)) != eIO_Success)
             break;
 
         if (uuu->w_len) {
-            size_t              off = BUF_Size(uuu->w_buf) - uuu->w_len;
-            struct XWriteBufCtx ctx;
+            XBUF_PeekCBCtx ctx;
             ctx.sock   = uuu->sock;
-            ctx.status = eIO_Success/*NB: status*/;
+            ctx.status = eIO_Success/*NB:==status*/;
+            off = BUF_Size(uuu->w_buf) - uuu->w_len;
+            assert(uuu->conn_state < eCS_ReadHeader);
             SOCK_SetTimeout(ctx.sock, eIO_Write, uuu->w_timeout);
-            do {
-                temp = BUF_PeekAtCB(uuu->w_buf, off,
-                                    x_WriteBuf, &ctx, uuu->w_len);
-                uuu->w_len -= temp;
-                off        += temp;
-                if (ctx.status != eIO_Success)
-                    break;
-            } while (uuu->w_len);
-            status  = ctx.status;
-        } else if (uuu->read_state == eRS_WriteRequest)
-            status  = SOCK_Write(uuu->sock, 0, 0, 0, eIO_WritePlain);
+            uuu->w_len -= BUF_PeekAtCB(uuu->w_buf, off,
+                                       x_WriteBuf, &ctx, uuu->w_len);
+            status = ctx.status;
+        } else
+            off = 0;
 
         if (status == eIO_Success) {
-            assert(uuu->w_len == 0);
-            if (uuu->read_state == eRS_WriteRequest) {
-                /* 10/07/03: While this call here is perfectly legal, it could
-                 * cause connection severed by a buggy CISCO load-balancer. */
-                /* 10/28/03: CISCO's beta patch for their LB shows that the
-                 * problem has been fixed;  no more 2'30" drops in connections
-                 * that shut down for write.  We still leave this commented
-                 * out to allow unpatched clients to work seamlessly... */ 
-                /*SOCK_Shutdown(uuu->sock, eIO_Write);*/
-                uuu->read_state = eRS_ReadHeader;
-                uuu->expected = (TNCBI_BigCount)(-1L);
-                uuu->received = 0;
-                BUF_Erase(uuu->http);
-            }
-            break;
+            if (uuu->w_len)
+                continue;
+            if (uuu->conn_state  > eCS_FlushRequest)
+                break;
+            if (!uuu->chunked)
+                uuu->conn_state  = eCS_FlushRequest;
+            if (uuu->conn_state == eCS_FlushRequest) {
+                /* "flush" */
+                status = SOCK_Write(uuu->sock, 0, 0, 0, eIO_WritePlain);
+                if (status == eIO_Success) {
+                    uuu->conn_state = eCS_ReadHeader;
+                    uuu->keepalive = 0/*uuu->net_info->version*/;
+                    uuu->expected = (TNCBI_BigCount)(-1L);
+                    uuu->received = 0;
+                    uuu->chunked = 0;
+                    BUF_Erase(uuu->http);
+                    break;
+                }
+            } else
+                break;
         }
 
         if (status == eIO_Timeout
             &&  (extract == eEM_Wait
-                 ||  (uuu->w_timeout
-                      &&  !(uuu->w_timeout->sec | uuu->w_timeout->usec)))) {
+                 ||  (timeout  &&  !(timeout->sec | timeout->usec)))) {
             break;
         }
-        if (uuu->w_len  &&  (temp = BUF_Size(uuu->w_buf)) != 0) {
-            sprintf(buf, "write request body at offset %lu",
-                    (unsigned long)(temp - uuu->w_len));
-        } else
-            strcpy(buf, "flush request header");
+
+        error = errno;
+        if (uuu->w_len  &&  uuu->conn_state == eCS_WriteRequest) {
+            if (!x_IsWriteThru(uuu)) {
+                sprintf(buf, "write request body at offset %lu",
+                        (unsigned long) off);
+            } else
+                strcpy(buf, "write request body");
+        } else {
+            if (uuu->w_len)
+                strcpy(buf, "finalize request body");
+            else
+                strcpy(buf, "finalize request");
+        }
 
         url = ConnNetInfo_URL(uuu->net_info);
-        CORE_LOGF_X(6, eLOG_Error,
-                    ("[HTTP%s%s]  Cannot %s (%s)",
-                     url ? "; " : "",
-                     url ? url  : "", buf, IO_StatusStr(status)));
+        CORE_LOGF_ERRNO_X(6, eLOG_Error, error,
+                          ("[HTTP%s%s]  Cannot %s (%s)",
+                           url ? "; " : "",
+                           url ? url  : "", buf, IO_StatusStr(status)));
         if (url)
             free(url);
 
-        /* write failed; close and try to use another server */
+        /* write failed; close and try to use another server, if possible */
         s_DropConnection(uuu);
         assert(status != eIO_Success);
         if ((status = s_Adjust(uuu, 0, extract)) != eIO_Success)
@@ -855,7 +926,7 @@ static EIO_Status s_ConnectAndSend(SHttpConnector* uuu,
 }
 
 
-static int/*bool*/ s_IsValidParam(const char* param, size_t paramlen)
+static int/*bool*/ x_IsValidParam(const char* param, size_t paramlen)
 {
     const char* e = (const char*) memchr(param, '=', paramlen);
     size_t len;
@@ -881,7 +952,7 @@ static int/*bool*/ s_IsValidParam(const char* param, size_t paramlen)
 }
 
 
-static int/*bool*/ s_IsValidChallenge(const char* text, size_t len)
+static int/*bool*/ x_IsValidChallenge(const char* text, size_t len)
 {
     /* Challenge must contain a scheme name token and a non-empty param
      * list (comma-separated pairs token={token|quoted_string}), with at
@@ -898,7 +969,7 @@ static int/*bool*/ s_IsValidChallenge(const char* text, size_t len)
             const char* c = (const char*) memchr(param, ',', paramlen);
             if (c)
                 paramlen = (size_t)(c - param);
-            if (!s_IsValidParam(param, paramlen))
+            if (!x_IsValidParam(param, paramlen))
                 return 0/*false*/;
             if (paramlen > 6  &&  strncasecmp(param, "realm=", 6) == 0)
                 retval = 1/*true, but keep scanning*/;
@@ -909,19 +980,222 @@ static int/*bool*/ s_IsValidChallenge(const char* text, size_t len)
 }
 
 
+static size_t x_PushbackBuf(void* data, const void* buf, size_t size)
+{
+    XBUF_PeekCBCtx* ctx = (XBUF_PeekCBCtx*) data;
+
+    assert(buf  &&  size);
+    if (ctx->status == eIO_Success)
+        ctx->status  = SOCK_Pushback(ctx->sock, buf, size);
+    return ctx->status != eIO_Success ? 0 : size;
+}
+
+
+static int/*bool*/ x_Pushback(SOCK sock, BUF buf)
+{
+    size_t size = BUF_Size(buf);
+    XBUF_PeekCBCtx ctx;
+    ctx.sock   = sock;
+    ctx.status = eIO_Success;
+    size ^= BUF_PeekAtCB(buf, 0, x_PushbackBuf, &ctx, size);
+    BUF_Destroy(buf);
+    return size ? 0 : 1;
+}
+
+
+static EIO_Status x_ReadChunkHead(SHttpConnector* uuu, int/*bool*/ first)
+{
+    int            n;
+    BUF            buf;
+    char*          str;
+    size_t         size;
+    TNCBI_BigCount chunk;
+    EIO_Status     status;
+
+    buf = 0;
+    str = 0;
+    size = 0;
+    for (;;) {
+        size_t off;
+        if (size > 2) {
+            if (!(str = (char*) malloc(size + 1)))
+                break;
+            verify(BUF_Peek(buf, str, size) == size);
+            if (!first  &&  (str[0] != '\r'  ||  str[1] != '\n')) {
+                free(str);
+                str = 0;
+                break;
+            }
+            assert(str[size - 1] == '\n');
+            str[size] = '\0';
+            break;
+        }
+        status = SOCK_StripToPattern(uuu->sock, "\r\n", 2, &buf, &off);
+        if (status != eIO_Success  ||  (size += off) != BUF_Size(buf))
+            break;
+    }
+
+    if (!str
+        ||  sscanf(str, "%" NCBI_BIGCOUNT_FORMAT_SPEC_HEX "%n", &chunk, &n) < 1
+        ||  (!isspace((unsigned char) str[n])  &&  str[n] != ';')) {
+        char* url = ConnNetInfo_URL(uuu->net_info);
+        CORE_LOGF_X(23, eLOG_Error,
+                    ("[HTTP%s%s]  Cannot read chunk size%s%.*s",
+                     url ? "; " : "",
+                     url ? url  : "",
+                     str ? ": " : "",
+                     str ? (int)(size - (first ? 2 : 4)) : 0,
+                     str ?       str  + (first ? 0 : 2)  : ""));
+        if (url)
+            free(url);
+        if (str) {
+            free(str);
+            BUF_Destroy(buf);
+            return eIO_Closed;
+        }
+        return x_Pushback(uuu->sock, buf) ? eIO_Unknown : eIO_Closed;
+    }
+    free(str);
+
+    uuu->expected = chunk;
+    uuu->received = 0;
+    BUF_Destroy(buf);
+    return eIO_Success;
+}
+
+
+static EIO_Status x_ReadChunkTail(SHttpConnector* uuu)
+{
+    EIO_Status status;
+    BUF buf = 0;
+    do {
+        size_t n;
+        status = SOCK_StripToPattern(uuu->sock, "\r\n", 2, &buf, &n);
+        if (n == 2) {
+            /*last trailer*/
+            BUF_Destroy(buf);
+            uuu->conn_state = eCS_Discard;
+            return eIO_Closed;
+        }
+    } while (status == eIO_Success);
+    return x_Pushback(uuu->sock, buf) ? status : eIO_Closed;
+}
+
+
+/* If "size"==0, then "buf" is a pointer to a BUF to receive the current body.
+ * Otherwise, "buf" is a non-NULL destination buffer.
+ */
+static EIO_Status s_ReadData(SHttpConnector* uuu,
+                             void* buf, size_t size,
+                             size_t* n_read, EIO_ReadMethod how)
+{
+    BUF*       xxx;
+    EIO_Status status;
+
+    assert(buf  &&  n_read  &&  !*n_read);
+
+    if (!uuu->chunked  ||  uuu->expected > uuu->received) {
+        if (!size) {
+            size = uuu->expected != (TNCBI_BigCount)(-1L)
+                ? uuu->expected - uuu->received
+                : 4096;
+            if (!size) {
+                assert(!uuu->chunked);
+                uuu->conn_state = eCS_DoneBody;
+                return eIO_Closed;
+            }
+            if (size > 2 * 4096)
+                size = 2 * 4096;
+            xxx = (BUF*) buf;
+            if (!(buf = (void*) malloc(size))) {
+                int error = errno;
+                char* url = ConnNetInfo_URL(uuu->net_info);
+                CORE_LOGF_ERRNO_X(24, eLOG_Error, error,
+                                  ("[HTTP%s%s]  Cannot allocate response chunk"
+                                   " (%lu byte%s)",
+                                   url ? "; " : "",
+                                   url ? url  : "",
+                                   (unsigned long) size, &"s"[size == 1]));
+                if (url)
+                    free(url);
+                return eIO_Unknown;
+            }
+        } else if (uuu->chunked) {
+            assert(uuu->expected != (TNCBI_BigCount)(-1L));
+            if (size > uuu->expected - uuu->received)
+                size = uuu->expected - uuu->received;
+            xxx = 0;
+        } else if (uuu->expected == uuu->received) {
+            uuu->conn_state = eCS_DoneBody;
+            return eIO_Closed;
+        } else
+            xxx = 0;
+        status = SOCK_Read(uuu->sock, buf, size, n_read, how);
+        if (xxx  &&  !BUF_AppendEx(xxx, buf, size, buf, *n_read)) {
+            int error = errno;
+            char* url = ConnNetInfo_URL(uuu->net_info);
+            CORE_LOGF_ERRNO_X(25, eLOG_Error, error,
+                              ("[HTTP%s%s]  Cannot collect response body",
+                               url ? "; " : "",
+                               url ? url  : ""));
+            if (url)
+                free(url);
+            free(buf);
+            status = eIO_Unknown;
+        }
+        return status;
+    }
+
+    if ((status = x_ReadChunkHead(uuu, !uuu->expected)) != eIO_Success)
+        return status;
+
+    if (uuu->expected) {
+        assert(uuu->expected != (TNCBI_BigCount)(-1L)  &&  !uuu->received);
+        if (size > uuu->expected)
+            size = uuu->expected;
+        return s_ReadData(uuu, buf, size, n_read, how);
+    }
+
+    uuu->conn_state = eCS_DoneBody;
+    return x_ReadChunkTail(uuu);
+}
+
+
+static int/*bool*/ x_IsErrorHeader(SHttpConnector* uuu)
+{
+    if (uuu->error_header == eDefault) {
+        char val[32];
+        ConnNetInfo_GetValue(0, "HTTP_ERROR_HEADER_ONLY", val, sizeof(val), 0);
+        uuu->error_header = ConnNetInfo_Boolean(val) ? eOn : eOff;
+    }
+    return uuu->error_header == eOn ? 1/*true*/ : 0/*false*/;
+}
+
+
 /* Read and parse HTTP header */
 static EIO_Status s_ReadHeader(SHttpConnector* uuu,
                                SRetry*         retry,
                                EExtractMode    extract)
 {
-    char*             url = 0, *str;
+    enum EHTTP_Tag {
+        eHTTP_NcbiMsg          = 1 << 0,
+        eHTTP_NcbiSid          = 1 << 1,
+        eHTTP_Location         = 1 << 2,
+        eHTTP_Connection       = 1 << 3,
+        eHTTP_Authenticate     = 1 << 4,
+        eHTTP_ContentLength    = 1 << 5,
+        eHTTP_TransferEncoding = 1 << 6
+    };
+    typedef unsigned short THTTP_Tags;  /* Bitwise-OR of EHTTP_Tag */
+    char*             url = 0, *hdr, *s;
     EHTTP_HeaderParse header_parse;
     int               http_code;
     size_t            size, n;
     EIO_Status        status;
     int               fatal;
+    THTTP_Tags        tags;
 
-    assert(uuu->sock  &&  uuu->read_state == eRS_ReadHeader);
+    assert(uuu->sock  &&  uuu->conn_state == eCS_ReadHeader);
     memset(retry, 0, sizeof(*retry));
     /*retry->mode = eRetry_None;
       retry->data = 0;*/
@@ -930,23 +1204,27 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
     for (;;) {
         /* do we have full header yet? */
         if ((size = BUF_Size(uuu->http)) >= 4) {
-            if (!(str = (char*) malloc(size + 1))) {
+            if (!(hdr = (char*) malloc(size + 1))) {
+                int error = errno;
                 assert(!url);
                 url = ConnNetInfo_URL(uuu->net_info);
-                CORE_LOGF_X(7, eLOG_Error,
-                            ("[HTTP%s%s]  Cannot allocate header (%lu bytes)",
-                             url ? "; " : "",
-                             url ? url  : "",
-                             (unsigned long) size));
+                CORE_LOGF_ERRNO_X(7, eLOG_Error, error,
+                                  ("[HTTP%s%s]  Cannot allocate header"
+                                   " (%lu bytes)",
+                                   url ? "; " : "",
+                                   url ? url  : "",
+                                   (unsigned long) size));
                 if (url)
                     free(url);
                 return eIO_Unknown;
             }
-            verify(BUF_Peek(uuu->http, str, size) == size);
-            str[size] = '\0';
-            if (strcmp(&str[size - 4], "\r\n\r\n") == 0)
-                break/*full header captured*/;
-            free(str);
+            verify(BUF_Peek(uuu->http, hdr, size) == size);
+            if (memcmp(&hdr[size - 4], "\r\n\r\n", 4) == 0) {
+                /*full header captured*/
+                hdr[size] = '\0';
+                break;
+            }
+            free(hdr);
         }
 
         status = SOCK_StripToPattern(uuu->sock, "\r\n", 2, &uuu->http, &n);
@@ -980,12 +1258,12 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
         }
     }
     /* the entire header has been read */
-    uuu->read_state = eRS_ReadBody;
+    uuu->conn_state = eCS_ReadBody;
     BUF_Erase(uuu->http);
 
     /* HTTP status must come on the first line of the response */
     fatal = 0/*false*/;
-    if (sscanf(str, "HTTP/%*d.%*d %d ", &http_code) != 1  ||  !http_code)
+    if (sscanf(hdr, "HTTP/%*d.%*d %d ", &http_code) != 1  ||  !http_code)
         http_code = -1;
     uuu->http_code = http_code;
     if (http_code < 200  ||  299 < http_code) {
@@ -1006,7 +1284,7 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
     } else
         http_code = 0/*no server error*/;
 
-    if ((http_code  ||  !uuu->error_header)
+    if ((http_code  ||  !x_IsErrorHeader(uuu))
         &&  uuu->net_info->debug_printout == eDebugPrintout_Some) {
         /* HTTP header gets printed as part of data logging when
            uuu->net_info->debug_printout == eDebugPrintout_Data. */
@@ -1029,32 +1307,80 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
             header_header = "HTTP header (retriable server error)";
         assert(!url);
         url = ConnNetInfo_URL(uuu->net_info);
-        CORE_DATAF_X(9, fatal ? eLOG_Error : eLOG_Note, str, size,
+        CORE_DATAF_X(9, fatal ? eLOG_Error : eLOG_Note, hdr, size,
                      ("[HTTP%s%s]  %s",
                       url ? "; " : "",
                       url ? url  : "", header_header));
     }
 
-    {{
-        unsigned int m = uuu->flags & fHTTP_NoAutomagicSID ? 1 : (2 | 1);
-        char* s;
-        for (s = strchr(str, '\n');  s  &&  *s;  s = strchr(s + 1, '\n')) {
-            static const char kNcbiMessageTag[] = "\n" HTTP_NCBI_MESSAGE " ";
-            static const char kNcbiSidTag[] = "\n" HTTP_NCBI_SID " ";
-            if ((m & 1)  &&
-                /* parse the "NCBI-Message" tag unconditionally */
-                strncasecmp(s, kNcbiMessageTag, sizeof(kNcbiMessageTag)-1)==0){
-                char* msg = s + sizeof(kNcbiMessageTag) - 1;
+    if (!(uuu->flags & fHTTP_KeepHeader)) {
+        if (fatal) {
+            if (!uuu->net_info->debug_printout  &&  !uuu->parse_header) {
+                char text[40];
+                assert(http_code);
+                if (!url)
+                    url = ConnNetInfo_URL(uuu->net_info);
+                if (http_code > 0)
+                    sprintf(text, "%d", http_code);
+                else
+                    strncpy0(text, "occurred", sizeof(text) - 1);
+                CORE_LOGF_X(22, eLOG_Error,
+                            ("[HTTP%s%s]  Fatal error %s",
+                             url ? "; " : "",
+                             url ? url  : "", text));
+            }
+            if (!uuu->adjust)
+                uuu->net_info->max_try = 0;
+        }
+
+        header_parse = uuu->parse_header
+            ? uuu->parse_header(hdr, uuu->user_data, http_code)
+            : eHTTP_HeaderSuccess;
+
+        if (header_parse == eHTTP_HeaderError) {
+            retry->mode = eRetry_None;
+            if (!http_code/*i.e. was okay*/  &&  x_IsErrorHeader(uuu)
+                &&  uuu->net_info->debug_printout == eDebugPrintout_Some) {
+                if (!url)
+                    url = ConnNetInfo_URL(uuu->net_info);
+                CORE_DATAF_X(9, eLOG_Note, hdr, size,
+                             ("[HTTP%s%s]  HTTP header (parse error)",
+                              url ? "; " : "",
+                              url ? url  : ""));
+            }
+        } else if (header_parse == eHTTP_HeaderComplete) {
+            /* i.e. stop processing */
+            retry->mode = eRetry_None;
+            http_code = 0/*fake success*/;
+        }
+    } else {
+        header_parse = eHTTP_HeaderSuccess;
+        retry->mode = eRetry_None;
+    }
+
+    tags = eHTTP_NcbiMsg | eHTTP_Connection
+        | (retry->mode & eRetry_Redirect     ? eHTTP_Location     :
+           retry->mode & eRetry_Authenticate ? eHTTP_Authenticate : 0)
+        | (uuu->flags & fHTTP_NoAutomagicSID ? 0 : eHTTP_NcbiSid);
+    if (uuu->http_code / 100 != 1  &&  uuu->http_code != 204)
+        tags |= eHTTP_ContentLength | eHTTP_TransferEncoding;
+
+    /* NB: the loop may clobber "hdr" unless fHTTP_KeepHeader is set */
+    for (s = strchr(hdr, '\n');  s  &&  *s;  s = strchr(s + 1, '\n')) {
+        if (tags & eHTTP_NcbiMsg) {
+            /* parse NCBI message */
+            static const char kNcbiMsgTag[] = "\n" HTTP_NCBI_MESSAGE;
+            if (strncasecmp(s, kNcbiMsgTag, sizeof(kNcbiMsgTag) - 1) == 0) {
+                char* msg = s + sizeof(kNcbiMsgTag) - 1, *e;
                 while (*msg  &&  isspace((unsigned char)(*msg)))
                     ++msg;
-                if (!(s = strchr(msg, '\r')))
-                    s = strchr(msg, '\n');
-                assert(s);
+                if (!(e = strchr(msg, '\r'))  &&  !(e = strchr(msg, '\n')))
+                    break;
                 do {
-                    if (!isspace((unsigned char) s[-1]))
+                    if (!isspace((unsigned char) e[-1]))
                         break;
-                } while (--s > msg);
-                n = (size_t)(s - msg);
+                } while (--e > msg);
+                n = (size_t)(e - msg);
                 if (n) {
                     char c = msg[n];
                     msg[n] = '\0';
@@ -1069,16 +1395,19 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
                                     ("[NCBI-MESSAGE]  %s", msg));
                     }
                     msg[n] = c;
-                    m &= ~1;
                 }
-            } else if ((m & 2)  &&
-                       strncasecmp(s, kNcbiSidTag, sizeof(kNcbiSidTag)-1)==0) {
+                tags &= ~eHTTP_NcbiMsg;
+                continue;
+            }
+        }
+        if (tags & eHTTP_NcbiSid) {
+            /* parse NCBI SID */
+            static const char kNcbiSidTag[] = "\n" HTTP_NCBI_SID;
+            if (strncasecmp(s, kNcbiSidTag, sizeof(kNcbiSidTag) - 1) == 0) {
                 char* sid = s + sizeof(kNcbiSidTag) - 1, *e;
                 while (*sid  &&  isspace((unsigned char)(*sid)))
                     ++sid;
-                if (!(e = strchr(sid, '\r')))
-                    e = strchr(sid, '\n');
-                if (!e)
+                if (!(e = strchr(sid, '\r'))  &&  !(e = strchr(sid, '\n')))
                     break;
                 do {
                     if (!isspace((unsigned char) e[-1]))
@@ -1090,137 +1419,61 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
                     sid[n] = '\0';
                     ConnNetInfo_OverrideUserHeader(uuu->net_info, s + 1);
                     sid[n] = c;
-                    m &= ~2;
                 }
+                tags &= ~eHTTP_NcbiSid;
+                continue;
             }
-            if (!m)
-                break;
         }
-    }}
-
-    if (fatal) {
-        if (!uuu->net_info->debug_printout) {
-            char text[40];
+        if (tags & eHTTP_Location) {
+            /* parse "Location" pointer */
+            static const char kLocationTag[] = "\nLocation:";
             assert(http_code);
-            if (!url)
-                url = ConnNetInfo_URL(uuu->net_info);
-            if (http_code > 0)
-                sprintf(text, "%d", http_code);
-            else
-                strncpy0(text, "occurred", sizeof(text) - 1);
-            CORE_LOGF_X(22, uuu->flags & fHTTP_SuppressMessages
-                        ? eLOG_Trace : eLOG_Error,
-                        ("[HTTP%s%s]  HTTP error %s",
-                         url ? "; " : "",
-                         url ? url  : "", text));
-        }
-        if (!uuu->adjust)
-            uuu->net_info->max_try = 0;
-    }
-
-    if (uuu->flags & fHTTP_KeepHeader) {
-        retry->mode = eRetry_None;
-        if (!BUF_Write(&uuu->r_buf, str, size)) {
-            if (!url)
-                url = ConnNetInfo_URL(uuu->net_info);
-            CORE_LOGF_X(11, eLOG_Error,
-                        ("[HTTP%s%s]  Cannot save HTTP header",
-                         url ? "; " : "",
-                         url ? url  : ""));
-            status = eIO_Unknown;
-        } else
-            status = eIO_Success;
-        free(str);
-        if (url)
-            free(url);
-        return status;
-    }
-
-    header_parse = uuu->parse_header
-        ? uuu->parse_header(str, uuu->user_data, http_code)
-        : eHTTP_HeaderSuccess;
-
-    if (!http_code  &&  header_parse/*!= eHTTP_HeaderError*/) {
-        /* parse "Content-Length" of non-error, non-HEAD responses only */
-        if (uuu->net_info->req_method != eReqMethod_Head) {
-            static const char kContentLenTag[] = "\nContent-Length: ";
-            const char* s;
-            int end;
-            for (s = strchr(str, '\n');  s  &&  *s;  s = strchr(s + 1, '\n')) {
-                if (!strncasecmp(s, kContentLenTag, sizeof(kContentLenTag)-1)){
-                    const char* len = s + sizeof(kContentLenTag) - 1;
-                    while (*len  &&  isspace((unsigned char)(*len)))
-                        len++;
-                    if (!(s = strchr(len, '\r')))
-                        s = strchr(len, '\n');
-                    assert(s);
-                    do {
-                        if (!isspace((unsigned char) s[-1]))
-                            break;
-                    } while (--s > len);
-                    if (s == len)
-                        continue;
-                    if (sscanf(len, "%" NCBI_BIGCOUNT_FORMAT_SPEC "%n",
-                               &uuu->expected, &end) < 1  ||  len + end != s) {
-                        uuu->expected = (TNCBI_BigCount)(-1L)/*no checks*/;
-                    }
-                    break;
-                }
-            }
-        } else
-            uuu->expected = 0;
-    }
-
-    if (!header_parse/*== eHTTP_HeaderError*/) {
-        retry->mode = eRetry_None;
-        if (!http_code/*i.e. was okay*/  &&  uuu->error_header
-            &&  uuu->net_info->debug_printout == eDebugPrintout_Some) {
-            if (!url)
-                url = ConnNetInfo_URL(uuu->net_info);
-            CORE_DATAF_X(9, eLOG_Note, str, size,
-                         ("[HTTP%s%s]  HTTP header (parse error)",
-                          url ? "; " : "",
-                          url ? url  : ""));
-        }
-    } else if (header_parse == eHTTP_HeaderComplete) {
-        /* i.e. stop processing */
-        retry->mode = eRetry_None;
-        http_code = 0/*fake success*/;
-    } else if (retry->mode & eRetry_Redirect) {
-        /* parse "Location" pointer */
-        static const char kLocationTag[] = "\nLocation: ";
-        char* s;
-        assert(http_code);
-        for (s = strchr(str, '\n');  s  &&  *s;  s = strchr(s + 1, '\n')) {
             if (strncasecmp(s, kLocationTag, sizeof(kLocationTag) - 1) == 0) {
-                char* loc = s + sizeof(kLocationTag) - 1;
+                char* loc = s + sizeof(kLocationTag) - 1, *e;
                 while (*loc  &&  isspace((unsigned char)(*loc)))
                     ++loc;
-                if (!(s = strchr(loc, '\r')))
-                    s = strchr(loc, '\n');
-                if (!s)
+                if (!(e = strchr(loc, '\r'))  &&  !(e = strchr(loc, '\n')))
                     break;
                 do {
-                    if (!isspace((unsigned char) s[-1]))
+                    if (!isspace((unsigned char) e[-1]))
                         break;
-                } while (--s > loc);
-                n = (size_t)(s - loc);
+                } while (--e > loc);
+                n = (size_t)(e - loc);
                 if (n) {
-                    memmove(str, loc, n);
-                    str[n] = '\0';
-                    retry->data = str;
-                    break;
+                    memmove(hdr, loc, n);
+                    hdr[n] = '\0';
+                    retry->data = hdr;
                 }
+                tags &= ~eHTTP_Location;
+                continue;
+            }
+        }
+        if (tags & eHTTP_Connection) {
+            /* parse "Connection" tag */
+            static const char kConnectionTag[] = "\nConnection:";
+            if (strncasecmp(s, kConnectionTag, sizeof(kConnectionTag)-1) == 0){
+                char* con = s + sizeof(kConnectionTag) - 1, *e;
+                while (*con  &&  isspace((unsigned char)(*con)))
+                    ++con;
+                if (!(e = strchr(con, '\r'))  &&  !(e = strchr(con, '\n')))
+                    break;
+                do {
+                    if (!isspace((unsigned char) e[-1]))
+                        break;
+                } while (--e > con);
+                n = (size_t)(e - con);
+                if (strncasecmp(con, "close", n) == 0)
+                    uuu->keepalive = 0;
+                tags &= ~eHTTP_Connection;
+                continue;
             }
         }
-    } else if (retry->mode & eRetry_Authenticate) {
-        /* parse "Authenticate"/"Proxy-Authenticate" tags */
-        static const char kAuthenticateTag[] = "-Authenticate: ";
-        char* s;
-        assert(http_code);
-        for (s = strchr(str, '\n');  s  &&  *s;  s = strchr(s + 1, '\n')) {
+        if (tags & eHTTP_Authenticate) {
+            /* parse "Authenticate"/"Proxy-Authenticate" tags */
+            static const char kAuthenticateTag[] = "-Authenticate:";
+            assert(http_code);
             if (strncasecmp(s + (retry->mode == eRetry_Authenticate ? 4 : 6),
-                            kAuthenticateTag, sizeof(kAuthenticateTag)-1)==0){
+                            kAuthenticateTag, sizeof(kAuthenticateTag)-1)==0) {
                 if ((retry->mode == eRetry_Authenticate
                      &&  strncasecmp(s, "\nWWW",   4) == 0)  ||
                     (retry->mode == eRetry_ProxyAuthenticate
@@ -1229,33 +1482,106 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
                     txt += retry->mode == eRetry_Authenticate ? 4 : 6;
                     while (*txt  &&  isspace((unsigned char)(*txt)))
                         ++txt;
-                    if (!(e = strchr(txt, '\r')))
-                        e = strchr(txt, '\n');
-                    else
-                        s = e;
-                    if (!e)
+                    if (!(e = strchr(txt, '\r'))  &&  !(e = strchr(txt, '\n')))
                         break;
                     do {
                         if (!isspace((unsigned char) e[-1]))
                             break;
                     } while (--e > txt);
                     n = (size_t)(e - txt);
-                    if (n  &&  s_IsValidChallenge(txt, n)) {
-                        memmove(str, txt, n);
-                        str[n] = '\0';
-                        retry->data = str;
+                    if (n  &&  x_IsValidChallenge(txt, n)) {
+                        memmove(hdr, txt, n);
+                        hdr[n] = '\0';
+                        retry->data = hdr;
+                    }
+                    tags &= ~eHTTP_Authenticate;
+                    continue;
+                }
+            }
+        }
+        if (tags & eHTTP_ContentLength) {
+            /* parse "Content-Length" for non-HEAD/CONNECT */
+            static const char kContentLenTag[] = "\nContent-Length:";
+            if (strncasecmp(s, kContentLenTag, sizeof(kContentLenTag)-1) == 0){
+                if (!uuu->chunked
+                    &&  uuu->net_info->req_method != eReqMethod_Head
+                    &&  uuu->net_info->req_method != eReqMethod_Connect) {
+                    const char* len = s + sizeof(kContentLenTag) - 1, *e;
+                    int tmp;
+                    while (*len  &&  isspace((unsigned char)(*len)))
+                        len++;
+                    if (!(e = strchr(len, '\r'))  &&  !(e = strchr(len, '\n')))
                         break;
+                    do {
+                        if (!isspace((unsigned char) e[-1]))
+                            break;
+                    } while (--e > len);
+                    if (e == len
+                        ||  sscanf(len, "%" NCBI_BIGCOUNT_FORMAT_SPEC "%n",
+                                   &uuu->expected, &tmp) < 1
+                        ||  len + tmp != e) {
+                        uuu->expected = (TNCBI_BigCount)(-1L)/*no checks*/;
                     }
                 }
+                tags &= ~eHTTP_ContentLength;
+                continue;
             }
         }
+        if (tags & eHTTP_TransferEncoding) {
+            static const char kTransferEncodingTag[] = "\nTransfer-Encoding:";
+            if (strncasecmp(s, kTransferEncodingTag,
+                            sizeof(kTransferEncodingTag)-1) == 0) {
+                const char* te = s + sizeof(kTransferEncodingTag) - 1, *e;
+                while (*te  &&  isspace((unsigned char)(*te)))
+                    te++;
+                if (!(e = strchr(te, '\r'))  &&  !(e = strchr(te, '\n')))
+                    break;
+                do {
+                    if (!isspace((unsigned char) e[-1]))
+                        break;
+                } while(--e > te);
+                n = (size_t)(e - te);
+                if (n < 7  ||  strncasecmp(&e[-7], "chunked", 7) != 0
+                    ||  (!isspace((unsigned char) e[-8])
+                         &&  e[-8] != ':'  &&  e[-8] != ',')) {
+                    uuu->keepalive = 0;
+                } else
+                    uuu->chunked = 1;
+                uuu->expected = 0;
+                tags &= ~(eHTTP_ContentLength | eHTTP_TransferEncoding);
+                if (!uuu->net_info->version) {
+                    CORE_LOG(eLOG_Warning,
+                             "Chunked transfer encoding within HTTP/1.0");
+                }
+                continue;
+            }
+        }
+        if (!tags)
+            break;
+    }
+
+    if (uuu->flags & fHTTP_KeepHeader) {
+        assert(retry->mode == eRetry_None);
+        if (!BUF_AppendEx(&uuu->r_buf, hdr, 0, hdr, size)) {
+            int error = errno;
+            if (!url)
+                url = ConnNetInfo_URL(uuu->net_info);
+            CORE_LOGF_ERRNO_X(11, eLOG_Error, error,
+                              ("[HTTP%s%s]  Cannot save HTTP header",
+                               url ? "; " : "",
+                               url ? url  : ""));
+            free(hdr);
+        }
+        if (url)
+            free(url);
+        return eIO_Success;
     }
 
     if (!retry->data)
-        free(str);
+        free(hdr);
 
     if (!http_code) {
-        if (header_parse/*!= eHTTP_HeaderError*/) {
+        if (header_parse != eHTTP_HeaderError) {
             if (url)
                 free(url);
             return eIO_Success;
@@ -1266,17 +1592,28 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
 
     if (uuu->net_info->debug_printout
         ||  header_parse == eHTTP_HeaderContinue) {
-        if (http_code > 0/*real error, w/only a very short body expected*/)
-            SOCK_SetTimeout(uuu->sock, eIO_Read, kInfiniteTimeout);
-        status = SOCK_StripToPattern(uuu->sock, 0, 0, &uuu->http, &size);
-        assert(status != eIO_Success);
+        if (http_code > 0/*real error, w/only a very short body expected*/) {
+            static const STimeout kDefConnTimeout = {
+                (unsigned int)
+                  DEF_CONN_TIMEOUT,
+                (unsigned int)
+                ((DEF_CONN_TIMEOUT - (unsigned int) DEF_CONN_TIMEOUT)
+                 * 1000000.0)
+            };
+            SOCK_SetTimeout(uuu->sock, eIO_Read, &kDefConnTimeout);
+        }
+        do {
+            n = 0;
+            status = s_ReadData(uuu, &uuu->http, 0, &n, eIO_ReadPlain);
+            uuu->received += n;
+        } while (status == eIO_Success);
         if (header_parse == eHTTP_HeaderContinue  &&  status == eIO_Closed) {
             if (url)
                 free(url);
-            return eIO_Closed;
+            return retry->mode ? status : eIO_Success;
         }
     } else
-        status = eIO_Success/*NB: not really necessary*/;
+        status = eIO_Success/*NB: irrelevant*/;
 
     if (uuu->net_info->debug_printout == eDebugPrintout_Some
         ||  header_parse == eHTTP_HeaderContinue) {
@@ -1291,7 +1628,7 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
                         ("[HTTP%s%s]  Server error message incomplete (%s)",
                          url ? "; " : "",
                          url ? url  : "", err));
-        } else if (!size) {
+        } else if (!(size = BUF_Size(uuu->http))) {
             CORE_LOGF_X(12, err  &&  !(uuu->flags & fHTTP_SuppressMessages)
                         ? eLOG_Warning : eLOG_Trace,
                         ("[HTTP%s%s]  No error message received from server"
@@ -1300,8 +1637,8 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
                          url ? url  : "",
                          err ? " (" : "",
                          err ? err  : "", &")"[!err]));
-        } else if ((str = (char*) malloc(size)) != 0) {
-            n = BUF_Read(uuu->http, str, size);
+        } else if ((s = (char*) malloc(size)) != 0) {
+            n = BUF_Read(uuu->http, s, size);
             if (n != size) {
                 CORE_LOGF_X(13, eLOG_Error,
                             ("[HTTP%s%s]  Cannot extract server error message"
@@ -1311,14 +1648,14 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
                              (unsigned long) n, (unsigned long) size));
             }
             if (n) {
-                CORE_DATAF_X(14, eLOG_Note, str, n,
+                CORE_DATAF_X(14, eLOG_Note, s, n,
                              ("[HTTP%s%s]  Server error message%s%s%s",
                               url ? "; " : "",
                               url ? url  : "",
                               err ? " (" : "",
                               err ? err  : "", &")"[!err]));
             }
-            free(str);
+            free(s);
         } else {
             CORE_LOGF_X(15, eLOG_Error,
                         ("[HTTP%s%s]  Cannot allocate server error message"
@@ -1337,11 +1674,11 @@ static EIO_Status s_ReadHeader(SHttpConnector* uuu,
 }
 
 
-/* Prepare connector for reading.  Open socket if necessary and
- * make initial connect and send, re-trying if possible until success.
+/* Prepare connector for reading.  Open socket if necessary and make an initial
+ * connect and send, re-trying if possible until success.
  * Return codes:
  *   eIO_Success = success, connector is ready for reading (uuu->sock != NULL);
- *   eIO_Timeout = maybe (check uuu->sock) connected and no data yet available;
+ *   eIO_Timeout = maybe (check uuu->sock) connected and no data available yet;
  *   other code  = error, not connected (uuu->sock == NULL).
  * NB: On error, uuu->r_buf may be updated to contain new pending data!
  */
@@ -1355,27 +1692,45 @@ static EIO_Status s_PreRead(SHttpConnector* uuu,
         EIO_Status adjust;
         SRetry     retry;
 
-        if ((status = s_ConnectAndSend(uuu, extract)) != eIO_Success)
+        if ((status = s_ConnectAndSend(uuu, timeout, extract)) != eIO_Success)
             break;
+        assert(!uuu->w_len);
+
+        if (uuu->conn_state == eCS_WriteRequest) {
+            assert(x_IsWriteThru(uuu)  &&  uuu->chunked);
+            BUF_Erase(uuu->w_buf);
+            if (!BUF_Write(&uuu->w_buf, "0\r\n\r\n", 5)) {
+                status = eIO_Unknown;
+                break;
+            }
+            uuu->w_len = 5;
+            uuu->conn_state  = eCS_FlushRequest;
+
+            status = s_ConnectAndSend(uuu, timeout, extract);
+            if (status != eIO_Success)
+                break;
+            assert(!uuu->w_len);
+        }
+
         if (extract == eEM_Flush)
             return eIO_Success;
 
-        assert(uuu->sock  &&  uuu->read_state > eRS_WriteRequest);
+        assert(uuu->sock  &&  uuu->conn_state > eCS_FlushRequest);
 
         if (extract == eEM_Wait
-            &&  (uuu->read_state & eRS_DoneBody) == eRS_DoneBody) {
+            &&  (uuu->conn_state & eCS_DoneBody) == eCS_DoneBody) {
             return eIO_Closed;
         }
 
         /* set read timeout before leaving (s_Read() expects it set) */
         SOCK_SetTimeout(uuu->sock, eIO_Read, timeout);
 
-        if (uuu->read_state & eRS_ReadBody)
+        if (uuu->conn_state & eCS_ReadBody)
             return eIO_Success;
 
-        assert(uuu->read_state == eRS_ReadHeader);
+        assert(uuu->conn_state == eCS_ReadHeader);
         if ((status = s_ReadHeader(uuu, &retry, extract)) == eIO_Success) {
-            assert((uuu->read_state & eRS_ReadBody)  &&  !retry.mode);
+            assert((uuu->conn_state & eCS_ReadBody)  &&  !retry.mode);
             /* pending output data no longer needed */
             BUF_Erase(uuu->w_buf);
             return eIO_Success;
@@ -1410,25 +1765,41 @@ static EIO_Status s_PreRead(SHttpConnector* uuu,
 }
 
 
+/* NB: Sets the EOM read state */
+static void x_Close(SHttpConnector* uuu)
+{
+    /* since this is merely an acknowledgement, it will be "instant" */
+    SOCK_SetTimeout(uuu->sock, eIO_Close, &kZeroTimeout);
+    SOCK_CloseEx(uuu->sock, 0/*retain SOCK*/);
+    uuu->conn_state = eCS_Eom;
+}
+
+
 /* Read non-header data from connection */
 static EIO_Status s_Read(SHttpConnector* uuu, void* buf,
                          size_t size, size_t* n_read)
 {
     EIO_Status status;
 
-    assert(uuu->sock  &&  n_read  &&  (uuu->read_state & eRS_ReadBody));
+    assert(uuu->conn_state & eCS_ReadBody);
+    assert(uuu->sock  &&  size  &&  n_read  &&  !*n_read);
+    assert(uuu->net_info->req_method != eReqMethod_Connect);
 
-    if ((uuu->read_state & eRS_DoneBody) == eRS_DoneBody) {
-        *n_read = 0;
-        return eIO_Closed;
+    if ((uuu->conn_state & eCS_DoneBody) == eCS_DoneBody) {
+        if (!uuu->chunked)
+            return eIO_Closed;
+        if (uuu->conn_state == eCS_Discard)
+            x_Close(uuu);
+        return uuu->conn_state != eCS_Eom ? x_ReadChunkTail(uuu) : eIO_Closed;
     }
-
     assert(uuu->received <= uuu->expected);
 
-    if (uuu->net_info->req_method == eReqMethod_Head) {
+    if (uuu->net_info->req_method == eReqMethod_Head
+        ||  uuu->http_code / 100 == 1
+        ||  uuu->http_code == 204
+        ||  uuu->http_code == 304) {
         status = eIO_Closed;
-        *n_read = 0;
-    } else if (uuu->flags & fHCC_UrlDecodeInput) {
+    } else if (!uuu->net_info->version && (uuu->flags & fHCC_UrlDecodeInput)) {
         /* read and URL-decode */
         size_t         n_peeked, n_decoded;
         TNCBI_BigCount remain    = uuu->expected - uuu->received;
@@ -1437,10 +1808,7 @@ static EIO_Status s_Read(SHttpConnector* uuu, void* buf,
 
         /* peek the data */
         status= SOCK_Read(uuu->sock,peek_buf,peek_size,&n_peeked,eIO_ReadPeek);
-        if (status != eIO_Success) {
-            assert(!n_peeked);
-            *n_read = 0;
-        } else {
+        if (status == eIO_Success) {
             if (URL_DecodeEx(peek_buf,n_peeked,&n_decoded,buf,size,n_read,"")){
                 /* decode, then discard successfully decoded data from input */
                 if (n_decoded) {
@@ -1467,29 +1835,26 @@ static EIO_Status s_Read(SHttpConnector* uuu, void* buf,
                 if (url)
                     free(url);
             }
-        }
+        } else
+            assert(!n_peeked);
         if (peek_buf)
             free(peek_buf);
     } else {
         /* just read, with no URL-decoding */
-        status = SOCK_Read(uuu->sock, buf, size, n_read, eIO_ReadPlain);
+        status = s_ReadData(uuu, buf, size, n_read, eIO_ReadPlain);
         uuu->received += *n_read;
     }
 
-    if (status == eIO_Closed) {
-        /* since this is merely an acknowledgement, it will be "instant" */
-        SOCK_SetTimeout(uuu->sock, eIO_Close, &kZeroTimeout);
-        SOCK_CloseEx(uuu->sock, 0/*retain socket*/);
-        uuu->read_state = eRS_DoneBody;
-    }
+    if (status == eIO_Closed  &&  !uuu->keepalive)
+        x_Close(uuu);
 
     if (uuu->expected != (TNCBI_BigCount)(-1L)) {
         const char* how = 0;
         if (uuu->received < uuu->expected) {
             if (status == eIO_Closed) {
-                assert(uuu->read_state == eRS_DoneBody);
+                assert(uuu->conn_state == eCS_ReadBody);
                 status  = eIO_Unknown;
-                how = "premature EOF in";
+                how = "premature EOM in";
             }
         } else {
             if (uuu->expected < uuu->received) {
@@ -1501,7 +1866,7 @@ static EIO_Status s_Read(SHttpConnector* uuu, void* buf,
                     assert(*n_read >= excess);
                     *n_read -= (size_t) excess;
                 }
-                uuu->read_state = eRS_DropBody;
+                uuu->conn_state = eCS_Discard;
                 status  = eIO_Unknown;
                 how = "too much";
             }
@@ -1532,15 +1897,15 @@ static EIO_Status s_Disconnect(SHttpConnector* uuu,
 {
     EIO_Status status = eIO_Success;
 
-    assert(!(extract & eEM_Wait));  /* i.e. here either drop or read, only */
+    assert(!(extract & eEM_Wait));  /* here it's only either drop or read */
 
     BUF_Erase(uuu->http);
     if (extract == eEM_Drop)
         BUF_Erase(uuu->r_buf);
     else if ((status = s_PreRead(uuu, timeout, extract)) == eIO_Success) {
         do {
-            char   buf[4096];
-            size_t x_read;
+            char buf[4096];
+            size_t x_read = 0;
             status = s_Read(uuu, buf, sizeof(buf), &x_read);
             if (!BUF_Write(&uuu->r_buf, buf, x_read))
                 status = eIO_Unknown;
@@ -1561,7 +1926,6 @@ static void s_OpenHttpConnector(SHttpConnector* uuu,
 {
     /* NOTE: the real connect will be performed on the first "READ", or
      * "FLUSH/CLOSE", or on "WAIT" on read -- see in "s_ConnectAndSend" */
-
     assert(!uuu->sock);
 
     /* store timeouts for later use */
@@ -1571,8 +1935,8 @@ static void s_OpenHttpConnector(SHttpConnector* uuu,
         uuu->ww_timeout = *timeout;
         uuu->w_timeout  = &uuu->ww_timeout;
     } else {
-        uuu->o_timeout  = timeout;
-        uuu->w_timeout  = timeout;
+        uuu->o_timeout  = kInfiniteTimeout;
+        uuu->w_timeout  = kInfiniteTimeout;
     }
 
     /* reset the auto-reconnect/re-try/auth features */
@@ -1682,10 +2046,25 @@ static EIO_Status s_VT_Wait
         assert(uuu->sock);
         return SOCK_Wait(uuu->sock, eIO_Read, timeout);
     case eIO_Write:
-        /* Return 'Closed' if no more writes are allowed (and now - reading) */
-        return uuu->can_connect == fCC_None
-            ||  (uuu->sock  &&  uuu->can_connect == fCC_Once)
-            ? eIO_Closed : eIO_Success;
+        if (uuu->can_connect == fCC_None)
+            return eIO_Closed;
+        if (!x_IsWriteThru(uuu)) {
+            return uuu->sock  &&  uuu->can_connect == fCC_Once
+                ? eIO_Closed : eIO_Success;
+        }
+        if (!uuu->sock  &&  !BUF_Size(uuu->w_buf))
+            return eIO_Success;
+        if (!uuu->sock  ||  uuu->conn_state < eCS_ReadHeader) {
+            status = s_ConnectAndSend(uuu, timeout, eEM_Flush);
+            if (status != eIO_Success)
+                return status;
+        } else
+            return uuu->can_connect == fCC_Once ? eIO_Closed : eIO_Success;
+        assert(uuu->sock);
+        assert(uuu->conn_state < eCS_ReadHeader  &&  !uuu->w_len);
+        return uuu->conn_state < eCS_FlushRequest
+            ? SOCK_Wait(uuu->sock, eIO_Write, timeout)
+            : eIO_Success;
     default:
         assert(0);
         break;
@@ -1702,13 +2081,23 @@ static EIO_Status s_VT_Write
  const STimeout* timeout)
 {
     SHttpConnector* uuu = (SHttpConnector*) connector->handle;
+    EIO_Status status;
+
+    assert(!*n_written);
 
-    /* if trying to "WRITE" after "READ" then close the socket,
-     * and so switch to "WRITE" mode */
-    if (uuu->sock) {
-        EIO_Status status = s_Disconnect(uuu, timeout,
-                                         uuu->flags & fHTTP_DropUnread
-                                         ? eEM_Drop : eEM_Read);
+    /* store the write timeout */
+    if (timeout) {
+        uuu->ww_timeout = *timeout;
+        uuu->w_timeout  = &uuu->ww_timeout;
+    } else
+        uuu->w_timeout  = kInfiniteTimeout;
+
+    /* if trying to write after a request then close the socket,
+     * and so return to "IDLE" */
+    if (uuu->sock  &&  uuu->conn_state > eCS_WriteRequest) {
+        status = s_Disconnect(uuu, timeout,
+                              uuu->flags & fHTTP_DropUnread
+                              ? eEM_Drop : eEM_Read);
         if (status != eIO_Success)
             return status;
     }
@@ -1716,31 +2105,58 @@ static EIO_Status s_VT_Write
         return eIO_Closed; /* no more connects permitted */
     uuu->can_connect |= fCC_Once;
 
-    /* accumulate all output in the memory buffer */
+    /* check if writing is at all legitimate */
+    if (size  &&  (uuu->net_info->req_method == eReqMethod_Head  ||
+                   uuu->net_info->req_method == eReqMethod_Get)) {
+        return eIO_Closed;
+    }
+
+    /* write-through with HTTP/1.1 */
+    if (x_IsWriteThru(uuu)) {
+        if (BUF_Size(uuu->w_buf)) {
+            status = s_ConnectAndSend(uuu, timeout, eEM_Flush);
+            if (status != eIO_Success)
+                return status;
+        }
+        assert((!uuu->sock  ||  uuu->conn_state == eCS_WriteRequest)
+               &&  !uuu->w_len);
+        if (size) {
+            char prefix[80];
+            int  n = sprintf(prefix, "%" NCBI_BIGCOUNT_FORMAT_SPEC_HEX "\r\n",
+                             (TNCBI_BigCount) size);
+            BUF_Erase(uuu->w_buf);
+            if (!BUF_Write(&uuu->w_buf, prefix, (size_t) n)  ||
+                !BUF_Write(&uuu->w_buf, buf,    size)        ||
+                !BUF_Write(&uuu->w_buf, "\r\n", 2)) {
+                BUF_Erase(uuu->w_buf);
+                return eIO_Unknown;
+            }
+            *n_written = size;
+            size += n + 2;
+            uuu->w_len = size;
+            uuu->entity = 1;
+        }
+        return eIO_Success;
+    }
+
+    /* accumulate all output in a memory buffer */
     if (size  &&  (uuu->flags & fHCC_UrlEncodeOutput)) {
         /* with URL-encoding */
         size_t dst_size = 3 * size;
         void*  dst = malloc(dst_size);
         URL_Encode(buf, size, n_written, dst, dst_size, &dst_size);
-        if (*n_written != size  ||  !BUF_Write(&uuu->w_buf, dst, dst_size)) {
+        if (!*n_written
+            ||  !BUF_AppendEx(&uuu->w_buf, dst, 0, dst, dst_size)) {
             if (dst)
                 free(dst);
             return eIO_Unknown;
         }
-        free(dst);
     } else {
         /* "as is" (without URL-encoding) */
         if (!BUF_Write(&uuu->w_buf, buf, size))
             return eIO_Unknown;
         *n_written = size;
     }
-
-    /* store the write timeout */
-    if (timeout) {
-        uuu->ww_timeout = *timeout;
-        uuu->w_timeout  = &uuu->ww_timeout;
-    } else
-        uuu->w_timeout  = timeout;
     return eIO_Success;
 }
 
@@ -1752,21 +2168,25 @@ static EIO_Status s_VT_Flush
     SHttpConnector* uuu = (SHttpConnector*) connector->handle;
     EIO_Status status;
 
-    if (!(uuu->flags & fHTTP_Flushable)  ||  uuu->sock) {
-        /* The real flush will be performed on the first "READ" (or "CLOSE"),
-         * or on "WAIT". Here, we just store the write timeout, that's all...
-         * NOTE: fHTTP_Flushable connectors are able to actually flush data.
-         */
-        if (timeout) {
-            uuu->ww_timeout = *timeout;
-            uuu->w_timeout  = &uuu->ww_timeout;
-        } else
-            uuu->w_timeout  = timeout;
+    if (!uuu->sock  &&  uuu->can_connect == fCC_None)
+        return eIO_Closed;
+
+    if (timeout) {
+        uuu->ww_timeout = *timeout;
+        uuu->w_timeout  = &uuu->ww_timeout;
+    } else
+        uuu->w_timeout  = timeout;
+
+    if (!(uuu->flags & fHTTP_Flushable))
+        return eIO_Success;
+
+    if (uuu->sock
+        &&  !(x_IsWriteThru(uuu)  &&  uuu->conn_state < eCS_ReadHeader)) {
         return eIO_Success;
     }
-    if (uuu->can_connect == fCC_None)
-        return eIO_Closed;
-    status = s_PreRead(uuu, timeout, eEM_Flush);
+    status = x_IsWriteThru(uuu)
+        ? s_ConnectAndSend(uuu, timeout, eEM_Flush)
+        : s_PreRead       (uuu, timeout, eEM_Flush); 
     return BUF_Size(uuu->r_buf) ? eIO_Success : status;
 }
 
@@ -1784,6 +2204,7 @@ static EIO_Status s_VT_Read
         ? s_PreRead(uuu, timeout, extract) : eIO_Closed;
     size_t        x_read = BUF_Read(uuu->r_buf, buf, size);
 
+    assert(n_read  &&  !*n_read);
     if (x_read < size  &&  extract == eEM_Read  &&  status == eIO_Success) {
         status   = s_Read(uuu, (char*) buf + x_read, size - x_read, n_read);
         *n_read += x_read;
@@ -1923,16 +2344,17 @@ static EIO_Status s_CreateHttpConnector
     SHttpConnector* uuu;
     char*           fff;
     int/*bool*/     sid;
-    char            val[32];
 
     *http = 0;
     xxx = net_info ? ConnNetInfo_Clone(net_info) : ConnNetInfo_Create(0);
     if (!xxx)
         return eIO_Unknown;
 
-    if (xxx->req_method  &  eReqMethod_v1) {
+    if (xxx->req_method >=  eReqMethod_v1) {
         xxx->req_method &= ~eReqMethod_v1;
         xxx->version = 1;
+        if (flags & fHTTP_PushAuth)
+            xxx->http_push_auth = 1;
     }
     if (!tunnel) {
         if (xxx->req_method == eReqMethod_Connect
@@ -1948,7 +2370,10 @@ static EIO_Status s_CreateHttpConnector
             *fff = '\0';
     }
 
-    ConnNetInfo_OverrideUserHeader(xxx, user_header);
+    if (!ConnNetInfo_OverrideUserHeader(xxx, user_header)) {
+        ConnNetInfo_Destroy(xxx);
+        return eIO_Unknown;
+    }
 
     if (tunnel) {
         if (!xxx->http_proxy_host[0]  ||  !xxx->http_proxy_port) {
@@ -1977,10 +2402,10 @@ static EIO_Status s_CreateHttpConnector
     /* initialize internal data structure */
     uuu->net_info     = xxx;
 
+    uuu->parse_header = 0;
     uuu->user_data    = 0;
     uuu->adjust       = 0;
     uuu->cleanup      = 0;
-    uuu->parse_header = 0;
 
     sid = flags & fHTTP_NoAutomagicSID ? 1 : tunnel;
     uuu->skip_host    = x_FixupUserHeader(xxx, &sid);
@@ -1988,15 +2413,14 @@ static EIO_Status s_CreateHttpConnector
         flags |= fHTTP_NoAutomagicSID;
     uuu->flags        = flags;
 
-    uuu->reserved     = 0;
-    uuu->can_connect  = fCC_None;         /* will be properly set at open */
-
-    ConnNetInfo_GetValue(0, "HTTP_ERROR_HEADER_ONLY", val, sizeof(val), 0);
-    uuu->error_header = ConnNetInfo_Boolean(val);
+    uuu->unsafe_redir = flags & fHTTP_UnsafeRedirects ? eOn : eOff;
+    uuu->error_header = eDefault;
+    uuu->can_connect  = fCC_None;         /* will be properly set at open    */
+    uuu->unused       = 0;
 
     uuu->sock         = 0;
-    uuu->o_timeout    = kDefaultTimeout;  /* deliberately bad values..    */
-    uuu->w_timeout    = kDefaultTimeout;  /* ..must be reset prior to use */
+    uuu->o_timeout    = kDefaultTimeout;  /* deliberately bad values here... */
+    uuu->w_timeout    = kDefaultTimeout;  /* ...must be reset prior to use   */
     uuu->http         = 0;
     uuu->r_buf        = 0;
     uuu->w_buf        = 0;
@@ -2021,7 +2445,6 @@ static CONNECTOR s_CreateConnector
 {
     SHttpConnector* uuu;
     CONNECTOR       ccc;
-    char            val[32];
 
     if (s_CreateHttpConnector(net_info, user_header, 0/*regular*/,
                               flags, &uuu) != eIO_Success) {
@@ -2036,14 +2459,14 @@ static CONNECTOR s_CreateConnector
     }
 
     /* initialize additional internal data structure */
+    uuu->parse_header = parse_header;
     uuu->user_data    = user_data;
     uuu->adjust       = adjust;
     uuu->cleanup      = cleanup;
-    uuu->parse_header = parse_header;
 
-    ConnNetInfo_GetValue(0, "HTTP_INSECURE_REDIRECT", val, sizeof(val), 0);
-    if (ConnNetInfo_Boolean(val))
-        uuu->flags |= fHTTP_InsecureRedirect;
+    /* enable an override from outside */
+    if (!uuu->unsafe_redir)
+        uuu->unsafe_redir = eDefault;
 
     /* initialize connector structure */
     ccc->handle  = uuu;
@@ -2109,7 +2532,7 @@ extern EIO_Status HTTP_CreateTunnelEx
             sprintf(uuu->net_info->args, "[%lu]", (unsigned long) size);
         status = s_PreRead(uuu, uuu->net_info->timeout, eEM_Wait);
         if (status == eIO_Success) {
-            assert(uuu->read_state == eRS_ReadBody);
+            assert(uuu->conn_state == eCS_ReadBody);
             assert(uuu->http_code / 100 == 2);
             assert(uuu->sock);
             *sock = uuu->sock;
@@ -2128,6 +2551,7 @@ extern EIO_Status HTTP_CreateTunnelEx
     switch (http_code) {
     case 503:
         return eIO_NotSupported;
+    case 426:
     case 404:
         return eIO_InvalidArg;
     case 403:
diff --git a/c++/src/connect/ncbi_http_session.cpp b/c++/src/connect/ncbi_http_session.cpp
index c107954..dd3525b 100644
--- a/c++/src/connect/ncbi_http_session.cpp
+++ b/c++/src/connect/ncbi_http_session.cpp
@@ -1,4 +1,4 @@
-/* $Id: ncbi_http_session.cpp 465171 2015-04-17 15:05:33Z grichenk $
+/* $Id: ncbi_http_session.cpp 493038 2016-02-23 19:24:35Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -67,8 +67,7 @@ static const char* kReservedHeaders[]  = {
     "NCBI-PHID"
 };
 
-
-static const CHttpHeaders::THeaderValues kEmptyValues;
+static  CSafeStatic<CHttpHeaders::THeaderValues> kEmptyValues;
 static const char kHttpHeaderDelimiter = ':';
 
 
@@ -105,7 +104,7 @@ const CHttpHeaders::THeaderValues&
     CHttpHeaders::GetAllValues(CHeaderNameConverter name) const
 {
     THeaders::const_iterator it = m_Headers.find(name.GetName());
-    if (it == m_Headers.end()) return kEmptyValues;
+    if (it == m_Headers.end()) return kEmptyValues.Get();
     return it->second;
 }
 
@@ -145,18 +144,19 @@ void CHttpHeaders::ClearAll(void)
 
 void CHttpHeaders::ParseHttpHeader(const CTempString& headers)
 {
-    list<string> lines;
-    NStr::Split(headers, HTTP_EOL, lines);
+    list<CTempString> lines;
+    NStr::Split(headers, HTTP_EOL, lines,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     string name, value;
-    ITERATE(list<string>, line, lines) {
+    ITERATE(list<CTempString>, line, lines) {
         size_t delim = line->find(kHttpHeaderDelimiter);
         if (delim == NPOS  ||  delim < 1) {
             // No delimiter or no name before the delimiter - skip the line.
             // Can be HTTP status or an empty line.
             continue;
         }
-        name = line->substr(0, delim);
+        name  = line->substr(0, delim);
         value = line->substr(delim + 1);
         NStr::TruncateSpacesInPlace(value, NStr::eTrunc_Both);
         m_Headers[name].push_back(value);
@@ -560,7 +560,7 @@ CHttpRequest::CHttpRequest(CHttpSession& session,
 CHttpResponse CHttpRequest::Execute(void)
 {
     // Connection not open yet.
-    // Only POST supports sending form data.
+    // Only POST and PUT support sending form data.
     bool have_data = m_FormData  &&  !m_FormData.Empty();
     if ( !m_Response ) {
         x_InitConnection(have_data);
@@ -597,7 +597,7 @@ CNcbiOstream& CHttpRequest::ContentStream(void)
 
 CHttpFormData& CHttpRequest::FormData(void)
 {
-    if (m_Method != eReqMethod_Post) {
+    if ( !x_CanSendData() ) {
         NCBI_THROW(CHttpSessionException, eBadRequest,
             "Request method does not support sending data");
     }
@@ -619,6 +619,9 @@ void CHttpRequest::x_InitConnection(bool use_form_data)
             "An attempt to execute HTTP request already being executed");
     }
     SConnNetInfo* connnetinfo = ConnNetInfo_Create(0);
+    if (m_Session->GetProtocol() == CHttpSession::eHTTP_11) {
+        connnetinfo->version = 1;
+    }
     connnetinfo->req_method = m_Method;
 
     // Save headers set automatically (e.g. from CONN_HTTP_USER_HEADER).
@@ -679,7 +682,7 @@ void CHttpRequest::x_InitConnection(bool use_form_data)
 
 bool CHttpRequest::x_CanSendData(void) const
 {
-    return m_Method == eReqMethod_Post;
+    return m_Method == eReqMethod_Post  ||  m_Method == eReqMethod_Put;
 }
 
 
@@ -774,7 +777,8 @@ CHttpRequest& CHttpRequest::SetTimeout(unsigned int sec,
 
 
 CHttpSession::CHttpSession(void)
-    : m_HttpFlags(0)
+    : m_Protocol(eHTTP_10),
+      m_HttpFlags(0)
 {
 }
 
@@ -816,6 +820,26 @@ CHttpResponse CHttpSession::Post(const CUrl&     url,
 }
 
 
+CHttpResponse CHttpSession::Put(const CUrl&     url,
+                                CTempString     data,
+                                CTempString     content_type,
+                                const CTimeout& timeout,
+                                THttpRetries    retries)
+{
+    CHttpRequest req = NewRequest(url, ePut);
+    req.SetTimeout(timeout);
+    req.SetRetries(retries);
+    if ( content_type.empty() ) {
+        content_type = kContentType_FormUrlEnc;
+    }
+    req.Headers().SetValue(CHttpHeaders::eContentType, content_type);
+    if ( !data.empty() ) {
+        req.ContentStream() << data;
+    }
+    return req.Execute();
+}
+
+
 // Mutex protecting session cookies.
 DEFINE_STATIC_FAST_MUTEX(s_SessionMutex);
 
@@ -914,6 +938,52 @@ CHttpResponse g_HttpPost(const CUrl&         url,
 }
 
 
+CHttpResponse g_HttpPut(const CUrl&     url,
+                        CTempString     data,
+                        CTempString     content_type,
+                        const CTimeout& timeout,
+                        THttpRetries    retries)
+{
+    CHttpHeaders hdr;
+    return g_HttpPut(url, hdr, data, content_type, timeout, retries);
+}
+
+
+CHttpResponse g_HttpPut(const CUrl&         url,
+                        const CHttpHeaders& headers,
+                        CTempString         data,
+                        CTempString         content_type,
+                        const CTimeout&     timeout,
+                        THttpRetries        retries)
+{
+    CRef<CHttpSession> session(new CHttpSession);
+    CHttpRequest req = session->NewRequest(url, CHttpSession::ePut);
+    req.SetTimeout(timeout);
+    req.SetRetries(retries);
+    req.Headers().Merge(headers);
+
+    if ( content_type.empty() ) {
+        if ( headers.HasValue(CHttpHeaders::eContentType) ) {
+            req.Headers().SetValue(CHttpHeaders::eContentType,
+                headers.GetValue(CHttpHeaders::eContentType));
+        }
+        else {
+            req.Headers().SetValue(CHttpHeaders::eContentType,
+            kContentType_FormUrlEnc);
+        }
+    }
+    else {
+        req.Headers().SetValue(CHttpHeaders::eContentType, content_type);
+    }
+
+    if ( !data.empty() ) {
+        req.ContentStream() << data;
+    }
+
+    return req.Execute();
+}
+
+
 ///////////////////////////////////////////////////////
 //  CHttpSessionException::
 //
diff --git a/c++/src/connect/ncbi_lbos.c b/c++/src/connect/ncbi_lbos.c
new file mode 100644
index 0000000..feb646f
--- /dev/null
+++ b/c++/src/connect/ncbi_lbos.c
@@ -0,0 +1,2793 @@
+/*
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors:  Dmitriy Elisov
+ * @file
+ * File Description:
+ *   A client for service discovery API based on LBOS.
+ *   LBOS is a client for ZooKeeper cloud-based DB.
+ *   LBOS allows to announce, deannounce and resolve services.
+ */
+
+
+#include "ncbi_ansi_ext.h"
+#include <connect/ncbi_http_connector.h>
+#include "ncbi_lbosp.h"
+#include "ncbi_priv.h"
+#include <stdlib.h> /* free, realloc, calloc, malloc */
+#include <ctype.h> /* isdigit */
+
+#define            kHostportStringLength     (16+1+5)/**<
+                                                     strlen("255.255.255.255")+
+                                                     strlen(":") +
+                                                     strlen("65535")         */
+#define            kMaxLineSize              1024  /**< used to build strings*/
+                                                         
+
+#define            NCBI_USE_ERRCODE_X        Connect_LBSM /**< Used in
+                                                               CORE_LOG*_X  */
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                         STATIC VARIABLES                                  //
+/////////////////////////////////////////////////////////////////////////////*/
+
+static const char* kRoleFile                  = "/etc/ncbi/role";
+static const char* kDomainFile                = "/etc/ncbi/domain";
+#ifdef NCBI_OS_MSWIN
+    static const char* kLbosresolverFile      = "C:\\Apps\\Admin_Installs\\etc"
+                                                "\\ncbi\\lbosresolver";
+#else 
+    static const char* kLbosresolverFile      = "/etc/ncbi/lbosresolver";
+#endif
+static const char* kLBOSQuery                 = "/lbos/text/mlresolve?name=";
+
+
+/*
+ * LBOS registry section for announcement
+ */
+static const char* kLBOSAnnouncementSection    = "LBOS_ANNOUNCEMENT";
+static const char* kLBOSServiceVariable        = "SERVICE";
+static const char* kLBOSVersionVariable        = "VERSION";
+static const char* kLBOSServerHostVariable     = "HOST";
+static const char* kLBOSPortVariable           = "PORT";
+static const char* kLBOSHealthcheckUrlVariable = "HEALTHCHECK";
+static const char* kLBOSDomainVariable         = "lbos_domain";
+
+
+static SConnNetInfo* s_EmptyNetInfo         = NULL; /* Do..                  */
+static       char*   s_LBOS_CurrentDomain   = NULL; /*  ..not..              */
+static       char*   s_LBOS_Lbosresolver    = NULL; /*      ..change..       */
+static       char*   s_LBOS_CurrentRole     = NULL; /*          ..after init */
+static const int     kInitialCandidatesCount = 1;   /* For initial memory
+                                                       allocation            */
+static       int     s_LBOS_TurnedOn         = 1;   /* If LBOS cannot 
+                                                       resolve even itself,
+                                                       we turn it off for
+                                                       performance           */
+static       int     s_LBOS_Init             = 0;   /* If client has already
+                                                       been initialized      */
+
+static 
+struct SLBOS_AnnounceHandle_Tag* 
+                   s_LBOS_AnnouncedServers      = NULL;
+static 
+unsigned int       s_LBOS_AnnouncedServersNum   = 0;
+static 
+unsigned int       s_LBOS_AnnouncedServersAlloc = 0;
+/*/////////////////////////////////////////////////////////////////////////////
+//                     STATIC FUNCTION DECLARATIONS                          //
+/////////////////////////////////////////////////////////////////////////////*/
+static SSERV_Info**   s_LBOS_ResolveIPPort (const char*   lbos_address,
+                                            const char*   serviceName,
+                                            SConnNetInfo* net_info);
+static char *         s_LBOS_UrlReadAll    (SConnNetInfo* net_info, 
+                                            const char*   url, 
+                                            int*          status_code,
+                                            char**        status_message);
+static void           s_LBOS_FillCandidates(SLBOS_Data*   data,
+                                            const char*   service);
+static SLBOS_Data*    s_LBOS_ConstructData (size_t        candidatesCapacity);
+static void           s_LBOS_DestroyData   (SLBOS_Data*   data);
+static SSERV_Info*    s_LBOS_GetNextInfo   (SERV_ITER     iter,
+                                            HOST_INFO*    host_info);
+static void           s_LBOS_Initialize    (void);
+static int/*bool*/    s_LBOS_Feedback      (SERV_ITER     a,
+                                            double        b,
+                                            int           c);
+static void           s_LBOS_Close         (SERV_ITER     iter);
+static void           s_LBOS_Reset         (SERV_ITER     iter);
+static int/*bool*/    s_LBOS_Update        (SERV_ITER     iter,
+                                            const char*   text,
+                                            int           code);
+static const char*    s_LBOS_ReadDomain    (void);
+static const char*    s_LBOS_ReadRole      (void);
+static const char*    s_LBOS_ReadLbosresolver(void);
+static 
+EHTTP_HeaderParse     s_LBOS_ParseHeader   (const char*   header,
+                                            void*         /* SLBOS_UserData* */
+                                                          response,
+                                            int           server_error);
+/*LBOS is intended to answer in 0.5 sec, or is considered dead*/
+static const STimeout   kLBOSTimeout       =  {10, 500000};
+static char*            s_LBOS_Instance    =  NULL;
+static char*            s_LBOS_DTABLocal   =  NULL;
+
+static 
+unsigned short s_LBOS_Announce(const char*             service,
+                               const char*             version,
+                               const char*             host,
+                               unsigned short          port,
+                               const char*             healthcheck_url,
+                               char**                  lbos_answer,
+                               char**                  http_status_message);
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                     UNIT TESTING VIRTUAL FUNCTION TABLE                   //
+/////////////////////////////////////////////////////////////////////////////*/
+static SLBOS_Functions s_LBOS_funcs = {
+                s_LBOS_ResolveIPPort
+                ,CONN_Read
+                ,g_LBOS_ComposeLBOSAddress
+                ,s_LBOS_FillCandidates
+                ,s_LBOS_DestroyData
+                ,s_LBOS_GetNextInfo
+                ,s_LBOS_Initialize
+                ,s_LBOS_UrlReadAll
+                ,s_LBOS_ParseHeader
+                ,SOCK_GetLocalHostAddress
+                ,s_LBOS_Announce
+};
+
+
+/** Get pointer to s_LBOS_MyPort */
+///////////////////////////////////////////////////////////////////////////////
+//                  INTERNAL STORAGE OF ANNOUNCED SERVERS                    //
+///////////////////////////////////////////////////////////////////////////////
+/** Add server to list of announced servers.
+ * @attention
+ *  Intended to be used inside critical section, with caller having
+ *  locked already, so does not lock.  */
+static int  s_LBOS_FindAnnouncedServer(const char*            service,
+                                       const char*            version,
+                                       unsigned short         port,
+                                       const char*            host)
+{
+    /* For convenience, we use some aliases. Not references, because this 
+     * is not C++ */
+    struct SLBOS_AnnounceHandle_Tag** arr;
+    unsigned int* count;
+    int retval;
+    unsigned int i = 0;
+
+    arr = &s_LBOS_AnnouncedServers;
+    if (*arr == NULL)
+        return -1;
+    count = &s_LBOS_AnnouncedServersNum;
+    retval = -1;
+
+    /* Just iterate and compare */    
+    for (i = 0;  i < *count;  i++) {
+        if (strcmp(service, (*arr)[i].service) == 0 
+            &&
+            strcmp(version, (*arr)[i].version) == 0 
+            &&
+            strcmp(host, (*arr)[i].host) == 0 
+            && 
+            (*arr)[i].port == port)
+        {
+            retval = i;
+        }
+    }
+
+    return retval;
+}
+
+
+/** Remove server from list of announced servers.
+ * @attention
+ *  Intended to be used inside critical section, with caller having
+ *  locked already, so does not lock.  */
+static 
+int/*bool*/ s_LBOS_RemoveAnnouncedServer(const char*          service,
+                                         const char*          version,
+                                         unsigned short       port,
+                                         const char*          host)
+{
+    int return_code;
+    struct SLBOS_AnnounceHandle_Tag** arr;
+    unsigned int* count;
+    int pos;
+
+
+    /* If server was announced using local IP, it should be deleted
+     * with IP "0.0.0.0"                                    */
+    if (g_LBOS_StringIsNullOrEmpty(host)) {
+        host = "0.0.0.0"; /* we safely reassign, because caller should care 
+                             about memory leaks */
+    }
+    return_code = 1;
+    /* For convenience, we use some aliases. Not references, because this 
+     * is not C++ */
+    arr = &s_LBOS_AnnouncedServers;
+    if (*arr == NULL) {
+        return_code = 0;
+        goto unlock_and_return;
+    }
+    count = &s_LBOS_AnnouncedServersNum;
+
+    /* Find node to delete*/
+    pos = s_LBOS_FindAnnouncedServer(service, version, port, host);
+    if (pos == -1) {/* no such service was announced */
+        return_code = 0;
+        goto unlock_and_return;
+    }
+
+    /* Erase node data */
+    free((*arr)[pos].version);
+    free((*arr)[pos].service);
+    free((*arr)[pos].host);
+
+    /* Move all nodes to fill erased position */
+    memmove(*arr + pos, 
+            *arr + pos + 1, 
+            sizeof(**arr) * (*count - pos -1 ));
+    (*count)--;
+unlock_and_return:
+    assert(return_code == 0 || return_code == 1);
+    return return_code;
+}
+
+
+/** Add server to list of announced servers.
+ * @attention
+ *  Intended to be used inside critical section, with caller having
+ *  locked already, so does not lock.  */
+static 
+int/*bool*/ s_LBOS_AddAnnouncedServer(const char*            service,
+                                     const char*             version,
+                                     unsigned short          port,
+                                     const char*             healthcheck_url)
+{
+    int return_code;
+    struct SLBOS_AnnounceHandle_Tag handle;
+    SConnNetInfo * healthcheck_info;
+    /* For convenience, we use some aliases. Not references, because this
+     * is not C++ */
+    struct SLBOS_AnnounceHandle_Tag** arr = &s_LBOS_AnnouncedServers;
+    unsigned int* count = &s_LBOS_AnnouncedServersNum;
+    unsigned int* alloc = &s_LBOS_AnnouncedServersAlloc;
+
+    /* First we create object without using static variables, and then lock
+     * critical section and copy object to static array. This will allow to 
+     * to use most of multithreading */
+    return_code = 1;
+    /* extract host from healthcheck url */
+    healthcheck_info = ConnNetInfo_Clone(s_EmptyNetInfo);
+    healthcheck_info->host[0] = '\0'; /* to be sure that it will be
+                                           * overridden                      */
+    ConnNetInfo_ParseURL(healthcheck_info, healthcheck_url);
+
+    /* Create new element of list*/
+    handle.host = strdup(healthcheck_info->host);
+    handle.port = port;
+    handle.version = strdup(version);
+    handle.service = strdup(service);
+
+    /* We search for the same server being already announced                 */  
+    s_LBOS_RemoveAnnouncedServer(service, version, port,
+                                 healthcheck_info->host);
+    ConnNetInfo_Destroy(healthcheck_info);
+
+    /* Allocate more space, if needed */
+    if (*arr == NULL || *count == *alloc)
+    {
+        int new_size = *alloc*2 + 1;
+        struct SLBOS_AnnounceHandle_Tag* realloc_result = 
+            (struct SLBOS_AnnounceHandle_Tag*)realloc(*arr,
+                new_size * sizeof(struct SLBOS_AnnounceHandle_Tag));
+        if (realloc_result != NULL) {
+            *arr = realloc_result;
+            *alloc = new_size;
+        } else {
+            free(handle.version);
+            free(handle.service);
+            free(handle.host);
+            return_code = 0;
+            goto clear_and_exit;
+        }
+    }
+    assert(arr != NULL);
+    /* Copy handle to the end of array*/
+    (*count)++;
+    (*arr)[*count - 1] = handle;
+
+clear_and_exit:
+    return return_code;
+}
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                  SERVICE MAPPING VIRTUAL FUNCTION TABLE                   //
+/////////////////////////////////////////////////////////////////////////////*/
+static const SSERV_VTable s_lbos_op =  {
+        s_LBOS_GetNextInfo, /**< Use open()'ed iterator to get next found
+                             *   server*/
+        s_LBOS_Feedback,    /**< Not used                                    */
+        s_LBOS_Update,      /**< Not used                                    */
+        s_LBOS_Reset,       /**< Free iterator's 'data'                      */
+        s_LBOS_Close,       /**< Close iterator and free its 'data'          */
+        "lbos"              /**< name of mapper                              */
+};
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                    GLOBAL CONVENIENCE FUNCTIONS                           //
+/////////////////////////////////////////////////////////////////////////////*/
+/** Check C-string if it is not NULL and contains at least one symbol        */
+int/*bool*/ g_LBOS_StringIsNullOrEmpty(const char* const str)
+{
+    if ((str == NULL) || (strlen(str) == 0)) {
+        return 1;
+    }
+    return 0;
+}
+
+
+/** Case-insensitive string lookup. 
+ * @note
+ *  Supposes that the string can be changed! No const modifier for dest      
+ * @note
+ *  If dest or lookup is NULL or empty, returns NULL */
+const char* g_LBOS_strcasestr(const char* dest, const char* lookup)
+{
+    char* dest_lwr;
+    char* lookup_lwr;
+    const char* result;
+
+    if (g_LBOS_StringIsNullOrEmpty(dest) || g_LBOS_StringIsNullOrEmpty(lookup)) 
+    {
+        return NULL;
+    }
+    dest_lwr = strlwr(strdup(dest));
+    lookup_lwr = strlwr(strdup(lookup));
+
+    result = strstr(dest_lwr, lookup_lwr);
+    /* Set the same offset, but in original string */
+    if (result != NULL) {
+        result = dest + (result - dest_lwr);
+    }
+
+    free(dest_lwr);
+    free(lookup_lwr);
+
+    return result;
+}
+
+
+/**  Concatenate two C-strings and assign result to the left
+ *  @param dest[in, out]
+ *   Address of string to which you want to append another string. 
+ *   This address will be realloc()'ed and returned, so dest should point to 
+ *   heap and can be a result of function like strdup("my string").
+ *   If it is NULL, a new string will be created.
+ *  @param to_append[in]
+ *   String that will be copied to the end of dest. 
+ *   It will not be changed. If it is NULL or empty, and dest is not NULL,
+ *   dest will be returned. If dest is NULL, empty string will be returned.
+ *  @param dest_length[in]
+ *   Can be NULL. Optimizes performance on sequence of concatenations like
+ *   g_LBOS_StringConcat(g_LBOS_StringConcat(str,to_app1,&len), to_app2,&len).
+ *   Value of data_length on first call should be 0.
+ *  @return 
+ *   1 if success, 0 if error happened and dest was not changed              */
+char*   g_LBOS_StringConcat(char*       dest, 
+                            const char* to_append,
+                            size_t*     dest_length)
+{
+    char* realloc_result;
+    size_t dest_length_local = 0; /* not to handle if dest_length is NULL */
+    size_t append_len;
+
+    if (dest_length != NULL) {
+        dest_length_local = *dest_length;
+    }
+    if (dest == NULL) {
+        dest_length_local = 0;
+    } else if (dest_length_local == 0) {
+        dest_length_local = strlen(dest);
+    }
+    append_len = 0;
+    if (!g_LBOS_StringIsNullOrEmpty(to_append)) {
+        /* All done, in this case */
+        append_len = strlen(to_append);
+    }
+    realloc_result = (char*)realloc(dest, dest_length_local + append_len + 1);
+    if (realloc_result == NULL) {
+        CORE_LOG(eLOG_Critical, "g_LBOS_StringConcat: No RAM. Returning NULL.");
+        free(dest);
+        return NULL;
+    }
+    dest = realloc_result;
+    memcpy(dest + dest_length_local, to_append, append_len);
+    dest[dest_length_local + append_len] = '\0';
+    dest_length_local += append_len;
+    if (dest_length != NULL) {
+        *dest_length = dest_length_local;
+    }
+    return dest;
+}
+#if 0
+/* Get "tag: value" pair from HTTP header */
+char* s_LBOS_GetHTTPHeader(const char* tag, const char* headers)
+{
+    char* tag_lwr = strlwr(strdup(tag));
+    char* header_lwr = strlwr(strdup(headers));
+    char* tag_start = header_lwr, *tag_end;
+    while (tag_start != NULL)
+    {
+        /* We move bit by bit */
+        tag_start = strstr(tag_start, tag_lwr);
+        /* We want to be sure that found tag is the tag itself,
+         * not a value as if in "Some-Tag: tag: 2". So we check for
+         * either \n before tag, or it should be positioned at the very
+         * beginning of the string
+         */
+        if  (
+                tag_start != NULL
+                &&
+                (
+                    (*(tag_start - 1) == '\n')
+                    ||
+                    (tag_start == header_lwr)
+                )
+            ) 
+            {
+                /* Look for the end of tag: value */
+                while ()
+            }
+        else {
+            tag_start = 
+
+        if (d)
+    }
+}
+
+
+char* g_LBOS_CombineDTabs(const char* primary_dtab, const char* secondary_dtab)
+{
+    char* primary_dtab, *primary_dtab_end, *new_dtab;
+    int length, primary_dtab_length;
+    primary_dtab += strlen("DTab-Local:");
+    if (primary_dtab[1] == ' ') {
+        primary_dtab++;
+    }
+    /* Find end of line */
+    primary_dtab_end = strchr(primary_dtab, '\n');
+    if (primary_dtab_end[-1] == '\r')  {
+        primary_dtab_end--;
+    }
+    /* Create new string that includes first DTabs from registry and then
+    * DTabs from HTTP requests */
+    length = 0;
+    primary_dtab_length = primary_dtab_end - primary_dtab;
+    new_dtab = NULL;
+    new_dtab = g_LBOS_StringNConcat(g_LBOS_StringConcat(
+               g_LBOS_StringConcat(g_LBOS_StringConcat(
+                 /*dest*/   /*to append*/     /*length*/  /*count*/
+                 new_dtab,  "DTab-local: ",   &length),
+                            secondary_dtab,   &length),
+                            ";",              &length),
+                            primary_dtab,     &length,    primary_dtab_length);
+    return new_dtab;
+}
+#endif
+
+char*   g_LBOS_StringNConcat(char*       dest,
+                             const char* to_append,
+                             size_t*     dest_length,
+                             size_t      count)
+{
+    char* buf = (char*)malloc((count + 1) * sizeof(char));
+    char* result;
+
+    if (buf == NULL) {
+        CORE_LOG(eLOG_Critical, 
+                 "g_LBOS_StringConcat: No RAM. Returning NULL.");
+        free(buf);
+        free(dest);
+        return NULL;
+    }
+    memcpy(buf, to_append, count);
+    buf[count] = '\0';
+    result = g_LBOS_StringConcat(dest, buf, dest_length);
+    free(buf);
+    return result;
+}
+
+
+/* Wrapper of CORE_REG_GET that eliminates the need to know the length of the
+ * parameter being read*/
+char*   g_LBOS_RegGet(const char* section,
+                      const char* name,
+                      const char* def_value)
+{
+    size_t    totalBufSize     = kMaxLineSize;
+    char*     realloc_result   = NULL;
+    char*     buf              = (char*)malloc(totalBufSize * sizeof(char));
+
+    if (buf == NULL) {
+        CORE_LOG(eLOG_Critical, "g_LBOS_RegGet: No RAM. Returning NULL.");
+        return buf;
+    }
+    for (;;) {
+        CORE_REG_GET(section, name, buf, totalBufSize, def_value);
+        /* If we had enough space allocated */
+        if (strlen(buf) < totalBufSize-1) {
+            break;
+        }
+        /* If we (possibly) did not have enough space allocated
+           then add space to buffer  */
+        realloc_result = (char*)realloc(buf, sizeof(char)*(totalBufSize * 2));
+        if (realloc_result == NULL) {
+            CORE_LOG(eLOG_Warning, "g_LBOS_RegGet: Buffer "
+                                    "overflow while reading from "
+                                    "registry. Returning string at its "
+                                    "maximum size");
+            return buf;
+        } else {
+            buf = realloc_result;
+            totalBufSize *= 2;
+        }
+    }
+    return buf;
+}
+
+
+/**  We compose LBOS hostname based on /etc/ncbi/domain and /etc/ncbi/role.  */
+char* g_LBOS_ComposeLBOSAddress(void)
+{
+    char* site = NULL;
+    size_t length = 0;
+    const char *role   = s_LBOS_ReadRole(), 
+               *domain = s_LBOS_ReadDomain();
+
+    if (role == NULL || domain == NULL) {
+        return NULL;
+    }
+    site = g_LBOS_StringConcat(g_LBOS_StringConcat(
+                g_LBOS_StringConcat(g_LBOS_StringConcat(
+                /* dest */    /* to append */        /* length */
+                site,          "lbos.",              &length),
+                               role,                 &length),
+                               ".",                  &length),
+                               domain,               &length);
+    if (site == NULL) {
+        CORE_LOG(eLOG_Warning, "s_LBOS_ComposeLBOSAddress: "
+                                 "memory allocation failed");
+        return NULL;
+    }
+    return site;
+}
+
+
+/** Checks iterator, fact that iterator belongs to this mapper, iterator data.
+ * Only debug function.                                                      */
+int/*bool*/ g_LBOS_CheckIterator(SERV_ITER              iter,
+                                 ELBOSIteratorCheckType should_have_data)
+{
+    assert(iter != NULL);  /* we can do nothing if this happens */
+    if (should_have_data == ELBOSIteratorCheckType_MustHaveData) {
+        if (iter->data == NULL) {
+            return 0;
+        }
+        assert(((SLBOS_Data*)iter->data)->a_cand >= 
+            ((SLBOS_Data*)iter->data)->n_cand);
+        assert(((SLBOS_Data*)iter->data)->pos_cand <=
+            ((SLBOS_Data*)iter->data)->n_cand);
+    }
+    if (should_have_data == ELBOSIteratorCheckType_DataMustBeNULL 
+        && iter->data != NULL) {
+        return 0;
+    }
+    if (strcmp(iter->op->mapper, s_lbos_op.mapper) != 0) {
+        return 0;
+    }
+    return 1;
+}
+
+
+/** Given address to LBOS instance, check if it resides in the same domain
+ * (be-md, st-va, ac-va, or-wa) as current machine                           */
+int/*bool*/ g_LBOS_CheckDomain(const char* lbos_address)
+{
+    return 1; /* we do not check domain */
+    /* Though we cannot be 100% sure that sequence of numbers and dots is IP, 
+     * it is what we hope for */
+    int/*bool*/ is_ip = 1;
+    unsigned short int i;
+    for (i = 0; i < strlen(lbos_address); i++) {
+        if (!isdigit(lbos_address[i]) && lbos_address[i] != '.') {
+            is_ip = 0;
+        }
+    }
+    /*  The check now is really simple - it searches for known domains in the
+     * provided address. If domain is omitted in address - then we deny such 
+     * address, just in case. If address contains 
+     * non-standard domain - check will not work. */
+    if ( !is_ip
+         /* &&
+         (
+            (strstr(lbos_address, ".be-md.") != NULL) 
+             || 
+            (strstr(lbos_address, ".st-va.") != NULL)
+             ||
+            (strstr(lbos_address, ".or-wa.") != NULL)
+             ||
+            (strstr(lbos_address, ".ac-va.") != NULL)
+         ) */
+         &&
+         (
+            !g_LBOS_StringIsNullOrEmpty(s_LBOS_ReadDomain())
+         )
+         &&
+         (
+             strcmp(s_LBOS_ReadDomain(), "*") != 0
+         )
+       )
+    {
+        /* If we can perform check, we return result of check */
+        return (strstr(lbos_address, s_LBOS_ReadDomain()) != NULL);
+    }
+    /* If we cannot perform check, we allow any domain */
+    return 1;
+}
+
+
+/**  This function is needed to get LBOS hostname in different situations.
+ *  @param priority_find_method[in]
+ *   The first method to try to find LBOS. If it fails, default order of
+ *   methods will be used to find LBOS.
+ *   Default order is:
+ *   1) registry value of [CONN]->lbos;
+ *   2) 127.0.0.1:8080;
+ *   3) LBOS for current /etc/ncbi/{role, domain}.
+ *   To not specify default method, use eLBOSFindMethod_None.
+ *  @param lbos_addr[in]
+ *   If priority_find_method is eLBOSFindMethod_CustomHost, then LBOS is
+ *   first looked for at hostname:port specified in this variable.           */
+char* g_LBOS_GetLBOSAddressEx (ELBOSFindMethod priority_find_method,
+                                const char* lbos_addr)
+{
+    const char* lbosaddress = NULL; /* for const strings */
+    char* lbosaddress_temp = NULL;  /* for non-const strings */
+    char* address = NULL;
+    /* List of methods used, in their order */
+    ELBOSFindMethod find_method_order[] = {
+               priority_find_method /* eLBOSFindMethod_None, if not specified*/
+               , eLBOSFindMethod_Registry
+               , eLBOSFindMethod_Lbosresolve
+    };
+    size_t find_method_iter;
+    size_t find_method_count = 
+        sizeof(find_method_order) / sizeof(ELBOSFindMethod);
+    CORE_LOG_X(1, eLOG_Trace, "Getting LBOS addresses...");
+    /* Iterate through methods of finding LBOS address */
+    for (find_method_iter = 0;  
+         find_method_iter < find_method_count;
+         ++find_method_iter)
+    {
+        /* If LBOS address has been filled - we're done */
+        if (address != NULL)
+            break;
+        switch (find_method_order[find_method_iter]) {
+        case eLBOSFindMethod_None :
+            break;
+        case eLBOSFindMethod_CustomHost :
+            if (g_LBOS_StringIsNullOrEmpty(lbos_addr)) {
+                CORE_LOG_X(1, eLOG_Warning, "Use of custom LBOS address was "
+                           "asked for, but no custom address was supplied. "
+                           "Using default LBOS.");
+                break;
+            }
+            address = strdup(lbos_addr);
+            if (address == NULL) {
+                CORE_LOG_X(1, eLOG_Warning, "Did not manage to copy custom "
+                           "LBOS address. Probably insufficient RAM.");
+            }
+            break;
+        case eLBOSFindMethod_Lbosresolve :
+#if defined NCBI_OS_LINUX || defined NCBI_OS_MSWIN
+            lbosaddress = s_LBOS_ReadLbosresolver();
+            if (g_LBOS_StringIsNullOrEmpty(lbosaddress)) {
+                CORE_LOG_X(1, eLOG_Warning, "Trying to find LBOS using "
+                           "/etc/ncbi/lbosresolve failed");
+            } else {
+                address = strdup(lbosaddress);
+            }
+#endif
+            break;
+        case eLBOSFindMethod_Registry:
+            lbosaddress_temp = g_LBOS_RegGet("CONN", "lbos", NULL);
+            if (g_LBOS_StringIsNullOrEmpty(lbosaddress_temp)) {
+                CORE_LOG_X(1, eLOG_Warning, "Trying to find LBOS in "
+                                            "registry [CONN]lbos failed. "
+                                            "Using address in "
+                                            "/etc/ncbi/lbosresolver");
+                free(lbosaddress_temp); /* just in case */
+                lbosaddress_temp = NULL;
+                break;
+            }
+            address = lbosaddress_temp;
+            break;
+        }
+    }
+    return address;
+}
+
+
+/* Get possible addresses of LBOS in default order */
+char* g_LBOS_GetLBOSAddress(void)
+{
+    return g_LBOS_GetLBOSAddressEx(eLBOSFindMethod_None, NULL);
+}
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                    STATIC CONVENIENCE FUNCTIONS                           //
+/////////////////////////////////////////////////////////////////////////////*/
+/** Get role of current host. Returned string is read-only, may reside in 
+ * 'data' memory area                                                        */
+static const char* s_LBOS_ReadRole()
+{
+    /*
+     * If no role previously read, fill it. Of course, not on MSWIN
+     */
+#ifdef NCBI_OS_LINUX
+    if (s_LBOS_CurrentRole == NULL) {
+        size_t len;
+        char str[kMaxLineSize];
+        char* read_result; /* during function will become equal either NULL 
+                              or str, do not free() */
+        FILE* role_file;
+        char *role; /* will be used to set s_LBOS_CurrentRole, do not free() */
+        if ((role_file = fopen(kRoleFile, "r")) == NULL) {
+            /* No role recognized */
+            CORE_LOGF(eLOG_Warning, ("s_LBOS_ReadRole: "
+                                     "could not open role file %s",
+                                     kRoleFile));
+            return NULL;
+        }
+        read_result = fgets(str, sizeof(str), role_file);
+        fclose(role_file);
+        if (read_result == NULL) {
+            CORE_LOG(eLOG_Warning, "s_LBOS_ReadRole: "
+                                     "memory allocation failed");
+            return NULL;
+        }
+        len = strlen(str);
+        assert(len);
+        /*We remove unnecessary '/n' and probably '/r'   */
+        if (str[len - 1] == '\n') {
+            if (--len && str[len - 1] == '\r')
+                --len;
+            str[len] = '\0';
+        }
+        if (strncasecmp(str, "try", 3) == 0)
+            role = "try";
+        else {
+            if (strncasecmp(str, "qa", 2) == 0)
+                role = "qa";
+            else {
+                if (strncasecmp(str, "dev", 3) == 0)
+                    role = "dev";
+                else {
+                    if (strncasecmp(str, "prod", 4) == 0)
+                        role = "prod";
+                    else {
+                        /* No role recognized */
+                        CORE_LOGF(eLOG_Warning,
+                            ("s_LBOS_ComposeLBOSAddress"
+                                ": could not recognize role [%s] in %s",
+                                str, kRoleFile));
+                        return NULL;
+                    }
+                }
+            }
+        }
+        CORE_LOCK_WRITE;
+        /* Check one more time that no other thread managed to fill
+            * static variable ahead of this thread. If this happened,
+            * release memory */
+        if (s_LBOS_CurrentRole == NULL)
+            s_LBOS_CurrentRole = strdup(role);
+        CORE_UNLOCK;
+    }
+#endif /* #ifdef NCBI_OS_LINUX */
+    return s_LBOS_CurrentRole;
+}
+
+
+/** Get domain of current host. Do not modify or clear the returned string!
+ * Returned string is read-only, may reside in 'data' memory area            */
+static const char* s_LBOS_ReadDomain()
+{
+    /*
+     * If no domain has been previously read, fill it
+     */
+    if (s_LBOS_CurrentDomain == NULL) {
+        char* registry_domain = NULL; /* if registry has domain specified
+                                       * for LBOS First, we check registry
+                                       * and then if nothing there, we check
+                                       * /etc/ncbi/domain                    */
+        registry_domain = g_LBOS_RegGet("CONN", kLBOSDomainVariable, NULL);
+        CORE_LOCK_WRITE;
+        if (!g_LBOS_StringIsNullOrEmpty(registry_domain)
+                && s_LBOS_CurrentDomain == NULL)
+        {
+            s_LBOS_CurrentDomain = registry_domain;
+        } else {
+            free(registry_domain);
+        }
+        CORE_UNLOCK;
+        if (s_LBOS_CurrentDomain != NULL)
+            return s_LBOS_CurrentDomain;
+
+#ifdef NCBI_OS_LINUX
+        else { /* If nothing found in registry, check /etc/ncbi/domain */
+            FILE* domain_file;
+            size_t len;
+            char str[kMaxLineSize];
+            char* read_result; /* during function will become equal either NULL 
+                               or str, do not free() */
+            if ((domain_file = fopen(kDomainFile, "r")) == NULL) {
+                CORE_LOGF(eLOG_Warning, ("s_LBOS_ReadDomain: "
+                                         "could not open domain file %s",
+                                         kDomainFile));
+                return NULL;
+            }
+            read_result = fgets(str, sizeof(str), domain_file);
+            fclose(domain_file);
+            if (read_result == NULL) {
+                CORE_LOG(eLOG_Warning, "s_LBOS_ReadDomain: "
+                                       "memory allocation failed");
+                return NULL;
+            }
+            len = strlen(str);
+            assert(len);
+            /*We remove unnecessary '/n' and probably '/r'   */
+            if (str[len - 1] == '\n') {
+                if (--len && str[len - 1] == '\r')
+                    --len;
+                str[len] = '\0';
+            }
+            if (g_LBOS_StringIsNullOrEmpty(str)) {
+                /* No domain recognized */
+                CORE_LOGF(eLOG_Warning,
+                          ("s_LBOS_ComposeLBOSAddress: domain file"
+                          "%s is empty, skipping this method",
+                          kDomainFile));
+                free(read_result);
+                return NULL;
+            }
+            CORE_LOCK_WRITE;
+            /* Check one more time that no other thread managed to fill
+                * static variable ahead of this thread. If this happened,
+                * release memory */
+            if (s_LBOS_CurrentDomain == NULL)
+                s_LBOS_CurrentDomain = strdup(str);
+            CORE_UNLOCK;
+        }
+#endif /* #ifdef NCBI_OS_LINUX */
+    }
+    return s_LBOS_CurrentDomain;
+}
+
+
+/** Get domain of current host. Do not modify or clear the returned string!
+ * Returned string is read-only, may reside in 'data' memory area            */
+static const char* s_LBOS_ReadLbosresolver(void)
+{
+#ifdef NCBI_OS_LINUX
+    if (s_LBOS_Lbosresolver == NULL) {
+        FILE* lbosresolver_file;
+        size_t len;
+        char str[kMaxLineSize];
+        char* read_result; /* during function will become equal either NULL
+                           or str, do not free() */
+        if ((lbosresolver_file = fopen(kLbosresolverFile, "r")) == NULL) {
+            CORE_LOGF(eLOG_Warning, ("LBOS mapper: "
+                                     "could not open lbosresolve file %s",
+                                     kLbosresolverFile));
+            return NULL;
+        }
+        read_result = fgets(str, sizeof(str), lbosresolver_file);
+        fclose(lbosresolver_file);
+        if (read_result == NULL) {
+            CORE_LOG(eLOG_Warning, "s_LBOS_ReadLBOSResolve: "
+                                   "memory allocation failed");
+            return NULL;
+        }
+        len = strlen(str);
+        assert(len);
+        /*We remove unnecessary '/n' and probably '/r'   */
+        if (str[len - 1] == '\n') {
+            if (--len && str[len - 1] == '\r')
+                --len;
+            str[len] = '\0';
+        }
+        if (g_LBOS_StringIsNullOrEmpty(str)) {
+            /* No domain recognized */
+            CORE_LOGF(eLOG_Warning,
+                      ("LBOS mapper: /etc/ncbi/lbosresolve file"
+                      "%s is empty, no LBOS address available",
+                      kLbosresolverFile));
+            free(read_result);
+            return NULL;
+        }
+        CORE_LOCK_WRITE;
+        /* Check one more time that no other thread managed to fill
+            * static variable ahead of this thread. If this happened,
+            * release memory */
+        if (s_LBOS_Lbosresolver == NULL)
+            /* We skip "http://" and "/lbos" */
+            str[strlen(str) - strlen("/lbos")] = '\0';
+            s_LBOS_Lbosresolver = strdup(str + 7);
+        CORE_UNLOCK;
+    }
+#endif /* #ifdef NCBI_OS_LINUX */
+    return s_LBOS_Lbosresolver;
+}
+
+
+/**   Takes original string and returns URL-encoded string. Original string
+ *  is untouched.
+ */
+char* s_LBOS_URLEncode (const char* to_encode)
+{
+    /* If all symbols are escape, our string will take triple space */
+    size_t encoded_string_buf_size = strlen(to_encode)*3 + 1;
+    char* encoded_string = (char*)calloc(encoded_string_buf_size, 
+                                         sizeof(char));
+    size_t src_read, dst_written; /*strange things needed by URL_Encode*/
+    URL_Encode(to_encode, strlen(to_encode), &src_read,
+               encoded_string, encoded_string_buf_size, &dst_written);
+    return encoded_string;
+}
+
+
+/** @brief Just connect and return connection
+ *
+ *  Internal function to create connection, which simplifies process
+ *  by ignoring many settings and making them default
+ */
+static CONN s_LBOS_ConnectURL(SConnNetInfo* net_info, const char* url,
+                              SLBOS_UserData* user_data)
+{
+    THTTP_Flags         flags        = fHTTP_AutoReconnect | fHTTP_Flushable;
+    CONN                conn;
+    CONNECTOR           connector;
+
+    CORE_LOGF(eLOG_Note, ("Parsing URL \"%s\"", url));
+    if (!ConnNetInfo_ParseURL(net_info, url)) {
+        CORE_LOG(eLOG_Warning, "Cannot parse URL");
+        return NULL;
+    }
+    CORE_LOGF(eLOG_Note, ("Creating HTTP%s connector",
+            &"S"[net_info->scheme != eURL_Https]));
+    if (!(connector = HTTP_CreateConnectorEx(net_info, flags,
+                      g_LBOS_UnitTesting_GetLBOSFuncs()->ParseHeader,
+                      user_data/*data*/, 0, 
+                      0/*cleanup*/))) 
+    {
+        CORE_LOG(eLOG_Warning, "Cannot create HTTP connector");
+        return NULL;
+    }
+    CORE_LOG(eLOG_Note, "Creating connection");
+    if (CONN_Create(connector, &conn) != eIO_Success) {
+        CORE_LOG(eLOG_Warning, "Cannot create connection");
+        return NULL;
+    }
+    /*
+     * We define very little timeout so that we can quickly iterate
+     * through LBOSes (they should answer in no more than 0.5 second)
+     */
+    CONN_SetTimeout(conn, eIO_Open,      &kLBOSTimeout);
+    CONN_SetTimeout(conn, eIO_ReadWrite, &kLBOSTimeout);
+    return conn;
+}
+
+
+/** If you are sure that all answer will fit in one char*, use this function
+ * to read all input. Must be free()'d by the caller.
+ */
+static char * s_LBOS_UrlReadAll(SConnNetInfo*   net_info, 
+                                const char*     url, 
+                                int*            status_code,
+                                char**          status_message)
+{
+    SLBOS_UserData user_data; /* used to store HTTP response code and 
+                                 HTTP header, HTTP header only for unit 
+                                 testing */
+    /* Status of reading*/
+    EIO_Status    status = eIO_Timeout;
+    /* how much how been read to the moment*/
+    size_t        totalRead        = 0;
+    /* how much we suppose one line takes*/
+    size_t        oneLineSize      = kMaxLineSize;
+    /* how much bytes was read in one turn*/
+    size_t        bytesRead        = 0;    
+    /* Connection to LBOS. We do not know if LBOS really exists at url */
+    CONN          conn;
+    char*         buf;
+    size_t        totalBufSize;
+    char*         realloc_result;
+
+    /* Not to handle case when status_code is NULL, we use internal variable,
+       and only try to set status_code in the end of this function */
+    user_data.http_response_code = 0;
+    /* The same for status_message */
+    user_data.http_status_mesage = NULL;
+    net_info->max_try = 1; /* we do not need to try more than once */
+    /* Set HTTP header for unit testing. Pointer to already existing string. */
+    user_data.header = net_info->http_user_header;
+    /* Set content length to the maximum possible value */
+    user_data.content_length = (size_t)-1; 
+    conn = s_LBOS_ConnectURL(net_info, url, &user_data);
+    if (conn == NULL) {
+        return NULL;
+    }
+    CONN_SetUserData(conn, &user_data);
+    buf              = (char*)calloc(oneLineSize, sizeof(char));
+    /* Total length of buffer. We already have oneLineSize because of calloc */
+    totalBufSize     = oneLineSize;    
+    if (buf == NULL)
+    {
+        CORE_LOG(eLOG_Critical, "s_LBOS_UrlReadAll: No RAM. "
+                                "Returning NULL.");
+        CONN_Close(conn);
+        return NULL;
+    }
+    do {
+        /* If there is no LBOS, we will know about it here */
+        status = g_LBOS_UnitTesting_GetLBOSFuncs()->
+                          Read(conn, buf + strlen(buf),
+                               totalBufSize - totalRead - 1 /* for \0 */,
+                               &bytesRead, eIO_ReadPlain);
+        if (user_data.http_response_code != 200) {
+            CORE_LOGF(eLOG_Critical, ("s_LBOS_UrlReadAll: LBOS returned "
+                                      "status code %d", 
+                                      user_data.http_response_code));
+        }
+        if (status_code != NULL) {
+            *status_code = user_data.http_response_code;
+        }
+        if (status_message != NULL && user_data.http_status_mesage != NULL) {
+            *status_message = strdup(user_data.http_status_mesage);
+        }
+        free(user_data.http_status_mesage); /* not needed anymore*/
+        user_data.http_status_mesage = NULL;
+        /* If could not connect, fail now */
+        if (user_data.http_response_code == 0) {
+            free(buf);
+            CONN_Close(conn);
+            return NULL;
+        }
+        totalRead += bytesRead;
+
+        buf[totalRead] = 0; /* force end of string */
+#if 0
+        /* If we have read enough and use PUT or DELETE methods,
+         * exit this loop */
+        if (
+                totalRead >= user_data.content_length
+                /*&&
+                (   net_info->req_method == eReqMethod_Put
+                    ||
+                    net_info->req_method == eReqMethod_Delete
+                )*/
+            )
+        {
+            CONN_Flush(conn);
+            CONN_SetTimeout(conn, eIO_Close, &kLBOSZeroTimeout);
+            SOCK_CloseEx(sock, 0/*retain SOCK*/);
+            break;
+        }
+#endif
+        /* IF we still have to read - then add space to buffer, if needed  */
+        if ( status == eIO_Success && totalBufSize < totalRead * 2 )
+        {
+            realloc_result = (char*)realloc(buf, 
+                                            sizeof(char) * (totalBufSize * 2));
+            if (realloc_result == NULL) {
+                CORE_LOG(eLOG_Warning, "s_LBOS_UrlReadAll: Buffer "
+                                        "overflow. Returning string at its "
+                                        "maximum size");
+                return buf;
+            } else {
+                buf = realloc_result;
+                totalBufSize *= 2;
+            }
+        }
+    } while (status == eIO_Success);
+    /*In the end we shrink buffer to the minimal needed size*/
+    if ( !(realloc_result = (char*) realloc(buf,
+                                           sizeof(char) * (strlen(buf) + 1))) ) 
+    {
+        CORE_LOG(eLOG_Warning, "s_LBOS_UrlReadAll: Buffer shrink error, using "
+                               "original stirng");
+    }  else  {
+        buf = realloc_result;
+    }
+    CONN_Close(conn);
+    return buf;
+}
+
+
+/**   Resolve service name to one of the hosts implementing service.
+ *   Uses LBZK at specified IP and port.
+ */
+static SSERV_Info** s_LBOS_ResolveIPPort(const char* lbos_address,
+                                         const char* serviceName,
+                                         SConnNetInfo* net_info)
+{ 
+    SSERV_Info** infos;
+    size_t infos_count;
+    size_t infos_capacity;
+    char* servicename_url_encoded = NULL;
+    size_t url_length;
+    char * url;
+    char * lbos_answer; /*to write down LBOS's answer*/
+    const char* user_dtab = NULL; 
+    size_t length;
+    size_t user_dtab_length;
+    char* new_dtab = NULL;
+    char* user_dtab_end;
+    char* token = NULL, *saveptr = NULL, *str = NULL, *opt_param = NULL;
+#ifdef _DEBUG
+    char hostport[kHostportStringLength]; //just for debug
+#endif
+    /* Allocate space for answer (will be expanded later, if needed) */
+    infos = (SSERV_Info**)calloc(2, sizeof(SSERV_Info*));
+    if (infos == NULL) {
+        CORE_LOG(eLOG_Critical, "s_LBOS_ResolveIPPort: No RAM. "
+                                "Returning NULL.");
+        return NULL;
+    }
+    infos_count = 0;
+    infos_capacity = 1;
+    /* Update HTTP Header with local DTabs from registry and revert after we 
+     * finished reading from URL */
+    /* First, we look if there is DTab-Local already in header*/
+    char* old_header = net_info->http_user_header ?
+            strdup(net_info->http_user_header) : NULL;
+    user_dtab = g_LBOS_strcasestr(net_info->http_user_header, 
+                                              "DTab-local:");
+    /* If there is an already defined local DTab, we mix it with one from 
+     * registry */
+    if (user_dtab != NULL) 
+    {
+        /* Move start after name of tag*/
+        user_dtab += strlen("DTab-Local:");
+        if (user_dtab[1] == ' ') {
+            user_dtab++;
+        }
+        /* Find end of line */
+        user_dtab_end = strchr(user_dtab, '\n');
+        if (user_dtab_end[-1] == '\r')  {
+            user_dtab_end--;
+        }
+        /* Create new string that includes first DTabs from registry and then
+         * DTabs from HTTP requests */
+        length = 0;
+        user_dtab_length = user_dtab_end - user_dtab;
+        new_dtab = NULL;
+        new_dtab = g_LBOS_StringNConcat(g_LBOS_StringConcat(
+            g_LBOS_StringConcat(g_LBOS_StringConcat(
+            /*dest*/   /*to append*/       /*length*/   /*count*/
+            new_dtab,   "DTab-local: ",     &length), 
+                        s_LBOS_DTABLocal,   &length),
+                        ";",                &length),
+                        user_dtab,          &length,    user_dtab_length);
+        ConnNetInfo_OverrideUserHeader(net_info, new_dtab);
+        free(new_dtab);
+    } else {
+        /* Set default Dtab from registry */
+        size_t length = 0;
+        char* new_dtab = NULL;
+        new_dtab = g_LBOS_StringConcat(g_LBOS_StringConcat(
+            /*dest*/   /*to append*/       /*length*/   /*count*/
+            new_dtab,   "DTab-local: ",     &length), 
+                        s_LBOS_DTABLocal,   &length);
+        ConnNetInfo_OverrideUserHeader(net_info, new_dtab);
+        free(new_dtab);
+    }
+    servicename_url_encoded = s_LBOS_URLEncode(serviceName);
+  /*encode service name to url encoding (change ' ' to %20, '/' to %2f, etc.)*/
+    url_length = strlen("http://") + strlen(lbos_address) +
+            strlen(kLBOSQuery) + strlen(servicename_url_encoded);
+    url = (char*)malloc(sizeof(char) * url_length + 1); /** to make up
+                                                   LBOS query URI to connect*/
+    if (url == NULL)
+    {
+        CORE_LOG(eLOG_Critical, "s_LBOS_ResolveIPPort: No RAM. "
+                                "Returning NULL.");
+        free(infos);
+        free(old_header);
+        free(servicename_url_encoded);
+        return NULL;
+    }
+    sprintf(url, "%s%s%s%s", "http://", lbos_address, kLBOSQuery,
+            servicename_url_encoded);
+    lbos_answer = s_LBOS_UrlReadAll(net_info, url, NULL, NULL);
+    /* Revert header */
+    ConnNetInfo_OverrideUserHeader(net_info, old_header);
+    free(old_header);
+    free(url);
+    free(servicename_url_encoded);
+    /* If no connection */
+    if (lbos_answer == NULL) {
+        free(infos);
+        return NULL;
+    }
+    /*
+     * We read all the answer, find host:port in the answer and fill
+     * 'hostports', occasionally reallocating array, if needed
+     */
+    for (str = lbos_answer  ;  ;  str = NULL) {
+        SSERV_Info * info;
+#ifdef NCBI_COMPILER_MSVC
+        token = strtok_s(str, "\n", &saveptr);
+#else
+        token = strtok_r(str, "\n", &saveptr);
+#endif
+        if (token == NULL) {
+            break;
+        }
+        if ((opt_param = strstr(token, " | ")) != NULL) {
+            *opt_param = 0;
+        }
+        info = SERV_ReadInfoEx(token, serviceName, 0);
+        /* Occasionally, the info returned by LBOS can be invalid. */
+        if (info == NULL) {
+            continue;
+        }
+        /* We check if we have at least two more places: one for current
+            * info and one for finalizing NULL
+            */
+        if (infos_capacity <= infos_count + 1) {
+            SSERV_Info** realloc_result = (SSERV_Info**)realloc(infos,
+                    sizeof(SSERV_Info*) * (infos_capacity*2 + 1));
+            if (realloc_result == NULL) {
+                /* If error with realloc, return as much as could allocate
+                    * for*/
+                infos_count--; /*Will just rewrite last info with NULL to
+                                    mark end of array*/
+                break;
+            } else { /*If realloc successful */
+                infos = realloc_result;
+                infos_capacity = infos_capacity*2 + 1;
+            }
+        }
+        infos[infos_count++] = info;
+#ifdef _DEBUG
+        SOCK_HostPortToString(info->host, info->port, hostport,
+                kHostportStringLength);
+        /*Copy IP from stream to the result char array*/
+        CORE_LOGF(eLOG_Note, ("Resolved [%s] to [%s]", serviceName, hostport));
+#endif
+    }
+    free(lbos_answer);
+    /* Shuffle list with Durstenfeld's shuffle algorithm 
+     * (also credits go to Fisher and Yates, and Knuth) */
+    if (infos_count > 1) {
+        size_t i;
+        for (i = 0; i < infos_count - 1; i++) {
+            size_t j = i + ( rand() % (infos_count - i) );
+            if (i == j) continue; /* not swapping the item with itself */
+            SSERV_Info* t = infos[j];
+            infos[j] = infos[i];
+            infos[i] = t;
+        }
+    }
+    /* Set last element this NULL, finalizing the array ...*/
+    infos[infos_count] = NULL;
+
+    return infos; 
+}
+
+
+/** Given an empty iterator which has service name in its "name" field
+ * we fill it with all servers which were found by asking LBOS
+ * @param[in,out] iter
+ *  We need name from it, then set "data" field with all servers. All
+ *  previous "data" will be overwritten, causing possible memory leak.
+ */
+static void s_LBOS_FillCandidates(SLBOS_Data* data, const char* service)
+{
+    unsigned int    i;
+    SSERV_Info**    hostports_array = 0;
+    char*           lbos_address    = NULL; /* We copy LBOS address to  */
+
+    /* We suppose that number of addresses is constant (and so
+       is position of NULL), so no mutex is necessary */
+    if (s_LBOS_Instance == NULL) return;
+    lbos_address = s_LBOS_Instance;
+    CORE_LOGF_X(1, eLOG_Trace, ("Trying to find servers of \"%s\" with "
+                "LBOS at %s", service, lbos_address));
+    hostports_array = 
+        g_LBOS_UnitTesting_GetLBOSFuncs()->ResolveIPPort(lbos_address, service,
+                                                         data->net_info);
+    if (hostports_array == NULL) {
+        CORE_LOGF_X(1, eLOG_Trace, ("Ho servers of \"%s\" found by LBOS",
+                    service));
+        return;
+    }
+    for (i = 0;  hostports_array[i] != NULL;  i++) continue;
+    CORE_LOGF_X(1, eLOG_Trace, ("Found %u servers of \"%s\" with "
+                "LBOS at %s", i, service, lbos_address));
+    /* If we received answer from LBOS, we fill candidates */
+    if (hostports_array != NULL) {
+        SLBOS_Candidate* realloc_result;
+        /* To allocate space once and forever, let's quickly find the number of
+         * received addresses...
+         */
+        for (i = 0;  hostports_array[i] != NULL;  ++i) continue;
+        /* ...and allocate space */
+        realloc_result = (SLBOS_Candidate*)realloc(data->cand,
+                                           sizeof(SLBOS_Candidate) * (i + 1));
+        if (realloc_result == NULL) {
+            CORE_LOGF_X(1, eLOG_Warning, 
+                        ("s_LBOS_FillCandidates: Could not "
+                        "allocate space for all candidates, "
+                        "will use as much as was allocated "
+                        "initially: %du",
+                        (unsigned int)data->a_cand));
+        } else {
+            data->cand = realloc_result;
+            data->a_cand = i + 1;
+        }
+        for (i = 0;  hostports_array[i] != NULL && i < data->a_cand;  i++) {
+            data->cand[i].info = hostports_array[i];
+            data->n_cand++;
+        }
+        free(hostports_array);
+    }
+    /*If we did not find answer from LBOS, we just finish*/
+}
+
+
+
+static int s_LBOS_CheckAnnounceArgs(const char* service,
+                                    const char* version,
+                                    const char* host,
+                                    unsigned short port,
+                                    const char* healthcheck_url,
+                                    char** lbos_answer)
+{
+    unsigned short i;
+    if (g_LBOS_StringIsNullOrEmpty(healthcheck_url)) {
+        CORE_LOG(eLOG_Critical, "Error with announcement, "
+                                "no healthcheck_url specified.");
+        return 0;
+    }
+    if ((strstr(healthcheck_url, "http://") != healthcheck_url)
+        &&
+        (strstr(healthcheck_url, "https://") != healthcheck_url)) {
+        CORE_LOG(eLOG_Critical, "Error with announcement, missing http:// or "
+                                "https:// in the beginning of healthcheck "
+                                "URL.");
+        return 0;
+    }
+    /* Greedy check for host - host should consist of alphanumerics and dots,
+     * or be NULL */
+    if (!g_LBOS_StringIsNullOrEmpty(host)) {
+        for (i = 0;  i < strlen(host);  i++) {
+            if (!isalnum(host[i]) && (host[i] != '.')) {
+                return 0;
+            }
+        }
+    }
+    if (port < 1 || port > 65535) {
+        CORE_LOG(eLOG_Critical, "Error with announcement, incorrect port.");
+        return 0;
+    }
+    if (g_LBOS_StringIsNullOrEmpty(version)) {
+        CORE_LOG(eLOG_Critical, "Error with announcement, "
+                                "no version specified.");
+        return 0;
+    }
+    if (g_LBOS_StringIsNullOrEmpty(service)) {
+        CORE_LOG(eLOG_Critical, "Error with announcement, "
+                                "no service name specified.");
+        return 0;
+    }
+    if (lbos_answer == NULL) {
+        CORE_LOG(eLOG_Critical, "Error with announcement, "
+                                "no variable provided to save LBOS answer.");
+        return 0;
+    }
+    return 1;
+}
+
+
+static int s_LBOS_CheckDeannounceArgs(const char* service,
+                                      const char* version,
+                                      const char* host,
+                                      unsigned short port)
+{
+    if (!g_LBOS_StringIsNullOrEmpty(host) && strstr(host, ":") != NULL) {
+        CORE_LOG(eLOG_Critical, "Invalid argument passed for de-announcement, "
+                                "please check that \"host\" parameter does "
+                                "not contain protocol or port");
+        return 0;
+    }
+    if (port < 1 || port > 65535) {
+        CORE_LOG(eLOG_Critical, "Invalid argument passed for de-announcement, "
+                                "incorrect port.");
+        return 0;
+    }
+    if (g_LBOS_StringIsNullOrEmpty(version)) {
+        CORE_LOG(eLOG_Critical, "Invalid argument passed for de-announcement, "
+                                "no version specified.");
+        return 0;
+    }
+    if (g_LBOS_StringIsNullOrEmpty(service)) {
+        CORE_LOG(eLOG_Critical, "Invalid argument passed for de-announcement, "
+                                "no service name specified.");
+        return 0;
+    }
+    return 1;
+}
+
+
+/** Iterator request through LBOSes and return the best answer (ideally, one
+ * that has status code 200)
+ * This function is TODO
+ */
+static unsigned short s_LBOS_PerformRequest(const char* request,
+                                            char**      lbos_answer,
+                                            char**      http_status_message,
+                                            TReqMethod  req_method,
+                                            const char* service)
+{
+    SConnNetInfo*  net_info;
+    char*          buf;
+    char*          lbos_address;
+    int            status_code;
+    char*          query;
+    char*          status_message  = NULL;
+    size_t         length           = 0;
+    /* We try all LBOSes until we get 200. If we receive error status code
+     * instead of 200, we save it. So, if no LBOS returns 200, we
+     * return error code. If we receive nothing (LBOS is not present), then
+     * we save nothing.
+     */
+    net_info                = ConnNetInfo_Clone(s_EmptyNetInfo);
+    net_info->req_method    = req_method;
+    buf                     = NULL;
+    status_code             = 0;
+    lbos_address            = s_LBOS_Instance;
+    /* We deny foreign de-announcement*/
+    /* Compare local domain and LBOS domain */
+    if (!g_LBOS_CheckDomain(lbos_address)) {
+        CORE_LOGF_X(1, eLOG_Error,
+                    ("Could not verify that [%s] is in local domain [%s]. "
+                    "Announcement in foreign domain is not allowed. "
+                    "If you omitted [%s] in the LBOS address - please, "
+                    "provide it.",
+                    lbos_address, s_LBOS_ReadDomain(), s_LBOS_ReadDomain()));
+    }
+    else { /* domain is good */
+        query = g_LBOS_StringConcat(g_LBOS_StringConcat(
+                                    strdup("http://"), lbos_address, &length),
+                                    request, &length);
+        length = strlen(query);
+        buf = s_LBOS_UrlReadAll(net_info, query, &status_code, 
+                                &status_message);
+        free(query);
+    }
+    if (lbos_answer != NULL && !g_LBOS_StringIsNullOrEmpty(buf)) {
+        *lbos_answer = strdup(buf);
+    }
+    free(buf);
+    if (http_status_message != NULL && status_message != NULL) {
+        *http_status_message = strdup(status_message);
+    }
+    free(status_message);
+
+    if (status_code == 0) {
+        status_code = kLBOSNoLBOS;
+    }
+    /* Cleanup */
+    ConnNetInfo_Destroy(net_info);
+    return status_code;
+}
+
+
+static char* s_LBOS_Replace0000WithIP(const char* healthcheck_url)
+{
+    size_t          chars_to_copy;
+    const char*     query;
+    char            hostname[kMaxLineSize];
+    size_t          length;
+    /* new url with replaced "0.0.0.0" (if needed) */
+    char*           my_healthcheck_url; 
+    const char*     replace_pos; /* to check if there is 0.0.0.0 */
+    if (healthcheck_url == NULL)
+        return NULL;
+    /* By 'const' said that we will not touch healthcheck_url, but actually 
+     * we need to be able to change it, so we copy it */
+    /* If we need to insert local IP instead of 0.0.0.0, we will */
+    if ((replace_pos = strstr(healthcheck_url, "0.0.0.0")) == NULL) {
+        my_healthcheck_url = strdup(healthcheck_url);
+        return(my_healthcheck_url);
+    }
+    my_healthcheck_url = (char*)calloc(kMaxLineSize, sizeof(char));
+    if (my_healthcheck_url == NULL) {
+        CORE_LOG(eLOG_Warning, "Failed memory allocation. Most likely, "
+                               "not enough RAM.");
+        return NULL;
+    }
+    chars_to_copy   = replace_pos - healthcheck_url;
+    query           = replace_pos + strlen("0.0.0.0");
+    unsigned int local_host_ip =
+            g_LBOS_UnitTesting_GetLBOSFuncs()->LocalHostAddr(eDefault);
+    if (local_host_ip == 0) {
+        CORE_LOG(eLOG_Warning,
+                 "Error with announcement, cannot find local IP.");
+        free(my_healthcheck_url);
+        return NULL;
+    }
+    SOCK_HostPortToString(local_host_ip, 0, hostname, kMaxLineSize - 1);
+    if (hostname == NULL) {
+        CORE_LOG(eLOG_Warning,
+                 "Error with announcement, cannot find local IP.");
+        free(my_healthcheck_url);
+        return NULL;
+    }
+    length = strlen(my_healthcheck_url);
+    my_healthcheck_url =
+        g_LBOS_StringConcat(g_LBOS_StringConcat(g_LBOS_StringNConcat(
+        my_healthcheck_url, healthcheck_url,   &length,   chars_to_copy),
+                            strlwr(hostname),  &length),
+                            query,             &length);
+
+    return my_healthcheck_url;
+}
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                             UNIT TESTING                                  //
+/////////////////////////////////////////////////////////////////////////////*/
+/** Check whether LBOS client is turned ON or OFF
+ * @return
+ *  address of static variable s_LBOS_TurnedOn
+ * @see
+ *  SERV_LBOS_Open()                                                         */
+int* g_LBOS_UnitTesting_PowerStatus(void)
+{
+    return &s_LBOS_TurnedOn;
+}
+
+
+SLBOS_Functions* g_LBOS_UnitTesting_GetLBOSFuncs(void)
+{
+    return &s_LBOS_funcs;
+}
+
+/**  Check whether LBOS client has been initialized already
+ *  @return
+ *   Address of static variable s_LBOS_Init
+ *  @see
+ *   SERV_LBOS_Open()                                                        */
+int* g_LBOS_UnitTesting_InitStatus(void)
+{
+    return &s_LBOS_Init;
+}
+
+
+/**  List of addresses of LBOS that is maintained in actual state.
+ *  @return
+ *   address of static variable s_LBOS_InstancesList.
+ *  @see
+ *   SERV_LBOS_Open(), s_LBOS_FillCandidates()                               */
+char** g_LBOS_UnitTesting_Instance(void)
+{
+    return &s_LBOS_Instance;
+}
+
+
+/**  Pointer to s_LBOS_CurrentDomain
+ *  @return
+ *   address of static variable s_LBOS_CurrentDomain.
+ *  @see                                                                     */
+char** g_LBOS_UnitTesting_CurrentDomain(void)
+{
+    return &s_LBOS_CurrentDomain;
+}
+
+
+/**  Pointer to s_LBOS_CurrentRole
+ *  @return
+ *   address of static variable s_LBOS_CurrentRole.
+ *  @see                                                                     */
+char** g_LBOS_UnitTesting_CurrentRole(void)
+{
+    return &s_LBOS_CurrentRole;
+}
+
+
+/**  Pointer to s_LBOS_CurrentRole
+ *  @return
+ *   address of static variable s_LBOS_CurrentRole.
+ *  @see                                                                     */
+char** g_LBOS_UnitTesting_Lbosresolver(void)
+{
+    return &s_LBOS_Lbosresolver;
+}
+
+
+int/*bool*/ g_LBOS_UnitTesting_SetLBOSFindMethod (SERV_ITER       iter,
+                                                  ELBOSFindMethod method)
+{
+    SLBOS_Data* data;
+    assert(g_LBOS_CheckIterator(iter, ELBOSIteratorCheckType_MustHaveData));
+    data = (SLBOS_Data*) iter->data;
+    data->find_method = method;
+    return 1;
+}
+
+
+int/*bool*/ g_LBOS_UnitTesting_SetLBOSRoleDomainResolverFile
+                                                 (const char* roleFile,
+                                                  const char* domainFile,
+                                                  const char* lbosresolverfile)
+{
+    if (roleFile != NULL) {
+        kRoleFile = roleFile;
+    }
+    if (domainFile != NULL) {
+        kDomainFile = domainFile;
+    }
+    if (lbosresolverfile != NULL) {
+        kLbosresolverFile = lbosresolverfile;
+    }
+    return 1;
+}
+
+
+/* UNIT TESTING*/
+/**  Set custom address for LBOS. Can be both hostname:port and IP:port.
+ *  Intended mostly for testing.
+ * @param[in] iter
+ *  Where to set address for LBOS. The settings is made for only one iterator*/
+int/*bool*/ g_LBOS_UnitTesting_SetLBOSaddress (SERV_ITER iter, char* address) {
+    SLBOS_Data* data;
+    assert(g_LBOS_CheckIterator(iter, ELBOSIteratorCheckType_MustHaveData));
+    data = (SLBOS_Data*) iter->data;
+    data->lbos_addr = address;
+    return 1;
+}
+
+
+struct SLBOS_AnnounceHandle_Tag** g_LBOS_UnitTesting_GetAnnouncedServers(void)
+{
+    return &s_LBOS_AnnouncedServers;
+}
+
+
+int g_LBOS_UnitTesting_GetAnnouncedServersNum(void)
+{
+    return s_LBOS_AnnouncedServersNum;
+}
+
+
+int g_LBOS_UnitTesting_FindAnnouncedServer(const char*             service,
+                                           const char*             version,
+                                           unsigned short          port,
+                                           const char*             host) 
+{
+    return s_LBOS_FindAnnouncedServer(service, version, port, host);
+}
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                      DATA CONSTRUCTOR/DESTRUCTOR                          //
+/////////////////////////////////////////////////////////////////////////////*/
+/** Constructor for SLBOS_Data. Returns pointer to new empty initialized
+ * SLBOS_Data.                                                              */
+static SLBOS_Data* s_LBOS_ConstructData(size_t candidatesCapacity)
+{
+    SLBOS_Data* data;
+
+    if (!(data = (SLBOS_Data*) calloc(1, sizeof(SLBOS_Data))))
+    {
+        CORE_LOG_X(1, eLOG_Error, "Could not allocate memory for LBOS mapper");
+        return NULL;
+    }
+    /*
+     * We consider that there will never be more than 20 candidates, which
+     * is not many for us
+     */
+    data->a_cand        = candidatesCapacity;
+    data->pos_cand      = 0;
+    data->n_cand        = 0;
+    data->lbos_addr     = NULL;
+    data->find_method   = eLBOSFindMethod_None;
+    data->cand          = (SLBOS_Candidate*)calloc(candidatesCapacity, 
+                                                   sizeof(SLBOS_Candidate));
+    return data;
+}
+
+
+/** Destructor for SLBOS_Data.
+ * @param[in] data_to_delete
+ *  Please note that you have to set pointer to NULL yourself.               */
+static void s_LBOS_DestroyData(SLBOS_Data* data)
+{
+    if (data == NULL) {
+        return;
+    }
+    if (data->cand != NULL) {
+        size_t i;
+        for (i = data->pos_cand;  i < data->n_cand;  i++) {
+            if (data->cand[i].info != NULL) {
+                free(data->cand[i].info);
+                data->cand[i].info = NULL;
+            }
+        }
+        free(data->cand);
+    }
+    if (data->net_info) {
+        ConnNetInfo_Destroy(data->net_info);
+    }
+    free(data);
+}
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                        MAIN MAPPER FUNCTIONS                              //
+/////////////////////////////////////////////////////////////////////////////*/
+/**  This function tests existence of the application that should always be
+ *  found - LBOS itself. If it is not found, we turn LBOS off.               */
+static void s_LBOS_Initialize(void)
+{
+    const char*     service     = "/lbos";
+    SConnNetInfo*   net_info;
+    SERV_ITER       iter;
+    CORE_LOCK_WRITE;
+        if (s_LBOS_Instance == NULL) {
+            s_LBOS_Instance = g_LBOS_GetLBOSAddress();
+        }
+        if (s_EmptyNetInfo == NULL) {
+            s_EmptyNetInfo = ConnNetInfo_Create(NULL);
+        }
+    CORE_UNLOCK;
+    s_LBOS_TurnedOn = 1; /* To ensure that initialization does
+                            not depend on this variable */
+    s_LBOS_Init     = 1;
+
+    /* 
+     * Load DTAB Local from registry
+     */
+    free(s_LBOS_DTABLocal);
+    s_LBOS_DTABLocal = g_LBOS_RegGet("CONN", "DTAB", NULL);
+    if (g_LBOS_StringIsNullOrEmpty(s_LBOS_DTABLocal)) {
+        CORE_LOG_X(1, eLOG_Trace, "No DTAB in registry");
+    } else {
+        CORE_LOGF_X(1, eLOG_Trace, 
+                   ("DTAB from registry: %s ", s_LBOS_DTABLocal));
+    }
+
+    /* Check On/Off status */
+    char* lbos_toggle = g_LBOS_RegGet("CONN", "LBOS_ENABLE", NULL);
+    int lbos_toggled = ConnNetInfo_Boolean(lbos_toggle);
+    free(lbos_toggle);
+    if (lbos_toggled) {
+        CORE_LOG_X(1, eLOG_Note, "LBOS is turned ON in config.");
+    } else {
+        CORE_LOG_X(1, eLOG_Warning, 
+                   "LBOS is NOT turned ON in config! Please provide "
+                   "[CONN]LBOS_ENABLE=1");
+        s_LBOS_TurnedOn = 0;
+        return;
+    }
+    /*
+     * Try to find LBOS
+     */
+    iter = (SERV_ITER)calloc(1, sizeof(*iter));
+    assert(iter != NULL);  /* we can do nothing if this happens */
+    iter->name  = service;
+    net_info    = ConnNetInfo_Clone(s_EmptyNetInfo);
+    iter->op    = SERV_LBOS_Open(iter, net_info, NULL);
+    ConnNetInfo_Destroy(net_info);
+    if (iter->op == NULL) {
+        CORE_LOGF_X(1, eLOG_Warning, 
+                    ("Could not connect to LBOS, or "
+                     "http://%s/lbos/text/mlresolve?name=%%2flbos "
+                     "is empty. Turning LBOS off in this "
+                     "process.", s_LBOS_Instance));
+        s_LBOS_TurnedOn = 0;
+    } else {
+        s_LBOS_Close(iter);
+        s_LBOS_TurnedOn = 1;
+    }
+    free(iter);
+
+}
+
+
+/** After we receive answer from dispd.cgi, we parse header
+ * to get all hosts.                                                         */
+static EHTTP_HeaderParse s_LBOS_ParseHeader(const char*      header,
+                                            void* /* SLBOS_UserData* */ 
+                                                             response,
+                                            int              server_error)
+{
+    SLBOS_UserData* response_output;
+    int             status_code = 0/*success code if any*/;
+    /* For all we know, status message ends before \r\n */
+    char*           header_end;
+    char*           status_message;
+    unsigned int    content_length;
+    char*           content_length_pos;
+
+    if (response == NULL) {
+        /* We do not intervent in the process by default */
+        return eHTTP_HeaderSuccess;
+    }
+    response_output = (SLBOS_UserData*)response;
+    header_end      = strstr(header, "\r\n");
+    status_message  = (char*)calloc(header_end-header, sizeof(char));
+
+    if (sscanf(header, "%*s %d %[^\r]\r\n", &status_code,
+               status_message) < 1)
+    {
+        if (response != NULL) {
+            response_output->http_response_code = 503; /* server error */
+        }
+        free(status_message);
+        return eHTTP_HeaderError;
+    }
+    if (status_code != 200) {
+        CORE_LOGF(eLOG_Critical, ("s_LBOS_UrlReadAll: LBOS returned status "
+                  "code %d", status_code));
+    }
+    char* temp_header = strlwr(strdup(header)); /* we cannot modify
+                                                 * original */
+    /* We want to be sure that found "content-length" is the tag itself,
+     * not a value as if in "Some-Tag: content-length: 2". So we check for
+     * either \n before tag, or it should be positioned at the very
+     * beginning of the string
+     */
+    content_length_pos = strstr(temp_header, "content-length: ");
+    if (
+            content_length_pos != NULL
+            &&
+            (
+                (*(content_length_pos - 1) == '\n')
+                ||
+                (content_length_pos == temp_header)
+            )
+        )
+    {
+        sscanf(content_length_pos + strlen("content-length: "),
+               "%u", &content_length);
+    }
+    /* If we could not read "content-length", we do not have any
+     * estimation of the upper bound  */
+    else {
+        content_length = (unsigned int)(-1);
+    }
+    free(temp_header);
+    /* check for empty document */
+    response_output->http_response_code = status_code;
+    response_output->http_status_mesage = status_message;
+    response_output->content_length     = content_length;
+    return eHTTP_HeaderSuccess;
+}
+
+
+static void s_LBOS_Reset(SERV_ITER iter)
+{
+    size_t i;
+    SLBOS_Data* data;
+    /*
+     * First, we need to check if it is our iterator. It would be bad
+     * to mess with other mapper's iterator
+     */
+    assert(g_LBOS_CheckIterator(iter, ELBOSIteratorCheckType_NoCheck));
+    /*
+     * Check passed, it is LBOS's iterator. Now we can be sure that we know
+     * how to reset it
+     */
+    data = (SLBOS_Data*) iter->data;
+    if (data != NULL) {
+        if (data->cand) {
+            for (i = data->pos_cand;  i < data->n_cand;  i++)
+                free(data->cand[i].info);
+            free(data->cand);
+            /*There will hardly be more than 20 candidates, so we allocate
+             * memory for candidates straight away, no array of pointers
+             */
+            data->cand = (SLBOS_Candidate*)calloc(data->a_cand, 
+                                                  sizeof(SLBOS_Candidate));
+            if (data->cand == NULL) {
+                CORE_LOG(eLOG_Critical, "s_LBOS_Reset: No RAM. "
+                                        "Failed to create iterator.");
+                data->a_cand   = 0;
+                data->n_cand   = 0;
+                data->pos_cand = 0;
+            }
+#if defined(_DEBUG)  &&  !defined(NDEBUG)
+            /** We check both that it returns zero and does not crash accessing
+             * allocated memory  */
+            for (i = 0;  i < data->n_cand;  i++) {
+                assert(data->cand + i != NULL);
+                data->cand[i].info = (SSERV_Info*)malloc(sizeof(SSERV_Info));
+                free(data->cand[i].info);
+                data->cand[i].info = NULL;
+            }
+#endif
+        }
+        data->n_cand = 0;
+        data->pos_cand = 0;
+    }
+    return;
+}
+
+
+/** Not implemented in LBOS client. */
+static int/*bool*/ s_LBOS_Feedback (SERV_ITER a, double b, int c)
+{
+    return 0;
+}
+
+
+/** Not implemented in LBOS client. */
+static int/*bool*/ s_LBOS_Update(SERV_ITER iter, const char* text, int code)
+{
+    return 1;
+}
+
+
+static void s_LBOS_Close (SERV_ITER iter)
+{
+    SLBOS_Data* data;
+    /*
+     * First, we need to check if it is our iterator. It would be bad
+     * to mess with other mapper's iterator
+     */
+    assert(g_LBOS_CheckIterator(iter, ELBOSIteratorCheckType_MustHaveData));
+    data = (SLBOS_Data*) iter->data;
+    if(data->n_cand > 0) {
+        /*s_Reset() has to be called before*/
+        s_LBOS_Reset(iter);
+    }
+    s_LBOS_DestroyData((SLBOS_Data*)iter->data);
+    iter->data = NULL;
+    return;
+}
+
+
+/** 1) If iterator is valid - find and return next server;
+ *  2) If iterator is outdated or empty - we update it and fill it with hosts
+ *     and go to 1)                                                          */
+static SSERV_Info* s_LBOS_GetNextInfo(SERV_ITER iter, HOST_INFO* host_info)
+{
+    SLBOS_Data* data;
+    /*
+     * We store snapshot of LBOS answer in memory. So we just go from last
+     * known position. Position is stored in n_skip.
+     * If we want to update list - well, we update all the list and start from
+     * the beginning.
+     */
+
+    /* host_info is implemented only for lbsmd mapper, so we just set it to
+     * NULL, if it even exists.
+     */
+    if (host_info) {
+        *host_info = NULL; /*No host data*/
+    }
+
+    assert(iter != NULL);  /* we can do nothing if this happens */
+
+    if (iter->data == NULL) {
+        iter->data = s_LBOS_ConstructData(kInitialCandidatesCount);
+    }
+
+    data = (SLBOS_Data*)(iter->data); /** set typed variable
+                                                     for convenience */
+
+    if (data->n_cand == 0) { /**< this is possible after reset()*/
+        g_LBOS_UnitTesting_GetLBOSFuncs()->FillCandidates(data, iter->name);
+    }
+    /*
+     * If there are some servers left to show, we move iterator and show next
+     * Otherwise, return NULL
+     */
+    if (data->pos_cand < data->n_cand) {
+        data->pos_cand++;
+        return data->cand[data->pos_cand-1].info;
+    }  else  {
+        return NULL;
+    }
+}
+
+
+/** Creates iterator and fills it with found servers.
+ * @param[in,out] iter
+ *  Pointer to iterator. It is read and rewritten
+ * @param[out] net_info
+ *  Connection information.
+ * @param[out] info
+ *  Pointer to variable to return pointer to info about server. */
+const SSERV_VTable* SERV_LBOS_Open( SERV_ITER            iter,
+                                    const SConnNetInfo*  net_info,
+                                    SSERV_Info**         info     )
+{
+    SLBOS_Data* data;
+    char* new_name = NULL; /* if we need to add dbaf */
+    const char* orig_serv_name = iter->name; /* we may modify name with dbaf */
+    if (s_LBOS_Init == 0) {
+        s_LBOS_funcs.Initialize();
+    }
+    if (s_LBOS_TurnedOn == 0) {
+        return NULL;
+    }
+    /*
+     * First, we need to check arguments
+     */
+    assert(iter != NULL);  /* we can do nothing if this happens */
+
+    /* Check that iter is not a mask - LBOS cannot work with masks */
+    if (iter->ismask) {
+        CORE_LOG(eLOG_Warning, "Mask was provided instead of service name. "
+            "Masks are not supported in LBOS.");
+        return NULL;
+    }
+
+    /* Check that service name is provided - otherwise there is nothing to 
+     * search for */
+    if (iter->name == NULL) {
+        CORE_LOG(eLOG_Warning, "\"iter->name\" is null, not able "
+                               "to continue SERV_LBOS_Open");
+        return NULL;
+    }
+
+    /* If dbaf is defined, we construct new service name and assign it 
+     * to iter */
+    if ( iter->arg  &&  (strcmp(iter->arg, "dbaf") == 0)  &&  iter->val ) {
+        size_t length = 0;
+        new_name = 
+            g_LBOS_StringConcat(g_LBOS_StringConcat(g_LBOS_StringConcat(
+                                NULL, iter->name, &length),
+                                      "/",        &length),
+                                      iter->val,  &length);
+        if (new_name == NULL) {
+            CORE_LOG(eLOG_Warning, "Could not concatenate dbaf with service "
+                                   "name, probably not enough RAM. Searching "
+                                   "for service without dbaf");
+        } else {
+            iter->name = new_name;
+        }
+    }
+    /*
+     * Arguments OK, start work
+     */
+    if (info != NULL) {
+        *info = NULL;
+    }
+    data = s_LBOS_ConstructData(kInitialCandidatesCount);
+    if(net_info == NULL) {
+        CORE_LOG(eLOG_Warning,
+                 "Parameter \"net_info\" is null, creating net info. "
+                 "Please, fix the code and provide net_info.");
+        data->net_info = ConnNetInfo_Clone(s_EmptyNetInfo);
+    } else {
+        data->net_info = ConnNetInfo_Clone(net_info);
+    }
+    // Check if CONNECT_Init() has been run before
+    if (g_CORE_GetRequestDtab == NULL) {
+        CORE_LOG(eLOG_Critical, 
+                 "LBOS FAIL! Please run CONNECT_Init() prior to using LBOS!\n"
+                 "Example:\n"
+                 "CNcbiRegistry& config = CNcbiApplication::Instance()"
+                 "->GetConfig();\n"
+                 "CONNECT_Init(&config);\n"
+                 "LBOS::Announce(...);");
+        s_LBOS_DestroyData(data);
+        if (iter->name != orig_serv_name) {
+            free(new_name);
+            iter->name = orig_serv_name;
+        }
+        return NULL;
+    }
+    const char* request_dtab = g_CORE_GetRequestDtab();
+    if (!g_LBOS_StringIsNullOrEmpty(request_dtab)) {
+        /* Add a semicolon to separate DTabs */
+        ConnNetInfo_ExtendUserHeader(data->net_info, "DTab-Local: ;");
+        ConnNetInfo_ExtendUserHeader(data->net_info, request_dtab);
+    }
+    g_LBOS_UnitTesting_GetLBOSFuncs()->FillCandidates(data, iter->name);
+    /* Connect to LBOS, read what is needed, build iter, info, host_info
+     */
+    if (!data->n_cand) {
+        s_LBOS_DestroyData(data);
+        if (iter->name != orig_serv_name) {
+            free(new_name);
+            iter->name = orig_serv_name;
+        }
+        return NULL;
+    }
+    /* Something was found, now we can use iter */
+
+    /*Just explicitly mention here to do something with it*/
+    iter->data = data;
+    if (iter->name != orig_serv_name) {
+        free(new_name);
+        iter->name = orig_serv_name;
+    }
+    return &s_lbos_op;
+}
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                        ANNOUNCEMENT/DEANNOUCEMENT                         //
+/////////////////////////////////////////////////////////////////////////////*/
+/** For the unit testing this function is moved from LBOS_Announce
+ *  (interception of
+ * parameters). For full description see LBOS_Announce
+ * @sa 
+ *  LBOS_Announce()                                                        */
+static 
+unsigned short s_LBOS_Announce(const char*             service,
+                               const char*             version,
+                               const char*             host,
+                               unsigned short          port,
+                               const char*             healthcheck_url,
+                               /* lbos_answer is never NULL  */
+                               char**                  lbos_answer,
+                               char**                  http_status_message)
+    {
+    char*           lbos_address;
+    char*           lbos_addr; /* to store address of LBOS that 
+                                  did the announcement*/
+    int             status_code;
+    char*           status_message;
+    SConnNetInfo*   net_info;
+    const char*     query_format        = NULL;
+    char*           buf                 = NULL; /* for answer from LBOS */
+    int             parsed_symbols = 0;
+    size_t length;
+
+    if (s_LBOS_Init == 0) {
+        s_LBOS_funcs.Initialize();
+    }
+    if (s_LBOS_TurnedOn == 0) {
+        return kLBOSOff;
+    }
+    lbos_address         = s_LBOS_Instance;
+    status_code          = 0;
+    status_message       = NULL;
+    net_info             = ConnNetInfo_Clone(s_EmptyNetInfo);
+    net_info->req_method = eReqMethod_Post;
+    query_format         = "http://%s/lbos/json/announce?name=%s&"
+                           "version=%s&port=%hu&check=%s";
+    /*
+     * Let's try announce 
+     */
+    char* query;
+    /* We deny foreign announcement*/
+    /* Compare local domain and LBOS domain */
+    if (!g_LBOS_CheckDomain(lbos_address)) {
+        CORE_LOGF_X(1, eLOG_Warning, 
+                    ("[%s] is not from local domain [%s]. "
+                    "Announcement in foreign domain is not allowed.",
+                    lbos_address, s_LBOS_ReadDomain()));    
+    } else {
+        query = (char*)calloc(strlen(query_format) + 
+                              strlen(lbos_address) + 
+                              strlen(service) + strlen(version) +
+                              5/* port */ + strlen(healthcheck_url),
+                              sizeof(char));
+        sprintf(query,
+                query_format,
+                lbos_address, service, version, port, healthcheck_url);
+        length = strlen(query);
+        /* If host was provided, we append it to query */
+        if (!g_LBOS_StringIsNullOrEmpty(host)) {
+            query = g_LBOS_StringConcat(g_LBOS_StringConcat(
+                                                    query,  "&ip=", &length),
+                                                            host,   &length);
+        }
+        buf = s_LBOS_UrlReadAll(net_info, query, &status_code, 
+                                &status_message);
+        free(query);      
+    }
+    if (!g_LBOS_StringIsNullOrEmpty(buf)) {
+        *lbos_answer = strdup(buf);
+    }
+    if (http_status_message != NULL && status_message != NULL) {
+        *http_status_message = strdup(status_message);
+    }
+    free(status_message);
+    /* If no LBOS found */
+    if (status_code == 0) {
+        CORE_LOG(eLOG_Warning, "Announce failed. No LBOS found.");
+        status_code = kLBOSNoLBOS;
+        goto clear_and_exit;
+    }
+    /* If announced server has broken healthcheck */
+    if (status_code == kLBOSNotFound || status_code == kLBOSBadRequest  
+        || status_code == kLBOSServerError) 
+    {
+        CORE_LOGF(eLOG_Warning, ("Announce failed. "
+                                 "LBOS returned error code %d.", status_code));
+        goto clear_and_exit;
+    }
+    /* If we could not announce, it is really bad */
+    if (status_code != 200) {
+        CORE_LOGF(eLOG_Warning, ("Announce failed. "
+                                 "LBOS returned error code %d. "
+                                 "LBOS answer: %s.", status_code, buf));
+        goto clear_and_exit;
+    }
+    /* If we announced successfully and status_code is 200,
+     * let's extract LBOS address */
+    lbos_addr = (char*)calloc(kMaxLineSize, sizeof(char)); /* will not be 
+                                                            * free()'d */
+    if (lbos_addr == NULL) {
+        CORE_LOG(eLOG_Warning, "Failed memory allocation. Most likely, "
+                               "not enough RAM.");
+        status_code = kLBOSMemAllocError;
+        goto clear_and_exit;
+    }
+    if (buf != NULL) {
+        parsed_symbols = sscanf(buf, "{\"watcher\":\"%[^\"]\"}", 
+                                lbos_addr);
+    }
+    if (parsed_symbols != 1) {
+        CORE_LOG(eLOG_Warning, "g_LBOS_Announce: LBOS answered 200 OK, but "
+                               "output could not be parsed");
+        free(lbos_addr);
+        status_code = kLBOSCorruptOutput;
+        goto clear_and_exit;
+    } else {
+    /* If announce finished with success, we parsed it to extract LBOS ip:port.
+     * We free() original output and replace it with ip:port                 */
+        free(*lbos_answer);
+        *lbos_answer = lbos_addr;
+    }
+
+    /* Cleanup */
+    clear_and_exit:
+        free(buf);
+        ConnNetInfo_Destroy(net_info);
+    return status_code;
+}
+
+
+unsigned short LBOS_Announce(const char*             service,
+                             const char*             version,
+                             const char*             host,
+                             unsigned short          port,
+                             const char*             healthcheck_url,
+                             char**                  lbos_answer,
+                             char**                  http_status_message)
+{
+    char*           my_healthcheck_url      = NULL;
+    char*           healthcheck_encoded     = NULL;
+    char*           my_host                 = NULL;
+    char*           service_encoded         = NULL;
+    char*           version_encoded         = NULL;
+    unsigned short  result;
+
+    /*
+     * First we check input arguments
+     */
+    if (s_LBOS_CheckAnnounceArgs(service, version, host, port, healthcheck_url,
+                                 lbos_answer) == 0)
+    {
+        return kLBOSInvalidArgs;
+    }
+    /*
+     * Pre-assign variables
+     */
+    *lbos_answer = NULL;
+    /* Check if we need to replace 0.0.0.0 with local IP, and do it if needed*/
+    my_healthcheck_url = s_LBOS_Replace0000WithIP(healthcheck_url);
+
+	/*my_healthcheck_url = strdup(healthcheck_url); */
+    if (my_healthcheck_url == NULL) {
+        result = kLBOSDNSResolveError;
+        goto clean_and_exit;
+    }
+    /* If host provided separately from healthcheck URL, check if we need to
+     * replace 0.0.0.0 with local IP, and do it if needed                    */
+    my_host = s_LBOS_Replace0000WithIP(host);
+
+    healthcheck_encoded  = s_LBOS_URLEncode(my_healthcheck_url);
+    service_encoded      = s_LBOS_URLEncode(service);
+    version_encoded      = s_LBOS_URLEncode(version);
+
+    /* Announce */
+    result = 
+            g_LBOS_UnitTesting_GetLBOSFuncs()->AnnounceEx(service_encoded, 
+                                                          version_encoded, 
+                                                          my_host,
+                                                          port,
+                                                          healthcheck_encoded, 
+                                                          lbos_answer,
+                                                          http_status_message);     
+    if (result == kLBOSSuccess) {
+        CORE_LOCK_WRITE;
+        s_LBOS_AddAnnouncedServer(service, version, port, healthcheck_url);
+        CORE_UNLOCK;
+    }
+
+    /* Cleanup */
+clean_and_exit:
+    free(healthcheck_encoded);
+    free(my_healthcheck_url);
+    free(my_host);
+    free(version_encoded);
+    free(service_encoded);
+    return result;
+}
+
+
+unsigned short LBOS_AnnounceFromRegistry(const char*  registry_section,
+                                         char**       lbos_answer,
+                                         char**       http_status_message)
+{
+    unsigned short  result      = kLBOSSuccess;
+    size_t          i           = 0;
+    unsigned int    port;
+    char*           srvc;
+    char*           vers;
+    char*           port_str;
+    char*           hlth;
+    char*           host;
+
+    if (g_LBOS_StringIsNullOrEmpty(registry_section)) {
+        registry_section = kLBOSAnnouncementSection;
+    }
+    srvc      = g_LBOS_RegGet(registry_section, kLBOSServiceVariable, NULL);
+    vers      = g_LBOS_RegGet(registry_section, kLBOSVersionVariable, NULL);
+    port_str  = g_LBOS_RegGet(registry_section, kLBOSPortVariable, NULL);
+    host      = g_LBOS_RegGet(registry_section, kLBOSServerHostVariable, NULL);
+    hlth      = g_LBOS_RegGet(registry_section, kLBOSHealthcheckUrlVariable, 
+                              NULL);
+    
+    /* Check port that it is a number of max 5 digits and no other symbols   */
+    for (i = 0;  i < strlen(port_str);  i++) {
+        if (!isdigit(port_str[i])) {
+            result = kLBOSInvalidArgs;
+            goto clean_and_exit;
+        }
+    }
+    if (strlen(port_str) > 5 || (sscanf(port_str, "%d", &port) != 1) ||
+        port < 1 || port > 65535) 
+    {
+        result = kLBOSInvalidArgs;
+        goto clean_and_exit;
+    }    
+
+    /* Announce */    
+    result = LBOS_Announce(srvc, vers, host, (unsigned short)port, hlth,
+                           lbos_answer, http_status_message);    
+    if (result == kLBOSSuccess) {
+        CORE_LOCK_WRITE;
+        s_LBOS_AddAnnouncedServer(srvc, vers, port, hlth);
+        CORE_UNLOCK;
+    }
+
+    /* Cleanup */
+clean_and_exit:
+    free(srvc);
+    free(vers);
+    free(port_str);
+    free(hlth);
+    free(host);
+    return result;
+}
+
+
+unsigned short s_LBOS_Deannounce(const char*      service,
+                               const char*        version,
+                               const char*        host,
+                               unsigned short     port,
+                               char**             lbos_answer,
+                               char**             http_status_message,
+                               SConnNetInfo*      net_info)
+{
+    const char*    query_format;
+    char*          lbos_address;
+    char*          status_message = NULL;
+    char*          buf;
+    int            status_code;
+    lbos_address = s_LBOS_Instance;
+    status_code = 0;
+    buf = NULL;
+    query_format = "http://%s/lbos/json/conceal?name=%s&version=%s&port=%hu";
+    /*
+    * Try deannounce
+    */
+    char* query;
+    size_t length;
+    /* We deny foreign de-announcement*/
+    /* Compare local domain and LBOS domain */
+    if (!g_LBOS_CheckDomain(lbos_address)) {
+        CORE_LOGF_X(1, eLOG_Warning,
+            ("[%s] is not from local domain [%s]. "
+            "Announcement in foreign domain is not allowed.",
+            lbos_address, s_LBOS_ReadDomain()));
+    }
+    else {
+        query = (char*)calloc(strlen(query_format) +
+                       strlen(lbos_address) + strlen(service) +
+                       strlen(version) + 5/*port*/,
+                       sizeof(char));
+        sprintf(query, query_format, lbos_address, service, version, port);
+        length = strlen(query);
+        /* If host was provided, we append it to query */
+        if (!g_LBOS_StringIsNullOrEmpty(host)) {
+            query = g_LBOS_StringConcat(g_LBOS_StringConcat(
+                                                query,    "&ip=",    &length),
+                                                          host,      &length);
+        }
+        else { /* If host was NOT provided, we append local IP to query,
+                * just in case */
+            char* local_ip = s_LBOS_Replace0000WithIP("0.0.0.0");
+            query = g_LBOS_StringConcat(g_LBOS_StringConcat(
+                                        query,   "&ip=",         &length),
+                                                  local_ip,      &length);
+            free(local_ip);
+        }
+        buf = s_LBOS_UrlReadAll(net_info, query, &status_code, 
+                                &status_message);
+        free(query);
+    }
+    if (lbos_answer != NULL && !g_LBOS_StringIsNullOrEmpty(buf)) {
+        *lbos_answer = strdup(buf);
+    }
+    free(buf);
+    if (http_status_message != NULL && status_message != NULL) {
+        *http_status_message = strdup(status_message);
+    }
+    free(status_message);
+
+    if (status_code == 0) {
+        status_code = kLBOSNoLBOS;
+    }
+    return status_code;
+}
+
+
+unsigned short LBOS_Deannounce(const char*        service,
+                               const char*        version,
+                               const char*        host,
+                               unsigned short     port,
+                               char**             lbos_answer,
+                               char**             http_status_message)
+{ 
+    SConnNetInfo*   net_info;
+    char*           service_encoded;
+    char*           version_encoded;
+    char*           my_host;
+    unsigned short  retval;
+    /*
+     * First we check input arguments
+     */
+    if (s_LBOS_CheckDeannounceArgs(service, version, host, port) == 0) {
+        return kLBOSInvalidArgs;
+    }
+    /*
+     * Check if LBOS is ON
+     */
+    if (s_LBOS_Init == 0) {
+        s_LBOS_funcs.Initialize();
+    }
+    if (s_LBOS_TurnedOn == 0) {
+        return kLBOSOff;
+    }
+    /*
+     * If we are here, arguments are good!
+     */
+    if (!g_LBOS_StringIsNullOrEmpty(host)) {
+        my_host = s_LBOS_Replace0000WithIP(host);
+    }
+    else { /* If host was NOT provided, we append local IP to query,
+           * just in case */
+        my_host = s_LBOS_Replace0000WithIP("0.0.0.0");
+    }
+    net_info             = ConnNetInfo_Clone(s_EmptyNetInfo);
+    net_info->req_method = eReqMethod_Post;
+    service_encoded      = s_LBOS_URLEncode(service);
+    version_encoded      = s_LBOS_URLEncode(version);
+    
+    retval = s_LBOS_Deannounce(service_encoded, version_encoded, 
+                               my_host, port, lbos_answer, 
+                               http_status_message, net_info);
+
+    /* If kLBOSNotFound or kLBOSSuccess - we delete server from local storage
+    * as no longer existing */
+    if (retval == kLBOSNotFound || retval == kLBOSSuccess) {
+        CORE_LOCK_WRITE;
+        s_LBOS_RemoveAnnouncedServer(service, version, port, host);
+        CORE_UNLOCK;
+    }
+
+    /*
+     * Cleanup
+     */
+    free(version_encoded);
+    free(service_encoded);
+    free(my_host);
+    ConnNetInfo_Destroy(net_info);
+
+    return retval;
+}
+
+
+/** Deannounce all announced servers.
+ * @note    
+ *  Though this function is mt-safe, you should fully recognize the fact 
+ *  results of simultaneous multiple de-announcement of the same service can be 
+ *  unpredictable. For example, if service has just been de-announced in 
+ *  different thread, this thread will return error "service is not announced".
+
+ * @return 
+ *  1 - all services de-announced successfully 
+ *  0 - at least one server could not be de-announced */
+void LBOS_DeannounceAll()
+{
+    struct SLBOS_AnnounceHandle_Tag**   arr;
+    struct SLBOS_AnnounceHandle_Tag*    local_arr;
+    unsigned int                        servers;
+    unsigned int                        i;
+
+    CORE_LOCK_READ;
+    arr       = &s_LBOS_AnnouncedServers;
+    servers   = s_LBOS_AnnouncedServersNum;
+    local_arr = 
+              (struct SLBOS_AnnounceHandle_Tag*)calloc(servers, sizeof(**arr)); 
+    if (local_arr == NULL) {
+        CORE_LOG_X(1, eLOG_Warning, "RAM error. Cancelling deannounce all.");
+        CORE_UNLOCK;
+        return;
+    }
+    /* 
+     * Copy servers list to local variable in case other thread 
+     * deletes it or wants to announce new server which we would not want to 
+     * deannounce, since it will be announced after call of this function.
+     */
+    for (i = 0;  i < servers;  i++) {
+        local_arr[i].version        = strdup((*arr)[i].version);
+        local_arr[i].service        = strdup((*arr)[i].service);
+        local_arr[i].port           =        (*arr)[i].port;
+        if (strcmp((*arr)[i].host, "0.0.0.0") == 0) {
+        /* If host is "0.0.0.0", we do not provide it to LBOS in
+         * HTTP request (because it returns error in this case).
+         * With no host provided, LBOS understands that we want
+         * to deannounce server from local host, which is the same
+         * as 0.0.0.0
+         */
+            local_arr[i].host       = NULL;
+        } else {
+            local_arr[i].host       = strdup((*arr)[i].host);
+        }
+    }
+    CORE_UNLOCK;
+    for (i = 0;  i < servers;  i++) {
+        /* Deannounce */
+        LBOS_Deannounce(local_arr[i].service,
+                        local_arr[i].version,
+                        local_arr[i].host,
+                        local_arr[i].port,
+                        NULL,
+                        NULL);
+        /* Cleanup */
+        free(local_arr[i].version);
+        free(local_arr[i].host);
+        free(local_arr[i].service);
+    }
+    free(local_arr);
+    return;
+}
+
+
+/*/////////////////////////////////////////////////////////////////////////////
+//                             LBOS CONFIGURATION                            //
+/////////////////////////////////////////////////////////////////////////////*/
+/** This request will show currently used version for a requested service.
+ * Current and previous version will be the same.
+ * @param service[in]
+ *  Name of service for which to ask default version
+ * @param lbos_answer[out]
+ *  Variable to be assigned pointer to C-string with LBOS answer
+ * @param http_status_message[out]
+ *  Variable to be assigned pointer to C-string with status message from LBOS
+ * @return
+ *  Status code returned by LBOS
+ */
+unsigned short LBOS_ServiceVersionGet(const char*  service,
+                                      char**       lbos_answer,
+                                      char**       http_status_message)
+{
+    char*          service_encoded;
+    const char*    query_format;
+    char*          query;
+    unsigned short return_code;
+    /*
+     * First we check input arguments
+     */
+    if (g_LBOS_StringIsNullOrEmpty(service) || lbos_answer == NULL) {
+        return kLBOSInvalidArgs;
+    }
+    /*
+     * Check if LBOS is ON
+     */
+    if (s_LBOS_Init == 0) {
+        s_LBOS_funcs.Initialize();
+    }
+    if (s_LBOS_TurnedOn == 0) {
+        return kLBOSOff;
+    }
+    /*
+     * Arguments are good! Let's do the request
+     */
+    service_encoded = s_LBOS_URLEncode(service);
+    query_format = "/lbos/xml/configuration?name=%s";
+    query = (char*)calloc(strlen(query_format) +
+                          strlen(service_encoded),
+                          sizeof(char));
+    sprintf(query, query_format, service_encoded);
+    return_code = s_LBOS_PerformRequest(query,
+                                        lbos_answer,
+                                        http_status_message,
+                                        eReqMethod_Get,
+                                        service);
+    /*
+     * Cleanup
+     */
+    free(query);
+    free(service_encoded);
+    return return_code;
+}
+
+
+/** This request can be used to set new version for a service. Current and
+ * previous versions show currently set and previously used service versions.
+ * @param[in] service
+ *  Name of service for which the version is going to be changed
+ * @param new_version[out]
+ *  Version that will be used by default for specefied service
+ * @param lbos_answer[out]
+ *  Variable to be assigned pointer to C-string with LBOS answer
+ * @param http_status_message[out]
+ *  Variable to be assigned pointer to C-string with status message from LBOS
+ */
+unsigned short LBOS_ServiceVersionSet(const char*  service,
+                                      const char*  new_version,
+                                      char**       lbos_answer,
+                                      char**       http_status_message)
+{
+    char*          service_encoded;
+    const char*    query_format;
+    char*          query;
+    unsigned short return_code;
+    /*
+     * First we check input arguments
+     */
+    if (g_LBOS_StringIsNullOrEmpty(service) || lbos_answer == NULL
+            || g_LBOS_StringIsNullOrEmpty(new_version)) {
+        return kLBOSInvalidArgs;
+    }
+    /*
+     * Check if LBOS is ON
+     */
+    if (s_LBOS_Init == 0) {
+        s_LBOS_funcs.Initialize();
+    }
+    if (s_LBOS_TurnedOn == 0) {
+        return kLBOSOff;
+    }
+    /*
+     * Arguments are good! Let's do the request
+     */
+    service_encoded = s_LBOS_URLEncode(service);
+    query_format = "/lbos/xml/configuration?name=%s&version=%s";
+    query = (char*)calloc(strlen(query_format) +
+                          strlen(service_encoded) +
+                          strlen(new_version),
+                          sizeof(char));
+    sprintf(query, query_format, service_encoded, new_version);
+    return_code = s_LBOS_PerformRequest(query,
+                                        lbos_answer,
+                                        http_status_message,
+                                        eReqMethod_Put,
+                                        service);
+    /*
+     * Cleanup
+     */
+    free(service_encoded);
+    free(query);
+    return return_code;
+}
+
+/** This service can be used to remove service from configuration. Current
+ * version will be empty. Previous version shows deleted version.
+ */
+unsigned short LBOS_ServiceVersionDelete(const char*  service,
+                                         char**       lbos_answer,
+                                         char**       http_status_message)
+{
+    char*          service_encoded;
+    const char*    query_format;
+    char*          query;
+    unsigned short return_code;
+    /*
+     * First we check input arguments
+     */
+    if (g_LBOS_StringIsNullOrEmpty(service) || lbos_answer == NULL) {
+        return kLBOSInvalidArgs;
+    }
+    /*
+     * Check if LBOS is ON
+     */
+    if (s_LBOS_Init == 0) {
+        s_LBOS_funcs.Initialize();
+    }
+    if (s_LBOS_TurnedOn == 0) {
+        return kLBOSOff;
+    }
+    /*
+     * Arguments are good! Let's do the request
+     */
+    service_encoded = s_LBOS_URLEncode(service);
+    query_format = "/lbos/xml/configuration?name=%s";
+    query = (char*)calloc(strlen(query_format) +
+                          strlen(service_encoded),
+                          sizeof(char));
+    sprintf(query, query_format, service_encoded);
+    return_code = s_LBOS_PerformRequest(query,
+                                        lbos_answer,
+                                        http_status_message,
+                                        eReqMethod_Delete,
+                                        service);
+    /*
+     * Cleanup
+     */
+    free(service_encoded);
+    free(query);
+    return return_code;
+}
+
+
+#undef NCBI_USE_ERRCODE_X
+
diff --git a/c++/src/connect/ncbi_lbos.h b/c++/src/connect/ncbi_lbos.h
new file mode 100755
index 0000000..a3c512f
--- /dev/null
+++ b/c++/src/connect/ncbi_lbos.h
@@ -0,0 +1,176 @@
+#ifndef CONNECT___NCBI_LBOS__H
+#define CONNECT___NCBI_LBOS__H
+/*
+* ===========================================================================
+*
+*                            PUBLIC DOMAIN NOTICE
+*               National Center for Biotechnology Information
+*
+*  This software/database is a "United States Government Work" under the
+*  terms of the United States Copyright Act.  It was written as part of
+*  the author's official duties as a United States Government employee and
+*  thus cannot be copyrighted.  This software/database is freely available
+*  to the public for use. The National Library of Medicine and the U.S.
+*  Government have not placed any restriction on its use or reproduction.
+*
+*  Although all reasonable efforts have been taken to ensure the accuracy
+*  and reliability of the software and data, the NLM and the U.S.
+*  Government do not and cannot warrant the performance or results that
+*  may be obtained by using this software or data. The NLM and the U.S.
+*  Government disclaim all warranties, express or implied, including
+*  warranties of performance, merchantability or fitness for any particular
+*  purpose.
+*
+*  Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* Authors:  Dmitriy Elisov
+* @file
+* File Description:
+*   Possibly public interface to LBOS client if someone ever needs a C version
+*
+*   LBOS client is a client for service discovery API based on LBOS.
+*   LBOS is a client for ZooKeeper cloud-based DB.
+*   LBOS allows to announce, deannounce and resolve services.
+*/
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+    
+/** Announce server.
+*
+* @attention
+*  IP for the server being announced is taken from healthcheck URL!
+* @param [in] service 
+*  Name of service as it will appear in ZK. For services this means that the
+*  name should start with '/'.
+* @param [in] version
+*  Any non-null non-empty string that will help to identify the version
+*  of service. A good idea is to use [semantic versioning]
+*  (http://semver.org/) like "4.7.2"
+* @param [in] host
+*  Optional parameter (NULL to ignore). If provided, tells on which host
+*  the server resides. Can be different from healthcheck host. If set to
+*  NULL, host is taken from healthcheck.
+* @param [in] port
+*  Port for the service. Can differ from healthcheck port.
+* @param [in] healthcheck_url
+*  Full absolute URL starting with "http://" or "https://". Should include
+*  hostname or IP (and port, if necessary).
+* @note
+*  If you want to announce a service that is on the same machine that
+*  announces it (i.e., if server announces itself), you can write
+*  "0.0.0.0" for IP (this is convention with lbos). You still have to
+*  provide port, even if you write "0.0.0.0".
+* @param [out] lbos_answer
+*  This variable will be assigned a pointer to C-string with exact body of
+*  lbos' response (or NULL, if no lbos was reached).
+*  The returned string must be free()'d by the caller.
+*  If eLBOS_Success is returned, then lbos_answer will contain
+*  "host:port" of the lbos instance that was used to announce the server.
+*  Otherwise, lbos answer will contain human-readable error message or NULL.
+* @param [out] http_status_message
+*  This variable will be assigned a pointer to C-string with exact 
+*  status message of lbos' response (or NULL, if no lbos was reached).
+*  The returned string must be free()'d by the caller.
+* @return
+*  HTTP status code returned by lbos (or one of additional codes, 
+*  see ncbi_lbosp.h)
+*
+* @sa LBOS_Deannounce(), LBOS_DeannounceAll()
+*/
+NCBI_XCONNECT_EXPORT
+unsigned short LBOS_Announce(const char*             service,
+                             const char*             version,
+                             const char*             host,
+                             unsigned short          port,
+                             const char*             healthcheck_url,
+                             char**                  lbos_answer,
+                             char**                  http_status_message);
+
+
+/** Modification of LBOS_Announce() that gets all needed parameters from 
+ * registry.
+ *
+ * @attention
+ *  IP for the server being announced is taken from healthcheck URL!
+ * @param [in] registry_section
+ *  Name of section in registry file where to look for announcement parameters.
+ *  Parameters are:
+ *  SERVICE, VERSION, PORT, HEALTHCHECK
+ *  Example:
+ *  --------------
+ *  [LBOS_ANNOUNCEMENT]
+ *  SERVICE=MYSERVICE
+ *  VERSION=1.0.0
+ *  PORT=8080
+ *  HEALTH=http://0.0.0.0:8080/health
+ * @param [out] lbos_answer
+ *  This variable will be assigned a pointer to C-string with exact body of
+ *  lbos' response (or NULL, if no lbos was reached).
+ *  The returned string must be free()'d by the caller.
+ * @param [out] http_status_message 
+ *  This variable will be assigned a pointer to C-string with exact
+ *  status message of lbos' response (or NULL, if no lbos was reached).
+ *  The returned string must be free()'d by the caller.
+ * @return
+ *  HTTP status code returned by lbos (or one of additional codes,
+ *  see ncbi_lbosp.h)
+ *  
+ *  --------------                                                           */
+NCBI_XCONNECT_EXPORT
+unsigned short LBOS_AnnounceFromRegistry(const char*  registry_section,
+                                         char**       lbos_answer,
+                                         char**       http_status_message);
+
+
+/** Deannounce service.*
+* @param [in] service
+*  Name of service to be de-announced.
+* @param [in] version
+*  Version of service to be de-announced.
+* @param [in] host
+*  IP or hostname of service to be de-announced. NULL to use local host address
+* @param [in] port
+*  Port of service to be de-announced.
+* @param [out] lbos_answer
+*  This variable will be assigned a pointer to C-string with exact body of
+*  lbos' response (or NULL, if no lbos was reached).
+*  The returned string must be free()'d by the caller.
+* @param [out] http_status_message
+*  This variable will be assigned a pointer to C-string with exact
+*  status message of lbos' response (or NULL, if no lbos was reached).
+*  The returned string must be free()'d by the caller.
+* @return
+*  HTTP status code returned by lbos (or one of additional codes,
+*  see ncbi_lbosp.h)
+*
+* @sa LBOS_Announce(), LBOS_DeannounceAll()
+*/
+NCBI_XCONNECT_EXPORT
+unsigned short LBOS_Deannounce(const char*        service,
+                               const char*        version,
+                               const char*        host,
+                               unsigned short     port,
+                               char**             lbos_answer,
+                               char**             http_status_message);
+
+
+/** Deannounce all servers that were announced during runtime.
+*
+* @sa LBOS_Announce(), LBOS_Deannounce()
+*/
+NCBI_XCONNECT_EXPORT
+void LBOS_DeannounceAll(void);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /*__cplusplus*/
+
+
+#endif /* CONNECT___NCBI_LBOS__H */
diff --git a/c++/src/connect/ncbi_lbos_cxx.cpp b/c++/src/connect/ncbi_lbos_cxx.cpp
new file mode 100755
index 0000000..b3537b4
--- /dev/null
+++ b/c++/src/connect/ncbi_lbos_cxx.cpp
@@ -0,0 +1,568 @@
+/*
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors:  Dmitriy Elisov
+ * @file
+ * File Description:
+ *   C++ Wrapper for the LBOS mapper written in C
+ */
+/* C++ */
+#include <ncbi_pch.hpp>
+#include <sstream>
+#include <corelib/ncbiapp.hpp>
+#include <corelib/ncbimisc.hpp>
+#include <corelib/ncbi_safe_static.hpp>
+#include <connect/ncbi_socket.hpp>
+#include "ncbi_lbosp.hpp"
+/* C */
+#include "ncbi_lbosp.h"
+
+
+BEGIN_NCBI_SCOPE
+
+DEFINE_STATIC_FAST_MUTEX(s_GlobalLock);
+static const char* kLBOSAnnounceRegistrySection("LBOS_ANNOUNCEMENT");
+static const char* kLBOSServiceVariable("SERVICE");
+static const char* kLBOSVersionVariable("VERSION");
+static const char* kLBOSServerHostVariable("HOST");
+static const char* kLBOSPortVariable("PORT");
+static const char* kLBOSHealthcheckUrlVariable("HEALTHCHECK");
+
+const SConnNetInfo* kEmptyNetInfo = ConnNetInfo_Create(NULL);
+
+/// Functor template for deleting object (for AutoPtr<>)
+template<class X>
+struct Free
+{
+    /// Default delete function.
+    static void Delete(X* object)
+    {
+        free(*object);
+    }
+};
+
+
+/// A structure to save parse results from LBOS /configuration
+struct SLbosConfigure
+{
+    bool existed; /*< right before request */
+    bool exists;  /*< after request  */
+    string prev_version;
+    string current_version;
+};
+
+bool CLBOSIpCacheKey::operator==(const CLBOSIpCacheKey& rh) const
+{
+    return x_Service == rh.x_Service &&
+        x_Hostname == rh.x_Hostname &&
+        x_Version == rh.x_Version &&
+        x_Port == rh.x_Port;
+}
+
+
+CLBOSIpCacheKey::CLBOSIpCacheKey(string service, string hostname, string version, unsigned short port) :
+x_Service(service), x_Hostname(hostname), x_Version(version),
+x_Port(port)
+{
+
+}
+
+bool CLBOSIpCacheKey::operator<(const CLBOSIpCacheKey& rh) const
+{
+    if (x_Service != rh.x_Service) {
+        return x_Service < rh.x_Service;
+    }
+    if (x_Hostname != rh.x_Hostname) {
+        return x_Hostname < rh.x_Hostname;
+    }
+    if (x_Version != rh.x_Version) {
+        return x_Version < rh.x_Version;
+    }
+    return x_Port < rh.x_Port;
+}
+
+bool CLBOSIpCacheKey::operator>(const CLBOSIpCacheKey& rh) const
+{
+    return !(*this == rh || *this < rh);
+}
+
+
+std::string CLBOSIpCache::HostnameTryFind(string service, string hostname, 
+                                      string version, unsigned short port)
+{
+    if (hostname == "")
+        hostname = CSocketAPI::GetLocalHostAddress();
+    map<CLBOSIpCacheKey, string>::iterator pos;
+    CLBOSIpCacheKey key(service, hostname, version, port);
+    pos = x_IpCache->find(key);
+    if (pos != x_IpCache->end())
+        return pos->second;
+    else return hostname;
+}
+
+std::string CLBOSIpCache::HostnameResolve(string service, string hostname, 
+                                      string version, unsigned short port)
+{
+    /* LBOS behavior - if DNS could not resolve hostname, throw 400 Bad Request.
+    * Here we emulate LBOS behavior.
+    * Here we try to resolve hostname before
+    * sending it to LBOS, so we should return the same answer as LBOS would
+    * do.*/
+    if (hostname == "") {
+        throw CLBOSException(CDiagCompileInfo(__FILE__, __LINE__), NULL,
+            CLBOSException::EErrCode::e_LBOSBadRequest, "400 Bad Request",
+            kLBOSBadRequest);
+    }
+    map<CLBOSIpCacheKey, string>::iterator pos;
+    CLBOSIpCacheKey key(service, hostname, version, port);
+    pos = x_IpCache->find(key);
+    /* If hostname is already in the cache, return previously resolved IP */
+    if (pos != x_IpCache->end())
+        return pos->second;
+    /* We did not find IP in the cache. Then we resolve the hostname to IP and
+       save it to the cache. To make sure that our changes do not interfere
+       with changes from another thread, we use 'insert' instead of '[]' (not
+       to rewrite) */
+    string host =
+        CSocketAPI::HostPortToString(CSocketAPI::gethostbyname(hostname), 0);
+    /* If gethostbyname() could not resolve the hostname, it will return ":0".
+       In this case we go back to the original hostname, so that LBOS can try 
+       to resolve it itself. */
+    if (host == ":0") {
+        host = hostname; 
+    }
+    /* Save pair */
+    std::pair<map<CLBOSIpCacheKey, string>::iterator, bool> res =
+        x_IpCache->insert(std::pair<CLBOSIpCacheKey, string>(key, host));
+    return res.first->second;
+}
+
+void CLBOSIpCache::HostnameDelete(string service, string hostname, 
+                                  string version, unsigned short port)
+{
+    if (hostname == "")
+        hostname = CSocketAPI::GetLocalHostAddress();
+    map<CLBOSIpCacheKey, string>::iterator pos;
+    CLBOSIpCacheKey key(service, hostname, version, port);
+    pos = x_IpCache->find(key);
+    if (pos != x_IpCache->end())
+        x_IpCache->erase(pos);
+}
+
+
+CSafeStatic< map< CLBOSIpCacheKey, string > > CLBOSIpCache::x_IpCache;
+
+
+static void s_ProcessResult(unsigned short result, 
+                            const char* lbos_answer,
+                            const char* status_message)
+{
+    if (result == kLBOSSuccess)
+        return;
+
+    stringstream message;
+    message << result;
+
+    if (status_message != NULL) {
+        message << " " << status_message;
+    }
+    if (lbos_answer != NULL) {
+        message << " " << lbos_answer;
+    }
+    throw CLBOSException(CDiagCompileInfo(__FILE__, __LINE__), NULL,
+            CLBOSException::s_HTTPCodeToEnum(result),
+            message.str(), result);
+}
+
+
+void LBOS::Announce(const string& service, const string& version,
+                    const string& host, unsigned short port,
+                    const string& healthcheck_url)
+{
+    char* body_str = NULL, *status_message_str = NULL;
+    AutoPtr< char*, Free<char*> > body_aptr(&body_str),
+                                  status_message_aptr(&status_message_str);
+    string cur_host = host, ip;
+    /* If host is empty, it means that host is the same as in healthcheck 
+     * (by convention). We have to parse healthcheck and get host */
+    if (cur_host == "")
+    {
+        SConnNetInfo * healthcheck_info;
+        healthcheck_info = ConnNetInfo_Clone(kEmptyNetInfo);
+        healthcheck_info->host[0] = '\0'; /* to be sure that it will be
+                                          * overridden                      */
+        /* Save info about host */
+        ConnNetInfo_ParseURL(healthcheck_info, healthcheck_url.c_str());
+        cur_host = healthcheck_info->host;
+        /* If we could not parse healthcheck URL, throw "Invalid Arguments" */
+        if (cur_host == "") {
+            ConnNetInfo_Destroy(healthcheck_info);
+            throw CLBOSException(CDiagCompileInfo(__FILE__, __LINE__), NULL,
+                                 CLBOSException::EErrCode::e_LBOSInvalidArgs,
+                                 NStr::IntToString(kLBOSInvalidArgs),
+                                 kLBOSInvalidArgs);
+        }
+        ConnNetInfo_Destroy(healthcheck_info);
+    }
+    if (cur_host == "0.0.0.0") {
+        ip = cur_host;
+    } else {
+        /* We make a guard here because CLBOSIpCache saves resolution results 
+           to its static storage */
+        CFastMutexGuard spawn_guard(s_GlobalLock);
+        ip = CLBOSIpCache::HostnameResolve(service, cur_host, version, port);
+    }
+    /* If healthcheck is on the same host as server, we try to replace hostname 
+     * with IP in healthcheck URL, too */
+    string temp_healthcheck = NStr::Replace(healthcheck_url, cur_host, ip);
+    unsigned short result = LBOS_Announce(service.c_str(), version.c_str(),
+                                          ip.c_str(), port,
+                                          temp_healthcheck.c_str(),
+                                          &*body_aptr, &*status_message_aptr);
+    s_ProcessResult(result, *body_aptr, *status_message_aptr);
+}
+
+
+void LBOS::AnnounceFromRegistry(string reg_section)
+{
+    CNcbiRegistry& config = CNcbiApplication::Instance()->GetConfig();
+    /* If "registry_section" is empty, we use default section. */
+    if (reg_section == "") {
+        reg_section = kLBOSAnnounceRegistrySection;
+    }
+    string host =     config.Get(reg_section, kLBOSServerHostVariable);
+    string service =  config.Get(reg_section, kLBOSServiceVariable);
+    string version =  config.Get(reg_section, kLBOSVersionVariable);
+    string port_str = config.Get(reg_section, kLBOSPortVariable);
+    string health =   config.Get(reg_section, kLBOSHealthcheckUrlVariable);
+
+    /* Check that port is a number between 1 and 65535   */
+    int port_int = 0;
+    try {
+        port_int = NStr::StringToInt(port_str);
+    }
+    catch (...) {
+        throw CLBOSException(CDiagCompileInfo(__FILE__, __LINE__), NULL,
+                             CLBOSException::EErrCode::e_LBOSInvalidArgs,
+                             NStr::IntToString(kLBOSInvalidArgs),
+                             kLBOSInvalidArgs);
+    }
+    if (port_int < 1 || port_int > 65535)
+    {
+        throw CLBOSException(CDiagCompileInfo(__FILE__, __LINE__), NULL,
+                             CLBOSException::EErrCode::e_LBOSInvalidArgs, 
+                             NStr::IntToString(kLBOSInvalidArgs),
+                             kLBOSInvalidArgs);
+    }
+    unsigned short port = static_cast<unsigned short>(port_int);
+    Announce(service, version, host, port, health);
+}
+
+
+void LBOS::DeannounceAll(void)
+{
+    LBOS_DeannounceAll();
+}
+
+
+void LBOS::Deannounce(const string&         service,
+                      const string&         version,
+                      const string&         host,
+                      unsigned short        port)
+{
+    char* body_str = NULL, *status_message_str = NULL;
+    string ip;
+    if (host == "" || host == "0.0.0.0") {
+        ip = host;
+    } else {
+        CFastMutexGuard spawn_guard(s_GlobalLock);
+        ip = CLBOSIpCache::HostnameTryFind(service, host, version, port);
+    }
+    AutoPtr< char*, Free<char*> > body_aptr(&body_str),
+                                  status_message_aptr(&status_message_str);
+    unsigned short result = LBOS_Deannounce(service.c_str(), version.c_str(), 
+                                            ip.c_str(), port, &*body_aptr, 
+                                            &*status_message_aptr);
+    s_ProcessResult(result, *body_aptr, *status_message_aptr);
+    /* Nothing thrown - deannounce successful! */
+    /* Then remove resolution result from cache */
+    if (host != "" /* invalid input */ &&
+        host != "0.0.0.0" /* not handled by cache */) {
+        CFastMutexGuard spawn_guard(s_GlobalLock);
+        CLBOSIpCache::HostnameDelete(service, host, version, port);
+    }
+}
+
+/** Check LBOS response for /configuration request 
+ * @param[in] lbos_answer
+ *  Exact body of LBOS response/
+ * @param[in] method_get
+ *  If the method was GET, than we throw NOT FOUND if no current version was 
+ *  returned 
+ * @return 
+ *  Filled structure with previous version and current version (or one of 
+ *  them or none of them)*/
+SLbosConfigure ParseLbosConfigureAnswer(const char* lbos_answer)
+{
+    SLbosConfigure res;
+    if (lbos_answer == NULL) {
+        lbos_answer = strdup("");
+    }
+    string body = lbos_answer;
+    
+    /* How the string we parse looks like:
+     * <lbos>
+     * <configuration name="/lbos" currentVersion="0.1.4-76-ami-c61703ae" 
+     *                             previousVersion="0.1.4-76-ami-c61703ae"/>
+     * </lbos>
+     */
+    /* First, just check if we can parse at least service name*/
+    size_t name_start = body.find("name=\"") +
+                        strlen("name=\"");
+    if (name_start == 0) {
+        ERR_POST(Error << "Could not parse ZK configuration answer");
+        return res;
+    } 
+    size_t name_end = body.find("\"", name_start);
+    string name = body.substr(name_start, name_end - name_start);
+    /* Now let's get current version */
+    size_t cur_ver_start = body.find("currentVersion=\"");
+    res.exists = cur_ver_start != string::npos;
+    if (res.exists) {
+        cur_ver_start += strlen("currentVersion=\"");
+        size_t cur_ver_end = body.find("\"", cur_ver_start);
+        res.current_version = body.substr(cur_ver_start, 
+                                          cur_ver_end - cur_ver_start);
+    }
+    /* Now let's get previous version, if possible  */
+    size_t prev_ver_start = body.find("previousVersion=\"");
+    res.existed = prev_ver_start != string::npos;
+    if (res.existed) {
+        prev_ver_start += strlen("previousVersion=\"");
+        size_t prev_ver_end = body.find("\"", prev_ver_start);
+        res.prev_version = body.substr(prev_ver_start,
+                                       prev_ver_end - prev_ver_start);
+    }
+    return res;
+}
+
+
+string LBOS::ServiceVersionGet(const string&  service,
+                               bool* exists) 
+{
+    char* body_str = NULL, *status_message_str = NULL;
+    AutoPtr< char*, Free<char*> > body_aptr(&body_str),
+                                  status_message_aptr(&status_message_str);
+    unsigned short result = LBOS_ServiceVersionGet(service.c_str(), &*body_aptr,
+                                                   &*status_message_aptr);
+    s_ProcessResult(result, *body_aptr, *status_message_aptr);
+    SLbosConfigure res = ParseLbosConfigureAnswer(*body_aptr);
+    if (exists != NULL) {
+        *exists = res.exists;
+    }
+    return res.current_version;
+}
+
+
+string LBOS::ServiceVersionSet(const string&  service,
+                               const string&  new_version,
+                               bool* existed)
+{
+    char* body_str = NULL, *status_message_str = NULL;
+    AutoPtr< char*, Free<char*> > body_aptr(&body_str),
+                                  status_message_aptr(&status_message_str);
+    unsigned short result = LBOS_ServiceVersionSet(service.c_str(),
+                                                   new_version.c_str(),
+                                                   &*body_aptr,
+                                                   &*status_message_aptr);
+    s_ProcessResult(result, *body_aptr, *status_message_aptr);
+    SLbosConfigure res = ParseLbosConfigureAnswer(*body_aptr);
+    if (existed != NULL) {
+        *existed = res.existed;
+    }
+    return res.prev_version;
+}
+
+
+string LBOS::ServiceVersionDelete(const string&  service,
+                                  bool* existed)
+{
+    char* body_str = NULL, *status_message_str = NULL;
+    AutoPtr< char*, Free<char*> > body_aptr(&body_str),
+                                  status_message_aptr(&status_message_str);
+    unsigned short result = LBOS_ServiceVersionDelete(service.c_str(),
+                                                      &*body_aptr,
+                                                      &*status_message_aptr);
+    s_ProcessResult(result, *body_aptr, *status_message_aptr);
+    SLbosConfigure res = ParseLbosConfigureAnswer(*body_aptr);
+    if (existed != NULL) {
+        *existed = res.existed;
+    }
+    return res.prev_version;
+}
+
+
+CLBOSException::EErrCode 
+    CLBOSException::s_HTTPCodeToEnum(unsigned short http_code) 
+{
+    switch (http_code) {
+    case kLBOSNoLBOS:
+        return EErrCode::e_LBOSNoLBOS;
+    case kLBOSNotFound:
+        return EErrCode::e_LBOSNotFound;
+    case kLBOSBadRequest:
+        return EErrCode::e_LBOSBadRequest;
+    case kLBOSOff:
+        return EErrCode::e_LBOSOff;
+    case kLBOSInvalidArgs:
+        return EErrCode::e_LBOSInvalidArgs;
+    case kLBOSDNSResolveError:
+        return EErrCode::e_LBOSDNSResolveError;
+    case kLBOSMemAllocError:
+        return EErrCode::e_LBOSMemAllocError;
+    case kLBOSCorruptOutput:
+        return EErrCode::e_LBOSCorruptOutput;
+    case kLBOSServerError:
+        return EErrCode::e_LBOSServerError;
+    default:
+        return EErrCode::e_LBOSUnknown;
+    }
+}
+
+
+unsigned short CLBOSException::GetStatusCode(void) const {
+    return m_StatusCode;
+}
+
+
+const char* CLBOSException::GetErrCodeString(void) const
+{
+    switch (GetErrCode()) {
+    /* 400 */
+    case EErrCode::e_LBOSBadRequest:
+        return "";
+    /* 404 */
+    case EErrCode::e_LBOSNotFound:
+        return "";
+    /* 500 */
+    case EErrCode::e_LBOSServerError:
+        return "";
+    /* 450 */
+    case EErrCode::e_LBOSNoLBOS:
+        return "LBOS was not found";
+    /* 451 */
+    case EErrCode::e_LBOSDNSResolveError:
+        return "DNS error. Possibly, cannot get IP of current machine or "
+               "resolve provided hostname for the server";
+    /* 452 */
+    case EErrCode::e_LBOSInvalidArgs:
+        return "Invalid arguments were provided. No request to LBOS was sent";
+    /* 453 */
+    case EErrCode::e_LBOSMemAllocError:
+        return "Memory allocation error happened while performing request";
+    /* 454 */
+    case EErrCode::e_LBOSCorruptOutput:
+        return "Failed to parse LBOS output.";
+    /* 550 */
+    case EErrCode::e_LBOSOff:
+        return "LBOS functionality is turned OFF. Check config file or "
+               "connection to LBOS.";
+    default:
+        return "Unknown LBOS error code";
+    }
+}
+
+
+CLBOSException::CLBOSException(void) : m_StatusCode(0)
+{
+}
+
+
+CLBOSException::CLBOSException(const CDiagCompileInfo& info, 
+                               const CException* prev_exception, 
+                               const CExceptionArgs<EErrCode>& args, 
+                               const string& message, 
+                               unsigned short status_code) 
+    : CException(info, prev_exception, (message),
+      args.GetSeverity(), 0)
+{
+
+    x_Init(info, message, prev_exception, args.GetSeverity());
+    x_InitArgs(args);
+    x_InitErrCode((CException::EErrCode) args.GetErrCode());
+    m_StatusCode = status_code;
+    stringstream message_builder;
+    message_builder << "Error: "
+        << status_code << " " << GetErrCodeString() << endl;
+    m_Message = message_builder.str();
+}
+
+
+CLBOSException::CLBOSException(const CDiagCompileInfo& info, 
+                               const CException* prev_exception, 
+                               EErrCode err_code, 
+                               const string& message, 
+                               unsigned short status_code, 
+                               EDiagSev severity /*= eDiag_Error*/) 
+    : CException(info, prev_exception, (message), severity, 0)
+{
+    x_Init(info, message, prev_exception, severity);
+    x_InitErrCode((CException::EErrCode) err_code);
+    m_StatusCode = status_code;
+    stringstream message_builder;
+    message_builder << "Error: "
+        << message << endl;
+    m_Message = message_builder.str();
+}
+
+const char* CLBOSException::what() const throw()
+{
+
+    return m_Message.c_str();
+}
+
+CLBOSException::~CLBOSException(void) throw()
+{
+
+}
+
+const char* CLBOSException::GetType(void) const
+{
+    return "CLBOSException";
+}
+
+CLBOSException::TErrCode CLBOSException::GetErrCode(void) const
+{
+    return typeid(*this) == typeid(CLBOSException) ?
+        (TErrCode) this->x_GetErrCode() :
+        (TErrCode)CException::eInvalid;
+}
+
+const CException* CLBOSException::x_Clone(void) const
+{
+    return new CLBOSException(*this);
+}
+
+END_NCBI_SCOPE
diff --git a/c++/src/connect/ncbi_lbosp.h b/c++/src/connect/ncbi_lbosp.h
new file mode 100644
index 0000000..5592d46
--- /dev/null
+++ b/c++/src/connect/ncbi_lbosp.h
@@ -0,0 +1,607 @@
+#ifndef CONNECT___NCBI_LBOSP__H
+#define CONNECT___NCBI_LBOSP__H
+/*
+* ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors:  Dmitriy Elisov
+ * @file
+ * File Description:
+ *   This header was made only because of unit testing application. Please, 
+ *   include only ncbi_lbos.h.
+ *   This file contains only those elements that are absolutely unneeded
+ *   if you do not want to dive into internal LBOS client implementation.
+*/
+#include "ncbi_servicep.h"
+#include <connect/ncbi_http_connector.h>
+#include "ncbi_lbos.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+
+/*
+ * Additional HTTP codes:
+ *  450 - LBOS not found
+ *  451 - DNS resolve failed for healthcheck URL
+ *  452 - Invalid arguments provided, request was not sent to LBOS
+ *  453 - Memory allocation error encountered
+ *  454 - LBOS output could not be parsed
+ *  550 - LBOS client is OFF in the current process
+ */
+static const int kLBOSSuccess         = 200;
+static const int kLBOSBadRequest      = 400;
+static const int kLBOSNotFound        = 404;
+static const int kLBOSNoLBOS          = 450;
+static const int kLBOSDNSResolveError = 451;
+static const int kLBOSInvalidArgs     = 452;
+static const int kLBOSMemAllocError   = 453;
+static const int kLBOSCorruptOutput   = 454;
+static const int kLBOSServerError     = 500;
+static const int kLBOSOff             = 550;
+
+
+///////////////////////////////////////////////////////////////////////////////
+//                             DATA TYPES                                    //
+///////////////////////////////////////////////////////////////////////////////
+/** @brief Possible values to set primary address where to search for LBOS.
+ *
+ * LBOS can be located in different places, such as:
+ *   - localhost,
+ *   - home zone server (i.e. LBOS.dev.be-md.ncbi.nlm.nih.gov, if you
+ *     are be-md domain on dev machine),
+ *   - somewhere else (set in registry with [CONN]LBOS)
+ * You can set priority for the first place to try. If LBOS is not found in
+ * this primary location, then it will be searched for in other places
+ * following default algorithm of going through places (maybe even through
+ * the same place again).                                                    */
+typedef enum {
+    eLBOSFindMethod_None,           /**< do not search. Used to skip
+                                         "custom host" method                */
+    eLBOSFindMethod_CustomHost,     /**< Use custom address provided by
+                                         s_SetLBOSaddress()                  */
+    eLBOSFindMethod_Registry,       /**< Use value from registry (default)   */
+    eLBOSFindMethod_Lbosresolve,    /**< Use value from /etc/ncbi/lbosresolve*/
+} ELBOSFindMethod;
+
+
+/** Very simple internal structure which stores information about found 
+ * servers.                                                                  */
+typedef struct {
+    SSERV_Info*         info;        /**< Stores only IP and port for now    */
+} SLBOS_Candidate;
+
+
+/** All the data required to store state of one request to LBOS between 
+ * calls to SERV_GetNextInfo.                                                */
+typedef struct {
+    SConnNetInfo*       net_info;    /**< Connection point                   */
+    const char*         lbos_addr;   /**< LBOS host:port or IP:port. Used if
+                                          find_method == 
+                                          eLBOSFindMethod_CustomHost        */
+    SLBOS_Candidate*    cand;        /**< Array of found server to iterate   */
+    size_t              pos_cand;    /**< Current candidate                  */
+    size_t              n_cand;      /**< Used space for candidates          */
+    size_t              a_cand;      /**< Allocated space for candidates     */
+    ELBOSFindMethod     find_method; /**< How we find LBOS. Mainly for
+                                          testing                            */
+} SLBOS_Data;
+
+
+/** Data structure to use as user_data in HTTP Connector (header is used 
+ *  only for unit testing)                                                   */
+typedef struct {
+    int http_response_code;
+    char* http_status_mesage;
+    const char* header;
+    size_t content_length; /* Value of "Content-length" HTTP header tag. 
+                              -1 (max value) as no limit */
+} SLBOS_UserData;
+
+
+/** Used for internal storage, so that DeannounceAll() could deannounce 
+ *  everything that was announced earlier.
+ * @see 
+ *  DeannounceAll()
+ */
+struct SLBOS_AnnounceHandle_Tag
+{
+    char*            service;       /**< service name of announced server    */
+    char*            version;       /**< service version of announced server */
+    char*            host;          /**< host of announced server            */
+    unsigned short   port;          /**< port of announced server            */
+};
+
+
+/** Possible values of parameter for g_LBOS_CheckIterator(), 
+ *  this enum is used only in assertions
+ * @see
+ *  g_LBOS_CheckIterator()                                                   */
+typedef enum {
+    ELBOSIteratorCheckType_MustHaveData,   /**< Iterator MUST have 'data'
+                                                filled or error will be
+                                                returned                     */
+    ELBOSIteratorCheckType_DataMustBeNULL, /**< Iterator MUST have 'data' 
+                                                NULL or error will be 
+                                                returned                     */
+    ELBOSIteratorCheckType_NoCheck         /**< No check of 'data'           */
+} ELBOSIteratorCheckType;
+
+///////////////////////////////////////////////////////////////////////////////
+//                        MOCK FUNCTION TYPEDEFS                             //
+///////////////////////////////////////////////////////////////////////////////
+/** Send REST API request to LBOS, read answer and return filled array of 
+ * SSERV_INFO, containing info about all found servers.
+ * @param lbos_address[in]  
+ *  IP:port or host:port where to send request.
+ * @param serviceName[in]   
+ *  Name of service to ask for.
+ * @param net_info[in] 
+ *  Connection point.
+ * @return             
+ *  Array of pointers to SSERV_Info structs, containing all found servers. 
+ */
+typedef
+SSERV_Info** FLBOS_ResolveIPPortMethod(const char*     lbos_address,
+                                       const char*     serviceName,
+                                       SConnNetInfo*   net_info);
+
+
+/** Read from connection. Handles buffer itself.
+ * @param conn[in]     
+ *  Connection handle.
+ * @param buf[in]      
+ *  Memory buffer to read to.
+ * @param size[in]     
+ *  Max. # of bytes to read.
+ * @param n_read[out]  
+ *  Non-NULL, # of actually read bytes.
+ * @param how[in]      
+ *  Peek/read/persist.
+ * @return             
+ *  Success or some error code.                                              */
+typedef
+EIO_Status FLBOS_ConnReadMethod(CONN           conn,
+                                void*          buf,
+                                size_t         size,
+                                size_t*        n_read,
+                                EIO_ReadMethod how);
+
+
+/**  Compose LBOS address from /etc/ncbi/{role, domain}.
+ *  @return             
+ *   Constructed host:port or IP:port. Must be free()'d by the caller.       */
+typedef
+char* FLBOS_ComposeLBOSAddressMethod(void);
+
+
+/**  Given just empty data structure and name of service, do all necessary 
+ *  operations to fill the structure with servers.
+ *  @param data[out]    
+ *   This structure will be filled.
+ *  @param service[in]  
+ *   Name of the service of which we search servers.                         */
+typedef
+void FLBOS_FillCandidatesMethod(SLBOS_Data* data,
+                                const char* service);
+
+
+/**  Destroy data (simulation of destructor as if SLBOS_Data were a class. 
+ *  Please note that it will be free()'d and no following access is possible, 
+ *  so setting data to NULL after this method is recommended for avoiding 
+ *  confusion.
+ *  @param data[in]     
+ *   Structure to be destroyed.
+ *  @note               
+ *   It presumes that s_LBOS_Reset was called previously.
+ *  @see                
+ *   S_LBOS_Reset(), SLBOS_Data                                              */
+typedef
+void FLBOS_DestroyDataMethod(SLBOS_Data* data);
+
+
+/** Called under the hood of SERV_GetNextInfo and is responsible for 
+ *  LBOS client.
+ *  @param iter[in]
+ *   Iterator used to iterate through servers.
+ *  @param host_info[out]  
+ *   Supposed to be set to pointer to info about host on which returned 
+ *   server resides, but due to limitations of AWS cloud, it is always NULL.
+ *  @return              
+ *   Next server.                                                            */
+typedef
+SSERV_Info* FLBOS_GetNextInfoMethod(SERV_ITER  iter,
+                                    HOST_INFO* host_info);
+
+
+/** For announcement we search for a LBOS which can handle our request. 
+ * Search starts with default order of LBOS.
+ * @param service[in]    
+ *  Name of service as it will appear in ZK. For services this means that 
+ *  name should start with '/'.
+ * @param version[in]
+ *  Any non-NULL valid C-string.
+* @param [in] host
+*  Optional parameter (NULL to ignore). If provided, tells on which host
+*  the server resides. Can be different from healthcheck host. If set to
+*  NULL, host is taken from healthcheck.
+ * @param port[in]
+ *  Port for service. Can differ from healthcheck port.
+ * @param healthcheck_url[in]
+ *  Full absolute URL starting with "http://" or "https://". Should include
+ *  hostname or IP and port, if necessary.
+ * @param LBOS_answer[out]
+ *  This variable will be assigned a pointer to char* with exact answer of
+ *  LBOS, or NULL. If it is not NULL, must be free()'d by the caller. If
+ *  eLBOS_Success is returned, LBOS answer contains "host:port"
+ *  of LBOS that was used for announce. If something else is returned, LBOS
+ *  answer contains human-readable error message.
+ * @return
+ *  Code of success or some error.
+ * @see
+ *  ELBOS_Result                                                             */
+typedef
+unsigned short FLBOS_AnnounceMethod(const char*     service,
+                                    const char*     version,
+                                    const char*     host,
+                                    unsigned short  port,
+                                    const char*     healthcheck_url,
+                                    char**          LBOS_answer,
+                                    char**          http_status_message);
+
+
+/** Deannounce previously announced service.
+ * @param lbos_hostport[in]    
+ *  Address of the same LBOS that was used for announcement of the service 
+ *  now being de-announced.
+ * @param service[in]    
+ *  Name of service to be de-announced.
+ * @param version[in]    
+ *  Version of service to be de-announced.
+ * @param port[in]       
+ *  Port of service to be de-announced.
+ * @param[in]            
+ *  IP or hostname of service to be de-announced.
+ * @return               
+ *  false - any error, no deannounce was made;
+ *  true - success, deannounce was made.                                     */
+typedef
+int/*bool*/ FLBOS_DeannounceMethod(const char*       lbos_hostport,
+                                   const char*       service,
+                                   const char*       version,
+                                   const char*       host,
+                                   unsigned short    port,
+                                   char**            lbos_answer,
+                                   int*              http_status_code,
+                                   char**            http_status_message);
+
+
+/** This function test existence of the application that should always be 
+ * found - LBOS itself. If it is not found, we turn client off.              */
+typedef 
+void FLBOS_InitializeMethod(void);
+
+
+typedef char* FLBOS_UrlReadAllMethod(SConnNetInfo* net_info, 
+                                     const char*   url,
+                                     int*          status_code,
+                                     char**        status_message);
+
+
+/** Standard parse header function. The only thing considered is that
+   standard "void* data" field is used as int code of HTTP response          */
+typedef EHTTP_HeaderParse FLBOS_ParseHeader(const char*      header,
+                                             void* /* int* */response_code,
+                                             int             server_error);
+
+/** Get (and cache for faster follow-up retrievals) the address of
+ * local host.                                                               */
+typedef unsigned int FLBOS_SOCKGetLocalHostAddressMethod(ESwitch reget);
+
+///////////////////////////////////////////////////////////////////////////////
+//                       VIRTUAL FUNCTIONS TABLE                             //
+///////////////////////////////////////////////////////////////////////////////
+typedef struct {
+    FLBOS_ResolveIPPortMethod*              ResolveIPPort;
+    FLBOS_ConnReadMethod*                   Read;
+    FLBOS_ComposeLBOSAddressMethod*         ComposeLBOSAddress;
+    FLBOS_FillCandidatesMethod*             FillCandidates;
+    FLBOS_DestroyDataMethod*                DestroyData;
+    FLBOS_GetNextInfoMethod*                GetNextInfo;
+    FLBOS_InitializeMethod*                 Initialize;
+    FLBOS_UrlReadAllMethod*                 UrlReadAll;
+    FLBOS_ParseHeader*                      ParseHeader;
+    FLBOS_SOCKGetLocalHostAddressMethod*    LocalHostAddr;
+    FLBOS_AnnounceMethod*                   AnnounceEx;
+} SLBOS_Functions;
+
+
+///////////////////////////////////////////////////////////////////////////////
+//                             GLOBAL FUNCTIONS                              //
+///////////////////////////////////////////////////////////////////////////////
+/** Get the best possible LBOS address for this platform.
+ * @return
+ *  LBOS address that needs to be free()'d by the caller.
+ * @see
+ *  g_LBOS_GetLBOSAddressEx()                                              */
+NCBI_XCONNECT_EXPORT
+char* g_LBOS_GetLBOSAddress(void);
+
+
+/** Get the best possible LBOS addresses for this platform, extended version - 
+ * first tries the method of caller's choice.
+ * @param[in]   priority_find_method
+ *  First method to try.
+ * @param[in]   lbos_addr
+ *  String with "%hostname%:%port%" or "%IP%:%port%". If priority_find_method
+ *  is set to eLBOSFindMethod_CustomHost, lbos_addr should be non-NULL
+ *  (or else the method will be ignored)
+ * @return
+ *  LBOS address that needs to be free()'d by the caller.
+ * @see
+ *  g_LBOS_GetLBOSAddress()                                                */
+NCBI_XCONNECT_EXPORT
+char* g_LBOS_GetLBOSAddressEx(ELBOSFindMethod priority_find_method,
+                              const char*     lbos_addr);
+
+/** Creates iterator and fills it with found servers.
+ * @param[in,out] iter
+ *  Pointer to iterator. It is read and rewritten. If nothing found, it is
+ *  free()'d and points to unallocated area.
+ * @param[in] net_info
+ *  Connection point.
+ * @param[out] info
+ *  Always assigned NULL, as not used in this client.
+ * @return
+ *  Table of methods if found servers, NULL if not found.
+ * @see
+ *  s_Open(), SERV_LOCAL_Open(), SERV_LBSMD_Open(), SERV_DISPD_Open()        */
+NCBI_XCONNECT_EXPORT
+const SSERV_VTable*  SERV_LBOS_Open(SERV_ITER           iter,
+                                    const SConnNetInfo* net_info,
+                                    SSERV_Info**        info);
+
+
+/** Checks C-string if it is NULL or is of zero length.
+ * @param[in]   str
+ *  String to check.
+ * @return
+ *  true - string is NULL or empty;
+ *  false - string exists and contains elements.                             */
+NCBI_XCONNECT_EXPORT
+int/*bool*/ g_LBOS_StringIsNullOrEmpty(const char* const str);
+
+
+/** Compose LBOS address from /etc/ncbi/{role, domain}.
+ *  @return
+ *   LBOS address. Must be free()'d by the caller.                           */
+NCBI_XCONNECT_EXPORT
+char* g_LBOS_ComposeLBOSAddress(void);
+
+
+/** Set primary method how to find LBOS. Default is eLBOSFindMethod_Registry.
+ *  @param[in]  iter
+ *   Iterator that represents current request to LBOS.
+ *  @param[in]  method
+ *   One of methods.
+ *  @return             f
+ *   false - something went wrong, primary method was not changed;
+ *   true  - success.                                                        */
+NCBI_XCONNECT_EXPORT
+int/*bool*/ g_LBOS_UnitTesting_SetLBOSFindMethod(SERV_ITER        iter,
+                                                 ELBOSFindMethod  method);
+
+
+/**  Set custom host for LBOS. It will be used when method 
+ *  eLBOSFindMethod_CustomHost is used.
+ *  @param[in]  iter
+ *   Iterator that represents current request to LBOS.
+ *  @param[in]  address
+ *   IP:port  or host:port to use.
+ *  @return             
+ *   false - something went wrong, LBOS address was not changed.
+ *   true  - success.                                                        */
+NCBI_XCONNECT_EXPORT
+int/*bool*/ g_LBOS_UnitTesting_SetLBOSaddress(SERV_ITER  iter,
+                                              char*      address);
+
+
+/**  Set custom files to load role and domain from, respectively.
+ *  @param roleFile[in] 
+ *   To change role file path, pass it here. To use current role file path, 
+ *   pass NULL.
+ *  @param domainFile[in]  
+ *   To change domain file path, pass it here. To use current domain file path, 
+ *   pass NULL.
+ *  @param lbosresolverFile[in]
+ *   To change lbosresolver file path, pass it here. To use current 
+ *   lbosresolver file path, pass NULL.
+ *  @return             
+ *   false - something went wrong, values not changed;
+ *   true  - success.                                                        */
+NCBI_XCONNECT_EXPORT int/*bool*/
+g_LBOS_UnitTesting_SetLBOSRoleDomainResolverFile(const char* roleFile,
+                                                 const char* domainFile,
+                                                 const char* lbosresolverFile);
+
+
+/**  Checks iterator, fact that iterator belongs to this client, iterator data.
+ * Only debug function.
+ * @param iter[in]
+ *  Iterator to check. Not modified in any way.
+ * @param should_have_data[in]
+ *  How to check 'data' field of iterator.
+ * @see
+ *  ELBOSIteratorCheckType
+ * @return
+ *  true  - iterator is valid;
+ *  false - iterator is invalid.                                            
+ */
+NCBI_XCONNECT_EXPORT
+int/*bool*/  g_LBOS_CheckIterator(SERV_ITER               iter,
+                                  ELBOSIteratorCheckType  should_have_data);
+
+/** Find server among announced and return its position. If not found, 
+ * return -1.                                                               
+ */
+NCBI_XCONNECT_EXPORT
+int  g_LBOS_UnitTesting_FindAnnouncedServer(const char*          service,
+                                             const char*          version,
+                                             unsigned short       port,
+                                             const char*          host);
+
+/** Get LBOS-specific announcement variable from registry                   
+ */
+NCBI_XCONNECT_EXPORT char* g_LBOS_RegGet(const char* section,
+                                          const char* name,
+                                          const char* def_value);
+
+
+
+/** This service can be used to remove service from configuration. Current
+ * version will be empty. Previous version shows deleted version.
+ */
+NCBI_XCONNECT_EXPORT
+unsigned short LBOS_ServiceVersionDelete(const char*   service,
+                                               char**  lbos_answer,
+                                               char**  http_status_message);
+
+
+/** This request can be used to set new version for a service. Current and
+ * previous versions show currently set and previously used service versions.
+ * @param[in] service
+ *  Name of service for which the version is going to be changed
+ * @param new_version[out]
+ *  Version that will be used by default for specefied service
+ * @param lbos_answer[out]
+ *  Variable to be assigned pointer to C-string with LBOS answer
+ * @param http_status_message[out]
+ *  Variable to be assigned pointer to C-string with status message from LBOS
+ */
+NCBI_XCONNECT_EXPORT
+unsigned short LBOS_ServiceVersionSet(const char*   service,
+                                      const char*   new_version,
+                                            char**  lbos_answer,
+                                            char**  http_status_message);
+
+
+/** This request will show currently used version for a requested service.
+* Current and previous version will be the same.
+* @param service[in]
+*  Name of service for which to ask default version
+* @param lbos_answer[out]
+*  Variable to be assigned pointer to C-string with LBOS answer
+* @param http_status_message[out]
+*  Variable to be assigned pointer to C-string with status message from LBOS
+* @return
+*  Status code returned by LBOS
+*/
+NCBI_XCONNECT_EXPORT
+unsigned short LBOS_ServiceVersionGet(const char*  service,
+                                            char** lbos_answer,
+                                            char** http_status_message);
+
+///////////////////////////////////////////////////////////////////////////////
+//                      GLOBAL VARIABLES FOR UNIT TESTS                      //
+///////////////////////////////////////////////////////////////////////////////
+
+/** Table of all functions to mock, used solely for unit testing purposes.
+ * @see                
+ *  SLBOS_Functions                                                          */
+NCBI_XCONNECT_EXPORT
+SLBOS_Functions* g_LBOS_UnitTesting_GetLBOSFuncs(void);
+
+
+/** Check whether LBOS client is turned ON or OFF.
+ * @return
+ *  address of static variable s_LBOS_TurnedOn.
+ * @see           
+ *  SERV_LBOS_Open()                                                         */
+NCBI_XCONNECT_EXPORT
+int* g_LBOS_UnitTesting_PowerStatus(void);
+
+
+/** Check whether LBOS client is turned ON or OFF.
+ * @return         
+ *  address of static variable s_LBOS_TurnedOn.
+ * @see 
+ *  SERV_LBOS_Open()                                                         */
+NCBI_XCONNECT_EXPORT
+int* g_LBOS_UnitTesting_InitStatus(void);
+
+
+/** List of addresses of LBOS that is maintained in actual state.
+ * @return         
+ *  address of static variable s_LBOS_InstancesList.
+ * @see            
+ *  SERV_LBOS_Open(), s_LBOS_FillCandidates()                                */
+NCBI_XCONNECT_EXPORT
+char** g_LBOS_UnitTesting_Instance(void);
+
+
+/** List of announced servers that is stored statically
+ * @return 
+ *  address of static variable s_LBOS_AnnouncedServers                       */
+NCBI_XCONNECT_EXPORT
+struct SLBOS_AnnounceHandle_Tag** g_LBOS_UnitTesting_GetAnnouncedServers(void);
+
+
+/** Number of announced servers stored
+ * @return 
+ *  pointer to s_LBOS_AnnouncedServersNum                                    */
+NCBI_XCONNECT_EXPORT
+int g_LBOS_UnitTesting_GetAnnouncedServersNum(void);
+
+
+/**  Pointer to s_LBOS_CurrentDomain
+ *  @return
+ *   address of static variable s_LBOS_CurrentDomain.
+ *  @see                                                                     */
+NCBI_XCONNECT_EXPORT
+char** g_LBOS_UnitTesting_CurrentDomain(void);
+
+
+/**  Pointer to s_LBOS_CurrentRole
+ *  @return
+ *   address of static variable s_LBOS_CurrentRole.
+ *  @see                                                                     */
+NCBI_XCONNECT_EXPORT
+char** g_LBOS_UnitTesting_CurrentRole(void);
+
+
+/**  Pointer to s_LBOS_Lbosresolver
+ *  @return
+ *   address of static variable s_LBOS_Lbosresolver.
+ *  @see                                                                     */
+NCBI_XCONNECT_EXPORT
+char** g_LBOS_UnitTesting_Lbosresolver(void);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /*__cplusplus*/
+
+#endif /* CONNECT___NCBI_LBOSP__H */
diff --git a/c++/src/connect/ncbi_lbosp.hpp b/c++/src/connect/ncbi_lbosp.hpp
new file mode 100644
index 0000000..7de44ec
--- /dev/null
+++ b/c++/src/connect/ncbi_lbosp.hpp
@@ -0,0 +1,96 @@
+#ifndef CONNECT___NCBI_LBOSP__HPP
+#define CONNECT___NCBI_LBOSP__HPP
+/*
+* ===========================================================================
+*
+*                            PUBLIC DOMAIN NOTICE
+*               National Center for Biotechnology Information
+*
+*  This software/database is a "United States Government Work" under the
+*  terms of the United States Copyright Act.  It was written as part of
+*  the author's official duties as a United States Government employee and
+*  thus cannot be copyrighted.  This software/database is freely available
+*  to the public for use. The National Library of Medicine and the U.S.
+*  Government have not placed any restriction on its use or reproduction.
+*
+*  Although all reasonable efforts have been taken to ensure the accuracy
+*  and reliability of the software and data, the NLM and the U.S.
+*  Government do not and cannot warrant the performance or results that
+*  may be obtained by using this software or data. The NLM and the U.S.
+*  Government disclaim all warranties, express or implied, including
+*  warranties of performance, merchantability or fitness for any particular
+*  purpose.
+*
+*  Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* Authors:  Dmitriy Elisov
+* @file
+* File Description:
+*   Unit test functions for the LBOS client.
+*/
+
+#include <corelib/ncbiexpt.hpp>
+#include <connect/ncbi_lbos.hpp>
+
+BEGIN_NCBI_SCOPE
+
+
+/// Composite key for "hostname<->IP" cache
+class CLBOSIpCacheKey
+{
+public:
+    CLBOSIpCacheKey(string service, string hostname, string version,
+                    unsigned short port);
+
+    bool operator==(const CLBOSIpCacheKey& rh) const;
+
+    bool operator<(const CLBOSIpCacheKey& rh) const;
+
+    bool operator>(const CLBOSIpCacheKey& rh) const;
+private:
+    string x_Service;
+    string x_Hostname;
+    string x_Version;
+    unsigned short x_Port;
+};
+
+
+class NCBI_XCONNECT_EXPORT CLBOSIpCache
+{
+public:
+    /** Search the cache for previously resolved hostname with a given 
+    * service name, version, port. If not found - return the same hostname.
+    */
+    static
+    string HostnameTryFind(string service, string hostname, string version,
+    unsigned short port);
+
+
+    /** Search the cache for previously resolved hostname with a given 
+    * service name, version, port. If not found - resolve, cache and return 
+    * result.
+    */
+    static
+        string HostnameResolve(string service, string hostname,
+        string version, unsigned short port);
+
+
+    /** We do not need to store hostname<->IP record after the server is
+    * de-announced. So we just make sure that we delete the record only one 
+    * time, in case if many threads are going to delete it at the same 
+    * moment */
+    static
+        void HostnameDelete(string service, string hostname, string version,
+        unsigned short port);
+
+private:
+    static CSafeStatic< map< CLBOSIpCacheKey, string > > x_IpCache;
+};
+
+
+
+END_NCBI_SCOPE
+
+#endif /* CONNECT___NCBI_LBOSP__HPP */
diff --git a/c++/src/connect/ncbi_local.c b/c++/src/connect/ncbi_local.c
index 3c719dd..a856e59 100644
--- a/c++/src/connect/ncbi_local.c
+++ b/c++/src/connect/ncbi_local.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_local.c 462401 2015-03-18 16:28:18Z lavr $
+/* $Id: ncbi_local.c 481584 2015-10-14 04:40:34Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -376,7 +376,6 @@ const SSERV_VTable* SERV_LOCAL_Open(SERV_ITER iter,
 
     if (!(data = (struct SLOCAL_Data*) calloc(1, sizeof(*data))))
         return 0;
-
     iter->data = data;
 
     if (g_NCBI_ConnectRandomSeed == 0) {
@@ -389,6 +388,7 @@ const SSERV_VTable* SERV_LOCAL_Open(SERV_ITER iter,
         s_Close(iter);
         return 0;
     }
+    assert(data->n_cand);
     if (data->n_cand > 1)
         qsort(data->cand, data->n_cand, sizeof(*data->cand), s_Sort);
 
diff --git a/c++/src/connect/ncbi_pipe.cpp b/c++/src/connect/ncbi_pipe.cpp
index 43f4968..db31633 100644
--- a/c++/src/connect/ncbi_pipe.cpp
+++ b/c++/src/connect/ncbi_pipe.cpp
@@ -1,4 +1,4 @@
-/* $Id: ncbi_pipe.cpp 452711 2014-11-24 15:55:22Z sadyrovr $
+/* $Id: ncbi_pipe.cpp 488579 2016-01-01 00:38:12Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -36,9 +36,10 @@
 #  undef _FORTIFY_SOURCE
 #endif /*_FORTIFY_SOURCE*/
 #define  _FORTIFY_SOURCE 0
+#include "ncbi_priv.h"
 #include <connect/error_codes.hpp>
+#include <corelib/ncbi_param.hpp>
 #include <connect/ncbi_pipe.hpp>
-#include <connect/ncbi_util.h>
 #include <corelib/ncbi_system.hpp>
 #include <corelib/stream_utils.hpp>
 
@@ -56,6 +57,7 @@
 #  include <sys/time.h>
 #  include <sys/types.h>
 #  include <sys/wait.h>
+#  include <poll.h>
 
 #else
 #  error "The CPipe class is supported only on Windows and Unix"
@@ -264,12 +266,11 @@ private:
 
 
 CPipeHandle::CPipeHandle(void)
-    : m_ProcHandle(INVALID_HANDLE_VALUE),
-      m_ChildStdIn(INVALID_HANDLE_VALUE),
+    : m_ChildStdIn (INVALID_HANDLE_VALUE),
       m_ChildStdOut(INVALID_HANDLE_VALUE),
       m_ChildStdErr(INVALID_HANDLE_VALUE),
-      m_Flags(0),
-      m_SelfHandles(false)
+      m_ProcHandle (INVALID_HANDLE_VALUE),
+      m_Flags(0), m_SelfHandles(false)
 {
     return;
 }
@@ -533,7 +534,6 @@ EIO_Status CPipeHandle::Close(int* exitcode, const STimeout* timeout)
     if (status != eIO_Timeout) {
         x_Clear();
     }
-
     return status;
 }
 
@@ -882,6 +882,10 @@ static string s_UnixError(int error, string& message)
 // CPipeHandle -- Unix version
 //
 
+NCBI_PARAM_DECL  (bool, CONN, PIPE_USE_POLL);
+NCBI_PARAM_DEF_EX(bool, CONN, PIPE_USE_POLL,
+                  true, eParam_Default, CONN_PIPE_USE_POLL);
+
 class CPipeHandle
 {
 public:
@@ -933,15 +937,20 @@ private:
     // member variables contain the relevant handles of the
     // current process, in which case they won't be closed.
     bool m_SelfHandles;
+
+    // Use poll(2) (now default) instead of select(2) (formerly)
+    bool m_UsePoll;
 };
 
 
 CPipeHandle::CPipeHandle(void)
     : m_ChildStdIn(-1), m_ChildStdOut(-1), m_ChildStdErr(-1),
-      m_Pid((pid_t)(-1)), m_Flags(0),
-      m_SelfHandles(false)
+      m_Pid((pid_t)(-1)), m_Flags(0), m_SelfHandles(false)
 {
-    return;
+    static NCBI_PARAM_TYPE(CONN, PIPE_USE_POLL) use_poll_param;
+
+    m_UsePoll = use_poll_param.Get();
+    _TRACE("CPipeHandle using poll(): " + NStr::BoolToString(m_UsePoll));
 }
 
 
@@ -964,7 +973,7 @@ static void s_Exit(int status, int fd)
 }
 
 
-// Emulate inexistent function execvpe().
+// Emulate nonexistent function execvpe().
 // On success, execve() does not return, on error -1 is returned,
 // and errno is set appropriately.
 
@@ -975,18 +984,16 @@ static int s_ExecShell(const char *file,
 
     // Count number of arguments
     int i;
-    for (i = 0;  argv[i];  i++);
-    i++; // copy last zero element also
-    
-    // Construct an argument list for the shell.
-    // Not all compilers support next construction:
-    //   const char* args[i + 1];
+    for (i = 0;  argv[i];  ++i);
+    ++i; // copy last zero element also
+
+    // Construct argument list for the shell
     const char **args = new const char*[i + 1];
     AutoPtr<const char*,  ArrayDeleter<const char*> > args_ptr(args);
 
     args[0] = kShell;
     args[1] = file;
-    for (;  i > 1;  i--) {
+    for (;  i > 1;  --i) {
         args[i] = argv[i - 1];
     }
 
@@ -995,7 +1002,7 @@ static int s_ExecShell(const char *file,
 }
 
 
-static int s_ExecVPE(const char *file, char *const argv[], char *const envp[])
+static int s_ExecVPE(const char* file, char* const argv[], char* const envp[])
 {
     // CAUTION (security):  current directory is in the path on purpose,
     //                      to be in-sync with default behavior of MS-Win.
@@ -1006,6 +1013,7 @@ static int s_ExecVPE(const char *file, char *const argv[], char *const envp[])
         errno = ENOENT;
         return -1;
     }
+
     // If the file name contains path
     if ( strchr(file, '/') ) {
         ::execve(file, argv, envp);
@@ -1014,24 +1022,22 @@ static int s_ExecVPE(const char *file, char *const argv[], char *const envp[])
         }
         return -1;
     }
-    // Get PATH environment variable   
-    const char *path = getenv("PATH");
+
+    // Get the PATH environment variable
+    CORE_LOCK_READ;
+    const char* path = getenv("PATH");
     if ( !path ) {
         path = kPathDefault;
     }
-    size_t file_len = strlen(file) + 1 /* '\0' */;
-    size_t buf_len = strlen(path) + file_len + 1 /* '/' */;
-    char* buf = new char[buf_len];
-    if ( !buf ) {
-        errno = ENOMEM;
-        return -1;
-    }
-    AutoPtr<char, ArrayDeleter<char> > buf_ptr(buf);
+    size_t file_len = strlen(file) + 1/*'\0'*/;
+    AutoPtr< char, ArrayDeleter<char> >
+        buf_ptr(new char[strlen(path) + 1/*'/'*/ + file_len]);
+    char* buf = buf_ptr.get();
 
     bool eacces_err = false;
     const char* next = path;
     while (*next) {
-        next = strchr(path,':');
+        next = strchr(path, ':');
         if ( !next ) {
             // Last part of the PATH environment variable
             next = path + strlen(path);
@@ -1039,22 +1045,25 @@ static int s_ExecVPE(const char *file, char *const argv[], char *const envp[])
         size_t len = next - path;
         if ( len ) {
             // Copy directory name into the buffer
-            memmove(buf, path, next - path);
+            memmove(buf, path, len);
+            // Add slash if needed
+            if (buf[len - 1] != '/') {
+                buf[len++]    = '/';
+            }
         } else {
             // Two colons side by side -- current directory
-            buf[0]='.';
-            len = 1;
-        }
-        // Add slash and file name
-        if (buf[len-1] != '/') {
-            buf[len++] = '/';
+            buf[0] = '.';
+            buf[1] = '/';
+            len = 2;
         }
+        // Add file name
         memcpy(buf + len, file, file_len);
         path = next + 1;
 
         // Try to execute file with generated name
         ::execve(buf, argv, envp);
         if (errno == ENOEXEC) {
+            CORE_UNLOCK;
             return s_ExecShell(buf, argv, envp);
         }
         switch (errno) {
@@ -1067,9 +1076,12 @@ static int s_ExecVPE(const char *file, char *const argv[], char *const envp[])
             break;
         default:
             // We found an executable file, but could not execute it
+            CORE_UNLOCK;
             return -1;
         }
     }
+
+    CORE_UNLOCK;
     if ( eacces_err ) {
         errno = EACCES;
     }
@@ -1601,90 +1613,146 @@ CPipe::TChildPollMask CPipeHandle::x_Poll(CPipe::TChildPollMask mask,
 {
     CPipe::TChildPollMask poll = 0;
 
-    for (;;) { // Auto-resume if interrupted by a signal
-        struct timeval* tmp;
-        struct timeval  tmo;
-
-        if ( timeout ) {
-            // NB: Timeout has already been normalized
-            tmo.tv_sec  = timeout->sec;
-            tmo.tv_usec = timeout->usec;
-            tmp = &tmo;
-        } else {
-            tmp = 0;
-        }
+    if (m_UsePoll) {
+        struct pollfd poll_fds[3] = {
+            {m_ChildStdIn,  POLLOUT|POLLERR, 0},
+            {m_ChildStdOut, POLLIN,          0},
+            {m_ChildStdErr, POLLIN,          0}
+        };
+        int timeout_msec(timeout
+                         ? timeout->sec * 1000 + (timeout->usec + 500) / 1000
+                         : -1/*infinite*/);
+
+        // Negative FDs OK, poll should ignore them
+        // Check the mask
+        if (!(mask & CPipe::fStdIn))
+            poll_fds[0].fd = -1;
+        if (!(mask & CPipe::fStdOut))
+            poll_fds[1].fd = -1;
+        if (!(mask & CPipe::fStdErr))
+            poll_fds[2].fd = -1;
+
+        for (;;) { // Auto-resume if interrupted by a signal
+            int n = ::poll(poll_fds, 3, timeout_msec);
+
+            if (n == 0) {
+                // timeout
+                break;
+            }
+            if (n > 0) {
+                // no need to check mask here
+                if (poll_fds[0].revents)
+                    poll |= CPipe::fStdIn;
+                if (poll_fds[1].revents)
+                    poll |= CPipe::fStdOut;
+                if (poll_fds[2].revents)
+                    poll |= CPipe::fStdErr;
+                break;
+            }
+            // n < 0
+            if ((n = errno) != EINTR) {
+                PIPE_THROW(n, "poll(2) failed");
+            }
+            // continue, no need to recreate either timeout or poll_fds
+        }
+    } else { // Using select(2), as before
+        for (;;) { // Auto-resume if interrupted by a signal
+            struct timeval* tmp;
+            struct timeval  tmo;
+
+            if ( timeout ) {
+                // NB: Timeout has already been normalized
+                tmo.tv_sec  = timeout->sec;
+                tmo.tv_usec = timeout->usec;
+                tmp = &tmo;
+            } else {
+                tmp = 0;
+            }
 
-        fd_set rfds;
-        fd_set wfds;
-        fd_set efds;
+            fd_set rfds;
+            fd_set wfds;
+            fd_set efds;
 
-        int max = -1;
-        bool rd = false;
-        bool wr = false;
+            int max = -1;
+            bool rd = false;
+            bool wr = false;
 
-        FD_ZERO(&efds);
+            FD_ZERO(&efds);
 
-        if ( (mask & CPipe::fStdIn)   &&  m_ChildStdIn  != -1 ) {
-            wr = true;
-            FD_ZERO(&wfds);
-            FD_SET(m_ChildStdIn,  &wfds);
-            FD_SET(m_ChildStdIn,  &efds);
-            if (max < m_ChildStdIn) {
-                max = m_ChildStdIn;
-            }
-        }
-        if ( (mask & CPipe::fStdOut)  &&  m_ChildStdOut != -1 ) {
-            if (!rd) {
-                rd = true;
-                FD_ZERO(&rfds);
+            if ( (mask & CPipe::fStdIn)   &&  m_ChildStdIn  != -1 ) {
+                wr = true;
+                FD_ZERO(&wfds);
+                if (m_ChildStdIn < FD_SETSIZE) {
+                    FD_SET(m_ChildStdIn,  &wfds);
+                    FD_SET(m_ChildStdIn,  &efds);
+                }
+                if (max < m_ChildStdIn) {
+                    max = m_ChildStdIn;
+                }
             }
-            FD_SET(m_ChildStdOut, &rfds);
-            FD_SET(m_ChildStdOut, &efds);
-            if (max < m_ChildStdOut) {
-                max = m_ChildStdOut;
+            if ( (mask & CPipe::fStdOut)  &&  m_ChildStdOut != -1 ) {
+                if (!rd) {
+                    rd = true;
+                    FD_ZERO(&rfds);
+                }
+                if (m_ChildStdOut < FD_SETSIZE) {
+                    FD_SET(m_ChildStdOut, &rfds);
+                    FD_SET(m_ChildStdOut, &efds);
+                }
+                if (max < m_ChildStdOut) {
+                    max = m_ChildStdOut;
+                }
             }
-        }
-        if ( (mask & CPipe::fStdErr)  &&  m_ChildStdErr != -1 ) {
-            if (!rd) {
-                rd = true;
-                FD_ZERO(&rfds);
+            if ( (mask & CPipe::fStdErr)  &&  m_ChildStdErr != -1 ) {
+                if (!rd) {
+                    rd = true;
+                    FD_ZERO(&rfds);
+                }
+                if (m_ChildStdErr < FD_SETSIZE) {
+                    FD_SET(m_ChildStdErr, &rfds);
+                    FD_SET(m_ChildStdErr, &efds);
+                }
+                if (max < m_ChildStdErr) {
+                    max = m_ChildStdErr;
+                }
             }
-            FD_SET(m_ChildStdErr, &rfds);
-            FD_SET(m_ChildStdErr, &efds);
-            if (max < m_ChildStdErr) {
-                max = m_ChildStdErr;
+            _ASSERT(rd  ||  wr);
+
+            if (max >= FD_SETSIZE) {
+                throw string("File descriptor is too large (FD_SETSIZE)");
             }
-        }
-        _ASSERT(rd  ||  wr);
 
-        int n = ::select(max + 1, rd ? &rfds : 0, wr ? &wfds : 0, &efds, tmp);
+            int n = ::select(max + 1,
+                             rd ? &rfds : 0,
+                             wr ? &wfds : 0, &efds, tmp);
 
-        if (n == 0) {
-            // timeout
-            break;
-        }
-        if (n > 0) {
-            if ( wr
-                 &&  ( FD_ISSET(m_ChildStdIn,  &wfds)  ||
-                       FD_ISSET(m_ChildStdIn,  &efds) ) ) {
-                poll |= CPipe::fStdIn;
+            if (n == 0) {
+                // timeout
+                break;
             }
-            if ( (mask & CPipe::fStdOut)  &&  m_ChildStdOut != -1
-                 &&  ( FD_ISSET(m_ChildStdOut, &rfds)  ||
-                       FD_ISSET(m_ChildStdOut, &efds) ) ) {
-                poll |= CPipe::fStdOut;
+            if (n > 0) {
+                if ( wr
+                     &&  ( FD_ISSET(m_ChildStdIn,  &wfds)  ||
+                           FD_ISSET(m_ChildStdIn,  &efds) ) ) {
+                    poll |= CPipe::fStdIn;
+                }
+                if ( (mask & CPipe::fStdOut)  &&  m_ChildStdOut != -1
+                     &&  ( FD_ISSET(m_ChildStdOut, &rfds)  ||
+                           FD_ISSET(m_ChildStdOut, &efds) ) ) {
+                    poll |= CPipe::fStdOut;
+                }
+                if ( (mask & CPipe::fStdErr)  &&  m_ChildStdErr != -1
+                     &&  ( FD_ISSET(m_ChildStdErr, &rfds)  ||
+                           FD_ISSET(m_ChildStdErr, &efds) ) ) {
+                    poll |= CPipe::fStdErr;
+                }
+                break;
             }
-            if ( (mask & CPipe::fStdErr)  &&  m_ChildStdErr != -1
-                 &&  ( FD_ISSET(m_ChildStdErr, &rfds)  ||
-                       FD_ISSET(m_ChildStdErr, &efds) ) ) {
-                poll |= CPipe::fStdErr;
+            if ((n = errno) != EINTR) {
+                PIPE_THROW(n, "Failed select()");
             }
-            break;
-        }
-        if ((n = errno) != EINTR) {
-            PIPE_THROW(n, "Failed select()");
+            // continue
         }
-        // continue
     }
 
     return poll;
diff --git a/c++/src/connect/ncbi_priv.c b/c++/src/connect/ncbi_priv.c
index 31349b0..a2f4511 100644
--- a/c++/src/connect/ncbi_priv.c
+++ b/c++/src/connect/ncbi_priv.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_priv.c 436799 2014-05-30 18:46:10Z lavr $
+/* $Id: ncbi_priv.c 488838 2016-01-06 13:45:11Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -44,12 +44,13 @@
 
 
 /* GLOBALS */
-int               g_NCBI_ConnectRandomSeed = 0;
-MT_LOCK           g_CORE_MT_Lock           = &g_CORE_MT_Lock_default;
-LOG               g_CORE_Log               = 0;
-REG               g_CORE_Registry          = 0;
-FNcbiGetAppName   g_CORE_GetAppName        = 0;
-FNcbiGetRequestID g_CORE_GetRequestID  = 0;
+int                     g_NCBI_ConnectRandomSeed = 0;
+MT_LOCK                 g_CORE_MT_Lock           = &g_CORE_MT_Lock_default;
+LOG                     g_CORE_Log               = 0;
+REG                     g_CORE_Registry          = 0;
+FNcbiGetAppName         g_CORE_GetAppName        = 0;
+FNcbiGetRequestID       g_CORE_GetRequestID      = 0;
+FNcbiGetRequestDtab     g_CORE_GetRequestDtab    = 0;
 
 
 extern int g_NCBI_ConnectSrandAddend(void)
diff --git a/c++/src/connect/ncbi_priv.h b/c++/src/connect/ncbi_priv.h
index 9c471d0..e043cf2 100644
--- a/c++/src/connect/ncbi_priv.h
+++ b/c++/src/connect/ncbi_priv.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_PRIV__H
 #define CONNECT___NCBI_PRIV__H
 
-/* $Id: ncbi_priv.h 456332 2015-01-09 18:46:30Z lavr $
+/* $Id: ncbi_priv.h 488838 2016-01-06 13:45:11Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -331,6 +331,13 @@ typedef char* (*FNcbiGetRequestID)(ENcbiRequestID);
 extern NCBI_XCONNECT_EXPORT FNcbiGetRequestID g_CORE_GetRequestID;
 
 
+/******************************************************************************
+ *  DTab-Local support (may return NULL; gets converted to "" at the user level)
+ */
+typedef const char* (*FNcbiGetRequestDtab)(void);
+extern NCBI_XCONNECT_EXPORT FNcbiGetRequestDtab g_CORE_GetRequestDtab;
+
+
 #ifdef __GNUC__
 #  define likely(x)    __builtin_expect(!!(x),1)
 #  define unlikely(x)  __builtin_expect(!!(x),0)
diff --git a/c++/src/connect/ncbi_sendmail.c b/c++/src/connect/ncbi_sendmail.c
index 4537088..91ce7cf 100644
--- a/c++/src/connect/ncbi_sendmail.c
+++ b/c++/src/connect/ncbi_sendmail.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_sendmail.c 453682 2014-12-05 15:49:55Z lavr $
+/* $Id: ncbi_sendmail.c 488581 2016-01-01 00:39:45Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -241,12 +241,14 @@ static void s_MakeFrom(char* buf, size_t size, const char* from,
             *buf++ = '@';
             if ((!SOCK_gethostbyaddr(0, buf, size)  ||  !strchr(buf, '.'))
                 &&  SOCK_gethostname(buf, size) != 0) {
-                const char* host = getenv("HOSTNAME");
-                if ((!host  &&  !(host = getenv("HOST")))
+                const char* host;
+                CORE_LOCK_READ;
+                if ((!(host = getenv("HOSTNAME")) && !(host = getenv("HOST")))
                     ||  (len = strlen(host)) >= size) {
                     *--buf = '\0';
                 } else
                     strcpy(buf, host);
+                CORE_UNLOCK;
             }
         } else
             *buf   = '\0';
diff --git a/c++/src/connect/ncbi_service.c b/c++/src/connect/ncbi_service.c
index 22fea61..5c92a23 100644
--- a/c++/src/connect/ncbi_service.c
+++ b/c++/src/connect/ncbi_service.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_service.c 440975 2014-07-18 16:15:14Z lavr $
+/* $Id: ncbi_service.c 488579 2016-01-01 00:38:12Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,6 +34,9 @@
 #include "ncbi_dispd.h"
 #include "ncbi_lbsmd.h"
 #include "ncbi_local.h"
+#ifdef NCBI_CXX_TOOLKIT
+#  include "ncbi_lbosp.h"
+#endif
 #include "ncbi_priv.h"
 #include <ctype.h>
 #include <stdlib.h>
@@ -68,7 +71,7 @@ ESwitch SERV_DoFastOpens(ESwitch on)
 }
 
 
-static char* s_ServiceName(const char* service,
+static char* x_ServiceName(const char* service,
                            int/*bool*/ ismask, unsigned int depth)
 {
     char   buf[128];
@@ -109,15 +112,25 @@ static char* s_ServiceName(const char* service,
             s = srv;
         }
         if (*s  &&  strcasecmp(s, service) != 0)
-            return s_ServiceName(s, ismask, depth + 1);
+            return x_ServiceName(s, ismask, depth + 1);
     }
     return strdup(service);
 }
 
 
+static char* s_ServiceName(const char* service, int/*bool*/ ismask)
+{
+    char* retval;
+    CORE_LOCK_READ;
+    retval = x_ServiceName(service, ismask, 0);
+    CORE_UNLOCK;
+    return retval;
+}
+
+
 char* SERV_ServiceName(const char* service)
 {
-    return s_ServiceName(service, 0, 0);
+    return s_ServiceName(service, 0);
 }
 
 
@@ -170,7 +183,7 @@ static int/*bool*/ s_IsMapperConfigured(const char* service, const char* key)
 }
 
 
-static SERV_ITER s_Open(const char*         service,
+static SERV_ITER x_Open(const char*         service,
                         unsigned/*bool*/    ismask,
                         TSERV_Type          types,
                         unsigned int        preferred_host,
@@ -185,12 +198,17 @@ static SERV_ITER s_Open(const char*         service,
                         SSERV_Info**        info,
                         HOST_INFO*          host_info)
 {
-    int/*bool*/ do_lbsmd = -1/*unassigned*/, do_dispd = -1/*unassigned*/;
+    int/*bool*/
+        do_lbsmd = -1/*unassigned*/,
+#ifdef NCBI_CXX_TOOLKIT
+        do_lbos  = -1/*unassigned*/,
+#endif /*NCBI_CXX_TOOLKIT*/
+        do_dispd = -1/*unassigned*/;
     const SSERV_VTable* op;
     SERV_ITER iter;
     const char* s;
 
-    if (!(s = s_ServiceName(service, ismask, 0)))
+    if (!(s = s_ServiceName(service, ismask)))
         return 0;
     if (!(iter = (SERV_ITER) calloc(1, sizeof(*iter)))) {
         free((void*) s);
@@ -213,6 +231,8 @@ static SERV_ITER s_Open(const char*         service,
         iter->ismask        = 1;
     if (types & fSERV_IncludeDown)
         iter->ok_down       = 1;
+    if (types & fSERV_IncludeReserved)
+        iter->ok_reserved   = 1;
     if (types & fSERV_IncludeSuppressed)
         iter->ok_suppressed = 1;
     if (types & fSERV_ReverseDns)
@@ -252,6 +272,7 @@ static SERV_ITER s_Open(const char*         service,
         }
     }
     assert(n_skip == iter->n_skip);
+    iter->o_skip = iter->n_skip;
 
     if (net_info) {
         if (net_info->firewall)
@@ -264,15 +285,35 @@ static SERV_ITER s_Open(const char*         service,
         do_dispd = 0/*false*/;
     /* Ugly optimization not to access the registry more than necessary */
     if ((!s_IsMapperConfigured(service, REG_CONN_LOCAL_ENABLE)               ||
-         !(op = SERV_LOCAL_Open(iter, info, host_info)))                 &&
+         !(op = SERV_LOCAL_Open(iter, info, host_info)))
+
+        &&
         (!do_lbsmd                                                           ||
-         !(do_lbsmd= !s_IsMapperConfigured(service, REG_CONN_LBSMD_DISABLE)) ||
+         !(do_lbsmd = !s_IsMapperConfigured
+           (service, REG_CONN_LBSMD_DISABLE))                                ||
          !(op = SERV_LBSMD_Open(iter, info, host_info,
-                                !do_dispd                                    ||
-                                !(do_dispd = !s_IsMapperConfigured
-                                  (service, REG_CONN_DISPD_DISABLE)))))  &&
+                                (!do_dispd                                   ||
+                                 !(do_dispd = !s_IsMapperConfigured
+                                   (service, REG_CONN_DISPD_DISABLE)))
+#ifdef NCBI_CXX_TOOLKIT
+                                &&
+                                !(do_lbos = s_IsMapperConfigured
+                                  (service, REG_CONN_LBOS_ENABLE))
+#endif /*NCBI_CXX_TOOLKIT*/
+                                )))
+
+#ifdef NCBI_CXX_TOOLKIT
+        &&
+        (!do_lbos                                                            ||
+         (do_lbos < 0  &&  !(do_lbos = s_IsMapperConfigured
+                             (service, REG_CONN_LBOS_ENABLE)))               ||
+         !(op = SERV_LBOS_Open(iter, net_info, info)))
+#endif /*NCBI_CXX_TOOLKIT*/
+
+        && 
         (!do_dispd                                                           ||
-         !(do_dispd= !s_IsMapperConfigured(service, REG_CONN_DISPD_DISABLE)) ||
+         (do_dispd < 0  &&  !(do_dispd = !s_IsMapperConfigured
+                              (service, REG_CONN_DISPD_DISABLE)))            ||
          !(op = SERV_DISPD_Open(iter, net_info, info, host_info)))) {
         if (!do_lbsmd  &&  !do_dispd) {
             CORE_LOGF_X(1, eLOG_Error,
@@ -288,64 +329,6 @@ static SERV_ITER s_Open(const char*         service,
 }
 
 
-extern SERV_ITER SERV_OpenSimple(const char* service)
-{
-    SConnNetInfo* net_info = ConnNetInfo_Create(service);
-    SERV_ITER iter = SERV_Open(service, fSERV_Any, SERV_ANYHOST, net_info);
-    ConnNetInfo_Destroy(net_info);
-    return iter;
-}
-
-
-extern SERV_ITER SERV_Open(const char*         service,
-                           TSERV_Type          types,
-                           unsigned int        preferred_host,
-                           const SConnNetInfo* net_info)
-{
-    return s_Open(service, 0/*not mask*/, types,
-                  preferred_host, 0/*preferred_port*/, 0.0/*preference*/,
-                  net_info, 0/*skip*/, 0/*n_skip*/,
-                  0/*not external*/, 0/*arg*/, 0/*val*/,
-                  0/*info*/, 0/*host_info*/);
-}
-
-
-extern SERV_ITER SERV_OpenEx(const char*         service,
-                             TSERV_Type          types,
-                             unsigned int        preferred_host,
-                             const SConnNetInfo* net_info,
-                             SSERV_InfoCPtr      skip[],
-                             size_t              n_skip)
-{
-    return s_Open(service, 0/*not mask*/, types,
-                  preferred_host, 0/*preferred_port*/, 0.0/*preference*/,
-                  net_info, skip, n_skip,
-                  0/*not external*/, 0/*arg*/, 0/*val*/,
-                  0/*info*/, 0/*host_info*/);
-}
-
-
-SERV_ITER SERV_OpenP(const char*         service,
-                     TSERV_Type          types,
-                     unsigned int        preferred_host,
-                     unsigned short      preferred_port,
-                     double              preference,
-                     const SConnNetInfo* net_info,
-                     SSERV_InfoCPtr      skip[],
-                     size_t              n_skip,
-                     int/*bool*/         external,
-                     const char*         arg,
-                     const char*         val)
-{
-    return s_Open(service,
-                  service  &&  (!*service  ||  strpbrk(service, "?*")), types,
-                  preferred_host, preferred_port, preference,
-                  net_info, skip, n_skip,
-                  external, arg, val,
-                  0/*info*/, 0/*host_info*/);
-}
-
-
 static void s_SkipSkip(SERV_ITER iter)
 {
     size_t n;
@@ -407,46 +390,117 @@ static SSERV_Info* s_GetNextInfo(SERV_ITER   iter,
 }
 
 
-static SSERV_Info* s_GetInfo(const char*         service,
-                             TSERV_Type          types,
-                             unsigned int        preferred_host,
-                             unsigned short      preferred_port,
-                             double              preference,
-                             const SConnNetInfo* net_info,
-                             SSERV_InfoCPtr      skip[],
-                             size_t              n_skip,
-                             int /*bool*/        external,
-                             const char*         arg,
-                             const char*         val,
-                             HOST_INFO*          host_info)
+static SERV_ITER s_Open(const char*         service,
+                        unsigned/*bool*/    ismask,
+                        TSERV_Type          types,
+                        unsigned int        preferred_host,
+                        unsigned short      preferred_port,
+                        double              preference,
+                        const SConnNetInfo* net_info,
+                        SSERV_InfoCPtr      skip[],
+                        size_t              n_skip,
+                        int /*bool*/        external,
+                        const char*         arg,
+                        const char*         val,
+                        SSERV_Info**        info,
+                        HOST_INFO*          host_info)
 {
-    SSERV_Info* info;
-    SERV_ITER iter = s_Open(service, 0/*not mask*/, types,
+    SSERV_Info* x_info;
+    SERV_ITER iter = x_Open(service, ismask, types,
                             preferred_host, preferred_port, preference,
                             net_info, skip, n_skip,
                             external, arg, val,
-                            &info, host_info);
+                            &x_info, host_info);
     assert(!iter  ||  iter->op);
     if (!iter)
-        info = 0;
-    else if (!info) /* all LOCAL/DISPD searches here, but no LBSMD ones */
-        info = s_GetNextInfo(iter, host_info, 1/*internal*/);
-    else if (info == (SSERV_Info*)(-1L))
-        info = 0;
-    SERV_Close(iter);
-    return info;
+        x_info = 0;
+    else if (!x_info)
+        x_info = info ? s_GetNextInfo(iter, host_info, 1/*internal*/) : 0;
+    else if (x_info == (SSERV_Info*)(-1L)) {
+        SERV_Close(iter);
+        x_info = 0;
+        iter = 0;
+    }
+    if (info)
+        *info = x_info;
+    else if (x_info)
+        free(x_info);
+    return iter;
+}
+
+
+extern SERV_ITER SERV_OpenSimple(const char* service)
+{
+    SConnNetInfo* net_info = ConnNetInfo_Create(service);
+    SERV_ITER iter = s_Open(service, 0/*not mask*/, fSERV_Any,
+                            SERV_ANYHOST,
+                            0/*preferred_port*/, 0.0/*preference*/,
+                            net_info, 0/*skip*/, 0/*n_skip*/,
+                            0/*not external*/, 0/*arg*/, 0/*val*/,
+                            0/*info*/, 0/*host_info*/);
+    ConnNetInfo_Destroy(net_info);
+    return iter;
+}
+
+
+extern SERV_ITER SERV_Open(const char*         service,
+                           TSERV_Type          types,
+                           unsigned int        preferred_host,
+                           const SConnNetInfo* net_info)
+{
+    return s_Open(service, 0/*not mask*/, types,
+                  preferred_host, 0/*preferred_port*/, 0.0/*preference*/,
+                  net_info, 0/*skip*/, 0/*n_skip*/,
+                  0/*not external*/, 0/*arg*/, 0/*val*/,
+                  0/*info*/, 0/*host_info*/);
+}
+
+
+extern SERV_ITER SERV_OpenEx(const char*         service,
+                             TSERV_Type          types,
+                             unsigned int        preferred_host,
+                             const SConnNetInfo* net_info,
+                             SSERV_InfoCPtr      skip[],
+                             size_t              n_skip)
+{
+    return s_Open(service, 0/*not mask*/, types,
+                  preferred_host, 0/*preferred_port*/, 0.0/*preference*/,
+                  net_info, skip, n_skip,
+                  0/*not external*/, 0/*arg*/, 0/*val*/,
+                  0/*info*/, 0/*host_info*/);
+}
+
+
+SERV_ITER SERV_OpenP(const char*         service,
+                     TSERV_Type          types,
+                     unsigned int        preferred_host,
+                     unsigned short      preferred_port,
+                     double              preference,
+                     const SConnNetInfo* net_info,
+                     SSERV_InfoCPtr      skip[],
+                     size_t              n_skip,
+                     int/*bool*/         external,
+                     const char*         arg,
+                     const char*         val)
+{
+    return s_Open(service,
+                  service  &&  (!*service  ||  strpbrk(service, "?*")), types,
+                  preferred_host, preferred_port, preference,
+                  net_info, skip, n_skip,
+                  external, arg, val,
+                  0/*info*/, 0/*host_info*/);
 }
 
 
 extern SSERV_Info* SERV_GetInfoSimple(const char* service)
 {
     SConnNetInfo* net_info = ConnNetInfo_Create(service);
-    SSERV_Info* info = s_GetInfo(service, fSERV_Any,
-                                 SERV_ANYHOST/*preferred_host*/,
-                                 0/*preferred_port*/, 0.0/*preference*/,
-                                 net_info, 0/*skip*/, 0/*n_skip*/,
-                                 0/*not external*/, 0/*arg*/, 0/*val*/,
-                                 0/*host_info*/);
+    SSERV_Info* info = SERV_GetInfoP(service, fSERV_Any,
+                                     SERV_ANYHOST/*preferred_host*/,
+                                     0/*preferred_port*/, 0.0/*preference*/,
+                                     net_info, 0/*skip*/, 0/*n_skip*/,
+                                     0/*not external*/, 0/*arg*/, 0/*val*/,
+                                     0/*host_info*/);
     ConnNetInfo_Destroy(net_info);
     return info;
 }
@@ -457,11 +511,12 @@ extern SSERV_Info* SERV_GetInfo(const char*         service,
                                 unsigned int        preferred_host,
                                 const SConnNetInfo* net_info)
 {
-    return s_GetInfo(service, types,
-                     preferred_host, 0/*preferred_port*/, 0.0/*preference*/,
-                     net_info, 0/*skip*/, 0/*n_skip*/,
-                     0/*not external*/, 0/*arg*/, 0/*val*/,
-                     0/*host_info*/);
+    return SERV_GetInfoP(service, types,
+                         preferred_host,
+                         0/*preferred_port*/, 0.0/*preference*/,
+                         net_info, 0/*skip*/, 0/*n_skip*/,
+                         0/*not external*/, 0/*arg*/, 0/*val*/,
+                         0/*host_info*/);
 }
 
 
@@ -473,11 +528,12 @@ extern SSERV_Info* SERV_GetInfoEx(const char*         service,
                                   size_t              n_skip,
                                   HOST_INFO*          host_info)
 {
-    return s_GetInfo(service, types,
-                     preferred_host, 0/*preferred_port*/, 0.0/*preference*/,
-                     net_info, skip, n_skip,
-                     0/*not external*/, 0/*arg*/, 0/*val*/,
-                     host_info);
+    return SERV_GetInfoP(service, types,
+                         preferred_host,
+                         0/*preferred_port*/, 0.0/*preference*/,
+                         net_info, skip, n_skip,
+                         0/*not external*/, 0/*arg*/, 0/*val*/,
+                         host_info);
 }
 
 
@@ -489,16 +545,20 @@ SSERV_Info* SERV_GetInfoP(const char*         service,
                           const SConnNetInfo* net_info,
                           SSERV_InfoCPtr      skip[],
                           size_t              n_skip,
-                          int/*bool*/         external, 
+                          int/*bool*/         external,
                           const char*         arg,
                           const char*         val,
                           HOST_INFO*          host_info)
 {
-    return s_GetInfo(service, types,
-                     preferred_host, preferred_port, preference,
-                     net_info, skip, n_skip,
-                     external, arg, val,
-                     host_info);
+    SSERV_Info* info;
+    SERV_ITER iter = s_Open(service, 0/*not mask*/, types,
+                            preferred_host, preferred_port, preference,
+                            net_info, skip, n_skip,
+                            external, arg, val,
+                            &info, host_info);
+    assert(!info  ||  iter);
+    SERV_Close(iter);
+    return info;
 }
 
 
@@ -780,7 +840,7 @@ char* SERV_Print(SERV_ITER iter, SConnNetInfo* net_info, int/*bool*/ but_last)
                 buflen = sizeof(kUsedServerInfo) - 1;
                 memcpy(buffer, kUsedServerInfo, buflen);
             } else
-                buflen = sprintf(buffer, kSkipInfo, (unsigned) i + 1); 
+                buflen = sprintf(buffer, kSkipInfo, (unsigned) i + 1);
             assert(buflen < sizeof(buffer) - 1);
             if (!BUF_Write(&buf, buffer, buflen)                ||
                 (namelen  &&  !BUF_Write(&buf, name, namelen))  ||
@@ -825,11 +885,11 @@ extern unsigned short SERV_ServerPort(const char*  name,
      */
     if (!host  ||  host == SERV_LOCALHOST)
         host = SOCK_GetLocalHostAddress(eDefault);
-    if (!(info = s_GetInfo(name, fSERV_Standalone | fSERV_Promiscuous,
-                           host, 0/*pref. port*/, -1.0/*latch host*/,
-                           0/*net_info*/, 0/*skip*/, 0/*n_skip*/,
-                           0/*not external*/, 0/*arg*/, 0/*val*/,
-                           0/*host_info*/))) {
+    if (!(info = SERV_GetInfoP(name, fSERV_Standalone | fSERV_Promiscuous,
+                               host, 0/*pref. port*/, -1.0/*latch host*/,
+                               0/*net_info*/, 0/*skip*/, 0/*n_skip*/,
+                               0/*not external*/, 0/*arg*/, 0/*val*/,
+                               0/*host_info*/))) {
         return 0;
     }
     assert(info->host == host);
diff --git a/c++/src/connect/ncbi_servicep.h b/c++/src/connect/ncbi_servicep.h
index fc90567..028187a 100644
--- a/c++/src/connect/ncbi_servicep.h
+++ b/c++/src/connect/ncbi_servicep.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_SERVICEP__H
 #define CONNECT___NCBI_SERVICEP__H
 
-/* $Id: ncbi_servicep.h 453850 2014-12-08 19:00:36Z lavr $
+/* $Id: ncbi_servicep.h 482179 2015-10-21 15:02:35Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -160,6 +160,7 @@ extern NCBI_XCONNECT_EXPORT SSERV_Info* SERV_GetInfoP
  HOST_INFO*           hinfo          /* host information to return on match  */
  );
 
+
 /* Same as the above but creates an iterator to get the servers one by one.
  * CAUTION:  Special requirement for "skip" infos in case of a wildcard
  * service is that they _must_ be created having a name (perhaps, empty "")
diff --git a/c++/src/connect/ncbi_socket.c b/c++/src/connect/ncbi_socket.c
index 0d835fc..a792801 100644
--- a/c++/src/connect/ncbi_socket.c
+++ b/c++/src/connect/ncbi_socket.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_socket.c 466159 2015-04-29 14:48:08Z lavr $
+/* $Id: ncbi_socket.c 495662 2016-03-18 22:10:31Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1040,6 +1040,14 @@ static unsigned int s_gethostbyname_(const char* hostname, ESwitch log)
 
     CORE_TRACEF(("[SOCK::gethostbyname]  \"%s\"", hostname));
 
+#ifdef NCBI_OS_DARWIN
+    if (strspn(hostname, ".0123456789") == strlen(hostname)
+        &&  !SOCK_isip(hostname)) {
+        host = 0;
+        goto out;
+    }
+#endif /*NCBI_OS_DARWIN*/
+
     if ((host = inet_addr(hostname)) == htonl(INADDR_NONE)) {
         int error;
 #if defined(HAVE_GETADDRINFO)  &&  !defined(__GLIBC__)
@@ -1139,6 +1147,9 @@ static unsigned int s_gethostbyname_(const char* hostname, ESwitch log)
 #endif /*HAVE_GETADDRINFO && !__GLIBC__*/
     }
 
+#ifdef NCBI_OS_DARWIN
+out:
+#endif
 #if defined(_DEBUG)  &&  !defined(NDEBUG)
     if (!SOCK_isipEx(hostname, 1)  ||  !host) {
         char addr[40];
@@ -2611,7 +2622,7 @@ static EIO_Status s_IsConnected_(SOCK                  sock,
                 const unsigned int wtv_set = sock->w_tv_set;
                 struct timeval rtv;
                 struct timeval wtv;
-                char* desc = 0;
+                char* desc;
                 if (rtv_set)
                     rtv = sock->r_tv;
                 if (wtv_set)
@@ -2631,9 +2642,9 @@ static EIO_Status s_IsConnected_(SOCK                  sock,
                                   ("%sSSL session established%s%s",
                                    s_ID(sock, _id),
                                    &" "[!desc], desc ? desc : ""));
-                        if (desc)
-                            free(desc);
                     }
+                    if (desc)
+                        free(desc);
                 } else
                     *what = "SSL hello";
             } else
@@ -3636,21 +3647,23 @@ static EIO_Status s_Shutdown(SOCK                  sock,
     case eIO_Open:
     case eIO_Close:
         if (sock->w_status != eIO_Closed) {
-            if ((status = s_WritePending(sock, tv, 0, 0)) != eIO_Success
-                &&  !sock->pending   &&  sock->w_len) {
-                CORE_LOGF_X(13, !tv  ||  (tv->tv_sec | tv->tv_usec)
-                            ? eLOG_Warning : eLOG_Trace,
-                            ("%s[SOCK::%s] "
-                             " %s with output (%lu byte%s) still pending (%s)",
-                             s_ID(sock, _id),
-                             dir & eIO_ReadWrite ? "Shutdown" : "Close",
-                             !dir ? "Leaving " : dir == eIO_Close ? "Closing" :
-                             dir == eIO_Write
-                             ? "Shutting down for write"
-                             : "Shutting down for read/write",
-                             (unsigned long) sock->w_len,
-                             &"s"[sock->w_len == 1],
-                             IO_StatusStr(status)));
+            if ((status = s_WritePending(sock, tv, 0, 0)) != eIO_Success) {
+                if (!sock->pending   &&  sock->w_len) {
+                    CORE_LOGF_X(13, !tv  ||  (tv->tv_sec | tv->tv_usec)
+                                ? eLOG_Warning : eLOG_Trace,
+                                ("%s[SOCK::%s] "
+                                 " %s with output (%lu byte%s) still pending"
+                                 " (%s)", s_ID(sock, _id),
+                                 dir & eIO_ReadWrite ? "Shutdown" : "Close",
+                                 !dir ? "Leaving " : dir == eIO_Close
+                                 ?      "Closing"  : dir == eIO_Write
+                                 ?      "Shutting down for write"
+                                 :      "Shutting down for read/write",
+                                 (unsigned long) sock->w_len,
+                                 &"s"[sock->w_len == 1],
+                                 IO_StatusStr(status)));
+                } else if (!(dir & eIO_ReadWrite))
+                    status = eIO_Success;
             }
             if (sock->session  &&  !sock->pending) {
                 FSSLClose sslclose = s_SSL ? s_SSL->Close : 0;
@@ -7960,6 +7973,8 @@ extern int/*bool*/ SOCK_isipEx(const char* str, int/*bool*/ fullquad)
 
 extern int/*bool*/ SOCK_IsLoopbackAddress(unsigned int ip)
 {
+    if (ip == htonl(INADDR_LOOPBACK)) 
+        return 1/*true*/;
     /* 127/8 */
     if (ip) {
         unsigned int addr = ntohl(ip);
@@ -8184,12 +8199,31 @@ extern size_t SOCK_HostPortToString(unsigned int   host,
 
 extern void SOCK_SetupSSL(FSSLSetup setup)
 {
-    s_SSLSetup = setup;
+    CORE_LOCK_WRITE;
+
+    if (!setup) {
+        s_SSLSetup = 0;
+        if (s_SSL) {
+            FSSLExit sslexit = s_SSL->Exit;
+            s_SSL = 0;
+            if (sslexit)
+                sslexit();
+        }
+    } else if (s_SSLSetup != setup) {
+        if (!s_SSLSetup)
+            s_SSLSetup = setup;
+        else if (s_Initialized < 0)
+            s_SSLSetup = 0;
+        else
+            CORE_LOG(eLOG_Critical, "Cannot reset SSL while it is in use");
+    }
+
+    CORE_UNLOCK;
 }
 
 
 extern EIO_Status SOCK_SetupSSLEx(FSSLSetup setup)
 {
     SOCK_SetupSSL(setup);
-    return s_InitAPI(1/*secure*/);
+    return setup ? s_InitAPI(1/*secure*/) : eIO_Success;
 }
diff --git a/c++/src/connect/ncbi_socketp.h b/c++/src/connect/ncbi_socketp.h
index 03b582f..17d88d4 100644
--- a/c++/src/connect/ncbi_socketp.h
+++ b/c++/src/connect/ncbi_socketp.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_SOCKETP__H
 #define CONNECT___NCBI_SOCKETP__H
 
-/* $Id: ncbi_socketp.h 451558 2014-11-07 15:40:44Z lavr $
+/* $Id: ncbi_socketp.h 488580 2016-01-01 00:39:21Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -48,6 +48,7 @@
  */
 
 #ifdef NCBI_OS_MSWIN
+#  define  _WINSOCK_DEPRECATED_NO_WARNINGS  1
 #  include <winsock2.h>
 #else /*NCBI_OS_UNIX*/
 #  include <sys/socket.h>
@@ -277,7 +278,7 @@ typedef struct SOCK_tag {
     WSAEVENT         event;     /* event bound to I/O                        */
 #endif /*!NCBI_OS_MSWIN*/
 
-    void*            session;   /* secure session id if secure, else 0       */
+    void*            session;   /* secure session handle if used, else 0     */
     NCBI_CRED        cred;      /* secure session credentials, 0 if none     */
 
     /* timeouts */
@@ -323,7 +324,7 @@ typedef struct SOCK_tag {
  *    that has to be sent upon connection establishment.
  *
  * 2. eof is used differently for stream and datagram sockets:
- *    =1 for stream sockets means that read has hit EOF;
+ *    =1 for stream sockets means that last read has hit EOF;
  *    =1 for datagram sockets means that message in w_buf has been completed.
  *
  * 3. r_status keeps completion code of the last low-level read call;
diff --git a/c++/src/connect/ncbi_strerror.c b/c++/src/connect/ncbi_strerror.c
index c163a17..ca71e70 100644
--- a/c++/src/connect/ncbi_strerror.c
+++ b/c++/src/connect/ncbi_strerror.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_strerror.c 426749 2014-02-12 19:57:17Z lavr $
+/* $Id: ncbi_strerror.c 487456 2015-12-17 18:55:21Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -35,9 +35,11 @@
 
 #  ifdef _FREETDS_LIBRARY_SOURCE
 
-#    define s_StrError                s_StrErrorInternal
-#    define UTIL_TcharToUtf8          UTIL_TcharToUtf8_ftds64
-#    define UTIL_ReleaseBufferOnHeap  UTIL_ReleaseBufferOnHeap_ftds64
+#    include "../impl/ncbi_ftds_ver.h"
+#    define s_StrError        s_StrErrorInternal
+#    define UTIL_TcharToUtf8  NCBI_FTDS_VERSION_NAME(UTIL_TcharToUtf8_ftds)
+#    define UTIL_ReleaseBufferOnHeap  \
+                      NCBI_FTDS_VERSION_NAME(UTIL_ReleaseBufferOnHeap_ftds)
 
 #  endif /*_FREETDS_LIBRARY_SOURCE*/
 
diff --git a/c++/src/connect/ncbi_util.c b/c++/src/connect/ncbi_util.c
index 5f796dc..0dbe8fa 100644
--- a/c++/src/connect/ncbi_util.c
+++ b/c++/src/connect/ncbi_util.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_util.c 456255 2015-01-08 20:52:17Z lavr $
+/* $Id: ncbi_util.c 488579 2016-01-01 00:38:12Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -642,32 +642,36 @@ extern const char* CORE_GetAppName(void)
 extern char* CORE_GetNcbiRequestID(ENcbiRequestID reqid)
 {
     char* id;
+
     CORE_LOCK_READ;
     if (g_CORE_GetRequestID) {
         id = g_CORE_GetRequestID(reqid);
-        CORE_UNLOCK;
         assert(!id  ||  *id);
         if (id)
-            return id;
-    } else
-        CORE_UNLOCK;
+            goto out;
+    }
     switch (reqid) {
     case eNcbiRequestID_SID:
         id = getenv("HTTP_NCBI_SID");
         if (id  &&  *id)
-            return strdup(id);
+            break;
         id = getenv("NCBI_LOG_SESSION_ID");
         break;
     case eNcbiRequestID_HitID:
         id = getenv("HTTP_NCBI_PHID");
         if (id  &&  *id)
-            return strdup(id);
+            break;
         id = getenv("NCBI_LOG_HIT_ID");
         break;
     default:
-        return 0;
+        id = 0;
+        goto out;
     }
-    return id  &&  *id ? strdup(id) : 0;
+    id = id  &&  *id ? strdup(id) : 0;
+ out:
+    CORE_UNLOCK;
+
+    return id;
 }
 
 
@@ -765,8 +769,12 @@ extern const char* CORE_GetUsernameEx(char* buf, size_t bufsize,
         UTIL_ReleaseBuffer(login);
         return buf;
     }
-    if ((login = getenv("USERNAME")) != 0)
-        return x_Savestr(login, buf, bufsize);
+    CORE_LOCK_READ;
+    if ((login = getenv("USERNAME")) != 0) {
+        buf = x_Savestr(login, buf, bufsize);
+        CORE_UNLOCK;
+        return buf;
+    }
 #  endif /*NCBI_OS_MSWIN*/
 
 #else
@@ -855,9 +863,12 @@ extern const char* CORE_GetUsernameEx(char* buf, size_t bufsize,
 #endif /*!NCBI_OS_UNIX*/
 
     /* last resort */
+    CORE_LOCK_READ;
     if (!(login = getenv("USER"))  &&  !(login = getenv("LOGNAME")))
         login = "";
-    return x_Savestr(login, buf, bufsize);
+    buf = x_Savestr(login, buf, bufsize);
+    CORE_UNLOCK;
+    return buf;
 }
 
 
@@ -1216,7 +1227,7 @@ extern char* UTIL_NcbiLocalHostName(char* hostname)
 
     if (len) {
         size_t i;
-        for (i = 0;  i < sizeof(kEndings) / sizeof(kEndings[0]);  i++) {
+        for (i = 0;  i < sizeof(kEndings) / sizeof(kEndings[0]);  ++i) {
             assert(strlen(kEndings[i].text) == kEndings[i].len);
             if (len > kEndings[i].len) {
                 size_t prefix = len - kEndings[i].len;
diff --git a/c++/src/connect/ncbi_version.h b/c++/src/connect/ncbi_version.h
index ec20c5e..28b4023 100644
--- a/c++/src/connect/ncbi_version.h
+++ b/c++/src/connect/ncbi_version.h
@@ -1,7 +1,7 @@
 #ifndef CONNECT___NCBI_VERSION__H
 #define CONNECT___NCBI_VERSION__H
 
-/* $Id: ncbi_version.h 460431 2015-02-26 20:52:10Z lavr $
+/* $Id: ncbi_version.h 482179 2015-10-21 15:02:35Z lavr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -53,7 +53,7 @@
 
 #  define   NETDAEMONS_MAJOR        2
 #  define   NETDAEMONS_MINOR        2
-#  define   NETDAEMONS_PATCH        3
+#  define   NETDAEMONS_PATCH        5
 
 #  ifdef NCBI_CXX_TOOLKIT
 #    define NETDAEMONS_VERSION_STR  NCBI_PACKAGE_VERSION_COMPOSE_STR    \
diff --git a/c++/src/connect/server_monitor.cpp b/c++/src/connect/server_monitor.cpp
index c070ae5..b9f4146 100644
--- a/c++/src/connect/server_monitor.cpp
+++ b/c++/src/connect/server_monitor.cpp
@@ -1,4 +1,4 @@
-/* $Id: server_monitor.cpp 143267 2008-10-16 18:16:07Z lavr $
+/* $Id: server_monitor.cpp 475146 2015-08-05 15:18:50Z vakatov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -95,4 +95,21 @@ void CServer_Monitor::SendString(const string& str)
     SendMessage(str.data(), str.length());
 }
 
+
+bool CServer_Monitor::IsActive()
+{
+    return IsMonitorActive();
+}
+
+void CServer_Monitor::Send(const char* msg, size_t length)
+{
+    SendMessage(msg, length);
+}
+
+void CServer_Monitor::Send(const string& str)
+{
+    SendString(str);
+}
+
+
 END_NCBI_SCOPE
diff --git a/c++/src/connect/services/Makefile.in b/c++/src/connect/services/Makefile.in
index e6b6abb..a4605b4 100644
--- a/c++/src/connect/services/Makefile.in
+++ b/c++/src/connect/services/Makefile.in
@@ -1,5 +1,5 @@
 #################################
-# $Id: Makefile.in 77950 2006-02-27 14:50:21Z didenko $
+# $Id: Makefile.in 482144 2015-10-20 23:04:27Z sadyrovr $
 # Author:  Denis Vakatov (vakatov at ncbi.nlm.nih.gov)
 #################################
 
diff --git a/c++/src/connect/services/Makefile.ncbi_xcache_netcache.lib b/c++/src/connect/services/Makefile.ncbi_xcache_netcache.lib
index e406a91..b259ae0 100644
--- a/c++/src/connect/services/Makefile.ncbi_xcache_netcache.lib
+++ b/c++/src/connect/services/Makefile.ncbi_xcache_netcache.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.ncbi_xcache_netcache.lib 466155 2015-04-29 14:36:10Z sadyrovr $
+# $Id: Makefile.ncbi_xcache_netcache.lib 482143 2015-10-20 22:59:23Z sadyrovr $
 #
 
 SRC = neticache_client
diff --git a/c++/src/connect/services/Makefile.xconnserv.lib b/c++/src/connect/services/Makefile.xconnserv.lib
index 17dcad7..b53185b 100644
--- a/c++/src/connect/services/Makefile.xconnserv.lib
+++ b/c++/src/connect/services/Makefile.xconnserv.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.xconnserv.lib 466155 2015-04-29 14:36:10Z sadyrovr $
+# $Id: Makefile.xconnserv.lib 485672 2015-11-24 20:44:56Z sadyrovr $
 
 SRC     = grid_worker ns_client_factory grid_worker_app \
           grid_client grid_client_app \
@@ -8,15 +8,15 @@ SRC     = grid_worker ns_client_factory grid_worker_app \
           srv_connections netservice_api \
           balancing netservice_params \
           netschedule_api netschedule_api_submitter netschedule_api_executor \
-          netschedule_api_reader netschedule_api_admin \
+          netschedule_api_reader netschedule_api_admin netschedule_api_getjob \
           netschedule_key netschedule_api_expt \
           netcache_key netcache_rw netcache_params netcache_api \
           netcache_api_admin \
           netservice_protocol_parser util clparser \
-          json_over_uttp netstorage_rpc \
+          json_over_uttp netstorage netstorage_rpc \
           netstorageobjectloc netstorageobjectinfo netstorage_direct_nc \
           pack_int ns_output_parser \
-          ns_job_serializer compound_id compound_id_v0
+          ns_job_serializer compound_id compound_id_v0 tmp_wn_info
 
 LIB     = xconnserv
 PROJ_TAG = core
diff --git a/c++/src/connect/services/clparser.cpp b/c++/src/connect/services/clparser.cpp
index 2dbd344..5dad2e3 100644
--- a/c++/src/connect/services/clparser.cpp
+++ b/c++/src/connect/services/clparser.cpp
@@ -1,4 +1,4 @@
-/*  $Id: clparser.cpp 475261 2015-08-05 19:52:42Z vasilche $
+/*  $Id: clparser.cpp 485043 2015-11-18 14:43:31Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -55,7 +55,8 @@ struct SOptionOrCommandInfo : public CObject
 {
     SOptionOrCommandInfo(int id, const string& name_variants) : m_Id(id)
     {
-        NStr::Split(name_variants, "|", m_NameVariants);
+        NStr::Split(name_variants, "|", m_NameVariants,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     }
 
     const string& GetPrimaryName() const {return m_NameVariants.front();}
diff --git a/c++/src/connect/services/compound_id.cpp b/c++/src/connect/services/compound_id.cpp
index ad85ce4..1d24133 100644
--- a/c++/src/connect/services/compound_id.cpp
+++ b/c++/src/connect/services/compound_id.cpp
@@ -1,4 +1,4 @@
-/*  $Id: compound_id.cpp 458444 2015-02-04 23:20:49Z kazimird $
+/*  $Id: compound_id.cpp 489731 2016-01-15 15:57:28Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -72,8 +72,8 @@ BEGIN_NCBI_SCOPE
 
 static const char* s_ClassNames[eCIC_NumberOfClasses] = {
     /* eCIC_GenericID             */  CIC_GENERICID_CLASS_NAME,
-    /* eCIC_NetCacheKey           */  CIC_NETCACHEBLOBKEY_CLASS_NAME,
-    /* eCIC_NetScheduleKey        */  CIC_NETSCHEDULEJOBKEY_CLASS_NAME,
+    /* eCIC_NetCacheBlobKey       */  CIC_NETCACHEBLOBKEY_CLASS_NAME,
+    /* eCIC_NetScheduleJobKey     */  CIC_NETSCHEDULEJOBKEY_CLASS_NAME,
     /* eCIC_NetStorageObjectLocV1 */  CIC_NETSTORAGEOBJECTLOC_CLASS_NAME_V1,
     /* eCIC_NetStorageObjectLoc   */  CIC_NETSTORAGEOBJECTLOC_CLASS_NAME
 };
@@ -389,7 +389,7 @@ string CCompoundID::Dump()
     CNcbiOstrstream sstr;
     s_DumpCompoundID(sstr, m_Impl, 0, "    ");
     sstr << '\n' << NcbiEnds;
-    return sstr.str();
+    return CNcbiOstrstreamToString(sstr);
 }
 
 CCompoundIDPool::CCompoundIDPool() : m_Impl(new SCompoundIDPoolImpl)
diff --git a/c++/src/connect/services/grid_client.cpp b/c++/src/connect/services/grid_client.cpp
index c65e067..4c9f4b3 100644
--- a/c++/src/connect/services/grid_client.cpp
+++ b/c++/src/connect/services/grid_client.cpp
@@ -1,4 +1,4 @@
-/*  $Id: grid_client.cpp 475261 2015-08-05 19:52:42Z vasilche $
+/*  $Id: grid_client.cpp 492603 2016-02-18 19:27:56Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,6 +32,7 @@
 #include <ncbi_pch.hpp>
 
 #include "netschedule_api_impl.hpp"
+#include "netcache_api_impl.hpp"
 
 #include <connect/services/grid_rw_impl.hpp>
 #include <connect/services/grid_client.hpp>
@@ -97,8 +98,23 @@ size_t CGridClient::GetMaxServerInputSize()
 
 //////////////////////////////////////////////////////////////////////////////
 //
+void CGridClient::UseNextSubHitID()
+{
+    CDiagContext::GetRequestContext().GetNextSubHitID();
+    m_NetCacheAPI->m_UseNextSubHitID.DoNot();
+    m_NetScheduleSubmitter->m_UseNextSubHitID.DoNot();
+}
+
+void CGridClient::SetJobInput(const string& input)
+{
+    UseNextSubHitID();
+    m_Job.input = input;
+}
+
 CNcbiOstream& CGridClient::GetOStream()
 {
+    UseNextSubHitID();
+
     m_Writer.reset(new CStringOrBlobStorageWriter(
         GetMaxServerInputSize(),
         GetNetCacheAPI(),
@@ -132,6 +148,7 @@ string CGridClient::Submit(const string& affinity)
     if (!affinity.empty() && m_Job.affinity.empty())
         m_Job.affinity = affinity;
     string job_key = GetNetScheduleSubmitter().SubmitJob(m_Job);
+    x_RenewAllJobBlobs(m_NetScheduleSubmitter->m_API->m_JobTtl);
     m_Job.Reset();
     return job_key;
 }
@@ -139,11 +156,20 @@ string CGridClient::Submit(const string& affinity)
 CNetScheduleAPI::EJobStatus CGridClient::SubmitAndWait(unsigned wait_time)
 {
     CloseStream();
+    time_t job_exptime = 0;
     CNetScheduleAPI::EJobStatus status =
-            GetNetScheduleSubmitter().SubmitJobAndWait(m_Job, wait_time);
-    x_CleanUpAllJobBlobs(status);
-    m_JobDetailsRead = true;
-    return status;
+        m_NetScheduleSubmitter->SubmitJobAndWait(m_Job, wait_time, &job_exptime);
+
+    return x_CheckAllJobBlobs(status, job_exptime);
+}
+
+CNetScheduleAPI::EJobStatus CGridClient::WaitForJob(const string& job_key,
+        unsigned wait_time)
+{
+    CNetScheduleAPI::EJobStatus status =
+        m_NetScheduleSubmitter.WaitForJob(job_key, wait_time);
+
+    return x_CheckAllJobBlobs(status, m_NetScheduleSubmitter->m_API->m_JobTtl);
 }
 
 //////////////////////////////////////////////////////////
@@ -212,6 +238,7 @@ void CGridJobBatchSubmitter::PrepareNextJob()
     if (!m_Jobs.empty())
         ++m_JobIndex;
     m_Jobs.push_back(CNetScheduleJob());
+    m_GridClient.GetNetCacheAPI()->m_UseNextSubHitID.DoNot();
 }
 
 void CGridJobBatchSubmitter::Submit(const string& job_group)
@@ -239,6 +266,7 @@ void CGridJobBatchSubmitter::Reset()
     m_HasBeenSubmitted = false;
     m_JobIndex = 0;
     m_Jobs.clear();
+    m_GridClient.UseNextSubHitID();
 }
 
 CGridJobBatchSubmitter::CGridJobBatchSubmitter(CGridClient& grid_client)
@@ -247,10 +275,13 @@ CGridJobBatchSubmitter::CGridJobBatchSubmitter(CGridClient& grid_client)
 {
 }
 
+static unsigned s_TimeToTtl(time_t time);
+
 //////////////////////////////////////////////////////////////////////////////
 //
 
-bool CGridClient::x_CleanUpAllJobBlobs(CNetScheduleAPI::EJobStatus status)
+CNetScheduleAPI::EJobStatus CGridClient::x_CheckAllJobBlobs(
+        CNetScheduleAPI::EJobStatus status, time_t job_exptime)
 {
     if (m_AutoCleanUp && (
               status == CNetScheduleAPI::eDone ||
@@ -267,11 +298,12 @@ bool CGridClient::x_CleanUpAllJobBlobs(CNetScheduleAPI::EJobStatus status)
                     RemoveDataBlob(m_Job.progress_msg.c_str() + 2);
             }
         }
-
-        return true;
+    } else {
+        x_RenewAllJobBlobs(s_TimeToTtl(job_exptime));
     }
 
-    return false;
+    m_JobDetailsRead = true;
+    return status;
 }
 CNetScheduleAPI::EJobStatus CGridClient::GetStatus()
 {
@@ -280,11 +312,7 @@ CNetScheduleAPI::EJobStatus CGridClient::GetStatus()
     CNetScheduleAPI::EJobStatus status =
         GetNetScheduleSubmitter().GetJobDetails(m_Job, &job_exptime);
 
-    if (!x_CleanUpAllJobBlobs(status)) {
-        x_RenewAllJobBlobs(job_exptime);
-    }
-    m_JobDetailsRead = true;
-    return status;
+    return x_CheckAllJobBlobs(status, job_exptime);
 }
 
 CNcbiIstream& CGridClient::GetIStream()
@@ -359,12 +387,14 @@ bool CGridClient::x_ProlongJobFieldLifetime(
     return true;
 }
 
-void CGridClient::x_RenewAllJobBlobs(time_t job_exptime)
+static unsigned s_TimeToTtl(time_t exptime)
 {
     time_t current_time = time(NULL);
-    unsigned ttl = 0;
-    if (job_exptime > current_time)
-        ttl = unsigned(job_exptime - current_time + 1);
+    return exptime > current_time ? unsigned(exptime - current_time + 1) : 0;
+}
+
+void CGridClient::x_RenewAllJobBlobs(unsigned ttl)
+{
     x_ProlongJobFieldLifetime(m_Job.input, ttl);
     x_ProlongJobFieldLifetime(m_Job.output, ttl);
     if (!m_Job.progress_msg.empty() &&
@@ -381,7 +411,7 @@ void CGridClient::x_GetJobDetails()
         return;
     time_t job_exptime = 0;
     GetNetScheduleSubmitter().GetJobDetails(m_Job, &job_exptime);
-    x_RenewAllJobBlobs(job_exptime);
+    x_RenewAllJobBlobs(s_TimeToTtl(job_exptime));
     m_JobDetailsRead = true;
 }
 
diff --git a/c++/src/connect/services/grid_control_thread.cpp b/c++/src/connect/services/grid_control_thread.cpp
index ac27e6d..b88b68c 100644
--- a/c++/src/connect/services/grid_control_thread.cpp
+++ b/c++/src/connect/services/grid_control_thread.cpp
@@ -1,4 +1,4 @@
-/*  $Id: grid_control_thread.cpp 451104 2014-11-03 19:33:10Z grichenk $
+/*  $Id: grid_control_thread.cpp 491697 2016-02-08 18:44:39Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -60,10 +60,13 @@ public:
                          CNcbiOstream& os,
                          CWorkerNodeControlServer* control_server)
     {
-        os << "OK:version=" << NStr::URLEncode(
-                control_server->GetWorkerNode().GetAppVersion()) <<
-                "&build_date=" << NStr::URLEncode(
-                control_server->GetWorkerNode().GetBuildDate()) << "\n";
+        const CVersion& version(control_server->GetWorkerNode().GetAppVersion());
+        const CVersionInfo& version_info(version.GetVersionInfo());
+        const SBuildInfo& build_info(version.GetBuildInfo());
+
+        os << "OK:version=" << NStr::URLEncode(version_info.Print()) <<
+                "&build_date=" << NStr::URLEncode(build_info.date) <<
+                "&build_tag=" << NStr::URLEncode(build_info.tag) << "\n";
     }
 };
 
@@ -164,10 +167,14 @@ public:
                          CWorkerNodeControlServer* control_server)
     {
         CGridWorkerNode node(control_server->GetWorkerNode());
+        const CVersion& version(control_server->GetWorkerNode().GetAppVersion());
+        const CVersionInfo& version_info(version.GetVersionInfo());
+        const SBuildInfo& build_info(version.GetBuildInfo());
 
         os << "OK:Application: " << node.GetAppName() <<
-                "\nVersion: " << node.GetAppVersion() <<
-                "\nBuild date: " << node.GetBuildDate() << "\n";
+                "\nVersion: " << version_info.Print() <<
+                "\nBuild date: " << build_info.date <<
+                "\nBuild tag: " << build_info.tag << "\n";
 
         {{
             CMutexGuard guard(CNcbiApplication::GetInstanceMutex());
@@ -181,8 +188,9 @@ public:
 
         os << "Host name: " << CSocketAPI::gethostname() <<
                 "\nControl port: " << control_server->GetControlPort() <<
+                "\nUser name: " << GetDiagContext().GetUsername() <<
                 "\nNetCache client name: " << node.GetNetCacheAPI().
-                        GetService().GetServerPool().GetClientName() <<
+                        GetService()->GetClientName() <<
                 "\nNetSchedule client name: " << node->GetClientName() <<
                 "\nQueue name: " << node->GetQueueName() <<
                 "\nNode ID: " << ns_api->m_ClientNode <<
diff --git a/c++/src/connect/services/grid_rw_impl.cpp b/c++/src/connect/services/grid_rw_impl.cpp
index 1cc68a9..9e36e9a 100644
--- a/c++/src/connect/services/grid_rw_impl.cpp
+++ b/c++/src/connect/services/grid_rw_impl.cpp
@@ -1,4 +1,4 @@
-/*  $Id: grid_rw_impl.cpp 304778 2011-06-16 16:14:34Z kazimird $
+/*  $Id: grid_rw_impl.cpp 489744 2016-01-15 16:50:24Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -106,29 +106,58 @@ void CStringOrBlobStorageWriter::Abort()
 ////////////////////////////////////////////////////////////////////////////
 //
 
+CStringOrBlobStorageReader::EType CStringOrBlobStorageReader::x_GetDataType(
+        string& data)
+{
+    if (NStr::CompareCase(data, 0, JOB_OUTPUT_PREFIX_LEN,
+                s_JobOutputPrefixNetCache) == 0) {
+        data.erase(0, JOB_OUTPUT_PREFIX_LEN);
+        return eNetCache;
+    }
+
+    if (NStr::CompareCase(data, 0, JOB_OUTPUT_PREFIX_LEN,
+                s_JobOutputPrefixEmbedded) == 0) {
+        data.erase(0, JOB_OUTPUT_PREFIX_LEN);
+        return eEmbedded;
+    }
+
+    return data.empty() ? eEmpty : eRaw;
+}
+
 CStringOrBlobStorageReader::CStringOrBlobStorageReader(const string& data_or_key,
         SNetCacheAPIImpl* storage, size_t* data_size) :
     m_Storage(storage), m_Data(data_or_key)
 {
-    if (NStr::CompareCase(data_or_key, 0, JOB_OUTPUT_PREFIX_LEN,
-            s_JobOutputPrefixNetCache) == 0) {
-        m_NetCacheReader.reset(m_Storage.GetReader(
-            data_or_key.data() + JOB_OUTPUT_PREFIX_LEN, data_size));
-    } else if (NStr::CompareCase(data_or_key, 0,
-            JOB_OUTPUT_PREFIX_LEN, s_JobOutputPrefixEmbedded) == 0) {
-        m_BytesToRead = data_or_key.size() - JOB_OUTPUT_PREFIX_LEN;
+    switch (x_GetDataType(m_Data)) {
+    case eNetCache:
+        // If NetCache API is not provided, initialize it using info from key
+        if (!m_Storage) {
+            CNetCacheKey key(m_Data);
+            string service(key.GetServiceName());
+
+            if (service.empty()) {
+                service = key.GetHost() + ":" + NStr::UIntToString(key.GetPort());
+            }
+
+            m_Storage = CNetCacheAPI(service, kEmptyStr);
+            m_Storage.GetService().GetServerPool().StickToServer(
+                    key.GetHost(), key.GetPort());
+        }
+
+        m_NetCacheReader.reset(m_Storage.GetReader(m_Data, data_size));
+        return;
+
+    case eEmbedded:
+    case eEmpty:
+        m_BytesToRead = m_Data.size();
         if (data_size != NULL)
             *data_size = m_BytesToRead;
-    } else if (data_or_key.empty()) {
-        m_BytesToRead = 0;
-        if (data_size != NULL)
-            *data_size = 0;
-    } else {
+        return;
+
+    default:
         NCBI_THROW_FMT(CStringOrBlobStorageRWException, eInvalidFlag,
-            "Unknown data type \"" <<
-                string(data_or_key.begin(), data_or_key.begin() +
-                    (data_or_key.size() < JOB_OUTPUT_PREFIX_LEN ?
-                    data_or_key.size() : JOB_OUTPUT_PREFIX_LEN)) << '"');
+                "Unknown data type \"" <<
+                m_Data.substr(0, JOB_OUTPUT_PREFIX_LEN) << '"');
     }
 }
 
diff --git a/c++/src/connect/services/grid_worker.cpp b/c++/src/connect/services/grid_worker.cpp
index 234a434..647107e 100644
--- a/c++/src/connect/services/grid_worker.cpp
+++ b/c++/src/connect/services/grid_worker.cpp
@@ -1,4 +1,4 @@
-/*  $Id: grid_worker.cpp 467434 2015-05-13 16:41:39Z sadyrovr $
+/*  $Id: grid_worker.cpp 499332 2016-04-25 17:42:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -404,7 +404,7 @@ void SGridWorkerNodeImpl::x_WNCoreInit()
     const IRegistry& reg = m_App.GetConfig();
 
     if (!m_SingleThreadForced) {
-        string max_threads = reg.GetString(kServerSec, "max_threads", "auto");
+        string max_threads = reg.GetString(kServerSec, "max_threads", "8");
         if (NStr::CompareNocase(max_threads, "auto") == 0)
             m_MaxThreads = GetCpuCount();
         else {
@@ -515,8 +515,10 @@ int SGridWorkerNodeImpl::Run(
 
     const string kServerSec("server");
 
+    const SBuildInfo& build_info(m_App.GetFullVersion().GetBuildInfo());
+
     LOG_POST_X(50, Info << m_JobProcessorFactory->GetJobVersion() <<
-            " build " WN_BUILD_DATE);
+            " build " << build_info.date << " tag " << build_info.tag);
 
     const IRegistry& reg = m_App.GetConfig();
 
@@ -532,7 +534,8 @@ int SGridWorkerNodeImpl::Run(
         CTempString from_port, to_port;
 
         NStr::SplitInTwo(control_port_arg, "- ",
-                from_port, to_port, NStr::eMergeDelims);
+                from_port, to_port,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
         start_port = NStr::StringToUInt(from_port);
         end_port = to_port.empty() ? start_port : NStr::StringToUInt(to_port);
@@ -545,8 +548,8 @@ int SGridWorkerNodeImpl::Run(
 
     vector<string> vhosts;
 
-    NStr::Tokenize(reg.GetString(kServerSec,
-        "master_nodes", kEmptyStr), " ;,", vhosts);
+    NStr::Split(reg.GetString(kServerSec,
+        "master_nodes", kEmptyStr), " ;,", vhosts, NStr::fSplit_NoMergeDelims);
 
     ITERATE(vector<string>, it, vhosts) {
         string host, port;
@@ -558,8 +561,8 @@ int SGridWorkerNodeImpl::Run(
 
     vhosts.clear();
 
-    NStr::Tokenize(reg.GetString(kServerSec,
-        "admin_hosts", kEmptyStr), " ;,", vhosts);
+    NStr::Split(reg.GetString(kServerSec,
+        "admin_hosts", kEmptyStr), " ;,", vhosts, NStr::fSplit_NoMergeDelims);
 
     ITERATE(vector<string>, it, vhosts) {
         unsigned int ha = CSocketAPI::gethostbyname(*it);
@@ -649,29 +652,16 @@ int SGridWorkerNodeImpl::Run(
         return 3;
     }
 
-    string control_port_str(
-            NStr::NumericToString(control_thread->GetControlPort()));
-    LOG_POST_X(60, "Control port: " << control_port_str);
-    m_NetScheduleAPI.SetAuthParam("control_port", control_port_str);
-    m_NetScheduleAPI.SetAuthParam("client_host", CSocketAPI::gethostname());
-
-    if (m_NetScheduleAPI->m_ClientNode.empty()) {
-        string client_node(m_NetScheduleAPI->
-                m_Service->m_ServerPool->m_ClientName);
-        client_node.append(2, ':');
-        client_node.append(CSocketAPI::gethostname());
-        client_node.append(1, ':');
-        client_node.append(NStr::NumericToString(
-            control_thread->GetControlPort()));
-        m_NetScheduleAPI.SetClientNode(client_node);
-
-        string session(NStr::NumericToString(CProcess::GetCurrentPid()) + '@');
-        session += NStr::NumericToString(GetFastLocalTime().GetTimeT());
-        session += ':';
-        session += GetDiagContext().GetStringUID();
-
-        m_NetScheduleAPI.SetClientSession(session);
-    }
+    const string& client(GetClientName());
+    const string& host(CSocketAPI::gethostname());
+    const string& port(NStr::NumericToString(control_thread->GetControlPort()));
+    LOG_POST_X(60, "Control port: " << port);
+    m_NetScheduleAPI->SetAuthParam("control_port", port);
+    m_NetScheduleAPI->SetAuthParam("client_host", host);
+
+    // This overrides default client node format (omits user name),
+    // so deployed worker nodes could be determined by GRID Dashboard.
+    m_NetScheduleAPI.SetClientNode(client + "::" + host + ':' + port);
 
     m_NetScheduleAPI.SetProgramVersion(m_JobProcessorFactory->GetJobVersion());
 
@@ -728,7 +718,7 @@ int SGridWorkerNodeImpl::Run(
         fprintf(procinfo_file, "pid: %lu\nport: %s\n"
                 "client_node: %s\nclient_session: %s\n",
                 (unsigned long) CDiagContext::GetPID(),
-                control_port_str.c_str(),
+                port.c_str(),
                 m_NetScheduleAPI->m_ClientNode.c_str(),
                 m_NetScheduleAPI->m_ClientSession.c_str());
         fclose(procinfo_file);
@@ -801,7 +791,8 @@ int SGridWorkerNodeImpl::Run(
     LOG_POST_X(54, Info << "\n=================== NEW RUN : " <<
         CGridGlobals::GetInstance().GetStartTime().AsString() <<
             " ===================\n" <<
-        m_JobProcessorFactory->GetJobVersion() << " build " WN_BUILD_DATE <<
+        m_JobProcessorFactory->GetJobVersion() << " build " <<
+        build_info.date << " tag " << build_info.tag <<
         " is started.\n"
         "Waiting for control commands on " << CSocketAPI::gethostname() <<
             ":" << control_thread->GetControlPort() << "\n"
@@ -1092,16 +1083,9 @@ string CGridWorkerNode::GetAppName() const
     return m_Impl->m_JobProcessorFactory->GetAppName();
 }
 
-string CGridWorkerNode::GetAppVersion() const
-{
-    CFastMutexGuard guard(m_Impl->m_JobProcessorMutex);
-    return m_Impl->m_JobProcessorFactory->GetAppVersion();
-}
-
-string CGridWorkerNode::GetBuildDate() const
+const CVersion& CGridWorkerNode::GetAppVersion() const
 {
-    CFastMutexGuard guard(m_Impl->m_JobProcessorMutex);
-    return m_Impl->m_JobProcessorFactory->GetAppBuildDate();
+    return m_Impl->m_App.GetFullVersion();
 }
 
 CNetCacheAPI CGridWorkerNode::GetNetCacheAPI() const
diff --git a/c++/src/connect/services/grid_worker_app.cpp b/c++/src/connect/services/grid_worker_app.cpp
index 6e660e8..75c18f2 100644
--- a/c++/src/connect/services/grid_worker_app.cpp
+++ b/c++/src/connect/services/grid_worker_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: grid_worker_app.cpp 469237 2015-06-02 18:26:13Z sadyrovr $
+/*  $Id: grid_worker_app.cpp 491697 2016-02-08 18:44:39Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -100,17 +100,20 @@ void CGridWorkerApp::Construct(IWorkerNodeJobFactory* job_factory)
 #endif
 }
 
-CGridWorkerApp::CGridWorkerApp(IWorkerNodeJobFactory* job_factory)
+CGridWorkerApp::CGridWorkerApp(IWorkerNodeJobFactory* job_factory,
+                               const SBuildInfo& build_info) :
+    CNcbiApplication(build_info)
 {
     Construct(job_factory);
 }
 
 CGridWorkerApp::CGridWorkerApp(IWorkerNodeJobFactory* job_factory,
-                               const CVersionInfo& version_info)
+                               const CVersionInfo& version_info,
+                               const SBuildInfo& build_info)
 {
     Construct(job_factory);
 
-    SetVersion(version_info);
+    SetVersion(version_info, build_info);
 }
 
 void CGridWorkerApp::Init(void)
diff --git a/c++/src/connect/services/grid_worker_impl.hpp b/c++/src/connect/services/grid_worker_impl.hpp
index e950dee..76fb181 100644
--- a/c++/src/connect/services/grid_worker_impl.hpp
+++ b/c++/src/connect/services/grid_worker_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES__GRID_WORKER_IMPL__HPP
 #define CONNECT_SERVICES__GRID_WORKER_IMPL__HPP
 
-/*  $Id: grid_worker_impl.hpp 467683 2015-05-15 15:04:08Z sadyrovr $
+/*  $Id: grid_worker_impl.hpp 488742 2016-01-05 15:56:22Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -44,7 +44,7 @@ BEGIN_NCBI_SCOPE
 //
 
 ///@internal
-struct SWorkerNodeJobContextImpl : public CWorkerNodeTimelineEntry
+struct SWorkerNodeJobContextImpl : public CObject
 {
     SWorkerNodeJobContextImpl(SGridWorkerNodeImpl* worker_node);
 
@@ -59,11 +59,14 @@ struct SWorkerNodeJobContextImpl : public CWorkerNodeTimelineEntry
     void x_PrintRequestStop();
 
     virtual void PutProgressMessage(const string& msg,
-        bool send_immediately = false);
+        bool send_immediately, bool overwrite);
     virtual CNetScheduleAdmin::EShutdownLevel GetShutdownLevel();
     virtual void JobDelayExpiration(unsigned runtime_inc);
     virtual void x_RunJob();
 
+    const CDeadline GetTimeout() const { return m_Deadline; }
+    void ResetTimeout(unsigned seconds) { m_Deadline = CDeadline(seconds, 0); }
+
     SGridWorkerNodeImpl* m_WorkerNode;
     CNetScheduleJob m_Job;
     CWorkerNodeJobContext::ECommitStatus m_JobCommitStatus;
@@ -88,6 +91,9 @@ struct SWorkerNodeJobContextImpl : public CWorkerNodeTimelineEntry
 
     CDeadline m_CommitExpiration;
     bool      m_FirstCommitAttempt;
+
+private:
+    CDeadline m_Deadline;
 };
 
 class CJobRunRegistration;
@@ -169,7 +175,7 @@ struct SGridWorkerNodeImpl : public CObject
     }
     const string& GetClientName() const
     {
-        return m_NetScheduleAPI->m_Service->m_ServerPool->m_ClientName;
+        return m_NetScheduleAPI->m_Service->GetClientName();
     }
     const string& GetServiceName() const
     {
@@ -311,7 +317,8 @@ class CMainLoopThread : public CThread
 public:
     CMainLoopThread(SGridWorkerNodeImpl* worker_node) :
         m_WorkerNode(worker_node),
-        m_Semaphore(0, 1),
+        m_Impl(worker_node),
+        m_Timeline(m_Impl),
         m_ThreadName(worker_node->GetAppName() + "_mn")
     {
     }
@@ -319,17 +326,44 @@ public:
     virtual void* Main();
 
 private:
-    SGridWorkerNodeImpl* m_WorkerNode;
-    CSemaphore m_Semaphore;
-    const string m_ThreadName;
-    CServerTimeline m_Timeline;
+    class CImpl : public CNetScheduleGetJob
+    {
+    public:
+        CImpl(SGridWorkerNodeImpl* worker_node) :
+            m_API(worker_node->m_NetScheduleAPI),
+            m_Timeout(worker_node->m_NSTimeout),
+            m_WorkerNode(worker_node)
+        {
+        }
+
+        void Main();
+
+        EState CheckState();
+        CNetServer ReadNotifications();
+        CNetServer WaitForNotifications(const CDeadline& deadline);
+        bool MoreJobs(const SEntry& entry);
+        bool CheckEntry(
+                SEntry& entry,
+                const string& prio_aff_list,
+                CNetScheduleJob& job,
+                CNetScheduleAPI::EJobStatus* job_status);
+        void ReturnJob(CNetScheduleJob& job);
+
+        CNetScheduleAPI m_API;
+        const unsigned m_Timeout;
+
+    private:
+        SGridWorkerNodeImpl* m_WorkerNode;
+
+        CNetServer x_ProcessRequestJobNotification();
+    };
 
-    bool x_PerformTimelineAction(CServerTimeline::TEntryRef timeline_entry,
-            CNetScheduleJob& job);
-    bool x_EnterSuspendedState();
-    void x_ProcessRequestJobNotification();
-    bool x_WaitForNewJob(CNetScheduleJob& job);
     bool x_GetNextJob(CNetScheduleJob& job);
+
+    SGridWorkerNodeImpl* m_WorkerNode;
+    CImpl m_Impl;
+    CNetScheduleGetJobImpl<CImpl> m_Timeline;
+    const string m_ThreadName;
 };
 
 END_NCBI_SCOPE
diff --git a/c++/src/connect/services/json_over_uttp.cpp b/c++/src/connect/services/json_over_uttp.cpp
index 8177717..36c7526 100644
--- a/c++/src/connect/services/json_over_uttp.cpp
+++ b/c++/src/connect/services/json_over_uttp.cpp
@@ -1,4 +1,4 @@
-/*  $Id: json_over_uttp.cpp 457651 2015-01-26 20:28:49Z kazimird $
+/*  $Id: json_over_uttp.cpp 495785 2016-03-21 16:50:59Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -779,7 +779,7 @@ CJsonNode CJsonNode::GetByKeyOrNull(const string& key) const
     return const_cast<SJsonNodeImpl*>(it->m_Node.GetPointerOrNull());
 }
 
-const string& CJsonNode::AsString() const
+const string CJsonNode::AsString() const
 {
     m_Impl->VerifyType("AsString()", eString);
 
diff --git a/c++/src/connect/services/netcache_api.cpp b/c++/src/connect/services/netcache_api.cpp
index 5afeffe..4666016 100644
--- a/c++/src/connect/services/netcache_api.cpp
+++ b/c++/src/connect/services/netcache_api.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netcache_api.cpp 477824 2015-09-02 12:20:47Z ivanov $
+/*  $Id: netcache_api.cpp 497256 2016-04-05 15:59:16Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -88,7 +88,7 @@ CRef<INetServerProperties> CNetCacheServerListener::AllocServerProperties()
 }
 
 CConfig* CNetCacheServerListener::OnPreInit(CObject* api_impl,
-        CConfig* config, string* config_section)
+        CConfig* config, string* config_section, string& client_name)
 {
     SNetCacheAPIImpl* nc_impl = static_cast<SNetCacheAPIImpl*>(api_impl);
 
@@ -98,22 +98,13 @@ CConfig* CNetCacheServerListener::OnPreInit(CObject* api_impl,
 
     if (CNetScheduleAPI api = nc_impl->m_NetScheduleAPI) {
         // Use client name from NetSchedule if it's not provided for NetCache
-        if (m_ClientName.empty()) {
-            m_ClientName = api.GetExecutor().GetClientName();
+        if (client_name.empty()) {
+            client_name = api.GetExecutor().GetClientName();
         }
 
-        // If we are not forced to load config from NetSchedule
-        // and have either config or service name, then nothing to do here
-        if (!CNetScheduleConfigLoader::Use(config, *config_section) &&
-                (config || !nc_impl->m_Service->m_ServiceName.empty())) {
-            return NULL;
-        }
-
-        const CTempString kLiterals[] = {
-            "nc.",      "netcache_conf_from_netschedule",
-            "nc::",     "netcache_conf_from_netschedule_GETP2"
-        };
-        return CNetScheduleConfigLoader::Get(kLiterals, api, config_section);
+        CNetScheduleConfigLoader loader(
+                "nc.",  "netcache_conf_from_netschedule");
+        return loader.Get(api, config, *config_section);
     }
 
     return NULL;
@@ -126,7 +117,7 @@ void CNetCacheServerListener::OnInit(CObject* api_impl,
 
     m_Auth = nc_impl->m_Service->MakeAuthString();
 
-    if (nc_impl->m_Service->m_ServerPool->m_ClientName.length() < 3) {
+    if (nc_impl->m_Service->GetClientName().length() < 3) {
         NCBI_THROW(CNetCacheException,
             eAuthenticationError, "Client name is too short or empty");
     }
@@ -164,6 +155,25 @@ void CNetCacheServerListener::OnInit(CObject* api_impl,
         if (config->GetBool(config_section,
                 "use_compound_id", CConfig::eErr_NoThrow, false))
             nc_impl->m_DefaultParameters.SetUseCompoundID(true);
+
+        const auto allowed_services = config->GetString(config_section,
+                "allowed_services", CConfig::eErr_NoThrow, kEmptyStr);
+
+        if (!allowed_services.empty()) {
+            nc_impl->m_ServiceMap.Restrict();
+
+            vector<string> services;
+            NStr::Split(allowed_services, ", ", services,
+                    NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
+
+            for (auto& service : services) {
+                // Do not add configured service, it is always allowed
+                if (NStr::CompareNocase(service,
+                            nc_impl->m_Service.GetServiceName())) {
+                    nc_impl->m_ServiceMap.AddToAllowed(service);
+                }
+            }
+        }
     } else {
         nc_impl->m_TempDir = default_temp_dir;
         nc_impl->m_CacheInput = false;
@@ -201,32 +211,29 @@ void CNetCacheServerListener::OnConnected(CNetServerConnection& connection)
 
 void CNetCacheServerListener::OnError(const string& err_msg, CNetServer& server)
 {
-    string message = server->m_ServerInPool->m_Address.AsString();
-
-    message += ": ";
-    message += err_msg;
-
     static const char s_BlobNotFoundMsg[] = "BLOB not found";
     if (NStr::strncmp(err_msg.c_str(), s_BlobNotFoundMsg,
             sizeof(s_BlobNotFoundMsg) - 1) == 0) {
         if (strstr(err_msg.c_str(), "AGE=") != NULL) {
-            NCBI_THROW(CNetCacheBlobTooOldException, eBlobTooOld, message);
+            CONNSERV_THROW_FMT(CNetCacheBlobTooOldException, eBlobTooOld,
+                    server, err_msg);
         } else {
-            NCBI_THROW(CNetCacheException, eBlobNotFound, message);
+            CONNSERV_THROW_FMT(CNetCacheException, eBlobNotFound,
+                    server, err_msg);
         }
     }
 
     static const char s_AccessDenied[] = "Access denied";
     if (NStr::strncmp(err_msg.c_str(), s_AccessDenied,
         sizeof(s_AccessDenied) - 1) == 0)
-        NCBI_THROW(CNetCacheException, eAccessDenied, message);
+        CONNSERV_THROW_FMT(CNetCacheException, eAccessDenied, server, err_msg);
 
     static const char s_UnknownCommandMsg[] = "Unknown command";
     if (NStr::strncmp(err_msg.c_str(), s_UnknownCommandMsg,
         sizeof(s_UnknownCommandMsg) - 1) == 0)
-        NCBI_THROW(CNetCacheException, eUnknownCommand, message);
+        CONNSERV_THROW_FMT(CNetCacheException, eUnknownCommand, server, err_msg);
 
-    NCBI_THROW(CNetCacheException, eServerError, message);
+    CONNSERV_THROW_FMT(CNetCacheException, eServerError, server, err_msg);
 }
 
 void CNetCacheServerListener::OnWarning(const string& warn_msg,
@@ -270,6 +277,13 @@ SNetCacheAPIImpl::SNetCacheAPIImpl(CConfig* config, const string& section,
     m_Service->Init(this, service, config, section, s_NetCacheConfigSections);
 }
 
+SNetCacheAPIImpl::SNetCacheAPIImpl(const string& api_name,
+        const string& client_name, INetServerConnectionListener* listener) :
+    m_Service(new SNetServiceImpl(api_name, client_name, listener)),
+    m_DefaultParameters(eVoid)
+{
+}
+
 SNetCacheAPIImpl::SNetCacheAPIImpl(SNetServerInPool* server,
         SNetCacheAPIImpl* parent) :
     m_Service(new SNetServiceImpl(server, parent->m_Service)),
@@ -282,9 +296,8 @@ SNetCacheAPIImpl::SNetCacheAPIImpl(SNetServerInPool* server,
 {
 }
 
-void SNetCacheAPIImpl::AppendClientIPSessionID(string* cmd)
+void s_AppendClientIPSessionID(string* cmd, const CRequestContext& req)
 {
-    CRequestContext& req = CDiagContext::GetRequestContext();
     cmd->append(" ip=\"");
     cmd->append(req.GetClientIP());
     cmd->append("\" sid=\"");
@@ -292,10 +305,16 @@ void SNetCacheAPIImpl::AppendClientIPSessionID(string* cmd)
     cmd->append(1, '\"');
 }
 
+void SNetCacheAPIImpl::AppendClientIPSessionID(string* cmd)
+{
+    s_AppendClientIPSessionID(cmd, CDiagContext::GetRequestContext());
+}
+
 void SNetCacheAPIImpl::AppendClientIPSessionIDPasswordAgeHitID(string* cmd,
         const CNetCacheAPIParameters* parameters)
 {
-    AppendClientIPSessionID(cmd);
+    CRequestContext& req = CDiagContext::GetRequestContext();
+    s_AppendClientIPSessionID(cmd, req);
 
     string password(parameters->GetPassword());
     if (!password.empty()) {
@@ -311,7 +330,8 @@ void SNetCacheAPIImpl::AppendClientIPSessionIDPasswordAgeHitID(string* cmd,
     }
 
     cmd->append(" ncbi_phid=\"");
-    cmd->append(CDiagContext::GetRequestContext().GetNextSubHitID());
+    cmd->append(m_UseNextSubHitID ?
+            req.GetNextSubHitID() : req.GetCurrentSubHitID());
     cmd->append(1, '\"');
 }
 
@@ -329,7 +349,8 @@ unsigned SNetCacheAPIImpl::x_ExtractBlobAge(
     string::size_type pos = exec_result.response.find("AGE=");
 
     if (pos == string::npos) {
-        NCBI_THROW_FMT(CNetCacheException, eInvalidServerResponse,
+        CONNSERV_THROW_FMT(CNetCacheException, eInvalidServerResponse,
+                exec_result.conn->m_Server,
                        "No AGE field in " << cmd_name <<
                        " output: \"" << exec_result.response << "\"");
     }
@@ -371,8 +392,16 @@ CNetServer::SExecResult SNetCacheAPIImpl::ExecMirrorAware(
 
     CNetService service(m_Service);
 
-    if (service_name_is_defined && service_name != service.GetServiceName())
+    if (service_name_is_defined && service_name != service.GetServiceName()) {
+        // NB: Configured service is always allowed
+
+        if (!m_ServiceMap.IsAllowed(service_name)) {
+            NCBI_THROW_FMT(CNetCacheException, eAccessDenied, "Service " <<
+                    service_name << " is not in the allowed services");
+        }
+
         service = m_ServiceMap.GetServiceByName(service_name, m_Service);
+    }
 
     bool key_is_mirrored = service_name_is_defined &&
             !key.GetFlag(CNetCacheKey::fNCKey_SingleServer) &&
@@ -445,12 +474,26 @@ CNetServer::SExecResult SNetCacheAPIImpl::ExecMirrorAware(
         return exec_result;
     }
 
-    if (service_name_is_defined && server_check != eOff &&
-            !service->IsInService(primary_server)) {
-        NCBI_THROW_FMT(CNetSrvConnException, eServerNotInService,
-                key.GetKey() << ": NetCache server " <<
-                primary_server.GetServerAddress() << " could not be "
-                "accessed because it is not registered for the service.");
+    // If enabled, check if the server belongs to the selected service
+    if (server_check != eOff && !service->IsInService(primary_server)) {
+
+        // Service name is known, no need to check other services
+        if (service_name_is_defined) {
+            NCBI_THROW_FMT(CNetSrvConnException, eServerNotInService,
+                    key.GetKey() << ": NetCache server " <<
+                    primary_server.GetServerAddress() << " could not be "
+                    "accessed because it is not registered for the service.");
+
+        // Service name is not known,
+        // check if the server belongs to one of the explicitly allowed services
+        } else if (!m_ServiceMap.IsAllowed(primary_server, m_Service)) {
+            NCBI_THROW_FMT(CNetCacheException, eAccessDenied,
+                    key.GetKey() << ": NetCache server " <<
+                    primary_server.GetServerAddress() << " could not be "
+                    "accessed because it is not registered for the allowed "
+                    "services.");
+        }
+
     }
 
     return primary_server.ExecWithRetry(cmd, multiline_output, conn_listener);
@@ -523,6 +566,7 @@ CNetServerConnection SNetCacheAPIImpl::InitiateWriteCmd(
         cmd.append(stripped_blob_id);
     }
 
+    m_UseNextSubHitID.ProperCommand();
     AppendClientIPSessionIDPasswordAgeHitID(&cmd, parameters);
 
     CNetServer::SExecResult exec_result;
@@ -546,29 +590,31 @@ CNetServerConnection SNetCacheAPIImpl::InitiateWriteCmd(
                 ". Connecting to backup server " << backup->AsString() << ".");
 
             exec_result =
-                    m_Service.GetServer(*backup).ExecWithRetry(cmd, false);
+                    m_Service->GetServer(*backup).ExecWithRetry(cmd, false);
         }
     }
 
     if (NStr::FindCase(exec_result.response, "ID:") != 0) {
         // Answer is not in the "ID:....." format
         exec_result.conn->Abort();
-        string msg = "Unexpected server response: ";
-        msg += exec_result.response;
-        NCBI_THROW(CNetServiceException, eCommunicationError, msg);
+        CONNSERV_THROW_FMT(CNetServiceException, eCommunicationError,
+            exec_result.conn->m_Server,
+            "Unexpected server response: " << exec_result.response);
     }
     exec_result.response.erase(0, 3);
 
     if (exec_result.response.empty()) {
         exec_result.conn->Abort();
-        NCBI_THROW(CNetServiceException, eCommunicationError,
+        CONNSERV_THROW_FMT(CNetServiceException, eCommunicationError,
+            exec_result.conn->m_Server,
             "Invalid server response. Empty key.");
     }
 
     if (write_existing_blob) {
         if (exec_result.response != stripped_blob_id) {
             exec_result.conn->Abort();
-            NCBI_THROW_FMT(CNetCacheException, eInvalidServerResponse,
+            CONNSERV_THROW_FMT(CNetCacheException, eInvalidServerResponse,
+                exec_result.conn->m_Server,
                 "Server created " << exec_result.response <<
                 " in response to PUT3 \"" << stripped_blob_id << "\"");
         }
@@ -662,6 +708,8 @@ bool CNetCacheAPI::HasBlob(const string& blob_id,
                 false,
                 &parameters).response[0] == '1';
     }
+    // Workaround for a bug in NC v6.6.1 (CXX-4095)
+    // TODO: Throw away after all NC servers are upgraded to v6.6.2+
     catch (CNetCacheException& e) {
         if (e.GetErrCode() == CNetCacheException::eBlobNotFound)
             return false;
@@ -697,6 +745,7 @@ void CNetCacheAPI::Remove(const string& blob_id,
     CNetCacheKey key(blob_id, m_Impl->m_CompoundIDPool);
 
     try {
+        m_Impl->m_UseNextSubHitID.ProperCommand();
         m_Impl->ExecMirrorAware(key,
                 m_Impl->MakeCmd("RMV2 ", key, &parameters),
                 false,
diff --git a/c++/src/connect/services/netcache_api_impl.hpp b/c++/src/connect/services/netcache_api_impl.hpp
index 8069b1c..382449b 100644
--- a/c++/src/connect/services/netcache_api_impl.hpp
+++ b/c++/src/connect/services/netcache_api_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES___NETCACHE_API_IMPL__HPP
 #define CONNECT_SERVICES___NETCACHE_API_IMPL__HPP
 
-/*  $Id: netcache_api_impl.hpp 466058 2015-04-28 18:02:57Z sadyrovr $
+/*  $Id: netcache_api_impl.hpp 492602 2016-02-18 19:27:34Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,6 +32,7 @@
  */
 
 #include "netcache_rw.hpp"
+#include "netservice_api_impl.hpp"
 
 BEGIN_NCBI_SCOPE
 
@@ -57,7 +58,7 @@ public:
 
 public:
     virtual CConfig* OnPreInit(CObject* api_impl,
-        CConfig* config, string* config_section);
+        CConfig* config, string* config_section, string& client_name);
     virtual void OnInit(CObject* api_impl,
         CConfig* config, const string& config_section);
     virtual void OnConnected(CNetServerConnection& connection);
@@ -78,11 +79,8 @@ struct NCBI_XCONNECT_EXPORT SNetCacheAPIImpl : public CObject
             CNetScheduleAPI::TInstance ns_api);
 
     // For use by SNetICacheClientImpl
-    SNetCacheAPIImpl(SNetServiceImpl* service_impl) :
-        m_Service(service_impl),
-        m_DefaultParameters(eVoid)
-    {
-    }
+    SNetCacheAPIImpl(const string& api_name, const string& client_name,
+            INetServerConnectionListener* listener);
 
     // Special constructor for CNetCacheAPI::GetServer().
     SNetCacheAPIImpl(SNetServerInPool* server, SNetCacheAPIImpl* parent);
@@ -140,6 +138,8 @@ struct NCBI_XCONNECT_EXPORT SNetCacheAPIImpl : public CObject
     CNetCacheAPIParameters m_DefaultParameters;
 
     CCompoundIDPool m_CompoundIDPool;
+
+    SUseNextSubHitID m_UseNextSubHitID;
 };
 
 struct SNetCacheAdminImpl : public CObject
diff --git a/c++/src/connect/services/netcache_params.cpp b/c++/src/connect/services/netcache_params.cpp
index ff90cbd..42501be 100644
--- a/c++/src/connect/services/netcache_params.cpp
+++ b/c++/src/connect/services/netcache_params.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netcache_params.cpp 458433 2015-02-04 21:48:50Z kazimird $
+/*  $Id: netcache_params.cpp 481318 2015-10-08 15:54:01Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -71,8 +71,8 @@ void CNetCacheAPIParameters::LoadNamedParameters(
             SetActualBlobAgePtr(Get<unsigned*>(optional));
         else if (optional->Is(CNetCacheAPI::eNPT_UseCompoundID))
             SetUseCompoundID(Get<bool>(optional));
-        else if (optional->Is(CNetCacheAPI::eNPT_SingleServer))
-            SetSingleServer(Get<bool>(optional));
+        else if (optional->Is(CNetCacheAPI::eNPT_TryAllServers))
+            SetTryAllServers(Get<bool>(optional));
         else if (optional->Is(CNetCacheAPI::eNPT_CacheName))
             SetCacheName(Get<string>(optional));
 }
@@ -201,9 +201,9 @@ bool CNetCacheAPIParameters::GetUseCompoundID() const
     NETCACHE_API_GET_PARAM_IMPL(UseCompoundID);
 }
 
-bool CNetCacheAPIParameters::GetSingleServer() const
+bool CNetCacheAPIParameters::GetTryAllServers() const
 {
-    NETCACHE_API_GET_PARAM_IMPL(SingleServer);
+    NETCACHE_API_GET_PARAM_IMPL(TryAllServers);
 }
 
 string CNetCacheAPIParameters::GetCacheName() const
diff --git a/c++/src/connect/services/netcache_params.hpp b/c++/src/connect/services/netcache_params.hpp
index 90b8381..b6ba3ce 100644
--- a/c++/src/connect/services/netcache_params.hpp
+++ b/c++/src/connect/services/netcache_params.hpp
@@ -1,7 +1,7 @@
 #ifndef CONN___NETCACHE_PARAMS__HPP
 #define CONN___NETCACHE_PARAMS__HPP
 
-/*  $Id: netcache_params.hpp 458433 2015-02-04 21:48:50Z kazimird $
+/*  $Id: netcache_params.hpp 481318 2015-10-08 15:54:01Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -62,7 +62,7 @@ public:
         eDP_MaxBlobAge = 1 << 8,
         eDP_ActualBlobAgePtr = 1 << 9,
         eDP_UseCompoundID = 1 << 10,
-        eDP_SingleServer = 1 << 11,
+        eDP_TryAllServers = 1 << 11,
         eDP_CacheName = 1 << 12,
     };
     typedef unsigned TDefinedParameters;
@@ -85,7 +85,7 @@ public:
         m_MaxBlobAge(0),
         m_ActualBlobAgePtr(NULL),
         m_UseCompoundID(false),
-        m_SingleServer(false)
+        m_TryAllServers(false)
     {
     }
 
@@ -157,10 +157,10 @@ public:
         m_UseCompoundID = use_compound_id;
     }
 
-    void SetSingleServer(bool single_server)
+    void SetTryAllServers(bool try_all_servers)
     {
-        m_DefinedParameters |= eDP_SingleServer;
-        m_SingleServer = single_server;
+        m_DefinedParameters |= eDP_TryAllServers;
+        m_TryAllServers = try_all_servers;
     }
 
     void SetCacheName(const string& cache_name)
@@ -180,7 +180,7 @@ public:
     unsigned GetMaxBlobAge() const;
     unsigned* GetActualBlobAgePtr() const;
     bool GetUseCompoundID() const;
-    bool GetSingleServer() const;
+    bool GetTryAllServers() const;
     string GetCacheName() const;
 
     static bool StringToBool(const string& bool_str,
@@ -201,7 +201,7 @@ private:
     unsigned m_MaxBlobAge;
     unsigned* m_ActualBlobAgePtr;
     bool m_UseCompoundID;
-    bool m_SingleServer;
+    bool m_TryAllServers;
     string m_CacheName;
 };
 
diff --git a/c++/src/connect/services/netcache_rw.cpp b/c++/src/connect/services/netcache_rw.cpp
index a86c3f6..466ee4d 100644
--- a/c++/src/connect/services/netcache_rw.cpp
+++ b/c++/src/connect/services/netcache_rw.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netcache_rw.cpp 465280 2015-04-20 14:54:39Z sadyrovr $
+/*  $Id: netcache_rw.cpp 496093 2016-03-23 18:15:45Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -80,7 +80,8 @@ CNetCacheReader::CNetCacheReader(SNetCacheAPIImpl* impl,
 
     if (pos == string::npos) {
         exec_result.conn->Abort();
-        NCBI_THROW(CNetCacheException, eInvalidServerResponse,
+        CONNSERV_THROW_FMT(CNetCacheException, eInvalidServerResponse,
+            m_Connection->m_Server,
             "No SIZE field in reply to the blob reading command");
     }
 
@@ -225,26 +226,26 @@ void CNetCacheReader::SocketRead(void* buf, size_t count, size_t* bytes_read)
     switch (status) {
     case eIO_Success:
         break;
-
     case eIO_Timeout:
-        NCBI_THROW(CNetServiceException, eTimeout,
+        CONNSERV_THROW_FMT(CNetServiceException, eTimeout,
+            m_Connection->m_Server,
             "Timeout while reading blob contents");
 
     case eIO_Closed:
         if (count > *bytes_read) {
             Uint8 remaining_bytes = m_BlobBytesToRead;
             m_BlobBytesToRead = 0;
-            NCBI_THROW_FMT(CNetCacheException, eBlobClipped,
+            CONNSERV_THROW_FMT(CNetCacheException, eBlobClipped,
+                m_Connection->m_Server,
                 "Unexpected EOF while reading " << m_BlobID <<
-                " from " <<
-                m_Connection->m_Server->m_ServerInPool->m_Address.AsString() <<
                 " (blob size: " << m_BlobSize <<
                 ", unread bytes: " << remaining_bytes << ")");
         }
         break;
 
     default:
-        NCBI_THROW_FMT(CNetServiceException, eCommunicationError,
+        CONNSERV_THROW_FMT(CNetServiceException, eCommunicationError,
+            m_Connection->m_Server,
             "Error while reading blob: " << IO_StatusStr(status));
     }
 }
@@ -346,10 +347,12 @@ void CNetCacheWriter::Close()
     if (res != eRW_Success) {
         AbortConnection();
         if (res == eRW_Timeout) {
-            NCBI_THROW(CNetServiceException, eTimeout,
+            CONNSERV_THROW_FMT(CNetServiceException, eTimeout,
+                m_Connection->m_Server,
                 "Timeout while sending EOF packet");
         } else {
-            NCBI_THROW(CNetServiceException, eCommunicationError,
+            CONNSERV_THROW_FMT(CNetServiceException, eCommunicationError,
+                m_Connection->m_Server,
                 "IO error while sending EOF packet");
         }
     }
@@ -413,39 +416,118 @@ void CNetCacheWriter::AbortConnection()
     m_Connection = NULL;
 }
 
-void CNetCacheWriter::Transmit(const void* buf,
-    size_t count, size_t* bytes_written)
+EIO_Status CNetCacheWriter::TransmitImpl(const char* buf, size_t count)
 {
-    ERW_Result res = m_TransmissionWriter->Write(buf, count, bytes_written);
+    const STimeout timeout =
+        m_NetCacheAPI->m_Service->m_ServerPool.GetCommunicationTimeout();
+    CDeadline deadline(g_STimeoutToCTimeout(&timeout));
+
+    vector<CSocketAPI::SPoll> poll(1,
+            CSocketAPI::SPoll(&m_Connection->m_Socket, eIO_ReadWrite));
+    EIO_Event& in = poll[0].m_Event;
+    EIO_Event& out = poll[0].m_REvent;
+    EIO_Status stat = eIO_Success;
+    ERW_Result res = eRW_Success;
+
+    for (;;) {
+        const CNanoTimeout remaining = deadline.GetRemainingTime();
+        STimeout wait;
+        stat = CSocketAPI::Poll(poll, g_CTimeoutToSTimeout(remaining, wait));
+
+        if (stat != eIO_Interrupt) {
+            if (stat != eIO_Success) {
+                break;
+            }
 
-    try {
-        STimeout to = {0, 0};
-        switch (m_Connection->m_Socket.Wait(eIO_Read, &to)) {
-            case eIO_Success:
-                {
-                    string msg;
-                    if (m_Connection->m_Socket.ReadLine(msg) != eIO_Closed) {
-                        if (msg.empty())
-                            break;
+            if (out == eIO_Close) {
+                stat = eIO_Closed;
+                break;
+            }
+
+            if (out & eIO_Read) {
+                string msg;
+
+                if (m_Connection->m_Socket.ReadLine(msg) != eIO_Closed) {
+                    if (!msg.empty()) {
                         if (msg.find("ERR:") == 0) {
                             msg.erase(0, 4);
                             msg = NStr::ParseEscapes(msg);
                         }
-                        NCBI_THROW(CNetCacheException, eServerError, msg);
+
+                        CONNSERV_THROW_FMT(CNetCacheException, eServerError,
+                                m_Connection->m_Server, msg);
                     }
+                }
+            }
+
+            // If we have done writing everything or due to some error
+            if (in == eIO_Read) {
+                break;
+            }
 
-                    if (res != eRW_Success) {
-                        NCBI_THROW(CNetServiceException, eCommunicationError,
-                            g_RW_ResultToString(res));
-                    } // else FALL THROUGH
+            if (out & eIO_Write) {
+                size_t written = 0;
+                res = m_TransmissionWriter->Write(buf, count, &written);
+
+                if (res == eRW_Success) {
+                    buf += written;
+                    count -= written;
+                }
+
+                // If there is an error on writing or we have done,
+                // do a non-waiting check for incoming messages
+                if (res != eRW_Success || !count) {
+                    in = eIO_Read;
+                    deadline = CDeadline(0, 0);
+                } else {
+                    deadline = g_STimeoutToCTimeout(&timeout);
                 }
+            }
+        }
+    }
 
-            case eIO_Closed:
-                NCBI_THROW(CNetServiceException, eCommunicationError,
-                    "Server closed communication channel (timeout?)");
+    // If we have not done writing yet
+    if (in != eIO_Read) {
+        return stat;
+    }
 
-            default:
-                break;
+    if (res == eRW_Success) {
+        return eIO_Success;
+    }
+
+    CONNSERV_THROW_FMT(CNetServiceException, eCommunicationError,
+            m_Connection->m_Server, g_RW_ResultToString(res));
+}
+
+void CNetCacheWriter::Transmit(const void* buf,
+        size_t count, size_t* bytes_written)
+{
+    try {
+        switch (TransmitImpl(static_cast<const char*>(buf), count))
+        {
+        case eIO_Closed:
+            CONNSERV_THROW_FMT(CNetServiceException, eCommunicationError,
+                m_Connection->m_Server,
+                "Server closed communication channel (timeout?)");
+
+        case eIO_Timeout:
+            CONNSERV_THROW_FMT(CNetServiceException, eTimeout,
+                m_Connection->m_Server,
+                    "Timeout while writing blob contents");
+
+        case eIO_InvalidArg:
+        case eIO_NotSupported:
+            _TROUBLE;
+            /* FALL THROUGH if not DEBUG */
+
+        case eIO_Unknown:
+            CONNSERV_THROW_FMT(CNetServiceException, eCommunicationError,
+                m_Connection->m_Server,
+                "Unknown error");
+
+        default:
+            if (bytes_written) *bytes_written = count;
+            return;
         }
     }
     catch (...) {
@@ -453,7 +535,7 @@ void CNetCacheWriter::Transmit(const void* buf,
         throw;
     }
 }
-
+ 
 void CNetCacheWriter::EstablishConnection()
 {
     ResetWriters();
@@ -463,7 +545,8 @@ void CNetCacheWriter::EstablishConnection()
     m_Connection->m_Socket.SetCork(true);
 
     m_SocketReaderWriter.reset(
-        new CSocketReaderWriter(&m_Connection->m_Socket));
+        new CSocketReaderWriter(&m_Connection->m_Socket, eNoOwnership,
+            eIO_WritePlain));
 
     m_TransmissionWriter.reset(
         new CTransmissionWriter(m_SocketReaderWriter.get(),
diff --git a/c++/src/connect/services/netcache_rw.hpp b/c++/src/connect/services/netcache_rw.hpp
index 92a836b..6123c35 100644
--- a/c++/src/connect/services/netcache_rw.hpp
+++ b/c++/src/connect/services/netcache_rw.hpp
@@ -1,7 +1,7 @@
 #ifndef CONN___NETCACHE_RW__HPP
 #define CONN___NETCACHE_RW__HPP
 
-/*  $Id: netcache_rw.hpp 456051 2015-01-07 17:38:03Z kazimird $
+/*  $Id: netcache_rw.hpp 477209 2015-08-27 13:39:00Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -146,6 +146,7 @@ private:
     bool IsConnectionOpen() { return m_TransmissionWriter.get() != NULL; }
     void ResetWriters();
     void AbortConnection();
+    EIO_Status TransmitImpl(const char* buf, size_t count);
     void Transmit(const void* buf, size_t count, size_t* bytes_written);
 
     void EstablishConnection();
diff --git a/c++/src/connect/services/neticache_client.cpp b/c++/src/connect/services/neticache_client.cpp
index 9f5d1f8..04ff636 100644
--- a/c++/src/connect/services/neticache_client.cpp
+++ b/c++/src/connect/services/neticache_client.cpp
@@ -1,4 +1,4 @@
-/*  $Id: neticache_client.cpp 475261 2015-08-05 19:52:42Z vasilche $
+/*  $Id: neticache_client.cpp 498373 2016-04-15 17:20:10Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -37,6 +37,7 @@
 #include <connect/services/neticache_client.hpp>
 #include <connect/services/error_codes.hpp>
 #include <connect/services/netcache_api_expt.hpp>
+#include <connect/services/srv_connections.hpp>
 
 #include <connect/ncbi_conn_exception.hpp>
 
@@ -138,8 +139,8 @@ struct SNetICacheClientImpl : public SNetCacheAPIImpl, protected CConnIniter
             const string& service_name,
             const string& client_name,
             const string& cache_name) :
-        SNetCacheAPIImpl(new SNetServiceImpl(s_NetICacheAPIName,
-                client_name, new CNetICacheServerListener)),
+        SNetCacheAPIImpl(s_NetICacheAPIName, client_name,
+                new CNetICacheServerListener),
         m_CacheFlags(ICache::fBestPerformance)
     {
         m_DefaultParameters.SetCacheName(cache_name);
@@ -147,6 +148,21 @@ struct SNetICacheClientImpl : public SNetCacheAPIImpl, protected CConnIniter
             config, section, s_NetICacheConfigSections);
     }
 
+    SNetICacheClientImpl(const IRegistry& reg,
+            const string& section,
+            const string& service_name,
+            const string& client_name,
+            const string& cache_name) :
+        SNetCacheAPIImpl(s_NetICacheAPIName, client_name,
+                new CNetICacheServerListener),
+        m_CacheFlags(ICache::fBestPerformance)
+    {
+        m_DefaultParameters.SetCacheName(cache_name);
+        CConfig config(reg);
+        m_Service->Init(this, service_name,
+            &config, section, s_NetICacheConfigSections);
+    }
+
     CNetServer::SExecResult ChooseServerAndExec(const string& cmd,
             const string& key,
             bool multiline_output,
@@ -214,9 +230,9 @@ void CNetICacheServerListener::OnInit(CObject* api_impl,
     }
 
     if (config != NULL)
-        icache_impl->m_DefaultParameters.SetSingleServer(
+        icache_impl->m_DefaultParameters.SetTryAllServers(
                 config->GetBool(config_section,
-                        "single_server", CConfig::eErr_NoThrow, false));
+                        "try_all_servers", CConfig::eErr_NoThrow, false));
 }
 
 CNetServerConnection SNetICacheClientImpl::InitiateWriteCmd(
@@ -230,6 +246,7 @@ CNetServerConnection SNetICacheClientImpl::InitiateWriteCmd(
     cmd.append(nc_writer->GetBlobID());
     if (nc_writer->GetResponseType() == eNetCache_Wait)
         cmd.append(" confirm=1");
+    m_UseNextSubHitID.ProperCommand();
     AppendClientIPSessionIDPasswordAgeHitID(&cmd, parameters);
 
     return ChooseServerAndExec(cmd, nc_writer->GetKey(),
@@ -269,6 +286,12 @@ CNetICacheClient::CNetICacheClient(CConfig* config, const string& driver_name) :
 {
 }
 
+CNetICacheClient::CNetICacheClient(const IRegistry& reg, const string& section) :
+    m_Impl(new SNetICacheClientImpl(reg, section,
+        kEmptyStr, kEmptyStr, kEmptyStr))
+{
+}
+
 void CNetICacheClient::SetCommunicationTimeout(const STimeout& to)
 {
     m_Impl->m_Service->m_ServerPool.SetCommunicationTimeout(to);
@@ -319,20 +342,40 @@ CNetServer::SExecResult SNetICacheClientImpl::ChooseServerAndExec(
     CNetServer selected_server(parameters->GetServerToUse());
     CNetServer* server_last_used_ptr(parameters->GetServerLastUsedPtr());
 
-    if (parameters->GetSingleServer()) {
-        if (!selected_server)
-            selected_server = m_Service.IterateByWeight(key).GetServer();
-
-        if (server_last_used_ptr == NULL)
-            return selected_server.ExecWithRetry(cmd,
-                    multiline_output, conn_listener);
-        else {
+    if (!parameters->GetTryAllServers()) {
+        if (selected_server) {
             CNetServer::SExecResult exec_result(
                     selected_server.ExecWithRetry(cmd,
-                            multiline_output, conn_listener));
-            *server_last_used_ptr = selected_server;
+                        multiline_output, conn_listener));
+
+            if (server_last_used_ptr) *server_last_used_ptr = selected_server;
             return exec_result;
         }
+
+        CNetServer::SExecResult exec_result;
+        auto it = m_Service.IterateByWeight(key);
+
+        do {
+            try {
+                exec_result = (*it).ExecWithRetry(cmd,
+                        multiline_output, conn_listener);
+                selected_server = *it;
+                break;
+            }
+            catch (CNetSrvConnException& ex) {
+                // A shortcut
+                const auto kErrCode = CNetSrvConnException::eConnectionFailure;
+
+                // Not a connection failure
+                if (ex.GetErrCode() != kErrCode) throw;
+
+                // No more servers to try
+                if (!++it) throw;
+            }
+        } while (it);
+
+        if (server_last_used_ptr) *server_last_used_ptr = selected_server;
+        return exec_result;
     }
 
     CNetServer::SExecResult exec_result;
@@ -475,6 +518,56 @@ void CNetICacheClient::GetBlobOwner(const string&  key,
     *owner = kEmptyStr;
 }
 
+list<string> CNetICacheClient::GetSubkeyList(const string& key)
+{
+    CNetServerMultilineCmdOutput output(
+            m_Impl->ChooseServerAndExec(
+                m_Impl->MakeStdCmd("BLIST", key, &m_Impl->m_DefaultParameters),
+                key,
+                true,
+                &m_Impl->m_DefaultParameters));
+
+    output->SetNetCacheCompatMode();
+    string line;
+
+    if (!output.ReadLine(line)) {
+        NCBI_THROW(CNetCacheException, eInvalidServerResponse,
+            "Failed to read SIZE field");
+    }
+
+    const string kSize = "SIZE=";
+    string::size_type pos = line.find(kSize);
+
+    if (pos == string::npos) {
+        NCBI_THROW(CNetCacheException, eInvalidServerResponse,
+            "No SIZE field in reply to BLIST command");
+    }
+
+    Int8 to_read = NStr::StringToInt8(line.substr(pos + kSize.size()),
+            NStr::fAllowTrailingSymbols);
+
+    list<string> result;
+
+    while (to_read > 0) {
+        output.ReadLine(line);
+        to_read -= line.size() + 1; // Plus newline character
+
+        vector<string> blob;
+        NStr::Split(line, ",", blob, NStr::fSplit_NoMergeDelims);
+
+        // It should be "cachename,key,subkey"
+        if (blob.size() != 3) {
+            NCBI_THROW_FMT(CNetCacheException, eInvalidServerResponse,
+                "Unexpected response format: " << line);
+        }
+
+        // Only subkey is used
+        result.push_back(blob[2]);
+    }
+
+    return result;
+}
+
 IReader* SNetICacheClientImpl::GetReadStreamPart(
     const string& key, int version, const string& subkey,
     size_t offset, size_t part_size,
@@ -640,6 +733,7 @@ void CNetICacheClient::RemoveBlob(const string& key,
 
     parameters.LoadNamedParameters(optional);
 
+    m_Impl->m_UseNextSubHitID.ProperCommand();
     m_Impl->ExecStdCmd("REMO", key, version, subkey, &parameters);
 }
 
@@ -665,9 +759,11 @@ bool CNetICacheClient::HasBlob(const string& key, const string& subkey,
 
         parameters.LoadNamedParameters(optional);
 
-        return m_Impl->ExecStdCmd("HASB",
-                key, 0, subkey, &parameters)[0] == '1';
+        string response(m_Impl->ExecStdCmd("HASB", key, 0, subkey, &parameters));
+        return (response[0] == '1'|| NStr::StartsWith(response, "0, VER="));
     }
+    // Workaround for a bug in NC v6.6.1 (CXX-4095)
+    // TODO: Throw away after all NC servers are upgraded to v6.6.2+
     catch (CNetCacheException& e) {
         if (e.GetErrCode() == CNetCacheException::eBlobNotFound)
             return false;
@@ -833,7 +929,7 @@ public:
 
     virtual CRef<INetServerProperties> AllocServerProperties();
     virtual CConfig* OnPreInit(CObject* api_impl,
-        CConfig* config, string* config_section);
+        CConfig* config, string* config_section, string& client_name);
     virtual void OnInit(CObject* api_impl,
         CConfig* config, const string& config_section);
     virtual void OnConnected(CNetServerConnection& connection);
@@ -852,9 +948,10 @@ CRef<INetServerProperties> CSetValidWarningSuppressor::AllocServerProperties()
 }
 
 CConfig* CSetValidWarningSuppressor::OnPreInit(CObject* api_impl,
-        CConfig* config, string* config_section)
+        CConfig* config, string* config_section, string& client_name)
 {
-    return m_DelegateListener->OnPreInit(api_impl, config, config_section);
+    return m_DelegateListener->OnPreInit(api_impl, config, config_section,
+            client_name);
 }
 
 void CSetValidWarningSuppressor::OnInit(CObject* api_impl,
@@ -1008,6 +1105,23 @@ void CNetICacheClient::SetEventHandler(INetEventHandler* event_handler)
     m_Impl->GetListener()->m_EventHandler = event_handler;
 }
 
+void CNetICacheClientExt::ProlongBlobLifetime(const string& key,
+        const CTimeout& ttl, const CNamedParameterList* optional)
+{
+    CNetCacheAPIParameters parameters(&m_Impl->m_DefaultParameters);
+    parameters.LoadNamedParameters(optional);
+
+    string cmd("PROLONG \"");
+    cmd += NStr::PrintableString(parameters.GetCacheName());
+    cmd += "\" \"";
+    cmd += key;
+    cmd += "\" \"\" ttl=";
+    cmd += NStr::NumericToString((unsigned)ttl.GetAsDouble());
+
+    m_Impl->AppendClientIPSessionID(&cmd);
+    m_Impl->ChooseServerAndExec(cmd, key, false, &m_Impl->m_DefaultParameters);
+}
+
 
 /// Class factory for NetCache implementation of ICache
 ///
diff --git a/c++/src/connect/services/netschedule_api.cpp b/c++/src/connect/services/netschedule_api.cpp
index ea430ca..c8b408e 100644
--- a/c++/src/connect/services/netschedule_api.cpp
+++ b/c++/src/connect/services/netschedule_api.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netschedule_api.cpp 470758 2015-06-18 17:19:33Z ivanov $
+/*  $Id: netschedule_api.cpp 498273 2016-04-14 17:59:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,12 +34,12 @@
 
 #include "netschedule_api_impl.hpp"
 
+#include <connect/ncbi_socket.hpp>
 #include <connect/ncbi_conn_exception.hpp>
+#include <connect/ncbi_userhost.hpp>
 
 #include <corelib/ncbi_system.hpp>
 #include <corelib/plugin_manager_impl.hpp>
-#include <corelib/request_control.hpp>
-#include <corelib/request_ctx.hpp>
 
 #include <util/ncbi_url.hpp>
 
@@ -52,42 +52,11 @@
 
 BEGIN_NCBI_SCOPE
 
-void g_AppendClientIPAndSessionID(string& cmd, const string* default_session)
+void g_AppendClientIPSessionIDHitID(string& cmd)
 {
     CRequestContext& req = CDiagContext::GetRequestContext();
-
-    if (req.IsSetClientIP()) {
-        cmd += " ip=\"";
-        cmd += req.GetClientIP();
-        cmd += '"';
-    }
-
-    if (req.IsSetSessionID()) {
-        cmd += " sid=\"";
-        cmd += NStr::PrintableString(req.GetSessionID());
-        cmd += '"';
-    } else if (default_session != NULL) {
-        cmd += " sid=\"";
-        cmd += NStr::PrintableString(*default_session);
-        cmd += '"';
-    }
-}
-
-void g_AppendHitID(string& cmd)
-{
-    CRequestContext& req = CDiagContext::GetRequestContext();
-
-    if (req.IsSetHitID()) {
-        cmd += " ncbi_phid=\"";
-        cmd += req.GetHitID();
-        cmd += '"';
-    }
-}
-
-void g_AppendClientIPSessionIDHitID(string& cmd, const string* default_session)
-{
-    g_AppendClientIPAndSessionID(cmd, default_session);
-    g_AppendHitID(cmd);
+    g_AppendClientIPAndSessionID(cmd, req);
+    g_AppendHitID(cmd, req.GetCurrentSubHitID());
 }
 
 SNetScheduleNotificationThread::SNetScheduleNotificationThread(
@@ -109,10 +78,8 @@ SNetScheduleNotificationThread::SNetScheduleNotificationThread(
 }
 
 void SNetScheduleNotificationThread::CmdAppendPortAndTimeout(
-        string* cmd, const CDeadline& deadline)
+        string* cmd, unsigned remaining_seconds)
 {
-    unsigned remaining_seconds = s_GetRemainingSeconds(deadline);
-
     if (remaining_seconds > 0) {
         *cmd += " port=";
         *cmd += NStr::UIntToString(GetPort());
@@ -388,58 +355,155 @@ void SNetScheduleAPIImpl::x_ClearNode()
     }
 }
 
+// The purpose of this class is to suppress possible errors
+// when config loading is not enabled explicitly.
+//
+// Errors would happen when we try to load config from servers that either
+// do not support "GETP2" command (introduced in 4.16.9)
+// or, do not support "QINF2 service=name" command (introduced in 4.17.0)
+// or, do not have "service to queue" mapping set
+// or, are not actually NetSchedule servers but worker nodes
+// or, are currently not reachable (behind some firewall)
+// and need cross connectivity which is usually enabled later
+//
+// This class is turned off (becomes noop, by providing NULL as api_impl)
+// when config loading is enabled explicitly
+class CNetScheduleConfigLoader::CErrorSuppressor
+{
+private:
+    typedef CRef<INetEventHandler> THandlerRef;
+
+    struct SHandler : public INetEventHandler
+    {
+        bool OnError(CException::TErrCode err_code) { return true; }
+    };
+public:
+    CErrorSuppressor(SNetScheduleAPIImpl* api_impl) :
+        m_ApiImpl(api_impl)
+    {
+        if (m_ApiImpl) {
+            THandlerRef& handler = m_ApiImpl->GetListener()->m_EventHandler;
+            m_OriginalHandler = handler;
+            handler = new SHandler;
+            m_MaxRetries = TServConn_ConnMaxRetries::GetDefault();
+            TServConn_ConnMaxRetries::SetDefault(0);
+        }
+    }
+
+    ~CErrorSuppressor()
+    {
+        if (m_ApiImpl) {
+            m_ApiImpl->GetListener()->m_EventHandler = m_OriginalHandler;
+            TServConn_ConnMaxRetries::SetDefault(m_MaxRetries);
+        }
+    }
+
+private:
+    SNetScheduleAPIImpl* m_ApiImpl;
+    THandlerRef m_OriginalHandler;
+    unsigned m_MaxRetries;
+};
+
+CNetScheduleConfigLoader::CNetScheduleConfigLoader(
+        const CTempString& prefix, const CTempString& section) :
+    m_Prefix(prefix), m_Section(section)
+{
+}
+
+bool CNetScheduleConfigLoader::Transform(const CTempString& prefix, string& name)
+{
+    // Only params starting with provided prefix are used
+    if (NStr::StartsWith(name, prefix)) {
+        name.erase(0, prefix.size());
+        return true;
+    }
+
+    return false;
+}
+
 CConfig* CNetScheduleConfigLoader::Parse(const TParams& params,
-        const CTempString& prefix, EParseMode mode)
+        const CTempString& prefix)
 {
     auto_ptr<CConfig::TParamTree> result;
-    const string kQueueParameter = "queue_name";
-
-    ITERATE(CNetScheduleAPI::TQueueParams, it, params) {
-        string param;
-        if (mode == eGetQueueName && it->first == kQueueParameter) {
-            param = it->first;
-        } else if (NStr::StartsWith(it->first, prefix)) {
-            param = it->first.substr(prefix.size());
-        } else {
-            continue;
-        }
 
-        if (!result.get()) {
-            result.reset(new CConfig::TParamTree);
-        }
+    ITERATE(TParams, it, params) {
+        string param = it->first;
 
-        result->AddNode(CConfig::TParamValue(param, it->second));
+        if (Transform(prefix, param)) {
+            if (!result.get()) {
+                result.reset(new CConfig::TParamTree);
+            }
+
+            result->AddNode(CConfig::TParamValue(param, it->second));
+        }
     }
 
     return result.get() ? new CConfig(result.release()) : NULL;
 }
 
-CConfig* CNetScheduleConfigLoader::Get(const CTempString* literals,
-        SNetScheduleAPIImpl* impl, string* section, EParseMode mode)
+CConfig* CNetScheduleConfigLoader::Get(SNetScheduleAPIImpl* impl,
+        CConfig* config, string& section)
 {
-    _ASSERT(literals);
     _ASSERT(impl);
 
+    bool set_explicitly = false;
+
+    try {
+        if (config) {
+            // If it is disabled explicitly
+            if (!config->GetBool(section, "load_config_from_ns",
+                        CConfig::eErr_Throw, true)) {
+                return NULL;
+            }
+
+            set_explicitly = true;
+        }
+    }
+    catch (CConfigException&) {
+    }
+
+    // Disable error suppressor if config loading is set explicitly
+    CErrorSuppressor suppressor(set_explicitly ? NULL : impl);
     TParams queue_params;
-    impl->GetQueueParams(kEmptyStr, queue_params);
 
-    if (CConfig* result = Parse(queue_params, *literals++, mode)) {
-        *section = *literals;
+    try {
+        impl->GetQueueParams(kEmptyStr, queue_params);
+    }
+    catch (...) {
+        if (set_explicitly) throw;
+        return NULL;
+    }
+
+    if (CConfig* result = Parse(queue_params, m_Prefix)) {
+        section = m_Section;
         return result;
     }
 
-    try {
-        impl->GetQueueParams(queue_params);
+    return NULL;
+}
 
-        if (CConfig* result = Parse(queue_params, *++literals, mode)) {
-            *section = *++literals;
-            return result;
-        }
+CNetScheduleOwnConfigLoader::CNetScheduleOwnConfigLoader() :
+    CNetScheduleConfigLoader(
+            "ns.",  "netschedule_conf_from_netschedule")
+{
+}
+
+bool CNetScheduleOwnConfigLoader::Transform(const CTempString& prefix,
+        string& name)
+{
+    // If it's "service to queue" special case (we do not know queue name)
+    if (name == "queue_name") {
+        return true;
     }
-    catch (CNetScheduleException&) {
+
+    // Queue parameter "timeout" determines the initial TTL of a submitted job.
+    // Since "timeout" is too generic, replaced it with "job_ttl" on client side.
+    if (name == "timeout") {
+        name = "job_ttl";
+        return true;
     }
 
-    return NULL;
+    return CNetScheduleConfigLoader::Transform(prefix, name);
 }
 
 void CNetScheduleServerListener::SetAuthString(SNetScheduleAPIImpl* impl)
@@ -506,10 +570,17 @@ void CNetScheduleServerListener::SetAuthString(SNetScheduleAPIImpl* impl)
     // Make the auth token look like a command to be able to
     // check for potential authentication/initialization errors
     // like the "queue not found" error.
-    if (!m_WorkerNodeCompatMode) {
+    if (m_Mode & fNonWnCompatible) {
         auth += "\r\nVERSION";
-        g_AppendClientIPSessionIDHitID(auth,
-                impl->m_ClientSession.empty() ? NULL : &impl->m_ClientSession);
+
+        if (!g_AppendClientIPAndSessionID(auth) &&
+                !impl->m_ClientSession.empty()) {
+            auth += " sid=\"";
+            auth += NStr::PrintableString(impl->m_ClientSession);
+            auth += '"';
+        }
+
+        g_AppendHitID(auth);
     }
 
     m_Auth = auth;
@@ -542,74 +613,148 @@ CRef<INetServerProperties> CNetScheduleServerListener::AllocServerProperties()
     return CRef<INetServerProperties>(new SNetScheduleServerProperties);
 }
 
+// This class makes parameter reading to be performed only once
+template <typename TDestType, typename TSrcType = TDestType>
+struct SCfgReader
+{
+    SCfgReader(TDestType& dest,
+            CConfig*& config,
+            const string& section,
+            const string& param,
+            const TSrcType& def_value = TSrcType(),
+            const list<string>* synonyms = 0,
+            bool already_read = false) :
+        m_Dest(dest),
+        m_Config(config),
+        m_Section(section),
+        m_Param(param),
+        m_DefValue(def_value),
+        m_AlreadyRead(already_read),
+        m_Synonyms(synonyms)
+    {
+        if (!m_AlreadyRead) m_Dest = m_DefValue;
+    }
+
+    bool ReadOnce()
+    {
+        _ASSERT(m_Config);
+
+        if (m_AlreadyRead) return false;
+
+        try {
+            m_Dest = m_Config->Get(m_Section, m_Param,
+                    CConfig::eErr_Throw, m_DefValue, m_Synonyms);
+        }
+        catch (CConfigException&) {
+            return false;
+        }
+
+        return m_AlreadyRead = true;
+    }
+
+private:
+    TDestType& m_Dest;
+    CConfig*& m_Config;
+    const string& m_Section;
+    const string m_Param;
+    const TSrcType m_DefValue;
+    bool m_AlreadyRead;
+    const list<string>* m_Synonyms;
+};
+
 void CNetScheduleServerListener::OnInit(
     CObject* api_impl, CConfig* config, const string& section)
 {
     SNetScheduleAPIImpl* ns_impl = static_cast<SNetScheduleAPIImpl*>(api_impl);
     _ASSERT(ns_impl);
 
+    SetDiagUserAndHost();
+
+    const string& user(GetDiagContext().GetUsername());
+    ns_impl->m_ClientNode =
+        ns_impl->m_Service->GetClientName() + "::" +
+        (user.empty() ? kEmptyStr : user + '@') +
+        GetDiagContext().GetHost();
+
     auto_ptr<CConfig> config_holder;
+    CNetScheduleOwnConfigLoader loader;
+
+    string module = section;
+
+    string& queue_ref = ns_impl->m_Queue;
+
+    if (!queue_ref.empty()) {
+        SNetScheduleAPIImpl::VerifyQueueNameAlphabet(queue_ref);
+    }
+
+    ns_impl->m_AffinityPreference = CNetScheduleExecutor::eAnyJob;
+
+    const list<string> embedded_synonyms{"use_embedded_input"};
+    bool use_affinities_value;
+
+    SCfgReader<string> queue(queue_ref,
+            config, module, "queue_name", kEmptyStr, 0, !queue_ref.empty());
+
+    SCfgReader<bool> embedded(ns_impl->m_UseEmbeddedStorage,
+            config, module, "use_embedded_storage", true, &embedded_synonyms);
+
+    SCfgReader<bool> use_affinities(use_affinities_value,
+            config, module, "use_affinities");
+
+    SCfgReader<string> job_group(ns_impl->m_JobGroup,
+            config, module, "job_group");
+
+    SCfgReader<unsigned, int> job_ttl(ns_impl->m_JobTtl,
+            config, module, "job_ttl");
+
+    SCfgReader<string> client_node(ns_impl->m_ClientNode,
+            config, module, "client_node", ns_impl->m_ClientNode);
+
+    SCfgReader<string> scope(m_Scope, config, module, "scope");
 
     // There are two phases of OnInit in case we need to load config from server
     // 1) Setup as much as possible and try to get config from server
     // 2) Setup everything using received config from server
     for (int phase = 0; phase < 2; ++phase) {
-        string config_section = section;
-
-        if (!ns_impl->m_Queue.empty())
-            SNetScheduleAPIImpl::VerifyQueueNameAlphabet(ns_impl->m_Queue);
-        else if (config != NULL) {
-            ns_impl->m_Queue = config->GetString(config_section,
-                "queue_name", CConfig::eErr_NoThrow, kEmptyStr);
-            if (!ns_impl->m_Queue.empty())
-                SNetScheduleAPIImpl::VerifyQueueNameAlphabet(ns_impl->m_Queue);
-        }
-
-        if (config == NULL) {
-            ns_impl->m_AffinityPreference = CNetScheduleExecutor::eAnyJob;
-            ns_impl->m_UseEmbeddedStorage = true;
-        } else {
-            try {
-                ns_impl->m_UseEmbeddedStorage = config->GetBool(config_section,
-                    "use_embedded_storage", CConfig::eErr_Throw, true);
-            }
-            catch (CConfigException&) {
-                ns_impl->m_UseEmbeddedStorage = config->GetBool(config_section,
-                    "use_embedded_input", CConfig::eErr_NoThrow, true);
+        if (config) {
+            if (queue.ReadOnce()) {
+                SNetScheduleAPIImpl::VerifyQueueNameAlphabet(queue_ref);
             }
 
-            if (!config->GetBool(config_section, "use_affinities",
-                    CConfig::eErr_NoThrow, false))
-                ns_impl->m_AffinityPreference = CNetScheduleExecutor::eAnyJob;
-            else {
-                ns_impl->m_AffinityPreference = config->GetBool(config_section,
+            embedded.ReadOnce();
+
+            if (use_affinities.ReadOnce() && use_affinities_value) {
+                ns_impl->m_AffinityPreference = config->GetBool(module,
                         "claim_new_affinities", CConfig::eErr_NoThrow, false) ?
                     CNetScheduleExecutor::eClaimNewPreferredAffs :
-                    config->GetBool(config_section,
+                    config->GetBool(module,
                         "process_any_job", CConfig::eErr_NoThrow, false) ?
                             CNetScheduleExecutor::ePreferredAffsOrAnyJob :
                             CNetScheduleExecutor::ePreferredAffinities;
 
-                string affinity_list = config->GetString(config_section,
+                string affinity_list = config->GetString(module,
                         "affinity_list", CConfig::eErr_NoThrow, kEmptyStr);
 
                 if (!affinity_list.empty()) {
-                    NStr::Split(affinity_list, ", ", ns_impl->m_AffinityList);
+                    NStr::Split(affinity_list, ", ", ns_impl->m_AffinityList,
+                            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                     ITERATE(list<string>, it, ns_impl->m_AffinityList) {
                         SNetScheduleAPIImpl::VerifyAffinityAlphabet(*it);
                     }
                 }
 
-                string affinity_ladder = config->GetString(config_section,
+                string affinity_ladder = config->GetString(module,
                         "affinity_ladder", CConfig::eErr_NoThrow, kEmptyStr);
                 list<CTempString> affinities;
-                NStr::Split(affinity_ladder, ", ", affinities);
+                NStr::Split(affinity_ladder, ", ", affinities,
+                        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
                 if (!affinities.empty()) {
                     list<CTempString>::const_iterator it = affinities.begin();
                     affinity_list = *it;
                     for (;;) {
-                        ns_impl->m_AffinityLadder.push_back(affinity_list);
+                        ns_impl->m_AffinityLadder.push_back(
+                                make_pair(*it, affinity_list));
                         if (++it == affinities.end())
                             break;
                         affinity_list += ',';
@@ -618,65 +763,76 @@ void CNetScheduleServerListener::OnInit(
                 }
             }
 
-            ns_impl->m_JobGroup = config->GetString(config_section,
-                    "job_group", CConfig::eErr_NoThrow, kEmptyStr);
-
-            ns_impl->m_ClientNode = config->GetString(config_section,
-                "client_node", CConfig::eErr_NoThrow, kEmptyStr);
+            job_group.ReadOnce();
+            job_ttl.ReadOnce();
+            client_node.ReadOnce();
+            scope.ReadOnce();
+        }
 
-            if (!ns_impl->m_ClientNode.empty())
-                ns_impl->m_ClientSession = GetDiagContext().GetStringUID();
+        if (!ns_impl->m_ClientNode.empty()) {
+            ns_impl->m_ClientSession =
+                NStr::NumericToString(CDiagContext::GetPID()) + '@' +
+                NStr::NumericToString(GetFastLocalTime().GetTimeT()) + ':' +
+                GetDiagContext().GetStringUID();
         }
 
         SetAuthString(ns_impl);
 
-        // If we should not load config from NetSchedule server
-        // or have already done it
-        if (phase || !CNetScheduleConfigLoader::Use(config, config_section)) {
-            break;
+        // If we should load config from NetSchedule server
+        // and have not done it already and not working in WN compatible mode
+        if (!phase && (m_Mode & fConfigLoading)) {
+            if (CConfig* alt = loader.Get(ns_impl, config, module)) {
+                config_holder.reset(alt);
+                config = alt;
+                continue;
+            }
         }
 
-        const CTempString kLiterals[] = {
-            "ns.",      "netschedule_conf_from_netschedule",
-            "ns::",     "netschedule_conf_from_netschedule_GETP2"
-        };
-        config_holder.reset(
-                CNetScheduleConfigLoader::Get(kLiterals, ns_impl,
-                    &config_section, CNetScheduleConfigLoader::eGetQueueName));
-        config = config_holder.get();
+        break;
     }
 }
 
 void CNetScheduleServerListener::OnConnected(CNetServerConnection& connection)
 {
-    if (!m_WorkerNodeCompatMode) {
+    if (m_Mode & fNonWnCompatible) {
         string version_info(connection.Exec(m_Auth, false));
 
         CNetServerInfo server_info(new SNetServerInfoImpl(version_info));
 
         string attr_name, attr_value;
         string ns_node, ns_session;
+        CVersionInfo version;
 
         while (server_info.GetNextAttribute(attr_name, attr_value))
             if (attr_name == "ns_node")
                 ns_node = attr_value;
             else if (attr_name == "ns_session")
                 ns_session = attr_value;
+            else if (attr_name == "server_version")
+                version = CVersionInfo(attr_value);
 
+        // Usually, all attributes come together, so no need to check version
         if (!ns_node.empty() && !ns_session.empty()) {
             CRef<SNetScheduleServerProperties> server_props =
                 x_GetServerProperties(connection->m_Server);
 
+            // Version cannot change without session, so no need to compare, too
             if (server_props->ns_node != ns_node ||
                     server_props->ns_session != ns_session) {
                 CFastMutexGuard guard(m_ServerByNodeMutex);
-
                 server_props->ns_node = ns_node;
                 server_props->ns_session = ns_session;
+                server_props->version = version;
                 m_ServerByNode[ns_node] = connection->m_Server->m_ServerInPool;
                 server_props->affs_synced = false;
             }
         }
+
+        if (!m_Scope.empty()) {
+            string cmd("SETSCOPE " + m_Scope);
+            g_AppendClientIPSessionIDHitID(cmd);
+            connection.Exec(cmd, false);
+        }
     } else
         connection->WriteLine(m_Auth);
 }
@@ -697,6 +853,10 @@ void CNetScheduleServerListener::OnError(
     // Map code into numeric value
     CException::TErrCode err_code = CNetScheduleExceptionMap::GetCode(code);
 
+    if (m_EventHandler && m_EventHandler->OnError(err_code)) {
+        return;
+    }
+
     switch (err_code) {
     case CException::eInvalid:
         NCBI_THROW(CNetServiceException, eCommunicationError, err_msg);
@@ -739,15 +899,28 @@ SNetScheduleAPIImpl::SNetScheduleAPIImpl(
         CConfig* config, const string& section,
         const string& service_name, const string& client_name,
         const string& queue_name) :
-    m_Service(new SNetServiceImpl("NetScheduleAPI",
-        client_name, new CNetScheduleServerListener)),
-    m_Queue(queue_name)
+    m_Service(new SNetServiceImpl("NetScheduleAPI", client_name,
+                new CNetScheduleServerListener)),
+    m_Queue(queue_name),
+    m_JobTtl(0)
 {
     m_Service->Init(this, service_name,
         config, section, s_NetScheduleConfigSections);
 }
 
 SNetScheduleAPIImpl::SNetScheduleAPIImpl(
+        const string& service_name, const string& client_name,
+        const string& queue_name, bool wn_compatible) :
+    m_Service(new SNetServiceImpl("NetScheduleAPI", client_name,
+                new CNetScheduleServerListener(wn_compatible), wn_compatible)),
+    m_Queue(queue_name),
+    m_JobTtl(0)
+{
+    m_Service->Init(this, service_name,
+        NULL, kEmptyStr, s_NetScheduleConfigSections);
+}
+
+SNetScheduleAPIImpl::SNetScheduleAPIImpl(
         SNetServerInPool* server, SNetScheduleAPIImpl* parent) :
     m_Service(new SNetServiceImpl(server, parent->m_Service)),
     m_Queue(parent->m_Queue),
@@ -755,6 +928,7 @@ SNetScheduleAPIImpl::SNetScheduleAPIImpl(
     m_ClientNode(parent->m_ClientNode),
     m_ClientSession(parent->m_ClientSession),
     m_AffinityPreference(parent->m_AffinityPreference),
+    m_JobTtl(0),
     m_UseEmbeddedStorage(parent->m_UseEmbeddedStorage)
 {
 }
@@ -791,7 +965,7 @@ void CNetScheduleAPI::SetProgramVersion(const string& pv)
 {
     m_Impl->m_ProgramVersion = pv;
 
-    UpdateAuthString();
+    m_Impl->UpdateAuthString();
 }
 
 const string& CNetScheduleAPI::GetProgramVersion() const
@@ -1207,7 +1381,7 @@ void CNetScheduleAPI::SetClientNode(const string& client_node)
 
     m_Impl->m_ClientNode = client_node;
 
-    UpdateAuthString();
+    m_Impl->UpdateAuthString();
 }
 
 void CNetScheduleAPI::SetClientSession(const string& client_session)
@@ -1216,48 +1390,31 @@ void CNetScheduleAPI::SetClientSession(const string& client_session)
 
     m_Impl->m_ClientSession = client_session;
 
-    UpdateAuthString();
+    m_Impl->UpdateAuthString();
 }
 
-void CNetScheduleAPI::UpdateAuthString()
+void SNetScheduleAPIImpl::UpdateAuthString()
 {
-    m_Impl->m_Service->m_ServerPool->ResetServerConnections();
+    m_Service->m_ServerPool->ResetServerConnections();
 
-    m_Impl->GetListener()->SetAuthString(m_Impl);
+    GetListener()->SetAuthString(this);
 }
 
 void CNetScheduleAPI::SetClientType(CNetScheduleAPI::EClientType client_type)
 {
     m_Impl->GetListener()->m_ClientType = client_type;
 
-    UpdateAuthString();
-}
-
-void CNetScheduleAPI::EnableWorkerNodeCompatMode()
-{
-    m_Impl->GetListener()->m_WorkerNodeCompatMode = true;
-
-    UpdateAuthString();
+    m_Impl->UpdateAuthString();
 }
 
-void CNetScheduleAPI::UseOldStyleAuth()
+void SNetScheduleAPIImpl::UseOldStyleAuth()
 {
-    m_Impl->m_Service->m_ServerPool->m_UseOldStyleAuth = true;
+    m_Service->m_ServerPool->m_UseOldStyleAuth = true;
 
     UpdateAuthString();
 }
 
-CNetScheduleAPI CNetScheduleAPI::GetServer(CNetServer::TInstance server)
-{
-    return new SNetScheduleAPIImpl(server->m_ServerInPool, m_Impl);
-}
-
-void CNetScheduleAPI::SetEventHandler(INetEventHandler* event_handler)
-{
-    m_Impl->GetListener()->m_EventHandler = event_handler;
-}
-
-void CNetScheduleAPI::SetAuthParam(const string& param_name,
+void SNetScheduleAPIImpl::SetAuthParam(const string& param_name,
         const string& param_value)
 {
     if (!param_value.empty()) {
@@ -1265,18 +1422,13 @@ void CNetScheduleAPI::SetAuthParam(const string& param_name,
         auth_param += "=\"";
         auth_param += NStr::PrintableString(param_value);
         auth_param += '"';
-        m_Impl->m_AuthParams[param_name] = auth_param;
+        m_AuthParams[param_name] = auth_param;
     } else
-        m_Impl->m_AuthParams.erase(param_name);
+        m_AuthParams.erase(param_name);
 
     UpdateAuthString();
 }
 
-CCompoundIDPool CNetScheduleAPI::GetCompoundIDPool()
-{
-    return m_Impl->m_CompoundIDPool;
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 
 /// @internal
@@ -1347,4 +1499,66 @@ void NCBI_XCONNECT_EXPORT NCBI_EntryPoint_xnetscheduleapi(
 }
 
 
+void CNetScheduleAPIExt::AddToClientNode(const string& data)
+{
+    string& client_node(m_Impl->m_ClientNode);
+    client_node += ':';
+    client_node += data;
+    UpdateAuthString();
+}
+
+void CNetScheduleAPIExt::UpdateAuthString()
+{
+    m_Impl->UpdateAuthString();
+}
+
+void CNetScheduleAPIExt::UseOldStyleAuth()
+{
+    m_Impl->UseOldStyleAuth();
+}
+
+void CNetScheduleAPIExt::SetEventHandler(INetEventHandler* event_handler)
+{
+    m_Impl->GetListener()->m_EventHandler = event_handler;
+}
+
+CCompoundIDPool CNetScheduleAPIExt::GetCompoundIDPool()
+{
+    return m_Impl->m_CompoundIDPool;
+}
+
+CNetScheduleAPI CNetScheduleAPIExt::GetServer(CNetServer::TInstance server)
+{
+    return new SNetScheduleAPIImpl(server->m_ServerInPool, m_Impl);
+}
+
+void CNetScheduleAPIExt::ReSetClientNode(const string& client_node)
+{
+    g_VerifyAlphabet(client_node, "client node ID", eCC_RelaxedId);
+    m_Impl->m_ClientNode = client_node;
+    m_Impl->UpdateAuthString();
+}
+
+void CNetScheduleAPIExt::ReSetClientSession(const string& client_session)
+{
+    g_VerifyAlphabet(client_session, "client session ID", eCC_RelaxedId);
+    m_Impl->m_ClientSession = client_session;
+    m_Impl->UpdateAuthString();
+}
+
+CNetScheduleAPI::TInstance
+CNetScheduleAPIExt::CreateWnCompat(const string& service_name,
+        const string& client_name)
+{
+    return new SNetScheduleAPIImpl(service_name, client_name, kEmptyStr, true);
+}
+
+CNetScheduleAPI::TInstance
+CNetScheduleAPIExt::CreateNoCfgLoad(const string& service_name,
+        const string& client_name, const string& queue_name)
+{
+    return new SNetScheduleAPIImpl(service_name, client_name, queue_name, false);
+}
+
+
 END_NCBI_SCOPE
diff --git a/c++/src/connect/services/netschedule_api_admin.cpp b/c++/src/connect/services/netschedule_api_admin.cpp
index d2fa105..6f0418a 100644
--- a/c++/src/connect/services/netschedule_api_admin.cpp
+++ b/c++/src/connect/services/netschedule_api_admin.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netschedule_api_admin.cpp 449834 2014-10-21 16:34:48Z kazimird $
+/*  $Id: netschedule_api_admin.cpp 492599 2016-02-18 19:26:29Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -120,7 +120,9 @@ void CNetScheduleAdmin::CancelAllJobs(const string& job_statuses)
         cmd.assign("CANCEL status=");
         cmd.append(job_statuses);
     }
-    g_AppendClientIPSessionIDHitID(cmd);
+    CRequestContext& req = CDiagContext::GetRequestContext();
+    g_AppendClientIPAndSessionID(cmd, req);
+    g_AppendHitID(cmd, req.GetNextSubHitID());
     m_Impl->m_API->m_Service.ExecOnAllServers(cmd);
 }
 
diff --git a/c++/src/connect/services/netschedule_api_executor.cpp b/c++/src/connect/services/netschedule_api_executor.cpp
index 1458d0e..be05cdb 100644
--- a/c++/src/connect/services/netschedule_api_executor.cpp
+++ b/c++/src/connect/services/netschedule_api_executor.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netschedule_api_executor.cpp 466932 2015-05-07 15:31:56Z sadyrovr $
+/*  $Id: netschedule_api_executor.cpp 486255 2015-12-02 17:51:03Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,6 +34,8 @@
 
 #include "netschedule_api_impl.hpp"
 
+#include <cmath>
+
 #define NCBI_USE_ERRCODE_X   ConnServ_NetSchedule
 
 BEGIN_NCBI_SCOPE
@@ -367,23 +369,51 @@ bool SNetScheduleExecutorImpl::x_GetJobWithAffinityList(SNetServerImpl* server,
 }
 
 bool SNetScheduleExecutorImpl::x_GetJobWithAffinityLadder(
-        SNetServerImpl* server, const CDeadline& timeout, CNetScheduleJob& job)
+        SNetServerImpl* server, const CDeadline& timeout, 
+        const string& prio_aff_list, CNetScheduleJob& job)
 {
-    if (m_API->m_AffinityLadder.empty())
+    if (prio_aff_list.empty())
         return x_GetJobWithAffinityList(server, &timeout, job,
                 m_AffinityPreference, kEmptyStr);
 
-    list<string>::const_iterator it = m_API->m_AffinityLadder.begin();
+    // If prioritized_aff flag is supported (NS v4.22.0+)
+    CRef<SNetScheduleServerProperties> server_props =
+        CNetScheduleServerListener::x_GetServerProperties(server);
+
+    if (server_props->version.IsUpCompatible(CVersionInfo(4, 22, 0))) {
+        string cmd("GET2 wnode_aff=0 any_aff=0 aff=");
+        cmd += prio_aff_list;
+
+        m_NotificationHandler.CmdAppendTimeoutGroupAndClientInfo(cmd,
+                &timeout, m_JobGroup);
+
+        cmd.append(" prioritized_aff=1");
+        return ExecGET(server, cmd, job);
+    }
+
+    // XXX: Compatibility mode.
+    // TODO: Can be thrown out after all NS serves are updated to version 4.22.0+
+    list<CTempString> affinity_tokens;
+    NStr::Split(prio_aff_list, ",", affinity_tokens,
+            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
+
+    string affinity_list;
+    list<CTempString>::const_iterator it = affinity_tokens.begin();
+
+    while (it != affinity_tokens.end()) {
+        affinity_list += *it;
+        const bool last_try = ++it == affinity_tokens.end();
 
-    for (;;) {
-        string affinity_list = *it;
-        if (++it == m_API->m_AffinityLadder.end())
-            return x_GetJobWithAffinityList(server, &timeout, job,
-                    m_AffinityPreference, affinity_list);
-        else if (x_GetJobWithAffinityList(server, NULL, job,
-                CNetScheduleExecutor::ePreferredAffinities, affinity_list))
+        if (x_GetJobWithAffinityList(server, last_try ? &timeout : NULL,
+                    job, CNetScheduleExecutor::eExplicitAffinitiesOnly,
+                    affinity_list)) {
             return true;
+        }
+
+        affinity_list += ',';
     }
+
+    return false;
 }
 
 bool CNetScheduleExecutor::GetJob(CNetScheduleJob& job,
@@ -477,7 +507,8 @@ string CNetScheduleNotificationHandler::MkBaseGETCmd(
     if (!affinity_list.empty()) {
         list<CTempString> affinity_tokens;
 
-        NStr::Split(affinity_list, ",", affinity_tokens);
+        NStr::Split(affinity_list, ",", affinity_tokens,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
         ITERATE(list<CTempString>, token, affinity_tokens) {
             SNetScheduleAPIImpl::VerifyAffinityAlphabet(*token);
@@ -494,7 +525,8 @@ void CNetScheduleNotificationHandler::CmdAppendTimeoutGroupAndClientInfo(
         string& cmd, const CDeadline* deadline, const string& job_group)
 {
     if (deadline != NULL) {
-        unsigned remaining_seconds = s_GetRemainingSeconds(*deadline);
+        unsigned remaining_seconds = (unsigned)
+            ceil(deadline->GetRemainingTime().GetAsDouble());
 
         if (remaining_seconds > 0) {
             cmd += " port=";
@@ -687,7 +719,8 @@ CNetScheduleAPI::EJobStatus CNetScheduleExecutor::GetJobStatus(
     return m_Impl->m_API->GetJobStatus("WST2", job, job_exptime, pause_mode);
 }
 
-void CNetScheduleExecutor::ReturnJob(const CNetScheduleJob& job)
+void SNetScheduleExecutorImpl::ReturnJob(const CNetScheduleJob& job,
+        bool blacklist)
 {
     string cmd("RETURN2 job_key=" + job.job_id);
 
@@ -695,9 +728,18 @@ void CNetScheduleExecutor::ReturnJob(const CNetScheduleJob& job)
     cmd.append(" auth_token=");
     cmd.append(job.auth_token);
 
+    if (!blacklist) {
+        cmd.append(" blacklist=0");
+    }
+
     g_AppendClientIPSessionIDHitID(cmd);
 
-    m_Impl->ExecWithOrWithoutRetry(job, cmd);
+    ExecWithOrWithoutRetry(job, cmd);
+}
+
+void CNetScheduleExecutor::ReturnJob(const CNetScheduleJob& job)
+{
+    m_Impl->ReturnJob(job);
 }
 
 int SNetScheduleExecutorImpl::AppendAffinityTokens(string& cmd,
@@ -753,7 +795,7 @@ const string& CNetScheduleExecutor::GetQueueName()
 
 const string& CNetScheduleExecutor::GetClientName()
 {
-    return m_Impl->m_API->m_Service->m_ServerPool.GetClientName();
+    return m_Impl->m_API->m_Service->GetClientName();
 }
 
 const string& CNetScheduleExecutor::GetServiceName()
diff --git a/c++/src/connect/services/netschedule_api_getjob.cpp b/c++/src/connect/services/netschedule_api_getjob.cpp
new file mode 100644
index 0000000..16b5fb5
--- /dev/null
+++ b/c++/src/connect/services/netschedule_api_getjob.cpp
@@ -0,0 +1,461 @@
+/*  $Id: netschedule_api_getjob.cpp 476303 2015-08-17 19:03:16Z sadyrovr $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors: Rafael Sadyrov
+ *
+ * File Description:
+ *   NetSchedule API get/read job implementation.
+ *
+ */
+
+#include <ncbi_pch.hpp>
+
+#include "grid_worker_impl.hpp"
+#include "netschedule_api_impl.hpp"
+#include "netservice_api_impl.hpp"
+
+#include "netschedule_api_getjob.hpp"
+
+BEGIN_NCBI_SCOPE
+
+
+template <class TImpl> class CAnyAffinityJob;
+template <class TImpl> class CMostAffinityJob;
+
+template <class TImpl>
+CNetScheduleGetJob::EResult CNetScheduleGetJobImpl<TImpl>::GetJob(
+        const CDeadline& deadline,
+        CNetScheduleJob& job,
+        CNetScheduleAPI::EJobStatus* job_status)
+{
+    if (m_Impl.m_API->m_AffinityLadder.empty()) {
+        CAnyAffinityJob<TImpl> holder(job, job_status, m_ImmediateActions);
+        return GetJobImpl(deadline, holder);
+    } else {
+        ReturnNotFullyCheckedServers();
+        CMostAffinityJob<TImpl> holder(job, job_status, m_ImmediateActions, m_Impl);
+        return GetJobImpl(deadline, holder);
+    }
+}
+
+typedef list<SServerAddress> TServers;
+typedef list<CNetScheduleGetJob::SEntry> TTimeline;
+typedef TTimeline::iterator TIterator;
+
+// TODO: This can be replaced by lambda after we migrate to C++11
+template <class TImpl>
+struct SEntryHasMoreJobs
+{
+    TImpl& impl;
+    SEntryHasMoreJobs(TImpl& i) : impl(i) {}
+
+    bool operator()(const CNetScheduleGetJob::SEntry& entry)
+    {
+        return impl.MoreJobs(entry);
+    }
+};
+
+template <class TImpl>
+class CAnyAffinityJob
+{
+public:
+    CNetScheduleJob& job;
+    CNetScheduleAPI::EJobStatus* job_status;
+
+    CAnyAffinityJob(CNetScheduleJob& j, CNetScheduleAPI::EJobStatus* js,
+            TTimeline& timeline) :
+        job(j), job_status(js), m_Timeline(timeline)
+    {}
+
+    void Interrupt()                {}
+    TIterator Begin()               { return m_Timeline.begin(); }
+    TIterator Next(bool)            { return m_Timeline.begin(); }
+    const string& Affinity(bool&) const { return kEmptyStr; }
+    bool Done()                     { return true; }
+    bool HasJob() const             { return false; }
+
+private:
+    TTimeline& m_Timeline;
+};
+
+template <class TImpl>
+class CMostAffinityJob
+{
+public:
+    CNetScheduleJob& job;
+    CNetScheduleAPI::EJobStatus* job_status;
+
+    CMostAffinityJob(CNetScheduleJob& j, CNetScheduleAPI::EJobStatus* js,
+            TTimeline& timeline, TImpl& get_job_impl) :
+        job(j), job_status(js), m_JobPriority(numeric_limits<size_t>::max()),
+        m_Timeline(timeline), m_Iterator(timeline.end()),
+        m_GetJobImpl(get_job_impl)
+    {
+        _ASSERT(m_GetJobImpl.m_API->m_AffinityLadder.size());
+    }
+
+    void Interrupt()
+    {
+        if (HasJob()) {
+            m_GetJobImpl.ReturnJob(job);
+            job.Reset();
+        }
+    }
+
+    TIterator Begin()
+    {
+        m_Iterator = m_Timeline.end();
+        return m_Timeline.begin();
+    }
+
+    TIterator Next(bool increment)
+    {
+        if (increment) {
+            if (m_Iterator == m_Timeline.end()) {
+                m_Iterator = m_Timeline.begin();
+            } else {
+                ++m_Iterator;
+            }
+
+            // We've already got a job from an entry at m_Iterator + 1
+            // (that is why increment is true), so must not happen
+            _ASSERT(m_Iterator != m_Timeline.end());
+
+        } else if (m_Iterator == m_Timeline.end()) {
+            return m_Timeline.begin();
+        }
+
+        TIterator ret = m_Iterator;
+        return ++ret;
+    }
+
+    const string& Affinity(bool& all_affinities) const
+    {
+        // Must not happen, since otherwise Done() has returned true already
+        _ASSERT(m_JobPriority);
+
+        CNetScheduleGetJob::TAffinityLadder&
+            affinity_ladder(m_GetJobImpl.m_API->m_AffinityLadder);
+
+        if (HasJob()) {
+            // Only affinities that are higher that current job's one
+            all_affinities = false;
+            return affinity_ladder[m_JobPriority - 1].second;
+        } else {
+            // All affinities
+            all_affinities = true;
+            return affinity_ladder.back().second;
+        }
+    }
+
+    bool Done()
+    {
+        // Must not happen, since otherwise Done() has returned true already
+        _ASSERT(m_JobPriority);
+
+        // Return a less-priority job back
+        if (HasJob()) {
+            m_GetJobImpl.ReturnJob(m_PreviousJob);
+        }
+
+        m_PreviousJob = job;
+
+        CNetScheduleGetJob::TAffinityLadder&
+            affinity_ladder(m_GetJobImpl.m_API->m_AffinityLadder);
+
+        size_t priority = min(affinity_ladder.size(), m_JobPriority) - 1;
+
+        do {
+            if (job.affinity == affinity_ladder[priority].first) {
+                m_JobPriority = priority;
+
+                // Return true, if job has the highest priority (zero)
+                return !m_JobPriority;
+            }
+        } while (priority-- > 0);
+
+        // Should not happen
+        LOG_POST(Error << "Got a job " << job.job_id <<
+                " with unexpected affinity " << job.affinity);
+        m_JobPriority = numeric_limits<size_t>::max();
+        return false;
+    }
+
+    bool HasJob() const
+    {
+        return m_JobPriority < numeric_limits<size_t>::max();
+    }
+
+private:
+    size_t m_JobPriority;
+    TTimeline& m_Timeline;
+    TIterator m_Iterator;
+    TImpl& m_GetJobImpl;
+    CNetScheduleJob m_PreviousJob;
+};
+
+template <class TImpl>
+template <class TJobHolder>
+CNetScheduleGetJob::EResult CNetScheduleGetJobImpl<TImpl>::GetJobImmediately(TJobHolder& holder)
+{
+    TIterator i = holder.Begin();
+
+    for (;;) {
+        EState state = m_Impl.CheckState();
+
+        if (state == eStopped) {
+            holder.Interrupt();
+            return eInterrupt;
+        }
+        
+        if (state == eRestarted) {
+            Restart();
+            i = holder.Begin();
+            continue;
+        }
+
+        // We must check i here to let state be checked before leaving loop
+        if (i == m_ImmediateActions.end()) {
+            return holder.HasJob() ? eJob : eAgain;
+        }
+
+        if (*i == m_DiscoveryAction) {
+            NextDiscoveryIteration();
+            i = holder.Begin();
+            continue;
+        }
+
+        // Whether to move to the next entry
+        // (false means we are already at the next entry due to splice/erase)
+        bool increment = false;
+
+        try {
+            // Get prioritized affinity list and
+            // a flag whether the list contains all possible affinities
+            bool all_affinities = true;
+            const string& prio_aff_list(holder.Affinity(all_affinities));
+
+            if (m_Impl.CheckEntry(*i, prio_aff_list,
+                        holder.job, holder.job_status)) {
+                if (i == m_ImmediateActions.begin()) {
+                    increment = true;
+                } else {
+                    // We have got a more prioritized job from this server.
+                    // Move this server to the top of immediate actions,
+                    // so we will have servers ordered (most-to-least)
+                    // by affinities of the jobs they have returned last
+                    m_ImmediateActions.splice(m_ImmediateActions.begin(),
+                            m_ImmediateActions, i);
+                }
+
+                // A job has been returned; keep the server in
+                // immediate actions because there can be more
+                // jobs in the queue.
+                if (holder.Done()) {
+                    return eJob;
+                }
+            } else {
+                // No job has been returned by this server;
+                // query the server later.
+                i->deadline = CDeadline(m_Impl.m_Timeout, 0);
+                i->all_affinities = all_affinities;
+                m_ScheduledActions.splice(m_ScheduledActions.end(),
+                        m_ImmediateActions, i);
+            }
+        }
+        catch (CNetSrvConnException& e) {
+            // Because a connection error has occurred, do not
+            // put this server back to the timeline.
+            m_ImmediateActions.erase(i);
+            LOG_POST(Warning << e.GetMsg());
+        }
+        catch (...) {
+            m_ImmediateActions.erase(i);
+
+            if (holder.HasJob()) {
+                return eJob;
+            }
+
+            throw;
+        }
+
+        // Check all servers that have timeout expired
+        while (!m_ScheduledActions.empty() &&
+                m_ScheduledActions.front().deadline.GetRemainingTime().IsZero()) {
+            m_ImmediateActions.splice(m_ImmediateActions.end(),
+                    m_ScheduledActions, m_ScheduledActions.begin());
+        }
+
+        // Check if there's a notification in the UDP socket.
+        while (CNetServer server = m_Impl.ReadNotifications()) {
+            MoveToImmediateActions(server);
+        }
+
+        i = holder.Next(increment);
+    }
+}
+
+template <class TImpl>
+template <class TJobHolder>
+CNetScheduleGetJob::EResult CNetScheduleGetJobImpl<TImpl>::GetJobImpl(
+        const CDeadline& deadline, TJobHolder& holder)
+{
+    for (;;) {
+        EResult ret = GetJobImmediately(holder);
+
+        if (ret != eAgain) {
+            return ret;
+        }
+
+        // If MoreJobs() returned false for all entries of m_ScheduledActions
+        if (find_if(m_ScheduledActions.begin(), m_ScheduledActions.end(),
+                    SEntryHasMoreJobs<TImpl>(m_Impl)) == m_ScheduledActions.end()) {
+            return eNoJobs;
+        }
+
+        if (deadline.IsExpired())
+            return eAgain;
+
+        // At least, the discovery action must be there
+        _ASSERT(!m_ScheduledActions.empty());
+
+        // There's still time. Wait for notifications and query the servers.
+        CDeadline next_event_time = m_ScheduledActions.front().deadline;
+        bool last_wait = deadline < next_event_time;
+        if (last_wait) next_event_time = deadline;
+
+        if (CNetServer server = m_Impl.WaitForNotifications(next_event_time)) {
+            do {
+                MoveToImmediateActions(server);
+            } while ((server = m_Impl.ReadNotifications()));
+        } else if (last_wait) {
+            return eAgain;
+        } else {
+            m_ImmediateActions.splice(m_ImmediateActions.end(),
+                    m_ScheduledActions, m_ScheduledActions.begin());
+        }
+    }
+}
+
+inline void Filter(TTimeline& timeline, TServers& servers)
+{
+    TTimeline::iterator i = timeline.begin();
+
+    while (i != timeline.end()) {
+        const SServerAddress& address(i->server_address);
+        TServers::iterator j = find(servers.begin(), servers.end(), address);
+
+        // If this server is still valid
+        if (j != servers.end()) {
+            servers.erase(j);
+            ++i;
+        } else {
+            timeline.erase(i++);
+        }
+    }
+}
+
+template <class TImpl>
+void CNetScheduleGetJobImpl<TImpl>::Restart()
+{
+    // Rediscover all servers
+    m_ImmediateActions.clear();
+    m_ScheduledActions.clear();
+    NextDiscoveryIteration();
+}
+
+template <class TImpl>
+void CNetScheduleGetJobImpl<TImpl>::MoveToImmediateActions(SNetServerImpl* server_impl)
+{
+    SEntry entry(server_impl->m_ServerInPool->m_Address);
+
+    TTimeline::iterator i = find(m_ScheduledActions.begin(),
+            m_ScheduledActions.end(), entry);
+
+    // Server was postponed, move to immediate
+    if (i != m_ScheduledActions.end()) {
+        m_ImmediateActions.splice(m_ImmediateActions.end(),
+                m_ScheduledActions, i);
+        return;
+    }
+
+    TTimeline::iterator j = find(m_ImmediateActions.begin(),
+            m_ImmediateActions.end(), entry);
+
+    // It's new server, add to immediate
+    if (j == m_ImmediateActions.end()) {
+        m_ImmediateActions.push_back(entry);
+    }
+}
+
+template <class TImpl>
+void CNetScheduleGetJobImpl<TImpl>::NextDiscoveryIteration()
+{
+    TServers servers;
+
+    for (CNetServiceIterator it =
+            m_Impl.m_API.GetService().Iterate(
+                CNetService::eIncludePenalized); it; ++it) {
+        servers.push_back((*it)->m_ServerInPool->m_Address);
+    }
+
+    // Keep up to date servers
+    Filter(m_ImmediateActions, servers);
+    Filter(m_ScheduledActions, servers);
+
+    // Add newly discovered servers
+    for (TServers::const_iterator i = servers.begin();
+            i != servers.end(); ++i) {
+        m_ImmediateActions.push_back(*i);
+    }
+
+    // Reschedule discovery after timeout
+    m_DiscoveryAction.deadline = CDeadline(m_Impl.m_Timeout, 0);
+    m_ScheduledActions.push_back(m_DiscoveryAction);
+}
+
+template <class TImpl>
+void CNetScheduleGetJobImpl<TImpl>::ReturnNotFullyCheckedServers()
+{
+    // Return back to immediate actions
+    // all servers that have not been checked for all possible affinities
+    TIterator i = m_ScheduledActions.begin();
+
+    while (i != m_ScheduledActions.end()) {
+        if (i->all_affinities) {
+            ++i;
+        } else {
+            m_ImmediateActions.splice(m_ImmediateActions.end(),
+                    m_ScheduledActions, i++);
+        } 
+    }
+}
+
+
+template class CNetScheduleGetJobImpl<CMainLoopThread::CImpl>;
+template class CNetScheduleGetJobImpl<SNetScheduleJobReaderImpl::CImpl>;
+
+
+END_NCBI_SCOPE
diff --git a/c++/src/connect/services/netschedule_api_getjob.hpp b/c++/src/connect/services/netschedule_api_getjob.hpp
new file mode 100644
index 0000000..13e68e7
--- /dev/null
+++ b/c++/src/connect/services/netschedule_api_getjob.hpp
@@ -0,0 +1,128 @@
+#ifndef CONN_SERVICES___NETSCHEDULE_API_GETJOB__HPP
+#define CONN_SERVICES___NETSCHEDULE_API_GETJOB__HPP
+
+/*  $Id: netschedule_api_getjob.hpp 476303 2015-08-17 19:03:16Z sadyrovr $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors: Rafael Sadyrov
+ *
+ * File Description:
+ *   NetSchedule API get/read job implementation.
+ *
+ */
+
+#include <connect/services/netschedule_api.hpp>
+
+#include <vector>
+#include <list>
+
+
+BEGIN_NCBI_SCOPE
+
+
+// A namespace-like class
+struct CNetScheduleGetJob
+{
+    // Vector of priority-ordered pairs of affinities and
+    // corresponding priority-ordered comma-separated affinity lists.
+    // E.g., for "a, b, c" it would be:
+    // { "a", "a"       },
+    // { "b", "a, b"    },
+    // { "c", "a, b, c" }
+    typedef vector<pair<string, string> > TAffinityLadder;
+
+    enum EState {
+        eWorking,
+        eRestarted,
+        eStopped
+    };
+
+    enum EResult {
+        eJob,
+        eAgain,
+        eInterrupt,
+        eNoJobs
+    };
+
+    struct SEntry
+    {
+        SServerAddress server_address;
+        CDeadline deadline;
+        bool all_affinities;
+        bool more_jobs;
+
+        SEntry(const SServerAddress& a, bool j = true) :
+            server_address(a),
+            deadline(0, 0),
+            all_affinities(true),
+            more_jobs(j)
+        {
+        }
+
+        bool operator==(const SEntry& rhs) const
+        {
+            return server_address == rhs.server_address;
+        }
+    };
+};
+
+template <class TImpl>
+class CNetScheduleGetJobImpl : public CNetScheduleGetJob
+{
+public:
+    CNetScheduleGetJobImpl(TImpl& impl) :
+        m_Impl(impl),
+        m_DiscoveryAction(SServerAddress(0, 0), false)
+    {
+        m_ImmediateActions.push_back(m_DiscoveryAction);
+    }
+
+    CNetScheduleGetJob::EResult GetJob(
+            const CDeadline& deadline,
+            CNetScheduleJob& job,
+            CNetScheduleAPI::EJobStatus* job_status);
+
+private:
+    template <class TJobHolder>
+    EResult GetJobImmediately(TJobHolder& holder);
+
+    template <class TJobHolder>
+    EResult GetJobImpl(const CDeadline& deadline, TJobHolder& holder);
+
+    void Restart();
+    void MoveToImmediateActions(SNetServerImpl* server_impl);
+    void NextDiscoveryIteration();
+    void ReturnNotFullyCheckedServers();
+
+    TImpl& m_Impl;
+    list<SEntry> m_ImmediateActions, m_ScheduledActions;
+    SEntry m_DiscoveryAction;
+};
+
+
+END_NCBI_SCOPE
+
+
+#endif  /* CONN_SERVICES___NETSCHEDULE_API_GETJOB__HPP */
diff --git a/c++/src/connect/services/netschedule_api_impl.hpp b/c++/src/connect/services/netschedule_api_impl.hpp
index 49e3197..52e37db 100644
--- a/c++/src/connect/services/netschedule_api_impl.hpp
+++ b/c++/src/connect/services/netschedule_api_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef CONN_SERVICES___NETSCHEDULE_API_IMPL__HPP
 #define CONN_SERVICES___NETSCHEDULE_API_IMPL__HPP
 
-/*  $Id: netschedule_api_impl.hpp 470759 2015-06-18 17:19:51Z ivanov $
+/*  $Id: netschedule_api_impl.hpp 498273 2016-04-14 17:59:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,11 +34,17 @@
  */
 
 #include "netservice_api_impl.hpp"
-#include "timeline.hpp"
+#include "netschedule_api_getjob.hpp"
+
+#include <corelib/request_ctx.hpp>
 
 #include <connect/services/netschedule_api.hpp>
 #include <connect/services/error_codes.hpp>
 
+#include <list>
+#include <map>
+#include <vector>
+
 
 BEGIN_NCBI_SCOPE
 
@@ -48,6 +54,36 @@ BEGIN_NCBI_SCOPE
 
 #define SERVER_PARAMS_ASK_MAX_COUNT 100
 
+inline
+void g_AppendHitID(string& cmd, const string& sub_hit_id =
+        CDiagContext::GetRequestContext().GetCurrentSubHitID())
+{
+    cmd += " ncbi_phid=\"";
+    cmd += sub_hit_id;
+    cmd += '"';
+}
+
+inline
+bool g_AppendClientIPAndSessionID(string& cmd,
+    const CRequestContext& req = CDiagContext::GetRequestContext())
+{
+    if (req.IsSetClientIP()) {
+        cmd += " ip=\"";
+        cmd += req.GetClientIP();
+        cmd += '"';
+    }
+
+    if (req.IsSetSessionID()) {
+        cmd += " sid=\"";
+        cmd += NStr::PrintableString(req.GetSessionID());
+        cmd += '"';
+        return true;
+    }
+
+    return false;
+}
+
+
 bool g_ParseGetJobResponse(CNetScheduleJob& job, const string& response);
 
 inline string g_MakeBaseCmd(const string& cmd_name, const string& job_key)
@@ -65,45 +101,69 @@ struct SNetScheduleServerProperties : public INetServerProperties
     {
     }
 
-    CFastMutex m_Mutex;
-
     string ns_node;
     string ns_session;
 
+    // Warning:
+    // Version is not set until we execute a command on a server.
+    // Therefore, if that command is version dependent,
+    // old version of the command will be sent to the server at first.
+    CVersionInfo version;
+
     bool affs_synced;
 };
 
-// A namespace-like helper class to load configuration from NetSchedule server
 class CNetScheduleConfigLoader
 {
+    class CErrorSuppressor;
+
 public:
-    enum EParseMode {
-        eDefault,
-        eGetQueueName
-    };
+    CNetScheduleConfigLoader(
+            const CTempString& prefix,
+            const CTempString& section);
 
-    static bool Use(CConfig* config, const string& section)
-    {
-        return config && config->GetBool(section, "load_config_from_ns",
-                CConfig::eErr_NoThrow, false);
-    }
+    CConfig* Get(SNetScheduleAPIImpl* impl, CConfig* config, string& section);
 
-    static CConfig* Get(const CTempString* literals, SNetScheduleAPIImpl* impl,
-            string* section, EParseMode mode = eDefault);
+protected:
+    virtual bool Transform(const CTempString& prefix, string& name);
 
 private:
     typedef CNetScheduleAPI::TQueueParams TParams;
+    CConfig* Parse(const TParams& params, const CTempString& prefix);
+
+    const CTempString m_Prefix;
+    const CTempString m_Section;
+};
+
+class CNetScheduleOwnConfigLoader : public CNetScheduleConfigLoader
+{
+public:
+    CNetScheduleOwnConfigLoader();
 
-    static CConfig* Parse(const TParams& params, const CTempString& prefix,
-            EParseMode mode);
+protected:
+    bool Transform(const CTempString& prefix, string& name);
 };
 
 class CNetScheduleServerListener : public INetServerConnectionListener
 {
+private:
+    enum EMode {
+        fWnCompatible       = (0 << 0),
+        fNonWnCompatible    = (1 << 0),
+        fConfigLoading      = (1 << 1) | fNonWnCompatible,
+    };
+    typedef int TMode;
+
 public:
     CNetScheduleServerListener() :
         m_ClientType(CNetScheduleAPI::eCT_Auto),
-        m_WorkerNodeCompatMode(false)
+        m_Mode(fConfigLoading)
+    {
+    }
+
+    CNetScheduleServerListener(bool wn_compatible) :
+        m_ClientType(CNetScheduleAPI::eCT_Auto),
+        m_Mode(wn_compatible ? fWnCompatible : fNonWnCompatible)
     {
     }
 
@@ -112,7 +172,7 @@ public:
     bool NeedToSubmitAffinities(SNetServerImpl* server_impl);
     void SetAffinitiesSynced(SNetServerImpl* server_impl, bool affs_synced);
 
-    CRef<SNetScheduleServerProperties> x_GetServerProperties(
+    static CRef<SNetScheduleServerProperties> x_GetServerProperties(
             SNetServerImpl* server_impl);
 
     virtual CRef<INetServerProperties> AllocServerProperties();
@@ -135,12 +195,11 @@ public:
     CFastMutex m_AffinitySubmissionMutex;
 
     CNetScheduleAPI::EClientType m_ClientType;
-    bool m_WorkerNodeCompatMode;
-};
 
-// Node IDs of the servers that are ready
-// (i.e. the servers have sent notifications).
-typedef set<string> TReadyServers;
+private:
+    const TMode m_Mode;
+    string m_Scope;
+};
 
 // Structure that governs NetSchedule server notifications.
 struct SServerNotifications
@@ -176,7 +235,9 @@ private:
     CSemaphore m_NotificationSemaphore;
     // Protection against concurrent access to m_ReadyServers.
     CFastMutex m_Mutex;
-    // A set of NetSchedule node IDs that are ready.
+    // A set of NetSchedule node IDs of the servers that are ready.
+    // (i.e. the servers have sent notifications).
+    typedef set<string> TReadyServers;
     TReadyServers m_ReadyServers;
     // This flag is set when the wait must be interrupted.
     bool m_Interrupted;
@@ -201,7 +262,7 @@ struct SNetScheduleNotificationThread : public CThread
 
     void PrintPortNumber();
 
-    void CmdAppendPortAndTimeout(string* cmd, const CDeadline& deadline);
+    void CmdAppendPortAndTimeout(string* cmd, unsigned remaining_seconds);
 
     SNetScheduleAPIImpl* m_API;
 
@@ -223,6 +284,9 @@ struct SNetScheduleAPIImpl : public CObject
         const string& service_name, const string& client_name,
         const string& queue_name);
 
+    SNetScheduleAPIImpl(const string& service_name, const string& client_name,
+        const string& queue_name, bool wn_compatible);
+
     // Special constructor for CNetScheduleAPI::GetServer().
     SNetScheduleAPIImpl(SNetServerInPool* server, SNetScheduleAPIImpl* parent);
 
@@ -294,6 +358,11 @@ struct SNetScheduleAPIImpl : public CObject
     // maintain job affinity for the client.
     void x_ClearNode();
 
+    void UpdateAuthString();
+    void UseOldStyleAuth();
+    void SetAuthParam(const string& param_name, const string& param_value);
+    CCompoundIDPool GetCompoundIDPool() { return m_CompoundIDPool; }
+
     CNetService m_Service;
 
     string m_Queue;
@@ -310,9 +379,11 @@ struct SNetScheduleAPIImpl : public CObject
 
     CNetScheduleExecutor::EJobAffinityPreference m_AffinityPreference;
     list<string> m_AffinityList;
-    list<string> m_AffinityLadder;
+
+    CNetScheduleGetJob::TAffinityLadder m_AffinityLadder;
 
     string m_JobGroup;
+    unsigned m_JobTtl;
 
     bool m_UseEmbeddedStorage;
 
@@ -337,7 +408,12 @@ struct SNetScheduleSubmitterImpl : public CObject
         const string& auth_token,
         const string& error_message);
 
+    CNetScheduleAPI::EJobStatus SubmitJobAndWait(CNetScheduleJob& job,
+            unsigned wait_time, time_t* job_exptime = NULL);
+
     CNetScheduleAPI m_API;
+
+    SUseNextSubHitID m_UseNextSubHitID;
 };
 
 inline SNetScheduleSubmitterImpl::SNetScheduleSubmitterImpl(
@@ -371,9 +447,11 @@ struct SNetScheduleExecutorImpl : public CObject
             const string& affinity_list);
     bool x_GetJobWithAffinityLadder(SNetServerImpl* server,
             const CDeadline& timeout,
+            const string& prio_aff_list,
             CNetScheduleJob& job);
 
     void ExecWithOrWithoutRetry(const CNetScheduleJob& job, const string& cmd);
+    void ReturnJob(const CNetScheduleJob& job, bool blacklist = true);
 
     enum EChangeAffAction {
         eAddAffs,
@@ -412,201 +490,68 @@ public:
     SNetScheduleExecutorImpl* m_Executor;
 };
 
-struct SServerTimelineEntry : public CWorkerNodeTimelineEntry
-{
-    const SServerAddress server_address;
-    unsigned discovery_iteration;
-    bool more_jobs;
-
-    // If iteration is zero, then it's either discovery action or search pattern
-    SServerTimelineEntry(const SServerAddress& a, unsigned i = 0) :
-        server_address(a),
-        discovery_iteration(i),
-        more_jobs(i) // It's set to false for special entries (see above)
-    {
-    }
-};
-
-class CServerTimelineEntries
-{
-public:
-    ~CServerTimelineEntries();
-
-    SServerTimelineEntry* GetEntry(SNetServerImpl* server_impl, unsigned iteration);
-
-private:
-    typedef SServerTimelineEntry TEntry;
-
-    struct SLess
-    {
-        bool operator ()(const TEntry* left, const TEntry* right) const
-        {
-            return left->server_address < right->server_address;
-        }
-    };
-
-    typedef set<TEntry*, SLess> TTimelineEntries;
-    TTimelineEntries m_TimelineEntryByAddress;
-};
-
-class CServerTimeline
-{
-public:
-    typedef CRef<SServerTimelineEntry> TEntryRef;
-
-    CServerTimeline();
-
-    bool HasImmediateActions() const { return !m_ImmediateActions.IsEmpty(); }
-    bool HasScheduledActions() const { return !m_Timeline.IsEmpty(); }
-
-    void CheckScheduledActions()
-    {
-        while (!m_Timeline.IsEmpty() && m_Timeline.GetHead()->TimeHasCome()) {
-            m_Timeline.MoveHeadTo(&m_ImmediateActions);
-        }
-    }
-
-    const CDeadline GetNextTimeout() const
-    {
-        return m_Timeline.GetHead()->GetTimeout();
-    }
-
-    TEntryRef PullImmediateAction()
-    {
-        TEntryRef entry;
-        m_ImmediateActions.Shift(entry);
-        return entry;
-    }
-
-    TEntryRef PullScheduledAction()
-    {
-        TEntryRef entry;
-        m_Timeline.Shift(entry);
-        return entry;
-    }
-
-    bool IsDiscoveryAction(TEntryRef entry) const
-    {
-        return !entry->discovery_iteration;
-    }
-
-    bool IsOutdatedAction(TEntryRef entry) const
-    {
-        return entry->discovery_iteration != m_DiscoveryIteration;
-    }
-
-    void MoveToImmediateActions(SNetServerImpl* server_impl)
-    {
-        m_ServerTimeline.GetEntry(server_impl, m_DiscoveryIteration)->
-            MoveTo(&m_ImmediateActions);
-    }
-
-    void PushImmediateAction(TEntryRef entry)
-    {
-        m_ImmediateActions.Push(entry);
-    }
-
-    void PushScheduledAction(TEntryRef entry)
-    {
-        m_Timeline.Push(entry);
-    }
-
-    CNetServer GetServer(CNetScheduleAPI api, TEntryRef entry)
-    {
-        return api.GetService().GetServer(entry->server_address);
-    }
-
-    void NextDiscoveryIteration(CNetScheduleAPI api)
-    {
-        ++m_DiscoveryIteration;
-
-        for (CNetServiceIterator it =
-                api.GetService().Iterate(
-                    CNetService::eIncludePenalized); it; ++it) {
-            SServerTimelineEntry* srv_entry = m_ServerTimeline.GetEntry(*it,
-                    m_DiscoveryIteration);
-            srv_entry->discovery_iteration = m_DiscoveryIteration;
-            if (!srv_entry->IsInTimeline())
-                m_ImmediateActions.Push(srv_entry);
-        }
-    }
-
-    bool MoreJobs() const
-    {
-        for (TEntryRef entry = m_Timeline.GetHead();
-                entry;
-                entry = m_Timeline.GetNext(entry)) {
-            if (entry->more_jobs && !IsOutdatedAction(entry)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    void Suspend(unsigned timeout)
-    {
-        m_ImmediateActions.Clear();
-        m_Timeline.Clear();
-        m_DiscoveryAction->ResetTimeout(timeout);
-        m_Timeline.Push(m_DiscoveryAction);
-    }
-
-    void Resume()
-    {
-        m_DiscoveryAction->MoveTo(&m_ImmediateActions);
-    }
-
-private:
-    CServerTimelineEntries m_ServerTimeline;
-
-    typedef CWorkerNodeTimeline<SServerTimelineEntry, TEntryRef> TTimeline;
-    TTimeline m_ImmediateActions, m_Timeline;
-
-    unsigned m_DiscoveryIteration;
-    TEntryRef m_DiscoveryAction;
-};
+const unsigned s_Timeout = 10;
 
 struct SNetScheduleJobReaderImpl : public CObject
 {
     SNetScheduleJobReaderImpl(CNetScheduleAPI::TInstance ns_api_impl,
             const string& group, const string& affinity) :
-        m_API(ns_api_impl),
-        m_JobGroup(group),
-        m_Affinity(affinity)
+        m_Impl(ns_api_impl, group, affinity),
+        m_Timeline(m_Impl)
     {
-        SNetScheduleAPIImpl::VerifyJobGroupAlphabet(group);
-        SNetScheduleAPIImpl::VerifyAffinityAlphabet(affinity);
     }
 
-    CNetScheduleAPI m_API;
-
     void x_StartNotificationThread()
     {
-        m_API->StartNotificationThread();
+        m_Impl.m_API->StartNotificationThread();
     }
 
-    string m_JobGroup;
-    string m_Affinity;
-
-    bool x_ReadJob(SNetServerImpl* server,
-            const CDeadline& timeout,
-            CNetScheduleJob& job,
-            CNetScheduleAPI::EJobStatus* job_status,
-            bool* no_more_jobs);
-    bool x_PerformTimelineAction(CServerTimeline::TEntryRef timeline_entry,
-            CNetScheduleJob& job,
-            CNetScheduleAPI::EJobStatus* job_status,
-            bool* no_more_jobs);
-    void x_ProcessReadJobNotifications();
-
+    void SetJobGroup(const string& group_name);
+    void SetAffinity(const string& affinity);
     CNetScheduleJobReader::EReadNextJobResult ReadNextJob(
         CNetScheduleJob* job,
         CNetScheduleAPI::EJobStatus* job_status,
         const CTimeout* timeout);
+    void InterruptReading();
 
 private:
-    CServerTimeline m_Timeline;
+    class CImpl : public CNetScheduleGetJob
+    {
+    public:
+        CImpl(CNetScheduleAPI::TInstance ns_api_impl,
+                const string& group, const string& affinity) :
+            m_API(ns_api_impl),
+            m_Timeout(s_Timeout),
+            m_JobGroup(group),
+            m_Affinity(affinity),
+            m_MoreJobs(false)
+        {
+            SNetScheduleAPIImpl::VerifyJobGroupAlphabet(group);
+            SNetScheduleAPIImpl::VerifyAffinityAlphabet(affinity);
+        }
+
+        EState CheckState();
+        CNetServer ReadNotifications();
+        CNetServer WaitForNotifications(const CDeadline& deadline);
+        bool MoreJobs(const SEntry& entry);
+        bool CheckEntry(
+                SEntry& entry,
+                const string& prio_aff_list,
+                CNetScheduleJob& job,
+                CNetScheduleAPI::EJobStatus* job_status);
+        void ReturnJob(CNetScheduleJob& job);
+
+        CNetScheduleAPI m_API;
+        const unsigned m_Timeout;
+        string m_JobGroup;
+        string m_Affinity;
+
+    private:
+        bool m_MoreJobs;
+    };
+
+    CImpl m_Impl;
+    CNetScheduleGetJobImpl<CImpl> m_Timeline;
 };
 
 struct SNetScheduleAdminImpl : public CObject
@@ -616,8 +561,6 @@ struct SNetScheduleAdminImpl : public CObject
     {
     }
 
-    typedef map<pair<string, unsigned int>, string> TIDsMap;
-
     CNetScheduleAPI m_API;
 };
 
diff --git a/c++/src/connect/services/netschedule_api_reader.cpp b/c++/src/connect/services/netschedule_api_reader.cpp
index c36082d..63be99e 100644
--- a/c++/src/connect/services/netschedule_api_reader.cpp
+++ b/c++/src/connect/services/netschedule_api_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netschedule_api_reader.cpp 470760 2015-06-18 17:20:09Z ivanov $
+/*  $Id: netschedule_api_reader.cpp 492591 2016-02-18 19:23:34Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -36,56 +36,8 @@
 
 #define NCBI_USE_ERRCODE_X   ConnServ_NetSchedule
 
-#define READJOB_TIMEOUT 10
-
 BEGIN_NCBI_SCOPE
 
-void CNetScheduleJobReader::SetJobGroup(const string& group_name)
-{
-    SNetScheduleAPIImpl::VerifyJobGroupAlphabet(group_name);
-    m_Impl->m_JobGroup = group_name;
-}
-
-void CNetScheduleJobReader::SetAffinity(const string& affinity)
-{
-    SNetScheduleAPIImpl::VerifyAffinityAlphabet(affinity);
-    m_Impl->m_Affinity = affinity;
-}
-
-CServerTimelineEntries::TEntry*
-CServerTimelineEntries::GetEntry(SNetServerImpl* server_impl, unsigned iteration)
-{
-    const SServerAddress search_address(server_impl->m_ServerInPool->m_Address);
-    TEntry search_pattern(search_address);
-
-    TTimelineEntries::iterator it(
-            m_TimelineEntryByAddress.find(&search_pattern));
-
-    if (it != m_TimelineEntryByAddress.end())
-        return *it;
-
-    TEntry* new_entry = new TEntry(search_address, iteration);
-
-    m_TimelineEntryByAddress.insert(new_entry);
-    new_entry->AddReference();
-
-    return new_entry;
-}
-
-CServerTimelineEntries::~CServerTimelineEntries()
-{
-    ITERATE(TTimelineEntries, it, m_TimelineEntryByAddress) {
-        (*it)->RemoveReference();
-    }
-}
-
-CServerTimeline::CServerTimeline() :
-    m_DiscoveryIteration(1),
-    m_DiscoveryAction(new SServerTimelineEntry(SServerAddress(0, 0)))
-{
-    m_ImmediateActions.Push(m_DiscoveryAction);
-}
-
 // True if a job is returned.
 static bool s_ParseReadJobResponse(const string& response,
         CNetScheduleJob& job,
@@ -147,21 +99,30 @@ static bool s_ParseReadJobResponse(const string& response,
     return job_fields == (1 << eNumberOfRequiredFields) - 1;
 }
 
-bool SNetScheduleJobReaderImpl::x_ReadJob(SNetServerImpl* server,
-        const CDeadline& timeout, CNetScheduleJob& job,
-        CNetScheduleAPI::EJobStatus* job_status,
-        bool* no_more_jobs)
+bool SNetScheduleJobReaderImpl::CImpl::CheckEntry(
+        SEntry& entry,
+        const string& prio_aff_list,
+        CNetScheduleJob& job,
+        CNetScheduleAPI::EJobStatus* job_status)
 {
+    CNetServer server(m_API.GetService()->GetServer(entry.server_address));
+    bool no_more_jobs = true;
+
     string cmd("READ2 reader_aff=0 ");
+    bool prioritized_aff = false;
 
-    if (m_Affinity.empty())
-        cmd.append("any_aff=1");
-    else {
+    if (!m_Affinity.empty()) {
         cmd.append("any_aff=0 aff=");
         cmd.append(m_Affinity);
+    } else if (!prio_aff_list.empty()) {
+        prioritized_aff = true;
+        cmd.append("any_aff=0 aff=");
+        cmd.append(prio_aff_list);
+    } else {
+        cmd.append("any_aff=1");
     }
 
-    m_API->m_NotificationThread->CmdAppendPortAndTimeout(&cmd, timeout);
+    m_API->m_NotificationThread->CmdAppendPortAndTimeout(&cmd, m_Timeout);
 
     if (!m_JobGroup.empty()) {
         cmd.append(" group=");
@@ -170,75 +131,97 @@ bool SNetScheduleJobReaderImpl::x_ReadJob(SNetServerImpl* server,
 
     g_AppendClientIPSessionIDHitID(cmd);
 
+    if (prioritized_aff) {
+        cmd.append(" prioritized_aff=1");
+    }
+
     CNetServer::SExecResult exec_result;
 
     server->ConnectAndExec(cmd, false, exec_result);
 
-    return s_ParseReadJobResponse(exec_result.response, job,
-            job_status, no_more_jobs);
+    bool ret = s_ParseReadJobResponse(exec_result.response, job,
+            job_status, &no_more_jobs);
+
+    if (!no_more_jobs)
+        m_MoreJobs = true;
+
+    // Cache the result for the server,
+    // so we don't need to ask the server again about matching jobs
+    // while waiting for its notifications
+    entry.more_jobs = !no_more_jobs;
+
+    return ret;
 }
 
-bool SNetScheduleJobReaderImpl::x_PerformTimelineAction(
-        CServerTimeline::TEntryRef timeline_entry,
-        CNetScheduleJob& job,
-        CNetScheduleAPI::EJobStatus* job_status,
-        bool* no_more_jobs)
+void SNetScheduleJobReaderImpl::CImpl::ReturnJob(CNetScheduleJob& job)
 {
-    _ASSERT(no_more_jobs);
-    *no_more_jobs = true;
-
-    if (m_Timeline.IsDiscoveryAction(timeline_entry)) {
-        m_Timeline.NextDiscoveryIteration(m_API);
+    string cmd = "RDRB job_key=";
+    cmd += job.job_id;
+    cmd += " auth_token=";
+    cmd += job.auth_token;
+    cmd += " blacklist=0";
 
-        timeline_entry->ResetTimeout(READJOB_TIMEOUT);
-        m_Timeline.PushScheduledAction(timeline_entry);
-        return false;
-    }
+    g_AppendClientIPSessionIDHitID(cmd);
 
-    // Skip servers that disappeared from LBSM.
-    if (m_Timeline.IsOutdatedAction(timeline_entry))
-        return false;
+    m_API->GetServer(job.job_id).ExecWithRetry(cmd, false);
+}
 
-    CNetServer server(m_Timeline.GetServer(m_API, timeline_entry));
-    timeline_entry->ResetTimeout(READJOB_TIMEOUT);
-
-    try {
-        if (x_ReadJob(server, READJOB_TIMEOUT,
-                job, job_status, no_more_jobs)) {
-            // A job has been returned; add the server to
-            // immediate actions because there can be more
-            // jobs in the queue.
-            m_Timeline.PushImmediateAction(timeline_entry);
-            return true;
-        } else {
-            // Cache the result for the server,
-            // so we don't need to ask the server again about matching jobs
-            // while waiting for its notifications
-            timeline_entry->more_jobs = !*no_more_jobs;
-
-            // No job has been returned by this server;
-            // query the server later.
-            m_Timeline.PushScheduledAction(timeline_entry);
-            return false;
-        }
-    }
-    catch (CNetSrvConnException& e) {
-        // Because a connection error has occurred, do not
-        // put this server back to the timeline.
-        LOG_POST(Warning << e.GetMsg());
-        return false;
+CNetServer SNetScheduleJobReaderImpl::CImpl::WaitForNotifications(const CDeadline& deadline)
+{
+    if (m_API->m_NotificationThread->m_ReadNotifications.Wait(deadline)) {
+        return ReadNotifications();
     }
+
+    return CNetServer();
 }
 
-void SNetScheduleJobReaderImpl::x_ProcessReadJobNotifications()
+CNetServer SNetScheduleJobReaderImpl::CImpl::ReadNotifications()
 {
     string ns_node;
     CNetServer server;
 
-    while (m_API->m_NotificationThread->m_ReadNotifications.GetNextNotification(
+    if (m_API->m_NotificationThread->m_ReadNotifications.GetNextNotification(
                 &ns_node))
-        if (m_API->GetServerByNode(ns_node, &server))
-            m_Timeline.MoveToImmediateActions(server);
+        m_API->GetServerByNode(ns_node, &server);
+
+    return server;
+}
+
+CNetScheduleGetJob::EState SNetScheduleJobReaderImpl::CImpl::CheckState()
+{
+    return eWorking;
+}
+
+bool SNetScheduleJobReaderImpl::CImpl::MoreJobs(const SEntry& entry)
+{
+    if (m_MoreJobs) {
+        m_MoreJobs = false;
+        return true;
+    }
+
+    return entry.more_jobs;
+}
+
+void SNetScheduleJobReaderImpl::SetJobGroup(const string& group_name)
+{
+    if (m_Impl.m_JobGroup.empty()) {
+        SNetScheduleAPIImpl::VerifyJobGroupAlphabet(group_name);
+        m_Impl.m_JobGroup = group_name;
+    } else {
+        NCBI_THROW(CNetScheduleException, eInvalidParameter,
+                "It's not allowed to change group");
+    }
+}
+
+void SNetScheduleJobReaderImpl::SetAffinity(const string& affinity)
+{
+    if (m_Impl.m_Affinity.empty()) {
+        SNetScheduleAPIImpl::VerifyAffinityAlphabet(affinity);
+        m_Impl.m_Affinity = affinity;
+    } else {
+        NCBI_THROW(CNetScheduleException, eInvalidParameter,
+                "It's not allowed to change affinity");
+    }
 }
 
 CNetScheduleJobReader::EReadNextJobResult SNetScheduleJobReaderImpl::ReadNextJob(
@@ -246,54 +229,42 @@ CNetScheduleJobReader::EReadNextJobResult SNetScheduleJobReaderImpl::ReadNextJob
         CNetScheduleAPI::EJobStatus* job_status,
         const CTimeout* timeout)
 {
+    _ASSERT(job);
+
     x_StartNotificationThread();
-    CDeadline deadline(timeout ? *timeout : CTimeout());
+    CDeadline deadline(timeout ? *timeout : CTimeout(0, 0));
 
-    bool no_more_jobs;
-    bool matching_job_exists = false;
+    switch (m_Timeline.GetJob(deadline, *job, job_status)) {
+    case CNetScheduleGetJob::eJob:
+        return CNetScheduleJobReader::eRNJ_JobReady;
 
-    for (;;) {
-        while (m_Timeline.HasImmediateActions()) {
-            if (x_PerformTimelineAction(m_Timeline.PullImmediateAction(),
-                    *job, job_status, &no_more_jobs))
-                return CNetScheduleJobReader::eRNJ_JobReady;
+    case CNetScheduleGetJob::eAgain:
+        return CNetScheduleJobReader::eRNJ_NotReady;
 
-            if (!no_more_jobs)
-                matching_job_exists = true;
+    case CNetScheduleGetJob::eInterrupt:
+        return CNetScheduleJobReader::eRNJ_Interrupt;
 
-            m_Timeline.CheckScheduledActions();
+    default /* CNetScheduleGetJob::eNoJobs */:
+        return CNetScheduleJobReader::eRNJ_NoMoreJobs;
+    }
+}
 
-            // Check if there's a notification in the UDP socket.
-            x_ProcessReadJobNotifications();
-        }
+void SNetScheduleJobReaderImpl::InterruptReading()
+{
+    x_StartNotificationThread();
+    m_Impl.m_API->m_NotificationThread->m_ReadNotifications.InterruptWait();
+}
 
-        // All servers returned 'no_more_jobs'.
-        if (!matching_job_exists && !m_Timeline.MoreJobs())
-            return CNetScheduleJobReader::eRNJ_NoMoreJobs;
-
-        // FIXME Check for interrupt
-        // if (CGridGlobals::GetInstance().IsShuttingDown())
-            // return eRNJ_Interrupt;
-
-        if (timeout == NULL || deadline.GetRemainingTime().IsZero())
-            return CNetScheduleJobReader::eRNJ_NotReady;
-
-        // There's still time. Wait for notifications and query the servers.
-        if (m_Timeline.HasScheduledActions()) {
-            const CDeadline next_event_time = m_Timeline.GetNextTimeout();
-            if (deadline < next_event_time) {
-                if (!m_API->m_NotificationThread->
-                        m_ReadNotifications.Wait(deadline))
-                    return CNetScheduleJobReader::eRNJ_NotReady;
-                x_ProcessReadJobNotifications();
-            } else if (m_API->m_NotificationThread->
-                    m_ReadNotifications.Wait(next_event_time))
-                x_ProcessReadJobNotifications();
-            else if (x_PerformTimelineAction(m_Timeline.PullScheduledAction(),
-                    *job, job_status, &no_more_jobs))
-                return CNetScheduleJobReader::eRNJ_JobReady;
-        }
-    }
+void CNetScheduleJobReader::SetJobGroup(const string& group_name)
+{
+    _ASSERT(m_Impl);
+    m_Impl->SetJobGroup(group_name);
+}
+
+void CNetScheduleJobReader::SetAffinity(const string& affinity)
+{
+    _ASSERT(m_Impl);
+    m_Impl->SetAffinity(affinity);
 }
 
 CNetScheduleJobReader::EReadNextJobResult CNetScheduleJobReader::ReadNextJob(
@@ -307,9 +278,8 @@ CNetScheduleJobReader::EReadNextJobResult CNetScheduleJobReader::ReadNextJob(
 
 void CNetScheduleJobReader::InterruptReading()
 {
-    m_Impl->x_StartNotificationThread();
-
-    m_Impl->m_API->m_NotificationThread->m_ReadNotifications.InterruptWait();
+    _ASSERT(m_Impl);
+    m_Impl->InterruptReading();
 }
 
 END_NCBI_SCOPE
diff --git a/c++/src/connect/services/netschedule_api_submitter.cpp b/c++/src/connect/services/netschedule_api_submitter.cpp
index f589be2..cbe974a 100644
--- a/c++/src/connect/services/netschedule_api_submitter.cpp
+++ b/c++/src/connect/services/netschedule_api_submitter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netschedule_api_submitter.cpp 468672 2015-05-27 15:06:02Z sadyrovr $
+/*  $Id: netschedule_api_submitter.cpp 492602 2016-02-18 19:27:34Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -38,6 +38,7 @@
 #include <connect/services/util.hpp>
 
 #include <stdio.h>
+#include <cmath>
 
 BEGIN_NCBI_SCOPE
 
@@ -96,7 +97,8 @@ string SNetScheduleSubmitterImpl::SubmitJobImpl(CNetScheduleJob& job,
 
     s_SerializeJob(cmd, job, udp_port, wait_time);
 
-    g_AppendClientIPAndSessionID(cmd);
+    CRequestContext& req = CDiagContext::GetRequestContext();
+    g_AppendClientIPAndSessionID(cmd, req);
 
     if (!job.group.empty()) {
         SNetScheduleAPIImpl::VerifyJobGroupAlphabet(job.group);
@@ -104,7 +106,9 @@ string SNetScheduleSubmitterImpl::SubmitJobImpl(CNetScheduleJob& job,
         cmd.append(job.group);
     }
 
-    g_AppendHitID(cmd);
+    m_UseNextSubHitID.ProperCommand();
+    g_AppendHitID(cmd, m_UseNextSubHitID ?
+            req.GetNextSubHitID() : req.GetCurrentSubHitID());
 
     CNetServer::SExecResult exec_result(
             m_API->m_Service.FindServerAndExec(cmd, false));
@@ -134,7 +138,8 @@ void CNetScheduleSubmitter::SubmitJobBatch(vector<CNetScheduleJob>& jobs,
     // Batch submit command.
     string cmd = "BSUB";
 
-    g_AppendClientIPAndSessionID(cmd);
+    CRequestContext& req = CDiagContext::GetRequestContext();
+    g_AppendClientIPAndSessionID(cmd, req);
 
     if (!job_group.empty()) {
         SNetScheduleAPIImpl::VerifyJobGroupAlphabet(job_group);
@@ -142,7 +147,9 @@ void CNetScheduleSubmitter::SubmitJobBatch(vector<CNetScheduleJob>& jobs,
         cmd.append(job_group);
     }
 
-    g_AppendHitID(cmd);
+    m_Impl->m_UseNextSubHitID.ProperCommand();
+    g_AppendHitID(cmd, m_Impl->m_UseNextSubHitID ?
+            req.GetNextSubHitID() : req.GetCurrentSubHitID());
 
     CNetServer::SExecResult exec_result(
         m_Impl->m_API->m_Service.FindServerAndExec(cmd, false));
@@ -398,21 +405,42 @@ CNetScheduleAPI::EJobStatus
 CNetScheduleSubmitter::SubmitJobAndWait(CNetScheduleJob& job,
                                         unsigned       wait_time)
 {
+    return m_Impl->SubmitJobAndWait(job, wait_time);
+}
+
+CNetScheduleAPI::EJobStatus
+SNetScheduleSubmitterImpl::SubmitJobAndWait(CNetScheduleJob& job,
+        unsigned wait_time, time_t* job_exptime)
+{
     CDeadline deadline(wait_time, 0);
 
     CNetScheduleNotificationHandler submit_job_handler;
 
-    submit_job_handler.SubmitJob(m_Impl, job, wait_time);
+    submit_job_handler.SubmitJob(this, job, wait_time);
 
     return submit_job_handler.WaitForJobCompletion(job,
-                                                   deadline, m_Impl->m_API);
+            deadline, m_API, job_exptime);
+}
+
+CNetScheduleAPI::EJobStatus
+CNetScheduleSubmitter::WaitForJob(const string& job_id, unsigned wait_time)
+{
+    const CNetScheduleNotificationHandler::TJobStatusMask wait_for_statuses =
+        CNetScheduleNotificationHandler::fJSM_Canceled |
+        CNetScheduleNotificationHandler::fJSM_Failed |
+        CNetScheduleNotificationHandler::fJSM_Done;
+
+    CDeadline deadline(wait_time);
+    return CNetScheduleNotificationHandler().WaitForJobEvent(job_id,
+            deadline, m_Impl->m_API, wait_for_statuses);
 }
 
 CNetScheduleAPI::EJobStatus
 CNetScheduleNotificationHandler::WaitForJobCompletion(
         CNetScheduleJob& job,
         CDeadline& deadline,
-        CNetScheduleAPI ns_api)
+        CNetScheduleAPI ns_api,
+        time_t* job_exptime)
 {
     CNetScheduleAPI::EJobStatus status = CNetScheduleAPI::ePending;
 
@@ -431,13 +459,13 @@ CNetScheduleNotificationHandler::WaitForJobCompletion(
             if (CheckJobStatusNotification(job.job_id, &status) &&
                     status != CNetScheduleAPI::eRunning &&
                     status != CNetScheduleAPI::ePending)
-                return ns_api.GetJobDetails(job);
+                return ns_api.GetJobDetails(job, job_exptime);
         } else {
             // The wait has timed out - query the server directly.
 
             string err_msg;
             try {
-                status = ns_api.GetJobDetails(job);
+                status = ns_api.GetJobDetails(job, job_exptime);
                 if ((status != CNetScheduleAPI::eRunning &&
                         status != CNetScheduleAPI::ePending) || last_wait)
                     return status;
@@ -484,12 +512,14 @@ bool CNetScheduleNotificationHandler::RequestJobWatching(
         CNetScheduleAPI::EJobStatus* job_status,
         int* last_event_index)
 {
+    double remaining_seconds = ceil(deadline.GetRemainingTime().GetAsDouble());
+
     string cmd("LISTEN job_key=" + job_id);
 
     cmd += " port=";
     cmd += NStr::NumericToString(GetPort());
     cmd += " timeout=";
-    cmd += NStr::NumericToString(s_GetRemainingSeconds(deadline));
+    cmd += NStr::NumericToString((unsigned)remaining_seconds);
 
     g_AppendClientIPSessionIDHitID(cmd);
 
@@ -555,9 +585,13 @@ CNetScheduleNotificationHandler::WaitForJobEvent(
 
 void CNetScheduleSubmitter::CancelJob(const string& job_key)
 {
-    CNetScheduleJob job;
-    job.job_id = job_key;
-    m_Impl->m_API->x_ExecOnce("CANCEL", job);
+    string cmd(g_MakeBaseCmd("CANCEL", job_key));
+    CRequestContext& req = CDiagContext::GetRequestContext();
+    g_AppendClientIPAndSessionID(cmd, req);
+    g_AppendHitID(cmd, req.GetNextSubHitID());
+
+    CNetServer::SExecResult exec_result;
+    m_Impl->m_API->GetServer(job_key)->ConnectAndExec(cmd, false, exec_result);
 }
 
 void CNetScheduleSubmitter::CancelJobGroup(const string& job_group,
@@ -569,7 +603,9 @@ void CNetScheduleSubmitter::CancelJobGroup(const string& job_group,
         cmd.append(" status=");
         cmd.append(job_statuses);
     }
-    g_AppendClientIPSessionIDHitID(cmd);
+    CRequestContext& req = CDiagContext::GetRequestContext();
+    g_AppendClientIPAndSessionID(cmd, req);
+    g_AppendHitID(cmd, req.GetNextSubHitID());
     m_Impl->m_API->m_Service.ExecOnAllServers(cmd);
 }
 
diff --git a/c++/src/connect/services/netservice_api.cpp b/c++/src/connect/services/netservice_api.cpp
index 67fea06..1fdf3d5 100644
--- a/c++/src/connect/services/netservice_api.cpp
+++ b/c++/src/connect/services/netservice_api.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netservice_api.cpp 477857 2015-09-02 13:15:07Z ivanov $
+/*  $Id: netservice_api.cpp 497256 2016-04-05 15:59:16Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -276,16 +276,13 @@ bool SNetServiceIterator_Weighted::Prev()
     return true;
 }
 
-SNetServerPoolImpl::SNetServerPoolImpl(const string& api_name,
-        const string& client_name,
-        INetServerConnectionListener* listener) :
-    m_APIName(api_name),
-    m_ClientName(client_name),
+SNetServerPoolImpl::SNetServerPoolImpl(INetServerConnectionListener* listener,
+        bool old_style_auth) :
     m_Listener(listener),
     m_EnforcedServer(0, 0),
     m_LBSMAffinityName(kEmptyStr),
     m_LBSMAffinityValue(NULL),
-    m_UseOldStyleAuth(false)
+    m_UseOldStyleAuth(old_style_auth)
 {
 }
 
@@ -422,7 +419,18 @@ void SNetServiceImpl::Init(CObject* api_impl, const string& service_name,
     m_ServiceName = service_name;
     NStr::TruncateSpacesInPlace(m_ServiceName);
 
-    if (CConfig *alt = m_Listener->PreInit(api_impl, config, &section)) {
+    if (config) {
+        m_ClientName = config->GetString(section, "client_name",
+                CConfig::eErr_NoThrow);
+
+        if (m_ClientName.empty()) {
+            m_ClientName = config->GetString(section, "client",
+                    CConfig::eErr_NoThrow);
+        }
+    }
+
+    if (CConfig *alt = m_Listener->OnPreInit(api_impl, config, &section,
+                m_ClientName)) {
         app_reg_config.reset(alt);
         config = alt;
     }
@@ -471,6 +479,17 @@ void SNetServiceImpl::Init(CObject* api_impl, const string& service_name,
         m_ConnectionRetryDelay = (int)s_GetRetryDelay();
     }
 
+    if (m_ClientName.empty() || m_ClientName == "noname" ||
+            NStr::FindNoCase(m_ClientName, "unknown") != NPOS) {
+        CMutexGuard guard(CNcbiApplication::GetInstanceMutex());
+        CNcbiApplication* app = CNcbiApplication::Instance();
+        if (app == NULL) {
+            NCBI_THROW_FMT(CArgException, eNoValue,
+                m_APIName << ": client name is not set");
+        }
+        m_ClientName = app->GetProgramDisplayName();
+    }
+
     m_ServerPool->Init(config, section, m_Listener.GetPointerOrNull());
 
     Construct();
@@ -481,12 +500,6 @@ void SNetServiceImpl::Init(CObject* api_impl, const string& service_name,
 void SNetServerPoolImpl::Init(CConfig* config, const string& section,
         INetServerConnectionListener* listener)
 {
-    _ASSERT(listener);
-
-    if (m_ClientName.empty()) {
-        m_ClientName = listener->GetClientName();
-    }
-
     if (config != NULL) {
         if (m_LBSMAffinityName.empty())
             m_LBSMAffinityName = config->GetString(section,
@@ -598,17 +611,6 @@ void SNetServerPoolImpl::Init(CConfig* config, const string& section,
         m_RebalanceStrategy = CreateDefaultRebalanceStrategy();
     }
 
-    if (m_ClientName.empty() || m_ClientName == "noname" ||
-            NStr::FindNoCase(m_ClientName, "unknown") != NPOS) {
-        CMutexGuard guard(CNcbiApplication::GetInstanceMutex());
-        CNcbiApplication* app = CNcbiApplication::Instance();
-        if (app == NULL) {
-            NCBI_THROW_FMT(CArgException, eNoValue,
-                m_APIName << ": client name is not set");
-        }
-        m_ClientName = app->GetProgramDisplayName();
-    }
-
     // Get affinity value from the local LBSM configuration file.
     if (!m_LBSMAffinityName.empty())
         m_LBSMAffinityValue = LBSMD_GetHostParameter(SERV_LOCALHOST,
@@ -638,7 +640,7 @@ string SNetServiceImpl::MakeAuthString()
     auth.reserve(256);
 
     auth += "client=\"";
-    auth += NStr::PrintableString(m_ServerPool->m_ClientName);
+    auth += NStr::PrintableString(m_ClientName);
     auth += '\"';
 
     if (!m_ServerPool->m_UseOldStyleAuth) {
@@ -660,11 +662,6 @@ string SNetServiceImpl::MakeAuthString()
     return auth;
 }
 
-const string& CNetServerPool::GetClientName() const
-{
-    return m_Impl->m_ClientName;
-}
-
 const string& CNetService::GetServiceName() const
 {
     return m_Impl->m_ServiceName;
@@ -766,19 +763,30 @@ CRef<SNetServerInPool> SNetServerPoolImpl::ReturnServer(
     return CRef<SNetServerInPool>(server_impl);
 }
 
-CNetServer CNetService::GetServer(const SServerAddress& server_address)
+CNetServer SNetServiceImpl::GetServer(const SServerAddress& server_address)
 {
-    m_Impl->m_ServerPool->m_RebalanceStrategy->OnResourceRequested();
+    m_ServerPool->m_RebalanceStrategy->OnResourceRequested();
+
+    CFastMutexGuard server_mutex_lock(m_ServerPool->m_ServerMutex);
 
-    CFastMutexGuard server_mutex_lock(m_Impl->m_ServerPool->m_ServerMutex);
+    SNetServerInPool* server = m_ServerPool->FindOrCreateServerImpl(
+            m_ServerPool->m_EnforcedServer.host == 0 ?
+            server_address : m_ServerPool->m_EnforcedServer);
 
-    SNetServerInPool* server = m_Impl->m_ServerPool->FindOrCreateServerImpl(
-            m_Impl->m_ServerPool->m_EnforcedServer.host == 0 ?
-            server_address : m_Impl->m_ServerPool->m_EnforcedServer);
+    server->m_ServerPool = m_ServerPool;
 
-    server->m_ServerPool = m_Impl->m_ServerPool;
+    return new SNetServerImpl(this, server);
+}
 
-    return new SNetServerImpl(m_Impl, server);
+CNetServer CNetService::GetServer(const string& host,
+        unsigned short port)
+{
+    return m_Impl->GetServer(SServerAddress(host, port));
+}
+
+CNetServer CNetService::GetServer(unsigned host, unsigned short port)
+{
+    return m_Impl->GetServer(SServerAddress(host, port));
 }
 
 class SRandomServiceTraversal : public IServiceTraversal
@@ -807,40 +815,46 @@ CNetServer SRandomServiceTraversal::NextServer()
     return ++m_Iterator ? *m_Iterator : CNetServer();
 }
 
-CNetServer::SExecResult CNetService::FindServerAndExec(const string& cmd,
+CNetServer::SExecResult SNetServiceImpl::FindServerAndExec(const string& cmd,
         bool multiline_output)
 {
-    switch (m_Impl->m_ServiceType) {
+    switch (m_ServiceType) {
     default: // CNetService::eServiceNotDefined
         NCBI_THROW_FMT(CNetSrvConnException, eSrvListEmpty,
-                m_Impl->m_ServerPool->m_APIName << ": command '" << cmd <<
+                m_APIName << ": command '" << cmd <<
                         "' requires a server but none specified");
 
     case CNetService::eLoadBalancedService:
         {
             CNetServer::SExecResult exec_result;
 
-            SRandomServiceTraversal random_traversal(*this);
+            SRandomServiceTraversal random_traversal(this);
 
-            m_Impl->IterateUntilExecOK(cmd, multiline_output,
+            IterateUntilExecOK(cmd, multiline_output,
                     exec_result, &random_traversal,
                     SNetServiceImpl::eIgnoreServerErrors,
-                    m_Impl->m_Listener);
+                    m_Listener);
 
             return exec_result;
         }
 
     case CNetService::eSingleServerService:
         {
-            CNetServer server(new SNetServerImpl(m_Impl,
-                    m_Impl->m_ServerPool->ReturnServer(
-                    m_Impl->m_DiscoveredServers->m_Servers.front().first)));
+            CNetServer server(new SNetServerImpl(this,
+                    m_ServerPool->ReturnServer(
+                    m_DiscoveredServers->m_Servers.front().first)));
 
             return server.ExecWithRetry(cmd, multiline_output);
         }
     }
 }
 
+CNetServer::SExecResult CNetService::FindServerAndExec(const string& cmd,
+        bool multiline_output)
+{
+    return m_Impl->FindServerAndExec(cmd, multiline_output);
+}
+
 void CNetService::ExecOnAllServers(const string& cmd)
 {
     for (CNetServiceIterator it = Iterate(eIncludePenalized); it; ++it)
@@ -851,7 +865,7 @@ void SNetServiceImpl::DiscoverServersIfNeeded()
 {
     if (m_ServiceType == CNetService::eServiceNotDefined) {
         NCBI_THROW_FMT(CNetSrvConnException, eSrvListEmpty,
-            m_ServerPool->m_APIName << ": service name is not set");
+            m_APIName << ": service name is not set");
     }
 
     if (m_ServiceType == CNetService::eLoadBalancedService) {
@@ -1319,11 +1333,23 @@ CNetServiceIterator CNetService::FindServer(INetServerFinder* finder,
     return it;
 }
 
+CNetService CNetService::Clone(const string& name)
+{
+    _ASSERT(m_Impl);
+    return name == m_Impl->m_ServiceName ? m_Impl :
+        new SNetServiceImpl(name, m_Impl);
+}
+
 CNetService SNetServiceMap::GetServiceByName(const string& service_name,
         SNetServiceImpl* prototype)
 {
     CFastMutexGuard guard(m_ServiceMapMutex);
+    return GetServiceByNameImpl(service_name, prototype);
+}
 
+CNetService SNetServiceMap::GetServiceByNameImpl(const string& service_name,
+        SNetServiceImpl* prototype)
+{
     pair<TNetServiceByName::iterator, bool> loc(m_ServiceByName.insert(
             TNetServiceByName::value_type(service_name, CNetService())));
 
@@ -1332,6 +1358,34 @@ CNetService SNetServiceMap::GetServiceByName(const string& service_name,
                     new SNetServiceImpl(service_name, prototype));
 }
 
+bool SNetServiceMap::IsAllowed(const string& service_name) const
+{
+    // Not restricted or found
+    return !m_Restricted || m_Allowed.count(service_name);
+}
+
+bool SNetServiceMap::IsAllowed(CNetServer::TInstance server,
+        SNetServiceImpl* prototype)
+{
+    if (!m_Restricted) return true;
+
+    CFastMutexGuard guard(m_ServiceMapMutex);
+
+    // Check if server belongs to some allowed service
+    for (auto& service_name: m_Allowed) {
+        CNetService service(GetServiceByNameImpl(service_name, prototype));
+
+        if (service->IsInService(server)) return true;
+    }
+
+    return false;
+}
+
+void SNetServiceMap::AddToAllowed(const string& service_name)
+{
+    m_Allowed.insert(service_name);
+}
+
 CJsonNode g_ExecToJson(IExecToJson& exec_to_json, CNetService service,
         CNetService::EServiceType service_type,
         CNetService::EIterationMode iteration_mode)
diff --git a/c++/src/connect/services/netservice_api_impl.hpp b/c++/src/connect/services/netservice_api_impl.hpp
index 6a28d2b..520a1f3 100644
--- a/c++/src/connect/services/netservice_api_impl.hpp
+++ b/c++/src/connect/services/netservice_api_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES___NETSERVICE_API_IMPL__HPP
 #define CONNECT_SERVICES___NETSERVICE_API_IMPL__HPP
 
-/*  $Id: netservice_api_impl.hpp 475261 2015-08-05 19:52:42Z vasilche $
+/*  $Id: netservice_api_impl.hpp 497257 2016-04-05 15:59:52Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -38,6 +38,11 @@
 
 BEGIN_NCBI_SCOPE
 
+#define CONNSERV_THROW_FMT(exception_class, err_code, server, message) \
+    NCBI_THROW(exception_class, err_code, \
+            FORMAT(server->m_ServerInPool->m_Address.AsString() << \
+            ": " << message))
+
 typedef pair<SNetServerInPool*, double> TServerRate;
 typedef vector<TServerRate> TNetServerList;
 typedef map<SServerAddress, SNetServerInPool*> TNetServerByAddress;
@@ -83,8 +88,8 @@ struct SDiscoveredServers : public CObject
 struct NCBI_XCONNECT_EXPORT SNetServerPoolImpl : public CObject
 {
     // Construct a new object.
-    SNetServerPoolImpl(const string& api_name, const string& client_name,
-            INetServerConnectionListener* listener);
+    SNetServerPoolImpl(INetServerConnectionListener* listener,
+            bool old_style_auth);
 
     void Init(CConfig* config, const string& section,
             INetServerConnectionListener* listener);
@@ -96,8 +101,6 @@ struct NCBI_XCONNECT_EXPORT SNetServerPoolImpl : public CObject
 
     virtual ~SNetServerPoolImpl();
 
-    string m_APIName;
-    string m_ClientName;
     CRef<INetServerConnectionListener> m_Listener;
 
     SServerAddress m_EnforcedServer;
@@ -246,13 +249,15 @@ struct NCBI_XCONNECT_EXPORT SNetServiceImpl : public CObject
 {
     // Construct a new object.
     SNetServiceImpl(const string& api_name, const string& client_name,
-            INetServerConnectionListener* listener) :
+            INetServerConnectionListener* listener, bool old_style_auth = false) :
         m_Listener(listener),
-        m_ServerPool(new SNetServerPoolImpl(api_name, client_name, listener)),
+        m_ServerPool(new SNetServerPoolImpl(listener, old_style_auth)),
 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT
         m_ColoNetwork(0),
         m_AllowXSiteConnections(false),
 #endif
+        m_APIName(api_name),
+        m_ClientName(client_name),
         m_UseSmartRetries(true),
         m_ConnectionMaxRetries(-1),
         m_ConnectionRetryDelay(-1)
@@ -269,6 +274,8 @@ struct NCBI_XCONNECT_EXPORT SNetServiceImpl : public CObject
         m_ColoNetwork(prototype->m_ColoNetwork),
         m_AllowXSiteConnections(prototype->m_AllowXSiteConnections),
 #endif
+        m_APIName(prototype->m_APIName),
+        m_ClientName(prototype->m_ClientName),
         m_UseSmartRetries(prototype->m_UseSmartRetries),
         m_ConnectionMaxRetries(prototype->m_ConnectionMaxRetries),
         m_ConnectionRetryDelay(prototype->m_ConnectionRetryDelay)
@@ -284,6 +291,8 @@ struct NCBI_XCONNECT_EXPORT SNetServiceImpl : public CObject
         m_ColoNetwork(prototype->m_ColoNetwork),
         m_AllowXSiteConnections(prototype->m_AllowXSiteConnections),
 #endif
+        m_APIName(prototype->m_APIName),
+        m_ClientName(prototype->m_ClientName),
         m_UseSmartRetries(prototype->m_UseSmartRetries),
         m_ConnectionMaxRetries(prototype->m_ConnectionMaxRetries),
         m_ConnectionRetryDelay(prototype->m_ConnectionRetryDelay)
@@ -303,6 +312,8 @@ struct NCBI_XCONNECT_EXPORT SNetServiceImpl : public CObject
 
     string MakeAuthString();
 
+    CNetServer::SExecResult FindServerAndExec(const string& cmd,
+        bool multiline_output);
     void DiscoverServersIfNeeded();
     void GetDiscoveredServers(CRef<SDiscoveredServers>& discovered_servers);
 
@@ -321,6 +332,9 @@ struct NCBI_XCONNECT_EXPORT SNetServiceImpl : public CObject
         INetServerConnectionListener* conn_listener);
 
     SDiscoveredServers* AllocServerGroup(unsigned discovery_iteration);
+    CNetServer GetServer(const SServerAddress& server_address);
+
+    const string& GetClientName() const { return m_ClientName; }
 
 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT
     void AllowXSiteConnections();
@@ -352,6 +366,10 @@ struct NCBI_XCONNECT_EXPORT SNetServiceImpl : public CObject
     bool m_AllowXSiteConnections;
 #endif
 
+private:
+    string m_APIName;
+    string m_ClientName;
+
     // connection parameters from config
     bool m_UseSmartRetries;
     int m_ConnectionMaxRetries;
@@ -370,6 +388,39 @@ struct SNetServiceMap {
 
     CNetService GetServiceByName(const string& service_name,
             SNetServiceImpl* prototype);
+
+    void Restrict() { m_Restricted = true; }
+    bool IsAllowed(const string& service_name) const;
+    bool IsAllowed(CNetServer::TInstance server, SNetServiceImpl* prototype);
+    void AddToAllowed(const string& service_name);
+
+private:
+    CNetService GetServiceByNameImpl(const string&, SNetServiceImpl*);
+
+    bool m_Restricted = false;
+    set<string, PNocase> m_Allowed;
+};
+
+struct SUseNextSubHitID
+{
+    void ProperCommand() { m_ProperCommand = true; }
+    void DoNot() { m_Allowed = false; }
+
+    operator bool()
+    {
+        if (!m_ProperCommand) return false;
+
+        m_ProperCommand = false;
+
+        if (m_Allowed) return true;
+
+        m_Allowed = true;
+        return false;
+    }
+
+private:
+    bool m_ProperCommand = false;
+    bool m_Allowed = true;
 };
 
 END_NCBI_SCOPE
diff --git a/c++/src/connect/services/netservice_params.cpp b/c++/src/connect/services/netservice_params.cpp
index 9b9bd24..2c591bc 100644
--- a/c++/src/connect/services/netservice_params.cpp
+++ b/c++/src/connect/services/netservice_params.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netservice_params.cpp 447439 2014-09-25 17:52:46Z vakatov $
+/*  $Id: netservice_params.cpp 478064 2015-09-03 16:58:00Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -47,6 +47,7 @@ NCBI_PARAM_DEF(string, netservice_api, communication_timeout,
 NCBI_PARAM_DEF(int, netservice_api, max_find_lbname_retries, 3);
 NCBI_PARAM_DEF(string, netcache_api, fallback_server, "");
 NCBI_PARAM_DEF(int, netservice_api, max_connection_pool_size, 0); // unlimited
+NCBI_PARAM_DEF(bool, netservice_api, connection_data_logging, false);
 NCBI_PARAM_DEF(unsigned, server, max_wait_for_servers, 24 * 60 * 60);
 NCBI_PARAM_DEF(bool, server, stop_on_job_errors, true);
 NCBI_PARAM_DEF(bool, server, allow_implicit_job_return, false);
diff --git a/c++/src/connect/services/netservice_params.hpp b/c++/src/connect/services/netservice_params.hpp
index 530c4b9..3893f67 100644
--- a/c++/src/connect/services/netservice_params.hpp
+++ b/c++/src/connect/services/netservice_params.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES__NETSERVICE_PARAMS_HPP
 #define CONNECT_SERVICES__NETSERVICE_PARAMS_HPP
 
-/*  $Id: netservice_params.hpp 423530 2014-01-06 17:39:49Z kazimird $
+/*  $Id: netservice_params.hpp 478064 2015-09-03 16:58:00Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -124,6 +124,10 @@ NCBI_PARAM_DECL(int, netservice_api, max_connection_pool_size);
 typedef NCBI_PARAM_TYPE(netservice_api, max_connection_pool_size)
     TServConn_MaxConnPoolSize;
 
+NCBI_PARAM_DECL(bool, netservice_api, connection_data_logging);
+typedef NCBI_PARAM_TYPE(netservice_api, connection_data_logging)
+    TServConn_ConnDataLogging;
+
 // Worker node-specific parameters
 
 // Determine how long the worker node should wait for the
diff --git a/c++/src/connect/services/netstorage.cpp b/c++/src/connect/services/netstorage.cpp
new file mode 100644
index 0000000..2dc0645
--- /dev/null
+++ b/c++/src/connect/services/netstorage.cpp
@@ -0,0 +1,281 @@
+/*  $Id: netstorage.cpp 499028 2016-04-21 15:25:58Z ivanov $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Author:  Dmitry Kazimirov
+ *
+ * File Description:
+ *   NetStorage implementation declarations.
+ *
+ */
+
+#include <ncbi_pch.hpp>
+#include <corelib/rwstream.hpp>
+#include <connect/services/impl/netstorage_impl.hpp>
+#include <connect/services/netstorage_ft.hpp>
+
+BEGIN_NCBI_SCOPE
+
+
+struct SNetStorageObjectRWStream : public CRWStream
+{
+    SNetStorageObjectRWStream(SNetStorageObjectImpl* nst_object) :
+        CRWStream(nst_object, nst_object, /*buf_size*/ 0, /*buf*/ NULL,
+                  CRWStreambuf::fLeakExceptions),
+        m_NetStorageObject(nst_object)
+    {
+    }
+
+    virtual ~SNetStorageObjectRWStream() { flush(); }
+
+    CNetStorageObject m_NetStorageObject;
+};
+
+string CNetStorageObject::GetLoc()
+{
+    return m_Impl->GetLoc();
+}
+
+size_t CNetStorageObject::Read(void* buffer, size_t buf_size)
+{
+    size_t bytes_read;
+    m_Impl->Read(buffer, buf_size, &bytes_read);
+    return bytes_read;
+}
+
+void CNetStorageObject::Read(string* data)
+{
+    m_Impl->Read(data);
+}
+
+IReader& CNetStorageObject::GetReader()
+{
+    return m_Impl->GetReader();
+}
+
+bool CNetStorageObject::Eof()
+{
+    return m_Impl->Eof();
+}
+
+void CNetStorageObject::Write(const void* buffer, size_t buf_size)
+{
+    m_Impl->Write(buffer, buf_size, NULL);
+}
+
+void CNetStorageObject::Write(const string& data)
+{
+    m_Impl->Write(data.data(), data.length(), NULL);
+}
+
+IEmbeddedStreamWriter& CNetStorageObject::GetWriter()
+{
+    return m_Impl->GetWriter();
+}
+
+CNcbiIostream* CNetStorageObject::GetRWStream()
+{
+    return new SNetStorageObjectRWStream(m_Impl);
+}
+
+Uint8 CNetStorageObject::GetSize()
+{
+    return m_Impl->GetSize();
+}
+
+CNetStorageObject::TAttributeList CNetStorageObject::GetAttributeList() const
+{
+    return m_Impl->GetAttributeList();
+}
+
+string CNetStorageObject::GetAttribute(const string& attr_name) const
+{
+    return m_Impl->GetAttribute(attr_name);
+}
+
+void CNetStorageObject::SetAttribute(const string& attr_name,
+        const string& attr_value)
+{
+    m_Impl->SetAttribute(attr_name, attr_value);
+}
+
+CNetStorageObjectInfo CNetStorageObject::GetInfo()
+{
+    return m_Impl->GetInfo();
+}
+
+void CNetStorageObject::SetExpiration(const CTimeout& ttl)
+{
+    m_Impl->SetExpiration(ttl);
+}
+
+void CNetStorageObject::Close()
+{
+    m_Impl->Close();
+}
+
+CNetStorage::CNetStorage(const string& init_string,
+        TNetStorageFlags default_flags) :
+    m_Impl(SNetStorage::CreateImpl(
+                SNetStorage::SConfig::Build(init_string), default_flags))
+{
+}
+
+CNetStorageObject CNetStorage::Create(TNetStorageFlags flags)
+{
+    return m_Impl->Create(flags);
+}
+
+CNetStorageObject CNetStorage::Open(const string& object_loc)
+{
+    return m_Impl->Open(object_loc);
+}
+
+CNetStorageObject CNetStorage::Open(const string& object_loc,
+        TNetStorageFlags /*flags*/)
+{
+    return m_Impl->Open(object_loc);
+}
+
+string CNetStorage::Relocate(const string& object_loc,
+        TNetStorageFlags flags)
+{
+    return m_Impl->Relocate(object_loc, flags);
+}
+
+bool CNetStorage::Exists(const string& object_loc)
+{
+    return m_Impl->Exists(object_loc);
+}
+
+ENetStorageRemoveResult CNetStorage::Remove(const string& object_loc)
+{
+    return m_Impl->Remove(object_loc);
+}
+
+CNetStorageByKey::CNetStorageByKey(const string& init_string,
+        TNetStorageFlags default_flags) :
+    m_Impl(SNetStorage::CreateByKeyImpl(
+                SNetStorage::SConfig::Build(init_string), default_flags))
+{
+}
+
+CNetStorageObject CNetStorageByKey::Open(const string& unique_key,
+        TNetStorageFlags flags)
+{
+    SNetStorage::SLimits::Check<SNetStorage::SLimits::SUserKey>(unique_key);
+    return m_Impl->Open(unique_key, flags);
+}
+
+string CNetStorageByKey::Relocate(const string& unique_key,
+        TNetStorageFlags flags, TNetStorageFlags old_flags)
+{
+    SNetStorage::SLimits::Check<SNetStorage::SLimits::SUserKey>(unique_key);
+    return m_Impl->Relocate(unique_key, flags, old_flags);
+}
+
+bool CNetStorageByKey::Exists(const string& key, TNetStorageFlags flags)
+{
+    SNetStorage::SLimits::Check<SNetStorage::SLimits::SUserKey>(key);
+    return m_Impl->Exists(key, flags);
+}
+
+ENetStorageRemoveResult CNetStorageByKey::Remove(const string& key,
+        TNetStorageFlags flags)
+{
+    SNetStorage::SLimits::Check<SNetStorage::SLimits::SUserKey>(key);
+    return m_Impl->Remove(key, flags);
+}
+
+#ifdef NCBI_GRID_XSITE_CONN_SUPPORT
+void g_AllowXSiteConnections(CNetStorage& netstorage)
+{
+    netstorage->AllowXSiteConnections();
+}
+
+void g_AllowXSiteConnections(CNetStorageByKey& netstorage)
+{
+    netstorage->AllowXSiteConnections();
+}
+#endif
+
+inline 
+CNetStorageException::EErrCode ConvertErrCode(CNetCacheException::TErrCode code)
+{
+    switch (code) {
+    case CNetCacheException::eAuthenticationError:
+    case CNetCacheException::eAccessDenied:
+        return CNetStorageException::eAuthError;
+
+    case CNetCacheException::eBlobNotFound:
+        return CNetStorageException::eNotExists;
+
+    case CNetCacheException::eKeyFormatError:
+        return CNetStorageException::eInvalidArg;
+
+    case CNetCacheException::eNotImplemented:
+        return CNetStorageException::eNotSupported;
+
+    case CNetCacheException::eServerError:
+    case CNetCacheException::eUnknownCommand:
+    case CNetCacheException::eInvalidServerResponse:
+        return CNetStorageException::eServerError;
+
+    case CNetCacheException::eBlobClipped:
+        return CNetStorageException::eIOError;
+    }
+
+    return CNetStorageException::eUnknown;
+}
+
+void g_ThrowNetStorageException(const CDiagCompileInfo& compile_info,
+        const CNetCacheException& prev_exception, const string& message)
+{
+    CNetStorageException::EErrCode err_code =
+        ConvertErrCode(prev_exception.GetErrCode());
+    throw CNetStorageException(compile_info, &prev_exception, err_code, message);
+}
+
+CNetStorageObject_FileTrack_Path::CNetStorageObject_FileTrack_Path(
+        CNetStorageObject object)
+    : m_Path(object->FileTrack_Path())
+{
+}
+
+void SNetStorage::SLimits::ThrowTooLong(const string& name, size_t max_length)
+{
+    NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
+            name << " exceeds maximum allowed length of " <<
+            max_length << " characters.");
+}
+
+void SNetStorage::SLimits::ThrowIllegalChars(const string& name,
+        const string& value)
+{
+    NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
+            name << " contains illegal characters: " <<
+            NStr::PrintableString(value));
+}
+
+END_NCBI_SCOPE
diff --git a/c++/src/connect/services/netstorage_direct_nc.cpp b/c++/src/connect/services/netstorage_direct_nc.cpp
index 4de9d9f..8bae92f 100644
--- a/c++/src/connect/services/netstorage_direct_nc.cpp
+++ b/c++/src/connect/services/netstorage_direct_nc.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netstorage_direct_nc.cpp 463064 2015-03-24 15:50:48Z sadyrovr $
+/*  $Id: netstorage_direct_nc.cpp 493320 2016-02-25 19:43:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -35,7 +35,6 @@
 #include "netstorage_direct_nc.hpp"
 #include "netcache_api_impl.hpp"
 
-#include <connect/services/netstorage_admin.hpp>
 #include <connect/services/error_codes.hpp>
 
 #include <util/ncbi_url.hpp>
@@ -51,51 +50,6 @@ string SNetStorage_NetCacheBlob::GetLoc()
     return m_BlobKey;
 }
 
-#define CONVERT_NETCACHEEXCEPTION(read_write, reading_writing) \
-    catch (CNetCacheException& e) { \
-        switch (e.GetErrCode()) { \
-        case CNetCacheException::eAuthenticationError: \
-        case CNetCacheException::eAccessDenied: \
-            NCBI_RETHROW_FMT(e, CNetStorageException, eAuthError, \
-                    "Authentication or authorization error " \
-                    "while accessing NetCache blob " << \
-                    m_BlobKey); \
-        case CNetCacheException::eBlobNotFound: \
-            NCBI_RETHROW_FMT(e, CNetStorageException, eNotExists, \
-                    "NetCache blob " << m_BlobKey << \
-                    " does not exist"); \
-        case CNetCacheException::eKeyFormatError: \
-        case CNetCacheException::eUnknownCommand: \
-        case CNetCacheException::eNotImplemented: \
-        case CNetCacheException::eInvalidServerResponse: \
-            NCBI_RETHROW_FMT(e, CNetStorageException, eInvalidArg, \
-                    "Cannot " read_write " NetCache blob " << \
-                    m_BlobKey); \
-        default: \
-            NCBI_RETHROW_FMT(e, CNetStorageException, eServerError, \
-                    "NetCache server error while " reading_writing " " << \
-                    m_BlobKey); \
-        } \
-    }
-
-#define CONVERT_NETSERVICEEXCEPTION(reading_writing) \
-    catch (CNetServiceException& e) { \
-        switch (e.GetErrCode()) { \
-        case CNetServiceException::eTimeout: \
-            NCBI_RETHROW_FMT(e, CNetStorageException, eTimeout, \
-                    "Timeout while " reading_writing " NetCache blob " << \
-                    m_BlobKey); \
-        case CNetServiceException::eCommunicationError: \
-            NCBI_RETHROW_FMT(e, CNetStorageException, eIOError, \
-                    "I/O error while " reading_writing " NetCache blob " << \
-                    m_BlobKey); \
-        default: \
-            NCBI_RETHROW_FMT(e, CNetStorageException, eServerError, \
-                    "NetCache server error while " reading_writing " " << \
-                    m_BlobKey); \
-        } \
-    }
-
 void SNetStorage_NetCacheBlob::x_InitReader()
 {
     if (m_State == eWriting) {
@@ -107,8 +61,7 @@ void SNetStorage_NetCacheBlob::x_InitReader()
         m_NetCacheReader.reset(m_NetCacheAPI->GetPartReader(
                 m_BlobKey, 0, 0, &m_BlobSize, NULL));
     }
-    CONVERT_NETCACHEEXCEPTION("read", "reading")
-    CONVERT_NETSERVICEEXCEPTION("reading")
+    NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on reading " + m_BlobKey)
 
     m_State = eReading;
 }
@@ -123,7 +76,8 @@ ERW_Result SNetStorage_NetCacheBlob::Read(void* buffer, size_t buf_size,
         return g_ReadFromNetCache(m_NetCacheReader.get(),
                 reinterpret_cast<char*>(buffer), buf_size, bytes_read);
     }
-    CONVERT_NETSERVICEEXCEPTION("reading");
+    NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on reading " + m_BlobKey)
+    return eRW_Error; // Not reached
 }
 
 ERW_Result SNetStorage_NetCacheBlob::PendingCount(size_t* count)
@@ -140,7 +94,7 @@ void SNetStorage_NetCacheBlob::Read(string* data)
     try {
         m_NetCacheAPI.ReadData(m_BlobKey, *data);
     }
-    CONVERT_NETSERVICEEXCEPTION("reading");
+    NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on reading " + m_BlobKey)
 }
 
 bool SNetStorage_NetCacheBlob::Eof()
@@ -168,8 +122,7 @@ void SNetStorage_NetCacheBlob::x_InitWriter()
     try {
         m_NetCacheWriter.reset(m_NetCacheAPI.PutData(&m_BlobKey));
     }
-    CONVERT_NETCACHEEXCEPTION("write", "writing")
-    CONVERT_NETSERVICEEXCEPTION("writing")
+    NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on writing " + m_BlobKey)
 
     m_State = eWriting;
 }
@@ -183,7 +136,8 @@ ERW_Result SNetStorage_NetCacheBlob::Write(const void* buf_pos, size_t buf_size,
     try {
         return m_NetCacheWriter->Write(buf_pos, buf_size, bytes_written);
     }
-    CONVERT_NETSERVICEEXCEPTION("writing");
+    NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on writing " + m_BlobKey)
+    return eRW_Error; // Not reached
 }
 
 ERW_Result SNetStorage_NetCacheBlob::Flush()
@@ -193,58 +147,65 @@ ERW_Result SNetStorage_NetCacheBlob::Flush()
 
 Uint8 SNetStorage_NetCacheBlob::GetSize()
 {
-    if (m_State != eReading)
-        return m_NetCacheAPI.GetBlobSize(m_BlobKey);
-    else
-        return m_NetCacheReader->GetBlobSize();
+    try {
+        if (m_State != eReading)
+            return m_NetCacheAPI.GetBlobSize(m_BlobKey);
+        else
+            return m_NetCacheReader->GetBlobSize();
+    }
+    NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on accessing " + m_BlobKey)
+    return 0; // Not reached
 }
 
 list<string> SNetStorage_NetCacheBlob::GetAttributeList() const
 {
-    NCBI_THROW_FMT(CNetStorageException, eInvalidArg, m_BlobKey <<
+    NCBI_THROW_FMT(CNetStorageException, eNotSupported, m_BlobKey <<
             ": attribute retrieval is not implemented for NetCache blobs");
 }
 
 string SNetStorage_NetCacheBlob::GetAttribute(const string& /*attr_name*/) const
 {
-    NCBI_THROW_FMT(CNetStorageException, eInvalidArg, m_BlobKey <<
+    NCBI_THROW_FMT(CNetStorageException, eNotSupported, m_BlobKey <<
             ": attribute retrieval is not implemented for NetCache blobs");
 }
 
 void SNetStorage_NetCacheBlob::SetAttribute(const string& /*attr_name*/,
         const string& /*attr_value*/)
 {
-    NCBI_THROW_FMT(CNetStorageException, eInvalidArg, m_BlobKey <<
+    NCBI_THROW_FMT(CNetStorageException, eNotSupported, m_BlobKey <<
             ": attribute setting for NetCache blobs is not implemented");
 }
 
 CNetStorageObjectInfo SNetStorage_NetCacheBlob::GetInfo()
 {
     try {
-        CNetServerMultilineCmdOutput output(
-                m_NetCacheAPI.GetBlobInfo(m_BlobKey));
+        try {
+            CNetServerMultilineCmdOutput output(
+                    m_NetCacheAPI.GetBlobInfo(m_BlobKey));
 
-        CJsonNode blob_info = CJsonNode::NewObjectNode();
-        string line, key, val;
+            CJsonNode blob_info = CJsonNode::NewObjectNode();
+            string line, key, val;
 
-        while (output.ReadLine(line))
-            if (NStr::SplitInTwo(line, ": ",
-                    key, val, NStr::fSplit_ByPattern))
-                blob_info.SetByKey(key, CJsonNode::GuessType(val));
+            while (output.ReadLine(line))
+                if (NStr::SplitInTwo(line, ": ",
+                        key, val, NStr::fSplit_ByPattern))
+                    blob_info.SetByKey(key, CJsonNode::GuessType(val));
 
-        CJsonNode size_node(blob_info.GetByKeyOrNull("Size"));
+            CJsonNode size_node(blob_info.GetByKeyOrNull("Size"));
 
-        Uint8 blob_size = size_node && size_node.IsInteger() ?
-                (Uint8) size_node.AsInteger() :
-                m_NetCacheAPI.GetBlobSize(m_BlobKey);
+            Uint8 blob_size = size_node && size_node.IsInteger() ?
+                    (Uint8) size_node.AsInteger() :
+                    m_NetCacheAPI.GetBlobSize(m_BlobKey);
 
-        if (m_NetCacheAPI.HasBlob(m_BlobKey)) {
-            return g_CreateNetStorageObjectInfo(m_BlobKey,
-                    eNFL_NetCache, NULL, blob_size, blob_info);
+            if (m_NetCacheAPI.HasBlob(m_BlobKey)) {
+                return g_CreateNetStorageObjectInfo(m_BlobKey,
+                        eNFL_NetCache, NULL, blob_size, blob_info);
+            }
         }
+        NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on accessing " + m_BlobKey)
     }
-    catch (CNetCacheException& e) {
-        if (e.GetErrCode() != CNetCacheException::eBlobNotFound)
+    catch (CNetStorageException& e) {
+        if (e.GetErrCode() != CNetStorageException::eNotExists)
             throw;
     }
 
@@ -252,6 +213,22 @@ CNetStorageObjectInfo SNetStorage_NetCacheBlob::GetInfo()
             eNFL_NotFound, NULL, 0, NULL);
 }
 
+void SNetStorage_NetCacheBlob::SetExpiration(const CTimeout& ttl)
+{
+    if (!ttl.IsFinite()) {
+        NCBI_THROW_FMT(CNetStorageException, eNotSupported, m_BlobKey <<
+            ": infinite ttl for NetCache blobs is not implemented");
+    }
+
+    m_NetCacheAPI.ProlongBlobLifetime(m_BlobKey, (unsigned)ttl.GetAsDouble());
+}
+
+string SNetStorage_NetCacheBlob::FileTrack_Path()
+{
+    NCBI_THROW_FMT(CNetStorageException, eInvalidArg, m_BlobKey <<
+            ": not a FileTrack object");
+}
+
 void SNetStorage_NetCacheBlob::Close()
 {
     switch (m_State) {
diff --git a/c++/src/connect/services/netstorage_direct_nc.hpp b/c++/src/connect/services/netstorage_direct_nc.hpp
index e4c8244..2db4425 100644
--- a/c++/src/connect/services/netstorage_direct_nc.hpp
+++ b/c++/src/connect/services/netstorage_direct_nc.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES__NETSTORAGE_DIRECT_NC__HPP
 #define CONNECT_SERVICES__NETSTORAGE_DIRECT_NC__HPP
 
-/*  $Id: netstorage_direct_nc.hpp 463064 2015-03-24 15:50:48Z sadyrovr $
+/*  $Id: netstorage_direct_nc.hpp 493320 2016-02-25 19:43:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,6 +77,9 @@ struct SNetStorage_NetCacheBlob : public SNetStorageObjectImpl
     virtual void SetAttribute(const string& attr_name,
             const string& attr_value);
     virtual CNetStorageObjectInfo GetInfo();
+    virtual void SetExpiration(const CTimeout&);
+
+    string FileTrack_Path();
 
     void x_InitReader();
     void x_InitWriter();
@@ -91,6 +94,14 @@ struct SNetStorage_NetCacheBlob : public SNetStorageObjectImpl
     size_t m_BlobSize;
 };
 
+class CDNCNetStorage
+{
+public:
+    static CNetStorageObject Create(CNetCacheAPI::TInstance nc_api);
+    static CNetStorageObject Open(CNetCacheAPI::TInstance nc_api,
+        const string& blob_key);
+};
+
 END_NCBI_SCOPE
 
 #endif  /* CONNECT_SERVICES__NETSTORAGE_DIRECT_NC__HPP */
diff --git a/c++/src/connect/services/netstorage_rpc.cpp b/c++/src/connect/services/netstorage_rpc.cpp
index 20aa4f0..ed5179d 100644
--- a/c++/src/connect/services/netstorage_rpc.cpp
+++ b/c++/src/connect/services/netstorage_rpc.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netstorage_rpc.cpp 468613 2015-05-26 19:15:53Z sadyrovr $
+/*  $Id: netstorage_rpc.cpp 499028 2016-04-21 15:25:58Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -35,13 +35,14 @@
 #include "netservice_api_impl.hpp"
 #include "netstorage_direct_nc.hpp"
 
-#include <connect/services/netstorage_admin.hpp>
 #include <connect/services/error_codes.hpp>
 
 #include <util/ncbi_url.hpp>
 
 #include <corelib/request_ctx.hpp>
 
+#include <sstream>
+
 #define NCBI_USE_ERRCODE_X  NetStorage_RPC
 
 #define NST_PROTOCOL_VERSION "1.0.0"
@@ -69,13 +70,13 @@ const char* CNetStorageException::GetErrCodeString() const
     }
 }
 
-static void s_WriteToSocket(CSocket* sock,
+static void s_WriteToSocket(CSocket& sock,
         const char* output_buffer, size_t output_buffer_size)
 {
     size_t bytes_written;
 
     while (output_buffer_size > 0) {
-        EIO_Status  status = sock->Write(output_buffer,
+        EIO_Status  status = sock.Write(output_buffer,
                 output_buffer_size, &bytes_written);
         if (status != eIO_Success) {
             // Error writing to the socket.
@@ -93,7 +94,7 @@ static void s_WriteToSocket(CSocket* sock,
 
             NCBI_THROW_FMT(CNetStorageException, eIOError,
                     "Error writing message to the NetStorage server " <<
-                            sock->GetPeerAddress() << ". "
+                            sock.GetPeerAddress() << ". "
                     "Socket write error status: " <<
                             IO_StatusStr(status) << ". "
                     "Bytes written: " <<
@@ -109,26 +110,24 @@ static void s_WriteToSocket(CSocket* sock,
 class CSendJsonOverSocket
 {
 public:
-    CSendJsonOverSocket() : m_JSONWriter(m_UTTPWriter) {}
+    CSendJsonOverSocket(CSocket& sock) : m_JSONWriter(m_UTTPWriter), m_Socket(sock) {}
 
-    void SendMessage(const CJsonNode& message, CSocket* sock);
+    void SendMessage(const CJsonNode& message);
 
 private:
     void x_SendOutputBuffer();
 
     CUTTPWriter m_UTTPWriter;
     CJsonOverUTTPWriter m_JSONWriter;
-    CSocket* m_Socket;
+    CSocket& m_Socket;
 };
 
-void CSendJsonOverSocket::SendMessage(const CJsonNode& message, CSocket* sock)
+void CSendJsonOverSocket::SendMessage(const CJsonNode& message)
 {
     char write_buffer[WRITE_BUFFER_SIZE];
 
     m_UTTPWriter.Reset(write_buffer, WRITE_BUFFER_SIZE);
 
-    m_Socket = sock;
-
     if (!m_JSONWriter.WriteMessage(message))
         do
             x_SendOutputBuffer();
@@ -149,7 +148,7 @@ void CSendJsonOverSocket::x_SendOutputBuffer()
     } while (m_JSONWriter.NextOutputBuffer());
 }
 
-static void s_SendUTTPChunk(const char* chunk, size_t chunk_size, CSocket* sock)
+static void s_SendUTTPChunk(const char* chunk, size_t chunk_size, CSocket& sock)
 {
     CUTTPWriter uttp_writer;
 
@@ -171,7 +170,7 @@ static void s_SendUTTPChunk(const char* chunk, size_t chunk_size, CSocket* sock)
     s_WriteToSocket(sock, output_buffer, output_buffer_size);
 }
 
-static void s_SendEndOfData(CSocket* sock)
+static void s_SendEndOfData(CSocket& sock)
 {
     CUTTPWriter uttp_writer;
 
@@ -193,12 +192,12 @@ static void s_SendEndOfData(CSocket* sock)
     s_WriteToSocket(sock, output_buffer, output_buffer_size);
 }
 
-static void s_ReadSocket(CSocket* sock, void* buffer,
+static void s_ReadSocket(CSocket& sock, void* buffer,
         size_t buffer_size, size_t* bytes_read)
 {
     EIO_Status status;
 
-    while ((status = sock->Read(buffer,
+    while ((status = sock.Read(buffer,
             buffer_size, bytes_read)) == eIO_Interrupt)
         /* no-op */;
 
@@ -207,7 +206,7 @@ static void s_ReadSocket(CSocket* sock, void* buffer,
         // eIO_NotSupported, eIO_Unknown
         NCBI_THROW_FMT(CNetStorageException, eIOError,
                 "I/O error while reading from NetStorage server " <<
-                        sock->GetPeerAddress() << ". "
+                        sock.GetPeerAddress() << ". "
                 "Socket status: " << IO_StatusStr(status) << '.');
     }
 }
@@ -215,14 +214,14 @@ static void s_ReadSocket(CSocket* sock, void* buffer,
 class CReadJsonFromSocket
 {
 public:
-    CJsonNode ReadMessage(CSocket* sock);
+    CJsonNode ReadMessage(CSocket& sock);
 
 private:
     CUTTPReader m_UTTPReader;
     CJsonOverUTTPReader m_JSONReader;
 };
 
-CJsonNode CReadJsonFromSocket::ReadMessage(CSocket* sock)
+CJsonNode CReadJsonFromSocket::ReadMessage(CSocket& sock)
 {
     try {
         char read_buffer[READ_BUFFER_SIZE];
@@ -237,13 +236,13 @@ CJsonNode CReadJsonFromSocket::ReadMessage(CSocket* sock)
         } while (!m_JSONReader.ReadMessage(m_UTTPReader));
     }
     catch (...) {
-        sock->Close();
+        sock.Close();
         throw;
     }
 
     if (m_UTTPReader.GetNextEvent() != CUTTPReader::eEndOfBuffer) {
-        string server_address(sock->GetPeerAddress());
-        sock->Close();
+        string server_address(sock.GetPeerAddress());
+        sock.Close();
         NCBI_THROW_FMT(CNetStorageException, eIOError,
                 "Extra bytes past message end while reading from " <<
                         server_address << " after receiving " <<
@@ -253,101 +252,205 @@ CJsonNode CReadJsonFromSocket::ReadMessage(CSocket* sock)
     return m_JSONReader.GetMessage();
 }
 
-static void s_TrapErrors(const CJsonNode& request,
-        const CJsonNode& reply, CSocket* sock)
+struct SIssue
 {
-    CJsonNode issues(reply.GetByKeyOrNull("Warnings"));
+    struct SBuilder;
 
-    if (issues) {
-        string server_address(sock->GetPeerAddress());
+    static const Int8 kEmptySubCode = -1;
 
-        for (CJsonIterator it = issues.Iterate(); it; ++it) {
-            LOG_POST(Warning << "NetStorage server " << server_address <<
-                    " issued warning #" << (*it).GetInteger("Code") <<
-                    " (" << (*it).GetString("Message") << ").");
-        }
+    Int8 code;
+    string message;
+    string scope;
+    Int8 sub_code;
+
+    SIssue(SBuilder builder) :
+        code(builder.GetCode()),
+        message(builder.GetMessage()),
+        scope(builder.GetScope()),
+        sub_code(builder.GetSubCode())
+    {}
+
+    template <class TOstream>
+    TOstream& Print(TOstream& os) const
+    {
+        if (!scope.empty()) os << scope << "::";
+        os << code;
+        if (sub_code) os << '.' << sub_code;
+        return os << " (" << message << ')';
     }
 
-    if (reply.GetString("Status") != "OK") {
-        Int8 code = CNetStorageServerError::eUnknownError;
-        string errors;
+    struct SBuilder
+    {
+        SBuilder(const CJsonNode& node) :
+            m_Node(node)
+        {
+            _ASSERT(m_Node);
+        }
 
-        issues = reply.GetByKeyOrNull("Errors");
+        Int8 GetCode() const
+        {
+            return m_Node.GetInteger("Code");
+        }
 
-        if (!issues)
-            errors = reply.GetString("Status");
-        else {
-            const char* prefix = "error ";
+        string GetMessage() const
+        {
+            return m_Node.GetString("Message");
+        }
+
+        string GetScope() const
+        {
+            if (CJsonNode scope = m_Node.GetByKeyOrNull("Scope")) {
+                return scope.AsString();
+            } else {
+                return string();
+            }
+        }
 
-            for (CJsonIterator it = issues.Iterate(); it; ++it) {
-                errors += prefix;
-                code = (*it).GetInteger("Code");
-                errors += NStr::NumericToString(code);
-                errors += ": ";
-                errors += (*it).GetString("Message");
-                prefix = ", error ";
+        Int8 GetSubCode() const
+        {
+            if (CJsonNode sub_code = m_Node.GetByKeyOrNull("SubCode")) {
+                return sub_code.AsInteger();
+            } else {
+                return kEmptySubCode;
             }
         }
 
-        string err_msg = FORMAT("Error while executing " <<
-                        request.GetString("Type") << " "
-                "on NetStorage server " <<
-                        sock->GetPeerAddress() << ". "
-                "Server returned " << errors);
+    private:
+        CJsonNode m_Node;
+    };
+
+};
+
+// Clang does not like templated operator (sees ambiguity with CNcbiDiag's one).
+const CNcbiDiag& operator<< (const CNcbiDiag& diag, const SIssue& issue)
+{
+    return issue.Print(diag);
+}
+
+ostream& operator<< (ostream& os, const SIssue& issue)
+{
+    return issue.Print(os);
+}
 
+void s_ThrowError(Int8 code, Int8 sub_code, const string& err_msg)
+{
+    // Issues were reported by a NetStorage server v2.2.0 or later
+    if (sub_code != SIssue::kEmptySubCode) {
         switch (code) {
-            case CNetStorageServerError::eNetStorageObjectNotFound:
-            case CNetStorageServerError::eRemoteObjectNotFound:
-                NCBI_THROW_FMT(CNetStorageException, eNotExists, err_msg);
-                break;
-            case CNetStorageServerError::eNetStorageObjectExpired:
-                NCBI_THROW_FMT(CNetStorageException, eExpired, err_msg);
+            case 3000:
+                code = sub_code; // CNetStorageServerError
                 break;
-            default:
-                NCBI_THROW_FMT(CNetStorageException, eServerError, err_msg);
+            case 3010:
+                throw CNetServiceException(DIAG_COMPILE_INFO, 0,
+                        static_cast<CNetServiceException::EErrCode>(sub_code),
+                        err_msg);
+            case 3020:
+                throw CNetStorageException(DIAG_COMPILE_INFO, 0,
+                        static_cast<CNetStorageException::EErrCode>(sub_code),
+                        err_msg);
         }
     }
 
-    if (reply.GetInteger("RE") != request.GetInteger("SN")) {
-        NCBI_THROW_FMT(CNetStorageException, eServerError,
-                "Message serial number mismatch "
-                "(NetStorage server: " << sock->GetPeerAddress() << "; "
-                "request: " << request.Repr() << "; "
-                "reply: " << reply.Repr() << ").");
+    switch (code) {
+        case CNetStorageServerError::eNetStorageObjectNotFound:
+        case CNetStorageServerError::eRemoteObjectNotFound:
+            NCBI_THROW_FMT(CNetStorageException, eNotExists, err_msg);
+            break;
+        case CNetStorageServerError::eNetStorageObjectExpired:
+            NCBI_THROW_FMT(CNetStorageException, eExpired, err_msg);
+            break;
+        default:
+            NCBI_THROW_FMT(CNetStorageException, eServerError, err_msg);
     }
 }
 
-static CJsonNode s_Exchange(const CJsonNode& request, CSocket* sock)
+static void s_TrapErrors(const CJsonNode& request,
+        const CJsonNode& reply, CSocket& sock,
+        SNetStorage::SConfig::EErrMode err_mode)
 {
-    CSendJsonOverSocket message_sender;
+    const string server_address(sock.GetPeerAddress());
+    CJsonNode issues(reply.GetByKeyOrNull("Warnings"));
 
-    message_sender.SendMessage(request, sock);
+    if (issues) {
+        for (CJsonIterator it = issues.Iterate(); it; ++it) {
+            const SIssue issue(*it);
+            LOG_POST(Warning << "NetStorage server " << server_address <<
+                    " issued warning " << issue);
+        }
+    }
 
-    CReadJsonFromSocket message_reader;
+    const string status = reply.GetString("Status");
+    const bool status_ok = status == "OK";
+    issues = reply.GetByKeyOrNull("Errors");
+
+    // Got errors
+    if (!status_ok || issues) {
+        if (status_ok && err_mode != SNetStorage::SConfig::eThrow) {
+            if (err_mode == SNetStorage::SConfig::eLog) {
+                for (CJsonIterator it = issues.Iterate(); it; ++it) {
+                    const SIssue issue(*it);
+                    LOG_POST(Error << "NetStorage server " << server_address <<
+                            " issued error " << issue);
+                }
+            }
+        } else {
+            Int8 code = CNetStorageServerError::eUnknownError;
+            Int8 sub_code = SIssue::kEmptySubCode;
+            ostringstream errors;
+
+            if (!issues)
+                errors << status;
+            else {
+                const char* prefix = "error ";
+
+                for (CJsonIterator it = issues.Iterate(); it; ++it) {
+                    const SIssue issue(*it);
+                    code = issue.code;
+                    sub_code = issue.sub_code;
+                    errors << prefix << issue;
+                    prefix = ", error ";
+                }
+            }
 
-    CJsonNode reply(message_reader.ReadMessage(sock));
+            string err_msg = FORMAT("Error while executing " <<
+                            request.GetString("Type") << " "
+                    "on NetStorage server " <<
+                            sock.GetPeerAddress() << ". "
+                    "Server returned " << errors.str());
 
-    s_TrapErrors(request, reply, sock);
+            s_ThrowError(code, sub_code, err_msg);
+        }
+    }
 
-    return reply;
+    if (reply.GetInteger("RE") != request.GetInteger("SN")) {
+        NCBI_THROW_FMT(CNetStorageException, eServerError,
+                "Message serial number mismatch "
+                "(NetStorage server: " << sock.GetPeerAddress() << "; "
+                "request: " << request.Repr() << "; "
+                "reply: " << reply.Repr() << ").");
+    }
 }
 
 class CNetStorageServerListener : public INetServerConnectionListener
 {
 public:
-    CNetStorageServerListener(const CJsonNode& hello) : m_Hello(hello) {}
+    CNetStorageServerListener(const CJsonNode& hello,
+            SNetStorage::SConfig::EErrMode err_mode) :
+        m_Hello(hello), m_ErrMode(err_mode)
+    {
+    }
 
-public:
     virtual CRef<INetServerProperties> AllocServerProperties();
 
-public:
     virtual void OnInit(CObject* api_impl,
         CConfig* config, const string& config_section);
     virtual void OnConnected(CNetServerConnection& connection);
     virtual void OnError(const string& err_msg, CNetServer& server);
     virtual void OnWarning(const string& warn_msg, CNetServer& server);
-
-    CJsonNode m_Hello;
+ 
+private:
+    const CJsonNode m_Hello;
+    const SNetStorage::SConfig::EErrMode m_ErrMode;
 };
 
 CRef<INetServerProperties> CNetStorageServerListener::AllocServerProperties()
@@ -364,7 +467,17 @@ void CNetStorageServerListener::OnInit(CObject* /*api_impl*/,
 void CNetStorageServerListener::OnConnected(
         CNetServerConnection& connection)
 {
-    s_Exchange(m_Hello, &connection->m_Socket);
+    CSocket& sock(connection->m_Socket);
+
+    CSendJsonOverSocket message_sender(sock);
+
+    message_sender.SendMessage(m_Hello);
+
+    CReadJsonFromSocket message_reader;
+
+    CJsonNode reply(message_reader.ReadMessage(sock));
+
+    s_TrapErrors(m_Hello, reply, sock, m_ErrMode);
 }
 
 void CNetStorageServerListener::OnError(const string& /*err_msg*/,
@@ -423,6 +536,9 @@ struct SNetStorageObjectRPC : public SNetStorageObjectImpl
     virtual void SetAttribute(const string& attr_name,
             const string& attr_value);
     virtual CNetStorageObjectInfo GetInfo();
+    virtual void SetExpiration(const CTimeout&);
+
+    string FileTrack_Path();
 
     CJsonNode x_MkRequest(const string& request_type) const;
 
@@ -484,113 +600,127 @@ static const char* const s_NetStorageConfigSections[] = {
     NULL
 };
 
-SNetStorageRPC::SNetStorageRPC(const string& init_string,
-        TNetStorageFlags default_flags) :
-    m_DefaultStorage(eDefaultStorage_Undefined),
-    m_DefaultFlags(default_flags)
-{
-    CUrlArgs url_parser(init_string);
-
-    ITERATE(CUrlArgs::TArgs, field, url_parser.GetArgs()) {
-        if (field->name.empty())
-            continue;
-        switch (field->name[0]) {
-        case 'd':
-            if (field->name == "domain")
-                m_AppDomain = field->value;
-            else if (field->name == "default_storage") {
-                if (NStr::CompareNocase(field->value, "nst") == 0)
-                    m_DefaultStorage = eDefaultStorage_NetStorage;
-                else if (NStr::CompareNocase(field->value, "nc") == 0)
-                    m_DefaultStorage = eDefaultStorage_NetCache;
-                else if (NStr::CompareNocase(field->value, "nocreate") == 0 ||
-                        NStr::CompareNocase(field->value, "no_create") == 0)
-                    m_DefaultStorage = eDefaultStorage_NoCreate;
-                else {
-                    NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
-                            "Invalid default_storage value '" <<
-                                    field->value << '\'');
-                }
-            }
-            break;
-        case 'm':
-            if (field->name == "metadata")
-                m_MetadataOption = field->value;
-            break;
-        case 'n':
-            if (field->name == "namespace")
-                m_AppDomain = field->value;
-            else if (field->name == "nst")
-                m_NetStorageServiceName = field->value;
-            else if (field->name == "nc")
-                m_NetCacheServiceName = field->value;
-            break;
-        case 'c':
-            if (field->name == "cache")
-                m_AppDomain = field->value;
-            else if (field->name == "client")
-                m_ClientName = field->value;
-        }
+SNetStorage::SConfig::EDefaultStorage
+SNetStorage::SConfig::GetDefaultStorage(const string& value)
+{
+    if (NStr::CompareNocase(value, "nst") == 0)
+        return eNetStorage;
+    else if (NStr::CompareNocase(value, "nc") == 0)
+        return eNetCache;
+    else if (NStr::CompareNocase(value, "nocreate") == 0 ||
+            NStr::CompareNocase(value, "no_create") == 0)
+        return eNoCreate;
+    else {
+        NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
+                "Invalid default_storage value '" << value << '\'');
+        return eUndefined;
     }
+}
 
-    if (m_ClientName.empty()) {
+SNetStorage::SConfig::EErrMode
+SNetStorage::SConfig::GetErrMode(const string& value)
+{
+    if (NStr::CompareNocase(value, "strict") == 0)
+        return eThrow;
+    else if (NStr::CompareNocase(value, "ignore") == 0)
+        return eIgnore;
+    else
+        return eLog;
+}
+
+void SNetStorage::SConfig::ParseArg(const string& name, const string& value)
+{
+    if (name == "domain")
+        app_domain = value;
+    else if (name == "default_storage")
+        default_storage = GetDefaultStorage(value);
+    else if (name == "metadata")
+        metadata = value;
+    else if (name == "namespace")
+        app_domain = value;
+    else if (name == "nst")
+        service = value;
+    else if (name == "nc")
+        nc_service = value;
+    else if (name == "cache")
+        app_domain = value;
+    else if (name == "client")
+        client_name = value;
+    else if (name == "err_mode")
+        err_mode = GetErrMode(value);
+}
+
+void SNetStorage::SConfig::Validate(const string& init_string)
+{
+    SNetStorage::SLimits::Check<SNetStorage::SLimits::SNamespace>(app_domain);
+
+    if (client_name.empty()) {
         CNcbiApplication* app = CNcbiApplication::Instance();
         if (app != NULL) {
             string path;
             CDirEntry::SplitPath(app->GetProgramExecutablePath(),
-                    &path, &m_ClientName);
+                    &path, &client_name);
             if (NStr::EndsWith(path, CDirEntry::GetPathSeparator()))
                 path.erase(path.length() - 1);
             string parent_dir;
             CDirEntry::SplitPath(path, NULL, &parent_dir);
             if (!parent_dir.empty()) {
-                m_ClientName += '-';
-                m_ClientName += parent_dir;
+                client_name += '-';
+                client_name += parent_dir;
             }
         }
     }
 
-    if (m_ClientName.empty()) {
+    if (client_name.empty()) {
         NCBI_THROW_FMT(CNetStorageException, eAuthError,
                 "Client name is required.");
     }
 
-    switch (m_DefaultStorage) {
-    case eDefaultStorage_Undefined:
-        m_DefaultStorage =
-                !m_NetStorageServiceName.empty() ? eDefaultStorage_NetStorage :
-                !m_NetCacheServiceName.empty() ? eDefaultStorage_NetCache :
-                eDefaultStorage_NoCreate;
+    switch (default_storage) {
+    case eUndefined:
+        default_storage =
+                !service.empty() ? eNetStorage :
+                !nc_service.empty() ? eNetCache :
+                eNoCreate;
         break;
 
-    case eDefaultStorage_NetStorage:
-        if (m_NetStorageServiceName.empty()) {
+    case eNetStorage:
+        if (service.empty()) {
             NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
                     init_string << ": 'nst=' parameter is required "
                             "when 'default_storage=nst'");
         }
         break;
 
-    case eDefaultStorage_NetCache:
-        if (m_NetCacheServiceName.empty()) {
+    case eNetCache:
+        if (nc_service.empty()) {
             NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
                     init_string << ": 'nc=' parameter is required "
                             "when 'default_storage=nc'");
         }
         break;
 
-    default: /* eDefaultStorage_NoCreate */
+    default: /* eNoCreate */
         break;
     }
+}
 
+SNetStorageRPC::SNetStorageRPC(const TConfig& config,
+        TNetStorageFlags default_flags) :
+    m_DefaultFlags(default_flags),
+    m_Config(config)
+#ifdef NCBI_GRID_XSITE_CONN_SUPPORT
+    , m_AllowXSiteConnections(false)
+#endif
+{
     m_RequestNumber.Set(0);
 
     CJsonNode hello(MkStdRequest("HELLO"));
 
-    hello.SetString("Client", m_ClientName);
-    hello.SetString("Service", m_NetStorageServiceName);
-    if (!m_MetadataOption.empty())
-        hello.SetString("Metadata", m_MetadataOption);
+    hello.SetString("Client", m_Config.client_name);
+    hello.SetString("Service", m_Config.service);
+    if (!m_Config.metadata.empty())
+        hello.SetString("Metadata", m_Config.metadata);
     {{
         CMutexGuard guard(CNcbiApplication::GetInstanceMutex());
         CNcbiApplication* app = CNcbiApplication::Instance();
@@ -599,34 +729,34 @@ SNetStorageRPC::SNetStorageRPC(const string& init_string,
     }}
     hello.SetString("ProtocolVersion", NST_PROTOCOL_VERSION);
 
-    m_Service = new SNetServiceImpl("NetStorageAPI", m_ClientName,
-            new CNetStorageServerListener(hello));
+    m_Service = new SNetServiceImpl("NetStorageAPI", m_Config.client_name,
+            new CNetStorageServerListener(hello, m_Config.err_mode));
 
-    m_Service->Init(this, m_NetStorageServiceName,
+    m_Service->Init(this, m_Config.service,
             NULL, kEmptyStr, s_NetStorageConfigSections);
 }
 
 CNetStorageObject SNetStorageRPC::Create(TNetStorageFlags flags)
 {
-    switch (m_DefaultStorage) {
-    /* eDefaultStorage_Undefined is overridden in the constructor */
+    switch (m_Config.default_storage) {
+    /* TConfig::eUndefined is overridden in the constructor */
 
-    case eDefaultStorage_NetStorage:
+    case TConfig::eNetStorage:
         break; // This case is handled below the switch.
 
-    case eDefaultStorage_NetCache:
+    case TConfig::eNetCache:
         x_InitNetCacheAPI();
         return CDNCNetStorage::Create(m_NetCacheAPI);
 
-    default: /* eDefaultStorage_NoCreate */
+    default: /* TConfig::eNoCreate */
         NCBI_THROW_FMT(CNetStorageException, eAuthError,
                 "Object creation is disabled.");
     }
 
+    m_UseNextSubHitID.ProperCommand();
     CJsonNode request(MkStdRequest("CREATE"));
 
     x_SetStorageFlags(request, flags);
-    x_SetICacheNames(request);
 
     CNetServerConnection conn;
 
@@ -652,9 +782,10 @@ string SNetStorageRPC::Relocate(const string& object_loc,
         TNetStorageFlags flags)
 {
     if (x_NetCacheMode(object_loc))
-        NCBI_THROW_FMT(CNetStorageException, eInvalidArg, object_loc <<
+        NCBI_THROW_FMT(CNetStorageException, eNotSupported, object_loc <<
                 ": Relocate for NetCache blobs is not implemented");
 
+    m_UseNextSubHitID.ProperCommand();
     CJsonNode request(MkObjectRequest("RELOCATE", object_loc));
 
     CJsonNode new_location(CJsonNode::NewObjectNode());
@@ -670,7 +801,10 @@ string SNetStorageRPC::Relocate(const string& object_loc,
 bool SNetStorageRPC::Exists(const string& object_loc)
 {
     if (x_NetCacheMode(object_loc))
-        return m_NetCacheAPI.HasBlob(object_loc);
+        try {
+            return m_NetCacheAPI.HasBlob(object_loc);
+        }
+        NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on accessing " + object_loc)
 
     CJsonNode request(MkObjectRequest("EXISTS", object_loc));
 
@@ -678,14 +812,26 @@ bool SNetStorageRPC::Exists(const string& object_loc)
             request).GetBoolean("Exists");
 }
 
-void SNetStorageRPC::Remove(const string& object_loc)
+ENetStorageRemoveResult SNetStorageRPC::Remove(const string& object_loc)
 {
-    if (x_NetCacheMode(object_loc))
-        return m_NetCacheAPI.Remove(object_loc);
+    if (x_NetCacheMode(object_loc)) {
+        try {
+            if (m_NetCacheAPI.HasBlob(object_loc)) {
+                m_NetCacheAPI.Remove(object_loc);
+                return eNSTRR_Removed;
+            }
+        }
+        NETSTORAGE_CONVERT_NETCACHEEXCEPTION("on removing " + object_loc)
 
+        return eNSTRR_NotFound;
+    }
+
+    m_UseNextSubHitID.ProperCommand();
     CJsonNode request(MkObjectRequest("DELETE", object_loc));
+    CJsonNode response(Exchange(GetServiceFromLocator(object_loc), request));
+    CJsonNode not_found(response.GetByKeyOrNull("NotFound"));
 
-    Exchange(GetServiceFromLocator(object_loc), request);
+    return not_found && not_found.AsBoolean() ? eNSTRR_NotFound : eNSTRR_Removed;
 }
 
 class CJsonOverUTTPExecHandler : public INetServerExecHandler
@@ -707,9 +853,9 @@ private:
 void CJsonOverUTTPExecHandler::Exec(CNetServerConnection::TInstance conn_impl,
         STimeout* timeout)
 {
-    CSendJsonOverSocket sender;
+    CSendJsonOverSocket sender(conn_impl->m_Socket);
 
-    sender.SendMessage(m_Request, &conn_impl->m_Socket);
+    sender.SendMessage(m_Request);
 
     m_Connection = conn_impl;
 }
@@ -732,11 +878,11 @@ CJsonNode SNetStorageRPC::Exchange(CNetService service,
     if (conn != NULL)
         *conn = json_over_uttp_sender.GetConnection();
 
-    CSocket* sock = &json_over_uttp_sender.GetConnection()->m_Socket;
+    CSocket& sock = json_over_uttp_sender.GetConnection()->m_Socket;
 
     CJsonNode reply(message_reader.ReadMessage(sock));
 
-    s_TrapErrors(request, reply, sock);
+    s_TrapErrors(request, reply, sock, m_Config.err_mode);
 
     return reply;
 }
@@ -763,16 +909,6 @@ void SNetStorageRPC::x_SetStorageFlags(CJsonNode& node, TNetStorageFlags flags)
     node.SetByKey("StorageFlags", storage_flags);
 }
 
-void SNetStorageRPC::x_SetICacheNames(CJsonNode& node) const
-{
-    if (!m_NetCacheServiceName.empty() && !m_AppDomain.empty()) {
-        CJsonNode icache(CJsonNode::NewObjectNode());
-        icache.SetString("ServiceName", m_NetCacheServiceName);
-        icache.SetString("CacheName", m_AppDomain);
-        node.SetByKey("ICache", icache);
-    }
-}
-
 CJsonNode SNetStorageRPC::MkStdRequest(const string& request_type) const
 {
     CJsonNode new_request(CJsonNode::NewObjectNode());
@@ -790,8 +926,22 @@ CJsonNode SNetStorageRPC::MkStdRequest(const string& request_type) const
         new_request.SetString("SessionID", req.GetSessionID());
     }
 
+    // TODO:
+    // Remove sending this after all NetStorage servers are updated to v2.2.0
+    // (ncbi_phid is sent inside ncbi_context).
+    // GetNextSubHitID()/GetCurrentSubHitID()) must be still called though
+    // (without using returned value) to set appropriate value for ncbi_phid.
     if (req.IsSetHitID()) {
-        new_request.SetString("ncbi_phid", req.GetHitID());
+        new_request.SetString("ncbi_phid", m_UseNextSubHitID ?
+                req.GetNextSubHitID() : req.GetCurrentSubHitID());
+    }
+
+    const auto format = CRequestContext_PassThrough::eFormat_UrlEncoded;
+    const CRequestContext_PassThrough context;
+    const string ncbi_context(context.Serialize(format));
+
+    if (!ncbi_context.empty()) {
+        new_request.SetString("ncbi_context", ncbi_context);
     }
 
     return new_request;
@@ -813,22 +963,27 @@ CJsonNode SNetStorageRPC::MkObjectRequest(const string& request_type,
     CJsonNode new_request(MkStdRequest(request_type));
 
     CJsonNode user_key(CJsonNode::NewObjectNode());
-    user_key.SetString("AppDomain", m_AppDomain);
+    user_key.SetString("AppDomain", m_Config.app_domain);
     user_key.SetString("UniqueID", unique_key);
     new_request.SetByKey("UserKey", user_key);
 
     x_SetStorageFlags(new_request, flags);
-    x_SetICacheNames(new_request);
-
     return new_request;
 }
 
 void SNetStorageRPC::x_InitNetCacheAPI()
 {
     if (!m_NetCacheAPI) {
-        CNetCacheAPI nc_api(m_NetCacheServiceName, m_ClientName);
+        CNetCacheAPI nc_api(m_Config.nc_service, m_Config.client_name);
         nc_api.SetCompoundIDPool(m_CompoundIDPool);
         nc_api.SetDefaultParameters(nc_use_compound_id = true);
+
+#ifdef NCBI_GRID_XSITE_CONN_SUPPORT
+        if (m_AllowXSiteConnections) {
+            nc_api.GetService().AllowXSiteConnections();
+        }
+#endif
+
         m_NetCacheAPI = nc_api;
     }
 }
@@ -843,12 +998,6 @@ bool SNetStorageRPC::x_NetCacheMode(const string& object_loc)
     return true;
 }
 
-CNetStorage::CNetStorage(const string& init_string,
-        TNetStorageFlags default_flags) :
-    m_Impl(new SNetStorageRPC(init_string, default_flags))
-{
-}
-
 string SNetStorageObjectRPC::GetLoc()
 {
     return m_Locator;
@@ -856,7 +1005,7 @@ string SNetStorageObjectRPC::GetLoc()
 
 void SNetStorageObjectRPC::ReadConfirmation()
 {
-    CSocket* sock = &m_Connection->m_Socket;
+    CSocket& sock = m_Connection->m_Socket;
 
     CJsonOverUTTPReader json_reader;
     try {
@@ -873,7 +1022,7 @@ void SNetStorageObjectRPC::ReadConfirmation()
             NCBI_THROW_FMT(CNetStorageException, eIOError,
                     "Extra bytes past confirmation message "
                     "while reading " << m_Locator << " from " <<
-                    sock->GetPeerAddress() << '.');
+                    sock.GetPeerAddress() << '.');
         }
     }
     catch (...) {
@@ -882,7 +1031,8 @@ void SNetStorageObjectRPC::ReadConfirmation()
         throw;
     }
 
-    s_TrapErrors(m_OriginalRequest, json_reader.GetMessage(), sock);
+    s_TrapErrors(m_OriginalRequest, json_reader.GetMessage(), sock,
+            m_NetStorageRPC->m_Config.err_mode);
 }
 
 ERW_Result SNetStorageObjectRPC::Read(void* buffer, size_t buf_size,
@@ -907,7 +1057,7 @@ ERW_Result SNetStorageObjectRPC::Read(void* buffer, size_t buf_size,
 
         server->TryExec(json_over_uttp_sender);
 
-        CSocket* sock = &json_over_uttp_sender.GetConnection()->m_Socket;
+        CSocket& sock = json_over_uttp_sender.GetConnection()->m_Socket;
 
         CJsonOverUTTPReader json_reader;
 
@@ -922,11 +1072,12 @@ ERW_Result SNetStorageObjectRPC::Read(void* buffer, size_t buf_size,
         }
         catch (...) {
             m_UTTPReader.Reset();
-            sock->Close();
+            sock.Close();
             throw;
         }
 
-        s_TrapErrors(m_OriginalRequest, json_reader.GetMessage(), sock);
+        s_TrapErrors(m_OriginalRequest, json_reader.GetMessage(), sock,
+            m_NetStorageRPC->m_Config.err_mode);
 
         m_Connection = json_over_uttp_sender.GetConnection();
 
@@ -1003,7 +1154,7 @@ ERW_Result SNetStorageObjectRPC::Read(void* buffer, size_t buf_size,
                 return bytes_copied ? eRW_Success : eRW_Eof;
 
             case CUTTPReader::eEndOfBuffer:
-                s_ReadSocket(&m_Connection->m_Socket, m_ReadBuffer,
+                s_ReadSocket(m_Connection->m_Socket, m_ReadBuffer,
                         READ_BUFFER_SIZE, &bytes_read_local);
 
                 m_UTTPReader.SetNewBuffer(m_ReadBuffer, bytes_read_local);
@@ -1053,6 +1204,7 @@ ERW_Result SNetStorageObjectRPC::Write(const void* buf_pos, size_t buf_size,
     }
 
     if (m_State == eReady) {
+        m_NetStorageRPC->m_UseNextSubHitID.ProperCommand();
         m_OriginalRequest = x_MkRequest("WRITE");
 
         m_Locator = ExchangeUsingOwnService(m_OriginalRequest,
@@ -1063,7 +1215,7 @@ ERW_Result SNetStorageObjectRPC::Write(const void* buf_pos, size_t buf_size,
 
     try {
         s_SendUTTPChunk(reinterpret_cast<const char*>(buf_pos),
-                buf_size, &m_Connection->m_Socket);
+                buf_size, m_Connection->m_Socket);
         if (bytes_written != NULL)
             *bytes_written = buf_size;
         return eRW_Success;
@@ -1149,10 +1301,35 @@ CNetStorageObjectInfo SNetStorageObjectRPC::GetInfo()
 
     CJsonNode request(x_MkRequest("GETOBJECTINFO"));
 
-    return g_CreateNetStorageObjectInfo(m_Locator,
+    return g_CreateNetStorageObjectInfo(
             ExchangeUsingOwnService(request));
 }
 
+void SNetStorageObjectRPC::SetExpiration(const CTimeout& ttl)
+{
+    if (m_State != eReady) {
+        NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
+                "Cannot set expiration while reading or writing");
+    }
+
+    CJsonNode request(x_MkRequest("SETEXPTIME"));
+
+    if (ttl.IsFinite()) {
+        request.SetString("TTL", ttl.GetAsTimeSpan().AsString("dTh:m:s"));
+    } else {
+        request.SetString("TTL", "infinity");
+    }
+
+    ExchangeUsingOwnService(request);
+}
+
+string SNetStorageObjectRPC::FileTrack_Path()
+{
+    CJsonNode request(x_MkRequest("LOCKFTPATH"));
+
+    return ExchangeUsingOwnService(request).GetString("Path");
+}
+
 void SNetStorageObjectRPC::Close()
 {
     if (m_State == eReady)
@@ -1171,14 +1348,15 @@ void SNetStorageObjectRPC::Close()
     } else { /* m_State == eWriting */
         m_State = eReady;
 
-        CSocket* sock = &conn_copy->m_Socket;
+        CSocket& sock = conn_copy->m_Socket;
 
         s_SendEndOfData(sock);
 
         CReadJsonFromSocket message_reader;
 
         s_TrapErrors(m_OriginalRequest,
-                message_reader.ReadMessage(sock), sock);
+                message_reader.ReadMessage(sock), sock,
+                m_NetStorageRPC->m_Config.err_mode);
     }
 }
 
@@ -1191,11 +1369,6 @@ CJsonNode SNetStorageObjectRPC::x_MkRequest(const string& request_type) const
                 m_UniqueKey, m_Flags);
 }
 
-SNetStorageObjectRWStream::~SNetStorageObjectRWStream()
-{
-    flush();
-}
-
 ERW_Result SNetStorageObjectImpl::PendingCount(size_t* count)
 {
     *count = 0;
@@ -1239,7 +1412,7 @@ void SNetStorageObjectImpl::Read(string* data)
 
 struct SNetStorageByKeyRPC : public SNetStorageByKeyImpl
 {
-    SNetStorageByKeyRPC(const string& init_string,
+    SNetStorageByKeyRPC(const TConfig& config,
             TNetStorageFlags default_flags);
 
     virtual CNetStorageObject Open(const string& unique_key,
@@ -1247,17 +1420,22 @@ struct SNetStorageByKeyRPC : public SNetStorageByKeyImpl
     virtual string Relocate(const string& unique_key,
             TNetStorageFlags flags, TNetStorageFlags old_flags = 0);
     virtual bool Exists(const string& key, TNetStorageFlags flags = 0);
-    virtual void Remove(const string& key, TNetStorageFlags flags = 0);
+    virtual ENetStorageRemoveResult Remove(const string& key,
+            TNetStorageFlags flags = 0);
+
+#ifdef NCBI_GRID_XSITE_CONN_SUPPORT
+    void AllowXSiteConnections() { m_NetStorageRPC->AllowXSiteConnections(); }
+#endif
 
     CRef<SNetStorageRPC,
             CNetComponentCounterLocker<SNetStorageRPC> > m_NetStorageRPC;
 };
 
-SNetStorageByKeyRPC::SNetStorageByKeyRPC(const string& init_string,
+SNetStorageByKeyRPC::SNetStorageByKeyRPC(const TConfig& config,
         TNetStorageFlags default_flags) :
-    m_NetStorageRPC(new SNetStorageRPC(init_string, default_flags))
+    m_NetStorageRPC(new SNetStorageRPC(config, default_flags))
 {
-    if (m_NetStorageRPC->m_AppDomain.empty()) {
+    if (m_NetStorageRPC->m_Config.app_domain.empty()) {
         NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
                 "'domain' parameter is missing from the initialization string");
     }
@@ -1274,6 +1452,7 @@ CNetStorageObject SNetStorageByKeyRPC::Open(const string& unique_key,
 string SNetStorageByKeyRPC::Relocate(const string& unique_key,
         TNetStorageFlags flags, TNetStorageFlags old_flags)
 {
+    m_NetStorageRPC->m_UseNextSubHitID.ProperCommand();
     CJsonNode request(m_NetStorageRPC->MkObjectRequest(
             "RELOCATE", unique_key, old_flags));
 
@@ -1295,17 +1474,18 @@ bool SNetStorageByKeyRPC::Exists(const string& key, TNetStorageFlags flags)
             request).GetBoolean("Exists");
 }
 
-void SNetStorageByKeyRPC::Remove(const string& key, TNetStorageFlags flags)
+ENetStorageRemoveResult SNetStorageByKeyRPC::Remove(const string& key,
+        TNetStorageFlags flags)
 {
+    m_NetStorageRPC->m_UseNextSubHitID.ProperCommand();
     CJsonNode request(m_NetStorageRPC->MkObjectRequest("DELETE", key, flags));
 
-    m_NetStorageRPC->Exchange(m_NetStorageRPC->m_Service, request);
-}
+    CJsonNode response(
+            m_NetStorageRPC->Exchange(m_NetStorageRPC->m_Service, request));
 
-CNetStorageByKey::CNetStorageByKey(const string& init_string,
-        TNetStorageFlags default_flags) :
-    m_Impl(new SNetStorageByKeyRPC(init_string, default_flags))
-{
+    CJsonNode not_found(response.GetByKeyOrNull("NotFound"));
+
+    return not_found && not_found.AsBoolean() ? eNSTRR_NotFound : eNSTRR_Removed;
 }
 
 struct SNetStorageAdminImpl : public CObject
@@ -1341,4 +1521,16 @@ CJsonNode CNetStorageAdmin::ExchangeJson(const CJsonNode& request,
             request, conn, server_to_use);
 }
 
+SNetStorageImpl* SNetStorage::CreateImpl(const SConfig& config,
+        TNetStorageFlags default_flags)
+{
+    return new SNetStorageRPC(config, default_flags);
+}
+
+SNetStorageByKeyImpl* SNetStorage::CreateByKeyImpl(const SConfig& config,
+        TNetStorageFlags default_flags)
+{
+    return new SNetStorageByKeyRPC(config, default_flags);
+}
+
 END_NCBI_SCOPE
diff --git a/c++/src/connect/services/netstorage_rpc.hpp b/c++/src/connect/services/netstorage_rpc.hpp
index 6524688..7903a54 100644
--- a/c++/src/connect/services/netstorage_rpc.hpp
+++ b/c++/src/connect/services/netstorage_rpc.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES__NETSTORAGE_RPC__HPP
 #define CONNECT_SERVICES__NETSTORAGE_RPC__HPP
 
-/*  $Id: netstorage_rpc.hpp 463064 2015-03-24 15:50:48Z sadyrovr $
+/*  $Id: netstorage_rpc.hpp 499028 2016-04-21 15:25:58Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -35,26 +35,20 @@
 
 #include "netservice_api_impl.hpp"
 
-#include <connect/services/netstorage.hpp>
+#include <connect/services/netcache_api.hpp>
+#include <connect/services/impl/netstorage_impl.hpp>
 
 BEGIN_NCBI_SCOPE
 
-enum EDefaultStorage {
-    eDefaultStorage_Undefined,
-    eDefaultStorage_NetStorage,
-    eDefaultStorage_NetCache,
-    eDefaultStorage_NoCreate,
-};
-
 struct SNetStorageRPC : public SNetStorageImpl
 {
-    SNetStorageRPC(const string& init_string, TNetStorageFlags default_flags);
+    SNetStorageRPC(const TConfig& config, TNetStorageFlags default_flags);
 
     virtual CNetStorageObject Create(TNetStorageFlags flags = 0);
     virtual CNetStorageObject Open(const string& object_loc);
     virtual string Relocate(const string& object_loc, TNetStorageFlags flags);
     virtual bool Exists(const string& object_loc);
-    virtual void Remove(const string& object_loc);
+    virtual ENetStorageRemoveResult Remove(const string& object_loc);
 
     CJsonNode Exchange(CNetService service,
             const CJsonNode& request,
@@ -62,7 +56,6 @@ struct SNetStorageRPC : public SNetStorageImpl
             CNetServer::TInstance server_to_use = NULL) const;
 
     static void x_SetStorageFlags(CJsonNode& node, TNetStorageFlags flags);
-    void x_SetICacheNames(CJsonNode& node) const;
     CJsonNode MkStdRequest(const string& request_type) const;
     CJsonNode MkObjectRequest(const string& request_type,
             const string& object_loc) const;
@@ -76,28 +69,44 @@ struct SNetStorageRPC : public SNetStorageImpl
         CNetStorageObjectLoc locator_struct(m_CompoundIDPool, object_loc);
         string service_name = locator_struct.GetServiceName();
 
-        return service_name.empty() ||
-                service_name == m_Service.GetServiceName() ? m_Service :
-                        m_ServiceMap.GetServiceByName(service_name, m_Service);
-    }
+        if (service_name.empty())
+            return m_Service;
 
-    EDefaultStorage m_DefaultStorage;
+        // Clone will return itself if it has the same name and
+        // insert would not do anything if such entry already exists,
+        // so no need to check for existence.
+        CNetService service(m_Service.Clone(service_name));
+        m_ServiceMap.insert(make_pair(service_name, service));
+        return service;
+    }
 
     TNetStorageFlags m_DefaultFlags;
     CNetService m_Service;
-    SNetServiceMap m_ServiceMap;
 
-    string m_NetStorageServiceName;
-    string m_NetCacheServiceName;
-    string m_ClientName;
-    string m_AppDomain;
-    string m_MetadataOption;
+    const TConfig m_Config;
 
     mutable CAtomicCounter m_RequestNumber;
 
     CCompoundIDPool m_CompoundIDPool;
 
     CNetCacheAPI m_NetCacheAPI;
+
+    mutable SUseNextSubHitID m_UseNextSubHitID;
+
+private:
+    map<string, CNetService> m_ServiceMap;
+
+public:
+#ifdef NCBI_GRID_XSITE_CONN_SUPPORT
+    void AllowXSiteConnections()
+    {
+        m_AllowXSiteConnections = true;
+        m_Service.AllowXSiteConnections();
+        if (m_NetCacheAPI) m_NetCacheAPI.GetService().AllowXSiteConnections();
+    }
+
+    bool m_AllowXSiteConnections;
+#endif
 };
 
 END_NCBI_SCOPE
diff --git a/c++/src/connect/services/netstorageobjectinfo.cpp b/c++/src/connect/services/netstorageobjectinfo.cpp
index 0679b90..09d2a75 100644
--- a/c++/src/connect/services/netstorageobjectinfo.cpp
+++ b/c++/src/connect/services/netstorageobjectinfo.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netstorageobjectinfo.cpp 461290 2015-03-09 14:45:57Z sadyrovr $
+/*  $Id: netstorageobjectinfo.cpp 499845 2016-04-28 16:13:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,6 +32,7 @@
 
 #include <ncbi_pch.hpp>
 #include <connect/services/netstorage.hpp>
+#include <connect/services/impl/netstorage_impl.hpp>
 
 
 BEGIN_NCBI_SCOPE
@@ -40,18 +41,24 @@ typedef ENetStorageObjectLocation TLocation;
 
 struct SData
 {
-    TLocation loc;
-    CJsonNode loc_info;
+    TLocation location;
+    string object_loc;
+    string object_key;
+    CJsonNode object_loc_info;
     Uint8 file_size;
     CJsonNode st_info;
 
     SData() {}
     SData(TLocation l,
+            const string& ol,
+            const string& ok,
             CJsonNode::TInstance li,
             Uint8 fs,
             CJsonNode::TInstance si)
-        : loc(l),
-          loc_info(li),
+        : location(l),
+          object_loc(ol),
+          object_key(ok),
+          object_loc_info(li),
           file_size(fs),
           st_info(si)
     {}
@@ -103,28 +110,19 @@ private:
 
 struct SNetStorageObjectInfoImpl : CObject
 {
-    SNetStorageObjectInfoImpl(const string& loc, const SData& data)
-        : m_Data(data), m_Loc(loc)
-    {}
-
-    SNetStorageObjectInfoImpl(const string& loc, const CJsonNode& json)
-        : m_Data(json), m_Loc(loc)
-    {}
+    SNetStorageObjectInfoImpl(const SLazyInitData& data) : m_Data(data) {}
 
-    TLocation GetLocation()            const { Check(); return m_Data.loc; }
-    CJsonNode GetObjectLocInfo()       const { Check(); return m_Data.loc_info; }
+    TLocation GetLocation()            const { Check(); return m_Data.location; }
+    CJsonNode GetObjectLocInfo()       const { Check(); return m_Data.object_loc_info; }
     CTime     GetCreationTime()        const { Check(); return m_Data.time; }
     Uint8     GetSize()                const { Check(); return m_Data.file_size; }
     CJsonNode GetStorageSpecificInfo() const { Check(); return m_Data.st_info; }
     CJsonNode GetJSON()                const { Check(); return m_Data.json; }
 
-    string GetNFSPathname() const;
-
 private:
     void Check() const { m_Data.Check(); }
 
     mutable SLazyInitData m_Data;
-    string m_Loc;
 };
 
 
@@ -161,13 +159,17 @@ void SLazyInitData::InitData()
     // Init data from JSON
 
     const string l(json.GetString("Location"));
+    CJsonNode ol(json.GetByKeyOrNull("ObjectLoc"));
+    CJsonNode ok(json.GetByKeyOrNull("ObjectKey"));
     CJsonNode size(json.GetByKeyOrNull("Size"));
 
-    loc =
+    location =
         l == "NetCache"  ? eNFL_NetCache :
         l == "FileTrack" ? eNFL_FileTrack :
         l == "NotFound"  ? eNFL_NotFound : eNFL_Unknown;
-    loc_info = json.GetByKey("ObjectLocInfo");
+    object_loc = ol ? ol.AsString() : kEmptyStr;
+    object_key = ok ? ol.AsString() : kEmptyStr;
+    object_loc_info = json.GetByKey("ObjectLocInfo");
     file_size = size ? (Uint8) size.AsInteger() : 0;
     st_info = json.GetByKeyOrNull("StorageSpecificInfo");
     InitExtra();
@@ -175,9 +177,9 @@ void SLazyInitData::InitData()
 
 void SLazyInitData::InitExtra()
 {
-    if (loc == eNFL_FileTrack) {
+    if (location == eNFL_FileTrack) {
         time = GetTime<eNFL_FileTrack>();
-    } else if (loc == eNFL_NetCache) {
+    } else if (location == eNFL_NetCache) {
         time = GetTime<eNFL_NetCache>();
     }
 }
@@ -197,7 +199,7 @@ void SLazyInitData::InitJson()
     const char* const kOutputTimeFormat = "M/D/Y h:m:s";
     json = CJsonNode::NewObjectNode();
 
-    switch (loc) {
+    switch (location) {
     case eNFL_NetCache:
         json.SetByKey("CreationTime", CJsonNode::NewStringNode(
                 GetTime<eNFL_NetCache>().AsString(kOutputTimeFormat)));
@@ -214,26 +216,16 @@ void SLazyInitData::InitJson()
         json.SetString("Location", "NotFound");
     }
 
-    if (loc_info)
-        json.SetByKey("ObjectLocInfo", loc_info);
+    json.SetString("ObjectLoc", object_loc);
 
-    if (st_info)
-        json.SetByKey("StorageSpecificInfo", st_info);
-}
+    if (!object_key.empty())
+        json.SetString("ObjectKey", object_key);
 
-string SNetStorageObjectInfoImpl::GetNFSPathname() const
-{
-    try {
-        if (CJsonNode st_info = GetStorageSpecificInfo())
-            return st_info.GetString("path");
-    }
-    catch (CJsonException& e) {
-        if (e.GetErrCode() != CJsonException::eKeyNotFound)
-            throw;
-    }
+    if (object_loc_info)
+        json.SetByKey("ObjectLocInfo", object_loc_info);
 
-    NCBI_THROW_FMT(CNetStorageException, eInvalidArg,
-            "Cannot retrieve NFS path information for '" << m_Loc << '\'');
+    if (st_info)
+        json.SetByKey("StorageSpecificInfo", st_info);
 }
 
 CNetStorageObjectInfo g_CreateNetStorageObjectInfo(const string& object_loc,
@@ -241,15 +233,16 @@ CNetStorageObjectInfo g_CreateNetStorageObjectInfo(const string& object_loc,
         const CNetStorageObjectLoc* object_loc_struct,
         Uint8 file_size, CJsonNode::TInstance storage_specific_info)
 {
-    return new SNetStorageObjectInfoImpl(object_loc, SData(location,
+    return new SNetStorageObjectInfoImpl(SData(location, object_loc,
+            object_loc_struct ? object_loc_struct->GetUniqueKey() : kEmptyStr,
             object_loc_struct ? object_loc_struct->ToJSON() : NULL,
             file_size, storage_specific_info));
 }
 
-CNetStorageObjectInfo g_CreateNetStorageObjectInfo(const string& object_loc,
+CNetStorageObjectInfo g_CreateNetStorageObjectInfo(
         const CJsonNode& object_info_node)
 {
-    return new SNetStorageObjectInfoImpl(object_loc, object_info_node);
+    return new SNetStorageObjectInfoImpl(object_info_node);
 }
 
 TLocation CNetStorageObjectInfo::GetLocation() const
@@ -277,11 +270,6 @@ CJsonNode CNetStorageObjectInfo::GetStorageSpecificInfo() const
     return m_Impl->GetStorageSpecificInfo();
 }
 
-string CNetStorageObjectInfo::GetNFSPathname() const
-{
-    return m_Impl->GetNFSPathname();
-}
-
 CJsonNode CNetStorageObjectInfo::ToJSON()
 {
     return m_Impl->GetJSON();
diff --git a/c++/src/connect/services/netstorageobjectloc.cpp b/c++/src/connect/services/netstorageobjectloc.cpp
index a590d08..11062aa 100644
--- a/c++/src/connect/services/netstorageobjectloc.cpp
+++ b/c++/src/connect/services/netstorageobjectloc.cpp
@@ -1,4 +1,4 @@
-/*  $Id: netstorageobjectloc.cpp 460956 2015-03-04 17:37:13Z sadyrovr $
+/*  $Id: netstorageobjectloc.cpp 499845 2016-04-28 16:13:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -46,8 +46,6 @@
 
 #define NCBI_USE_ERRCODE_X  NetStorage_Common
 
-#define DEFAULT_CACHE_CHUNK_SIZE (1024 * 1024)
-
 #define FILETRACK_STORAGE_CODE "FT"
 #define NETCACHE_STORAGE_CODE "NC"
 
@@ -55,73 +53,41 @@
 
 BEGIN_NCBI_SCOPE
 
-/// @internal
-enum EFileTrackSite {
-    eFileTrack_ProdSite,
-    eFileTrack_DevSite,
-    eFileTrack_QASite,
-    eNumberOfFileTrackSites
-};
-
-/// @internal
-static EFileTrackSite s_StringToFileTrackSite(const char* ft_site_name)
-{
-    if (strcmp(ft_site_name, "submit") == 0 ||
-            strcmp(ft_site_name, "prod") == 0)
-        return eFileTrack_ProdSite;
-    else if (strcmp(ft_site_name, "dsubmit") == 0 ||
-            strcmp(ft_site_name, "dev") == 0)
-        return eFileTrack_DevSite;
-    else if (strcmp(ft_site_name, "qsubmit") == 0 ||
-            strcmp(ft_site_name, "qa") == 0)
-        return eFileTrack_QASite;
-    else {
-        NCBI_THROW_FMT(CArgException, eInvalidArg,
-                "unrecognized FileTrack site '" << ft_site_name << '\'');
-    }
-}
-
 CNetStorageObjectLoc::CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
         TNetStorageAttrFlags flags,
         const string& app_domain,
         Uint8 random_number,
-        const char* ft_site_name) :
+        EFileTrackSite ft_site) :
     m_CompoundIDPool(cid_pool),
-    m_LocatorFlags(x_StorageFlagsToLocatorFlags(flags)),
+    m_LocatorFlags(x_StorageFlagsToLocatorFlags(flags, ft_site)),
     m_ObjectID(0),
     m_Location(eNFL_Unknown),
     m_AppDomain(app_domain),
     m_Timestamp(time(NULL)),
     m_Random(random_number),
-    m_CacheChunkSize(DEFAULT_CACHE_CHUNK_SIZE),
+    m_ShortUniqueKey(MakeShortUniqueKey()),
+    m_UniqueKey(MakeUniqueKey()),
     m_NCFlags(0),
-    m_NetCacheIP(0),
-    m_NetCachePort(0),
     m_Dirty(true)
 {
-    x_SetFileTrackSite(ft_site_name);
-    x_SetUniqueKeyFromRandom();
+
 }
 
 CNetStorageObjectLoc::CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
         TNetStorageAttrFlags flags,
         const string& app_domain,
         const string& unique_key,
-        const char* ft_site_name) :
+        EFileTrackSite ft_site) :
     m_CompoundIDPool(cid_pool),
-    m_LocatorFlags(x_StorageFlagsToLocatorFlags(flags) | fLF_HasUserKey),
+    m_LocatorFlags(x_StorageFlagsToLocatorFlags(flags, ft_site) | fLF_HasUserKey),
     m_ObjectID(0),
     m_Location(eNFL_Unknown),
     m_AppDomain(app_domain),
-    m_UserKey(unique_key),
-    m_CacheChunkSize(DEFAULT_CACHE_CHUNK_SIZE),
+    m_ShortUniqueKey(unique_key),
+    m_UniqueKey(MakeUniqueKey()),
     m_NCFlags(0),
-    m_NetCacheIP(0),
-    m_NetCachePort(0),
     m_Dirty(true)
 {
-    x_SetFileTrackSite(ft_site_name);
-    x_SetUniqueKeyFromUserDefinedKey();
 }
 
 #define INVALID_LOC_ERROR_MSG "Invalid NetStorage object locator"
@@ -153,10 +119,7 @@ CNetStorageObjectLoc::CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
     m_CompoundIDPool(cid_pool),
     m_ObjectID(0),
     m_Location(eNFL_Unknown),
-    m_CacheChunkSize(DEFAULT_CACHE_CHUNK_SIZE),
     m_NCFlags(0),
-    m_NetCacheIP(0),
-    m_NetCachePort(0),
     m_Dirty(false),
     m_Locator(object_loc)
 {
@@ -168,10 +131,7 @@ CNetStorageObjectLoc::CNetStorageObjectLoc(CCompoundIDPool::TInstance cid_pool,
     m_CompoundIDPool(cid_pool),
     m_ObjectID(0),
     m_Location(eNFL_Unknown),
-    m_CacheChunkSize(DEFAULT_CACHE_CHUNK_SIZE),
     m_NCFlags(0),
-    m_NetCacheIP(0),
-    m_NetCachePort(0),
     m_Dirty(false),
     m_Locator(object_loc)
 {
@@ -224,9 +184,7 @@ void CNetStorageObjectLoc::Parse(const string& object_loc)
     if (m_LocatorFlags & fLF_HasUserKey) {
         // Get the unique object key.
         VERIFY_FIELD_EXISTS(field = field.GetNextNeighbor());
-        m_UserKey = field.GetString();
-
-        x_SetUniqueKeyFromUserDefinedKey();
+        m_ShortUniqueKey = field.GetString();
     } else {
         // Get object creation timestamp.
         VERIFY_FIELD_EXISTS(field = field.GetNextNeighbor());
@@ -236,14 +194,14 @@ void CNetStorageObjectLoc::Parse(const string& object_loc)
         m_Random = (Uint8) field.GetRandom() << (sizeof(Uint4) * 8);
         VERIFY_FIELD_EXISTS(field = field.GetNextNeighbor());
         m_Random |= field.GetRandom();
-
-        x_SetUniqueKeyFromRandom();
+        m_ShortUniqueKey = MakeShortUniqueKey();
     }
 
-    // If this object is cacheable, load the size of cache chunks.
+    m_UniqueKey = MakeUniqueKey();
+
+    // Not used, though has to be read to be backward-compatible
     if (m_LocatorFlags & fLF_Cacheable) {
-        VERIFY_FIELD_EXISTS(field = field.GetNextNeighbor());
-        m_CacheChunkSize = (Uint8) field.GetInteger();
+        field.GetNextNeighbor();
     }
 
     // Find storage info (optional).
@@ -262,12 +220,6 @@ void CNetStorageObjectLoc::Parse(const string& object_loc)
                 // Get the service name.
                 VERIFY_FIELD_EXISTS(field = field.GetNextNeighbor());
                 m_NCServiceName = field.GetServiceName();
-                // Get the primary NetCache server IP and port.
-                if (m_NCFlags & fNCF_ServerSpecified) {
-                    VERIFY_FIELD_EXISTS(field = field.GetNextNeighbor());
-                    m_NetCacheIP = field.GetIPv4Address();
-                    m_NetCachePort = field.GetPort();
-                }
             }
 
             break;
@@ -277,9 +229,10 @@ void CNetStorageObjectLoc::Parse(const string& object_loc)
 
 void CNetStorageObjectLoc::SetLocation_NetCache(
         const string& service_name,
-        Uint4 server_ip, unsigned short server_port,
         bool allow_xsite_conn)
 {
+    if (m_Location == eNFL_NetCache) return;
+
     m_Dirty = true;
 
     m_LocationCode = NETCACHE_STORAGE_CODE;
@@ -287,11 +240,6 @@ void CNetStorageObjectLoc::SetLocation_NetCache(
 
     m_NCServiceName = service_name;
 
-    if (server_ip != 0 && server_port != 0)
-        m_NCFlags |= fNCF_ServerSpecified;
-    else
-        m_NCFlags &= ~(TNetCacheFlags) fNCF_ServerSpecified;
-
     if (allow_xsite_conn)
         m_NCFlags |= fNCF_AllowXSiteConn;
     else
@@ -300,9 +248,9 @@ void CNetStorageObjectLoc::SetLocation_NetCache(
     // NB: FileTrack site must not be reset.
 }
 
-void CNetStorageObjectLoc::SetLocation_FileTrack(const char* ft_site_name)
+void CNetStorageObjectLoc::SetLocation_FileTrack(EFileTrackSite ft_site)
 {
-    EFileTrackSite ft_site = s_StringToFileTrackSite(ft_site_name);
+    if (m_Location == eNFL_FileTrack) return;
 
     m_Dirty = true;
 
@@ -311,7 +259,6 @@ void CNetStorageObjectLoc::SetLocation_FileTrack(const char* ft_site_name)
 
     m_NCServiceName.clear();
     m_NCFlags = 0;
-    m_CacheChunkSize = DEFAULT_CACHE_CHUNK_SIZE;
 
     m_LocatorFlags &= ~(TLocatorFlags) (fLF_DevEnv | fLF_QAEnv);
 
@@ -321,57 +268,25 @@ void CNetStorageObjectLoc::SetLocation_FileTrack(const char* ft_site_name)
         m_LocatorFlags |= fLF_QAEnv;
 }
 
-string CNetStorageObjectLoc::GetFileTrackURL()
+CNetStorageObjectLoc::EFileTrackSite CNetStorageObjectLoc::GetFileTrackSite() const
 {
-    EFileTrackSite ft_site = m_LocatorFlags & fLF_DevEnv ? eFileTrack_DevSite :
+    return m_LocatorFlags & fLF_DevEnv ? eFileTrack_DevSite :
             m_LocatorFlags & fLF_QAEnv ? eFileTrack_QASite :
                     eFileTrack_ProdSite;
-
-    switch (ft_site) {
-    default:
-        return "https://submit.ncbi.nlm.nih.gov";
-        break;
-    case eFileTrack_DevSite:
-        return "https://dsubmit.ncbi.nlm.nih.gov";
-        break;
-    case eFileTrack_QASite:
-        return "https://qsubmit.ncbi.nlm.nih.gov";
-    }
 }
 
-void CNetStorageObjectLoc::x_SetFileTrackSite(const char* ft_site_name)
+string CNetStorageObjectLoc::MakeShortUniqueKey() const
 {
-    m_LocatorFlags &= ~(TLocatorFlags) (fLF_DevEnv | fLF_QAEnv);
+    string result = NStr::NumericToString(m_Timestamp);
+    result += '-';
+    result += NStr::NumericToString(m_Random);
 
-    switch (s_StringToFileTrackSite(ft_site_name)) {
-    case eFileTrack_DevSite:
-        m_LocatorFlags |= fLF_DevEnv;
-        break;
-    case eFileTrack_QASite:
-        m_LocatorFlags |= fLF_QAEnv;
-    default:
-        break;
-    }
-}
-
-void CNetStorageObjectLoc::x_SetUniqueKeyFromRandom()
-{
-    m_ICacheKey = NStr::NumericToString(m_Timestamp);
-    m_ICacheKey += '-';
-    m_ICacheKey += NStr::NumericToString(m_Random);
     if (m_LocatorFlags & fLF_HasObjectID) {
-        m_ICacheKey += '-';
-        m_ICacheKey.append(NStr::NumericToString(m_ObjectID));
+        result += '-';
+        result += NStr::NumericToString(m_ObjectID);
     }
-    m_UniqueKey = m_AppDomain + '-';
-    m_UniqueKey += m_ICacheKey;
-}
 
-void CNetStorageObjectLoc::x_SetUniqueKeyFromUserDefinedKey()
-{
-    m_ICacheKey = m_UserKey;
-    m_UniqueKey = m_AppDomain + '-';
-    m_UniqueKey += m_UserKey;
+    return result;
 }
 
 void CNetStorageObjectLoc::x_Pack() const
@@ -398,7 +313,7 @@ void CNetStorageObjectLoc::x_Pack() const
     // Save object identification
     if (m_LocatorFlags & fLF_HasUserKey)
         // Save the unique object key.
-        cid.AppendString(m_UserKey);
+        cid.AppendString(m_ShortUniqueKey);
     else {
         // Save object creation timestamp.
         cid.AppendTimestamp(m_Timestamp);
@@ -407,9 +322,9 @@ void CNetStorageObjectLoc::x_Pack() const
         cid.AppendRandom((Uint4) m_Random);
     }
 
-    // If this object is cacheable, save the size of cache chunks.
+    // Not used, though has to be written to be backward-compatible
     if (m_LocatorFlags & fLF_Cacheable)
-        cid.AppendInteger((Int8) m_CacheChunkSize);
+        cid.AppendInteger(0);
 
     // Save storage info (optional).
     if (m_Location != eNFL_Unknown) {
@@ -424,9 +339,6 @@ void CNetStorageObjectLoc::x_Pack() const
             cid.AppendFlags(m_NCFlags);
             // Save the service name.
             cid.AppendServiceName(m_NCServiceName);
-            // Save the primary NetCache server IP and port.
-            if (m_NCFlags & fNCF_ServerSpecified)
-                cid.AppendIPv4SockAddr(m_NetCacheIP, m_NetCachePort);
             break;
         default:
             break;
@@ -454,8 +366,9 @@ TNetStorageAttrFlags CNetStorageObjectLoc::GetStorageAttrFlags() const
 }
 
 CNetStorageObjectLoc::TLocatorFlags
-        CNetStorageObjectLoc::x_StorageFlagsToLocatorFlags(
-                TNetStorageAttrFlags storage_flags)
+CNetStorageObjectLoc::x_StorageFlagsToLocatorFlags(
+        TNetStorageAttrFlags storage_flags,
+        EFileTrackSite ft_site)
 {
     TLocatorFlags locator_flags = 0;
 
@@ -466,6 +379,11 @@ CNetStorageObjectLoc::TLocatorFlags
     if (storage_flags & fNST_NoMetaData)
         locator_flags |= fLF_NoMetaData;
 
+    if (ft_site == eFileTrack_DevSite)
+        locator_flags |= fLF_DevEnv;
+    else if (ft_site == eFileTrack_QASite)
+        locator_flags |= fLF_QAEnv;
+
     return locator_flags;
 }
 
@@ -488,9 +406,6 @@ void CNetStorageObjectLoc::ToJSON(CJsonNode& root) const
     if (m_LocatorFlags & fLF_NetStorageService)
         root.SetString("ServiceName", m_ServiceName);
 
-    if (m_LocatorFlags & fLF_HasObjectID)
-        root.SetInteger("ObjectID", (Int8) m_ObjectID);
-
     CJsonNode storage_flags(CJsonNode::NewObjectNode());
 
     storage_flags.SetBoolean("Movable",
@@ -502,18 +417,6 @@ void CNetStorageObjectLoc::ToJSON(CJsonNode& root) const
 
     root.SetByKey("StorageFlags", storage_flags);
 
-    root.SetString("Namespace", m_AppDomain);
-
-    if (m_LocatorFlags & fLF_HasUserKey)
-        root.SetString("UserKey", m_UserKey);
-    else {
-        root.SetInteger("Timestamp", (Int8) m_Timestamp);
-        root.SetInteger("Random", (Int8) m_Random);
-    }
-
-    if (m_LocatorFlags & fLF_Cacheable)
-        root.SetInteger("CacheChunkSize", (Int8) m_CacheChunkSize);
-
     if (!m_LocationCode.empty())
         root.SetString("DefaultLocation", m_LocationCode);
 
@@ -522,11 +425,6 @@ void CNetStorageObjectLoc::ToJSON(CJsonNode& root) const
     switch (m_Location) {
     case eNFL_NetCache:
         storage_info.SetString("ServiceName", m_NCServiceName);
-        if (m_NCFlags & fNCF_ServerSpecified) {
-            storage_info.SetString("ServerHost",
-                    g_NetService_gethostnamebyaddr(m_NetCacheIP));
-            storage_info.SetInteger("ServerPort", m_NetCachePort);
-        }
         storage_info.SetBoolean("AllowXSiteConn", IsXSiteProxyAllowed());
 
         root.SetByKey("NetCache", storage_info);
diff --git a/c++/src/connect/services/ns_job_serializer.cpp b/c++/src/connect/services/ns_job_serializer.cpp
index 5657263..78119a0 100644
--- a/c++/src/connect/services/ns_job_serializer.cpp
+++ b/c++/src/connect/services/ns_job_serializer.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ns_job_serializer.cpp 431261 2014-04-02 16:29:53Z kazimird $
+/*  $Id: ns_job_serializer.cpp 489744 2016-01-15 16:50:24Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/connect/services/ns_output_parser.cpp b/c++/src/connect/services/ns_output_parser.cpp
index 22dbdb5..c34c8b3 100644
--- a/c++/src/connect/services/ns_output_parser.cpp
+++ b/c++/src/connect/services/ns_output_parser.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ns_output_parser.cpp 449834 2014-10-21 16:34:48Z kazimird $
+/*  $Id: ns_output_parser.cpp 479861 2015-09-23 21:07:21Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -36,39 +36,6 @@
 
 BEGIN_NCBI_SCOPE
 
-static void NormalizeStatKeyName(CTempString& key)
-{
-    char* begin = const_cast<char*>(key.data());
-    char* end = begin + key.length();
-
-    while (begin < end && !isalnum(*begin))
-        ++begin;
-
-    while (begin < end && !isalnum(end[-1]))
-        --end;
-
-    if (begin == end) {
-        key = "_";
-        return;
-    }
-
-    key.assign(begin, end - begin);
-
-    for (; begin < end; ++begin)
-        *begin = isalnum(*begin) ? tolower(*begin) : '_';
-}
-
-static inline string UnquoteIfQuoted(const CTempString& str)
-{
-    switch (str[0]) {
-    case '"':
-    case '\'':
-        return NStr::ParseQuoted(str);
-    default:
-        return str;
-    }
-}
-
 #define INVALID_FORMAT_ERROR() \
     NCBI_THROW2(CStringException, eFormat, \
             (*m_Ch == '\0' ? "Unexpected end of NetSchedule output" : \
@@ -309,277 +276,6 @@ CJsonNode CNetScheduleStructuredOutputParser::ParseValue()
     INVALID_FORMAT_ERROR();
 }
 
-class CExecAndParseStructuredOutput : public IExecToJson
-{
-public:
-    CExecAndParseStructuredOutput(const string& cmd) :
-        m_Cmd(cmd)
-    {
-        g_AppendClientIPSessionIDHitID(m_Cmd);
-    }
-
-protected:
-    virtual CJsonNode ExecOn(CNetServer server);
-
-private:
-    string m_Cmd;
-};
-
-CJsonNode CExecAndParseStructuredOutput::ExecOn(CNetServer server)
-{
-    CNetScheduleStructuredOutputParser parser;
-
-    return parser.ParseObject(server.ExecWithRetry(m_Cmd, false).response);
-}
-
-CJsonNode g_ExecStructuredNetScheduleCmdToJson(CNetScheduleAPI ns_api,
-        const string& cmd, CNetService::EServiceType service_type)
-{
-    CExecAndParseStructuredOutput exec_and_parse_structured_output(cmd);
-
-    return g_ExecToJson(exec_and_parse_structured_output,
-            ns_api.GetService(), service_type, CNetService::eIncludePenalized);
-}
-
-struct {
-    const char* command;
-    const char* record_prefix;
-    const char* entity_name;
-} static const s_StatTopics[eNumberOfNetStheduleStatTopics] = {
-    // eNetScheduleStatJobGroups
-    {"STAT GROUPS", "GROUP: ", "group"},
-    // eNetScheduleStatClients
-    {"STAT CLIENTS", "CLIENT: ", "client_node"},
-    // eNetScheduleStatNotifications
-    {"STAT NOTIFICATIONS", "CLIENT: ", "client_node"},
-    // eNetScheduleStatAffinities
-    {"STAT AFFINITIES", "AFFINITY: ", "affinity_token"}
-};
-
-string g_GetNetScheduleStatCommand(ENetScheduleStatTopic topic)
-{
-    return s_StatTopics[topic].command;
-}
-
-CJsonNode g_GenericStatToJson(CNetServer server,
-        ENetScheduleStatTopic topic, bool verbose)
-{
-    string stat_cmd(s_StatTopics[topic].command);
-    CTempString prefix(s_StatTopics[topic].record_prefix);
-    CTempString entity_name(s_StatTopics[topic].entity_name);
-
-    if (verbose)
-        stat_cmd.append(" VERBOSE");
-
-    CNetServerMultilineCmdOutput output(server.ExecWithRetry(stat_cmd, true));
-
-    CJsonNode entities(CJsonNode::NewArrayNode());
-    CJsonNode entity_info;
-    CJsonNode array_value;
-
-    string line;
-
-    while (output.ReadLine(line)) {
-        if (NStr::StartsWith(line, prefix)) {
-            if (entity_info)
-                entities.Append(entity_info);
-            entity_info = CJsonNode::NewObjectNode();
-            entity_info.SetString(entity_name, UnquoteIfQuoted(
-                    CTempString(line.data() + prefix.length(),
-                    line.length() - prefix.length())));
-        } else if (entity_info && NStr::StartsWith(line, "  ")) {
-            if (NStr::StartsWith(line, "    ") && array_value) {
-                array_value.AppendString(UnquoteIfQuoted(
-                        NStr::TruncateSpaces(line, NStr::eTrunc_Begin)));
-            } else {
-                if (array_value)
-                    array_value = NULL;
-                CTempString key, value;
-                NStr::SplitInTwo(line, ":", key, value);
-                NormalizeStatKeyName(key);
-                string key_norm(key);
-                value = NStr::TruncateSpaces_Unsafe(value, NStr::eTrunc_Begin);
-                if (value.empty())
-                    entity_info.SetByKey(key_norm, array_value =
-                            CJsonNode::NewArrayNode());
-                else
-                    entity_info.SetByKey(key_norm, CJsonNode::GuessType(value));
-            }
-        }
-    }
-    if (entity_info)
-        entities.Append(entity_info);
-
-    return entities;
-}
-
-bool g_FixMisplacedPID(CJsonNode& stat_info, CTempString& executable_path,
-        const char* pid_key)
-{
-    SIZE_TYPE misplaced_pid = NStr::Find(executable_path, "; PID: ");
-    if (misplaced_pid == NPOS)
-        return false;
-
-    SIZE_TYPE pos = misplaced_pid + sizeof("; PID: ") - 1;
-    stat_info.SetInteger(pid_key, NStr::StringToInt8(
-            CTempString(executable_path.data() + pos,
-                    executable_path.length() - pos)));
-    executable_path.erase(misplaced_pid);
-    return true;
-}
-
-CJsonNode g_LegacyStatToJson(CNetServer server, bool verbose)
-{
-    const string stat_cmd(verbose ? "STAT ALL" : "STAT");
-
-    CNetServerMultilineCmdOutput output(server.ExecWithRetry(stat_cmd, true));
-
-    CJsonNode stat_info(CJsonNode::NewObjectNode());
-    CJsonNode jobs_by_status(CJsonNode::NewObjectNode());;
-    stat_info.SetByKey("JobsByStatus", jobs_by_status);
-    CJsonNode section_entries;
-
-    string line;
-    CTempString key, value;
-
-    while (output.ReadLine(line)) {
-        if (line.empty() || isspace(line[0]))
-            continue;
-
-        if (line[0] == '[') {
-            size_t section_name_len = line.length();
-            while (--section_name_len > 0 &&
-                    (line[section_name_len] == ':' ||
-                    line[section_name_len] == ']' ||
-                    isspace(line[section_name_len])))
-                ;
-            line.erase(0, 1);
-            line.resize(section_name_len);
-            stat_info.SetByKey(line,
-                    section_entries = CJsonNode::NewArrayNode());
-        }
-        else if (section_entries) {
-            section_entries.AppendString(line);
-        }
-        else if (NStr::SplitInTwo(line, ":", key, value)) {
-            value = NStr::TruncateSpaces_Unsafe(value, NStr::eTrunc_Begin);
-            if (CNetScheduleAPI::StringToStatus(key) !=
-                    CNetScheduleAPI::eJobNotFound)
-                jobs_by_status.SetInteger(key, NStr::StringToInt8(value));
-            else {
-                if (key == "Executable path" &&
-                        g_FixMisplacedPID(stat_info, value, "PID")) {
-                    if (!stat_info.HasKey("Version"))
-                        stat_info.SetString("Version", "Unknown");
-
-                    if (!stat_info.HasKey("Build date"))
-                        stat_info.SetString("Build date", "Unknown");
-                }
-                stat_info.SetByKey(key, CJsonNode::GuessType(value));
-            }
-        }
-    }
-
-    return stat_info;
-}
-
-struct SSingleQueueInfoToJson : public IExecToJson
-{
-    SSingleQueueInfoToJson(const CNetScheduleAdmin& ns_admin,
-            const string& queue_name) :
-        m_NetScheduleAdmin(ns_admin), m_QueueName(queue_name)
-    {
-    }
-
-    virtual CJsonNode ExecOn(CNetServer server);
-
-    CNetScheduleAdmin m_NetScheduleAdmin;
-    string m_QueueName;
-};
-
-CJsonNode SSingleQueueInfoToJson::ExecOn(CNetServer server)
-{
-    CNetScheduleAdmin::TQueueInfo queue_info;
-    m_NetScheduleAdmin.GetQueueInfo(server, m_QueueName, queue_info);
-
-    CJsonNode queue_info_node(CJsonNode::NewObjectNode());
-
-    ITERATE(CNetScheduleAdmin::TQueueInfo, qi, queue_info) {
-        queue_info_node.SetByKey(qi->first, CJsonNode::GuessType(qi->second));
-    }
-
-    return queue_info_node;
-}
-
-struct SQueueInfoToJson : public IExecToJson
-{
-    SQueueInfoToJson(const string& cmd, const string& section_prefix) :
-        m_Cmd(cmd), m_SectionPrefix(section_prefix)
-    {
-        g_AppendClientIPSessionIDHitID(m_Cmd);
-    }
-
-    virtual CJsonNode ExecOn(CNetServer server);
-
-    string m_Cmd;
-    string m_SectionPrefix;
-};
-
-CJsonNode SQueueInfoToJson::ExecOn(CNetServer server)
-{
-    CNetServerMultilineCmdOutput output(server.ExecWithRetry(m_Cmd, true));
-
-    CJsonNode queue_map(CJsonNode::NewObjectNode());
-    CJsonNode queue_params;
-
-    string line;
-    CTempString param_name, param_value;
-
-    while (output.ReadLine(line))
-        if (NStr::StartsWith(line, m_SectionPrefix) &&
-                line.length() > m_SectionPrefix.length())
-            queue_map.SetByKey(line.substr(m_SectionPrefix.length(),
-                    line.length() - m_SectionPrefix.length() - 1),
-                    queue_params = CJsonNode::NewObjectNode());
-        else if (queue_params && NStr::SplitInTwo(line, ": ",
-                param_name, param_value, NStr::eMergeDelims))
-            queue_params.SetByKey(param_name,
-                    CJsonNode::GuessType(param_value));
-
-    return queue_map;
-}
-
-CJsonNode g_QueueInfoToJson(CNetScheduleAPI ns_api,
-        const string& queue_name, CNetService::EServiceType service_type)
-{
-    if (queue_name.empty()) {
-        SQueueInfoToJson queue_info_proc("STAT QUEUES", "[queue ");
-
-        return g_ExecToJson(queue_info_proc, ns_api.GetService(),
-                service_type, CNetService::eIncludePenalized);
-    }
-
-    SSingleQueueInfoToJson single_queue_proc(ns_api.GetAdmin(), queue_name);
-
-    return g_ExecToJson(single_queue_proc, ns_api.GetService(),
-            service_type, CNetService::eIncludePenalized);
-}
-
-CJsonNode g_QueueClassInfoToJson(CNetScheduleAPI ns_api,
-        CNetService::EServiceType service_type)
-{
-    SQueueInfoToJson queue_info_proc("STAT QCLASSES", "[qclass ");
-
-    return g_ExecToJson(queue_info_proc, ns_api.GetService(),
-            service_type, CNetService::eIncludePenalized);
-}
-
-CJsonNode g_ReconfAndReturnJson(CNetScheduleAPI ns_api,
-        CNetService::EServiceType service_type)
-{
-    return g_ExecStructuredNetScheduleCmdToJson(ns_api, "RECO", service_type);
-}
-
 CAttrListParser::ENextAttributeType CAttrListParser::NextAttribute(
     CTempString* attr_name, string* attr_value, size_t* attr_column)
 {
@@ -639,155 +335,4 @@ CAttrListParser::ENextAttributeType CAttrListParser::NextAttribute(
     return eAttributeWithValue;
 }
 
-void CJobInfoToJSON::ProcessJobMeta(const CNetScheduleKey& key)
-{
-    m_JobInfo.SetString("server_host", g_NetService_TryResolveHost(key.host));
-    m_JobInfo.SetInteger("server_port", key.port);
-
-    m_JobInfo.SetInteger("job_id", key.id);
-
-    if (!key.queue.empty())
-        m_JobInfo.SetString("queue_name", UnquoteIfQuoted(key.queue));
-}
-
-void CJobInfoToJSON::BeginJobEvent(const CTempString& event_header)
-{
-    if (!m_JobEvents)
-        m_JobInfo.SetByKey("events", m_JobEvents = CJsonNode::NewArrayNode());
-
-    m_JobEvents.Append(m_CurrentEvent = CJsonNode::NewObjectNode());
-}
-
-void CJobInfoToJSON::ProcessJobEventField(const CTempString& attr_name,
-        const string& attr_value)
-{
-    m_CurrentEvent.SetByKey(attr_name, CJsonNode::GuessType(attr_value));
-}
-
-void CJobInfoToJSON::ProcessJobEventField(const CTempString& attr_name)
-{
-    m_CurrentEvent.SetNull(attr_name);
-}
-
-void CJobInfoToJSON::ProcessInputOutput(const string& data,
-        const CTempString& input_or_output)
-{
-    CJsonNode node(CJsonNode::NewObjectNode());
-
-    if (NStr::StartsWith(data, "D ")) {
-        node.SetString("storage", "embedded");
-        node.SetString("embedded_data", data.substr(2));
-    } else if (NStr::StartsWith(data, "K ")) {
-        node.SetString("storage", "netcache");
-        node.SetString("netcache_key", data.substr(2));
-    } else {
-        node.SetString("storage", "raw");
-        node.SetString("raw_data", data);
-    }
-
-    m_JobInfo.SetByKey(input_or_output, node);
-}
-
-void CJobInfoToJSON::ProcessJobInfoField(const CTempString& field_name,
-        const CTempString& field_value)
-{
-    m_JobInfo.SetByKey(field_name, CJsonNode::GuessType(field_value));
-}
-
-void CJobInfoToJSON::ProcessRawLine(const string& line)
-{
-    if (!m_UnparsableLines)
-        m_JobInfo.SetByKey("unparsable_lines",
-                m_UnparsableLines = CJsonNode::NewArrayNode());
-
-    m_UnparsableLines.AppendString(line);
-}
-
-void g_ProcessJobInfo(CNetScheduleAPI ns_api, const string& job_key,
-        IJobInfoProcessor* processor, bool verbose,
-        CCompoundIDPool::TInstance id_pool)
-{
-    processor->ProcessJobMeta(CNetScheduleKey(job_key, id_pool));
-
-    if (verbose) {
-        CNetServerMultilineCmdOutput output(ns_api.GetAdmin().DumpJob(job_key));
-
-        string line;
-
-        while (output.ReadLine(line)) {
-            if (!line.empty() && line[0] != '[' && !NStr::StartsWith(line,
-                    TEMP_STRING_CTOR("NCBI NetSchedule"))) {
-                CTempString field_name, field_value;
-
-                if (!NStr::SplitInTwo(line, TEMP_STRING_CTOR(": "),
-                        field_name, field_value, NStr::eMergeDelims))
-                    processor->ProcessRawLine(line);
-                else if (field_name == TEMP_STRING_CTOR("input") ||
-                        field_name == TEMP_STRING_CTOR("output"))
-                    processor->ProcessInputOutput(
-                            NStr::ParseQuoted(field_value), field_name);
-                else if (NStr::StartsWith(field_name,
-                        TEMP_STRING_CTOR("event"))) {
-                    processor->BeginJobEvent(field_name);
-
-                    try {
-                        CAttrListParser attr_parser;
-                        attr_parser.Reset(field_value);
-                        CAttrListParser::ENextAttributeType next_attr_type;
-                        CTempString attr_name;
-                        string attr_value;
-                        size_t attr_column;
-
-                        while ((next_attr_type = attr_parser.NextAttribute(
-                                &attr_name, &attr_value, &attr_column)) !=
-                                        CAttrListParser::eNoMoreAttributes)
-                            if (next_attr_type ==
-                                    CAttrListParser::eAttributeWithValue)
-                                processor->ProcessJobEventField(attr_name,
-                                        attr_value);
-                            else // CAttrListParser::eStandAloneAttribute
-                                processor->ProcessJobEventField(attr_name);
-                    }
-                    catch (CArgException&) {
-                        // Ignore this exception type.
-                    }
-                } else if (field_name != TEMP_STRING_CTOR("id") &&
-                        field_name != TEMP_STRING_CTOR("key"))
-                    processor->ProcessJobInfoField(field_name, field_value);
-            }
-        }
-    } else {
-        CNetScheduleJob job;
-        job.job_id = job_key;
-        CNetScheduleAPI::EJobStatus status(ns_api.GetJobDetails(job));
-
-        processor->ProcessJobInfoField(TEMP_STRING_CTOR("status"),
-                CNetScheduleAPI::StatusToString(status));
-
-        if (status == CNetScheduleAPI::eJobNotFound)
-            return;
-
-        processor->ProcessInputOutput(job.input, TEMP_STRING_CTOR("input"));
-
-        switch (status) {
-        default:
-            if (job.output.empty())
-                break;
-            /* FALL THROUGH */
-
-        case CNetScheduleAPI::eDone:
-        case CNetScheduleAPI::eReading:
-        case CNetScheduleAPI::eConfirmed:
-        case CNetScheduleAPI::eReadFailed:
-            processor->ProcessInputOutput(job.output,
-                    TEMP_STRING_CTOR("output"));
-            break;
-        }
-
-        if (!job.error_msg.empty())
-            processor->ProcessJobInfoField(TEMP_STRING_CTOR("err_msg"),
-                    job.error_msg);
-    }
-}
-
 END_NCBI_SCOPE
diff --git a/c++/src/connect/services/remote_app.cpp b/c++/src/connect/services/remote_app.cpp
index d31ec38..7f46a1a 100644
--- a/c++/src/connect/services/remote_app.cpp
+++ b/c++/src/connect/services/remote_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: remote_app.cpp 431247 2014-04-02 15:49:05Z kazimird $
+/*  $Id: remote_app.cpp 489744 2016-01-15 16:50:24Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -100,6 +100,15 @@ CNcbiOstream& CBlobStreamHelper::GetOStream(const string& fname /*= ""*/,
     return *m_OStream.get();
 }
 
+int CBlobStreamHelper::x_GetTypeAndName(CNcbiIstream& istream,
+        string& name)
+{
+    int res = eBlobStorage;
+    if (istream.good()) istream >> res;
+    if (istream.good()) ReadStrWithLen(istream, name);
+    return res;
+}
+
 CNcbiIstream& CBlobStreamHelper::GetIStream(string* fname /*= NULL*/,
     EStdOutErrStorageType* type /*= NULL*/)
 {
@@ -114,10 +123,7 @@ CNcbiIstream& CBlobStreamHelper::GetIStream(string* fname /*= NULL*/,
         string name;
         int tmp = (int)eBlobStorage;
         try {
-            if (m_IStream->good())
-                *m_IStream >> tmp;
-            if (m_IStream->good())
-                ReadStrWithLen(*m_IStream, name);
+            tmp = x_GetTypeAndName(*m_IStream, name);
         } catch (...) {
             if (!m_IStream->eof()) {
                 string msg =
@@ -235,8 +241,15 @@ static void s_ReplaceArg( vector<string>& args, const string& old_fname,
     }
 }
 
-void CRemoteAppRequest::Deserialize(CNcbiIstream& is)
+void CRemoteAppRequest::x_Deserialize(CNcbiIstream& is, TStoredFiles* files)
 {
+    // Partial deserialization doesn't create working dir and deserialize files,
+    // but fills the "files" map with deserialized filenames and blob IDs.
+    const bool partial_deserialization = files;
+
+    if (partial_deserialization)
+        files->clear();
+
     Reset();
 
     string cmdline;
@@ -248,23 +261,21 @@ void CRemoteAppRequest::Deserialize(CNcbiIstream& is)
     vector<string> args;
     if (!is.good()) return;
     is >> fcount;
-    if ( fcount > 0 )
+    if ( fcount > 0 && !partial_deserialization) {
         TokenizeCmdLine(GetCmdLine(), args);
-
+        x_CreateWDir();
+    }
 
     for( int i = 0; i < fcount; ++i) {
-        if ( i == 0 )
-            x_CreateWDir();
-
         string blobid, fname;
         ReadStrWithLen(is, fname);
         ReadStrWithLen(is, blobid);
         if (!is.good()) return;
-        if (blobid == kLocalFSSign) {
-            string nfname;
-            if (x_CopyLocalFile(fname, nfname))
-                s_ReplaceArg(args, fname, nfname);
-        } else {
+
+        const bool is_blob = blobid != kLocalFSSign;
+        if (partial_deserialization) {
+            files->insert(make_pair(fname, is_blob ? blobid : kEmptyStr));
+        } else if (is_blob) {
             string nfname = GetWorkingDir() + CDirEntry::GetPathSeparator()
                 + blobid;
             CNcbiOfstream of(nfname.c_str());
@@ -276,7 +287,7 @@ void CRemoteAppRequest::Deserialize(CNcbiIstream& is)
             }
         }
     }
-    if ( fcount > 0 ) {
+    if ( fcount > 0 && !partial_deserialization) {
         SetCmdLine(JoinCmdLine(args));
     }
 
@@ -293,12 +304,6 @@ void CRemoteAppRequest::Deserialize(CNcbiIstream& is)
     m_ExlusiveMode = tmp != 0;
 }
 
-bool CRemoteAppRequest::x_CopyLocalFile(const string& old_fname,
-                                               string& new_fname)
-{
-    return false;
-}
-
 void CRemoteAppRequest::Reset()
 {
     m_CmdLine = "";
@@ -316,7 +321,7 @@ void CRemoteAppRequest::x_CreateWDir()
 {
     if (!m_TmpDirName.empty())
         return;
-    m_TmpDirName = m_TmpDirPath + NStr::ULongToString(sm_DirCounter.Add(1));
+    m_TmpDirName = m_TmpDirPath + NStr::NumericToString(sm_DirCounter.Add(1));
     CDir wdir(m_TmpDirName);
     if (wdir.Exists())
         wdir.Remove();
diff --git a/c++/src/connect/services/srv_connections.cpp b/c++/src/connect/services/srv_connections.cpp
index 15f4634..990256b 100644
--- a/c++/src/connect/services/srv_connections.cpp
+++ b/c++/src/connect/services/srv_connections.cpp
@@ -1,4 +1,4 @@
-/*  $Id: srv_connections.cpp 477824 2015-09-02 12:20:47Z ivanov $
+/*  $Id: srv_connections.cpp 495142 2016-03-15 14:04:30Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -151,23 +151,20 @@ void SNetServerConnectionImpl::ReadCmdOutputLine(string& result,
         break;
     case eIO_Timeout:
         Abort();
-        NCBI_THROW_FMT(CNetSrvConnException, eReadTimeout,
-                "Communication timeout reading from " <<
-                m_Server->m_ServerInPool->m_Address.AsString() <<
+        CONNSERV_THROW_FMT(CNetSrvConnException, eReadTimeout, m_Server,
+                "Communication timeout while reading"
                 " (timeout=" << NcbiTimeoutToMs(
                         m_Socket.GetTimeout(eIO_Read)) / 1000.0 << "s)");
         break;
     case eIO_Closed:
         Abort();
-        NCBI_THROW_FMT(CNetSrvConnException, eConnClosedByServer,
-                "Connection closed by " <<
-                m_Server->m_ServerInPool->m_Address.AsString());
+        CONNSERV_THROW_FMT(CNetSrvConnException, eConnClosedByServer, m_Server,
+                "Connection closed");
         break;
     default: // invalid socket or request, bailing out
         Abort();
-        NCBI_THROW_FMT(CNetSrvConnException, eCommunicationError,
-                "Communication error reading from " <<
-                m_Server->m_ServerInPool->m_Address.AsString());
+        CONNSERV_THROW_FMT(CNetSrvConnException, eCommunicationError, m_Server,
+                "Communication error while reading");
     }
 
     if (NStr::StartsWith(result, "OK:")) {
@@ -232,34 +229,14 @@ void SNetServerConnectionImpl::WriteLine(const string& line)
         if (io_st != eIO_Success) {
             Abort();
 
-            NCBI_THROW_FMT(CNetSrvConnException, eWriteFailure,
-                "Failed to write to " <<
-                m_Server->m_ServerInPool->m_Address.AsString() << ": " <<
-                IO_StatusStr(io_st));
+            CONNSERV_THROW_FMT(CNetSrvConnException, eWriteFailure,
+                m_Server, "Failed to write: " << IO_StatusStr(io_st));
         }
         len -= n_written;
         buf += n_written;
     }
 }
 
-CConfig* INetServerConnectionListener::PreInit(CObject* api_impl,
-    CConfig* config, string* section)
-{
-    _ASSERT(section);
-
-    if (config) {
-        m_ClientName = config->GetString(*section, "client_name",
-                CConfig::eErr_NoThrow);
-
-        if (m_ClientName.empty()) {
-            m_ClientName = config->GetString(*section, "client",
-                    CConfig::eErr_NoThrow);
-        }
-    }
-
-    return OnPreInit(api_impl, config, section);
-}
-
 namespace {
     class CTimeoutKeeper
     {
@@ -618,12 +595,9 @@ CNetServerConnection SNetServerImpl::Connect(STimeout* timeout,
         if (io_st != eIO_Success) {
             conn->m_Socket.Close();
 
-            string message = "Could not connect to " +
-                m_ServerInPool->m_Address.AsString();
-            message += ": ";
-            message += IO_StatusStr(io_st);
-
-            NCBI_THROW(CNetSrvConnException, eConnectionFailure, message);
+            NCBI_THROW(CNetSrvConnException, eConnectionFailure,
+                FORMAT(m_ServerInPool->m_Address.AsString() <<
+                    ": Could not connect: " << IO_StatusStr(io_st)));
         }
 
 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT
@@ -639,7 +613,8 @@ CNetServerConnection SNetServerImpl::Connect(STimeout* timeout,
     m_ServerInPool->AdjustThrottlingParameters(SNetServerInPool::eCOR_Success);
 
     //LOG_POST("comm timeout: "<<*(timeout != NULL ? timeout: &m_ServerInPool->m_ServerPool->m_CommTimeout));
-    conn->m_Socket.SetDataLogging(eOff);
+    conn->m_Socket.SetDataLogging(
+            TServConn_ConnDataLogging::GetDefault() ? eOn : eOff);
     conn->m_Socket.SetTimeout(eIO_ReadWrite, timeout != NULL ? timeout :
                               &m_ServerInPool->m_ServerPool->m_CommTimeout);
     conn->m_Socket.DisableOSSendDelay();
diff --git a/c++/src/connect/services/srv_connections_impl.hpp b/c++/src/connect/services/srv_connections_impl.hpp
index 5723f5b..9e63c2c 100644
--- a/c++/src/connect/services/srv_connections_impl.hpp
+++ b/c++/src/connect/services/srv_connections_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef CONNECT_SERVICES___SRV_CONNECTIONS_IMPL__HPP
 #define CONNECT_SERVICES___SRV_CONNECTIONS_IMPL__HPP
 
-/*  $Id: srv_connections_impl.hpp 456051 2015-01-07 17:38:03Z kazimird $
+/*  $Id: srv_connections_impl.hpp 484804 2015-11-16 15:24:08Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -67,7 +67,25 @@ struct SNetServerMultilineCmdOutputImpl : public CObject
     bool m_ReadCompletely;
 };
 
-struct SNetServerInPool;
+class INetServerProperties : public CObject
+{
+};
+
+class INetServerConnectionListener : public CObject
+{
+public:
+    virtual CRef<INetServerProperties> AllocServerProperties() = 0;
+
+// Event handlers.
+public:
+    virtual CConfig* OnPreInit(CObject* api_impl, CConfig* config,
+            string* config_section, string& client_name) { return NULL; }
+    virtual void OnInit(CObject* api_impl,
+        CConfig* config, const string& config_section) = 0;
+    virtual void OnConnected(CNetServerConnection& connection) = 0;
+    virtual void OnError(const string& err_msg, CNetServer& server) = 0;
+    virtual void OnWarning(const string& warn_msg, CNetServer& server) = 0;
+};
 
 struct SNetServerConnectionImpl : public CObject
 {
@@ -112,6 +130,60 @@ public:
             const string& cmd) = 0;
 };
 
+// A host:port pair.
+struct SServerAddress {
+    SServerAddress(unsigned h, unsigned short p) : host(h), port(p), name(h) {}
+    SServerAddress(const string &n, unsigned short p)
+        : host(g_NetService_gethostbyname(n)), port(p), name(n, host) {}
+
+    bool operator ==(const SServerAddress& h) const
+    {
+        return host == h.host && port == h.port;
+    }
+
+    bool operator <(const SServerAddress& right) const
+    {
+        int cmp = int(host) - int(right.host);
+        return cmp < 0 || (cmp == 0 && port < right.port);
+    }
+
+    string AsString() const
+    {
+        string address(name.get(host));
+        address += ':';
+        address += NStr::UIntToString(port);
+
+        return address;
+    }
+
+    unsigned host;
+    unsigned short port;
+
+private:
+    struct SName
+    {
+        SName() : host(0) {}
+        SName(unsigned h) : host(h) {}
+        SName(const string &n, unsigned h) : name(n), host(h) {}
+
+        string get(unsigned h)
+        {
+            // Name was not looked up yet or host changed
+            if (name.empty() || host != h) {
+                host = h;
+                name = g_NetService_gethostnamebyaddr(h);
+            }
+
+            return name;
+        }
+
+        string name;
+        unsigned host;
+    };
+
+    mutable SName name;
+};
+
 struct SNetServerInPool : public CObject
 {
     SNetServerInPool(unsigned host, unsigned short port,
diff --git a/c++/src/connect/services/timeline.hpp b/c++/src/connect/services/timeline.hpp
deleted file mode 100644
index 5c0eb5b..0000000
--- a/c++/src/connect/services/timeline.hpp
+++ /dev/null
@@ -1,193 +0,0 @@
-#ifndef CONNECT_SERVICES__TIMELINE_HPP
-#define CONNECT_SERVICES__TIMELINE_HPP
-
-/*  $Id: timeline.hpp 470756 2015-06-18 17:19:13Z ivanov $
- * ===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors:  Dmitry Kazimirov
- *
- * File Description:
- *   Grid Worker Node Timeline - declarations.
- *
- */
-
-#include <corelib/ncbitime.hpp>
-
-BEGIN_NCBI_SCOPE
-
-class CWorkerNodeTimeline_Base;
-
-class NCBI_XCONNECT_EXPORT CWorkerNodeTimelineEntry : public CObject
-{
-public:
-    friend class CWorkerNodeTimeline_Base;
-
-    CWorkerNodeTimelineEntry() : m_Timeline(NULL), m_Deadline(0, 0) {}
-
-    bool IsInTimeline() const {return m_Timeline != NULL;}
-
-    void MoveTo(CWorkerNodeTimeline_Base* timeline);
-
-    const CDeadline GetTimeout() const {return m_Deadline;}
-
-    void ResetTimeout(unsigned seconds)
-    {
-        m_Deadline = CDeadline(seconds, 0);
-    }
-
-    bool TimeHasCome() const
-    {
-        return m_Deadline.GetRemainingTime().IsZero();
-    }
-
-    CWorkerNodeTimelineEntry* GetNext() const
-    {
-        return m_Next;
-    }
-
-private:
-    CWorkerNodeTimeline_Base* m_Timeline;
-    CWorkerNodeTimelineEntry* m_Prev;
-    CWorkerNodeTimelineEntry* m_Next;
-    CDeadline                 m_Deadline;
-};
-
-class NCBI_XCONNECT_EXPORT CWorkerNodeTimeline_Base
-{
-protected:
-    friend class CWorkerNodeTimelineEntry;
-
-    CWorkerNodeTimeline_Base() : m_Head(NULL), m_Tail(NULL)
-    {
-    }
-
-public:
-    bool IsEmpty() const {return m_Head == NULL;}
-
-    void Push(CWorkerNodeTimelineEntry* new_entry)
-    {
-        _ASSERT(new_entry->m_Timeline == NULL);
-        AttachTail(new_entry);
-        new_entry->AddReference();
-    }
-
-protected:
-    void AttachTail(CWorkerNodeTimelineEntry* new_tail)
-    {
-        new_tail->m_Timeline = this;
-        new_tail->m_Next = NULL;
-        if ((new_tail->m_Prev = m_Tail) != NULL)
-            m_Tail->m_Next = new_tail;
-        else
-            m_Head = new_tail;
-        m_Tail = new_tail;
-    }
-
-    CWorkerNodeTimelineEntry* DetachHead()
-    {
-        _ASSERT(m_Head != NULL);
-        CWorkerNodeTimelineEntry* detached_head = m_Head;
-        if ((m_Head = detached_head->m_Next) != NULL)
-            m_Head->m_Prev = NULL;
-        else
-            m_Tail = NULL;
-        detached_head->m_Timeline = NULL;
-        return detached_head;
-    }
-
-public:
-    void MoveHeadTo(CWorkerNodeTimeline_Base* timeline)
-    {
-        timeline->AttachTail(DetachHead());
-    }
-
-    void Clear()
-    {
-        CWorkerNodeTimelineEntry* entry = m_Head;
-        if (entry != NULL) {
-            m_Tail = m_Head = NULL;
-            do {
-                entry->m_Timeline = NULL;
-                CWorkerNodeTimelineEntry* next_entry = entry->m_Next;
-                entry->RemoveReference();
-                entry = next_entry;
-            } while (entry != NULL);
-        }
-    }
-
-protected:
-    ~CWorkerNodeTimeline_Base()
-    {
-        Clear();
-    }
-
-    CWorkerNodeTimelineEntry* m_Head;
-    CWorkerNodeTimelineEntry* m_Tail;
-};
-
-inline void CWorkerNodeTimelineEntry::MoveTo(CWorkerNodeTimeline_Base* timeline)
-{
-    if (m_Timeline != timeline) {
-        if (m_Timeline == NULL)
-            AddReference();
-        else {
-            if (m_Prev == NULL)
-                if ((m_Timeline->m_Head = m_Next) != NULL)
-                    m_Next->m_Prev = NULL;
-                else
-                    m_Timeline->m_Tail = NULL;
-            else if (m_Next == NULL)
-                (m_Timeline->m_Tail = m_Prev)->m_Next = NULL;
-            else
-                (m_Prev->m_Next = m_Next)->m_Prev = m_Prev;
-        }
-        timeline->AttachTail(this);
-    }
-}
-
-template <typename TTimelineEntry, typename TRefType>
-class CWorkerNodeTimeline : public CWorkerNodeTimeline_Base
-{
-public:
-    TRefType GetHead() const
-    {
-        return TRefType(static_cast<TTimelineEntry*>(m_Head));
-    }
-    TRefType GetNext(TRefType ref) const
-    {
-        _ASSERT(ref);
-        return TRefType(static_cast<TTimelineEntry*>(ref->GetNext()));
-    }
-    void Shift(TRefType& ref)
-    {
-        CWorkerNodeTimelineEntry* head = DetachHead();
-        ref = static_cast<TTimelineEntry*>(head);
-        head->RemoveReference();
-    }
-};
-
-END_NCBI_SCOPE
-
-#endif // !defined(CONNECT_SERVICES__TIMELINE_HPP)
diff --git a/c++/src/connect/services/tmp_wn_info.cpp b/c++/src/connect/services/tmp_wn_info.cpp
new file mode 100644
index 0000000..13c63c4
--- /dev/null
+++ b/c++/src/connect/services/tmp_wn_info.cpp
@@ -0,0 +1,452 @@
+/*  $Id: tmp_wn_info.cpp 486255 2015-12-02 17:51:03Z sadyrovr $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Author: Dmitry Kazimirov
+ *
+ */
+
+#include <ncbi_pch.hpp>
+
+#include "netschedule_api_impl.hpp"
+
+#include <connect/services/netschedule_api.hpp>
+
+// XXX: Workaround for VAR-1651
+// TODO: Merge this code with code of grid_cli (see also r485314).
+
+BEGIN_NCBI_SCOPE
+
+typedef CNetScheduleAdmin::SWorkerNodeInfo SWorkerNodeInfo;
+
+/// Types of administrative information NetSchedule can return.
+///
+enum ENetScheduleStatTopic {
+    eNetScheduleStatJobGroups,
+    eNetScheduleStatClients,
+    eNetScheduleStatNotifications,
+    eNetScheduleStatAffinities,
+    eNumberOfNetStheduleStatTopics
+};
+
+/// Return unquoted and unescaped version of 'str' if it
+/// starts with a quote. Otherwise, return 'str' itself.
+///
+string s_UnquoteIfQuoted(const CTempString& str);
+
+/// Return a JSON object that contains the requested infromation.
+/// The structure of the object depends on the topic.
+///
+CJsonNode s_GenericStatToJson(CNetServer server,
+        ENetScheduleStatTopic topic, bool verbose);
+
+/// Convert 'server_info' to a JSON object.
+///
+CJsonNode s_ServerInfoToJson(CNetServerInfo server_info,
+        bool server_version_key);
+
+/// Detect older format of the worker node info line that contained
+/// executable name followed by PID.
+/// @return false if 'stat_info' already has the new format
+///         of the executable name; true if 'stat_info' was fixed.
+///
+bool s_FixMisplacedPID(CJsonNode& stat_info, CTempString& executable_path,
+        const char* pid_key);
+
+/// Return a JSON object that contains status information reported
+/// by the specified worker node.
+///
+CJsonNode s_WorkerNodeInfoToJson(CNetServer worker_node);
+
+void s_GetWorkerNodes(CNetScheduleAPI api, list<SWorkerNodeInfo>& worker_nodes)
+{
+    worker_nodes.clear();
+
+    set<string> unique_sessions;
+
+    for (CNetServiceIterator iter = api->m_Service.Iterate(
+            CNetService::eIncludePenalized); iter; ++iter) {
+
+        CJsonNode client_info_array = s_GenericStatToJson(*iter,
+                eNetScheduleStatClients, /*verbose*/ false);
+
+        for (CJsonIterator client_info_iter = client_info_array.Iterate();
+                client_info_iter; ++client_info_iter) {
+            CJsonNode client_info = *client_info_iter;
+            if (NStr::Find(client_info.GetString("type"),
+                    "worker node") == NPOS)
+                continue;
+
+            string session = client_info.GetString("session");
+
+            if (unique_sessions.insert(session).second) {
+                worker_nodes.push_back(SWorkerNodeInfo());
+
+                SWorkerNodeInfo& wn_info = worker_nodes.back();
+                wn_info.name = client_info.GetString("client_node");
+                wn_info.prog = session;
+                wn_info.host = client_info.GetString("client_host");
+                wn_info.port = (unsigned short)
+                        client_info.GetInteger("worker_node_control_port");
+                wn_info.last_access = CTime(
+                        client_info.GetString("last_access"), "M/D/Y h:m:s.r");
+            }
+        }
+    }
+}
+
+CJsonNode g_GetWorkerNodeInfo(CNetScheduleAPI api)
+{
+    CJsonNode result(CJsonNode::NewObjectNode());
+
+    list<SWorkerNodeInfo> worker_nodes;
+    s_GetWorkerNodes(api, worker_nodes);
+
+    ITERATE(list<CNetScheduleAdmin::SWorkerNodeInfo>, wn_info, worker_nodes) {
+        CNetScheduleAPI wn_api(wn_info->host + ':' +
+                NStr::NumericToString(wn_info->port),
+                api->m_Service->GetClientName(),
+                kEmptyStr);
+
+        result.SetByKey(wn_info->prog, s_WorkerNodeInfoToJson(
+                wn_api.GetService().Iterate().GetServer()));
+    }
+
+    return result;
+}
+
+struct {
+    const char* command;
+    const char* record_prefix;
+    const char* entity_name;
+} static const s_StatTopics[eNumberOfNetStheduleStatTopics] = {
+    // eNetScheduleStatJobGroups
+    {"STAT GROUPS", "GROUP: ", "group"},
+    // eNetScheduleStatClients
+    {"STAT CLIENTS", "CLIENT: ", "client_node"},
+    // eNetScheduleStatNotifications
+    {"STAT NOTIFICATIONS", "CLIENT: ", "client_node"},
+    // eNetScheduleStatAffinities
+    {"STAT AFFINITIES", "AFFINITY: ", "affinity_token"}
+};
+
+string s_UnquoteIfQuoted(const CTempString& str)
+{
+    switch (str[0]) {
+    case '"':
+    case '\'':
+        return NStr::ParseQuoted(str);
+    default:
+        return str;
+    }
+}
+
+static void NormalizeStatKeyName(CTempString& key)
+{
+    char* begin = const_cast<char*>(key.data());
+    char* end = begin + key.length();
+
+    while (begin < end && !isalnum(*begin))
+        ++begin;
+
+    while (begin < end && !isalnum(end[-1]))
+        --end;
+
+    if (begin == end) {
+        key = "_";
+        return;
+    }
+
+    key.assign(begin, end - begin);
+
+    for (; begin < end; ++begin)
+        *begin = isalnum(*begin) ? tolower(*begin) : '_';
+}
+
+bool s_FixMisplacedPID(CJsonNode& stat_info, CTempString& executable_path,
+        const char* pid_key)
+{
+    SIZE_TYPE misplaced_pid = NStr::Find(executable_path, "; PID: ");
+    if (misplaced_pid == NPOS)
+        return false;
+
+    SIZE_TYPE pos = misplaced_pid + sizeof("; PID: ") - 1;
+    stat_info.SetInteger(pid_key, NStr::StringToInt8(
+            CTempString(executable_path.data() + pos,
+                    executable_path.length() - pos)));
+    executable_path.erase(misplaced_pid);
+    return true;
+}
+
+CJsonNode s_GenericStatToJson(CNetServer server,
+        ENetScheduleStatTopic topic, bool verbose)
+{
+    string stat_cmd(s_StatTopics[topic].command);
+    CTempString prefix(s_StatTopics[topic].record_prefix);
+    CTempString entity_name(s_StatTopics[topic].entity_name);
+
+    if (verbose)
+        stat_cmd.append(" VERBOSE");
+
+    g_AppendClientIPSessionIDHitID(stat_cmd);
+
+    CNetServerMultilineCmdOutput output(server.ExecWithRetry(stat_cmd, true));
+
+    CJsonNode entities(CJsonNode::NewArrayNode());
+    CJsonNode entity_info;
+    CJsonNode array_value;
+
+    string line;
+
+    while (output.ReadLine(line)) {
+        if (NStr::StartsWith(line, prefix)) {
+            if (entity_info)
+                entities.Append(entity_info);
+            entity_info = CJsonNode::NewObjectNode();
+            entity_info.SetString(entity_name, s_UnquoteIfQuoted(
+                    CTempString(line.data() + prefix.length(),
+                    line.length() - prefix.length())));
+        } else if (entity_info && NStr::StartsWith(line, "  ")) {
+            if (NStr::StartsWith(line, "    ") && array_value) {
+                array_value.AppendString(s_UnquoteIfQuoted(
+                        NStr::TruncateSpaces(line, NStr::eTrunc_Begin)));
+            } else {
+                if (array_value)
+                    array_value = NULL;
+                CTempString key, value;
+                NStr::SplitInTwo(line, ":", key, value);
+                NormalizeStatKeyName(key);
+                string key_norm(key);
+                value = NStr::TruncateSpaces_Unsafe(value, NStr::eTrunc_Begin);
+                if (value.empty())
+                    entity_info.SetByKey(key_norm, array_value =
+                            CJsonNode::NewArrayNode());
+                else
+                    entity_info.SetByKey(key_norm, CJsonNode::GuessType(value));
+            }
+        }
+    }
+    if (entity_info)
+        entities.Append(entity_info);
+
+    return entities;
+}
+
+CJsonNode s_ServerInfoToJson(CNetServerInfo server_info,
+        bool server_version_key)
+{
+    CJsonNode server_info_node(CJsonNode::NewObjectNode());
+
+    string attr_name, attr_value;
+
+    ESwitch old_format = eDefault;
+
+    while (server_info.GetNextAttribute(attr_name, attr_value)) {
+        switch (old_format) {
+        case eOn:
+            if (attr_name == "Build")
+                attr_name = "build_date";
+            else
+                NStr::ReplaceInPlace(NStr::ToLower(attr_name), " ", "_");
+            break;
+
+        case eDefault:
+            if (NStr::EndsWith(attr_name, " version"))
+            {
+                old_format = eOn;
+                attr_name = server_version_key ? "server_version" : "version";
+                break;
+            } else
+                old_format = eOff;
+            /* FALL THROUGH */
+
+        case eOff:
+            if (server_version_key && attr_name == "version")
+                attr_name = "server_version";
+        }
+
+        server_info_node.SetString(attr_name, attr_value);
+    }
+
+    return server_info_node;
+}
+
+static bool s_ExtractKey(const CTempString& line,
+        string& key, CTempString& value)
+{
+    key.erase(0, key.length());
+    SIZE_TYPE line_len = line.length();
+    key.reserve(line_len);
+
+    for (SIZE_TYPE i = 0; i < line_len; ++i)
+    {
+        char c = line[i];
+        if (isalnum(c))
+            key += tolower(c);
+        else if (c == ' ' || c == '_' || c == '-')
+            key += '_';
+        else if (c != ':' || key.empty())
+            break;
+        else {
+            if (++i < line_len && line[i] == ' ')
+                ++i;
+            value.assign(line, i, line_len - i);
+            return true;
+        }
+    }
+    return false;
+}
+
+static CJsonNode s_WordsToJsonArray(const CTempString& str)
+{
+    CJsonNode array_node(CJsonNode::NewArrayNode());
+    list<CTempString> words;
+    NStr::Split(str, TEMP_STRING_CTOR(" "), words,
+            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
+    ITERATE(list<CTempString>, it, words) {
+        array_node.AppendString(*it);
+    }
+    return array_node;
+}
+
+inline static CNetServerInfo s_ServerInfoFromString(const string& server_info)
+{
+    return new SNetServerInfoImpl(server_info);
+}
+
+CJsonNode s_WorkerNodeInfoToJson(CNetServer worker_node)
+{
+    CNetServerMultilineCmdOutput output(
+            worker_node.ExecWithRetry("STAT", true));
+
+    CJsonNode wn_info(CJsonNode::NewObjectNode());
+
+    string line;
+    string key;
+    CTempString value;
+    CJsonNode job_counters(CJsonNode::NewObjectNode());
+    CJsonNode running_jobs(CJsonNode::NewArrayNode());
+    SIZE_TYPE pos;
+    int running_job_count = 0;
+    int free_worker_threads = 1;
+    bool suspended = false;
+    bool shutting_down = false;
+    bool exclusive_job = false;
+    bool working = false;
+
+    while (output.ReadLine(line)) {
+        if (line.empty() || isspace(line[0]))
+            continue;
+
+        if (running_job_count > 0) {
+            if ((pos = NStr::Find(CTempString(line),
+                            TEMP_STRING_CTOR("running for "),
+                            NStr::eNocase, NStr::eReverseSearch)) != NPOS) {
+                --running_job_count;
+
+                pos += sizeof("running for ") - 1;
+                Uint8 run_time = NStr::StringToUInt8(
+                        CTempString(line.data() + pos, line.length() - pos),
+                                NStr::fConvErr_NoThrow |
+                                NStr::fAllowLeadingSpaces |
+                                NStr::fAllowTrailingSymbols);
+
+                if ((pos = NStr::Find(line, TEMP_STRING_CTOR(" "))) != NPOS) {
+                    CJsonNode running_job(CJsonNode::NewObjectNode());
+
+                    running_job.SetString("key", CTempString(line.data(), pos));
+                    running_job.SetInteger("run_time", (Int8) run_time);
+                    running_jobs.Append(running_job);
+                }
+            }
+        } else if (NStr::StartsWith(line, TEMP_STRING_CTOR("Jobs "))) {
+            if (s_ExtractKey(CTempString(line.data() + sizeof("Jobs ") - 1,
+                    line.length() - (sizeof("Jobs ") - 1)), key, value)) {
+                job_counters.SetInteger(key, NStr::StringToInt8(value));
+                if (key == "running") {
+                    running_job_count = NStr::StringToInt(value,
+                            NStr::fConvErr_NoThrow |
+                            NStr::fAllowLeadingSpaces |
+                            NStr::fAllowTrailingSymbols);
+                    working = running_job_count > 0;
+                    free_worker_threads -= running_job_count;
+                }
+            }
+        } else if (s_ExtractKey(line, key, value)) {
+            if (key == "host_name")
+                key = "hostname";
+            else if (key == "node_started_at")
+                key = "started";
+            else if (key == "executable_path")
+                s_FixMisplacedPID(wn_info, value, "pid");
+            else if (key == "maximum_job_threads") {
+                int maximum_job_threads = NStr::StringToInt(value,
+                            NStr::fConvErr_NoThrow |
+                            NStr::fAllowLeadingSpaces |
+                            NStr::fAllowTrailingSymbols);
+                free_worker_threads += maximum_job_threads - 1;
+                wn_info.SetInteger(key, maximum_job_threads);
+                continue;
+            } else if (key == "netschedule_servers") {
+                if (value != "N/A")
+                    wn_info.SetByKey(key, s_WordsToJsonArray(value));
+                else
+                    wn_info.SetByKey(key, CJsonNode::NewArrayNode());
+                continue;
+            } else if (key == "preferred_affinities") {
+                wn_info.SetByKey(key, s_WordsToJsonArray(value));
+                continue;
+            }
+            wn_info.SetByKey(key, CJsonNode::GuessType(value));
+        } else if (wn_info.GetSize() == 0)
+            wn_info = s_ServerInfoToJson(s_ServerInfoFromString(line), false);
+        else if (NStr::Find(line, TEMP_STRING_CTOR("suspended")) != NPOS)
+            suspended = true;
+        else if (NStr::Find(line, TEMP_STRING_CTOR("shutting down")) != NPOS)
+            shutting_down = true;
+        else if (NStr::Find(line, TEMP_STRING_CTOR("exclusive job")) != NPOS)
+            exclusive_job = true;
+    }
+
+    if (!wn_info.HasKey("maximum_job_threads"))
+        wn_info.SetInteger("maximum_job_threads", 1);
+    if (!wn_info.HasKey("version"))
+        wn_info.SetString("version", kEmptyStr);
+    if (!wn_info.HasKey("build_date"))
+        wn_info.SetString("build_date", kEmptyStr);
+
+    wn_info.SetString("status",
+            shutting_down ? "shutting_down" :
+            suspended ? "suspended" :
+            exclusive_job ? "processing_exclusive_job" :
+            free_worker_threads == 0 ? "busy" :
+            working ? "working" : "ready");
+
+    wn_info.SetByKey("job_counters", job_counters);
+    wn_info.SetByKey("running_jobs", running_jobs);
+
+    return wn_info;
+}
+
+END_NCBI_SCOPE
diff --git a/c++/src/connect/services/util.cpp b/c++/src/connect/services/util.cpp
index d6a05ff..107fcb5 100644
--- a/c++/src/connect/services/util.cpp
+++ b/c++/src/connect/services/util.cpp
@@ -1,4 +1,4 @@
-/*  $Id: util.cpp 429107 2014-03-11 16:37:16Z kazimird $
+/*  $Id: util.cpp 485043 2015-11-18 14:43:31Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -78,7 +78,8 @@ inline SCmdLineArgListImpl::SCmdLineArgListImpl(
 inline SCmdLineArgListImpl::SCmdLineArgListImpl(const string& args) :
     m_File(NULL)
 {
-    NStr::Split(args, CCmdLineArgList::GetDelimiterString(), m_Args);
+    NStr::Split(args, CCmdLineArgList::GetDelimiterString(), m_Args,
+            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 }
 
 SCmdLineArgListImpl::~SCmdLineArgListImpl()
diff --git a/c++/src/connect/services/wn_commit_thread.cpp b/c++/src/connect/services/wn_commit_thread.cpp
index d470cb8..8ee2ede 100644
--- a/c++/src/connect/services/wn_commit_thread.cpp
+++ b/c++/src/connect/services/wn_commit_thread.cpp
@@ -1,4 +1,4 @@
-/*  $Id: wn_commit_thread.cpp 470126 2015-06-11 14:18:21Z ivanov $
+/*  $Id: wn_commit_thread.cpp 470774 2015-06-18 19:13:47Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -69,12 +69,11 @@ CWorkerNodeJobContext CJobCommitterThread::AllocJobContext()
 {
     TFastMutexGuard mutex_lock(m_TimelineMutex);
 
-    if (m_JobContextPool.IsEmpty())
+    if (m_JobContextPool.empty())
         return new SWorkerNodeJobContextImpl(m_WorkerNode);
 
-    CWorkerNodeJobContext job_context;
-
-    m_JobContextPool.Shift(job_context);
+    CWorkerNodeJobContext job_context(m_JobContextPool.front());
+    m_JobContextPool.pop_front();
 
     job_context->m_Job.Reset();
     job_context->m_JobGeneration = m_WorkerNode->m_CurrentJobGeneration;
@@ -96,7 +95,7 @@ void CJobCommitterThread::RecycleJobContextAndCommitJob(
     // the semaphore must be incremented.
     WakeUp();
 
-    m_ImmediateActions.Push(job_context);
+    m_ImmediateActions.push_back(TEntry(job_context));
 
     // We must do it here, before m_TimelineMutex is unlocked
     rctx_switcher.Release();
@@ -109,44 +108,48 @@ void CJobCommitterThread::Stop()
     WakeUp();
 }
 
+bool CJobCommitterThread::WaitForTimeout()
+{
+    CNanoTimeout timeout = m_Timeline.front()->GetTimeout().GetRemainingTime();
+
+    if (timeout.IsZero()) {
+        return true;
+    }
+
+    TFastMutexUnlockGuard mutext_unlock(m_TimelineMutex);
+    return !m_Semaphore.TryWait(timeout);
+}
+
 void* CJobCommitterThread::Main()
 {
     SetCurrentThreadName(m_ThreadName);
     TFastMutexGuard mutex_lock(m_TimelineMutex);
 
     do {
-        if (m_Timeline.IsEmpty()) {
+        if (m_Timeline.empty()) {
             TFastMutexUnlockGuard mutext_unlock(m_TimelineMutex);
 
             m_Semaphore.Wait();
-        } else {
-            unsigned sec, nanosec;
-
-            m_Timeline.GetHead()->GetTimeout().GetRemainingTime().GetNano(&sec,
-                    &nanosec);
-
-            if (sec == 0 && nanosec == 0)
-                m_Timeline.MoveHeadTo(&m_ImmediateActions);
-            else {
-                bool wait_interrupted;
-                {
-                    TFastMutexUnlockGuard mutext_unlock(m_TimelineMutex);
-
-                    wait_interrupted = m_Semaphore.TryWait(sec, nanosec);
-                }
-                if (!wait_interrupted)
-                    m_Timeline.MoveHeadTo(&m_ImmediateActions);
-            }
+        } else if (WaitForTimeout()) {
+            m_ImmediateActions.push_back(m_Timeline.front());
+            m_Timeline.pop_front();
         }
 
-        while (!m_ImmediateActions.IsEmpty())
+        while (!m_ImmediateActions.empty()) {
+            TEntry& entry = m_ImmediateActions.front();
+
             // Do not remove the job context from m_ImmediateActions
             // prior to calling x_CommitJob() to avoid race conditions
             // (otherwise, the semaphore can be Post()'ed multiple times
             // by the worker threads while this thread is in x_CommitJob()).
-            m_ImmediateActions.MoveHeadTo(
-                    x_CommitJob(m_ImmediateActions.GetHead()) ?
-                            &m_JobContextPool : &m_Timeline);
+            if (x_CommitJob(entry)) {
+                m_JobContextPool.push_back(entry);
+            } else {
+                m_Timeline.push_back(entry);
+            }
+
+            m_ImmediateActions.pop_front();
+        }
     } while (!CGridGlobals::GetInstance().IsShuttingDown());
 
     return NULL;
diff --git a/c++/src/connect/services/wn_commit_thread.hpp b/c++/src/connect/services/wn_commit_thread.hpp
index 4f827f3..4c7c2df 100644
--- a/c++/src/connect/services/wn_commit_thread.hpp
+++ b/c++/src/connect/services/wn_commit_thread.hpp
@@ -2,7 +2,7 @@
 #define WN_COMMIT_THREAD__HPP
 
 
-/*  $Id: wn_commit_thread.hpp 470126 2015-06-11 14:18:21Z ivanov $
+/*  $Id: wn_commit_thread.hpp 470774 2015-06-18 19:13:47Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -35,7 +35,7 @@
 
 #include <connect/services/grid_worker.hpp>
 
-#include "timeline.hpp"
+#include <deque>
 
 BEGIN_NCBI_SCOPE
 
@@ -86,16 +86,17 @@ public:
     void Stop();
 
 private:
-    typedef CWorkerNodeTimeline<SWorkerNodeJobContextImpl,
-            CWorkerNodeJobContext> TCommitJobTimeline;
+    typedef CRef<SWorkerNodeJobContextImpl> TEntry;
+    typedef deque<TEntry> TCommitJobTimeline;
 
     virtual void* Main();
 
+    bool WaitForTimeout();
     bool x_CommitJob(SWorkerNodeJobContextImpl* job_context);
 
     void WakeUp()
     {
-        if (m_ImmediateActions.IsEmpty())
+        if (m_ImmediateActions.empty())
             m_Semaphore.Post();
     }
 
diff --git a/c++/src/connect/services/wn_main_loop.cpp b/c++/src/connect/services/wn_main_loop.cpp
index 74fb811..37b58f4 100644
--- a/c++/src/connect/services/wn_main_loop.cpp
+++ b/c++/src/connect/services/wn_main_loop.cpp
@@ -1,4 +1,4 @@
-/*  $Id: wn_main_loop.cpp 470126 2015-06-11 14:18:21Z ivanov $
+/*  $Id: wn_main_loop.cpp 489744 2016-01-15 16:50:24Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -135,7 +135,8 @@ SWorkerNodeJobContextImpl::SWorkerNodeJobContextImpl(
     m_NetScheduleExecutor(worker_node->m_NSExecutor),
     m_NetCacheAPI(worker_node->m_NetCacheAPI),
     m_JobGeneration(worker_node->m_CurrentJobGeneration),
-    m_CommitExpiration(0, 0)
+    m_CommitExpiration(0, 0),
+    m_Deadline(0, 0)
 {
 }
 
@@ -217,13 +218,15 @@ void CWorkerNodeJobContext::RescheduleJob(
 }
 
 void CWorkerNodeJobContext::PutProgressMessage(const string& msg,
-                                               bool send_immediately)
+                                               bool send_immediately,
+                                               bool overwrite)
 {
-    m_Impl->PutProgressMessage(msg, send_immediately);
+    m_Impl->PutProgressMessage(msg, send_immediately, overwrite);
 }
 
 void SWorkerNodeJobContextImpl::PutProgressMessage(const string& msg,
-                                               bool send_immediately)
+                                               bool send_immediately,
+                                               bool overwrite)
 {
     CheckIfJobIsLost();
     if (!send_immediately &&
@@ -252,7 +255,9 @@ void SWorkerNodeJobContextImpl::PutProgressMessage(const string& msg,
             }
         }
 
-        m_NetCacheAPI.PutData(m_Job.progress_msg, msg.data(), msg.length());
+        if (overwrite) {
+            m_NetCacheAPI.PutData(m_Job.progress_msg, msg.data(), msg.length());
+        }
     }
     catch (exception& ex) {
         ERR_POST_X(6, "Couldn't send a progress message: " << ex.what());
@@ -622,119 +627,92 @@ void* CMainLoopThread::Main()
     return NULL;
 }
 
-bool CMainLoopThread::x_PerformTimelineAction(
-        CServerTimeline::TEntryRef timeline_entry, CNetScheduleJob& job)
-{
-    if (m_Timeline.IsDiscoveryAction(timeline_entry)) {
-        if (!x_EnterSuspendedState()) {
-            m_Timeline.NextDiscoveryIteration(m_WorkerNode->m_NetScheduleAPI);
-        }
-
-        timeline_entry->ResetTimeout(m_WorkerNode->m_NSTimeout);
-        m_Timeline.PushScheduledAction(timeline_entry);
-        return false;
-    }
 
-    if (x_EnterSuspendedState() ||
-            // Skip servers that disappeared from LBSM.
-            m_Timeline.IsOutdatedAction(timeline_entry))
-        return false;
+CNetScheduleGetJob::EState CMainLoopThread::CImpl::CheckState()
+{
+    if (CGridGlobals::GetInstance().IsShuttingDown())
+        return eStopped;
 
-    CNetServer server(m_Timeline.GetServer(m_WorkerNode->m_NetScheduleAPI,
-                timeline_entry));
+    EState ret = eWorking;
 
-    timeline_entry->ResetTimeout(m_WorkerNode->m_NSTimeout);
+    for (;;) {
+        void* event;
+
+        while ((event = SwapPointers(&m_WorkerNode->m_SuspendResumeEvent,
+                NO_EVENT)) != NO_EVENT) {
+            if (event == SUSPEND_EVENT) {
+                if (!m_WorkerNode->m_TimelineIsSuspended) {
+                    // Stop the timeline.
+                    m_WorkerNode->m_TimelineIsSuspended = true;
+                    ret = eRestarted;
+                }
+            } else { /* event == RESUME_EVENT */
+                if (m_WorkerNode->m_TimelineIsSuspended) {
+                    // Resume the timeline.
+                    m_WorkerNode->m_TimelineIsSuspended = false;
+                }
+            }
+        }
 
-    try {
-        if (m_WorkerNode->m_NSExecutor->x_GetJobWithAffinityLadder(server,
-                m_WorkerNode->m_NSTimeout, job)) {
-            // A job has been returned; add the server to
-            // immediate actions because there can be more
-            // jobs in the queue.
-            m_Timeline.PushImmediateAction(timeline_entry);
-            return true;
-        } else {
-            // No job has been returned by this server;
-            // query the server later.
-            m_Timeline.PushScheduledAction(timeline_entry);
-            return false;
+        if (!m_WorkerNode->m_TimelineIsSuspended) {
+            return ret;
         }
-    }
-    catch (CNetSrvConnException& e) {
-        // Because a connection error has occurred, do not
-        // put this server back to the timeline.
-        LOG_POST(Warning << e.GetMsg());
-        return false;
+
+        m_WorkerNode->m_NSExecutor->
+            m_NotificationHandler.WaitForNotification(m_Timeout);
     }
 }
 
-bool CMainLoopThread::x_EnterSuspendedState()
+CNetServer CMainLoopThread::CImpl::ReadNotifications()
 {
-    if (CGridGlobals::GetInstance().IsShuttingDown())
-        return true;
+    if (m_WorkerNode->m_NSExecutor->
+            m_NotificationHandler.ReceiveNotification())
+        return x_ProcessRequestJobNotification();
 
-    void* event;
-
-    while ((event = SwapPointers(&m_WorkerNode->m_SuspendResumeEvent,
-            NO_EVENT)) != NO_EVENT) {
-        if (event == SUSPEND_EVENT) {
-            if (!m_WorkerNode->m_TimelineIsSuspended) {
-                // Stop the timeline.
-                m_WorkerNode->m_TimelineIsSuspended = true;
-                m_Timeline.Suspend(m_WorkerNode->m_NSTimeout);
-            }
-        } else { /* event == RESUME_EVENT */
-            if (m_WorkerNode->m_TimelineIsSuspended) {
-                // Resume the timeline.
-                m_WorkerNode->m_TimelineIsSuspended = false;
-                m_Timeline.Resume();
-            }
-        }
-    }
-
-    return m_WorkerNode->m_TimelineIsSuspended;
+    return CNetServer();
 }
 
-void CMainLoopThread::x_ProcessRequestJobNotification()
+CNetServer CMainLoopThread::CImpl::WaitForNotifications(const CDeadline& deadline)
 {
-    if (!x_EnterSuspendedState()) {
-        CNetServer server;
+     if (m_WorkerNode->m_NSExecutor->
+             m_NotificationHandler.WaitForNotification(deadline)) {
+        return x_ProcessRequestJobNotification();
+     }
 
-        if (m_WorkerNode->m_NSExecutor->
-                m_NotificationHandler.CheckRequestJobNotification(
-                        m_WorkerNode->m_NSExecutor, &server))
-            m_Timeline.MoveToImmediateActions(server);
-    }
+     return CNetServer();
 }
 
-bool CMainLoopThread::x_WaitForNewJob(CNetScheduleJob& job)
+CNetServer CMainLoopThread::CImpl::x_ProcessRequestJobNotification()
 {
-    for (;;) {
-        while (m_Timeline.HasImmediateActions()) {
-            if (x_PerformTimelineAction(m_Timeline.PullImmediateAction(), job))
-                return true;
+    CNetServer server;
 
-            m_Timeline.CheckScheduledActions();
+    // No need to check state here, it will be checked before entry processing
+    m_WorkerNode->m_NSExecutor->
+        m_NotificationHandler.CheckRequestJobNotification(
+                m_WorkerNode->m_NSExecutor, &server);
 
-            // Check if there's a notification in the UDP socket.
-            while (m_WorkerNode->m_NSExecutor->
-                    m_NotificationHandler.ReceiveNotification())
-                x_ProcessRequestJobNotification();
-        }
+    return server;
+}
 
-        if (CGridGlobals::GetInstance().IsShuttingDown())
-            return false;
+bool CMainLoopThread::CImpl::MoreJobs(const SEntry& /*entry*/)
+{
+    return true;
+}
 
-        if (m_Timeline.HasScheduledActions()) {
-            if (m_WorkerNode->m_NSExecutor->
-                    m_NotificationHandler.WaitForNotification(
-                        m_Timeline.GetNextTimeout()))
-                x_ProcessRequestJobNotification();
-            else if (x_PerformTimelineAction(
-                        m_Timeline.PullScheduledAction(), job))
-                return true;
-        }
-    }
+bool CMainLoopThread::CImpl::CheckEntry(
+        SEntry& entry,
+        const string& prio_aff_list,
+        CNetScheduleJob& job,
+        CNetScheduleAPI::EJobStatus* /*job_status*/)
+{
+    CNetServer server(m_API.GetService()->GetServer(entry.server_address));
+    return m_WorkerNode->m_NSExecutor->x_GetJobWithAffinityLadder(server,
+            m_Timeout, prio_aff_list, job);
+}
+
+void CMainLoopThread::CImpl::ReturnJob(CNetScheduleJob& job)
+{
+    m_WorkerNode->m_NSExecutor->ReturnJob(job, false);
 }
 
 bool CMainLoopThread::x_GetNextJob(CNetScheduleJob& job)
@@ -747,7 +725,7 @@ bool CMainLoopThread::x_GetNextJob(CNetScheduleJob& job)
     if (!m_WorkerNode->WaitForExclusiveJobToFinish())
         return false;
 
-    if (!x_WaitForNewJob(job)) {
+    if (m_Timeline.GetJob(CTimeout::eInfinite, job, NULL) != CNetScheduleGetJob::eJob) {
         return false;
     }
 
@@ -764,7 +742,8 @@ bool CMainLoopThread::x_GetNextJob(CNetScheduleJob& job)
         }
     }
 
-    if (x_EnterSuspendedState()) {
+    // No need to check for idleness here, running jobs won't be stopped anyway
+    if (CGridGlobals::GetInstance().IsShuttingDown()) {
         m_WorkerNode->m_NSExecutor.ReturnJob(job);
         return false;
     }
diff --git a/c++/src/connect/services/wn_offline_mode.cpp b/c++/src/connect/services/wn_offline_mode.cpp
index b77bd29..480ca9d 100644
--- a/c++/src/connect/services/wn_offline_mode.cpp
+++ b/c++/src/connect/services/wn_offline_mode.cpp
@@ -1,4 +1,4 @@
-/*  $Id: wn_offline_mode.cpp 455687 2015-01-02 17:47:12Z kazimird $
+/*  $Id: wn_offline_mode.cpp 489744 2016-01-15 16:50:24Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -64,7 +64,7 @@ public:
     }
 
     virtual void PutProgressMessage(const string& msg,
-        bool send_immediately = false);
+        bool send_immediately, bool overwrite);
     virtual CNetScheduleAdmin::EShutdownLevel GetShutdownLevel();
     virtual void JobDelayExpiration(unsigned runtime_inc);
     virtual void x_RunJob();
@@ -75,7 +75,7 @@ public:
 
 
 void SOfflineJobContextImpl::PutProgressMessage(const string& msg,
-        bool send_immediately)
+        bool send_immediately, bool overwrite)
 {
 }
 
@@ -219,14 +219,14 @@ int SGridWorkerNodeImpl::OfflineRun()
             try {
                 CRef<SOfflineJobContextImpl> job_context_impl(
                         new SOfflineJobContextImpl(this, output_dir_name,
-                                m_NetScheduleAPI.GetCompoundIDPool()));
+                                m_NetScheduleAPI->GetCompoundIDPool()));
 
                 CWorkerNodeJobContext job_context(job_context_impl);
 
                 job_context_impl->ResetJobContext();
 
                 CNetScheduleJobSerializer job_serializer(job_context.GetJob(),
-                        m_NetScheduleAPI.GetCompoundIDPool());
+                        m_NetScheduleAPI->GetCompoundIDPool());
 
                 job_serializer.LoadJobInput(dir_entry.GetPath());
 
diff --git a/c++/src/corelib/Makefile.corelib.lib b/c++/src/corelib/Makefile.corelib.lib
index d3e5317..f7182c0 100644
--- a/c++/src/corelib/Makefile.corelib.lib
+++ b/c++/src/corelib/Makefile.corelib.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.corelib.lib 477845 2015-09-02 13:12:10Z ivanov $
+# $Id: Makefile.corelib.lib 472138 2015-07-07 16:07:55Z grichenk $
 
 SRC = $(ncbicntr) blob_storage ddumpable env_reg metareg ncbi_config \
       ncbi_param ncbi_process ncbi_safe_static ncbi_signal ncbi_stack \
diff --git a/c++/src/corelib/ddumpable.cpp b/c++/src/corelib/ddumpable.cpp
index a95f453..12c92d3 100644
--- a/c++/src/corelib/ddumpable.cpp
+++ b/c++/src/corelib/ddumpable.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ddumpable.cpp 362739 2012-05-10 16:44:23Z ucko $
+/*  $Id: ddumpable.cpp 493118 2016-02-24 15:43:33Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -77,6 +77,11 @@ void CDebugDumpable::DebugDumpFormat(CDebugDumpFormatter& ddf,
 }
 
 
+void CDebugDumpable::DumpToConsole(void) const
+{
+    DebugDumpText(cout, kEmptyStr, 0);
+}
+
 //---------------------------------------------------------------------------
 //  CDebugDumpContext provides client interface in the form [name=value]
 
diff --git a/c++/src/corelib/env_reg.cpp b/c++/src/corelib/env_reg.cpp
index 0db400b..a90dc98 100644
--- a/c++/src/corelib/env_reg.cpp
+++ b/c++/src/corelib/env_reg.cpp
@@ -1,4 +1,4 @@
-/*  $Id: env_reg.cpp 478281 2015-09-08 14:34:01Z ivanov $
+/*  $Id: env_reg.cpp 495404 2016-03-17 13:28:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -140,7 +140,7 @@ const string& CEnvironmentRegistry::x_Get(const string& section,
         const string* resultp  = &m_Env->Get(var_name, &found);
         if ((m_Flags & fCaseFlags) == 0  &&  !found) {
             // try capitalizing the name
-            resultp = &m_Env->Get(NStr::ToUpper(var_name));
+            resultp = &m_Env->Get(NStr::ToUpper(var_name), &found);
         }
         if (found) {
             return *resultp;
@@ -171,6 +171,11 @@ void CEnvironmentRegistry::x_Enumerate(const string& section,
                                        list<string>& entries,
                                        TFlags flags) const
 {
+    // Environment does not provide comments, so if we came for in-section 
+    // comments, we can just return doing nothing
+    if (flags & fInSectionComments) {
+        return;
+    }
     if ( !(flags & fTransient) ) {
         return;
     }
@@ -241,6 +246,34 @@ bool CEnvironmentRegistry::x_Set(const string& section, const string& name,
 }
 
 
+bool CEnvironmentRegistry::x_Unset(const string& section, const string& name,
+                                   TFlags flags)
+{
+    bool result = false;
+    ITERATE (TPriorityMap, it, m_PriorityMap) {
+        string var_name = it->second->RegToEnv(section, name);
+        bool   found;
+        if (var_name.empty()) {
+            continue;
+        }
+        m_Env->Get(var_name, &found);
+        if (found) {
+            result = true;
+            m_Env->Unset(var_name);
+        }
+        if ((m_Flags & fCaseFlags) == 0) {
+            string cap_name = var_name;
+            NStr::ToUpper(cap_name);
+            m_Env->Get(cap_name, &found);
+            if (found) {
+                result = true;
+                m_Env->Unset(cap_name);
+            }
+        }
+    }
+    return result;
+}
+
 bool CEnvironmentRegistry::x_SetComment(const string&, const string&,
                                         const string&, TFlags)
 {
diff --git a/c++/src/corelib/metareg.cpp b/c++/src/corelib/metareg.cpp
index 7130dda..afc6001 100644
--- a/c++/src/corelib/metareg.cpp
+++ b/c++/src/corelib/metareg.cpp
@@ -1,4 +1,4 @@
-/*  $Id: metareg.cpp 450825 2014-10-30 18:31:55Z grichenk $
+/*  $Id: metareg.cpp 487768 2015-12-21 20:05:25Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -51,6 +51,12 @@ typedef ncbi::CNcbiStrstream TStrStream;
 BEGIN_NCBI_SCOPE
 
 
+#ifdef NCBI_OS_MSWIN
+static const CTempString kConfigPathDelim = ";";
+#else
+static const CTempString kConfigPathDelim = ":;";
+#endif
+
 static CSafeStatic<CMetaRegistry> s_Instance;
 
 
@@ -323,9 +329,17 @@ void CMetaRegistry::GetDefaultSearchPath(CMetaRegistry::TSearchPath& path)
     path.clear();
 
     const TXChar* cfg_path = NcbiSys_getenv(_TX("NCBI_CONFIG_PATH"));
+    TSearchPath   path_tail;
     if (cfg_path) {
-        path.push_back(_T_STDSTRING(cfg_path));
-        return;
+        NStr::Split(_T_STDSTRING(cfg_path), kConfigPathDelim, path,
+                    NStr::fSplit_NoMergeDelims);
+        TSearchPath::iterator it = find(path.begin(), path.end(), kEmptyStr);
+        if (it == path.end()) {
+            return;
+        } else {
+            path_tail.assign(it + 1, path.end());
+            path.erase(it, path.end());
+        }
     }
 
     if (NcbiSys_getenv(_TX("NCBI_DONT_USE_LOCAL_CONFIG")) == NULL) {
@@ -369,6 +383,14 @@ void CMetaRegistry::GetDefaultSearchPath(CMetaRegistry::TSearchPath& path)
             }
         }
     }}
+
+    if ( !path_tail.empty() ) {
+        ITERATE (TSearchPath, it, path_tail) {
+            if ( !it->empty() ) {
+                path.push_back(*it);
+            }
+        }
+    }
 }
 
 
diff --git a/c++/src/corelib/ncbi_autoinit.cpp b/c++/src/corelib/ncbi_autoinit.cpp
index aba6bd9..c2bde57 100644
--- a/c++/src/corelib/ncbi_autoinit.cpp
+++ b/c++/src/corelib/ncbi_autoinit.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbi_autoinit.cpp 478278 2015-09-08 14:32:54Z ivanov $
+/*  $Id: ncbi_autoinit.cpp 474964 2015-08-03 18:22:34Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/corelib/ncbi_base64.c b/c++/src/corelib/ncbi_base64.c
index c8efaec..6aeccc8 100644
--- a/c++/src/corelib/ncbi_base64.c
+++ b/c++/src/corelib/ncbi_base64.c
@@ -1,4 +1,4 @@
-/* $Id: ncbi_base64.c 394628 2013-04-04 15:46:39Z kazimird $
+/* $Id: ncbi_base64.c 488618 2016-01-04 12:52:59Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -79,7 +79,7 @@ extern void BASE64_Encode
         if (i >= src_size) {
             break;
         }
-        shift += 2;
+        shift = (unsigned char)(shift + 2);  // shift += 2;
         shift &= 7;
         temp = (c << (8 - shift)) & 0x3F;
         if (shift) {
@@ -129,11 +129,11 @@ extern int/*bool*/ BASE64_Decode
         if (c == '=') {
             c  = 64; /*end*/
         } else if (c >= 'A'  &&  c <= 'Z') {
-            c -= 'A';
+            c = (unsigned char)(c - 'A');         /* c -= 'A'; */
         } else if (c >= 'a'  &&  c <= 'z') {
-            c -= 'a' - 26;
+            c = (unsigned char)(c - ('a' - 26));  /* c -= 'a' - 26; */
         } else if (c >= '0'  &&  c <= '9') {
-            c -= '0' - 52;
+            c = (unsigned char)(c - ('0' - 52));  /* c -= '0' - 52; */
         } else if (c == '+') {
             c  = 62;
         } else if (c == '/') {
@@ -182,13 +182,13 @@ extern int/*bool*/ BASE64_Decode
             }
             switch (k) {
             case 0:
-                dst[j++] = (temp & 0xFF0000) >> 16;
+                dst[j++] = (unsigned char)((temp & 0xFF0000) >> 16);
                 /*FALLTHRU*/;
             case 4:
-                dst[j++] = (temp & 0xFF00) >> 8;
+                dst[j++] = (unsigned char)((temp & 0xFF00) >> 8);
                 /*FALLTHRU*/
             case 3:
-                dst[j++] = (temp & 0xFF);
+                dst[j++] = (unsigned char)(temp & 0xFF);
                 break;
             default:
                 break;
@@ -313,21 +313,21 @@ extern EBase64_Result base64url_decode(const void* src_buf, size_t src_size,
     while (src_size > 3) {
         XLAT_BASE64_CHAR(src_ch0);
         XLAT_BASE64_CHAR(src_ch1);
-        *dst++ = src_ch0 << 2 | src_ch1 >> 4;
+        *dst++ = (unsigned char)(src_ch0 << 2 | src_ch1 >> 4);
         XLAT_BASE64_CHAR(src_ch0);
-        *dst++ = src_ch1 << 4 | src_ch0 >> 2;
+        *dst++ = (unsigned char)(src_ch1 << 4 | src_ch0 >> 2);
         XLAT_BASE64_CHAR(src_ch1);
-        *dst++ = src_ch0 << 6 | src_ch1;
+        *dst++ = (unsigned char)(src_ch0 << 6 | src_ch1);
         src_size -= 4;
     }
 
     if (src_size > 1) {
         XLAT_BASE64_CHAR(src_ch0);
         XLAT_BASE64_CHAR(src_ch1);
-        *dst++ = src_ch0 << 2 | src_ch1 >> 4;
+        *dst++ = (unsigned char)(src_ch0 << 2 | src_ch1 >> 4);
         if (src_size > 2) {
             XLAT_BASE64_CHAR(src_ch0);
-            *dst = src_ch1 << 4 | src_ch0 >> 2;
+            *dst = (unsigned char)(src_ch1 << 4 | src_ch0 >> 2);
         }
     } else if (src_size == 1)
         return eBase64_InvalidInput;
diff --git a/c++/src/corelib/ncbi_config.cpp b/c++/src/corelib/ncbi_config.cpp
index 0a71853..b897dcc 100644
--- a/c++/src/corelib/ncbi_config.cpp
+++ b/c++/src/corelib/ncbi_config.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbi_config.cpp 449355 2014-10-15 20:21:49Z kazimird $
+/*  $Id: ncbi_config.cpp 486111 2015-12-01 17:17:39Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -103,7 +103,8 @@ TParamTree* s_FindSubNode(const string& path,
     list<string> name_list;
     list<TParamTree*> node_list;
 
-    NStr::Split(path, "/", name_list);
+    NStr::Split(path, "/", name_list,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     tree_root->FindNodes(name_list, &node_list);
     return node_list.empty() ? 0 : *node_list.rbegin();
 }
@@ -115,7 +116,8 @@ void s_ParseSubNodes(const string& sub_nodes,
                      set<string>&  rm_sections)
 {
     list<string> sub_list;
-    NStr::Split(sub_nodes, ",; \t\n\r", sub_list);
+    NStr::Split(sub_nodes, ",; \t\n\r", sub_list,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     set<string> sub_set;
     s_List2Set(sub_list, &sub_set);
     ITERATE(set<string>, sub_it, sub_set) {
@@ -256,7 +258,8 @@ CConfig::TParamTree* CConfig::ConvertRegToTree(const IRegistry& reg)
             tree_root->AddNode(node_ptr = node.release());
         } else {
             list<string> sub_node_list;
-            NStr::Split(section_name, "/", sub_node_list);
+            NStr::Split(section_name, "/", sub_node_list,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             node_ptr = tree_root->FindOrCreateNode(sub_node_list);
         }
 
@@ -275,7 +278,8 @@ CConfig::TParamTree* CConfig::ConvertRegToTree(const IRegistry& reg)
             }
             if (NStr::CompareNocase(element_name, kIncludeSections) == 0) {
                 list<string> inc_list;
-                NStr::Split(element_value, ",; \t\n\r", inc_list);
+                NStr::Split(element_value, ",; \t\n\r", inc_list,
+                    NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                 s_List2Set(inc_list, &inc_sections[node_ptr]);
                 continue;
             }
diff --git a/c++/src/corelib/ncbi_cookies.cpp b/c++/src/corelib/ncbi_cookies.cpp
index 9cea6f1..b7843d7 100644
--- a/c++/src/corelib/ncbi_cookies.cpp
+++ b/c++/src/corelib/ncbi_cookies.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbi_cookies.cpp 436348 2014-05-27 17:15:14Z grichenk $
+/*  $Id: ncbi_cookies.cpp 486111 2015-12-01 17:17:39Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -268,7 +268,7 @@ int CHttpCookie::sx_Compare(const CHttpCookie& c1, const CHttpCookie& c2)
     int x_cmp;
 
     // Longer domains go first.
-    x_cmp = c1.m_Domain.size() - c2.m_Domain.size();
+    x_cmp = int(c1.m_Domain.size() - c2.m_Domain.size());
     if ( x_cmp ) {
         return x_cmp;
     }
@@ -279,7 +279,7 @@ int CHttpCookie::sx_Compare(const CHttpCookie& c1, const CHttpCookie& c2)
     }
 
     // Longer paths should go first.
-    x_cmp = c1.m_Path.size() - c2.m_Path.size();
+    x_cmp = int(c1.m_Path.size() - c2.m_Path.size());
     if ( x_cmp ) {
         return x_cmp;
     }
@@ -418,7 +418,7 @@ CTime s_ParseDateTime(const string& value)
         if (mon <= 0  &&  field.size() == 3) {
             size_t mpos = NStr::FindNoCase(kMonthNames, field);
             if (mpos != NPOS) {
-                mon = mpos/4 + 1;
+                mon = int(mpos/4 + 1);
                 continue;
             }
 
@@ -512,7 +512,8 @@ bool CHttpCookie::Parse(const CTempString& str)
 
     // Parse additional attributes.
     list<string> attrs;
-    NStr::Split(attr_str, ";", attrs);
+    NStr::Split(attr_str, ";", attrs,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     string expires, maxage;
     ITERATE(list<string>, it, attrs) {
         pos = it->find('=');
@@ -729,7 +730,8 @@ size_t CHttpCookies::Add(ECookieHeader header,
     size_t count = 0;
     if (header == eHeader_Cookie) {
         list<string> cookies;
-        NStr::Split(str, ";", cookies);
+        NStr::Split(str, ";", cookies,
+            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         ITERATE(list<string>, it, cookies) {
             if ( cookie.Parse(*it) ) {
                 Add(cookie);
@@ -851,7 +853,8 @@ CHttpCookie* CHttpCookies::x_Find(const string& domain,
 string CHttpCookies::sx_RevertDomain(const string& domain)
 {
     list<string> names;
-    NStr::Split(domain, ".", names);
+    NStr::Split(domain, ".", names,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     string ret;
     REVERSE_ITERATE(list<string>, it, names) {
         if ( !ret.empty() ) {
diff --git a/c++/src/corelib/ncbi_message.cpp b/c++/src/corelib/ncbi_message.cpp
index e495dbc..159a724 100644
--- a/c++/src/corelib/ncbi_message.cpp
+++ b/c++/src/corelib/ncbi_message.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbi_message.cpp 477857 2015-09-02 13:15:07Z ivanov $
+/*  $Id: ncbi_message.cpp 473941 2015-07-23 17:05:00Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/corelib/ncbi_process.cpp b/c++/src/corelib/ncbi_process.cpp
index 19d6da6..618271c 100644
--- a/c++/src/corelib/ncbi_process.cpp
+++ b/c++/src/corelib/ncbi_process.cpp
@@ -1,4 +1,4 @@
-/* $Id: ncbi_process.cpp 465029 2015-04-16 13:28:52Z sadyrovr $
+/* $Id: ncbi_process.cpp 486692 2015-12-09 12:49:29Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1070,6 +1070,24 @@ int CProcess::Wait(unsigned long timeout, CExitInfo* info) const
 //       by other processes behind this API. Be aware.
 
 
+CPIDGuard::CPIDGuard(const string& filename)
+    : m_PID(0)
+{
+    string dir;
+    CDirEntry::SplitPath(filename, &dir, 0, 0);
+    if (dir.empty()) {
+        m_Path = CDirEntry::MakePath(CDir::GetTmpDir(), filename);
+    } else {
+        m_Path = filename;
+    }
+    // Create guard for MT-Safe protect	
+    m_MTGuard.reset(new CInterProcessLock(m_Path + ".guard"));
+    // Update PID
+    UpdatePID();
+}
+
+
+/// @deprecated
 CPIDGuard::CPIDGuard(const string& filename, const string& dir)
     : m_PID(0)
 {
diff --git a/c++/src/corelib/ncbi_stack_linux.cpp b/c++/src/corelib/ncbi_stack_linux.cpp
index 58c75b3..bfbe282 100644
--- a/c++/src/corelib/ncbi_stack_linux.cpp
+++ b/c++/src/corelib/ncbi_stack_linux.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbi_stack_linux.cpp 257670 2011-03-15 18:55:24Z grichenk $
+/*  $Id: ncbi_stack_linux.cpp 488254 2015-12-29 13:56:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -59,7 +59,7 @@ private:
 CStackTraceImpl::CStackTraceImpl(void)
 {
     m_Stack.resize(CStackTrace::s_GetStackTraceMaxDepth());
-    m_Stack.resize(backtrace(&m_Stack[0], m_Stack.size()));
+    m_Stack.resize(backtrace(&m_Stack[0], (int)m_Stack.size()));
 }
 
 
@@ -70,7 +70,7 @@ CStackTraceImpl::~CStackTraceImpl(void)
 
 void CStackTraceImpl::Expand(CStackTrace::TStack& stack)
 {
-    char** syms = backtrace_symbols(&m_Stack[0], m_Stack.size());
+    char** syms = backtrace_symbols(&m_Stack[0], (int)m_Stack.size());
     for (size_t i = 0;  i < m_Stack.size();  ++i) {
         string sym = syms[i];
 
diff --git a/c++/src/corelib/ncbi_system.cpp b/c++/src/corelib/ncbi_system.cpp
index a6037e9..2e26c1e 100644
--- a/c++/src/corelib/ncbi_system.cpp
+++ b/c++/src/corelib/ncbi_system.cpp
@@ -1,4 +1,4 @@
-/* $Id: ncbi_system.cpp 473887 2015-07-23 12:01:53Z ivanov $
+/* $Id: ncbi_system.cpp 488254 2015-12-29 13:56:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -652,10 +652,10 @@ bool GetCurrentProcessTimes(double* user_time, double* system_time)
         return false;
     }
     if ( system_time ) {
-        *system_time = (double) buf.tms_stime / tick;
+        *system_time = (double)buf.tms_stime / (double)tick;
     }
     if ( user_time ) {
-        *user_time = (double) buf.tms_utime / tick;
+        *user_time = (double)buf.tms_utime / (double)tick;
     }
 #endif
     return true;
@@ -1128,11 +1128,7 @@ extern int GetProcessFDCount(int* soft_limit, int* hard_limit)
         // fallback to sysconf
         ERR_POST_ONCE(Warning << "getrlimit(RLIMIT_NOFILE, ...) call failed. "
                                  "Using sysconf(_SC_OPEN_MAX) instead.");
-        long        sysconf_limit = sysconf(_SC_OPEN_MAX);
-        if (sysconf_limit > RLIM_INFINITY)
-            cur_limit = RLIM_INFINITY;
-        else
-            cur_limit = static_cast<rlim_t>(sysconf(_SC_OPEN_MAX));
+        cur_limit = static_cast<rlim_t>(sysconf(_SC_OPEN_MAX));
     }
 
     DIR* dir = opendir("/proc/self/fd/");
diff --git a/c++/src/corelib/ncbi_url.cpp b/c++/src/corelib/ncbi_url.cpp
index f5530e8..d96e61e 100644
--- a/c++/src/corelib/ncbi_url.cpp
+++ b/c++/src/corelib/ncbi_url.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbi_url.cpp 442459 2014-08-04 15:36:07Z grichenk $
+/*  $Id: ncbi_url.cpp 500588 2016-05-05 17:18:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -512,21 +512,23 @@ string CUrl::ComposeUrl(CUrlArgs::EAmpEncoding amp_enc,
         url += m_Scheme;
         url += m_IsGeneric ? "://" : ":";
     }
-    bool use_auth = false;
-    if ( !m_User.empty() ) {
-        url += encoder->EncodeUser(m_User);
-        use_auth = true;
-    }
-    if ( !m_Password.empty() ) {
-        url += ":" + encoder->EncodePassword(m_Password);
-        use_auth = true;
-    }
-    if ( use_auth ) {
-        url += "@";
-    }
-    url += m_Host;
-    if ( !m_Port.empty() ) {
-        url += ":" + m_Port;
+    if ( !m_Host.empty() ) {
+        bool use_auth = false;
+        if ( !m_User.empty() ) {
+            url += encoder->EncodeUser(m_User);
+            use_auth = true;
+        }
+        if ( !m_Password.empty() ) {
+            url += ":" + encoder->EncodePassword(m_Password);
+            use_auth = true;
+        }
+        if ( use_auth ) {
+            url += "@";
+        }
+        url += m_Host;
+        if ( !m_Port.empty() ) {
+            url += ":" + m_Port;
+        }
     }
     url += encoder->EncodePath(m_Path);
     if ( HaveArgs() ) {
diff --git a/c++/src/corelib/ncbiapp.cpp b/c++/src/corelib/ncbiapp.cpp
index 8f3de04..6f67430 100644
--- a/c++/src/corelib/ncbiapp.cpp
+++ b/c++/src/corelib/ncbiapp.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbiapp.cpp 460403 2015-02-26 19:51:12Z ucko $
+/*  $Id: ncbiapp.cpp 492326 2016-02-16 19:38:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -99,7 +99,7 @@ CNcbiApplication* CNcbiApplication::Instance(void)
 }
 
 
-CNcbiApplication::CNcbiApplication(void)
+CNcbiApplication::CNcbiApplication(const SBuildInfo& build_info)
     : m_ConfigLoaded(false),
       m_LogFile(0)
 {
@@ -122,7 +122,7 @@ CNcbiApplication::CNcbiApplication(void)
     m_Instance = this;
 
     // Create empty version info
-    m_Version.Reset(new CVersion());
+    m_Version.Reset(new CVersion(build_info));
 
     // Create empty application arguments & name
     m_Arguments.reset(new CNcbiArguments(0,0));
@@ -752,7 +752,17 @@ void CNcbiApplication::SetVersion(const CVersionInfo& version)
         ERR_POST_X(19, "SetVersion() should be used from constructor of " \
                        "CNcbiApplication derived class, see description");
     }
-    m_Version->SetVersionInfo( new CVersionInfo(version) );
+    m_Version->SetVersionInfo(new CVersionInfo(version));
+}
+
+void CNcbiApplication::SetVersion(const CVersionInfo& version,
+        const SBuildInfo& build_info)
+{
+    if ( s_IsApplicationStarted ) {
+        ERR_POST_X(19, "SetVersion() should be used from constructor of " \
+                       "CNcbiApplication derived class, see description");
+    }
+    m_Version->SetVersionInfo(new CVersionInfo(version), build_info);
 }
 
 void CNcbiApplication::SetFullVersion( CRef<CVersion> version)
@@ -1169,7 +1179,7 @@ string CNcbiApplication::FindProgramExecutablePath
     if (real_path) {
         char   buf[PATH_MAX + 1];
         string procfile = "/proc/" + NStr::IntToString(getpid()) + "/exe";
-        int    ncount   = readlink((procfile).c_str(), buf, PATH_MAX);
+        int    ncount   = (int)readlink((procfile).c_str(), buf, PATH_MAX);
         if (ncount > 0) {
             real_path->assign(buf, ncount);
             if (real_path == &ret_val  ||  ret_val.empty()) {
@@ -1217,9 +1227,11 @@ string CNcbiApplication::FindProgramExecutablePath
             }
             list<string> split_path;
 #  ifdef NCBI_OS_MSWIN
-            NStr::Split(env_path, ";", split_path);
+            NStr::Split(env_path, ";", split_path,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 #  else
-            NStr::Split(env_path, ":", split_path);
+            NStr::Split(env_path, ":", split_path,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 #  endif
             string base_name = CDirEntry(app_path).GetBase();
             ITERATE(list<string>, it, split_path) {
diff --git a/c++/src/corelib/ncbiargs.cpp b/c++/src/corelib/ncbiargs.cpp
index 6067f68..bc77509 100644
--- a/c++/src/corelib/ncbiargs.cpp
+++ b/c++/src/corelib/ncbiargs.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbiargs.cpp 466633 2015-05-05 15:36:22Z gouriano $
+/*  $Id: ncbiargs.cpp 488569 2015-12-31 21:35:10Z vakatov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -481,7 +481,13 @@ CArg_DateTime::CArg_DateTime(const string& name, const string& value)
     : CArg_String(name, value)
 {
     bool hasZ = value.size() != 0 && value[value.size()-1] == 'Z';
-    const char* fmt[] = {"Y-M-DTh:m:g", "Y/M/D h:m:g", nullptr};
+    const char* fmt[] = {
+        "M/D/Y h:m:s",  // CTime default
+        "Y-M-DTh:m:g",  // ISO8601
+        "Y/M/D h:m:g",  // 
+        "Y-M-D h:m:g",  // NCBI SQL server default
+        nullptr
+    };
     bool res = false;
     for (int i = 0; !res && fmt[i]; ++i) {
         try {
@@ -873,12 +879,15 @@ void CArgDesc::VerifyDefault(void) const
 }
 
 
-void CArgDesc::SetConstraint(CArgAllow*   constraint,
+void CArgDesc::SetConstraint(const CArgAllow* constraint,
                              CArgDescriptions::EConstraintNegate)
 {
-    NCBI_THROW(CArgException, eConstraint, s_ArgExptMsg(GetName(),
-        "No-value arguments may not be constrained",
-        constraint ? constraint->GetUsage() : kEmptyStr));
+    CConstRef<CArgAllow> safe_delete(constraint);
+
+    NCBI_THROW(CArgException, eConstraint,
+               s_ArgExptMsg(GetName(),
+                            "No-value arguments may not be constrained",
+                            constraint ? constraint->GetUsage() : kEmptyStr));
 }
 
 
@@ -1201,7 +1210,7 @@ CArgValue* CArgDescMandatory::ProcessDefault(void) const
 
 
 void CArgDescMandatory::SetConstraint
-(CArgAllow*                          constraint,
+(const CArgAllow*                    constraint,
  CArgDescriptions::EConstraintNegate negate)
 {
     m_Constraint       = constraint;
@@ -1358,6 +1367,7 @@ CArgDescSynopsis::CArgDescSynopsis(const string& synopsis)
 CArgDesc_Flag::CArgDesc_Flag(const string& name,
                              const string& comment,
                              bool  set_value)
+
     : CArgDesc(name, comment),
       m_Group(0),
       m_SetValue(set_value)
@@ -1897,6 +1907,7 @@ static string s_CArgs_ReadFromFile(const string& name, const string& filename)
     return string( value.data(), value.size());
 }
 
+
 static string s_CArgs_ReadFromStdin(const string& name, EEchoInput echo_input, const char* cue)
 {
     string thx("\n");
@@ -1914,6 +1925,7 @@ static string s_CArgs_ReadFromStdin(const string& name, EEchoInput echo_input, c
     }
 
     string value;
+
 #if defined(NCBI_OS_MSWIN)
     DWORD dw = 0;
     HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
@@ -1943,9 +1955,6 @@ static string s_CArgs_ReadFromStdin(const string& name, EEchoInput echo_input, c
         }
     }
 #else
-    size_t i = 0;
-    char ch;
-
     struct termios mode, silent_mode;
     if (echo_input == eNoEcho) {
         tcgetattr( STDIN_FILENO, &mode );
@@ -1954,13 +1963,21 @@ static string s_CArgs_ReadFromStdin(const string& name, EEchoInput echo_input, c
         tcsetattr( STDIN_FILENO, TCSANOW, &silent_mode );
     }
 
-    for( i = 0; (ch = getchar()) != EOF && (ch != '\n') && (ch != '\r'); i++ ) {
+    for (;;) {
+        int ich = getchar();
+        if (ich == EOF)
+            break;
+
+        char ch = (char) ich;
+        if (ch == '\n'  ||  ch == '\r')
+            break;
+
         if (ch == '\b') {
             if (value.size() > 0) {
-                value.erase( value.size()-1, 1);
+                value.resize(value.size() - 1);
             }
         } else {
-            value.append(1, ch);
+            value += ch;
         }
     }
 
@@ -1974,6 +1991,7 @@ static string s_CArgs_ReadFromStdin(const string& name, EEchoInput echo_input, c
     return value;
 }
 
+
 static string s_CArgs_ReadFromConsole(const string& name, EEchoInput echo_input, const char* cue)
 {
     string thx("\n");
@@ -1995,7 +2013,7 @@ static string s_CArgs_ReadFromConsole(const string& name, EEchoInput echo_input,
             GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
             FILE_ATTRIBUTE_NORMAL, NULL);
         if (hOut != INVALID_HANDLE_VALUE) {
-            WriteFile(hOut,prompt.data(),prompt.length(), &dw, NULL);
+            WriteFile(hOut, prompt.data(), (DWORD)prompt.length(), &dw, NULL);
         }
     }
 
@@ -2030,7 +2048,7 @@ static string s_CArgs_ReadFromConsole(const string& name, EEchoInput echo_input,
     }
 
     if (hOut != INVALID_HANDLE_VALUE) {
-        WriteFile(hOut,thx.data(),thx.length(), &dw, NULL);
+        WriteFile(hOut, thx.data(), (DWORD)thx.length(), &dw, NULL);
         CloseHandle(hOut);
     }
 #else
@@ -2252,23 +2270,22 @@ void CArgDescriptions::AddDefaultKey
 }
 
 
-void CArgDescriptions::AddFlag
-(const string& name,
- const string& comment,
- bool          set_value)
+void CArgDescriptions::AddFlag(
+    const string& name,
+    const string& comment,
+    CBoolEnum<EFlagValue> set_value)
 {
-    auto_ptr<CArgDesc_Flag> arg(new CArgDesc_Flag(name, comment, set_value));
-
+    auto_ptr<CArgDesc_Flag> arg(new CArgDesc_Flag(name, comment, set_value == eFlagHasValueIfSet));
     x_AddDesc(*arg);
     arg.release();
 }
 
 
-void CArgDescriptions::AddPositional
-(const string& name,
- const string& comment,
- EType         type,
- TFlags        flags)
+void CArgDescriptions::AddPositional(
+    const string& name,
+    const string& comment,
+    EType         type,
+    TFlags        flags)
 {
     auto_ptr<CArgDesc_Pos> arg(new CArgDesc_Pos(name, comment, type, flags));
 
@@ -2277,11 +2294,11 @@ void CArgDescriptions::AddPositional
 }
 
 
-void CArgDescriptions::AddOpening
-(const string& name,
- const string& comment,
- EType         type,
- TFlags        flags)
+void CArgDescriptions::AddOpening(
+    const string& name,
+    const string& comment,
+    EType         type,
+    TFlags        flags)
 {
     auto_ptr<CArgDesc_Opening> arg(new CArgDesc_Opening(name, comment, type, flags));
 
@@ -2290,11 +2307,11 @@ void CArgDescriptions::AddOpening
 }
 
 
-void CArgDescriptions::AddOptionalPositional
-(const string& name,
- const string& comment,
- EType         type,
- TFlags        flags)
+void CArgDescriptions::AddOptionalPositional(
+    const string& name,
+    const string& comment,
+    EType         type,
+    TFlags        flags)
 {
     auto_ptr<CArgDesc_PosOpt> arg
         (new CArgDesc_PosOpt(name, comment, type, flags));
@@ -2304,14 +2321,14 @@ void CArgDescriptions::AddOptionalPositional
 }
 
 
-void CArgDescriptions::AddDefaultPositional
-(const string& name,
- const string& comment,
- EType         type,
- const string& default_value,
- TFlags        flags,
- const string& env_var,
- const char*   display_value)
+void CArgDescriptions::AddDefaultPositional(
+     const string& name,
+     const string& comment,
+     EType         type,
+     const string& default_value,
+     TFlags        flags,
+     const string& env_var,
+     const char*   display_value)
 {
     auto_ptr<CArgDesc_PosDef> arg(new CArgDesc_PosDef(name,
         comment, type, flags, default_value, env_var, display_value));
@@ -2321,12 +2338,12 @@ void CArgDescriptions::AddDefaultPositional
 }
 
 
-void CArgDescriptions::AddExtra
-(unsigned      n_mandatory,
- unsigned      n_optional,
- const string& comment,
- EType         type,
- TFlags        flags)
+void CArgDescriptions::AddExtra(
+    unsigned      n_mandatory,
+    unsigned      n_optional,
+    const string& comment,
+    EType         type,
+    TFlags        flags)
 {
     if (!n_mandatory  &&  !n_optional) {
         NCBI_THROW(CArgException,eSynopsis,
@@ -2353,8 +2370,8 @@ void CArgDescriptions::AddExtra
 void CArgDescriptions::AddAlias(const string& alias,
                                 const string& arg_name)
 {
-    auto_ptr<CArgDesc_Alias> arg(
-        new CArgDesc_Alias(alias, arg_name, kEmptyStr));
+    auto_ptr<CArgDesc_Alias>arg
+        (new CArgDesc_Alias(alias, arg_name, kEmptyStr));
 
     x_AddDesc(*arg);
     arg.release();
@@ -2369,7 +2386,7 @@ void CArgDescriptions::AddNegatedFlagAlias(const string& alias,
     TArgsCI orig = x_Find(arg_name);
     if (orig == m_Args.end()  ||  !s_IsFlag(**orig)) {
         NCBI_THROW(CArgException, eArgType,
-            "Attempt to negate a non-flag argument: "+ arg_name);
+            "Attempt to negate a non-flag argument: " + arg_name);
     }
 
     auto_ptr<CArgDesc_Alias> arg(new CArgDesc_Alias(alias, arg_name, comment));
@@ -2381,26 +2398,27 @@ void CArgDescriptions::AddNegatedFlagAlias(const string& alias,
 
 
 void CArgDescriptions::SetConstraint(const string&      name, 
-                                     CArgAllow*         constraint,
+                                     const CArgAllow*   constraint,
                                      EConstraintNegate  negate)
 {
-    CRef<CArgAllow> safe_delete(constraint);
-
     TArgsI it = x_Find(name);
     if (it == m_Args.end()) {
+        CConstRef<CArgAllow> safe_delete(constraint);  // delete, if last ref
         NCBI_THROW(CArgException, eConstraint,
-            "Attempt to set constraint for undescribed argument: "+ name);
+            "Attempt to set constraint for undescribed argument: " + name);
     }
     (*it)->SetConstraint(constraint, negate);
 }
+
+
 void CArgDescriptions::SetConstraint(const string&      name,
                                      const CArgAllow&   constraint,
                                      EConstraintNegate  negate)
 {
     CArgAllow* onheap = constraint.Clone();
-    if (!onheap) {
+    if ( !onheap ) {
         NCBI_THROW(CArgException, eConstraint,
-            "Clone method not implemented for: "+ name);
+                   "Clone method not implemented for: " + name);
     }
     SetConstraint(name, onheap, negate);
 }
@@ -2601,9 +2619,11 @@ void CArgDescriptions::x_PreCheck(void) const
             }
         }
 
+/*
         if (dynamic_cast<CArgDescDefault*> (&arg) == 0) {
             continue;
         }
+*/
 
         try {
             arg.VerifyDefault();
@@ -3724,7 +3744,7 @@ void CArgDescriptions::x_PrintAliasesAsXml( CNcbiOstream& out,
 
 CCommandArgDescriptions::CCommandArgDescriptions(
     bool auto_help, CArgErrorHandler* err_handler, TCommandArgFlags cmd_flags)
-    : CArgDescriptions(auto_help,err_handler), m_Cmd_req(cmd_flags), m_CurrentGroup(0)
+    : CArgDescriptions(auto_help,err_handler), m_Cmd_req(cmd_flags), m_CurrentCmdGroup(0)
 {
 }
 
@@ -3734,10 +3754,10 @@ CCommandArgDescriptions::~CCommandArgDescriptions(void)
 
 void CCommandArgDescriptions::SetCurrentCommandGroup(const string& group)
 {
-    m_CurrentGroup = x_GetCommandGroupIndex(group);
-    if (m_CurrentGroup == 0) {
+    m_CurrentCmdGroup = x_GetCommandGroupIndex(group);
+    if (m_CurrentCmdGroup == 0) {
         m_CmdGroups.push_back(group);
-        m_CurrentGroup = m_CmdGroups.size();
+        m_CurrentCmdGroup = m_CmdGroups.size();
     }
 }
 
@@ -3781,13 +3801,13 @@ void CCommandArgDescriptions::AddCommand(
             description->Delete(s_AutoHelpXml);
         }
 
-        if (m_CurrentGroup == 0) {
+        if (m_CurrentCmdGroup == 0) {
             SetCurrentCommandGroup(kEmptyStr);
         }
         m_Commands.remove(command);
         m_Commands.push_back(command);
         m_Description[command] = description;
-        m_Groups[command] = m_CurrentGroup;
+        m_Groups[command] = m_CurrentCmdGroup;
         if (!alias.empty()) {
             m_Aliases[command] = alias;
         } else {
@@ -4577,7 +4597,6 @@ CArgAllow* CArgAllow_Doubles::Clone(void) const
     return clone;
 }
 
-
 ///////////////////////////////////////////////////////
 // CArgException
 
diff --git a/c++/src/corelib/ncbiargs_p.hpp b/c++/src/corelib/ncbiargs_p.hpp
index bb137cb..6869739 100644
--- a/c++/src/corelib/ncbiargs_p.hpp
+++ b/c++/src/corelib/ncbiargs_p.hpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbiargs_p.hpp 460139 2015-02-25 13:49:33Z gouriano $
+/*  $Id: ncbiargs_p.hpp 480411 2015-09-30 15:30:00Z vakatov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -314,7 +314,7 @@ public:
     virtual CArgValue* ProcessDefault(void) const;
 
     virtual 
-    void SetConstraint(CArgAllow*                          constraint, 
+    void SetConstraint(const CArgAllow*                    constraint, 
                        CArgDescriptions::EConstraintNegate negate);
     virtual const CArgAllow* GetConstraint(void) const;
     virtual bool IsConstraintInverted() const;
diff --git a/c++/src/corelib/ncbidiag.cpp b/c++/src/corelib/ncbidiag.cpp
index aedbf94..8d43805 100644
--- a/c++/src/corelib/ncbidiag.cpp
+++ b/c++/src/corelib/ncbidiag.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbidiag.cpp 483520 2015-11-02 14:44:26Z ivanov $
+/*  $Id: ncbidiag.cpp 500364 2016-05-04 12:04:46Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -787,8 +787,7 @@ bool CDiagContextThreadData::IsInitialized(void)
 
 
 CDiagContextThreadData::CDiagContextThreadData(void)
-    : m_Properties(NULL),
-      m_DiagBuffer(new CDiagBuffer),
+    : m_DiagBuffer(new CDiagBuffer),
       m_TID(s_GetThreadId()),
       m_ThreadPostNumber(0),
       m_DiagCollectionSize(0),
@@ -1423,10 +1422,10 @@ void CDiagContext::UpdateOnFork(TOnForkFlags flags)
     CDiagContext& ctx = GetDiagContext();
     // Do not perform any actions in the parent process.
     if ( !UpdatePID() ) return;
-    if (flags && fOnFork_ResetTimer) {
+    if (flags & fOnFork_ResetTimer) {
         ctx.m_StopWatch->Restart();
     }
-    if (flags && fOnFork_PrintStart) {
+    if (flags & fOnFork_PrintStart) {
         ctx.PrintStart(kEmptyStr);
     }
 }
@@ -1899,6 +1898,9 @@ void CDiagContext::PrintProperties(void)
 void CDiagContext::PrintStart(const string& message)
 {
     x_PrintMessage(SDiagMessage::eEvent_Start, message);
+    // Print extra message. If ncbi_role and/or ncbi_location are set,
+    // they will be logged by this extra. Otherwise nothing will be printed.
+    Extra().PrintNcbiRoleAndLocation().Flush();
     // Log hit id if already available.
     x_GetDefaultHitID(eHitID_NoCreate);
 }
@@ -1988,6 +1990,21 @@ CDiagContext_Extra& CDiagContext_Extra::AllowBadSymbolsInArgNames(void)
 const TDiagPostFlags kApplogDiagPostFlags =
         eDPF_OmitInfoSev | eDPF_OmitSeparator | eDPF_AppLog;
 
+
+CDiagContext_Extra& CDiagContext_Extra::PrintNcbiRoleAndLocation(void)
+{
+    const string& role = CDiagContext::GetHostRole();
+    const string& loc = CDiagContext::GetHostLocation();
+    if ( !role.empty() ) {
+        Print("ncbi_role", role);
+    }
+    if ( !loc.empty() ) {
+        Print("ncbi_location", loc);
+    }
+    return *this;
+}
+
+
 void CDiagContext_Extra::Flush(void)
 {
     if (m_Flushed  ||  CDiagContext::IsSetOldPostFormat()) {
@@ -1996,21 +2013,16 @@ void CDiagContext_Extra::Flush(void)
 
     // Add ncbi-role and ncbi-location just before setting m_Flushed flag.
     if (m_EventType == SDiagMessage::eEvent_RequestStart) {
-        const string& role = CDiagContext::GetHostRole();
-        const string& loc = CDiagContext::GetHostLocation();
-        if ( !role.empty() ) {
-            Print("ncbi_role", role);
-        }
-        if ( !loc.empty() ) {
-            Print("ncbi_location", loc);
-        }
+        PrintNcbiRoleAndLocation();
     }
     // Prevent double-flush
     m_Flushed = true;
 
-    // Ignore extra messages without arguments. Allow start/stop,
-    // request-start/request-stop without arguments.
-    if (m_EventType == SDiagMessage::eEvent_Extra  &&
+    // Ignore extra messages without arguments. Allow request-start/request-stop
+    // and stop without arguments. Empty start messages are printed only if
+    // ncbi_role/ncbi_location are available (see above).
+    if ((m_EventType == SDiagMessage::eEvent_Extra  ||
+        m_EventType == SDiagMessage::eEvent_Start)  &&
         (!m_Args  ||  m_Args->empty()) ) {
         return;
     }
@@ -2498,8 +2510,43 @@ string CDiagContext::x_GetDefaultHitID(EDefaultHitIDFlags flag) const
         *m_DefaultHitId = CRequestContext::SelectLastHitID(
             TParamHttpHitId::GetDefault());
         if ( m_DefaultHitId->empty() ) {
-            *m_DefaultHitId = CRequestContext::SelectLastHitID(
+            string phid = CRequestContext::SelectLastHitID(
                 TParamHitId::GetDefault());
+            if ( !phid.empty() ) {
+                const char* c_env_job_id = getenv("JOB_ID");
+                string env_job_id = c_env_job_id ? string(c_env_job_id): "";
+                const char* c_env_task_id = getenv("SGE_TASK_ID");
+                string env_task_id = c_env_task_id ? string(c_env_task_id) : "";
+                if (env_task_id.find_first_not_of("0123456789") != NPOS) {
+                    // If task id is 'undefined', set it to 1 - it's a job with
+                    // just one task.
+                    env_task_id = "1";
+                }
+                if (!env_job_id.empty()  &&  !env_task_id.empty()) {
+                    // FIX LATER: It's better to use J and T prefix
+                    // to indicate job/task, but currently CRequestContext
+                    // logs errors if sub-hit id contains non-digits.
+                    // Using leading 0s is a temporary solution. Later,
+                    // when most apps are recompiled with the new
+                    // CRequestContext, we can reconsider using J/T.
+                    string jid = ".000" + env_job_id;
+                    string tid = ".00" + env_task_id;
+                    size_t jid_pos = phid.find(jid);
+                    if (jid_pos == NPOS) {
+                        // No current job id in the phid.
+                        phid += jid + tid;
+                    }
+                    else {
+                        // Job id is already in the phid. Check task id.
+                        if (phid.find(tid, jid_pos + jid.size()) == NPOS) {
+                            // New task in the same job.
+                            phid += tid;
+                        }
+                        // else - task id already in the phid. Ignore.
+                    }
+                }
+            }
+            *m_DefaultHitId = phid;
         }
         if (m_DefaultHitId->empty()  &&  (flag == eHitID_Create)) {
             *m_DefaultHitId = GetNextHitID();
@@ -2665,7 +2712,8 @@ void CDiagContext::x_StartRequest(void)
     string log_args = s_LogEnvironment->Get();
     if ( !log_args.empty() ) {
         list<string> log_args_list;
-        NStr::Split(log_args, " ", log_args_list);
+        NStr::Split(log_args, " ", log_args_list,
+            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         CDiagContext_Extra extra = GetDiagContext().Extra();
         extra.Print("LogEnvironment", "true");
         {{
@@ -2688,7 +2736,8 @@ void CDiagContext::x_StartRequest(void)
     log_args = s_LogRegistry->Get();
     if ( !log_args.empty() ) {
         list<string> log_args_list;
-        NStr::Split(log_args, " ", log_args_list);
+        NStr::Split(log_args, " ", log_args_list,
+            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         CDiagContext_Extra extra = GetDiagContext().Extra();
         extra.Print("LogRegistry", "true");
         {{
@@ -2954,9 +3003,9 @@ bool SetApplogFile(const string& file_name)
 
 
 // Load string value from config if not null, or from the environment.
-static string s_GetLogConfigString(const CTempString& name,
-                                   const CTempString& defval,
-                                   CNcbiRegistry*     config)
+static string s_GetLogConfigString(const CTempString name,
+                                   const CTempString defval,
+                                   CNcbiRegistry*    config)
 {
     if ( config ) {
         return config->GetString("LOG", name, defval);
@@ -2969,9 +3018,9 @@ static string s_GetLogConfigString(const CTempString& name,
 
 
 // Load bool value from config if not null, or from the environment.
-static bool s_GetLogConfigBool(const CTempString& name,
-                               bool               defval,
-                               CNcbiRegistry*     config)
+static bool s_GetLogConfigBool(const CTempString name,
+                               bool              defval,
+                               CNcbiRegistry*    config)
 {
     if ( config ) {
         return config->GetBool("LOG", name, defval);
@@ -3192,7 +3241,7 @@ void CDiagContext::SetupDiag(EAppDiagStream       ds,
                             break;
                         }
                     }
-                    ERR_POST_X(3, Info << "Failed to set log file to " +
+                    _TRACE_X(3, "Failed to set log file to " +
                         CFile::NormalizePath(log_name));
                 }
                 // Have we skipped cmd_logfile above?
@@ -3213,8 +3262,7 @@ void CDiagContext::SetupDiag(EAppDiagStream       ds,
                         to_applog = true;
                         break;
                     }
-                    ERR_POST_X_ONCE(4, Info <<
-                        "Failed to set log file to " <<
+                    _TRACE_X(4, "Failed to set log file to " <<
                         CFile::NormalizePath(kDefaultFallback));
                 }
                 const char* log_name = TTeeToStderr::GetDefault() ?
@@ -3321,7 +3369,7 @@ CDiagContext& GetDiagContext(void)
 EDiagSev       CDiagBuffer::sm_PostSeverity       = eDiag_Error;
 #else
 EDiagSev       CDiagBuffer::sm_PostSeverity       = eDiag_Warning;
-#endif /* else!NDEBUG */
+#endif
 
 EDiagSevChange CDiagBuffer::sm_PostSeverityChange = eDiagSC_Unknown;
                                                   // to be set on first request
@@ -4048,11 +4096,11 @@ bool x_IsEncodableChar(char c)
 class CExtraDecoder : public IStringDecoder
 {
 public:
-    virtual string Decode(const CTempString& src, EStringType stype) const;
+    virtual string Decode(const CTempString src, EStringType stype) const;
 };
 
 
-string CExtraDecoder::Decode(const CTempString& src, EStringType stype) const
+string CExtraDecoder::Decode(const CTempString src, EStringType stype) const
 {
     string str = src; // NStr::TruncateSpaces(src);
     size_t len = str.length();
@@ -4075,7 +4123,7 @@ string CExtraDecoder::Decode(const CTempString& src, EStringType stype) const
                 NCBI_THROW2(CStringException, eFormat,
                     "Inavild char in extra arg", p);
             }
-            str[dst] = (n1 << 4) | n2;
+            str[dst] = char((n1 << 4) | n2);
             p += 3;
             break;
         }
@@ -4670,16 +4718,17 @@ class CExtraEncoder : public IStringEncoder
 public:
     CExtraEncoder(bool allow_bad_names = false) : m_AllowBadNames(allow_bad_names) {}
 
-    virtual string Encode(const CTempString& src, EStringType stype) const;
+    virtual string Encode(const CTempString src, EStringType stype) const;
 
 private:
     bool m_AllowBadNames;
 };
 
 
-string CExtraEncoder::Encode(const CTempString& src, EStringType stype) const
+string CExtraEncoder::Encode(const CTempString src, EStringType stype) const
 {
     string dst;
+    dst.reserve(src.length() * 2);
     ITERATE(CTempString, c, src) {
         const char* enc = s_ExtraEncodeChars[(unsigned char)(*c)];
         if (stype == eName  &&  !m_AllowBadNames &&
@@ -7255,7 +7304,7 @@ extern void SetDoubleDiagHandler(void)
 
 
 //////////////////////////////////////////////////////
-//  abort handler
+//  Abort handler
 
 
 static FAbortHandler s_UserAbortHandler = 0;
@@ -7268,25 +7317,27 @@ extern void SetAbortHandler(FAbortHandler func)
 
 extern void Abort(void)
 {
-    // If defined user abort handler then call it 
+    // If there is a user abort handler then call it 
     if ( s_UserAbortHandler )
         s_UserAbortHandler();
-    
-    // If don't defined handler or application doesn't still terminated
+
+    // If there's no handler or application is still running
 
     // Check environment variable for silent exit
     const TXChar* value = NcbiSys_getenv(_TX("DIAG_SILENT_ABORT"));
     if (value  &&  (*value == _TX('Y')  ||  *value == _TX('y')  ||  *value == _TX('1'))) {
-        ::exit(255);
+        ::fflush(0);
+        ::_exit(255);
     }
     else if (value  &&  (*value == _TX('N')  ||  *value == _TX('n') || *value == _TX('0'))) {
         ::abort();
     }
     else {
-#if defined(_DEBUG)
-        ::abort();
+#if defined(NDEBUG)
+        ::fflush(0);
+        ::_exit(255);
 #else
-        ::exit(255);
+        ::abort();
 #endif
     }
 }
@@ -7337,7 +7388,8 @@ bool s_ParseErrCodeInfoStr(string&          str,
         }
 
         // Split string on parts
-        NStr::Split(str, ",", tokens);
+        NStr::Split(str, ",", tokens,
+            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         if (tokens.size() < 2) {
             ERR_POST_X(11, "Error message file parsing: Incorrect file format "
                            ", line " + NStr::UInt8ToString(line));
diff --git a/c++/src/corelib/ncbidiag_p.cpp b/c++/src/corelib/ncbidiag_p.cpp
index 8ab11c5..33d1a58 100644
--- a/c++/src/corelib/ncbidiag_p.cpp
+++ b/c++/src/corelib/ncbidiag_p.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbidiag_p.cpp 456643 2015-01-14 13:08:34Z ivanov $
+/*  $Id: ncbidiag_p.cpp 486111 2015-12-01 17:17:39Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -161,7 +161,8 @@ void CDiagStrErrCodeMatcher::Print(ostream& out) const
 void CDiagStrErrCodeMatcher::x_Parse(TPattern& pattern, const string& str)
 {
     list<string> loc;
-    NStr::Split( str,",",loc);
+    NStr::Split( str, ",", loc,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     list<string>::iterator it_loc;
     for (it_loc = loc.begin(); it_loc != loc.end(); ++it_loc) {
         string first, second;
@@ -802,6 +803,7 @@ void CDiagSyntaxParser::x_PutIntoFilter(CDiagFilter& to, EInto into)
         break;
     default :
         _ASSERT( false );
+        return;
     }
     m_Matchers.clear();
     m_ErrCodeMatcher = NULL;
diff --git a/c++/src/corelib/ncbidll.cpp b/c++/src/corelib/ncbidll.cpp
index 3d65abd..5412c88 100644
--- a/c++/src/corelib/ncbidll.cpp
+++ b/c++/src/corelib/ncbidll.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbidll.cpp 441333 2014-07-23 12:15:14Z ivanov $
+/*  $Id: ncbidll.cpp 484640 2015-11-13 14:10:20Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -387,14 +387,14 @@ void CDllResolver::x_AddExtraDllPath(vector<string>& paths, TExtraDllPath which)
         // Parse PATH environment variable
         const TXChar* env = NcbiSys_getenv(_TX("PATH"));
         if (env  &&  *env) {
-            NStr::Tokenize(_T_STDSTRING(env), ";", paths);
+            NStr::Split(_T_STDSTRING(env), ";", paths, NStr::fSplit_NoMergeDelims);
         }
 
 #elif defined(NCBI_OS_UNIX)
         // From LD_LIBRARY_PATH environment variable
         const char* env = getenv("LD_LIBRARY_PATH");
         if (env  &&  *env) {
-            NStr::Tokenize(env, ":", paths);
+            NStr::Split(env, ":", paths, NStr::fSplit_NoMergeDelims);
         }
 #endif
     }
@@ -405,10 +405,10 @@ void CDllResolver::x_AddExtraDllPath(vector<string>& paths, TExtraDllPath which)
         const char* runpath = NCBI_GetRunpath();
         if (runpath  &&  *runpath) {
 #  if defined(NCBI_OS_MSWIN)
-            NStr::Tokenize(runpath, ";", paths);
+            NStr::Split(runpath, ";", paths, NStr::fSplit_NoMergeDelims);
 #  elif defined(NCBI_OS_UNIX)
             vector<string> tokenized;
-            NStr::Tokenize(runpath, ":", tokenized);
+            NStr::Split(runpath, ":", tokenized, NStr::fSplit_NoMergeDelims);
             ITERATE(vector<string>, i, tokenized) {
                 if (i->find("$ORIGIN") == NPOS) {
                     paths.push_back(*i);
diff --git a/c++/src/corelib/ncbienv.cpp b/c++/src/corelib/ncbienv.cpp
index d2b7a64..b13d6c0 100644
--- a/c++/src/corelib/ncbienv.cpp
+++ b/c++/src/corelib/ncbienv.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbienv.cpp 478280 2015-09-08 14:33:40Z ivanov $
+/*  $Id: ncbienv.cpp 477588 2015-08-31 18:03:35Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/corelib/ncbiexec.cpp b/c++/src/corelib/ncbiexec.cpp
index 5b8a0f3..4a29d6e 100644
--- a/c++/src/corelib/ncbiexec.cpp
+++ b/c++/src/corelib/ncbiexec.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbiexec.cpp 426334 2014-02-07 17:41:49Z lavr $
+/*  $Id: ncbiexec.cpp 486111 2015-12-01 17:17:39Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -253,27 +253,52 @@ string CExec::QuoteArg(const string& arg)
 }
 
 
+// More advanced quoting function for MS Windows.
+// Produce string argument accepted by ::CreateProcess() and CExec::Spawn*().
+//
+// Used code by Daniel Colascione, Microsoft Corporation:
+// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx
+
 string s_QuoteSpawnArg(const string& arg)
 {
 #if defined(NCBI_OS_MSWIN)
 
-    if ( arg.empty() ) {
-        return '"' + arg + '"';
-    }
-    bool have_space = (arg.find(' ') != NPOS);
-    bool have_quote = (arg.find('"') != NPOS);
-
-    if (!have_space  &&  !have_quote) {
+    if (!arg.empty()  &&  arg.find_first_of(" \t\n\v\"") == NPOS) {
         return arg;
     }
-    string s = arg;
-    if ( have_quote ) {
-        s = NStr::Replace(s, "\"", "\"\"");
-    }
-    if ( NStr::EndsWith(s, '\\') ) {
-        return '"' + s + "\\\"";
+    string s;
+    s.push_back('"');
+
+    ITERATE(string, it, arg) {
+        unsigned int n_backslashes = 0;
+
+        while (it != arg.end()  &&  *it == '\\') {
+            ++it;
+            ++n_backslashes;
+        }
+        if (it == arg.end()) {
+            // Escape all backslashes, but let the terminating
+            // double quotation mark we add below be interpreted
+            // as a meta-character.
+            //
+            s.append(n_backslashes * 2, '\\');
+            break;
+
+        } else if (*it == '"') {
+            // Escape all backslashes and the following
+            // double quotation mark.
+            //
+            s.append(n_backslashes * 2 + 1, '\\');
+            s.push_back(*it);
+        } else {
+            // Backslashes aren't special here.
+            //
+            s.append(n_backslashes, '\\');
+            s.push_back(*it);
+        }
     }
-    return '"' + s + '"';
+    s.push_back('"');
+    return s;
 #else
     return arg;
 #endif
@@ -747,7 +772,7 @@ CExec::CResult CExec::RunSilent(EMode mode, const char *cmdname,
         const char* p = NULL;
         while ( (p = va_arg(vargs, const char*)) ) {
             cmdline += _TX(" "); 
-            cmdline += _T_XSTRING(CExec::QuoteArg(p));
+            cmdline += _T_XSTRING(s_QuoteSpawnArg(p));
         }
         va_end(vargs);
     }
@@ -854,9 +879,11 @@ string CExec::ResolvePath(const string& filename)
                 if (env  &&  *env) {
                     list<string> split_path;
 #  ifdef NCBI_OS_MSWIN
-                    NStr::Split(_T_STDSTRING(env), ";", split_path);
+                    NStr::Split(_T_STDSTRING(env), ";", split_path,
+                        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 #  else
-                    NStr::Split(env, ":", split_path);
+                    NStr::Split(env, ":", split_path,
+                        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 #  endif
                     ITERATE(list<string>, it, split_path) {
                         string p = CDirEntry::MakePath(*it, tmp);
diff --git a/c++/src/corelib/ncbiexpt.cpp b/c++/src/corelib/ncbiexpt.cpp
index d0f5b57..6f39bff 100644
--- a/c++/src/corelib/ncbiexpt.cpp
+++ b/c++/src/corelib/ncbiexpt.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbiexpt.cpp 456643 2015-01-14 13:08:34Z ivanov $
+/*  $Id: ncbiexpt.cpp 476589 2015-08-20 13:11:52Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -324,6 +324,14 @@ void CException::Throw(void) const
 const char* CException::what(void) const throw()
 {
     m_What = ReportAll();
+    if ( m_StackTrace.get()  &&  !m_StackTrace->Empty() ) {
+        CNcbiOstrstream os;
+        string old_prefix = m_StackTrace->GetPrefix();
+        m_StackTrace->SetPrefix("      ");
+        os << "     Stack trace:\n" << *m_StackTrace;
+        m_StackTrace->SetPrefix(old_prefix);
+        m_What += (string) CNcbiOstrstreamToString(os);
+    }
     return m_What.c_str();
 }
 
@@ -711,6 +719,7 @@ void CExceptionReporterStream::Report(const char* file, int line,
 }
 
 
+
 /////////////////////////////////////////////////////////////////////////////
 // Core exceptions
 /////////////////////////////////////////////////////////////////////////////
@@ -728,6 +737,7 @@ const char* CCoreException::GetErrCodeString(void) const
     }
 }
 
+
 const char* CInvalidParamException::GetErrCodeString(void) const
 {
     switch (GetErrCode()) {
@@ -737,6 +747,8 @@ const char* CInvalidParamException::GetErrCodeString(void) const
     }
 }
 
+
+
 #if (defined(NCBI_OS_MSWIN) && defined(_UNICODE)) || \
         (NCBI_COMPILER_MSVC && (_MSC_VER >= 1400) && __STDC_WANT_SECURE_LIB__)
 // MT: Store pointer to the strerror message in TLS
@@ -747,6 +759,8 @@ static void s_TlsStrerrorMessageCleanup(char* msg, void* /* data */)
 }
 #endif
 
+
+
 extern const char*  Ncbi_strerror(int errnum)
 {
 #if (defined(NCBI_OS_MSWIN) && defined(_UNICODE)) || \
@@ -768,6 +782,8 @@ extern const char*  Ncbi_strerror(int errnum)
 #endif
 }
 
+
+
 #if defined(NCBI_OS_MSWIN)
 
 // MT: Store pointer to the last error message in TLS
@@ -777,6 +793,7 @@ static void s_TlsErrorMessageCleanup(char* msg, void* /* data */)
     LocalFree(msg);
 }
 
+
 const char* CLastErrorAdapt::GetErrCodeString(int errnum)
 {
     TXChar* xptr = NULL;
@@ -787,9 +804,9 @@ const char* CLastErrorAdapt::GetErrCodeString(int errnum)
                   "%0", errnum,
                   MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                   (TXChar*)&xptr, 0, NULL);
-#if defined(NCBI_OS_MSWIN) && defined(_UNICODE)
+#if defined(_UNICODE)
     CStringUTF8 tmp( CUtf8::AsUTF8(xptr));
-    char* ptr = (char*)LocalAlloc( LPTR, tmp.size() + 1);
+    char* ptr = (char*) LocalAlloc(LPTR, tmp.size() + 1);
     strcpy(ptr, tmp.c_str());
     LocalFree(xptr);
 #else
@@ -810,6 +827,7 @@ const char* CLastErrorAdapt::GetErrCodeString(int errnum)
 #endif
 
 
+
 // Function declared in ncbimics.hpp
 void g_ThrowOnNull(void)
 {
diff --git a/c++/src/corelib/ncbifile.cpp b/c++/src/corelib/ncbifile.cpp
index 4075c3e..f7062b2 100644
--- a/c++/src/corelib/ncbifile.cpp
+++ b/c++/src/corelib/ncbifile.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbifile.cpp 466209 2015-04-29 18:50:29Z ivanov $
+/*  $Id: ncbifile.cpp 488254 2015-12-29 13:56:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -142,11 +142,11 @@ NCBI_PARAM_DEF (string, NCBI, TmpDir, kEmptyStr);
 //     [NCBI]
 //     DeleteReadOnlyFiles = true/false
 // Environment variable:
-//     NCBI_CONFIG__NCBI__DeleteReadOnlyFiles
+//     NCBI_CONFIG__DELETEREADONLYFILES
 //
 NCBI_PARAM_DECL(bool, NCBI, DeleteReadOnlyFiles);
 NCBI_PARAM_DEF_EX(bool, NCBI, DeleteReadOnlyFiles, false,
-    eParam_NoThread, NCBI_CONFIG__DeleteReadOnlyFiles);
+    eParam_NoThread, NCBI_CONFIG__DELETEREADONLYFILES);
 
 
 // Declare how umask settings on Unix affect creating files/directories 
@@ -155,7 +155,7 @@ NCBI_PARAM_DEF_EX(bool, NCBI, DeleteReadOnlyFiles, false,
 //     [NCBI]
 //     FileAPIHonorUmask = true/false
 // Environment variable:
-//     NCBI_CONFIG__NCBI__FileAPIHonorUmask
+//     NCBI_CONFIG__FILEAPIHONORUMASK
 //
 // On WINDOWS: umask affect only CRT function, the part of API that
 // use Windows API directly just ignore umask setting.
@@ -163,7 +163,7 @@ NCBI_PARAM_DEF_EX(bool, NCBI, DeleteReadOnlyFiles, false,
 
 NCBI_PARAM_DECL(bool, NCBI, FileAPIHonorUmask);
 NCBI_PARAM_DEF_EX(bool, NCBI, FileAPIHonorUmask, DEFAULT_HONOR_UMASK_VALUE,
-                  eParam_NoThread, NCBI_CONFIG__FileAPIHonorUmask);
+    eParam_NoThread, NCBI_CONFIG__FILEAPIHONORUMASK);
 
 
 // Declare the parameter to turn on logging from CFile,
@@ -172,13 +172,13 @@ NCBI_PARAM_DEF_EX(bool, NCBI, FileAPIHonorUmask, DEFAULT_HONOR_UMASK_VALUE,
 //     [NCBI]
 //     FileAPILogging = true/false
 // Environment variable:
-//     NCBI_CONFIG__NCBI__FileAPILogging
+//     NCBI_CONFIG__FILEAPILOGGING
 //
 #define DEFAULT_LOGGING_VALUE false
 
 NCBI_PARAM_DECL(bool, NCBI, FileAPILogging);
 NCBI_PARAM_DEF_EX(bool, NCBI, FileAPILogging, DEFAULT_LOGGING_VALUE,
-    eParam_NoThread, NCBI_CONFIG__FileAPILogging);
+    eParam_NoThread, NCBI_CONFIG__FILEAPILOGGING);
 
 
 #define LOG_ERROR(log_message) \
@@ -808,7 +808,7 @@ string CDirEntry::NormalizePath(const string& path, EFollowLinks follow_links)
     while ( !current.empty()  ||  !tail.empty() ) {
         std::list<string> pretail;
         if ( !current.empty() ) {
-            NStr::Split(current, kSep, pretail, NStr::eNoMergeDelims);
+            NStr::Split(current, kSep, pretail, NStr::fSplit_NoMergeDelims);
             current.erase();
             if (pretail.front().empty()
 #ifdef DISK_SEPARATOR
@@ -1307,14 +1307,14 @@ string CDirEntry::ModeToString(TMode user_mode, TMode group_mode,
             int i = 0;
             if (special > 0) {
                 out = "0000";
-                out[0] = char(special)  + '0';
+                out[0] = char(special + '0');
                 i++;
             } else {
                 out = "000";
             }
-            out[i++] = char(user_mode)  + '0';
-            out[i++] = char(group_mode) + '0';
-            out[i++] = char(other_mode) + '0';
+            out[i++] = char(user_mode  + '0');
+            out[i++] = char(group_mode + '0');
+            out[i++] = char(other_mode + '0');
         }
         break;
     case eModeFormat_Symbolic:
@@ -1452,7 +1452,8 @@ bool CDirEntry::StringToMode(const CTempString& mode,
         // eModeFormat_Symbolic
         } else {
             std::list<string> parts;
-            NStr::Split(mode, ",", parts);
+            NStr::Split(mode, ",", parts,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             if ( parts.empty() ) {
                 CNcbiError::Set(CNcbiError::eInvalidArgument, mode);
                 return false;
@@ -2419,9 +2420,46 @@ bool CDirEntry::Rename(const string& newname, TRenameFlags flags)
                              " Source path does not exist: " + src.GetPath(),
                              CNcbiError::eNoSuchFileOrDirectory);
     }
-    EType dst_type = dst.GetType();
+
+    // Try to "move" in one atomic operation if possible to avoid race
+    // conditions between check on destination existence and renaming.
+
+#ifdef NCBI_OS_MSWIN
+    // On Windows we can try to move file or whole directory, even across volumes
+    if ( MoveFileEx(_T_XCSTRING(src.GetPath()),
+                    _T_XCSTRING(dst.GetPath()), MOVEFILE_COPY_ALLOWED) ) {
+        Reset(newname);
+        return true;
+    }
+#else
+    // On Unix we can use "link" technique for files.
+    
+    // link() have dirrerent behavior on some flavors of Unix
+    // regarding symbolic links handling, and can automatically
+    // dereference both source and destination as POSIX required, 
+    // or not (Linux with kernel 2.0 and up behavior).
+    // We need to rename symlink itself, if not dereferenced yet
+    // (see fRF_FollowLinks), and the destination should remains
+    // a symlink. So just dont use link() in this case and,
+    // fall back to regular rename() instead.
     
+    if ( src_type != eLink  && 
+         link(_T_XCSTRING(src.GetPath()),
+              _T_XCSTRING(dst.GetPath())) == 0 ) {
+        // Hard link successfully created, so we can just remove source file
+        if ( src.Remove() ) {
+            Reset(newname);
+            return true;
+        }
+    }
+#endif
+    // On error, symlink, or destination existence --
+    // continue on regular processing below
+
+    EType dst_type = dst.GetType();
+
     // If destination exists...
+
     if ( dst_type != eUnknown ) {
         // Can rename entries with different types?
         if ( F_ISSET(flags, fRF_EqualTypes)  &&  (src_type != dst_type) ) {
@@ -2467,20 +2505,21 @@ bool CDirEntry::Rename(const string& newname, TRenameFlags flags)
         LOG_ERROR_AND_RETURN("CDirEntry::Rename():"
                              " Destination path exists: " + GetPath());
     }
+    
     // Rename
-#ifdef NCBI_OS_MSWIN
-    int ok_code = EACCES;
-#else  // NCBI_OS_UNIX
-    int ok_code = EXDEV;
-#endif // NCBI_OS_...
+    
     if ( NcbiSys_rename(_T_XCSTRING(src.GetPath()),
                         _T_XCSTRING(dst.GetPath())) != 0 ) {
-        if ( errno != ok_code ) {
+#ifdef NCBI_OS_MSWIN
+        if ( errno != EACCES ) {
+#else
+        if ( errno != EXDEV ) {
+#endif
             LOG_ERROR_AND_RETURN_ERRNO("CDirEntry::Rename():"
                                        " rename() failed for " + GetPath());
         }
         // Note that rename() fails in the case of cross-device renaming.
-        // So, try to copy, instead, then remove the original.
+        // So, try to make a copy and remove the original later.
         auto_ptr<CDirEntry>
             e(CDirEntry::CreateObject(src_type, src.GetPath()));
         if ( !e->Copy(dst.GetPath(), fCF_Recursive | fCF_PreserveAll ) ) {
@@ -4427,7 +4466,7 @@ static const SFileSystem s_FileSystem[] = {
     if (statvfs(path.c_str(), &st) != 0) {                     \
         NCBI_THROW(CFileErrnoException, eFileSystemInfo, msg); \
     }                                                          \
-    info->total_space  = (Uint8)st.f_bsize * st.f_blocks       \
+    info->total_space  = (Uint8)st.f_bsize * st.f_blocks;      \
     if (st.f_frsize) {                                         \
         info->free_space = (Uint8)st.f_frsize * st.f_bavail;   \
         info->block_size = (unsigned long)st.f_frsize;         \
@@ -4681,7 +4720,8 @@ void s_GetDiskSpace_PANFS(const string&               path,
                 throw kParseError;
             }
             vector<string> tokens;
-            NStr::Tokenize(data + 1, " ", tokens, NStr::fSplit_MergeDelims);
+            NStr::Split(data + 1, " ", tokens,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             if ( tokens.size() != 6 ) {
                 throw kParseError;
             }
@@ -5929,7 +5969,8 @@ void FindFiles(const string& pattern,
     string search_path = kDirSep;
 
     std::list<string> parts;
-    NStr::Split(abs_path, kDirSep, parts);
+    NStr::Split(abs_path, kDirSep, parts,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     if ( parts.empty() ) {
         return;
     }
@@ -6123,7 +6164,7 @@ void CFileIO::Open(const string& filename,
             _TROUBLE;
     };
     // -- Ignore 'share_mode' on UNIX.
-    share_mode = eShare;
+    //share_mode = eShare;
 
     // Try to open/create file
     m_Handle = open(filename.c_str(), flags, mode);
diff --git a/c++/src/corelib/ncbimtx.cpp b/c++/src/corelib/ncbimtx.cpp
index d15ad34..90365b1 100644
--- a/c++/src/corelib/ncbimtx.cpp
+++ b/c++/src/corelib/ncbimtx.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbimtx.cpp 450144 2014-10-23 13:52:16Z grichenk $
+/*  $Id: ncbimtx.cpp 469575 2015-06-05 16:41:20Z elisovdn $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -40,6 +40,9 @@
 #include "ncbidbg_p.hpp"
 #include <stdio.h>
 #include <algorithm>
+
+//#define LOG_MUTEX_EVENTS
+
 #ifdef NCBI_POSIX_THREADS
 #  include <sys/time.h> // for gettimeofday()
 #  include <sched.h>    // for sched_yield()
@@ -51,6 +54,8 @@
 #include <fcntl.h>
 #  if defined(NCBI_OS_MSWIN)
 #    include <io.h>
+#  else
+#    include <unistd.h>
 #  endif
 
 #endif
@@ -65,17 +70,51 @@
 BEGIN_NCBI_SCOPE
 
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Log mutex events if LOG_MUTEX_EVENTS is defined.
+//
+//    The mutex events (create/destroy/lock/unlock) are logged into
+//    ./mutex_events.log or the one specified in MUTEX_EVENTS_LOG_FILE
+//    env. variable.
+//
+
+
+#if defined(_DEBUG) &&  defined(LOG_MUTEX_EVENTS)
+
+// Logging function, prints pointer to the mutex, system thread ID
+// and the message.
+static void s_WriteMutexEvent(void* mutex_ptr, const char* message);
+#  define WRITE_MUTEX_EVENT(mutex, message) s_WriteMutexEvent(mutex, message)
+
+#else
+
+#  define WRITE_MUTEX_EVENT(mutex, message) ((void)0)
+
+#endif
+
+
+
 #if defined(_DEBUG) &&  defined(LOG_MUTEX_EVENTS)
 
-void WriteMutexEvent(void* mutex_ptr, const char* message)
+void s_WriteMutexEvent(void* mutex_ptr, const char* message)
 {
-    static const int mode = O_WRONLY | O_APPEND | O_CREAT | O_TRUNC;
+    static const int mode = O_WRONLY | O_APPEND | O_CREAT;
     static const mode_t perm = CDirEntry::MakeModeT(
         CDirEntry::fRead | CDirEntry::fWrite,
         CDirEntry::fRead | CDirEntry::fWrite,
         CDirEntry::fRead | CDirEntry::fWrite,
         0);
-    static const char* file_name = getenv("MUTEX_EVENTS_LOG_FILE");
+    static const char* file_name = getenv("MUTEX_EVENTS_LOG_FILE"); /*This can
+    lead to multiple opens of a file in multithreaded mode, but left so by
+    intention, because:
+    1) with C++11-compatible compiler problem will be gone,
+       while any modification makes it worse adapted to C++11;
+    2) You cannot use mutexes in the function that is called by any mutex
+       create/delete/lock/unlock;
+    3) File is opened without O_TRUNC, so any write()'s to file will be saved
+       even if write()'s are made with different handles
+    4) This is a debug-only function.                                       */
     static int handle = open(file_name ? file_name : "mutex_events.log",
         mode, perm);
     CNcbiOstrstream str_os;
diff --git a/c++/src/corelib/ncbireg.cpp b/c++/src/corelib/ncbireg.cpp
index 3894f2d..635d911 100644
--- a/c++/src/corelib/ncbireg.cpp
+++ b/c++/src/corelib/ncbireg.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbireg.cpp 461481 2015-03-10 16:01:30Z ucko $
+/*  $Id: ncbireg.cpp 495404 2016-03-17 13:28:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -168,6 +168,8 @@ inline string s_FlatKey(const string& section, const string& name)
 //
 // IRegistry
 
+const char* IRegistry::sm_InSectionCommentName = "[]";
+
 bool IRegistry::Empty(TFlags flags) const
 {
     x_CheckFlags("IRegistry::Empty", flags, fLayerFlags);
@@ -217,7 +219,7 @@ bool IRegistry::Write(CNcbiOstream& os, TFlags flags) const
     TReadGuard LOCK(*this);
 
     // Write file comment
-    if ( !s_WriteComment(os, GetComment(kEmptyStr, kEmptyStr, flags)) )
+    if ( !s_WriteComment(os, GetComment(kEmptyStr, kEmptyStr, flags) + "\n") )
         return false;
 
     list<string> sections;
@@ -246,6 +248,15 @@ bool IRegistry::Write(CNcbiOstream& os, TFlags flags) const
                 return false;
             }
         }
+        // Make a line break between section entries and next section 
+        // (or optional in-section comments)
+        os << Endl();
+        // Write in-section comment
+        list<string> in_section_comments;
+        EnumerateInSectionComments(*section, &in_section_comments, flags);
+        ITERATE(list<string>, comment, in_section_comments) {
+            s_WriteComment(os, *comment + "\n");
+        }
     }
 
     // Clear the modified bit (checking it first so as to perform the
@@ -301,7 +312,9 @@ bool IRegistry::HasEntry(const string& section, const string& name,
         return false;
     }
     string clean_name = NStr::TruncateSpaces(name);
-    if ( !clean_name.empty()  &&  !s_IsNameEntry(clean_name, flags) ) {
+    bool is_special_name = clean_name.empty() || 
+                            clean_name == sm_InSectionCommentName;
+    if ( !is_special_name  &&  !s_IsNameEntry(clean_name, flags) ) {
         _TRACE("IRegistry::HasEntry: bad entry name \""
                << NStr::PrintableString(name) << '\"');
         return false;
@@ -452,7 +465,9 @@ const string& IRegistry::GetComment(const string& section, const string& name,
         return kEmptyStr;
     }
     string clean_name = NStr::TruncateSpaces(name);
-    if ( !clean_name.empty()  &&  !s_IsNameSection(clean_name, flags) ) {
+    bool is_special_name = clean_name.empty() || 
+                            clean_name == sm_InSectionCommentName;
+    if ( !is_special_name  &&  !s_IsNameSection(clean_name, flags) ) {
         _TRACE("IRegistry::GetComment: bad entry name \""
                << NStr::PrintableString(name) << '\"');
         return kEmptyStr;
@@ -462,6 +477,29 @@ const string& IRegistry::GetComment(const string& section, const string& name,
 }
 
 
+void IRegistry::EnumerateInSectionComments(const string& section,
+                                           list<string>* comments, 
+                                           TFlags        flags) const
+{
+    x_CheckFlags("IRegistry::EnumerateInSectionComments", flags,
+        (TFlags)fLayerFlags);
+
+    if (!(flags & fTPFlags)) {
+        flags |= fTPFlags;
+    }
+    _ASSERT(comments);
+    comments->clear();
+    string clean_section = NStr::TruncateSpaces(section);
+    if (clean_section.empty() || !s_IsNameSection(clean_section, flags)) {
+        _TRACE("IRegistry::EnumerateInSectionComments: bad section name \""
+            << NStr::PrintableString(section) << '\"');
+        return;
+    }
+    TReadGuard LOCK(*this);
+    x_Enumerate(clean_section, *comments, flags | fInSectionComments);
+}
+
+
 void IRegistry::EnumerateSections(list<string>* sections, TFlags flags) const
 {
     // Should clear fSectionlessEntries if set
@@ -613,6 +651,9 @@ IRWRegistry* IRWRegistry::x_Read(CNcbiIstream& is, TFlags flags,
     string    section(kEmptyStr);      // current section name
     string    comment;      // current comment
     string    in_path = path.empty() ? kEmptyStr : (" in " + path);
+    // To collect in-section comments we need a special container, because 
+    // these comments may be multiline with line breaks in the middle
+    map<string, string> in_section_comments;
 
     for (line = 1;  NcbiGetlineEOL(is, str);  ++line) {
         try {
@@ -622,9 +663,16 @@ IRWRegistry* IRWRegistry::x_Read(CNcbiIstream& is, TFlags flags,
             while (beg < len  &&  isspace((unsigned char) str[beg])) {
                 ++beg;
             }
+            // If this line is empty, all comments
+            // that have just been read go to the current section.
             if (beg == len) {
-                comment += str;
-                comment += '\n';
+                if (!comment.empty() && !section.empty()) {
+                    in_section_comments[section] += comment + "\n";
+                    SetComment(NStr::TruncateSpaces(
+                               in_section_comments[section]), section, 
+                               sm_InSectionCommentName, flags | fCountCleared);
+                    comment.erase();
+                }
                 continue;
             }
 
@@ -638,6 +686,14 @@ IRWRegistry* IRWRegistry::x_Read(CNcbiIstream& is, TFlags flags,
             case ';':  { // section or entry comment
                 comment += str;
                 comment += '\n';
+                // If there is end of file next, all comments
+                // that have just been read go to the current section.
+                if (is.peek() == EOF && !section.empty()) {
+                    SetComment(comment, section, sm_InSectionCommentName, 
+                               flags | fCountCleared);
+                    comment.erase();
+                    continue;
+                }
                 break;
             }
 
@@ -661,8 +717,7 @@ IRWRegistry* IRWRegistry::x_Read(CNcbiIstream& is, TFlags flags,
                 }
                 // Unconditional, to ensure the section becomes known
                 // even if it has no comment or contents
-                SetComment(GetComment(section, kEmptyStr, impact) + comment,
-                           section, kEmptyStr, flags | fCountCleared);
+                SetComment(comment, section, kEmptyStr, flags | fCountCleared);
                 comment.erase();
                 break;
             }
@@ -815,6 +870,33 @@ bool IRWRegistry::Set(const string& section, const string& name,
 }
 
 
+bool IRWRegistry::Unset(const string& section, const string& name,
+                        TFlags flags)
+{
+    x_CheckFlags("IRWRegistry::Unset", flags,
+                 fTPFlags | fCountCleared | fSectionlessEntries);
+    string clean_section = NStr::TruncateSpaces(section);
+    if ( !s_IsNameSection(clean_section, flags) ) {
+        _TRACE("IRWRegistry::Unset: bad section name \""
+               << NStr::PrintableString(section) << '\"');
+        return false;
+    }
+    string clean_name = NStr::TruncateSpaces(name);
+    if ( !s_IsNameEntry(clean_name, flags) ) {
+        _TRACE("IRWRegistry::Unset: bad entry name \""
+               << NStr::PrintableString(name) << '\"');
+        return false;
+    }
+    TWriteGuard LOCK(*this);
+    if (x_Unset(clean_section, clean_name, flags)) {
+        x_SetModifiedFlag(true, flags);
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
 bool IRWRegistry::SetComment(const string& comment, const string& section,
                              const string& name, TFlags flags)
 {
@@ -827,7 +909,9 @@ bool IRWRegistry::SetComment(const string& comment, const string& section,
         return false;
     }
     string clean_name = NStr::TruncateSpaces(name);
-    if ( !clean_name.empty()  &&  !s_IsNameEntry(clean_name, flags) ) {
+    bool is_special_name = clean_name.empty()  || 
+                            clean_name == sm_InSectionCommentName;
+    if ( !is_special_name && !s_IsNameEntry(clean_name, flags) )  {
         _TRACE("IRWRegistry::SetComment: bad entry name \""
                << NStr::PrintableString(name) << '\"');
         return false;
@@ -847,7 +931,11 @@ bool IRWRegistry::MaybeSet(string& target, const string& value, TFlags flags)
 {
     if (target.empty()) {
         target = value;
-        return !value.empty();
+        /* "return !value.empty()" was here before, which prevented to set 
+           comments to empty values, but now empty string is 
+           considered a value, not an unset variable, so we always return 
+           true */
+        return true; 
     } else if ( !(flags & fNoOverride) ) {
         target = value;
         return true;
@@ -889,6 +977,14 @@ bool CMemoryRegistry::x_HasEntry(const string& section, const string& name,
     } else if (name.empty()) {
         return ((flags & fCountCleared) != 0) || !sit->second.cleared;
     }
+    if (name == sm_InSectionCommentName) {
+        const string& inner_comment = sit->second.in_section_comment;
+        if (!inner_comment.empty()) {
+            return true; 
+        } else {
+            return false;
+        }
+    }
     const TEntries& entries = sit->second.entries;
     TEntries::const_iterator eit = entries.find(name);
     if (eit == entries.end()) {
@@ -913,6 +1009,8 @@ const string& CMemoryRegistry::x_GetComment(const string& section,
         return kEmptyStr;
     } else if (name.empty()) {
         return sit->second.comment;
+    } else if (name == sm_InSectionCommentName) {
+        return sit->second.in_section_comment;
     }
     const TEntries& entries = sit->second.entries;
     TEntries::const_iterator eit = entries.find(name);
@@ -937,7 +1035,14 @@ void CMemoryRegistry::x_Enumerate(const string& section, list<string>& entries,
                 entries.push_back(it->first);
             }
         }
+    } else  if (flags & IRegistry::fInSectionComments) {
+        // Enumerate in-section comments
+        string comment = x_GetComment(section, "[]", flags);
+        if (!comment.empty()) {
+            entries.push_back(comment);
+        }
     } else {
+        // Enumerate entries
         TSections::const_iterator sit = m_Sections.find(section);
         if (sit != m_Sections.end()) {
             ITERATE (TEntries, it, sit->second.entries) {
@@ -965,25 +1070,7 @@ bool CMemoryRegistry::x_Set(const string& section, const string& name,
     _TRACE(this << ": [" << section << ']' << name << " = " << value);
 #if 0 // historic behavior; could inappropriately expose entries in lower layers
     if (value.empty()) {
-        if (flags & fNoOverride) {
-            return false;
-        }
-        // remove
-        TSections::iterator sit = m_Sections.find(section);
-        if (sit == m_Sections.end()) {
-            return false;
-        }
-        TEntries& entries = sit->second.entries;
-        TEntries::iterator eit = entries.find(name);
-        if (eit == entries.end()) {
-            return false;
-        } else {
-            entries.erase(eit);
-            if (entries.empty()  &&  sit->second.comment.empty()) {
-                m_Sections.erase(sit);
-            }
-            return true;
-        }
+        return x_Unset(section, name, flags);
     } else
 #endif
     {
@@ -1024,6 +1111,29 @@ bool CMemoryRegistry::x_Set(const string& section, const string& name,
 }
 
 
+bool CMemoryRegistry::x_Unset(const string& section, const string& name,
+                              TFlags flags)
+{
+    _TRACE(this << ": [" << section << ']' << name << " to be unset");
+    TSections::iterator sit = m_Sections.find(section);
+    if (sit == m_Sections.end()) {
+        return false;
+    }
+    TEntries& entries = sit->second.entries;
+    TEntries::iterator eit = entries.find(name);
+    if (eit == entries.end()) {
+        return false;
+    } else {
+        entries.erase(eit);
+        if (entries.empty()  &&  sit->second.comment.empty()
+            &&  (flags & fCountCleared) == 0) {
+            m_Sections.erase(sit);
+        }
+        return true;
+    }
+}
+
+
 bool CMemoryRegistry::x_SetComment(const string& comment,
                                    const string& section, const string& name,
                                    TFlags flags)
@@ -1045,20 +1155,31 @@ bool CMemoryRegistry::x_SetComment(const string& comment,
         }
     }
     TEntries& entries = sit->second.entries;
+    string& inner_comment = sit->second.in_section_comment;
+    string& outer_comment = sit->second.comment;
     if (name.empty()) {
-        if (comment.empty()  &&  entries.empty()
+        if (comment.empty()  &&  entries.empty()  &&  inner_comment.empty()
             &&  (flags & fCountCleared) == 0) {
             m_Sections.erase(sit);
             return true;
         } else {
-            return MaybeSet(sit->second.comment, comment, flags);
+            return MaybeSet(outer_comment, comment, flags);
+        }
+    }
+    if (name == sm_InSectionCommentName) {
+        if (comment.empty() && entries.empty() && outer_comment.empty()
+            && (flags & fCountCleared) == 0) {
+            m_Sections.erase(sit);
+            return true;
+        } else {
+            return MaybeSet(inner_comment, comment, flags);
         }
     }
     TEntries::iterator eit = entries.find(name);
     if (eit == entries.end()) {
         return false;
     } else {
-        return MaybeSet(eit->second.comment, comment, flags);
+        return MaybeSet(outer_comment, comment, flags);
     }
 }
 
@@ -1200,7 +1321,7 @@ const string& CCompoundRegistry::x_GetComment(const string& section,
     if (section.empty()) {
         reg = m_PriorityMap.rbegin()->second;
     } else {
-        reg = FindByContents(section, name, flags);
+        reg = FindByContents(section, name, flags & ~fJustCore);
     }
     return reg ? reg->GetComment(section, name, flags & ~fJustCore)
         : kEmptyStr;
@@ -1217,8 +1338,13 @@ void CCompoundRegistry::x_Enumerate(const string& section,
         }
 
         list<string> tmp;
-        it->second->EnumerateEntries(section, &tmp, flags & ~fJustCore);
 
+        if (flags & fInSectionComments) {
+            it->second->EnumerateInSectionComments(section, &tmp, 
+                                                   flags & ~fJustCore);
+        } else {
+            it->second->EnumerateEntries(section, &tmp, flags & ~fJustCore);
+        }
         ITERATE (list<string>, it2, tmp) {
             accum.insert(*it2);
         }
@@ -1331,16 +1457,35 @@ void CTwoLayerRegistry::x_Enumerate(const string& section,
 {
     switch (flags & fTPFlags) {
     case fTransient:
-        m_Transient->EnumerateEntries(section, &entries, flags | fTPFlags);
+        if (flags & fInSectionComments) {
+            m_Transient->EnumerateInSectionComments(section, &entries, 
+                                                    flags | fTPFlags);
+        } else {
+            m_Transient->EnumerateEntries(section, &entries, 
+                                          flags | fTPFlags);
+        }
         break;
     case fPersistent:
-        m_Persistent->EnumerateEntries(section, &entries, flags | fTPFlags);
+        if (flags & fInSectionComments) {
+            m_Persistent->EnumerateInSectionComments(section, &entries, 
+                                                     flags | fTPFlags);
+        } else {
+            m_Persistent->EnumerateEntries(section, &entries, 
+                                           flags | fTPFlags);
+        }
         break;
     case fTPFlags:
     {
         list<string> tl, pl;
-        m_Transient ->EnumerateEntries(section, &tl, flags | fTPFlags);
-        m_Persistent->EnumerateEntries(section, &pl, flags | fTPFlags);
+        if (flags & fInSectionComments) {
+            m_Transient ->EnumerateInSectionComments(section, &tl, 
+                                                     flags | fTPFlags);
+            m_Persistent->EnumerateInSectionComments(section, &pl, 
+                                                     flags | fTPFlags);
+        } else {
+            m_Transient ->EnumerateEntries(section, &tl, flags | fTPFlags);
+            m_Persistent->EnumerateEntries(section, &pl, flags | fTPFlags);
+        }
         set_union(pl.begin(), pl.end(), tl.begin(), tl.end(),
                   back_inserter(entries), PNocase());
         break;
@@ -1383,6 +1528,20 @@ bool CTwoLayerRegistry::x_Set(const string& section, const string& name,
 }
 
 
+bool CTwoLayerRegistry::x_Unset(const string& section, const string& name,
+                                TFlags flags)
+{
+    bool result = false;
+    if ((flags & fTPFlags) != fTransient) {
+        result |= m_Persistent->Unset(section, name, flags & ~fTPFlags);
+    }
+    if ((flags & fTPFlags) != fPersistent) {
+        result |= m_Transient->Unset(section, name, flags & ~fTPFlags);
+    }
+    return result;
+}
+
+
 bool CTwoLayerRegistry::x_SetComment(const string& comment,
                                      const string& section, const string& name,
                                      TFlags flags)
@@ -1574,6 +1733,18 @@ IRWRegistry* CNcbiRegistry::x_Read(CNcbiIstream& is, TFlags flags,
 }
 
 
+const string& CNcbiRegistry::x_GetComment(const string& section,
+                                          const string& name,
+                                          TFlags        flags) const
+{
+    if (section.empty()) {      
+        return m_FileRegistry->GetComment(section, name, flags);
+    }
+
+    return CCompoundRWRegistry::x_GetComment(section, name, flags);
+}
+
+
 //////////////////////////////////////////////////////////////////////
 //
 // CCompoundRWRegistry -- general-purpose setup
@@ -1784,6 +1955,17 @@ const string& CCompoundRWRegistry::x_GetComment(const string& section,
                                                 const string& name,
                                                 TFlags flags) const
 {
+    const string* result;
+    if (section.empty() || name.empty()) {
+        result = &(m_MainRegistry->GetComment(section, name, flags));
+        if (result->empty()) {
+            auto reg = FindByName(".file");
+            if (reg != NULL)
+                result = &(reg->GetComment(section, name, flags));
+        }
+        return *result;
+    }
+
     return m_AllRegistries->GetComment(section, name, flags);
 }
 
@@ -1800,7 +1982,13 @@ void CCompoundRWRegistry::x_Enumerate(const string& section,
         }
 
         list<string> tmp;
-        it->second->EnumerateEntries(section, &tmp, flags & ~fJustCore);
+
+        if (flags & fInSectionComments) {
+            it->second->EnumerateInSectionComments(section, &tmp, 
+                                                   flags & ~fJustCore);
+        } else {
+            it->second->EnumerateEntries(section, &tmp, flags & ~fJustCore);
+        }
 
         ITERATE (list<string>, it2, tmp) {
             // avoid reporting cleared entries
@@ -1864,6 +2052,19 @@ bool CCompoundRWRegistry::x_Set(const string& section, const string& name,
 }
 
 
+bool CCompoundRWRegistry::x_Unset(const string& section, const string& name,
+                                  TFlags flags)
+{
+    bool result = false;
+    NON_CONST_ITERATE (CCompoundRegistry::TPriorityMap, it,
+                       m_AllRegistries->m_PriorityMap) {
+        IRWRegistry& subreg = dynamic_cast<IRWRegistry&>(*it->second);
+        result |= subreg.Unset(section, name, flags);
+    }
+    return result;
+}
+
+
 bool CCompoundRWRegistry::x_SetComment(const string& comment,
                                        const string& section,
                                        const string& name, TFlags flags)
diff --git a/c++/src/corelib/ncbistr.cpp b/c++/src/corelib/ncbistr.cpp
index 19d1689..68e3336 100644
--- a/c++/src/corelib/ncbistr.cpp
+++ b/c++/src/corelib/ncbistr.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbistr.cpp 479746 2015-09-23 13:17:35Z ivanov $
+/*  $Id: ncbistr.cpp 491918 2016-02-10 14:52:43Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -99,7 +99,7 @@ const wstring& CNcbiEmptyWString::FirstGet(void) {
 #endif
 
 
-bool NStr::IsBlank(const CTempString& str, SIZE_TYPE pos)
+bool NStr::IsBlank(const CTempString str, SIZE_TYPE pos)
 {
     SIZE_TYPE len = str.length();
     for (SIZE_TYPE idx = pos; idx < len; ++idx) {
@@ -111,7 +111,7 @@ bool NStr::IsBlank(const CTempString& str, SIZE_TYPE pos)
 }
 
 
-int NStr::CompareCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+int NStr::CompareCase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                       const char* pattern)
 {
     if (pos == NPOS  ||  !n  ||  str.length() <= pos) {
@@ -135,8 +135,8 @@ int NStr::CompareCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
 
 
 
-int NStr::CompareCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                      const CTempString& pattern)
+int NStr::CompareCase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                      const CTempString pattern)
 {
     if (pos == NPOS  ||  !n  ||  str.length() <= pos) {
         return pattern.empty() ? 0 : -1;
@@ -167,7 +167,7 @@ int NStr::CompareCase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
 }
 
 
-int NStr::CompareNocase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
+int NStr::CompareNocase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
                         const char* pattern)
 {
     if (pos == NPOS  ||  !n  ||  str.length() <= pos) {
@@ -196,8 +196,8 @@ int NStr::CompareNocase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
 }
 
 
-int NStr::CompareNocase(const CTempString& str, SIZE_TYPE pos, SIZE_TYPE n,
-                        const CTempString& pattern)
+int NStr::CompareNocase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n,
+                        const CTempString pattern)
 {
     if (pos == NPOS  ||  !n  ||  str.length() <= pos) {
         return pattern.empty() ? 0 : -1;
@@ -269,11 +269,11 @@ bool NStr::MatchesMask(CTempString str, CTempString mask, ECase use_case)
             return false;
 
         default:
-            // Compare nonpattern character in mask and name
+            // Compare non pattern character in mask and name
             char s = str[str_pos++];
             if (use_case == NStr::eNocase) {
-                c = tolower((unsigned char) c);
-                s = tolower((unsigned char) s);
+                c = (char)tolower((unsigned char) c);
+                s = (char)tolower((unsigned char) s);
             }
             if (c != s) {
                 return false;
@@ -289,7 +289,7 @@ char* NStr::ToLower(char* str)
 {
     char* s;
     for (s = str;  *str;  str++) {
-        *str = tolower((unsigned char)(*str));
+        *str = (char)tolower((unsigned char)(*str));
     }
     return s;
 }
@@ -298,7 +298,7 @@ char* NStr::ToLower(char* str)
 string& NStr::ToLower(string& str)
 {
     NON_CONST_ITERATE (string, it, str) {
-        *it = tolower((unsigned char)(*it));
+        *it = (char)tolower((unsigned char)(*it));
     }
     return str;
 }
@@ -308,7 +308,7 @@ char* NStr::ToUpper(char* str)
 {
     char* s;
     for (s = str;  *str;  str++) {
-        *str = toupper((unsigned char)(*str));
+        *str = (char)toupper((unsigned char)(*str));
     }
     return s;
 }
@@ -317,13 +317,13 @@ char* NStr::ToUpper(char* str)
 string& NStr::ToUpper(string& str)
 {
     NON_CONST_ITERATE (string, it, str) {
-        *it = toupper((unsigned char)(*it));
+        *it = (char)toupper((unsigned char)(*it));
     }
     return str;
 }
 
 
-bool NStr::IsLower(const CTempString& str)
+bool NStr::IsLower(const CTempString str)
 {
     SIZE_TYPE len = str.length();
     for (SIZE_TYPE i = 0; i < len; ++i) {
@@ -335,7 +335,7 @@ bool NStr::IsLower(const CTempString& str)
 }
 
 
-bool NStr::IsUpper(const CTempString& str)
+bool NStr::IsUpper(const CTempString str)
 {
     SIZE_TYPE len = str.length();
     for (SIZE_TYPE i = 0; i < len; ++i) {
@@ -407,7 +407,7 @@ public:
     // Auxiliary function to create a message about conversion error 
     // to specified type. It doesn't have any relation to the guard itself,
     // but can help to save on the amount of code in calling macro.
-    string Message(const CTempString& str, const char* to_type, const CTempString& msg);
+    string Message(const CTempString str, const char* to_type, const CTempString msg);
 
 private:
     bool m_NoThrow;    // do not throw an exception if TRUE
@@ -415,7 +415,7 @@ private:
     int  m_Errno;      // errno value to set
 };
 
-string CS2N_Guard::Message(const CTempString& str, const char* to_type, const CTempString& msg)
+string CS2N_Guard::Message(const CTempString str, const char* to_type, const CTempString msg)
 {
     string s;
     s.reserve(str.length() + msg.length() + 50);
@@ -495,7 +495,7 @@ string CS2N_Guard::Message(const CTempString& str, const char* to_type, const CT
     }
 
 
-int NStr::StringToInt(const CTempString& str, TStringToNumFlags flags,int base)
+int NStr::StringToInt(const CTempString str, TStringToNumFlags flags,int base)
 {
     S2N_CONVERT_GUARD_EX(flags);
     Int8 value = StringToInt8(str, flags, base);
@@ -507,7 +507,7 @@ int NStr::StringToInt(const CTempString& str, TStringToNumFlags flags,int base)
 
 
 unsigned int
-NStr::StringToUInt(const CTempString& str, TStringToNumFlags flags, int base)
+NStr::StringToUInt(const CTempString str, TStringToNumFlags flags, int base)
 {
     S2N_CONVERT_GUARD_EX(flags);
     Uint8 value = StringToUInt8(str, flags, base);
@@ -518,7 +518,7 @@ NStr::StringToUInt(const CTempString& str, TStringToNumFlags flags, int base)
 }
 
 
-long NStr::StringToLong(const CTempString& str, TStringToNumFlags flags,
+long NStr::StringToLong(const CTempString str, TStringToNumFlags flags,
                         int base)
 {
     S2N_CONVERT_GUARD_EX(flags);
@@ -531,7 +531,7 @@ long NStr::StringToLong(const CTempString& str, TStringToNumFlags flags,
 
 
 unsigned long
-NStr::StringToULong(const CTempString& str, TStringToNumFlags flags, int base)
+NStr::StringToULong(const CTempString str, TStringToNumFlags flags, int base)
 {
     S2N_CONVERT_GUARD_EX(flags);
     Uint8 value = StringToUInt8(str, flags, base);
@@ -566,7 +566,7 @@ bool s_IsGoodCharForRadix(char ch, int base, int* value = 0)
     if (isdigit((unsigned char) ch)) {
         delta = ch - '0';
     } else {
-        ch = tolower((unsigned char) ch);
+        ch = (char)tolower((unsigned char) ch);
         delta = ch - 'a' + 10;
     }
     if ( value ) {
@@ -601,7 +601,7 @@ bool s_IsDecimalPoint(unsigned char ch, NStr::TStringToNumFlags  flags)
 }
 
 static inline
-void s_SkipAllowedSymbols(const CTempString& str,
+void s_SkipAllowedSymbols(const CTempString  str,
                           SIZE_TYPE&         pos,
                           ESkipMode          skip_mode,
                           NStr::TStringToNumFlags  flags)
@@ -628,7 +628,7 @@ void s_SkipAllowedSymbols(const CTempString& str,
 // Update 'ptr' to current position in the string.
 
 static inline
-bool s_CheckRadix(const CTempString& str, SIZE_TYPE& pos, int& base)
+bool s_CheckRadix(const CTempString str, SIZE_TYPE& pos, int& base)
 {
     if ( base == 10 || base == 8 ) {
         // shortcut for most frequent case
@@ -660,7 +660,7 @@ bool s_CheckRadix(const CTempString& str, SIZE_TYPE& pos, int& base)
 }
 
 
-Int8 NStr::StringToInt8(const CTempString& str, TStringToNumFlags flags,
+Int8 NStr::StringToInt8(const CTempString str, TStringToNumFlags flags,
                         int base)
 {
     _ASSERT(flags == 0  ||  flags > 32);
@@ -741,7 +741,7 @@ Int8 NStr::StringToInt8(const CTempString& str, TStringToNumFlags flags,
 }
 
 
-Uint8 NStr::StringToUInt8(const CTempString& str,
+Uint8 NStr::StringToUInt8(const CTempString str,
                           TStringToNumFlags flags, int base)
 {
     _ASSERT(flags == 0  ||  flags > 32);
@@ -903,7 +903,7 @@ double NStr::StringToDoublePosix(const char* ptr, char** endptr, TStringToNumFla
     for ( ; ; c = *ptr++ ) {
         if (c >= '0' && c <= '9') {
             // digits: accumulate
-            c -= '0';
+            c = (char)(c - '0');
             anydigits = true;
             ++digits;
             if (first == 0) {
@@ -1146,7 +1146,7 @@ double NStr::StringToDoublePosix(const char* ptr, char** endptr, TStringToNumFla
     if (endptr) {
         *endptr = (char*)ptr;
     }
-    return ret;
+    return (double)ret;
 }
 
 
@@ -1257,7 +1257,7 @@ double NStr::StringToDoubleEx(const char* str, size_t size,
 }
 
 
-double NStr::StringToDouble(const CTempStringEx& str, TStringToNumFlags flags)
+double NStr::StringToDouble(const CTempStringEx str, TStringToNumFlags flags)
 {
     size_t size = str.size();
     if ( str.HasZeroAtEnd() ) {
@@ -1277,7 +1277,7 @@ double NStr::StringToDouble(const CTempStringEx& str, TStringToNumFlags flags)
 }
 
 /// @internal
-static Uint8 s_DataSizeConvertQual(const CTempString&      str,
+static Uint8 s_DataSizeConvertQual(const CTempString       str,
                                    SIZE_TYPE&              pos, 
                                    Uint8                   value,
                                    NStr::TStringToNumFlags flags)
@@ -1289,7 +1289,7 @@ static Uint8 s_DataSizeConvertQual(const CTempString&      str,
         return value;
     }
 
-    ch = toupper(ch);
+    ch = (unsigned char)toupper(ch);
     Uint8 v   = value;
     bool  err = false;
 
@@ -1331,9 +1331,9 @@ static Uint8 s_DataSizeConvertQual(const CTempString&      str,
 }
 
 
-Uint8 NStr::StringToUInt8_DataSize(const CTempString& str, 
-                                   TStringToNumFlags  flags, 
-                                   int                base)
+Uint8 NStr::StringToUInt8_DataSize(const CTempString str, 
+                                   TStringToNumFlags flags, 
+                                   int               base)
 {
     // We have a limited base range here
     _ASSERT(flags == 0  ||  flags > 20);
@@ -1410,7 +1410,7 @@ Uint8 NStr::StringToUInt8_DataSize(const CTempString& str,
 }
 
 
-Uint8 NStr::StringToUInt8_DataSize(const CTempString& str,
+Uint8 NStr::StringToUInt8_DataSize(const CTempString str,
                                    TStringToNumFlags flags /* = 0 */)
 {
     TStringToNumFlags allowed_flags = fConvErr_NoThrow +
@@ -1506,14 +1506,14 @@ Uint8 NStr::StringToUInt8_DataSize(const CTempString& str,
     }
     char suff_c = 0;
     if (str_ptr < str_end)
-        suff_c = toupper(*str_ptr);
+        suff_c = (char)toupper(*str_ptr);
 
     static const char s_Suffixes[] = {'K', 'M', 'G', 'T', 'P', 'E'};
     static const char* const s_BinCoefs[] = {"1024", "1048576", "1073741824",
                                              "1099511627776",
                                              "1125899906842624",
                                              "1152921504606846976"};
-    static const Uint4 s_NumSuffixes = sizeof(s_Suffixes) / sizeof(s_Suffixes[0]);
+    static const Uint4 s_NumSuffixes = (Uint4)(sizeof(s_Suffixes) / sizeof(s_Suffixes[0]));
 
     bool binary_suff = (flags & fDS_ForceBinary) != 0;
     Uint4 suff_idx = 0;
@@ -1558,7 +1558,7 @@ Uint8 NStr::StringToUInt8_DataSize(const CTempString& str,
     for (Uint4 i = 0; str_ptr < num_end; ++str_ptr) {
         if (*str_ptr == ','  ||  *str_ptr == '.')
             continue;
-        orig_num[i++] = *str_ptr - '0';
+        orig_num[i++] = Uint1(*str_ptr - '0');
     }
 
     Uint1* num_to_conv = orig_num.get();
@@ -1575,20 +1575,20 @@ Uint8 NStr::StringToUInt8_DataSize(const CTempString& str,
             Uint4 res_idx = orig_digs + coef_i;
             for (int orig_i = orig_digs - 1; orig_i >= 0; --orig_i, --res_idx) {
                 Uint1 orig_d = orig_num[orig_i];
-                Uint1 res_d = coef_d * orig_d + carry + mul_num[res_idx];
+                Uint1 res_d = Uint1(coef_d * orig_d + carry + mul_num[res_idx]);
                 carry = 0;
                 while (res_d >= 10) {
-                    res_d -= 10;
+                    res_d = (Uint1)(res_d - 10); // res_d -= 10;
                     ++carry;
                 }
                 mul_num[res_idx] = res_d;
             }
             _ASSERT(carry <= 9);
             for (; carry != 0; --res_idx) {
-                Uint1 res_d = mul_num[res_idx] + carry;
+                Uint1 res_d = Uint1(mul_num[res_idx] + carry);
                 carry = 0;
                 while (res_d >= 10) {
-                    res_d -= 10;
+                    res_d = (Uint1)(res_d - 10); // res_d -= 10;
                     ++carry;
                 }
                 mul_num[res_idx] = res_d;
@@ -1640,7 +1640,7 @@ Uint8 NStr::StringToUInt8_DataSize(const CTempString& str,
 }
 
 
-size_t NStr::StringToSizet(const CTempString& str,
+size_t NStr::StringToSizet(const CTempString str,
                            TStringToNumFlags flags, int base)
 {
 #if (SIZEOF_SIZE_T > 4)
@@ -1981,7 +1981,7 @@ void NStr::UInt8ToString_DataSize(string& out_str,
         max_digits = 3;
 
     static const char s_Suffixes[] = {'K', 'M', 'G', 'T', 'P', 'E'};
-    static const Uint4 s_NumSuffixes = sizeof(s_Suffixes) / sizeof(s_Suffixes[0]);
+    static const Uint4 s_NumSuffixes = Uint4(sizeof(s_Suffixes) / sizeof(s_Suffixes[0]));
 
     static const SIZE_TYPE kBufSize = 50;
     char  buffer[kBufSize];
@@ -2101,7 +2101,7 @@ try_even_more_suffix:
         do {
             left_val *= 10;
             Uint1 d = Uint1(left_val / mul_coef);
-            *num_end = d + '0';
+            *num_end = char(d + '0');
             ++num_end;
             left_val -= d * mul_coef;
             --cnt_more_digs;
@@ -2564,7 +2564,7 @@ SIZE_TYPE NStr::DoubleToStringPosix(double val, unsigned int precision,
     bool exp_positive = dec >= 0;
     unsigned int exp= (unsigned int)(exp_positive ? dec : (-dec));
 
-// assemble the result
+    // assemble the result
     char *buffer_pos = buffer;
 //    char *buffer_end = buffer + bufsize;
     char *digits_pos = digits;
@@ -2572,8 +2572,8 @@ SIZE_TYPE NStr::DoubleToStringPosix(double val, unsigned int precision,
     if (sign < 0) {
         *buffer_pos++ = '-';
     }
-// The 'e' format is used when the exponent of the value is less than -4
-//  or greater than or equal to the precision argument
+    // The 'e' format is used when the exponent of the value is less than -4
+    //  or greater than or equal to the precision argument
     if ((exp_positive && exp >= precision) || (!exp_positive && exp > 4)) {
         *buffer_pos++ = *digits_pos++;
         --digits_len;
@@ -2592,7 +2592,7 @@ SIZE_TYPE NStr::DoubleToStringPosix(double val, unsigned int precision,
         bool need_zeros = exp < 10 ? true : false;
         size_t need_digits = exp < 100 ? 2 : 3;
 #endif
-// assuming exp < 1000
+        // assuming exp < 1000
         buffer_pos = s_ncbi_append_int2str(buffer_pos, exp, need_digits,need_zeros);
     } else if (exp_positive) {
         *buffer_pos++ = *digits_pos++;
@@ -2653,7 +2653,7 @@ void NStr::PtrToString(string& out_str, const void* value)
 }
 
 
-const void* NStr::StringToPtr(const CTempStringEx& str)
+const void* NStr::StringToPtr(const CTempStringEx str)
 {
     int& errno_ref = errno;
     errno_ref = 0;
@@ -2688,7 +2688,7 @@ const string NStr::BoolToString(bool value)
 }
 
 
-bool NStr::StringToBool(const CTempString& str)
+bool NStr::StringToBool(const CTempString str)
 {
     if ( AStrEquiv(str, s_kTrueString,  PNocase())  ||
          AStrEquiv(str, s_kTString,     PNocase())  ||
@@ -2759,7 +2759,109 @@ string NStr::FormatVarargs(const char* format, va_list args)
 }
 
 
-SIZE_TYPE NStr::FindNoCase(const CTempString& str, const CTempString& pattern,
+SIZE_TYPE NStr::Find(const CTempString str,
+                     const CTempString pattern,
+                     ECase             use_case,
+                     EDirection        direction,
+                     SIZE_TYPE         occurence)
+{
+    const SIZE_TYPE slen = str.length();
+    const SIZE_TYPE plen = pattern.length();
+    SIZE_TYPE current_occurence = 0;
+    SIZE_TYPE pos = 0;
+    SIZE_TYPE current_pos = 0;  // saved position of last search
+    SIZE_TYPE search_pos = 0;   // next search position
+
+    if (plen > slen) {
+        return NPOS;
+    }
+
+    if (use_case == eCase) {
+
+        if (direction == eForwardSearch) {
+            do {
+                pos = str.find(pattern, search_pos);
+                if (pos == NPOS) {
+                    return NPOS;
+                }
+                current_pos = pos;
+                search_pos  = pos + plen;
+                ++current_occurence;
+            }
+            while (current_occurence <= occurence);
+
+        } else {
+            _ASSERT(direction == eReverseSearch);
+            search_pos = slen - plen;
+            do {
+                pos = str.rfind(pattern, search_pos);
+                if (pos == NPOS) {
+                    return NPOS;
+                }
+                current_pos = pos;
+                search_pos = (pos < plen) ? 0 : pos - plen;
+                ++current_occurence;
+            }
+            while (current_occurence <= occurence);
+        }
+
+    } else {
+        _ASSERT(use_case == eNocase);
+
+        // A set of lower/upper characters for pattern[0].
+        string x_first(pattern, 0, 1);
+        if (isupper((unsigned char)x_first[0])) {
+            x_first += (char)tolower((unsigned char)x_first[0]);
+        } else if (islower((unsigned char)x_first[0])) {
+            x_first += (char)toupper((unsigned char)x_first[0]);
+        }
+
+        if (direction == eForwardSearch) {
+            do {
+                pos = str.find_first_of(x_first, search_pos);
+                while (pos != NPOS) {
+                    if ( (pos + plen) > slen ) {
+                        return NPOS;
+                    }
+                    if ( CompareNocase(str, pos, plen, pattern) == 0 ) {
+                        break;
+                    }
+                    pos = str.find_first_of(x_first, pos + 1);
+                }
+                if (pos > slen) {
+                    return NPOS;
+                }
+                current_pos = pos;
+                search_pos  = pos + plen;
+                ++current_occurence;
+            }
+            while (current_occurence <= occurence);
+
+        } else {
+            _ASSERT(direction == eReverseSearch);
+            search_pos = slen - plen;
+            do {
+                pos = str.find_last_of(x_first, search_pos);
+                while (pos != NPOS  &&  pos
+                       &&  CompareNocase(str, pos, plen, pattern) != 0) {
+                    if (pos == 0) {
+                        return NPOS;
+                    }
+                    pos = str.find_last_of(x_first, pos - 1);
+                }
+                current_pos = pos;
+                search_pos = (pos < plen) ? 0 : pos - plen;
+                ++current_occurence;
+            }
+            while (current_occurence <= occurence);
+        }
+    }
+    return current_pos;
+}
+    
+
+// @deprecated
+SIZE_TYPE NStr::FindNoCase(const CTempString str, const CTempString pattern,
                            SIZE_TYPE start, SIZE_TYPE end, EOccurrence where)
 {
     string    pat(pattern, 0, 1);
@@ -2792,7 +2894,7 @@ SIZE_TYPE NStr::FindNoCase(const CTempString& str, const CTempString& pattern,
 }
 
 
-const string* NStr::Find(const list <string>& lst, const CTempString& val,
+const string* NStr::Find(const list <string>& lst, const CTempString val,
                          ECase use_case)
 {
    if (lst.empty()) return NULL;
@@ -2804,7 +2906,7 @@ const string* NStr::Find(const list <string>& lst, const CTempString& val,
    return NULL;
 }
 
-const string* NStr::Find(const vector <string>& vec, const CTempString& val,
+const string* NStr::Find(const vector <string>& vec, const CTempString val,
                          ECase use_case)
 {
    if (vec.empty()) return NULL;
@@ -2826,16 +2928,18 @@ bool s_IsWordBoundaryChar(char ch)
 }
 
 
-SIZE_TYPE NStr::FindWord(const CTempString& str, const CTempString& pattern,
-                         EOccurrence where, ECase use_case)
+SIZE_TYPE NStr::FindWord(const CTempString str,
+                         const CTempString word,
+                         ECase             use_case,
+                         EDirection        direction)
 {
     const SIZE_TYPE slen = str.length();
-    const SIZE_TYPE plen = pattern.length();
+    const SIZE_TYPE plen = word.length();
 
     SIZE_TYPE start = 0;
     SIZE_TYPE end   = slen;
 
-    SIZE_TYPE pos = Find(str, pattern, start, end, where, use_case);
+    SIZE_TYPE pos = Find(str, word, use_case, direction);
 
     while (pos != NPOS) {
         // Check word boundaries
@@ -2844,24 +2948,28 @@ SIZE_TYPE NStr::FindWord(const CTempString& str, const CTempString& pattern,
             return pos;
         }
         // Find next occurrence
-        if (where == eFirst) {
+        if (direction == eForwardSearch) {
             if (pos + plen == slen) {
                 return NPOS;
             }
             ++start;
-        } else { // eLast
+        } else { 
             if (pos == 0) {
                 return NPOS;
             }
             --end;
         }
-        pos = Find(str, pattern, start, end, where, use_case);
+        pos = Find(CTempString(str, start, end - start), word, use_case, direction);
+        if (pos != NPOS) {
+            // update position: from start of the string "str"
+            pos += start;
+        }
     }
     return pos;
 }
 
 
-SIZE_TYPE NStr::CommonOverlapSize(const CTempString& s1, const CTempString& s2)
+SIZE_TYPE NStr::CommonOverlapSize(const CTempString s1, const CTempString s2)
 {
     const SIZE_TYPE len1 = s1.length();
     const SIZE_TYPE len2 = s2.length();
@@ -2951,16 +3059,11 @@ string NStr::TruncateSpaces(const string& str, ETrunc where)
     return s_TruncateSpaces(str, where, kEmptyStr);
 }
 
-CTempString NStr::TruncateSpaces_Unsafe(const CTempString& str, ETrunc where)
+CTempString NStr::TruncateSpaces_Unsafe(const CTempString str, ETrunc where)
 {
     return s_TruncateSpaces(str, where, CTempString());
 }
 
-//CTempString NStr::TruncateSpaces_Unsafe(const char* str, ETrunc where)
-//{
-//    return s_TruncateSpaces(CTempString(str), where, CTempString());
-//}
-
 void NStr::TruncateSpacesInPlace(CTempString& str, ETrunc where)
 {
     str = s_TruncateSpaces(str, where, CTempString());
@@ -3013,7 +3116,7 @@ void NStr::TruncateSpacesInPlace(string& str, ETrunc where)
 }
 
 
-void NStr::TrimPrefixInPlace(string& str, const CTempString& prefix,
+void NStr::TrimPrefixInPlace(string& str, const CTempString prefix,
                              ECase use_case)
 {
     if (!str.length()  ||
@@ -3025,7 +3128,7 @@ void NStr::TrimPrefixInPlace(string& str, const CTempString& prefix,
 }
 
 
-void NStr::TrimPrefixInPlace(CTempString& str, const CTempString& prefix,
+void NStr::TrimPrefixInPlace(CTempString& str, const CTempString prefix,
                              ECase use_case)
 {
     if (!str.length() ||
@@ -3037,7 +3140,7 @@ void NStr::TrimPrefixInPlace(CTempString& str, const CTempString& prefix,
 }
 
 
-void NStr::TrimSuffixInPlace(string& str, const CTempString& suffix,
+void NStr::TrimSuffixInPlace(string& str, const CTempString suffix,
                              ECase use_case)
 {
     if (!str.length() ||
@@ -3049,7 +3152,7 @@ void NStr::TrimSuffixInPlace(string& str, const CTempString& suffix,
 }
 
 
-void NStr::TrimSuffixInPlace(CTempString& str, const CTempString& suffix,
+void NStr::TrimSuffixInPlace(CTempString& str, const CTempString suffix,
                              ECase use_case)
 {
     if (!str.length() ||
@@ -3220,28 +3323,6 @@ string& NStr::ReplaceInPlace(string& src,
     return src;
 }
 
-#if 0
-struct unit_test
-{
-    string test(const string& str, const string& search, const string& replace)
-    {
-        string s = str;
-        NStr::ReplaceInPlace(s, search, replace);
-        return s;
-    };
-    unit_test()
-    {
-        test("11 222 3333 4444", " ", "");
-        test("11 222 3333 4444", " ", ".");
-        test("11 222 3333 4444", "222", "x");
-        test("11 222 3333 4444", "222", "xxx");
-        test("11 222 3333 4444", "222", "xxxx");
-    }
-};
-
-unit_test t;
-#endif
-
 
 template<typename TString, typename TContainer>
 TContainer& s_Split(const TString& str, const TString& delim,
@@ -3260,47 +3341,125 @@ TContainer& s_Split(const TString& str, const TString& delim,
     return arr;
 }
 
-
-list<string>& NStr::Split(const CTempString& str, const CTempString& delim,
+list<string>& NStr::Split(const CTempString str, const CTempString delim,
                           list<string>& arr, TSplitFlags flags,
                           vector<SIZE_TYPE>* token_pos)
 {
     return s_Split(str, delim, arr, flags, token_pos);
 }
 
-list<CTempStringEx>& NStr::Split(const CTempString& str,
-                                 const CTempString& delim,
+vector<string>& NStr::Split(const CTempString str, const CTempString delim,
+                            vector<string>& arr, TSplitFlags flags,
+                            vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, flags, token_pos);
+}
+
+list<CTempString>& NStr::Split(const CTempString str, const CTempString delim,
+                               list<CTempString>& arr, TSplitFlags flags,
+                               vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, flags, token_pos);
+}
+
+vector<CTempString>& NStr::Split(const CTempString str, const CTempString delim,
+                                 vector<CTempString>& arr, TSplitFlags flags,
+                                 vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, flags, token_pos);
+}
+
+list<CTempStringEx>& NStr::Split(const CTempString str, const CTempString delim,
                                  list<CTempStringEx>& arr, TSplitFlags flags,
-                                 vector<SIZE_TYPE>* token_pos,
-                                 CTempString_Storage* storage)
+                                 vector<SIZE_TYPE>* token_pos, CTempString_Storage* storage)
 {
     return s_Split(str, delim, arr, flags, token_pos, storage);
 }
 
-list<CTempString>& NStr::Split(const CTempString& str,
-                               const CTempString& delim,
+vector<CTempStringEx>& NStr::Split(const CTempString str, const CTempString delim,
+                                   vector<CTempStringEx>& arr, TSplitFlags flags,
+                                   vector<SIZE_TYPE>* token_pos, CTempString_Storage* storage)
+{
+    return s_Split(str, delim, arr, flags, token_pos, storage);
+}
+
+list<string>& NStr::SplitByPattern(const CTempString str, const CTempString delim,
+                                 list<string>& arr, TSplitFlags flags,
+                                 vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, fSplit_ByPattern | flags, token_pos);
+}
+
+vector<string>& NStr::SplitByPattern(const CTempString str, const CTempString delim,
+                                   vector<string>& arr, TSplitFlags flags,
+                                   vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, fSplit_ByPattern | flags, token_pos);
+}
+
+list<CTempString>& NStr::SplitByPattern(const CTempString str, const CTempString delim,
+                                        list<CTempString>& arr, TSplitFlags flags,
+                                        vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, fSplit_ByPattern | flags, token_pos);
+}
+
+vector<CTempString>& NStr::SplitByPattern(const CTempString str, const CTempString delim,
+                                          vector<CTempString>& arr, TSplitFlags flags,
+                                          vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, fSplit_ByPattern | flags, token_pos);
+}
+
+list<CTempStringEx>& NStr::SplitByPattern(const CTempString str, const CTempString delim,
+                                        list<CTempStringEx>& arr, TSplitFlags flags,
+                                        vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, fSplit_ByPattern | flags, token_pos);
+}
+
+vector<CTempStringEx>& NStr::SplitByPattern(const CTempString str, const CTempString delim,
+                                          vector<CTempStringEx>& arr, TSplitFlags flags,
+                                          vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, fSplit_ByPattern | flags, token_pos);
+}
+
+
+
+/// @deprecated
+list<CTempString>& NStr::Split(const CTempString  str,
+                               const CTempString  delim,
                                list<CTempString>& arr, EMergeDelims merge,
                                vector<SIZE_TYPE>* token_pos)
 {
     vector<CTempStringEx> arr2;
-    Tokenize(str, delim, arr2,
-             (merge == eMergeDelims) ? fSplit_MergeDelims : 0, token_pos);
+    Split(str, delim, arr2, (TSplitFlags)merge, token_pos);
     ITERATE (vector<CTempStringEx>, it, arr2) {
         arr.push_back(*it);
     }
     return arr;
 }
 
-
-vector<string>& NStr::Tokenize(const CTempString& str, const CTempString& delim,
+/// @deprecated
+vector<string>& NStr::Tokenize(const CTempString str, const CTempString delim,
                                vector<string>& arr, TSplitFlags flags,
                                vector<SIZE_TYPE>* token_pos)
 {
     return s_Split(str, delim, arr, flags, token_pos);
 }
 
-vector<CTempStringEx>& NStr::Tokenize(const CTempString& str,
-                                      const CTempString& delim,
+/// @deprecated
+vector<string>& NStr::Tokenize(const CTempString str, const CTempString delim,
+                               vector<string>& arr, EMergeDelims merge,
+                               vector<SIZE_TYPE>* token_pos)
+{
+    return s_Split(str, delim, arr, (TSplitFlags)merge, token_pos);
+}
+
+/// @deprecated
+vector<CTempStringEx>& NStr::Tokenize(const CTempString  str,
+                                      const CTempString  delim,
                                       vector<CTempStringEx>& arr,
                                       TSplitFlags        flags,
                                       vector<SIZE_TYPE>* token_pos,
@@ -3309,15 +3468,15 @@ vector<CTempStringEx>& NStr::Tokenize(const CTempString& str,
     return s_Split(str, delim, arr, flags, token_pos, storage);
 }
 
-vector<CTempString>& NStr::Tokenize(const CTempString& str,
-                                    const CTempString& delim,
+/// @deprecated
+vector<CTempString>& NStr::Tokenize(const CTempString  str,
+                                    const CTempString  delim,
                                     vector<CTempString>& arr,
                                     EMergeDelims merge,
                                     vector<SIZE_TYPE>* token_pos)
 {
     vector<CTempStringEx> arr2;
-    Tokenize(str, delim, arr2,
-             (merge == eMergeDelims) ? fSplit_MergeDelims : 0, token_pos);
+    Split(str, delim, arr2, (TSplitFlags)merge, token_pos);
     arr.reserve(arr.size() + arr2.size());
     ITERATE (vector<CTempStringEx>, it, arr2) {
         arr.push_back(*it);
@@ -3326,17 +3485,25 @@ vector<CTempString>& NStr::Tokenize(const CTempString& str,
 }
 
 
-vector<CTempString>& NStr::TokenizePattern(const CTempString& str,
-                                           const CTempString& delim,
+/// @deprecated
+vector<string>& NStr::TokenizePattern(const CTempString  str,
+                                      const CTempString  delim,
+                                      vector<string>&    arr,
+                                      EMergeDelims       merge,
+                                      vector<SIZE_TYPE>* token_pos)
+{
+    return SplitByPattern(str, delim, arr, (TSplitFlags)merge, token_pos);
+}
+
+/// @deprecated
+vector<CTempString>& NStr::TokenizePattern(const CTempString  str,
+                                           const CTempString  delim,
                                            vector<CTempString>& arr,
-                                           EMergeDelims merge,
+                                           EMergeDelims       merge,
                                            vector<SIZE_TYPE>* token_pos)
 {
     vector<CTempStringEx> arr2;
-    Tokenize(str, delim, arr2,
-             fSplit_ByPattern 
-             | ((merge == eMergeDelims) ? fSplit_MergeDelims : 0),
-             token_pos);
+    Split(str, delim, arr2, fSplit_ByPattern | (TSplitFlags)merge, token_pos);
     arr.reserve(arr.size() + arr2.size());
     ITERATE (vector<CTempStringEx>, it, arr2) {
         arr.push_back(*it);
@@ -3345,8 +3512,7 @@ vector<CTempString>& NStr::TokenizePattern(const CTempString& str,
 }
 
 
-bool NStr::SplitInTwo(const CTempString& str, 
-                      const CTempString& delim,
+bool NStr::SplitInTwo(const CTempString str, const CTempString delim,
                       string& str1, string& str2, TSplitFlags flags)
 {
     CTempStringEx ts1, ts2;
@@ -3356,18 +3522,19 @@ bool NStr::SplitInTwo(const CTempString& str,
     return result;
 }
 
-bool NStr::SplitInTwo(const CTempString& str, const CTempString& delim,
-                      CTempString& str1, CTempString& str2, EMergeDelims merge)
+
+bool NStr::SplitInTwo(const CTempString str, const CTempString delim,
+                      CTempString& str1, CTempString& str2, TSplitFlags flags)
 {
-    CTempStringEx tsx1, tsx2;
-    bool result = SplitInTwo(str, delim, tsx1, tsx2,
-                             (merge == eMergeDelims) ? fSplit_MergeDelims : 0);
-    str1 = tsx1;
-    str2 = tsx2;
+    CTempStringEx ts1, ts2;
+    bool result = SplitInTwo(str, delim, ts1, ts2, flags);
+    str1 = ts1;
+    str2 = ts2;
     return result;
 }
 
-bool NStr::SplitInTwo(const CTempString& str, const CTempString& delim,
+
+bool NStr::SplitInTwo(const CTempString str, const CTempString delim,
                       CTempStringEx& str1, CTempStringEx& str2,
                       TSplitFlags flags,
                       CTempString_Storage* storage)
@@ -3377,59 +3544,52 @@ bool NStr::SplitInTwo(const CTempString& str, const CTempString& delim,
             "NStr::SplitInTwo(): the selected flags require non-NULL storage",
             0);
     }
-
     typedef CStrTokenize<CTempString, int, CStrDummyTokenPos,
                          CStrDummyTokenCount,
                          CStrDummyTargetReserve<int, int> > TSplitter;
 
     CTempStringList part_collector(storage);
     TSplitter       splitter(str, delim, flags, storage);
-    bool            found_delim;
-
-    splitter.SkipDelims();
-    if (splitter.GetPos() == 0) {
-        splitter.Advance(&part_collector);
-        part_collector.Join(&str1);
-        part_collector.Clear();
-        if (splitter.AtEnd()) {
-            // check for trailing delimiter
-            if ((flags & fSplit_ByPattern) != 0) {
-                found_delim = NStr::EndsWith(str, delim);
-            } else {
-                found_delim = ( !str.empty()
-                               &&  delim.find(str[str.size()-1]) != NPOS);
-            }
-            if (found_delim  &&  (flags & fSplit_CanEscape) != 0) {
-                SIZE_TYPE dsz = ((flags & fSplit_ByPattern) == 0 ? 1
-                                   : delim.size());
-                if (str.size() > dsz  &&  str[str.size() - dsz - 1] == '\\') {
-                    found_delim = false; // actually escaped
-                }
-            }
-        } else {
-            found_delim = true;
-        }
-    } else {
-        found_delim = true;
-        str1.clear();
-    }
+    SIZE_TYPE       delim_pos = NPOS;
+
+    // get first part
+    splitter.Advance(&part_collector, &delim_pos);
+    part_collector.Join(&str1);
+    part_collector.Clear();
 
     // don't need further splitting, just quote and escape parsing
     splitter.SetDelim(kEmptyStr);
     splitter.Advance(&part_collector);
     part_collector.Join(&str2);
 
-    return found_delim;
+    return delim_pos != NPOS;
+}
+
+/// @deprecated
+bool NStr::SplitInTwo(const CTempString  str, 
+                      const CTempString  delim,
+                      string& str1, string& str2, EMergeDelims merge) {
+    return SplitInTwo(str, delim, str1, str2, (TSplitFlags)merge);
+}
+
+// @deprecated
+bool NStr::SplitInTwo(const CTempString str, const CTempString delim,
+                      CTempString& str1, CTempString& str2, EMergeDelims merge)
+{
+    CTempStringEx tsx1, tsx2;
+    bool result = SplitInTwo(str, delim, tsx1, tsx2, (TSplitFlags)merge);
+    str1 = tsx1;
+    str2 = tsx2;
+    return result;
 }
 
 
 template <typename T>
-string s_NStr_Join(const T& arr, const CTempString& delim)
+string s_NStr_Join(const T& arr, const CTempString delim)
 {
     if (arr.empty()) {
         return kEmptyStr;
     }
-
     typename T::const_iterator it = arr.begin();
     string result = *it;
     SIZE_TYPE needed = result.size();
@@ -3447,37 +3607,37 @@ string s_NStr_Join(const T& arr, const CTempString& delim)
 }
 
 
-string NStr::Join(const list<string>& arr, const CTempString& delim)
+string NStr::Join(const list<string>& arr, const CTempString delim)
 {
     return s_NStr_Join(arr, delim);
 }
 
 
-string NStr::Join(const list<CTempString>& arr, const CTempString& delim)
+string NStr::Join(const list<CTempString>& arr, const CTempString delim)
 {
     return s_NStr_Join(arr, delim);
 }
 
 
-string NStr::Join(const vector<string>& arr, const CTempString& delim)
+string NStr::Join(const vector<string>& arr, const CTempString delim)
 {
     return s_NStr_Join(arr, delim);
 }
 
 
-string NStr::Join(const vector<CTempString>& arr, const CTempString& delim)
+string NStr::Join(const vector<CTempString>& arr, const CTempString delim)
 {
     return s_NStr_Join(arr, delim);
 }
 
 
-string NStr::Join(const set<string>& arr, const CTempString& delim)
+string NStr::Join(const set<string>& arr, const CTempString delim)
 {
     return s_NStr_Join(arr, delim);
 }
 
 
-string NStr::Join(const set<CTempString>& arr, const CTempString& delim)
+string NStr::Join(const set<CTempString>& arr, const CTempString delim)
 {
     return s_NStr_Join(arr, delim);
 }
@@ -3639,7 +3799,7 @@ enum ELanguage {
 };
 
 
-static string s_PrintableString(const CTempString&   str,
+static string s_PrintableString(const CTempString    str,
                                 NStr::TPrintableMode mode,
                                 ELanguage            lang)
 {
@@ -3713,17 +3873,17 @@ static string s_PrintableString(const CTempString&   str,
             unsigned char v;
             char val[3];
             int k = 0;
-            v =  (unsigned char) c >> 6;
+            v = (unsigned char)((unsigned char)c >> 6);
             if (v  ||  !reduce) {
-                val[k++] = '0' + v;
+                val[k++] = char('0' + v);
                 reduce = false;
             }
-            v = ((unsigned char) c >> 3) & 7;
+            v = ((unsigned char)c >> 3) & 7;
             if (v  ||  !reduce) {
-                val[k++] = '0' + v;
+                val[k++] = char('0' + v);
             }
-            v =  (unsigned char) c       & 7;
-            val    [k++] = '0' + v;
+            v = (unsigned char)c & 7;
+            val[k++] = char('0' + v);
             out->write(val, k);
         } else {
             out->put(c);
@@ -3744,14 +3904,14 @@ static string s_PrintableString(const CTempString&   str,
 }
 
         
-string NStr::PrintableString(const CTempString&   str,
+string NStr::PrintableString(const CTempString    str,
                              NStr::TPrintableMode mode)
 {
     return s_PrintableString(str, mode, eLanguage_C);
 }
 
 
-string NStr::JavaScriptEncode(const CTempString& str)
+string NStr::JavaScriptEncode(const CTempString str)
 {
     return s_PrintableString(str,
                              fNewLine_Quote | fNonAscii_Passthru,
@@ -3759,7 +3919,7 @@ string NStr::JavaScriptEncode(const CTempString& str)
 }
 
 
-string NStr::CEncode(const CTempString& str, EQuoted quoted)
+string NStr::CEncode(const CTempString str, EQuoted quoted)
 {
     switch (quoted) {
     case eNotQuoted:
@@ -3773,7 +3933,7 @@ string NStr::CEncode(const CTempString& str, EQuoted quoted)
 }
 
 
-string NStr::CParse(const CTempString& str, EQuoted quoted)
+string NStr::CParse(const CTempString str, EQuoted quoted)
 {
     if (quoted == eNotQuoted) {
         return ParseEscapes(str);
@@ -3828,7 +3988,7 @@ string NStr::CParse(const CTempString& str, EQuoted quoted)
 }
 
 
-string NStr::XmlEncode(const CTempString& str, EXmlEncode flags)
+string NStr::XmlEncode(const CTempString str, EXmlEncode flags)
 // http://www.w3.org/TR/2000/REC-xml-20001006#sec-predefined-ent
 {
     string result;
@@ -3891,7 +4051,7 @@ string NStr::XmlEncode(const CTempString& str, EXmlEncode flags)
 }
 
 
-string NStr::HtmlEncode(const CTempString& str, THtmlEncode flags)
+string NStr::HtmlEncode(const CTempString str, THtmlEncode flags)
 {
     string result;
     SIZE_TYPE i;
@@ -3995,40 +4155,40 @@ static struct tag_HtmlEntities
 {
     TUnicodeSymbol u;
     const char*    s;
-
-} const s_HtmlEntities[] = {
-        {  9, "Tab" }, 
-        { 10, "NewLine" }, 
-        { 33, "excl" }, 
+}
+const s_HtmlEntities[] = {
+    {    9, "Tab" }, 
+    {   10, "NewLine" }, 
+    {   33, "excl" }, 
     {   34, "quot" }, 
-        { 35, "num" }, 
-        { 36, "dollar" }, 
-        { 37, "percnt" }, 
+    {   35, "num" }, 
+    {   36, "dollar" }, 
+    {   37, "percnt" }, 
     {   38, "amp" }, 
     {   39, "apos" }, 
-        { 40, "lpar" }, 
-        { 41, "rpar" }, 
-        { 42, "ast" }, 
-        { 43, "plus" }, 
-        { 44, "comma" }, 
-        { 46, "period" }, 
-        { 47, "sol" }, 
-        { 58, "colon" }, 
-        { 59, "semi" }, 
+    {   40, "lpar" }, 
+    {   41, "rpar" }, 
+    {   42, "ast" }, 
+    {   43, "plus" }, 
+    {   44, "comma" }, 
+    {   46, "period" }, 
+    {   47, "sol" }, 
+    {   58, "colon" }, 
+    {   59, "semi" }, 
     {   60, "lt" }, 
-        { 61, "equals" }, 
+    {   61, "equals" }, 
     {   62, "gt" }, 
-        { 63, "quest" }, 
-        { 64, "commat" }, 
-        { 91, "lsqb" }, 
-        { 92, "bsol" }, 
-        { 93, "rsqb" }, 
-        { 94, "Hat" }, 
-        { 95, "lowbar" }, 
-        { 96, "grave" }, 
-        {123, "lcub" }, 
-        {124, "verbar" }, 
-        {125, "rcub" }, 
+    {   63, "quest" }, 
+    {   64, "commat" }, 
+    {   91, "lsqb" }, 
+    {   92, "bsol" }, 
+    {   93, "rsqb" }, 
+    {   94, "Hat" }, 
+    {   95, "lowbar" }, 
+    {   96, "grave" }, 
+    {  123, "lcub" }, 
+    {  124, "verbar" }, 
+    {  125, "rcub" }, 
     {  160, "nbsp" }, 
     {  161, "iexcl" }, 
     {  162, "cent" }, 
@@ -4291,7 +4451,7 @@ string NStr::HtmlEntity(TUnicodeSymbol uch)
     return kEmptyStr;
 }
 
-string NStr::HtmlDecode(const CTempString& str, EEncoding encoding, THtmlDecode* result_flags)
+string NStr::HtmlDecode(const CTempString str, EEncoding encoding, THtmlDecode* result_flags)
 {
     string ustr;
     THtmlDecode result = 0;
@@ -4396,7 +4556,7 @@ string NStr::HtmlDecode(const CTempString& str, EEncoding encoding, THtmlDecode*
 }
 
 
-string NStr::JsonEncode(const CTempString& str)
+string NStr::JsonEncode(const CTempString str)
 // http://www.json.org/
 {
     string result;
@@ -4415,7 +4575,7 @@ string NStr::JsonEncode(const CTempString& str)
             break;
         default:
             if ((unsigned int)c < 0x20 || (unsigned int)c >= 0x80) {
-                const char* charmap = "0123456789abcdef";
+                static const char* charmap = "0123456789abcdef";
                 result.append("\\u00");
                 Uint1 ch = c;
                 unsigned hi = ch >> 4;
@@ -4458,7 +4618,7 @@ string NStr::ShellEncode(const string& str)
     // - Escape without quotes. Use backslash.
     /////////////////////////////////////////////////////////////////////////
 
-    // 2. Non-empty printable string without metacharacters.
+    // 2. Non-empty printable string without meta-characters.
     //
     // Shell special characters, according to IEEE Std 1003.1,
     // plus ! (Bourne shell exit status negation and Bash history expansion),
@@ -4472,7 +4632,7 @@ string NStr::ShellEncode(const string& str)
         return str;
     }
 
-    // 3. Printable string, but either empty or some shell metacharacters.
+    // 3. Printable string, but either empty or some shell meta-characters.
     //
     // Aesthetics preference:
     // i)   If the string includes literal single-quotes, then prefer
@@ -4499,7 +4659,7 @@ string NStr::ShellEncode(const string& str)
     //      quoting: if there are many literal single-quotes and the
     //      use of double-quotes would involve the need to escape embedded
     //      characters, then it may be more pleasing to escape the
-    //      shell metacharacters, and avoid the need for single-quoting
+    //      shell meta-characters, and avoid the need for single-quoting
     //      in the presence of literal single-quotes.
     // iii) If there are no literal double-quotes, then all else being equal,
     //      avoid double-quotes and prefer escaping. Double-quotes are
@@ -4522,7 +4682,7 @@ string NStr::ShellEncode(const string& str)
     // Aesthetic improvement: Remove paired single-quotes ('')
     // that aren't escaped, as these evaluate to an empty string.
     // Don't apply this simplification for the degenerate case when
-    // the string is the empty string ''. (Nondegenerate strings
+    // the string is the empty string ''. (Non degenerate strings
     // must be length greater than 2). Implement the equivalent
     // of the Perl regexp:
     //
@@ -4545,7 +4705,7 @@ string NStr::ShellEncode(const string& str)
 }
 
 
-string NStr::ParseEscapes(const CTempString& str, EEscSeqRange mode, char user_char)
+string NStr::ParseEscapes(const CTempString str, EEscSeqRange mode, char user_char)
 {
     string out;
     out.reserve(str.size());  // result string can only be smaller
@@ -4624,10 +4784,10 @@ string NStr::ParseEscapes(const CTempString& str, EEscSeqRange mode, char user_c
         case '4':  case '5':  case '6':  case '7':
             {{
                 pos = pos2;
-                unsigned char c = str[pos++] - '0';
+                unsigned char c = (unsigned char)(str[pos++] - '0');
                 while (pos < pos2 + 3  &&  pos < str.size()
                        &&  str[pos] >= '0'  &&  str[pos] <= '7') {
-                    c = (c << 3) | (str[pos++] - '0');
+                    c = (unsigned char)((c << 3) | (str[pos++] - '0'));
                 }
                 out += c;
             }}
@@ -4651,7 +4811,7 @@ string NStr::ParseEscapes(const CTempString& str, EEscSeqRange mode, char user_c
 }
 
 
-string NStr::ParseQuoted(const CTempString& str, size_t* n_read /*= NULL*/)
+string NStr::ParseQuoted(const CTempString str, size_t* n_read /*= NULL*/)
 {
     const char* str_pos = str.data();
     char quote_char;
@@ -5096,7 +5256,7 @@ list<string>& NStr::WrapList(const list<string>& l, SIZE_TYPE width,
 }
 
 
-list<string>& NStr::Justify(const CTempString& str,
+list<string>& NStr::Justify(const CTempString  str,
                             SIZE_TYPE          width,
                             list<string>&      par,
                             const CTempString* pfx,
@@ -5160,7 +5320,7 @@ list<string>& NStr::Justify(const CTempString& str,
         if (nw > 1) {
             if (pos < str.size()  &&  len < width  &&  !big) {
                 space = (width - len) / (nw - 1);
-                nw    = (width - len) % (nw - 1);
+                nw    = (unsigned int)((width - len) % (nw - 1));
             } else {
                 space = 1;
                 nw    = 0;
@@ -5642,7 +5802,7 @@ static const char s_EncodeCookie[256][4] = {
     "%F8", "%F9", "%FA", "%FB", "%FC", "%FD", "%FE", "%FF"
 };
 
-string NStr::URLEncode(const CTempString& str, EUrlEncode flag)
+string NStr::URLEncode(const CTempString str, EUrlEncode flag)
 {
     SIZE_TYPE len = str.length();
     if ( !len ) {
@@ -5739,7 +5899,7 @@ CStringUTF8 NStr::SQLEncode(const CStringUTF8& str) {
 
 
 static
-void s_URLDecode(const CTempString& src, string& dst, NStr::EUrlDecode flag)
+void s_URLDecode(const CTempString src, string& dst, NStr::EUrlDecode flag)
 {
     SIZE_TYPE len = src.length();
     if ( !len ) {
@@ -5765,7 +5925,7 @@ void s_URLDecode(const CTempString& src, string& dst, NStr::EUrlDecode flag)
                 if (n1 < 0  ||  n1 > 15  || n2 < 0  ||  n2 > 15) {
                     dst[pdst] = src[psrc++];
                 } else {
-                    dst[pdst] = (n1 << 4) | n2;
+                    dst[pdst] = char((n1 << 4) | n2);
                     psrc += 3;
                 }
             }
@@ -5786,7 +5946,7 @@ void s_URLDecode(const CTempString& src, string& dst, NStr::EUrlDecode flag)
 }
 
 
-string NStr::URLDecode(const CTempString& str, EUrlDecode flag)
+string NStr::URLDecode(const CTempString str, EUrlDecode flag)
 {
     string dst;
     s_URLDecode(str, dst, flag);
@@ -5800,7 +5960,7 @@ void NStr::URLDecodeInPlace(string& str, EUrlDecode flag)
 }
 
 
-bool NStr::NeedsURLEncoding(const CTempString& str, EUrlEncode flag)
+bool NStr::NeedsURLEncoding(const CTempString str, EUrlEncode flag)
 {
     SIZE_TYPE len = str.length();
     if ( !len ) {
@@ -5870,7 +6030,7 @@ bool s_IsIPAddress(const char* str, size_t size)
                     return false;
                 }
                 if (prev_colon  &&  c - prev_colon  == 1) {
-                    // A group of zeroes found
+                    // A group of zeros found
                     if (have_group) {
                         // Only one group is allowed
                         return false;
@@ -5886,7 +6046,7 @@ bool s_IsIPAddress(const char* str, size_t size)
                 // Too many digits between colons
                 return false;
             }
-            char d = toupper(*c);
+            char d = (char)toupper((unsigned char)(*c));
             if (d < '0'  ||  d > 'F') {
                 // Invalid digit
                 return false;
@@ -5932,7 +6092,7 @@ bool s_IsIPAddress(const char* str, size_t size)
 }
 
 
-bool NStr::IsIPAddress(const CTempStringEx& str)
+bool NStr::IsIPAddress(const CTempStringEx str)
 {
     size_t size = str.size();
     if ( str.HasZeroAtEnd() ) {
@@ -5981,7 +6141,7 @@ namespace {
     // @return
     //   Found field; or empty string if the required field is not found.
     template <typename TComparator, typename TResult>
-    TResult s_GetField(const CTempString& str,
+    TResult s_GetField(const CTempString  str,
                        size_t             field_no,
                        const TComparator& delimiter,
                        NStr::EMergeDelims merge)
@@ -6033,10 +6193,10 @@ namespace {
 }
 
 
-string NStr::GetField(const CTempString& str,
-                      size_t             field_no,
-                      const CTempString& delimiters,
-                      EMergeDelims       merge)
+string NStr::GetField(const CTempString str,
+                      size_t            field_no,
+                      const CTempString delimiters,
+                      EMergeDelims      merge)
 {
     return s_GetField<PDelimiter<CTempString>, string>
         (str,
@@ -6046,10 +6206,10 @@ string NStr::GetField(const CTempString& str,
 }
 
 
-string NStr::GetField(const CTempString& str,
-                      size_t             field_no,
-                      char               delimiter,
-                      EMergeDelims       merge)
+string NStr::GetField(const CTempString str,
+                      size_t            field_no,
+                      char              delimiter,
+                      EMergeDelims      merge)
 {
     return s_GetField<PDelimiter<char>, string>
         (str,
@@ -6059,10 +6219,10 @@ string NStr::GetField(const CTempString& str,
 }
 
 
-CTempString NStr::GetField_Unsafe(const CTempString& str,
-                                  size_t             field_no,
-                                  const CTempString& delimiters,
-                                  EMergeDelims       merge)
+CTempString NStr::GetField_Unsafe(const CTempString str,
+                                  size_t            field_no,
+                                  const CTempString delimiters,
+                                  EMergeDelims      merge)
 {
     return s_GetField<PDelimiter<CTempString>, CTempString>
         (str,
@@ -6072,10 +6232,10 @@ CTempString NStr::GetField_Unsafe(const CTempString& str,
 }
 
 
-CTempString NStr::GetField_Unsafe(const CTempString& str,
-                                  size_t             field_no,
-                                  char               delimiter,
-                                  EMergeDelims       merge)
+CTempString NStr::GetField_Unsafe(const CTempString str,
+                                  size_t            field_no,
+                                  char              delimiter,
+                                  EMergeDelims      merge)
 {
     return s_GetField<PDelimiter<char>, CTempString>
         (str,
@@ -6091,7 +6251,7 @@ CTempString NStr::GetField_Unsafe(const CTempString& str,
 
 #if defined(__EXPORT_CTOR_STRINGUTF8__)
 
-CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(const CTempString& src) {
+CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(const CTempString src) {
     assign( CUtf8::AsUTF8(src, eEncoding_ISO8859_1, CUtf8::eNoValidate));
 }
 CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(const char* src ) {
@@ -6103,7 +6263,7 @@ CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(const string& src) {
 
 
 CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(
-    const CTempString& src, EEncoding encoding,EValidate validate) {
+    const CTempString src, EEncoding encoding,EValidate validate) {
     assign( CUtf8::AsUTF8(src, encoding, validate == CStringUTF8_DEPRECATED::eValidate ? CUtf8::eValidate : CUtf8::eNoValidate));
 }
 CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(
@@ -6170,7 +6330,7 @@ CStringUTF8_DEPRECATED::CStringUTF8_DEPRECATED(
 //#ifndef __NO_EXPORT_STRINGUTF8__
 #if 0
 
-CStringUTF8::CStringUTF8(const CTempString& src) {
+CStringUTF8::CStringUTF8(const CTempString src) {
     assign( CUtf8::AsUTF8(src, eEncoding_ISO8859_1, CUtf8::eNoValidate));
 } // NCBI_FAKE_WARNING
 CStringUTF8::CStringUTF8(const char* src ) {
@@ -6193,15 +6353,14 @@ TStringUCS2 CStringUTF8::AsUCS2(const TCharUCS2* substitute_on_error) const
     return CUtf8::AsBasicString<TCharUCS2>(*this,substitute_on_error,CUtf8::eNoValidate);
 }
 
-CStringUTF8 CStringUTF8::TruncateSpaces(const CTempString& str,
-                                    NStr::ETrunc side)
+CStringUTF8 CStringUTF8::TruncateSpaces(const CTempString str, NStr::ETrunc side)
 {
     return CUtf8::TruncateSpaces(str,side);
 }
 
 
 CStringUTF8::CStringUTF8(
-    const CTempString& src, EEncoding encoding,EValidate validate) {
+    const CTempString src, EEncoding encoding,EValidate validate) {
     assign( CUtf8::AsUTF8(src, encoding, validate == CStringUTF8::eValidate ? CUtf8::eValidate : CUtf8::eNoValidate));
 }
 
@@ -6349,7 +6508,7 @@ CStringUTF8& CStringUTF8::operator+= (const wchar_t* src) {
 }
 #endif
 CStringUTF8& CStringUTF8::Assign(
-    const CTempString& src, EEncoding encoding, EValidate validate) {
+    const CTempString src, EEncoding encoding, EValidate validate) {
     assign( CUtf8::AsUTF8(src, encoding, validate == CStringUTF8::eValidate ? CUtf8::eValidate : CUtf8::eNoValidate));
     return *this;
 }
@@ -6423,7 +6582,7 @@ CStringUTF8& CStringUTF8::Assign(char ch, EEncoding encoding) {
     return *this;
 }
 CStringUTF8& CStringUTF8::Append(
-    const CTempString& src, EEncoding encoding, EValidate validate) {
+    const CTempString src, EEncoding encoding, EValidate validate) {
     append( CUtf8::AsUTF8( src, encoding, validate == CStringUTF8::eValidate ? CUtf8::eValidate : CUtf8::eNoValidate));
     return *this;
 }
@@ -6515,7 +6674,7 @@ TUnicodeSymbol CStringUTF8::Decode(string::const_iterator& src) {
 #endif
 
 
-SIZE_TYPE CStringUTF8::GetSymbolCount(const CTempString& src)
+SIZE_TYPE CStringUTF8::GetSymbolCount(const CTempString src)
 {
     return CUtf8::GetSymbolCount(src);
 }
@@ -6525,7 +6684,7 @@ SIZE_TYPE CStringUTF8::GetValidSymbolCount(const char* src, SIZE_TYPE buf_size)
     return CUtf8::GetValidSymbolCount(CTempString(src, buf_size));
 }
 
-SIZE_TYPE CStringUTF8::GetValidSymbolCount(const CTempString& src)
+SIZE_TYPE CStringUTF8::GetValidSymbolCount(const CTempString src)
 {
     return CUtf8::GetValidSymbolCount(src);
 }
@@ -6535,7 +6694,7 @@ SIZE_TYPE CStringUTF8::GetValidBytesCount(const char* src, SIZE_TYPE buf_size)
     return CUtf8::GetValidBytesCount(CTempString(src,buf_size));
 }
 
-SIZE_TYPE CStringUTF8::GetValidBytesCount(const CTempString& src)
+SIZE_TYPE CStringUTF8::GetValidBytesCount(const CTempString src)
 {
     return CUtf8::GetValidBytesCount(src);
 }
@@ -6546,12 +6705,12 @@ string CStringUTF8::AsSingleByteString(EEncoding encoding,
     return CUtf8::AsSingleByteString(*this,encoding,substitute_on_error);
 }
 
-EEncoding CStringUTF8::GuessEncoding( const CTempString& src)
+EEncoding CStringUTF8::GuessEncoding(const CTempString src)
 {
     return CUtf8::GuessEncoding(src);
 }
 
-bool CStringUTF8::MatchEncoding( const CTempString& src, EEncoding encoding)
+bool CStringUTF8::MatchEncoding(const CTempString src, EEncoding encoding)
 {
     return CUtf8::MatchEncoding(src,encoding);
 }
@@ -6561,7 +6720,7 @@ string CStringUTF8::EncodingToString(EEncoding encoding)
     return CUtf8::EncodingToString(encoding);
 }
 
-EEncoding CStringUTF8::StringToEncoding(const CTempString& str)
+EEncoding CStringUTF8::StringToEncoding(const CTempString str)
 {
     return CUtf8::StringToEncoding(str);
 }
@@ -6597,7 +6756,7 @@ CStringUTF8& CStringUTF8::TruncateSpacesInPlace(NStr::ETrunc side)
     return CUtf8::TruncateSpacesInPlace(*this,side);
 }
 
-CTempString CStringUTF8::TruncateSpaces_Unsafe(const CTempString& str, NStr::ETrunc side)
+CTempString CStringUTF8::TruncateSpaces_Unsafe(const CTempString str, NStr::ETrunc side)
 {
     return CUtf8::TruncateSpaces_Unsafe(str,side);
 }
@@ -6612,7 +6771,7 @@ void   CStringUTF8::x_AppendChar(TUnicodeSymbol ch)
     CUtf8::x_AppendChar(*this, ch);
 }
 
-void   CStringUTF8::x_Append(const CTempString& src,
+void   CStringUTF8::x_Append(const CTempString src,
                 EEncoding encoding, EValidate validate)
 {
     CUtf8::x_Append(*this, src, encoding, (CUtf8::EValidate)validate);
@@ -6634,7 +6793,7 @@ bool   CStringUTF8::x_EvalNext(char ch)
 }
 #endif // __NO_EXPORT_STRINGUTF8__
 
-SIZE_TYPE CUtf8::x_GetValidSymbolCount(const CTempString& str,
+SIZE_TYPE CUtf8::x_GetValidSymbolCount(const CTempString str,
      CTempString::const_iterator& src)
 {
     SIZE_TYPE count = 0;
@@ -6653,7 +6812,7 @@ SIZE_TYPE CUtf8::x_GetValidSymbolCount(const CTempString& str,
     return count;
 }
 
-CTempString CUtf8::x_GetErrorFragment(const CTempString& src)
+CTempString CUtf8::x_GetErrorFragment(const CTempString src)
 {
     CTempString::const_iterator err;
     x_GetValidSymbolCount(src,err);
@@ -6665,7 +6824,7 @@ CTempString CUtf8::x_GetErrorFragment(const CTempString& src)
     return CTempString(from, to - from);
 }
 
-SIZE_TYPE CUtf8::GetSymbolCount( const CTempString& str)
+SIZE_TYPE CUtf8::GetSymbolCount(const CTempString str)
 {
     CTempString::const_iterator err;
     SIZE_TYPE count = x_GetValidSymbolCount(str,err);
@@ -6678,7 +6837,7 @@ SIZE_TYPE CUtf8::GetSymbolCount( const CTempString& str)
     return count;
 }
 
-string CUtf8::AsSingleByteString( const CTempString& str,
+string CUtf8::AsSingleByteString(const CTempString str,
     EEncoding encoding, const char* substitute_on_error, EValidate validate)
 {
     if (validate == eValidate) {
@@ -6712,7 +6871,7 @@ string CUtf8::AsSingleByteString( const CTempString& str,
     return result;
 }
 
-EEncoding CUtf8::GuessEncoding( const CTempString& src)
+EEncoding CUtf8::GuessEncoding(const CTempString src)
 {
     SIZE_TYPE more = 0;
     CTempString::const_iterator i = src.begin();
@@ -6765,7 +6924,7 @@ EEncoding CUtf8::GuessEncoding( const CTempString& src)
 }
 
 
-bool CUtf8::MatchEncoding( const CTempString& src, EEncoding encoding)
+bool CUtf8::MatchEncoding(const CTempString src, EEncoding encoding)
 {
     bool matches = false;
     EEncoding enc_src = GuessEncoding(src);
@@ -6804,7 +6963,7 @@ string  CUtf8::EncodingToString(EEncoding encoding)
 }
 
 // see http://www.iana.org/assignments/character-sets
-EEncoding CUtf8::StringToEncoding(const CTempString& str)
+EEncoding CUtf8::StringToEncoding(const CTempString str)
 {
     if (NStr::CompareNocase(str,"UTF-8")==0) {
         return eEncoding_UTF8;
@@ -6889,7 +7048,7 @@ char CUtf8::SymbolToChar(TUnicodeSymbol cp, EEncoding encoding)
     return (char)cp;
 }
 
-void CUtf8::x_Validate(const CTempString& str)
+void CUtf8::x_Validate(const CTempString str)
 {
     if ( !MatchEncoding( str,eEncoding_UTF8 ) ) {
         NCBI_THROW2(CStringException, eBadArgs,
@@ -6921,7 +7080,7 @@ CStringUTF8& CUtf8::x_AppendChar( CStringUTF8& self, TUnicodeSymbol c)
     return self;
 }
 
-CStringUTF8& CUtf8::x_Append( CStringUTF8& self, const CTempString& src,
+CStringUTF8& CUtf8::x_Append( CStringUTF8& self, const CTempString src,
     EEncoding encoding, EValidate validate)
 {
     if (encoding == eEncoding_Unknown) {
@@ -7068,7 +7227,7 @@ CStringUTF8& CUtf8::TruncateSpacesInPlace( CStringUTF8& str, NStr::ETrunc side)
 }
 
 CTempString CUtf8::TruncateSpaces_Unsafe(
-    const CTempString& str, NStr::ETrunc side)
+    const CTempString str, NStr::ETrunc side)
 {
     if (str.empty()) {
         return str;
@@ -7125,7 +7284,7 @@ CStringDecoder_Url::CStringDecoder_Url(NStr::EUrlDecode flag)
 }
 
 
-string CStringDecoder_Url::Decode(const CTempString& src,
+string CStringDecoder_Url::Decode(const CTempString src,
                                   EStringType ) const
 {
     return NStr::URLDecode(src, m_Flag);
@@ -7138,7 +7297,7 @@ CStringEncoder_Url::CStringEncoder_Url(NStr::EUrlEncode flag)
 }
 
 
-string CStringEncoder_Url::Encode(const CTempString& src,
+string CStringEncoder_Url::Encode(const CTempString src,
                                   EStringType ) const
 {
     return NStr::URLEncode(src, m_Flag);
@@ -7148,14 +7307,14 @@ string CStringEncoder_Url::Encode(const CTempString& src,
 /////////////////////////////////////////////////////////////////////////////
 // CEncodedString --
 
-CEncodedString::CEncodedString(const CTempString& s,
+CEncodedString::CEncodedString(const CTempString s,
                                NStr::EUrlEncode flag)
 {
     SetString(s, flag);
 }
 
 
-void CEncodedString::SetString(const CTempString& s,
+void CEncodedString::SetString(const CTempString s,
                                NStr::EUrlEncode flag)
 {
     m_Original = s;
@@ -7204,6 +7363,14 @@ void CTempStringList::Join(string* s) const
 }
 
 
+void CTempStringList::Join(CTempString* s) const
+{
+    CTempStringEx str;
+    Join(&str);
+    *s = str;
+}
+
+
 void CTempStringList::Join(CTempStringEx* s) const
 {
     if (m_FirstNode.next.get() == NULL) {
@@ -7259,16 +7426,28 @@ char* CTempString_Storage::Allocate(CTempString::size_type len)
 }
 
 
-bool CStrTokenizeBase::Advance(CTempStringList* part_collector)
+bool CStrTokenizeBase::Advance(CTempStringList* part_collector, SIZE_TYPE* ptr_delim_pos)
 {
-    SIZE_TYPE pos = m_Pos, part_start = m_Pos, delim_pos = 0, quote_pos = 0;
-    bool      found_text = false, done = (pos == NPOS);
+    SIZE_TYPE pos, part_start, delim_pos = 0, quote_pos = 0;
+    bool      found_text = false, done;
     char      active_quote = '\0';
 
+    // Skip leading delimiters.
+    // NOTE: We cannot process 
+    if (!m_Pos  &&  (m_Flags & NStr::fSplit_Truncate_Begin) != 0) {
+        SkipDelims();
+    }
+    pos = part_start = m_Pos;
+    done = (pos == NPOS);
+
+    // Checks
     if (pos >= m_Str.size()) {
         pos = NPOS;
         done = true;
     }
+    if (ptr_delim_pos) {
+        *ptr_delim_pos = NPOS;
+    }
 
     // Each chunk covers the half-open interval [part_start, delim_pos).
 
@@ -7299,10 +7478,8 @@ bool CStrTokenizeBase::Advance(CTempStringList* part_collector)
                     continue; // not actually a boundary
                 }
                 handled = true;
-            } else if (((m_Flags & NStr::fSplit_CanSingleQuote) != 0
-                        && c == '\'')
-                       ||  ((m_Flags & NStr::fSplit_CanDoubleQuote) != 0
-                            && c == '"')) {
+            } else if (((m_Flags & NStr::fSplit_CanSingleQuote) != 0  &&  c == '\'') || 
+                       ((m_Flags & NStr::fSplit_CanDoubleQuote) != 0  &&  c == '"')) {
                 active_quote = c;
                 quote_pos    = delim_pos;
                 handled = true;
@@ -7322,13 +7499,16 @@ bool CStrTokenizeBase::Advance(CTempStringList* part_collector)
             } else {
                 done = true;
             }
+            // save delimiter position
+            if (ptr_delim_pos) {
+                *ptr_delim_pos = delim_pos;
+            }
         }
 
         if (delim_pos > part_start) {
             found_text = true;
             if (part_collector != NULL) {
-                part_collector->Add
-                    (m_Str.substr(part_start, delim_pos - part_start));
+                part_collector->Add(m_Str.substr(part_start, delim_pos - part_start));
             }
         }
         part_start = next_start;
@@ -7348,33 +7528,38 @@ bool CStrTokenizeBase::Advance(CTempStringList* part_collector)
         m_Pos = NPOS;
     } else {
         m_Pos = pos;
-        SkipDelims();
+        MergeDelims();
     }
-
-    return found_text  ||  (m_Flags & NStr::fSplit_MergeDelims) == 0;
+    return found_text;
 }
 
-void CStrTokenizeBase::SkipDelims(void)
+
+void CStrTokenizeBase::x_SkipDelims(bool force_skip)
 {
-    if ((m_Flags & NStr::fSplit_MergeDelims) != 0) {
-        if ((m_Flags & NStr::fSplit_ByPattern) == 0) {
-            m_Pos = m_Str.find_first_not_of(m_Delim, m_Pos);
-        } else {
-            while (m_Pos + m_Delim.size() <= m_Str.size()  &&  m_Pos != NPOS
-                   &&  (memcmp(m_Delim.data(), m_Str.data() + m_Pos,
-                               m_Delim.size()) == 0)) {
-                m_Pos += m_Delim.size();
-            }
+    _ASSERT(NStr::fSplit_MergeDelimiters);
+
+    if ( !force_skip  &&  (m_Flags & NStr::fSplit_MergeDelimiters) == 0 ) {
+        return;
+    }
+    // skip all delimiters, starting from the current position
+    if ((m_Flags & NStr::fSplit_ByPattern) == 0) {
+        m_Pos = m_Str.find_first_not_of(m_Delim, m_Pos);
+    } else {
+        while (m_Pos != NPOS 
+                &&  m_Pos + m_Delim.size() <= m_Str.size()
+                && (memcmp(m_Delim.data(), m_Str.data() + m_Pos,
+                            m_Delim.size()) == 0)) {
+            m_Pos += m_Delim.size();
         }
     }
 }
 
+
 void CStrTokenizeBase::x_ExtendInternalDelim()
 {
     if ( !(m_Flags & (NStr::fSplit_CanEscape | NStr::fSplit_CanQuote)) ) {
         return; // Nothing to do
     }
-
     SIZE_TYPE n = m_InternalDelim.size();
     char* buf = m_DelimStorage.Allocate(n + 3);
     char *s = buf;
diff --git a/c++/src/corelib/ncbistre.cpp b/c++/src/corelib/ncbistre.cpp
index d8a0b4b..31f1ca6 100644
--- a/c++/src/corelib/ncbistre.cpp
+++ b/c++/src/corelib/ncbistre.cpp
@@ -1,4 +1,4 @@
-/* $Id: ncbistre.cpp 447116 2014-09-22 18:27:54Z lavr $
+/* $Id: ncbistre.cpp 488254 2015-12-29 13:56:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -329,8 +329,8 @@ size_t NcbiStreamToString(string* str, CNcbiIstream& is, size_t pos)
 bool NcbiStreamCompare(CNcbiIstream& is1, CNcbiIstream& is2)
 {
     while (is1 && is2) {
-        char c1 = is1.get();
-        char c2 = is2.get();
+        char c1 = (char)is1.get();
+        char c2 = (char)is2.get();
         if (c1 != c2) {
             return false;
         }
@@ -413,12 +413,6 @@ CNcbiOstrstreamToString::operator string(void) const
 }
 
 
-CNcbiOstream& operator<<(CNcbiOstream& out, const CTempString& str)
-{
-    return out.write(str.data(), str.length());
-}
-
-
 CNcbiOstream& operator<<(CNcbiOstream& out, CUpcaseStringConverter s)
 {
     ITERATE ( string, c, s.m_String ) {
@@ -533,17 +527,17 @@ void s_WritePrintable(CNcbiOstream& out, char c, char n)
     int k = 1;
 
     *octal = '\\';
-    v =  (unsigned char) c >> 6;
+    v = (unsigned char)((unsigned char) c >> 6);
     if (v  ||  full) {
-        octal[k++] = '0' + v;
+        octal[k++] = char('0' + v);
         full = true;
     }
     v = ((unsigned char) c >> 3) & 7;
     if (v  ||  full) {
-        octal[k++] = '0' + v;
+        octal[k++] = char('0' + v);
     }
-    v =  (unsigned char) c       & 7;
-    octal    [k++] = '0' + v;
+    v = (unsigned char) c & 7;
+    octal[k++] = char('0' + v);
     out.write(octal, k);
 }
 
diff --git a/c++/src/corelib/ncbitime.cpp b/c++/src/corelib/ncbitime.cpp
index e826d5d..689667f 100644
--- a/c++/src/corelib/ncbitime.cpp
+++ b/c++/src/corelib/ncbitime.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ncbitime.cpp 472773 2015-07-14 13:58:13Z ivanov $
+/*  $Id: ncbitime.cpp 493937 2016-03-02 16:38:06Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -46,12 +46,14 @@
 
 // The current difference in seconds between UTC and local time on this computer.
 // UTC = local time + TimeZone()
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) ||  defined(NCBI_COMPILER_MSVC)
 #  define TimeZone() _timezone
 #  define Daylight() _daylight
+#  define TZName()   _tzname
 #else
 #  define TimeZone()  timezone
 #  define Daylight()  daylight
+#  define TZName()    tzname
 #endif
 
 // The offset in seconds of daylight saving time.
@@ -156,14 +158,13 @@ const char kFormatEscapeSymbol = '$';
         } else { return false; } \
     }
 
-#define CHECK_RANGE_YEAR(value)       CHECK_RANGE_EXCEPTION(value, "Year", 1583, kMax_Int)
-#define CHECK_RANGE_MONTH(value)      CHECK_RANGE_EXCEPTION(value, "Month", 1, 12)
-#define CHECK_RANGE_DAY(value)        CHECK_RANGE_EXCEPTION(value, "Day", 1, 31)
-#define CHECK_RANGE_HOUR(value)       CHECK_RANGE_EXCEPTION(value, "Hour", 0, 23)
-#define CHECK_RANGE_MIN(value)        CHECK_RANGE_EXCEPTION(value, "Minute", 0, 59)
-#define CHECK_RANGE_SEC(value)        CHECK_RANGE_EXCEPTION(value, "Second", 0, 61)
-#define CHECK_RANGE_NSEC(value)       CHECK_RANGE_EXCEPTION(value, "Nanosecond", 0, \
-                                                            kNanoSecondsPerSecond - 1)
+#define CHECK_RANGE_YEAR(value)        CHECK_RANGE_EXCEPTION(value, "Year", 1583, kMax_Int)
+#define CHECK_RANGE_MONTH(value)       CHECK_RANGE_EXCEPTION(value, "Month", 1, 12)
+#define CHECK_RANGE_DAY(value)         CHECK_RANGE_EXCEPTION(value, "Day", 1, 31)
+#define CHECK_RANGE_HOUR(value)        CHECK_RANGE_EXCEPTION(value, "Hour", 0, 23)
+#define CHECK_RANGE_MIN(value)         CHECK_RANGE_EXCEPTION(value, "Minute", 0, 59)
+#define CHECK_RANGE_SEC(value)         CHECK_RANGE_EXCEPTION(value, "Second", 0, 61)
+#define CHECK_RANGE_NSEC(value)        CHECK_RANGE_EXCEPTION(value, "Nanosecond", 0, kNanoSecondsPerSecond - 1)
 
 #define CHECK_RANGE2_YEAR(value, err)  CHECK_RANGE2(value, "Year", 1583, kMax_Int, err)
 #define CHECK_RANGE2_MONTH(value, err) CHECK_RANGE2(value, "Month", 1, 12, err)
@@ -171,8 +172,17 @@ const char kFormatEscapeSymbol = '$';
 #define CHECK_RANGE2_HOUR(value, err)  CHECK_RANGE2(value, "Hour", 0, 23, err)
 #define CHECK_RANGE2_MIN(value, err)   CHECK_RANGE2(value, "Minute", 0, 59, err)
 #define CHECK_RANGE2_SEC(value, err)   CHECK_RANGE2(value, "Second", 0, 61, err)
-#define CHECK_RANGE2_NSEC(value, err)  CHECK_RANGE2(value, "Nanosecond", 0, \
-                                                    kNanoSecondsPerSecond - 1, err)
+#define CHECK_RANGE2_NSEC(value, err)  CHECK_RANGE2(value, "Nanosecond", 0, kNanoSecondsPerSecond - 1, err)
+
+// Bitfilds setters (to avoid warnings)
+
+#define SET_YEAR(value)  m_Data.year  = static_cast<unsigned int>((value) & 0xFFF)
+#define SET_MONTH(value) m_Data.month = static_cast<unsigned char>((value) & 0x0F)
+#define SET_DAY(value)   m_Data.day   = static_cast<unsigned char>((value) & 0x1F)
+#define SET_HOUR(value)  m_Data.hour  = static_cast<unsigned char>((value) & 0x1F)
+#define SET_MIN(value)   m_Data.min   = static_cast<unsigned char>((value) & 0x3F)
+#define SET_SEC(value)   m_Data.sec   = static_cast<unsigned char>((value) & 0x3F)
+
 
 
 //============================================================================
@@ -260,7 +270,7 @@ void s_AddInt(string& str, long value)
     char   buf[size];
     size_t pos = size;
     do {
-        buf[--pos] = char(value % 10) + '0';
+        buf[--pos] = char((value % 10) + '0');
         value /= 10;
     } while (value);
     str.append(buf + pos, size - pos);
@@ -281,7 +291,7 @@ void s_AddZeroPadInt(string& str, long value, size_t len, bool ignore_trailing_z
 
     size_t pos = size;
     do {
-        buf[--pos] = char(value % 10) + '0';
+        buf[--pos] = char((value % 10) + '0');
         value /= 10;
     } while (value);
 
@@ -302,8 +312,8 @@ void s_AddZeroPadInt2(string& str, long value)
 {
     _ASSERT((value >= 0)  &&  (value <= 99));
     char buf[2];
-    buf[1] = char(value % 10) + '0';
-    buf[0] = char(value / 10) + '0'; 
+    buf[1] = char((value % 10) + '0');
+    buf[0] = char((value / 10) + '0'); 
     str.append(buf, 2);
 }
 
@@ -434,9 +444,9 @@ CTime::CTime(int year, int yearDayNumber,
 
     CTime t = CTime(year, 1, 1);
     t.AddDay(yearDayNumber - 1);
-    m_Data.year  = t.Year();
-    m_Data.month = t.Month();
-    m_Data.day   = t.Day();
+    m_Data.year  = t.m_Data.year;
+    m_Data.month = t.m_Data.month;
+    m_Data.day   = t.m_Data.day;
 }
 
 
@@ -617,7 +627,7 @@ bool CTime::x_Init(const string& str, const CTimeFormat& format, EErrAction err_
                 size_t namelen = strlen(*name);
                 if (NStr::strncasecmp(sss, *name, namelen) == 0) {
                     sss += namelen;
-                    m_Data.month = i + 1;
+                    SET_MONTH(i + 1);
                     break;
                 }
                 ++name;
@@ -741,7 +751,7 @@ bool CTime::x_Init(const string& str, const CTimeFormat& format, EErrAction err_
         switch ( *fff ) {
         case 'Y':
             CHECK_RANGE2_YEAR(value, err_action);
-            m_Data.year = (unsigned int)value;
+            SET_YEAR(value);
             is_year_present = true;
             break;
         case 'y':
@@ -751,39 +761,39 @@ bool CTime::x_Init(const string& str, const CTimeFormat& format, EErrAction err_
                 value += 1900;
             }
             CHECK_RANGE2_YEAR(value, err_action);
-            m_Data.year = (unsigned int)value;
+            SET_YEAR(value);
             is_year_present = true;
             break;
         case 'M':
             CHECK_RANGE2_MONTH(value, err_action);
-            m_Data.month = (unsigned char)value;
+            SET_MONTH(value);
             is_month_present = true;
             break;
         case 'D':
         case 'd':
             CHECK_RANGE2_DAY(value, err_action);
-            m_Data.day = (unsigned char)value;
+            SET_DAY(value);
             is_day_present = true;
             break;
         case 'h':
             CHECK_RANGE2_HOUR(value, err_action);
-            m_Data.hour = (unsigned char)value;
+            SET_HOUR(value);
             is_time_present = true;
             break;
         case 'H':
             CHECK_RANGE2_HOUR(value, err_action);
-            m_Data.hour = (unsigned char)value % 12;
+            SET_HOUR(value % 12);
             is_12hour = true;
             is_time_present = true;
             break;
         case 'm':
             CHECK_RANGE2_MIN(value, err_action);
-            m_Data.min = (unsigned char)value;
+            SET_MIN(value);
             is_time_present = true;
             break;
         case 's':
             CHECK_RANGE2_SEC(value, err_action);
-            m_Data.sec = (unsigned char)value;
+            SET_SEC(value);
             is_time_present = true;
             break;
         case 'l':
@@ -804,7 +814,7 @@ bool CTime::x_Init(const string& str, const CTimeFormat& format, EErrAction err_
         case 'g':
         case 'G':
             CHECK_RANGE2_SEC(value, err_action);
-            m_Data.sec = (unsigned char)value;
+            SET_SEC(value);
             if ( *sss == '.' ) {
                 ++sss;
                 char* s = value_str;
@@ -839,7 +849,7 @@ bool CTime::x_Init(const string& str, const CTimeFormat& format, EErrAction err_
 
     // Correct 12-hour time if needed
     if (is_12hour  &&  hour_format == ePM) {
-        m_Data.hour += 12;
+        SET_HOUR(m_Data.hour + 12);
     }
 
     // Skip all remaining white spaces in the string
@@ -898,21 +908,21 @@ bool CTime::x_Init(const string& str, const CTimeFormat& format, EErrAction err_
             break;
         case 1222:                          // M,D,time -> Y = current
         case 1221:                          // M,D      -> Y = current
-            m_Data.year  = current.Year();
+            m_Data.year  = current.m_Data.year;
             break;
         case 1211:                          // M        -> Y = current, D = 1
-            m_Data.year  = current.Year();
+            m_Data.year  = current.m_Data.year;
             m_Data.day   = 1;
             break;
         case 1122:                          // D, time  -> Y,M = current
         case 1121:                          // D        -> Y,M = current
-            m_Data.year  = current.Year();
-            m_Data.month = current.Month();
+            m_Data.year  = current.m_Data.year;
+            m_Data.month = current.m_Data.month;
             break;
         case 1112:                          // time     -> Y,M,D = current
-            m_Data.year  = current.Year();
-            m_Data.month = current.Month();
-            m_Data.day   = current.Day();
+            m_Data.year  = current.m_Data.year;
+            m_Data.month = current.m_Data.month;
+            m_Data.day   = current.m_Data.day;
             break;
     }
 
@@ -955,12 +965,13 @@ CTime::CTime(int year, int month, int day, int hour,
     CHECK_RANGE_SEC(second);
     CHECK_RANGE_NSEC(nanosecond);
 
-    m_Data.year        = year;
-    m_Data.month       = month;
-    m_Data.day         = day;
-    m_Data.hour        = hour;
-    m_Data.min         = minute;
-    m_Data.sec         = second;
+    SET_YEAR(year);
+    SET_MONTH(month);
+    SET_DAY(day);
+    SET_HOUR(hour);
+    SET_MIN(minute);
+    SET_SEC(second);
+    
     m_Data.nanosec     = (Int4)nanosecond;
     m_Data.tz          = tz;
     m_Data.tzprec      = tzp;
@@ -1031,10 +1042,10 @@ bool CTime::ValidateString(const string& str, const CTimeFormat& fmt)
 void CTime::SetYear(int year)
 {
     CHECK_RANGE_YEAR(year);
-    m_Data.year = year;
+    SET_YEAR(year);
     int n_days = DaysInMonth();
     if ( m_Data.day > n_days ) {
-        m_Data.day = n_days;
+        SET_DAY(n_days);
     }
     // Additional checks
     if ( !IsValid() ) {
@@ -1048,10 +1059,10 @@ void CTime::SetYear(int year)
 void CTime::SetMonth(int month)
 {
     CHECK_RANGE_MONTH(month);
-    m_Data.month = month;
+    SET_MONTH(month);
     int n_days = DaysInMonth();
     if ( m_Data.day > n_days ) {
-        m_Data.day = n_days;
+        SET_DAY(n_days);
     }
     // Additional checks
     if ( !IsValid() ) {
@@ -1067,9 +1078,9 @@ void CTime::SetDay(int day)
     CHECK_RANGE_DAY(day);
     int n_days = DaysInMonth();
     if ( day > n_days ) {
-        m_Data.day = n_days;
+        SET_DAY(n_days);
     } else {
-        m_Data.day = day;
+        SET_DAY(day);
     }
     // Additional checks
     if ( !IsValid() ) {
@@ -1083,21 +1094,21 @@ void CTime::SetDay(int day)
 void CTime::SetHour(int hour)
 {
     CHECK_RANGE_HOUR(hour);
-    m_Data.hour = hour;
+    SET_HOUR(hour);
 }
 
 
 void CTime::SetMinute(int minute)
 {
     CHECK_RANGE_MIN(minute);
-    m_Data.min = minute;
+    SET_MIN(minute);
 }
 
 
 void CTime::SetSecond(int second)
 {
     CHECK_RANGE_SEC(second);
-    m_Data.sec = second;
+    SET_SEC(second);
 }
 
 
@@ -1421,12 +1432,13 @@ CTime& CTime::SetTimeTM(const struct tm& t)
     CHECK_RANGE_MIN    (t.tm_min);
     CHECK_RANGE_SEC    (t.tm_sec);
 
-    m_Data.year        = t.tm_year + 1900;
-    m_Data.month       = t.tm_mon + 1;
-    m_Data.day         = t.tm_mday;
-    m_Data.hour        = t.tm_hour;
-    m_Data.min         = t.tm_min;
-    m_Data.sec         = t.tm_sec;
+    SET_YEAR  (t.tm_year + 1900);
+    SET_MONTH (t.tm_mon + 1);
+    SET_DAY   (t.tm_mday);
+    SET_HOUR  (t.tm_hour);
+    SET_MIN   (t.tm_min);
+    SET_SEC   (t.tm_sec);
+    
     m_Data.nanosec     = 0;
     m_Data.tz          = eLocal;
     //m_Data.tzprec    -- not changed;
@@ -1708,12 +1720,14 @@ CTime& CTime::x_SetTime(const time_t* value)
     }
 #endif
     m_Data.adjTimeDiff = 0;
-    m_Data.year        = t->tm_year + 1900;
-    m_Data.month       = t->tm_mon + 1;
-    m_Data.day         = t->tm_mday;
-    m_Data.hour        = t->tm_hour;
-    m_Data.min         = t->tm_min;
-    m_Data.sec         = t->tm_sec;
+    
+    SET_YEAR  (t->tm_year + 1900);
+    SET_MONTH (t->tm_mon + 1);
+    SET_DAY   (t->tm_mday);
+    SET_HOUR  (t->tm_hour);
+    SET_MIN   (t->tm_min);
+    SET_SEC   (t->tm_sec);
+    
     CHECK_RANGE_NSEC(ns);
     m_Data.nanosec     = (Int4)ns;
 
@@ -1741,8 +1755,8 @@ CTime& CTime::AddMonth(int months, EDaylight adl)
     long newMonth = Month() - 1;
     int newYear = Year();
     s_Offset(&newMonth, months, 12, &newYear);
-    m_Data.year = newYear;
-    m_Data.month = (int)newMonth + 1;
+    SET_YEAR(newYear);
+    SET_MONTH(newMonth + 1);
     x_AdjustDay();
     if ( aflag ) {
         x_AdjustTime(*pt);
@@ -1804,7 +1818,7 @@ CTime& CTime::x_AddHour(int hours, EDaylight adl, bool shift_time)
     int dayOffset = 0;
     long newHour = Hour();
     s_Offset(&newHour, hours, 24, &dayOffset);
-    m_Data.hour = (int)newHour;
+    SET_HOUR(newHour);
     AddDay(dayOffset, eIgnoreDaylight);
     if ( aflag ) {
         x_AdjustTime(*pt, shift_time);
@@ -1834,7 +1848,7 @@ CTime& CTime::AddMinute(int minutes, EDaylight adl)
     int hourOffset = 0;
     long newMinute = Minute();
     s_Offset(&newMinute, minutes, 60, &hourOffset);
-    m_Data.min = (int)newMinute;
+    SET_MIN(newMinute);
     AddHour(hourOffset, eIgnoreDaylight);
     if ( aflag ) {
         x_AdjustTime(*pt);
@@ -1855,7 +1869,7 @@ CTime& CTime::AddSecond(TSeconds seconds, EDaylight adl)
     int minuteOffset = 0;
     long newSecond = Second();
     s_Offset(&newSecond, seconds, 60, &minuteOffset);
-    m_Data.sec = (int)newSecond;
+    SET_SEC(newSecond);
     return AddMinute(minuteOffset, adl);
 }
 
@@ -2069,12 +2083,12 @@ CTime& CTime::ToTime(ETimeZone tz)
                        "localtime/gmtime error, possible incorrect time_t value");
         }
 #endif
-        m_Data.year  = t->tm_year + 1900;
-        m_Data.month = t->tm_mon + 1;
-        m_Data.day   = t->tm_mday;
-        m_Data.hour  = t->tm_hour;
-        m_Data.min   = t->tm_min;
-        m_Data.sec   = t->tm_sec;
+        SET_YEAR  (t->tm_year + 1900);
+        SET_MONTH (t->tm_mon + 1);
+        SET_DAY   (t->tm_mday);
+        SET_HOUR  (t->tm_hour);
+        SET_MIN   (t->tm_min);
+        SET_SEC   (t->tm_sec);
         m_Data.tz    = tz;
     }
     return *this;
@@ -2236,7 +2250,7 @@ string CTime::TimeZoneName(void)
     }
 #endif
     if (s.empty()) {
-        s = t->tm_isdst > 0 ? tzname[1] : tzname[0];
+        s = t->tm_isdst > 0 ? TZName()[1] : TZName()[0];
     }
     return s;    
 }
@@ -2291,7 +2305,7 @@ void CTimeSpan::Set(double seconds)
                   " is too big to convert to CTimeSpan");
     }
     m_Sec = long(seconds);
-    m_NanoSec = long((seconds - m_Sec) * kNanoSecondsPerSecond);
+    m_NanoSec = long((seconds - (double)m_Sec) * kNanoSecondsPerSecond);
     x_Normalize();
 }
 
@@ -2300,7 +2314,7 @@ void CTime::x_AdjustDay()
 {
     int n_days = DaysInMonth();
     if (Day() > n_days) {
-        m_Data.day = n_days;
+        SET_DAY(n_days);
     }
 }
 
@@ -2883,9 +2897,9 @@ string CTimeSpan::x_AsSmartString_Smart_Small(TSmartStringFlags flags) const
     long nanoseconds  = GetNanoSecondsAfterSecond();
     // Split nanoseconds to 3 digit parts AAABBBCCC
     // AAA - milli, BBB - micro, CCC - nano
-    int  milli = nanoseconds / 1000000;
-    int  micro = nanoseconds / 1000 % 1000;
-    int  nano  = nanoseconds % 1000;
+    int  milli = int(nanoseconds / 1000000);
+    int  micro = int(nanoseconds / 1000 % 1000);
+    int  nano  = int(nanoseconds % 1000);
 
     // We would like to have 3 digits in result,
     // so we need 2 components max.
@@ -2952,7 +2966,7 @@ string CTimeSpan::x_AsSmartString_Smart_Small(TSmartStringFlags flags) const
 
     // Add (3-n) digits from v2 after "."
     if (v2  &&  len < 3) {
-        int n = v2 / 10;
+        int n = int(v2 / 10);
         if (len == 2) {
             n = n / 10;
         }
@@ -3563,17 +3577,17 @@ void CTimeout::Set(EType type)
 void CTimeout::Set(unsigned int sec, unsigned int usec)
 {
     m_Type    = eFinite;
-    m_Sec     =  usec / kMicroSecondsPerSecond + sec;
-    m_NanoSec = (usec % kMicroSecondsPerSecond) *
-        (kNanoSecondsPerSecond / kMicroSecondsPerSecond);
+    m_Sec     =  usec / (unsigned int)kMicroSecondsPerSecond + sec;
+    m_NanoSec = (usec % (unsigned int)kMicroSecondsPerSecond) *
+        (unsigned int)(kNanoSecondsPerSecond / kMicroSecondsPerSecond);
 }
 
 
 void CTimeout::SetNano(unsigned int sec, unsigned int nanosec)
 {
     m_Type    = eFinite;
-    m_Sec     = nanosec / kNanoSecondsPerSecond + sec;
-    m_NanoSec = nanosec % kNanoSecondsPerSecond;
+    m_Sec     = nanosec / (unsigned int)kNanoSecondsPerSecond + sec;
+    m_NanoSec = nanosec % (unsigned int)kNanoSecondsPerSecond;
 }
 
 
@@ -3744,7 +3758,7 @@ CDeadline::CDeadline(const CTimeout& timeout)
         x_Now();
         unsigned int sec, usec;
         timeout.Get(&sec, &usec);
-        x_Add(sec, usec * (kNanoSecondsPerSecond / kMicroSecondsPerSecond));
+        x_Add(sec, usec * (unsigned int)(kNanoSecondsPerSecond / kMicroSecondsPerSecond));
     }
 }
 
@@ -3776,8 +3790,8 @@ void CDeadline::x_Now(void)
     struct timeval tp;
     if (gettimeofday(&tp, 0) == 0) {
         m_Seconds     = tp.tv_sec;
-        m_Nanoseconds = tp.tv_usec *
-            (kNanoSecondsPerSecond / kMicroSecondsPerSecond);
+        m_Nanoseconds = (unsigned int)
+            (tp.tv_usec * (kNanoSecondsPerSecond / kMicroSecondsPerSecond));
     } else {
         NCBI_THROW(CTimeException, eInvalid,
                    "Cannot get current deadline time value");
@@ -3791,8 +3805,8 @@ void CDeadline::x_Add(unsigned int seconds, unsigned int nanoseconds)
 {
     if (!m_Infinite  &&  (seconds | nanoseconds)) {
         nanoseconds  += m_Nanoseconds;
-        seconds      += nanoseconds / kNanoSecondsPerSecond;
-        m_Nanoseconds = nanoseconds % kNanoSecondsPerSecond;
+        seconds      += nanoseconds / (unsigned int)kNanoSecondsPerSecond;
+        m_Nanoseconds = nanoseconds % (unsigned int)kNanoSecondsPerSecond;
         m_Seconds    += seconds;
     }
 }
@@ -3838,7 +3852,7 @@ CNanoTimeout CDeadline::GetRemainingTime(void) const
         thenNS -= nowNS;
     } else {
         --thenS;
-        thenNS = kNanoSecondsPerSecond - (nowNS - thenNS);
+        thenNS = (unsigned int)kNanoSecondsPerSecond - (nowNS - thenNS);
     }
     _ASSERT(thenS >= nowS);
     thenS -= nowS;
diff --git a/c++/src/corelib/perf_log.cpp b/c++/src/corelib/perf_log.cpp
index 3f719ba..f32e4b2 100644
--- a/c++/src/corelib/perf_log.cpp
+++ b/c++/src/corelib/perf_log.cpp
@@ -1,4 +1,4 @@
-/*  $Id: perf_log.cpp 469371 2015-06-03 18:05:11Z grichenk $
+/*  $Id: perf_log.cpp 484403 2015-11-10 18:22:15Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -43,10 +43,10 @@ BEGIN_NCBI_SCOPE
 //     [Log]
 //     PerfLogging = true/false
 // Environment variable:
-//     LOG_PerfLogging
+//     LOG_PERFLOGGING
 //
 NCBI_PARAM_DECL(bool, Log, PerfLogging);
-NCBI_PARAM_DEF_EX(bool, Log, PerfLogging, false, eParam_NoThread, LOG_PerfLogging);
+NCBI_PARAM_DEF_EX(bool, Log, PerfLogging, false, eParam_NoThread, LOG_PERFLOGGING);
 typedef NCBI_PARAM_TYPE(Log, PerfLogging) TPerfLogging;
 
 
diff --git a/c++/src/corelib/request_ctx.cpp b/c++/src/corelib/request_ctx.cpp
index ffdba9d..6c37235 100644
--- a/c++/src/corelib/request_ctx.cpp
+++ b/c++/src/corelib/request_ctx.cpp
@@ -1,4 +1,4 @@
-/*  $Id: request_ctx.cpp 472377 2015-07-09 14:15:29Z ivanov $
+/*  $Id: request_ctx.cpp 493379 2016-02-26 15:41:32Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -44,6 +44,11 @@
 BEGIN_NCBI_SCOPE
 
 
+static const char* kPassThrough_Sid = "ncbi_sid";
+static const char* kPassThrough_Phid = "ncbi_phid";
+static const char* kPassThrough_ClientIp = "ncbi_client_ip";
+static const char* kPassThrough_Dtab = "ncbi_dtab";
+
 CRequestContext::CRequestContext(TContextFlags flags)
     : m_RequestID(0),
       m_AppState(eDiagAppState_NotSet),
@@ -154,6 +159,7 @@ void CRequestContext::Reset(void)
     UnsetBytesRd();
     UnsetBytesWr();
     m_ReqTimer.Reset();
+    m_PassThroughProperties.clear();
 }
 
 
@@ -286,17 +292,24 @@ static bool IsValidHitID(const string& hit) {
         }
     }
     if (sep_pos == NPOS) return true;
-    // Separator found - make sure the rest of the id contains only digits and separators
-    // (XYZ.1.2.34)
-    for (pos = sep_pos; pos < hit.size(); pos++) {
+    // Separator found - make sure the rest of the id contains only separators
+    // and valid sub-hit ids: a prefix consisting of allowed chars and some
+    // digits (XYZ.1.J2.T34).
+    size_t last_digit = sep_pos;
+    for (pos = sep_pos + 1; pos < hit.size(); pos++) {
         char c = hit[pos];
         if (c == '.') {
-            // Need at least one digit between separators.
+            // Need at least one char between separators.
             if (pos == sep_pos + 1) return false;
+            // Need at least one digit before separator.
+            if (last_digit + 1 != pos) return false;
             sep_pos = pos;
             continue;
         }
-        if ( !isdigit(c) ) return false;
+        if (!isalnum(hit[pos])  &&  id_std.find(hit[pos]) == NPOS) {
+            return false;
+        }
+        if ( isdigit(c) ) last_digit = pos;
     }
     // Make sure the last char is digit.
     return pos > sep_pos + 1;
@@ -316,12 +329,12 @@ void CRequestContext::SetHitID(const string& hit)
         case eOnBadPHID_Ignore:
             return;
         case eOnBadPHID_AllowAndReport:
+            // Use Warning if bad hit id is acceptable.
+            ERR_POST_X(27, Warning << "Bad hit ID format: " << hit);
+            break;
         case eOnBadPHID_IgnoreAndReport:
             ERR_POST_X(27, "Bad hit ID format: " << hit);
-            if (action->Get() == eOnBadPHID_IgnoreAndReport) {
-                return;
-            }
-            break;
+            return;
         case eOnBadPHID_Throw:
             NCBI_THROW(CRequestContextException, eBadHit,
                 "Bad hit ID format: " + hit);
@@ -333,6 +346,7 @@ void CRequestContext::SetHitID(const string& hit)
     x_SetProp(eProp_HitID);
     if (m_HitID != hit) {
         m_SubHitID = 0;
+        m_SubHitIDCache.clear();
     }
     m_HitID = hit;
     m_LoggedHitID = false;
@@ -340,7 +354,7 @@ void CRequestContext::SetHitID(const string& hit)
 }
 
 
-const string& CRequestContext::GetNextSubHitID(void)
+void CRequestContext::x_UpdateSubHitID(bool increment)
 {
     static CAtomicCounter s_DefaultSubHitCounter;
 
@@ -349,12 +363,19 @@ const string& CRequestContext::GetNextSubHitID(void)
     // Use global sub-hit counter for default hit id to prevent
     // duplicate phids in different threads.
     m_SubHitIDCache = GetHitID();
-    int sub_hit_id = m_SubHitIDCache == GetDiagContext().GetDefaultHitID() ?
-        s_DefaultSubHitCounter.Add(1) : ++m_SubHitID;
+
+    unsigned int sub_hit_id;
+    if (m_SubHitIDCache == GetDiagContext().GetDefaultHitID()) {
+        sub_hit_id = (unsigned int)(increment ? s_DefaultSubHitCounter.Add(1) :
+            s_DefaultSubHitCounter.Get());
+    }
+    else {
+        if ( increment ) ++m_SubHitID;
+        sub_hit_id = m_SubHitID;
+    }
 
     // Cache the string so that C code can use it.
     m_SubHitIDCache += "." + NStr::NumericToString(sub_hit_id);
-    return m_SubHitIDCache;
 }
 
 
@@ -487,6 +508,8 @@ CRef<CRequestContext> CRequestContext::Clone(void) const
     ret->m_HitID = m_HitID;
     ret->m_LoggedHitID = m_LoggedHitID;
     ret->m_SubHitID = m_SubHitID;
+    ret->m_SubHitIDCache = m_SubHitIDCache;
+    ret->m_Dtab = m_Dtab;
     ret->m_ReqStatus = m_ReqStatus;
     ret->m_ReqTimer = m_ReqTimer;
     ret->m_BytesRd = m_BytesRd;
@@ -507,7 +530,8 @@ string CRequestContext::SelectLastHitID(const string& hit_ids)
         return hit_ids;
     }
     list<string> ids;
-    NStr::Split(hit_ids, ", ", ids);
+    NStr::Split(hit_ids, ", ", ids,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     return ids.empty() ? kEmptyStr : ids.back();
 }
 
@@ -519,7 +543,8 @@ string CRequestContext::SelectLastSessionID(const string& session_ids)
         return session_ids;
     }
     list<string> ids;
-    NStr::Split(session_ids, ", ", ids);
+    NStr::Split(session_ids, ", ", ids,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     REVERSE_ITERATE(list<string>, it, ids) {
         if (*it != "UNK_SESSION") {
             return *it;
@@ -529,6 +554,179 @@ string CRequestContext::SelectLastSessionID(const string& session_ids)
 }
 
 
+bool CRequestContext::x_IsSetPassThroughProp(CTempString name, bool update) const
+{
+    if ( update ) x_UpdateStdPassThroughProp(name);
+    TPassThroughProperties::const_iterator found = m_PassThroughProperties.find(name);
+    return found != m_PassThroughProperties.end();
+}
+
+
+const string& CRequestContext::x_GetPassThroughProp(CTempString name, bool update) const
+{
+    if ( update ) x_UpdateStdPassThroughProp(name);
+    TPassThroughProperties::const_iterator found = m_PassThroughProperties.find(name);
+    return found != m_PassThroughProperties.end() ? found->second : kEmptyStr;
+}
+
+
+void CRequestContext::x_SetPassThroughProp(CTempString name,
+                                           CTempString value,
+                                           bool update) const
+{
+    m_PassThroughProperties[name] = value;
+    if ( update ) x_UpdateStdContextProp(name);
+}
+
+
+void CRequestContext::x_ResetPassThroughProp(CTempString name, bool update) const
+{
+    TPassThroughProperties::iterator found = m_PassThroughProperties.find(name);
+    if (found != m_PassThroughProperties.end()) {
+        m_PassThroughProperties.erase(found);
+        if ( update ) x_UpdateStdContextProp(name);
+    }
+}
+
+
+void CRequestContext::x_UpdateStdPassThroughProp(CTempString name) const
+{
+    if (name.empty()  ||  NStr::EqualNocase(name, kPassThrough_Sid)) {
+        if ( IsSetSessionID() ) {
+            x_SetPassThroughProp(kPassThrough_Sid, GetSessionID(), false);
+        }
+        else {
+            x_ResetPassThroughProp(kPassThrough_Sid, false);
+        }
+    }
+    if (name.empty()  ||  NStr::EqualNocase(name, kPassThrough_ClientIp)) {
+        if ( IsSetClientIP() ) {
+            x_SetPassThroughProp(kPassThrough_ClientIp, GetClientIP(), false);
+        }
+        else {
+            x_ResetPassThroughProp(kPassThrough_ClientIp, false);
+        }
+    }
+    if (name.empty()  ||  NStr::EqualNocase(name, kPassThrough_Dtab)) {
+        if ( IsSetDtab() ) {
+            x_SetPassThroughProp(kPassThrough_Dtab, GetDtab(), false);
+        }
+        else {
+            x_ResetPassThroughProp(kPassThrough_Dtab, false);
+        }
+    }
+    if (name.empty()  ||  NStr::EqualNocase(name, kPassThrough_Phid)) {
+        if ( IsSetHitID() ) {
+            string sub_phid = const_cast<CRequestContext&>(*this).GetCurrentSubHitID();
+            if ( sub_phid.empty() ) {
+                sub_phid = const_cast<CRequestContext&>(*this).GetNextSubHitID();
+            }
+            x_SetPassThroughProp(kPassThrough_Phid, sub_phid, false);
+        }
+        else {
+            x_ResetPassThroughProp(kPassThrough_Phid, false);
+        }
+    }
+}
+
+
+void CRequestContext::x_UpdateStdContextProp(CTempString name) const
+{
+    CRequestContext& ctx = const_cast<CRequestContext&>(*this);
+
+    bool match = NStr::EqualNocase(name, kPassThrough_Sid);
+    if (name.empty()  ||  match) {
+        if (x_IsSetPassThroughProp(kPassThrough_Sid, false)) {
+            ctx.SetSessionID(x_GetPassThroughProp(kPassThrough_Sid, false));
+        }
+        // Reset property only if explicit name is provided
+        else if ( match ) {
+            ctx.UnsetSessionID();
+        }
+        // Explicit name provided - skip other checks.
+        if ( match ) return;
+    }
+
+    match = NStr::EqualNocase(name, kPassThrough_Phid);
+    if (name.empty()  ||  match) {
+        if (x_IsSetPassThroughProp(kPassThrough_Phid, false)) {
+            ctx.SetHitID(x_GetPassThroughProp(kPassThrough_Phid, false));
+        }
+        // Reset property only if explicit name is provided
+        else if ( match ) {
+            ctx.UnsetHitID();
+        }
+        // Explicit name provided - skip other checks.
+        if ( match ) return;
+    }
+
+    match = NStr::EqualNocase(name, kPassThrough_ClientIp);
+    if (name.empty()  ||  match) {
+        if (x_IsSetPassThroughProp(kPassThrough_ClientIp, false)) {
+            ctx.SetClientIP(x_GetPassThroughProp(kPassThrough_ClientIp, false));
+        }
+        // Reset property only if explicit name is provided
+        else if ( match ) {
+            ctx.UnsetClientIP();
+        }
+        // Explicit name provided - skip other checks.
+        if ( match ) return;
+    }
+
+    match = NStr::EqualNocase(name, kPassThrough_Dtab);
+    if (name.empty()  ||  match) {
+        if (x_IsSetPassThroughProp(kPassThrough_Dtab, false)) {
+            ctx.SetDtab(x_GetPassThroughProp(kPassThrough_Dtab, false));
+        }
+        // Reset property only if explicit name is provided
+        else if ( match ) {
+            ctx.UnsetDtab();
+        }
+        // Explicit name provided - skip other checks.
+        if ( match ) return;
+    }
+}
+
+
+string CRequestContext_PassThrough::Serialize(EFormat format) const
+{
+    m_Context->x_UpdateStdPassThroughProp("");
+
+    switch (format) {
+    case eFormat_UrlEncoded:
+        return x_SerializeUrlEncoded();
+    }
+    return kEmptyStr;
+}
+
+
+void CRequestContext_PassThrough::Deserialize(CTempString data, EFormat format)
+{
+    switch (format) {
+    case eFormat_UrlEncoded:
+        x_DeserializeUrlEncoded(data);
+        break;
+    }
+
+    m_Context->x_UpdateStdContextProp("");
+}
+
+
+string CRequestContext_PassThrough::x_SerializeUrlEncoded(void) const
+{
+    return CStringPairs<TProperties>::Merge(m_Context->m_PassThroughProperties,
+        "&", "=", new CStringEncoder_Url(NStr::eUrlEnc_Cookie));
+}
+
+
+void CRequestContext_PassThrough::x_DeserializeUrlEncoded(CTempString data)
+{
+    CStringPairs<TProperties>::Parse(
+        m_Context->m_PassThroughProperties, data,
+        "&", "=", new CStringDecoder_Url());
+}
+
+
 const char* CRequestContextException::GetErrCodeString(void) const
 {
     switch (GetErrCode()) {
diff --git a/c++/src/corelib/resource_info.cpp b/c++/src/corelib/resource_info.cpp
index 38929ab..3651a62 100644
--- a/c++/src/corelib/resource_info.cpp
+++ b/c++/src/corelib/resource_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: resource_info.cpp 464978 2015-04-15 18:51:39Z grichenk $
+/*  $Id: resource_info.cpp 488254 2015-12-29 13:56:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -66,8 +66,10 @@ namespace {
 
 inline char Hex(unsigned char c)
 {
-    if (c < 10) return c + '0';
-    return c - 10 + 'A';
+    if (c < 10) {
+        return char(c + '0');
+    }
+    return char(c - 10 + 'A');
 }
 
 
@@ -77,8 +79,8 @@ string BinToHex(const string& data)
     string ret;
     ret.reserve(data.size()*2);
     ITERATE(string, c, data) {
-        ret += Hex((unsigned char)(*c) >> 4);
-        ret += Hex((unsigned char)(*c) & 0x0f);
+        ret += Hex((unsigned char)((unsigned char)(*c) >> 4));
+        ret += Hex((unsigned char)((unsigned char)(*c) & 0x0F));
     }
     return ret;
 }
@@ -92,29 +94,33 @@ string HexToBin(const string& hex)
     _ASSERT(hex.size() % 2 == 0);
     ret.reserve(hex.size()/2);
     ITERATE(string, h, hex) {
-        char c1 = NStr::HexChar(*h);
+        int hc = NStr::HexChar(*h);
+        _ASSERT(hc != -1);
+        char c1 = char(hc);
         h++;
-        char c2 = NStr::HexChar(*h);
+        hc = NStr::HexChar(*h);
+        _ASSERT(hc != -1);
+        char c2 = char(hc);
         if (c1 < 0  ||  c2 < 0) {
             NCBI_THROW(CNcbiEncryptException, eBadFormat,
                 "Invalid hexadecimal string format: " + hex);
             return kEmptyStr;
         }
-        ret += ((c1 << 4) + c2);
+        ret += char((c1 << 4) + c2);
     }
     return ret;
 }
 
 
 // Use 128-bit key
-const int kBlockTEA_KeySize = 4;
+const size_t kBlockTEA_KeySize = 4;
 
 // Block size is a multiple of key size. The longer the better (hides
 // the source length).
 // For historical reasons block sizes for NCBI resources and encryption
 // API are different.
-const int kResInfo_BlockSize = kBlockTEA_KeySize*sizeof(Int4)*4;
-const int kEncrypt_BlockSize = kBlockTEA_KeySize*sizeof(Int4);
+const size_t kResInfo_BlockSize = kBlockTEA_KeySize * sizeof(Int4) * 4;
+const size_t kEncrypt_BlockSize = kBlockTEA_KeySize * sizeof(Int4);
 
 
 // Helper function converting a seed string to a 128 bit binary key.
@@ -286,7 +292,8 @@ CNcbiResourceInfoFile::AddResourceInfo(const string& plain_text)
     string pwd, res_name, res_value, extra;
 
     // Get password for encoding
-    NStr::Split(data, kParserSeparators, split);
+    NStr::Split(data, kParserSeparators, split,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     it = split.begin();
     if ( it == split.end() ) {
         // No password
@@ -624,7 +631,8 @@ void CNcbiEncrypt::sx_InitKeyMap(void)
                 files = CDirEntry::MakePath(CDir::GetHome(), kDefaultKeysFile);
             }
             list<string> file_list;
-            NStr::Split(files, ":", file_list);
+            NStr::Split(files, ":", file_list,
+                        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             ITERATE(list<string>, it, file_list) {
                 string fname = *it;
                 size_t home_pos = fname.find("$HOME");
@@ -724,7 +732,8 @@ string CNcbiEncrypt::x_GetDomainKeys(const string& domain, TKeyMap* keys)
 {
     string first_key;
     list<string> paths;
-    NStr::Split(TKeyPaths::GetDefault(), ":", paths);
+    NStr::Split(TKeyPaths::GetDefault(), ":", paths,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     ITERATE(list<string>, it, paths) {
         string path = *it;
         if (path == "$$") {
@@ -820,13 +829,13 @@ string CNcbiEncrypt::x_AddSalt(const string& data, char version)
     }
     time_t ttmp = tt;
     for (size_t i = 0; i < sizeof(ttmp) && salt.size() < kSaltLength; ++i) {
-        salt += ttmp & 0xFF;
+        salt += char(ttmp & 0xFF);
         ttmp >>= 8;
     }
     while (salt.size() < kSaltLength) {
         long ntmp = ++ns;
         for (size_t i = 0; i < sizeof(ntmp) && salt.size() < kSaltLength; ++i) {
-            salt += ntmp & 0xFF;
+            salt += char(ntmp & 0xFF);
             ntmp >>= 8;
         }
     }
diff --git a/c++/src/corelib/teamcity_boost.cpp b/c++/src/corelib/teamcity_boost.cpp
index 9e5d598..45e1370 100644
--- a/c++/src/corelib/teamcity_boost.cpp
+++ b/c++/src/corelib/teamcity_boost.cpp
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
- * $Id: teamcity_boost.cpp 431707 2014-04-07 15:25:56Z camacho $
+ * $Id: teamcity_boost.cpp 488254 2015-12-29 13:56:26Z ivanov $
 */
 
 #include <sstream>
@@ -128,7 +128,7 @@ void TeamcityBoostLogFormatter::test_unit_finish(ostream &out, boost::unit_test:
             }
         }
 
-        messages.testFinished(tu.p_name, elapsed / 1000, flowId);
+        messages.testFinished(tu.p_name, int(elapsed / 1000), flowId);
     } else {
         messages.suiteFinished(tu.p_name, flowId);
     }
diff --git a/c++/src/corelib/test_boost.cpp b/c++/src/corelib/test_boost.cpp
index bf6891e..174758c 100644
--- a/c++/src/corelib/test_boost.cpp
+++ b/c++/src/corelib/test_boost.cpp
@@ -1,4 +1,4 @@
-/*  $Id: test_boost.cpp 467868 2015-05-18 16:00:06Z ucko $
+/*  $Id: test_boost.cpp 497436 2016-04-06 17:56:51Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -70,7 +70,6 @@
 #include <boost/test/included/unit_test.hpp>
 #include <boost/test/results_collector.hpp>
 #include <boost/test/results_reporter.hpp>
-#include <boost/test/test_observer.hpp>
 #include <boost/test/unit_test_log.hpp>
 #include <boost/test/unit_test_log_formatter.hpp>
 #include <boost/test/output/plain_report_formatter.hpp>
@@ -79,9 +78,43 @@
 #include <boost/test/output/xml_log_formatter.hpp>
 #include <boost/test/utils/xml_printer.hpp>
 #include <boost/test/detail/global_typedef.hpp>
-#include <boost/test/detail/unit_test_parameters.hpp>
 #include <boost/test/debug.hpp>
 
+#if BOOST_VERSION >= 105900
+#  include <boost/test/tree/observer.hpp>
+#  include <boost/test/unit_test_parameters.hpp>
+#  define IGNORE_STATUS , true
+#else
+#  include <boost/test/test_observer.hpp>
+#  include <boost/test/detail/unit_test_parameters.hpp>
+#  define OF_XML    XML
+#  define TUT_CASE  tut_case
+#  define TUT_SUITE tut_suite
+#  define IGNORE_STATUS
+#endif
+
+#if BOOST_VERSION >= 106000
+#  define attr_value utils::attr_value
+#  define RTCFG(type, new_name, old_name) \
+    but::runtime_config::get<type >(but::runtime_config::new_name)
+#else
+#  define RTCFG(type, new_name, old_name) but::runtime_config::old_name()
+#  if BOOST_VERSION >= 105900
+#    define BOOST_TEST_I_TRY      BOOST_TEST_IMPL_TRY
+#    define BOOST_TEST_I_CATCH    BOOST_TEST_IMPL_CATCH
+#    define BOOST_TEST_I_CATCH0   BOOST_TEST_IMPL_CATCH0
+#    define BOOST_TEST_I_CATCHALL BOOST_TEST_IMPL_CATCHALL
+#  else
+#    define BOOST_TEST_I_TRY             try
+#    define BOOST_TEST_I_CATCH(type, ex) catch (type const& ex)
+#    define BOOST_TEST_I_CATCH0(type)    catch (type const&)
+#    define BOOST_TEST_I_CATCHALL()      catch (...)
+#  endif
+#endif
+
+#define CONFIGURED_FILTERS \
+    RTCFG(std::vector<std::string>, RUN_FILTERS, test_to_run)
+
 #ifdef NCBI_COMPILER_MSVC
 #  pragma warning(pop)
 #endif
@@ -101,6 +134,31 @@ namespace but = boost::unit_test;
 
 BEGIN_NCBI_SCOPE
 
+#if BOOST_VERSION >= 105900
+inline
+static bool s_IsEnabled(const but::test_unit& tu) {
+    return tu.is_enabled();
+}
+
+inline
+static void s_SetEnabled(but::test_unit& tu, bool enabled) {
+    but::test_unit::run_status rs
+        = enabled ? but::test_unit::RS_ENABLED : but::test_unit::RS_DISABLED;
+    tu.p_default_status.set(rs);
+    tu.p_run_status.set(rs);
+}
+#else
+inline
+static bool s_IsEnabled(const but::test_unit& tu) {
+    return tu.p_enabled;
+}
+
+inline
+static void s_SetEnabled(but::test_unit& tu, bool enabled) {
+    tu.p_enabled.set(enabled);
+}
+#endif
+
 const char* kTestsDisableSectionName = "UNITTESTS_DISABLE";
 const char* kTestsToFixSectionName = "UNITTESTS_TOFIX";
 const char* kTestsTimeoutSectionName = "UNITTESTS_TIMEOUT_MULT";
@@ -189,7 +247,13 @@ public:
                                           unsigned long elapsed);
     virtual
     void test_unit_skipped(ostream& ostr, but::test_unit const& tu);
-#if BOOST_VERSION >= 104200
+#if BOOST_VERSION >= 105900
+    virtual
+    void log_exception_start(ostream& ostr, but::log_checkpoint_data const& lcd,
+                             boost::execution_exception const& ex);
+    virtual
+    void log_exception_finish(ostream& ostr);
+#elif BOOST_VERSION >= 104200
     virtual
     void log_exception    (ostream& ostr, but::log_checkpoint_data const& lcd,
                                           boost::execution_exception const& ex);
@@ -210,6 +274,17 @@ public:
     virtual
     void log_entry_finish (ostream& ostr);
 
+#if BOOST_VERSION >= 105900
+    virtual
+    void entry_context_start(ostream& ostr, but::log_level l);
+
+    virtual
+    void log_entry_context(ostream& ostr, but::const_string value);
+
+    virtual
+    void entry_context_finish (ostream& ostr);
+#endif
+
 private:
     /// Standard logger from Boost for particular report format
     AutoPtr<TBoostLogFormatter>  m_Upper;
@@ -557,7 +632,7 @@ CNcbiBoostReporter::CNcbiBoostReporter()
 inline void
 CNcbiBoostReporter::SetOutputFormat(but::output_format format)
 {
-    if (format == but::XML) {
+    if (format == but::OF_XML) {
         m_IsXML = true;
         m_Upper = new but::output::xml_report_formatter();
     }
@@ -576,7 +651,7 @@ CNcbiBoostLogger::CNcbiBoostLogger(void)
 inline void
 CNcbiBoostLogger::SetOutputFormat(but::output_format format)
 {
-    if (format == but::XML) {
+    if (format == but::OF_XML) {
         m_IsXML = true;
         m_Upper = new but::output::xml_log_formatter();
     }
@@ -694,7 +769,7 @@ CNcbiTestTreeElement::EnsureDep(CNcbiTestTreeElement* from)
     TElemsList parents;
 
     CNcbiTestTreeElement* parElem = this;
-    if (m_TestUnit->p_type != but::tut_suite) {
+    if (m_TestUnit->p_type != but::TUT_SUITE) {
         parElem = m_Parent;
     }
     do {
@@ -913,8 +988,8 @@ CNcbiTestApplication::AddTestDependsOn(but::test_unit* tu,
 inline void
 CNcbiTestApplication::SetTestDisabled(but::test_unit* tu)
 {
-    if (but::runtime_config::test_to_run().empty()) {
-        tu->p_enabled.set(false);
+    if (CONFIGURED_FILTERS.empty()) {
+        s_SetEnabled(*tu, false);
         m_DisabledTests.insert(tu);
     }
 }
@@ -947,8 +1022,7 @@ string
 CNcbiTestApplication::x_GetTrimmedTestName(const string& test_name)
 {
     string new_name = test_name;
-    SIZE_TYPE pos = NStr::FindCase(new_name, "::", 0, new_name.size(),
-                                   NStr::eLast);
+    SIZE_TYPE pos = NStr::Find(new_name, "::", NStr::eCase, NStr::eReverseSearch);
     if (pos != NPOS) {
         new_name = new_name.substr(pos + 2);
     }
@@ -1007,13 +1081,13 @@ CNcbiTestApplication::x_ActualizeDeps(void)
 {
     ITERATE(TUnitToManyMap, it, m_TestDeps) {
         but::test_unit* test = it->first;
-        if (!m_DisabledTests.count(test) && !test->p_enabled) {
+        if (!m_DisabledTests.count(test) && !s_IsEnabled(*test)) {
             continue;
         }
 
         ITERATE(TUnitsSet, dep_it, it->second) {
             but::test_unit* dep_test = *dep_it;
-            if (!m_DisabledTests.count(dep_test) && !dep_test->p_enabled) {
+            if (!m_DisabledTests.count(dep_test) && !s_IsEnabled(*dep_test)) {
                 continue;
             }
 
@@ -1213,7 +1287,7 @@ CNcbiTestApplication::x_InitCommonParserVars(void)
     }
     // Split $FEATURES to tokens
     list<string> features_list;
-    NStr::Split(features_str, " ", features_list);
+    NStr::Split(features_str, " ", features_list, NStr::fSplit_Tokenize);
     // Convert list<> to set<> to speed up a search
     typedef set<string> TFeatures;
     TFeatures features;
@@ -1368,7 +1442,7 @@ CNcbiTestApplication::x_ReadConfiguration(void)
         but::test_unit* tu = GetTestUnit(test_name);
         if (tu) {
             list<CTempString> koef_lst;
-            NStr::Split(reg_value, ";", koef_lst);
+            NStr::Split(reg_value, ";", koef_lst, NStr::fSplit_NoMergeDelims);
             ITERATE(list<CTempString>, it_koef, koef_lst) {
                 CTempString koef_str, koef_cond;
                 if (NStr::SplitInTwo(*it_koef, ":", koef_str, koef_cond)) {
@@ -1401,8 +1475,8 @@ CNcbiTestApplication::x_EnableAllTests(bool enable)
 {
     ITERATE(TStringToUnitMap, it, m_AllTests) {
         but::test_unit* tu = it->second;
-        if (tu->p_type == but::tut_case) {
-            tu->p_enabled.set(enable);
+        if (tu->p_type == but::TUT_CASE) {
+            s_SetEnabled(*tu, enable);
 
             /*
             For full correctness this functionality should exist but it
@@ -1410,7 +1484,7 @@ CNcbiTestApplication::x_EnableAllTests(bool enable)
             then it will not be possible to get list of tests inside this
             suite to be included in the report.
 
-            if (enable  &&  tu->p_type == but::tut_suite) {
+            if (enable  &&  tu->p_type == but::TUT_SUITE) {
                 but::results_collector.results(tu->p_id).p_skipped = false;
             }
             */
@@ -1457,7 +1531,7 @@ CNcbiTestApplication::ReEnableAllTests(void)
     // Disabled tests can accidentally become not included in full list if
     // they were disabled in initialization
     ITERATE(TUnitsSet, it, m_DisabledTests) {
-        (*it)->p_enabled.set(true);
+        s_SetEnabled(**it, true);
     }
 }
 
@@ -1491,7 +1565,11 @@ CNcbiTestApplication::AdjustTestTimeout(but::test_unit* tu)
             CNcbiEnvironment env;
             printf("Maximum execution time of %s seconds is exceeded",
                    m_TimeoutStr.c_str());
+#if BOOST_VERSION >= 105900
+            raise(SIGALRM);
+#else
             throw but::test_being_aborted();
+#endif
         }
         new_timeout = (unsigned int)(m_Timeout - elapsed);
     }
@@ -1536,7 +1614,7 @@ CNcbiTestApplication::GetRanTestsCount(void)
     int result = 0;
     ITERATE(TStringToUnitMap, it, m_AllTests) {
         but::test_unit* tu = it->second;
-        if (tu->p_type.get() != but::tut_case)
+        if (tu->p_type != but::TUT_CASE)
             continue;
 
         string str = GetTestResultString(tu);
@@ -1567,7 +1645,8 @@ CNcbiTestApplication::IsTestToFix(const but::test_unit* tu)
 inline void
 CNcbiTestApplication::x_SetupBoostReporters(void)
 {
-    but::output_format format = but::runtime_config::report_format();
+    but::output_format format = RTCFG(but::output_format, REPORT_FORMAT,
+                                      report_format);
 
     CNcbiEnvironment env;
     string is_autobuild = env.Get("NCBI_AUTOMATED_BUILD");
@@ -1575,7 +1654,7 @@ CNcbiTestApplication::x_SetupBoostReporters(void)
         // There shouldn't be any message box in the automated build mode
         SuppressSystemMessageBox(fSuppress_All);
 
-        format = but::XML;
+        format = but::OF_XML;
         but::results_reporter::set_level(but::DETAILED_REPORT);
 
         string boost_rep = env.Get("NCBI_BOOST_REPORT_FILE");
@@ -1594,7 +1673,8 @@ CNcbiTestApplication::x_SetupBoostReporters(void)
     m_Reporter->SetOutputFormat(format);
     but::results_reporter::set_format(m_Reporter);
 
-    m_Logger->SetOutputFormat(but::runtime_config::log_format());
+    m_Logger->SetOutputFormat(RTCFG(but::output_format, LOG_FORMAT,
+                                    log_format));
     but::unit_test_log.set_formatter(m_Logger);
 }
 
@@ -1657,15 +1737,17 @@ CNcbiTestApplication::x_CollectAllTests(void)
 {
     m_AllTests.clear();
     CNcbiTestsCollector collector;
-    but::traverse_test_tree(but::framework::master_test_suite(), collector);
+    but::traverse_test_tree(but::framework::master_test_suite(), collector
+                            IGNORE_STATUS);
 }
 
 inline int
 CNcbiTestApplication::x_GetEnabledTestsCount(void)
 {
     but::test_case_counter tcc;
-    but::traverse_test_tree(but::framework::master_test_suite(), tcc);
-    return tcc.p_count;
+    but::traverse_test_tree(but::framework::master_test_suite(), tcc
+                            IGNORE_STATUS);
+    return (int)tcc.p_count;
 }
 
 but::test_suite*
@@ -1708,23 +1790,24 @@ CNcbiTestApplication::InitTestFramework(int argc, char* argv[])
         x_CollectAllTests();
 
         but::traverse_test_tree(but::framework::master_test_suite(),
-                                m_TreeBuilder);
+                                m_TreeBuilder IGNORE_STATUS);
 
         // We do not read configuration if particular tests were given in
         // command line
         if (x_CallUserFuncs(eTestUserFuncDeps)
-            &&  (!but::runtime_config::test_to_run().empty()
-                 ||  x_ReadConfiguration()))
+            &&  (!CONFIGURED_FILTERS.empty()  ||  x_ReadConfiguration()))
         {
             // Call should be doubled to support manual adding of
             // test cases inside NCBITEST_INIT_TREE().
             x_CollectAllTests();
+#if BOOST_VERSION < 105900
             if (x_GetEnabledTestsCount() == 0) {
                 SetGloballyDisabled();
                 x_AddDummyTest();
             }
+#endif
 #ifdef NCBI_COMPILER_WORKSHOP
-            else if (!but::runtime_config::test_to_run().empty()) {
+            else if (!CONFIGURED_FILTERS.empty()) {
                 printf("Parameter --run_test is not supported in current configuration\n");
                 x_EnableAllTests(false);
                 x_AddDummyTest();
@@ -1868,7 +1951,7 @@ CNcbiBoostReporter::test_unit_report_start(but::test_unit const&  tu,
                                         const_cast<but::test_unit*>(&tu));
 
     if (m_IsXML) {
-        ostr << '<' << (tu.p_type == but::tut_case ? "TestCase" : "TestSuite")
+        ostr << '<' << (tu.p_type == but::TUT_CASE ? "TestCase" : "TestSuite")
              << " name"   << but::attr_value() << tu.p_name.get()
              << " result" << but::attr_value() << descr;
 
@@ -1876,7 +1959,7 @@ CNcbiBoostReporter::test_unit_report_start(but::test_unit const&  tu,
     }
     else {
         ostr << std::setw( m_Indent ) << ""
-            << "Test " << (tu.p_type == but::tut_case ? "case " : "suite " )
+            << "Test " << (tu.p_type == but::TUT_CASE ? "case " : "suite " )
             << "\"" << tu.p_name << "\" " << descr;
 
         ostr << '\n';
@@ -1899,6 +1982,22 @@ void
 CNcbiBoostReporter::do_confirmation_report(but::test_unit const&  tu,
                                            std::ostream&          ostr)
 {
+#if BOOST_VERSION >= 105900
+    if (tu.p_type == but::TUT_SUITE  &&  tu.p_line_num == 0) {
+        but::test_results const& tr = but::results_collector.results(tu.p_id);
+
+        if ( !m_IsXML ) {
+            if (tr.p_test_cases_skipped > 0) {
+                ostr << "*** Skipped " << tr.p_test_cases_skipped
+                     << " test(s)\n";
+            } else if (tr.p_skipped) {
+                ostr << "*** Skipped some tests\n";
+            }
+        }
+        const_cast<bool&>(tr.p_skipped.get()) = false;
+        const_cast<but::counter_t&>(tr.p_test_cases_skipped.get()) = 0;
+    }
+#endif
     m_Upper->do_confirmation_report(tu, ostr);
 }
 
@@ -1949,7 +2048,21 @@ CNcbiBoostLogger::test_unit_skipped(ostream& ostr, but::test_unit const& tu)
     m_Upper->test_unit_skipped(ostr, tu);
 }
 
-#if BOOST_VERSION >= 104200
+#if BOOST_VERSION >= 105900
+void
+CNcbiBoostLogger::log_exception_start(ostream& ostr,
+                                      but::log_checkpoint_data const& lcd,
+                                      boost::execution_exception const& ex)
+{
+    m_Upper->log_exception_start(ostr, lcd, ex);
+}
+
+void
+CNcbiBoostLogger::log_exception_finish(ostream& ostr)
+{
+    m_Upper->log_exception_finish(ostr);
+}
+#elif BOOST_VERSION >= 104200
 void
 CNcbiBoostLogger::log_exception(ostream& ostr, but::log_checkpoint_data const& lcd,
                                 boost::execution_exception const& ex)
@@ -1984,6 +2097,23 @@ CNcbiBoostLogger::log_entry_finish(ostream& ostr)
     m_Upper->log_entry_finish(ostr);
 }
 
+#if BOOST_VERSION >= 105900
+void CNcbiBoostLogger::entry_context_start(ostream& ostr, but::log_level l)
+{
+    m_Upper->entry_context_start(ostr, l);
+}
+
+void CNcbiBoostLogger::log_entry_context(ostream& ostr,
+                                         but::const_string value)
+{
+    m_Upper->log_entry_context(ostr, value);
+}
+
+void CNcbiBoostLogger::entry_context_finish (ostream& ostr)
+{
+    m_Upper->entry_context_finish(ostr);
+}
+#endif
 
 void
 RegisterNcbiTestUserFunc(TNcbiTestUserFunction func,
@@ -2040,10 +2170,17 @@ END_NCBI_SCOPE
 
 using namespace but;
 
+static int    s_NcbiArgc;
+static char** s_NcbiArgv;
+
 /// Global initialization function called from Boost framework
 test_suite*
-init_unit_test_suite(int argc, char* argv[])
+init_unit_test_suite(int argc, char** argv)
 {
+    if (s_NcbiArgc > 0) {
+        argc = s_NcbiArgc;
+        argv = s_NcbiArgv;
+    }
     return NCBI_NS_NCBI::s_GetTestApp().InitTestFramework(argc, argv);
 }
 
@@ -2059,28 +2196,99 @@ init_unit_test_suite(int argc, char* argv[])
 #include "teamcity_boost.cpp"
 
 
-// This main() is mostly a copy from Boost's unit_test_main.ipp
+// This main() is based on a unification of code from various Boost versions'
+// unit_test_main.ipp, matching 1.60.0's where reasonably possible.
 int
 main(int argc, char* argv[])
 {
-    int result = boost::exit_success;
-
-    try {
+    int result_code = boost::exit_success;
+    bool made_report = false;
+
+    BOOST_TEST_I_TRY {
+#if BOOST_VERSION >= 106000
+        std::vector<char*> boost_args(1, argv[0]), ncbi_args;
+        for (int i = 0;  i < argc;  ++i) {
+            NCBI_NS_NCBI::CTempString s(argv[i]);
+            if (NCBI_NS_NCBI::NStr::StartsWith(s, "--")) {
+                boost_args.push_back(argv[i]);
+            } else if (s.size() == 2  &&  s[0] == '-'
+                       &&  s[1] >= 'a'  &&  s[1] <= 'z') {
+                boost_args.push_back(argv[i]);
+                if (i + 1 < argc  &&  argv[i+1][0] != '-') {
+                    boost_args.push_back(argv[++i]);
+                }
+            } else {
+                ncbi_args.push_back(argv[i]);
+            }
+        }
+        s_NcbiArgc = ncbi_args.size();
+        s_NcbiArgv = ncbi_args.data();
+        framework::init
+            (&init_unit_test_suite, boost_args.size(), boost_args.data());
+#else
         framework::init( &init_unit_test_suite, argc, argv );
+#endif
+
+#if BOOST_VERSION >= 105900
+        if( RTCFG(bool, WAIT_FOR_DEBUGGER, wait_for_debugger) ) {
+            results_reporter::get_stream() << "Press any key to continue..." << std::endl;
 
+            std::getchar();
+            results_reporter::get_stream() << "Continuing..." << std::endl;
+        }
+
+        framework::finalize_setup_phase();
+
+        output_format list_cont = RTCFG(output_format, LIST_CONTENT,
+                                        list_content);
+        if( list_cont != but::OF_INVALID ) {
+            if( list_cont == but::OF_DOT ) {
+                ut_detail::dot_content_reporter reporter( results_reporter::get_stream() );
+
+                traverse_test_tree( framework::master_test_suite().p_id, reporter, true );
+            }
+            else {
+                ut_detail::hrf_content_reporter reporter( results_reporter::get_stream() );
+
+                traverse_test_tree( framework::master_test_suite().p_id, reporter, true );
+            }
+
+            return boost::exit_success;
+        }
+
+        if( RTCFG(bool, LIST_LABELS, list_labels) ) {
+            ut_detail::labels_collector collector;
+
+            traverse_test_tree( framework::master_test_suite().p_id, collector, true );
+
+            results_reporter::get_stream() << "Available labels:\n  ";
+            std::copy( collector.labels().begin(), collector.labels().end(), 
+                       std::ostream_iterator<std::string>( results_reporter::get_stream(), "\n  " ) );
+            results_reporter::get_stream() << "\n";
+
+            return boost::exit_success;
+        }
+#else
         if( !runtime_config::test_to_run().is_empty() ) {
             test_case_filter filter( runtime_config::test_to_run() );
 
             traverse_test_tree( framework::master_test_suite().p_id, filter );
         }
+#endif
 
         framework::run();
 
-        // Let's try to make report in case of any error after all catches.
-        //results_reporter::make_report();
+        results_reporter::make_report();
+        made_report = true;
 
-        if (!runtime_config::no_result_code()) {
-            result = results_collector.results( framework::master_test_suite().p_id ).result_code();
+        if (
+#if BOOST_VERSION >= 106000
+            runtime_config::get<bool>( runtime_config::RESULT_CODE )
+#else
+            !runtime_config::no_result_code()
+#endif
+            ) {
+            result_code = results_collector.results( framework::master_test_suite().p_id ).result_code();
             if (!NCBI_NS_NCBI::s_GetTestApp().HasTestErrors()
                 &&  NCBI_NS_NCBI::s_GetTestApp().HasTestTimeouts())
             {
@@ -2090,36 +2298,48 @@ main(int argc, char* argv[])
                        " (for autobuild scripts: NCBI_UNITTEST_TIMEOUTS_BUT_NO_ERRORS)\n");
             }
         }
+
     }
-#if BOOST_VERSION >= 104200
-    catch( framework::nothing_to_test const& ) {
-        result = boost::exit_success;
+#if BOOST_VERSION >= 106000
+    BOOST_TEST_I_CATCH( framework::nothing_to_test, ex ) {
+        result_code = ex.m_result_code;
+    }
+#elif BOOST_VERSION >= 104200
+    BOOST_TEST_I_CATCH0( framework::nothing_to_test ) {
+        result_code = boost::exit_success;
     }
 #endif
-    catch( framework::internal_error const& ex ) {
+    BOOST_TEST_I_CATCH( framework::internal_error, ex ) {
         results_reporter::get_stream() << "Boost.Test framework internal error: " << ex.what() << std::endl;
-        
-        result = boost::exit_exception_failure;
+
+        result_code = boost::exit_exception_failure;
     }
-    catch( framework::setup_error const& ex ) {
+    BOOST_TEST_I_CATCH( framework::setup_error, ex ) {
         results_reporter::get_stream() << "Test setup error: " << ex.what() << std::endl;
-        
-        result = boost::exit_exception_failure;
+
+        result_code = boost::exit_exception_failure;
     }
-    catch( std::exception const& ex ) {
+    BOOST_TEST_I_CATCH( std::exception, ex ) {
         results_reporter::get_stream() << "Test framework error: " << ex.what() << std::endl;
 
-        result = boost::exit_exception_failure;
+        result_code = boost::exit_exception_failure;
     }
-    catch( ... ) {
+    BOOST_TEST_I_CATCHALL() {
         results_reporter::get_stream() << "Boost.Test framework internal error: unknown reason" << std::endl;
-        
-        result = boost::exit_exception_failure;
+
+        result_code = boost::exit_exception_failure;
     }
 
-    results_reporter::make_report();
+    // Report results now if an exception precluded doing so earlier.
+    if ( !made_report ) {
+        results_reporter::make_report();
+    }
+
+#if BOOST_VERSION >= 105900
+    framework::shutdown();
+#endif
 
     delete NCBI_NS_NCBI::s_TestApp;
-    NCBI_NS_NCBI::GetDiagContext().SetExitCode(result);
-    return result;
+    NCBI_NS_NCBI::GetDiagContext().SetExitCode(result_code);
+    return result_code;
 }
diff --git a/c++/src/corelib/test_mt.cpp b/c++/src/corelib/test_mt.cpp
index 8c62d2c..1e1d2e2 100644
--- a/c++/src/corelib/test_mt.cpp
+++ b/c++/src/corelib/test_mt.cpp
@@ -1,4 +1,4 @@
-/* $Id: test_mt.cpp 461873 2015-03-13 12:47:31Z vasilche $
+/* $Id: test_mt.cpp 488254 2015-12-29 13:56:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -55,10 +55,10 @@ int           s_SpawnBy    = 6;
 // Next test thread index
 static volatile unsigned int s_NextIndex = 0;
 
-#define TESTAPP_LOG_POST(x)  do { ++m_LogMsgCount; ERR_POST(x); } while (0)
+#define TESTAPP_LOG_POST(x)  do { ++m_LogMsgCount; LOG_POST(x); } while (0)
 
 /////////////////////////////////////////////////////////////////////////////
-// Randomization paramaters
+// Randomization parameters
 
 // if (rand() % 100 < threshold) then use cascading threads
 NCBI_PARAM_DECL(unsigned int, TEST_MT, Cascading);
@@ -86,8 +86,8 @@ public:
     static void StartCascadingThreads(void);
 
     CTestThread(int id);
-    virtual void SyncPoint(void) {
-    }
+    virtual void SyncPoint(void) {};
+    virtual void GlobalSyncPoint(void);
 
 protected:
     ~CTestThread(void);
@@ -108,9 +108,17 @@ public:
 };
 
 
+static CSemaphore           s_Semaphore(0, INT_MAX); /* For GlobalSyncPoint()*/
+static CAtomicCounter       s_SyncCounter;           /* For GlobalSyncPoint()*/
+static CAtomicCounter       s_NumberOfThreads;       /* For GlobalSyncPoint()*/
+
+
 CTestThread::CTestThread(int idx)
     : m_Idx(idx)
 {
+    /* We want to know total number of threads, and the easiest way is to make
+       them register themselves */
+    s_NumberOfThreads.Add(1);
     if ( s_Application != 0 )
         assert(s_Application->Thread_Init(m_Idx));
 }
@@ -118,6 +126,8 @@ CTestThread::CTestThread(int idx)
 
 CTestThread::~CTestThread(void)
 {
+    s_NumberOfThreads.Add(-1);
+    assert(s_NumberOfThreads.Get() >= 0);
     if ( s_Application != 0 )
         assert(s_Application->Thread_Destroy(m_Idx));
 }
@@ -130,6 +140,24 @@ void CTestThread::OnExit(void)
 }
 
 
+void CTestThread::GlobalSyncPoint(void)
+{
+    /* Semaphore is supposed to have zero value when threads come here,
+       so Wait() causes stop */
+    if (s_SyncCounter.Add(1) != s_NumberOfThreads.Get()) {
+        s_Semaphore.Wait();
+        return;
+    }
+    /* If we are the last thread to come to sync point, we yield 
+       so that threads that were waiting for us go first      */
+    if (s_NumberOfThreads.Get() > 1) {
+        s_Semaphore.Post((unsigned int)s_NumberOfThreads.Get() - 1);
+        s_SyncCounter.Set(0);
+        SleepMilliSec(0);
+    }
+}
+
+
 #ifdef USE_NATIVE_THREADS
 
 TWrapperRes NativeWrapper(TWrapperArg arg)
@@ -289,10 +317,11 @@ private:
     CFastMutex m_Mutex;
     unsigned int m_SyncCounter;
 };
-static CRef<CThreadGroup> thr_group[k_NumThreadsMax];
-static CStaticTls<int> s_ThreadIdxTLS;
 
 
+static CRef<CThreadGroup>   thr_group[k_NumThreadsMax];
+static CStaticTls<int>      s_ThreadIdxTLS;
+
 CInGroupThread::CInGroupThread(CThreadGroup& group, int id)
     : CTestThread(id), m_Group(group)
 {
@@ -307,6 +336,7 @@ void CInGroupThread::SyncPoint(void)
     m_Group.SyncPoint();
 }
 
+
 void* CInGroupThread::Main(void)
 {
     m_Group.ThreadWait();
@@ -343,6 +373,7 @@ CThreadGroup::~CThreadGroup(void)
 inline
 void CThreadGroup::Go(void)
 {
+    s_NumberOfThreads.Add(m_Number_of_threads);
     m_Semaphore.Post(m_Number_of_threads);
 }
 
@@ -368,9 +399,12 @@ void CThreadGroup::SyncPoint(void)
     }
 }
 
+
 inline
 void CThreadGroup::ThreadWait(void)
 {
+    s_NumberOfThreads.Add(-1);
+    assert(s_NumberOfThreads.Get() >= 0);
     m_Semaphore.Wait();
 }
 
@@ -471,13 +505,12 @@ int CThreadedApp::Run(void)
 
     s_SpawnBy = args["spawnby"].AsInteger();
 
-    //
     assert(TestApp_Init());
 
     unsigned int seed = GetArgs()["seed"]
-        ? (unsigned int) GetArgs()["seed"].AsInteger()
-        : ((unsigned int) CProcess::GetCurrentPid() ^
-           (unsigned int) time(NULL)) % 1000000;
+        ? static_cast<unsigned int>(GetArgs()["seed"].AsInteger())
+        : (static_cast<unsigned int>(CProcess::GetCurrentPid()) ^
+           static_cast<unsigned int>(time(NULL)) % 1000000);
     TESTAPP_LOG_POST("Randomization seed value: " << seed);
     srand(seed);
 
@@ -485,11 +518,10 @@ int CThreadedApp::Run(void)
     if (threshold > 100) {
         ERR_FATAL("Cascading threshold must be less than 100");
     }
-    bool cascading = ((unsigned int)(rand() % 100)) < threshold;
+    bool cascading = (static_cast<unsigned int>(rand() % 100)) < threshold;
 #if !defined(NCBI_THREADS)
     cascading = true;
 #endif
-
     if ( !cascading ) {
         x_InitializeThreadGroups();
         x_PrintThreadGroups();
@@ -578,17 +610,16 @@ void CThreadedApp::x_InitializeThreadGroups(void)
         ERR_FATAL("IntragroupSyncPoint threshold must be less than 100");
     }
 
-    unsigned int threads_left = s_NumThreads;
     for (unsigned int g = 0;  g < count;  ++g) {
         SThreadGroup group;
         // randomize intra-group sync points
         group.has_sync_point = ((unsigned int)(rand() % 100)) < threshold;
-        group.number_of_threads = 1; // mio
+        group.number_of_threads = 1;
         m_ThreadGroups.push_back(group);
     }
 
     if (s_NumThreads > count) {
-        threads_left = s_NumThreads - count;
+        unsigned int threads_left = s_NumThreads - count;
         for (unsigned int t = 0;  t < threads_left;  ++t) {
             // randomize # of threads
             m_ThreadGroups[ rand() % count ].number_of_threads += 1;
@@ -626,7 +657,7 @@ void CThreadedApp::x_PrintThreadGroups( void)
 
 unsigned int CThreadedApp::x_InitializeDelayedStart(void)
 {
-    const unsigned int count = (unsigned int)m_ThreadGroups.size();
+    const unsigned int count = static_cast<unsigned int>(m_ThreadGroups.size());
     unsigned int start_now = count;
     unsigned int g;
     if (m_Max == 0)
@@ -665,7 +696,6 @@ void CThreadedApp::x_StartThreadGroup(unsigned int count)
 }
 
 
-
 /////////////////////////////////////////////////////////////////////////////
 
 bool CThreadedApp::Thread_Init(int /*idx*/)
@@ -709,6 +739,24 @@ void CThreadedApp::TestApp_IntraGroupSyncPoint(void)
 }
 
 
+void CThreadedApp::TestApp_GlobalSyncPoint(void)
+{
+    {{
+        CFastMutexGuard LOCK(m_AppMutex);
+        if (!m_Delayed.empty()) {
+            TESTAPP_LOG_POST("There were delayed threads, running them now, "
+                "because TestApp_GlobalSyncPoint() was called");
+            for (size_t i = m_Reached.size(); i < m_Delayed.size(); i++) {
+                m_Reached.insert(NStr::SizetToString(i));
+                x_StartThreadGroup(m_Delayed[i]);
+            }
+        }
+    }}
+    int idx = static_cast<int>(intptr_t(s_ThreadIdxTLS.GetValue()));
+    thr[idx]->GlobalSyncPoint();
+}
+
+
 void CThreadedApp::SetNumberOfDelayedStartSyncPoints(
     unsigned int num_min, unsigned int num_max)
 {
diff --git a/c++/src/corelib/version.cpp b/c++/src/corelib/version.cpp
index 8e2a2c3..ec7250e 100644
--- a/c++/src/corelib/version.cpp
+++ b/c++/src/corelib/version.cpp
@@ -1,4 +1,4 @@
-/*  $Id: version.cpp 343034 2011-11-02 18:37:06Z ivanov $
+/*  $Id: version.cpp 492326 2016-02-16 19:38:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -450,21 +450,36 @@ string CComponentVersionInfo::Print(void) const
 }
 
 /////////////////////////////////////////////////////////////////////////////
+//  SBuildInfo
+
+SBuildInfo::SBuildInfo()
+    : date(__DATE__ " " __TIME__)
+#ifdef NCBI_BUILD_TAG
+    , tag(NCBI_AS_STRING(NCBI_BUILD_TAG))
+#endif
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
 //  CVersion
 
-CVersion::CVersion(void)
-    : m_VersionInfo( new CVersionInfo(0,0))
+CVersion::CVersion(const SBuildInfo& build_info)
+    : m_VersionInfo(new CVersionInfo(0,0)),
+      m_BuildInfo(build_info)
+
 {
 }
 
-CVersion::CVersion(const CVersionInfo& version)
-    : m_VersionInfo( new CVersionInfo(version) )
+CVersion::CVersion(const CVersionInfo& version, const SBuildInfo& build_info)
+    : m_VersionInfo(new CVersionInfo(version)),
+      m_BuildInfo(build_info)
 {
 }
 
 CVersion::CVersion(const CVersion& version)
     : m_VersionInfo( version.m_VersionInfo), 
-      m_Components ( version.m_Components)
+      m_Components(version.m_Components),
+      m_BuildInfo(version.m_BuildInfo)
 {
 }
 
@@ -475,9 +490,25 @@ void CVersion::SetVersionInfo( int  ver_major, int  ver_minor,
         ver_major, ver_minor, patch_level, ver_name) );
 }
 
-void CVersion::SetVersionInfo( CVersionInfo* version)
+void CVersion::SetVersionInfo( int  ver_major, int  ver_minor,
+                               int  patch_level, const string& ver_name,
+                               const SBuildInfo& build_info)
+{
+    m_VersionInfo.reset( new CVersionInfo(
+        ver_major, ver_minor, patch_level, ver_name) );
+    m_BuildInfo = build_info;
+}
+
+void CVersion::SetVersionInfo(CVersionInfo* version)
+{
+    m_VersionInfo.reset( version );
+}
+
+void CVersion::SetVersionInfo(CVersionInfo* version,
+        const SBuildInfo& build_info)
 {
     m_VersionInfo.reset( version );
+    m_BuildInfo = build_info;
 }
 
 const CVersionInfo& CVersion::GetVersionInfo(void) const
@@ -499,6 +530,11 @@ void CVersion::AddComponentVersion( CComponentVersionInfo* component)
     m_Components.push_back( AutoPtr<CComponentVersionInfo>( component ));
 }
 
+const SBuildInfo& CVersion::GetBuildInfo() const
+{
+    return m_BuildInfo;
+}
+
 string CVersion::GetPackageName(void)
 {
     return NCBI_PACKAGE_NAME;
@@ -516,31 +552,49 @@ string CVersion::GetPackageConfig(void)
     return NCBI_PACKAGE_CONFIG;
 }
 
+
 string CVersion::Print(const string& appname, TPrintFlags flags) const
 {
     CNcbiOstrstream os;
+
     if (flags & fVersionInfo) {
         os << appname << ": " << m_VersionInfo->Print() << endl;
     }
+
     if (flags & fComponents) {
-        ITERATE( vector< AutoPtr< CComponentVersionInfo> >, c, m_Components) {
+        ITERATE(vector< AutoPtr< CComponentVersionInfo> >, c, m_Components) {
             os << ' ' <<  (*c)->Print() << endl;
         }
     }
+
 #if NCBI_PACKAGE
     if (flags & ( fPackageShort | fPackageFull )) {
-        os << "Package: " << GetPackageName() << ' '
+        os << " Package: " << GetPackageName() << ' '
            << GetPackageVersion().Print() << ", build "
-           << __DATE__ << ' ' << __TIME__
+           << SBuildInfo().date
            << endl;
     }
-#ifdef NCBI_SIGNATURE
     if (flags & fPackageFull) {
-        os << ' ' << NCBI_SIGNATURE << endl;
-        os << ' ' << GetPackageConfig() << endl;
+        os << " Package-Config: " << ' ' << GetPackageConfig() << endl;
     }
 #endif
+
+#ifdef NCBI_SIGNATURE
+    if (flags & fBuildSignature) {
+        os << " Build-Signature: " << ' ' << NCBI_SIGNATURE << endl;
+    }
 #endif
+
+    if (flags & fBuildInfo) {
+        if (!m_BuildInfo.date.empty()) {
+            os << " Build-Date:  " << m_BuildInfo.date << endl;
+        }
+
+        if (!m_BuildInfo.tag.empty()) {
+            os << " Build-Tag:  " << m_BuildInfo.tag << endl;
+        }
+    }
+
     return CNcbiOstrstreamToString(os);
 }
 
diff --git a/c++/src/dbapi/blobstream.cpp b/c++/src/dbapi/blobstream.cpp
index 2836064..8b599df 100644
--- a/c++/src/dbapi/blobstream.cpp
+++ b/c++/src/dbapi/blobstream.cpp
@@ -1,4 +1,4 @@
-/* $Id: blobstream.cpp 426478 2014-02-10 19:48:45Z ucko $
+/* $Id: blobstream.cpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE                          
@@ -23,7 +23,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: blobstream.cpp 426478 2014-02-10 19:48:45Z ucko $
+* File Name:  $Id: blobstream.cpp 498367 2016-04-15 17:18:04Z ivanov $
 *
 * Author:  Michael Kholodov
 *   
@@ -57,7 +57,7 @@ CBlobIStream::~CBlobIStream()
 }
 
 CBlobOStream::CBlobOStream(CDB_Connection* connAux,
-                           I_ITDescriptor* desc,
+                           I_BlobDescriptor* desc,
                            size_t datasize, 
                            streamsize bufsize,
                            TBlobOStreamFlags flags,
diff --git a/c++/src/dbapi/blobstream.hpp b/c++/src/dbapi/blobstream.hpp
index 1e051f2..44943b9 100644
--- a/c++/src/dbapi/blobstream.hpp
+++ b/c++/src/dbapi/blobstream.hpp
@@ -1,7 +1,7 @@
 #ifndef _BLOBSTREAM_HPP_
 #define _BLOBSTREAM_HPP_
 
-/* $Id: blobstream.hpp 426478 2014-02-10 19:48:45Z ucko $
+/* $Id: blobstream.hpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE                          
@@ -26,7 +26,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: blobstream.hpp 426478 2014-02-10 19:48:45Z ucko $
+* File Name:  $Id: blobstream.hpp 498367 2016-04-15 17:18:04Z ivanov $
 *
 * Author:  Michael Kholodov
 *   
@@ -53,7 +53,7 @@ class CBlobOStream : public ostream
 public:
     
     CBlobOStream(CDB_Connection* connAux,
-	             I_ITDescriptor* desc,
+                 I_BlobDescriptor* desc,
                  size_t datasize, 
                  streamsize bufsize,
                  TBlobOStreamFlags flags,
@@ -69,7 +69,7 @@ public:
     virtual ~CBlobOStream();
     
 private:
-    I_ITDescriptor* m_desc;
+    I_BlobDescriptor* m_desc;
     CDB_Connection* m_conn;
     bool m_destroyConn;
 };
diff --git a/c++/src/dbapi/cache/dbapi_blob_cache.cpp b/c++/src/dbapi/cache/dbapi_blob_cache.cpp
index 02e4b72..ebb68d0 100644
--- a/c++/src/dbapi/cache/dbapi_blob_cache.cpp
+++ b/c++/src/dbapi/cache/dbapi_blob_cache.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dbapi_blob_cache.cpp 478145 2015-09-04 11:52:04Z ivanov $
+/*  $Id: dbapi_blob_cache.cpp 487444 2015-12-17 18:38:53Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -182,10 +182,8 @@ public:
                         int                      version,
                         const string&            subkey,
                         unsigned                 buf_size = kWriterBufferSize)
-    : m_GoodStateFlag(true),
-      m_Conn(conn),
+    : m_Conn(conn),
       m_Key(key),
-      m_Version(version),
       m_SubKey(subkey),
       m_Buffer(0),
       m_BytesInBuffer(0),
@@ -217,7 +215,7 @@ public:
                 } else { // use temp file instead
                     m_TmpFile.reset(
                         CFile::CreateTmpFileEx(m_TempDir, m_TempPrefix));
-                    for (unsigned i = 0; i < m_BlobSize;) {
+                    for (size_t i = 0; i < m_BlobSize;) {
                         char buf[1024];
                         size_t br = rs->Read(buf, sizeof(buf));
                         m_TmpFile->write(buf, br);
@@ -289,19 +287,17 @@ private:
     auto_ptr<fstream>     m_TmpFile;
     string                m_TempDir;
     string                m_TempPrefix;
-    bool                  m_GoodStateFlag; //!< Stream is in the good state
 
     IConnection*          m_Conn;
 
     string                m_Key;
-    int                   m_Version;
     string                m_SubKey;
 
     unsigned char*        m_Buffer;
-    unsigned int          m_BytesInBuffer;
-    unsigned int          m_BlobSize;
-    unsigned int          m_ReadPos;
-    unsigned int          m_MemBufferSize;
+    size_t                m_BytesInBuffer;
+    size_t                m_BlobSize;
+    size_t                m_ReadPos;
+    size_t                m_MemBufferSize;
 };
 
 
@@ -313,7 +309,7 @@ public:
                       const string&            key,
                       int                      version,
                       const string&            subkey,
-                      unsigned int             buffer_size = kWriterBufferSize)
+                      size_t                   buffer_size = kWriterBufferSize)
     : m_Cache(cache),
       m_TmpFile(0),
       m_GoodStateFlag(true),
@@ -363,7 +359,7 @@ public:
                 "Cannot call IWriter::Write after Flush");
         }
 
-        unsigned int new_buf_length = m_BytesInBuffer + count;
+        size_t new_buf_length = m_BytesInBuffer + count;
 
         if (m_Buffer) {
             // Filling the buffer while we can
@@ -544,8 +540,8 @@ private:
     string                m_SubKey;
 
     unsigned char*        m_Buffer;
-    unsigned int          m_BytesInBuffer;
-    unsigned int          m_MemBufferSize;
+    size_t                m_BytesInBuffer;
+    size_t                m_MemBufferSize;
 };
 
 
diff --git a/c++/src/dbapi/dbapi.cpp b/c++/src/dbapi/dbapi.cpp
index b98e02f..a9facd3 100644
--- a/c++/src/dbapi/dbapi.cpp
+++ b/c++/src/dbapi/dbapi.cpp
@@ -1,4 +1,4 @@
-/* $Id: dbapi.cpp 438402 2014-06-16 16:00:33Z ucko $
+/* $Id: dbapi.cpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE                          
@@ -23,7 +23,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: dbapi.cpp 438402 2014-06-16 16:00:33Z ucko $
+* File Name:  $Id: dbapi.cpp 498367 2016-04-15 17:18:04Z ivanov $
 *
 * Author:  Michael Kholodov
 *   
@@ -55,18 +55,29 @@ IConnection::~IConnection()
 {
 }
 
+size_t IConnection::GetTimeout(void) const
+{
+    return const_cast<IConnection*>(this)->GetCDB_Connection()->GetTimeout();
+}
+
+size_t IConnection::GetCancelTimeout(void) const
+{
+    return const_cast<IConnection*>(this)->GetCDB_Connection()
+        ->GetCancelTimeout();
+}
+
 IStatement::~IStatement()
 {
 }
 
-IWriter* IStatement::GetBlobWriter(I_ITDescriptor& d, size_t blob_size,
+IWriter* IStatement::GetBlobWriter(I_BlobDescriptor& d, size_t blob_size,
                                    EAllowLog log_it)
 {
     return GetBlobWriter(d, blob_size,
                          (log_it == eDisableLog) ? fBOS_SkipLogging : 0);
 }
 
-CNcbiOstream& IStatement::GetBlobOStream(I_ITDescriptor& d, size_t blob_size,
+CNcbiOstream& IStatement::GetBlobOStream(I_BlobDescriptor& d, size_t blob_size,
                                          EAllowLog log_it, size_t buf_size)
 {
     return GetBlobOStream(d, blob_size,
diff --git a/c++/src/dbapi/driver/Makefile.in b/c++/src/dbapi/driver/Makefile.in
index c48c8ad..797baae 100644
--- a/c++/src/dbapi/driver/Makefile.in
+++ b/c++/src/dbapi/driver/Makefile.in
@@ -1,7 +1,7 @@
-# $Id: Makefile.in 171052 2009-09-21 12:53:12Z ivanovp $
+# $Id: Makefile.in 487476 2015-12-17 19:48:39Z ucko $
 
 LIB_PROJ = dbapi_driver
-SUB_PROJ = util ctlib ftds64 dblib mysql odbc samples
+SUB_PROJ = util ctlib ftds64 ftds95 ftds-default dblib mysql odbc samples
 
 srcdir = @srcdir@
 include @builddir@/Makefile.meta
diff --git a/c++/src/dbapi/driver/dbapi_conn_factory.cpp b/c++/src/dbapi/driver/dbapi_conn_factory.cpp
index e47a7b0..b02e455 100644
--- a/c++/src/dbapi/driver/dbapi_conn_factory.cpp
+++ b/c++/src/dbapi/driver/dbapi_conn_factory.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dbapi_conn_factory.cpp 471064 2015-06-23 13:56:53Z fukanchi $
+/*  $Id: dbapi_conn_factory.cpp 470851 2015-06-19 16:29:01Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/dbapi/driver/dbapi_driver_conn_mgr.cpp b/c++/src/dbapi/driver/dbapi_driver_conn_mgr.cpp
index 31ab457..9a420db 100644
--- a/c++/src/dbapi/driver/dbapi_driver_conn_mgr.cpp
+++ b/c++/src/dbapi/driver/dbapi_driver_conn_mgr.cpp
@@ -1,4 +1,4 @@
-/* $Id: dbapi_driver_conn_mgr.cpp 403742 2013-06-18 15:26:09Z grichenk $
+/* $Id: dbapi_driver_conn_mgr.cpp 494592 2016-03-08 17:55:58Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -37,6 +37,9 @@
 #include <set>
 #include <map>
 #include <dbapi/driver/public.hpp>
+#include <dbapi/error_codes.hpp>
+
+#define NCBI_USE_ERRCODE_X   Dbapi_ConnMgr
 
 BEGIN_NCBI_SCOPE
 
@@ -122,7 +125,8 @@ IDBConnectionFactory::~IDBConnectionFactory(void)
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-CDbapiConnMgr::CDbapiConnMgr(void) : m_NumConnect(0)
+CDbapiConnMgr::CDbapiConnMgr(void)
+    : m_NumConnect(0), m_HasExplicitConnectionFactory(false)
 {
     m_ConnectFactory.Reset( new CDefaultConnectPolicy() );
 }
@@ -145,6 +149,29 @@ typedef NCBI_PARAM_TYPE(dbapi, max_connection) TDbapi_MaxConnection;
 NCBI_PARAM_DEF_EX(unsigned int, dbapi, max_connection, 100, eParam_NoThread, NULL);
 
 
+void CDbapiConnMgr::SetConnectionFactory(IDBConnectionFactory* factory,
+                                         EIfSet if_set)
+{
+    CFastMutexGuard mg(m_Mutex);
+    if (m_HasExplicitConnectionFactory) {
+        static const char* msg
+            = "A connection factory has already been explicitly registered.";
+        switch (if_set) {
+        case eIfSet_Replace:
+            break;
+        case eIfSet_KeepSilently:
+            return;
+        case eIfSet_KeepAndWarn:
+            ERR_POST_X(1, Warning << msg);
+            return;
+        case eIfSet_KeepAndThrow:
+            DATABASE_DRIVER_ERROR(msg, 301);
+        }
+    }
+    m_HasExplicitConnectionFactory = true;
+    m_ConnectFactory.Reset(factory);
+}
+
 void CDbapiConnMgr::SetMaxConnect(unsigned int max_connect)
 {
     TDbapi_MaxConnection::SetDefault(max_connect);
@@ -157,7 +184,7 @@ unsigned int CDbapiConnMgr::GetMaxConnect(void)
 
 bool CDbapiConnMgr::AddConnect(void)
 {
-    CMutexGuard mg(m_Mutex);
+    CFastMutexGuard mg(m_Mutex);
 
     if (m_NumConnect >= GetMaxConnect())
         return false;
@@ -168,7 +195,7 @@ bool CDbapiConnMgr::AddConnect(void)
 
 void CDbapiConnMgr::DelConnect(void)
 {
-    CMutexGuard mg(m_Mutex);
+    CFastMutexGuard mg(m_Mutex);
 
     if (m_NumConnect > 0)
         --m_NumConnect;
diff --git a/c++/src/dbapi/driver/dbapi_driver_conn_params.cpp b/c++/src/dbapi/driver/dbapi_driver_conn_params.cpp
index 379e495..2b76a0a 100644
--- a/c++/src/dbapi/driver/dbapi_driver_conn_params.cpp
+++ b/c++/src/dbapi/driver/dbapi_driver_conn_params.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dbapi_driver_conn_params.cpp 441728 2014-07-28 15:00:40Z ucko $
+/*  $Id: dbapi_driver_conn_params.cpp 488796 2016-01-05 20:20:40Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -401,7 +401,7 @@ void CDBUriConnParams::ParseParamPairs(const string& param_pairs, size_t cur_pos
     string key;
     string value;
 
-    NStr::Tokenize(param_pairs, "&", arr_param);
+    NStr::Split(param_pairs, "&", arr_param, NStr::fSplit_NoMergeDelims);
 
     ITERATE(vector<string>, it, arr_param) {
         if (NStr::SplitInTwo(*it, "=", key, value)) {
@@ -423,7 +423,7 @@ CDB_ODBC_ConnParams::CDB_ODBC_ConnParams(const string& params)
     string key;
     string value;
 
-    NStr::Tokenize(params, ";", arr_param);
+    NStr::Split(params, ";", arr_param, NStr::fSplit_NoMergeDelims);
 
     ITERATE(vector<string>, it, arr_param) {
         if (NStr::SplitInTwo(*it, "=", key, value)) {
@@ -587,7 +587,8 @@ CDBInterfacesFileConnParams::CDBInterfacesFileConnParams(
             if (state == eKeyRead) {
                 NStr::TruncateSpacesInPlace(line);
                 arr_param.clear();
-                NStr::Tokenize(line, "\t ", arr_param);
+                NStr::Split(line, "\t ", arr_param,
+                            NStr::fSplit_NoMergeDelims);
 
                 if (NStr::Equal(arr_param[0], "query")) {
                     if (NStr::Equal(arr_param[1], "tli")) {
@@ -632,7 +633,8 @@ CDBInterfacesFileConnParams::CDBInterfacesFileConnParams(
                 } else {
                     NStr::TruncateSpacesInPlace(host_str);
                     arr_param.clear();
-                    NStr::Tokenize(host_str, ".", arr_param);
+                    NStr::Split(host_str, ".", arr_param,
+                                NStr::fSplit_NoMergeDelims);
 
                     b[0] = NStr::StringToUInt(arr_param[0]);
                     b[1] = NStr::StringToUInt(arr_param[1]);
@@ -724,7 +726,7 @@ CDBConnParams::EServerType
 CCPPToolkitConnParams::GetServerType(const CTempString& server_name)
 {
     // Artificial intelligence ...
-    if (NStr::CompareNocase(server_name, 0, 13, "DBAPI_MS_TEST") == 0
+    if (NStr::CompareNocase(server_name, 0, 8, "DBAPI_MS") == 0
         || NStr::CompareNocase(server_name, 0, 5, "MSSQL") == 0
         || NStr::CompareNocase(server_name, 0, 5, "MSDEV") == 0
         || NStr::CompareNocase(server_name, 0, 7, "OAMSDEV") == 0
diff --git a/c++/src/dbapi/driver/dbapi_driver_convert.cpp b/c++/src/dbapi/driver/dbapi_driver_convert.cpp
index 1e2b444..8c10c3f 100644
--- a/c++/src/dbapi/driver/dbapi_driver_convert.cpp
+++ b/c++/src/dbapi/driver/dbapi_driver_convert.cpp
@@ -197,8 +197,12 @@ CValueConvert<SRunTimeCP, CDB_Result>::operator string(void) const
     //     return ConvertFrom<TO, CDB_SmallDateTime>();
     case eDB_Text:
         return ConvertFromLOB<TO, CDB_Text>();
+    case eDB_VarCharMax:
+        return ConvertFromLOB<TO, CDB_VarCharMax>();
     case eDB_Image:
         return ConvertFromLOB<TO, CDB_Image>();
+    case eDB_VarBinaryMax:
+        return ConvertFromLOB<TO, CDB_VarBinaryMax>();
     case eDB_Bit: 
         return ConvertFrom<TO, CDB_Bit>();
     case eDB_Numeric:
@@ -259,8 +263,12 @@ CValueConvert<SRunTimeCP, CDB_Result>::operator CTime(void) const
     //     return Convert2CTime<TO, CDB_SmallDateTime>();
     case eDB_Text:
         return ConvertFromLOB<TO, CDB_Text>();
+    case eDB_VarCharMax:
+        return ConvertFromLOB<TO, CDB_VarCharMax>();
     case eDB_Image:
         return ConvertFromLOB<TO, CDB_Image>();
+    case eDB_VarBinaryMax:
+        return ConvertFromLOB<TO, CDB_VarBinaryMax>();
     case eDB_Bit: 
         return Convert2CTime<TO, CDB_Bit>();
     case eDB_Numeric:
@@ -458,8 +466,12 @@ CValueConvert<SRunTimeSqlCP, CDB_Result>::operator string(void) const
     //     return ConvertFrom<TO, CDB_SmallDateTime>();
     case eDB_Text:
         return ConvertFromLOB<TO, CDB_Text>();
+    case eDB_VarCharMax:
+        return ConvertFromLOB<TO, CDB_VarCharMax>();
     case eDB_Image:
         return ConvertFromLOB<TO, CDB_Image>();
+    case eDB_VarBinaryMax:
+        return ConvertFromLOB<TO, CDB_VarBinaryMax>();
     case eDB_Bit: 
         return ConvertFrom<TO, CDB_Bit>();
     case eDB_Numeric:
@@ -522,6 +534,10 @@ CValueConvert<SRunTimeSqlCP, CDB_Result>::operator CTime(void) const
         return ConvertFromLOB<TO, CDB_Text>();
     case eDB_Image:
         return ConvertFromLOB<TO, CDB_Image>();
+    case eDB_VarCharMax:
+        return ConvertFromLOB<TO, CDB_VarCharMax>();
+    case eDB_VarBinaryMax:
+        return ConvertFromLOB<TO, CDB_VarBinaryMax>();
     case eDB_Bit: 
         return Convert2CTime<TO, CDB_Bit>();
     case eDB_Numeric:
diff --git a/c++/src/dbapi/driver/dbapi_driver_utils.cpp b/c++/src/dbapi/driver/dbapi_driver_utils.cpp
index 875acd8..20ae4dd 100644
--- a/c++/src/dbapi/driver/dbapi_driver_utils.cpp
+++ b/c++/src/dbapi/driver/dbapi_driver_utils.cpp
@@ -1,4 +1,4 @@
-/* $Id: dbapi_driver_utils.cpp 447074 2014-09-22 14:45:33Z ucko $
+/* $Id: dbapi_driver_utils.cpp 487444 2015-12-17 18:38:53Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -271,7 +271,7 @@ unsigned int CCachedRowInfo::FindParamPosInternal(const string& name) const
 
     const size_t param_num = m_Info.size();
 
-    for (size_t i = 0; i < param_num; ++i) {
+    for (unsigned int i = 0; i < param_num; ++i) {
         if (m_Info[i].m_Name == name) {
             return i;
         }
@@ -426,7 +426,8 @@ CRowInfo_SP_SQL_Server::Initialize(void) const
 			{
 				vector<string> arr_param;
 
-				NStr::Tokenize(GetSPName(), ".", arr_param);
+                NStr::Split(GetSPName(), ".", arr_param,
+                            NStr::fSplit_NoMergeDelims);
 				size_t pos = 0;
 
 				switch (arr_param.size()) {
diff --git a/c++/src/dbapi/driver/dbapi_impl_cmd.cpp b/c++/src/dbapi/driver/dbapi_impl_cmd.cpp
index 37ed64a..7c1eb81 100644
--- a/c++/src/dbapi/driver/dbapi_impl_cmd.cpp
+++ b/c++/src/dbapi/driver/dbapi_impl_cmd.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dbapi_impl_cmd.cpp 441150 2014-07-21 19:10:46Z ucko $
+/*  $Id: dbapi_impl_cmd.cpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -223,10 +223,10 @@ CBaseCmd::Update(const string& /* table_name */, const string& /* upd_query */)
 
 
 bool
-CBaseCmd::UpdateTextImage(unsigned int /* item_num */,
-                          CDB_Stream& /* data */,
-                          bool /* log_it */
-                          )
+CBaseCmd::UpdateBlob(unsigned int /* item_num */,
+                     CDB_Stream& /* data */,
+                     bool /* log_it */
+                     )
 {
     _ASSERT(false);
     return false;
diff --git a/c++/src/dbapi/driver/dbapi_impl_connection.cpp b/c++/src/dbapi/driver/dbapi_impl_connection.cpp
index a290e15..b8f6298 100644
--- a/c++/src/dbapi/driver/dbapi_impl_connection.cpp
+++ b/c++/src/dbapi/driver/dbapi_impl_connection.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dbapi_impl_connection.cpp 480564 2015-10-01 16:54:20Z ivanov $
+/*  $Id: dbapi_impl_connection.cpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -336,11 +336,23 @@ void CConnection::ReleaseInterface(void)
 }
 
 
-void CConnection::SetTextImageSize(size_t /* nof_bytes */)
+void CConnection::SetBlobSize(size_t /* nof_bytes */)
 {
 }
 
 
+size_t CConnection::GetTimeout(void) const
+{
+    return GetCDriverContext().GetTimeout();
+}
+
+
+size_t CConnection::GetCancelTimeout(void) const
+{
+    return GetCDriverContext().GetCancelTimeout();
+}
+
+
 bool
 CConnection::IsMultibyteClientEncoding(void) const
 {
diff --git a/c++/src/dbapi/driver/dbapi_impl_context.cpp b/c++/src/dbapi/driver/dbapi_impl_context.cpp
index 1836101..c0da2cb 100644
--- a/c++/src/dbapi/driver/dbapi_impl_context.cpp
+++ b/c++/src/dbapi/driver/dbapi_impl_context.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dbapi_impl_context.cpp 481035 2015-10-06 16:46:46Z ivanov $
+/*  $Id: dbapi_impl_context.cpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -69,7 +69,7 @@ CDriverContext::CDriverContext(void) :
     m_LoginTimeout(0),
     m_Timeout(0),
     m_CancelTimeout(0),
-    m_MaxTextImageSize(0),
+    m_MaxBlobSize(0),
     m_ClientEncoding(eEncoding_ISO8859_1)
 {
     PushCntxMsgHandler    ( &CDB_UserHandler::GetDefault(), eTakeOwnership );
@@ -175,13 +175,13 @@ bool CDriverContext::SetCancelTimeout(unsigned int nof_secs)
     return success;
 }
 
-bool CDriverContext::SetMaxTextImageSize(size_t nof_bytes)
+bool CDriverContext::SetMaxBlobSize(size_t nof_bytes)
 {
     CMutexGuard mg(x_GetCtxMtx());
 
-    m_MaxTextImageSize = nof_bytes;
+    m_MaxBlobSize = nof_bytes;
 
-    UpdateConnMaxTextImageSize();
+    UpdateConnMaxBlobSize();
 
     return true;
 }
@@ -235,6 +235,10 @@ void CDriverContext::ResetEnvSybase(void)
     // If user forces his own Sybase client path using $RESET_SYBASE
     // and $SYBASE -- use that unconditionally.
     try {
+        if (env.Get("LC_ALL") == "POSIX") {
+            // Canonicalize, since locales.dat might list C but not POSIX.
+            env.Set("LC_ALL", "C");
+        }
         if (!env.Get("SYBASE").empty()) {
             string reset = env.Get("RESET_SYBASE");
             if ( !reset.empty() && NStr::StringToBool(reset)) {
@@ -792,9 +796,21 @@ CDriverContext::ReadDBConfParams(const string&  service_name,
         params->flags += SDBConfParams::fUsernameSet;
         params->username = reg.Get(section_name, "username");
     }
+    if (reg.HasEntry(section_name, "password_key", IRegistry::fCountCleared)) {
+        params->flags += SDBConfParams::fPasswordKeySet;
+        params->password_key_id = reg.Get(section_name, "password_key");
+    }
     if (reg.HasEntry(section_name, "password", IRegistry::fCountCleared)) {
         params->flags += SDBConfParams::fPasswordSet;
         params->password = reg.Get(section_name, "password");
+        if (CNcbiEncrypt::IsEncrypted(params->password)) {
+            try {
+                params->password = CNcbiEncrypt::Decrypt(params->password);
+            } NCBI_CATCH("Password decryption for " + service_name);
+        } else if (params->password_key_id.empty()) {
+            ERR_POST(Warning
+                     << "Using unencrypted password for " + service_name);
+        }
     }
     if (reg.HasEntry(section_name, "password_file",
                      IRegistry::fCountCleared)) {
@@ -804,10 +820,6 @@ CDriverContext::ReadDBConfParams(const string&  service_name,
         params->flags += SDBConfParams::fPasswordFileSet;
         params->password_file = reg.Get(section_name, "password_file");
     }
-    if (reg.HasEntry(section_name, "password_key", IRegistry::fCountCleared)) {
-        params->flags += SDBConfParams::fPasswordKeySet;
-        params->password_key_id = reg.Get(section_name, "password_key");
-    }
     if (reg.HasEntry(section_name, "login_timeout", IRegistry::fCountCleared)) {
         params->flags += SDBConfParams::fLoginTimeoutSet;
         params->login_timeout = reg.Get(section_name, "login_timeout");
@@ -1187,7 +1199,7 @@ void CDriverContext::UpdateConnTimeout(void) const
 }
 
 
-void CDriverContext::UpdateConnMaxTextImageSize(void) const
+void CDriverContext::UpdateConnMaxBlobSize(void) const
 {
     // Do not protect this method. It is protected.
 
@@ -1195,14 +1207,14 @@ void CDriverContext::UpdateConnMaxTextImageSize(void) const
         CConnection* t_con = *it;
         if (!t_con) continue;
 
-        t_con->SetTextImageSize(GetMaxTextImageSize());
+        t_con->SetBlobSize(GetMaxBlobSize());
     }
 
     ITERATE(TConnPool, it, m_InUse) {
         CConnection* t_con = *it;
         if (!t_con) continue;
 
-        t_con->SetTextImageSize(GetMaxTextImageSize());
+        t_con->SetBlobSize(GetMaxBlobSize());
     }
 }
 
diff --git a/c++/src/dbapi/driver/dbapi_object_convert.cpp b/c++/src/dbapi/driver/dbapi_object_convert.cpp
index c26d1aa..ad50f70 100644
--- a/c++/src/dbapi/driver/dbapi_object_convert.cpp
+++ b/c++/src/dbapi/driver/dbapi_object_convert.cpp
@@ -1,4 +1,4 @@
-/* $Id: dbapi_object_convert.cpp 420801 2013-12-05 16:20:55Z ucko $
+/* $Id: dbapi_object_convert.cpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -310,6 +310,8 @@ CValueConvert<SSafeCP, CDB_Object>::operator string(void) const
             ));
         case eDB_Text:
         case eDB_Image: 
+        case eDB_VarCharMax:
+        case eDB_VarBinaryMax:            
             {
                 CDB_Stream& strm = const_cast<CDB_Stream&>(static_cast<const CDB_Stream&>(m_Value));
                 result.resize(strm.Size());
@@ -573,6 +575,8 @@ CValueConvert<SSafeSqlCP, CDB_Object>::operator string(void) const
             ));
         case eDB_Text:
         case eDB_Image: 
+        case eDB_VarCharMax:
+        case eDB_VarBinaryMax:            
             {
                 CDB_Stream& strm = const_cast<CDB_Stream&>(static_cast<const CDB_Stream&>(m_Value));
                 result.resize(strm.Size());
@@ -668,6 +672,8 @@ TO Convert_CDB_Object(const CDB_Object& value)
             ));
         case eDB_Text:
         case eDB_Image: 
+        case eDB_VarCharMax:
+        case eDB_VarBinaryMax:            
             {
                 string result;
                 CDB_Stream& strm = const_cast<CDB_Stream&>(static_cast<const CDB_Stream&>(value));
@@ -833,7 +839,9 @@ TO Convert_CDB_ObjectSql(const CDB_Object& value)
                 static_cast<const CDB_LongBinary&>(value).DataSize()
             ));
         case eDB_Text:
-        case eDB_Image: 
+        case eDB_Image:
+        case eDB_VarCharMax:
+        case eDB_VarBinaryMax:            
             {
                 string result;
                 CDB_Stream& strm = const_cast<CDB_Stream&>(static_cast<const CDB_Stream&>(value));
diff --git a/c++/src/dbapi/driver/dbapi_svc_mapper.cpp b/c++/src/dbapi/driver/dbapi_svc_mapper.cpp
index 9021068..ecd741c 100644
--- a/c++/src/dbapi/driver/dbapi_svc_mapper.cpp
+++ b/c++/src/dbapi/driver/dbapi_svc_mapper.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dbapi_svc_mapper.cpp 414127 2013-09-20 16:02:32Z ucko $
+/*  $Id: dbapi_svc_mapper.cpp 485360 2015-11-20 17:03:34Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -341,11 +341,12 @@ CDBUDRandomMapper::ConfigureFromRegistry(const IRegistry* registry)
             vector<string> server_name;
             string service_name = *cit;
 
-            NStr::Tokenize(registry->GetString(section_name,
-                                               service_name,
-                                               service_name),
-                           " ,;",
-                           server_name);
+            NStr::Split(registry->GetString(section_name,
+                                            service_name,
+                                            service_name),
+                        " ,;",
+                        server_name,
+                        NStr::fSplit_MergeDelimiters);
 
             // Replace with new data ...
             if (!server_name.empty()) {
@@ -616,11 +617,12 @@ CDBUDPriorityMapper::ConfigureFromRegistry(const IRegistry* registry)
             vector<string> server_name;
             string service_name = *cit;
 
-            NStr::Tokenize(registry->GetString(section_name,
-                                               service_name,
-                                               service_name),
-                           " ,;",
-                           server_name);
+            NStr::Split(registry->GetString(section_name,
+                                            service_name,
+                                            service_name),
+                        " ,;",
+                        server_name,
+                        NStr::fSplit_MergeDelimiters);
 
             // Replace with new data ...
             if (!server_name.empty()) {
@@ -826,11 +828,12 @@ CDBUniversalMapper::ConfigureFromRegistry(const IRegistry* registry)
 
     if (registry) {
 
-        NStr::Tokenize(registry->GetString
+        NStr::Split(registry->GetString
                     (section_name, "MAPPERS",
                         def_mapper_name),
                     " ,;",
-                    service_name);
+                    service_name,
+                    NStr::fSplit_MergeDelimiters);
 
     } else {
         service_name.push_back(def_mapper_name);
diff --git a/c++/src/dbapi/driver/interfaces.cpp b/c++/src/dbapi/driver/interfaces.cpp
index 10b9658..2f73e97 100644
--- a/c++/src/dbapi/driver/interfaces.cpp
+++ b/c++/src/dbapi/driver/interfaces.cpp
@@ -1,4 +1,4 @@
-/* $Id: interfaces.cpp 423263 2014-01-02 17:57:22Z ucko $
+/* $Id: interfaces.cpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -132,7 +132,7 @@ string CDBConnParamsDelegate::GetParam(const string& key) const
 
 
 ////////////////////////////////////////////////////////////////////////////
-I_ITDescriptor::~I_ITDescriptor(void)
+I_BlobDescriptor::~I_BlobDescriptor(void)
 {
     return;
 }
diff --git a/c++/src/dbapi/driver/memory_store.cpp b/c++/src/dbapi/driver/memory_store.cpp
index 7107ec9..ecdf9e9 100644
--- a/c++/src/dbapi/driver/memory_store.cpp
+++ b/c++/src/dbapi/driver/memory_store.cpp
@@ -1,4 +1,4 @@
-/*  $Id: memory_store.cpp 461604 2015-03-11 15:24:58Z ucko $
+/*  $Id: memory_store.cpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -166,6 +166,29 @@ size_t CMemStore::Peek(void* buff, size_t size) const
 }
 
 
+size_t CMemStore::PeekAt(void* buff, size_t start, size_t size) const
+{
+    // Work with a shallow copy to avoid code duplication.
+    CMemStore ms2(m_BlockSize);
+    ms2.m_First    = m_First;
+    ms2.m_Current  = m_Current;
+    ms2.m_Pos      = m_Pos;
+    ms2.m_BlockPos = m_BlockPos;
+    ms2.m_Size     = m_Size;
+    // Set m_Last for the sake of Seek, but make sure it winds up NULL
+    // to avoid premature cleanup.
+    try {
+        ms2.m_Last = m_Last;
+        ms2.Seek(start, eHead);
+    } catch (...) {
+        ms2.m_Last = NULL;
+        throw;
+    }
+    ms2.m_Last = NULL;
+    return ms2.Read(buff, size);
+}
+
+
 CMemStore::TSize CMemStore::x_SeekCURR(CMemStore::TSize offset)
 {
     if ( !m_Current )
diff --git a/c++/src/dbapi/driver/memory_store.hpp b/c++/src/dbapi/driver/memory_store.hpp
index 8dfe1f8..f5e8923 100644
--- a/c++/src/dbapi/driver/memory_store.hpp
+++ b/c++/src/dbapi/driver/memory_store.hpp
@@ -1,7 +1,7 @@
 #ifndef DBAPI_DRIVER___MEMORY_STORE__HPP
 #define DBAPI_DRIVER___MEMORY_STORE__HPP
 
-/*  $Id: memory_store.hpp 441148 2014-07-21 18:58:42Z ucko $
+/*  $Id: memory_store.hpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -98,6 +98,7 @@ public:
 
     size_t Read        (void*       buff, size_t nof_bytes);
     size_t Peek        (void*       buff, size_t nof_bytes) const;
+    size_t PeekAt      (void*       buff, size_t start, size_t n) const;
     size_t Append      (const void* buff, size_t nof_bytes);
     size_t Write       (const void* buff, size_t nof_bytes);
     size_t Insert      (const void* buff, size_t nof_bytes);
diff --git a/c++/src/dbapi/driver/odbc/bcp.cpp b/c++/src/dbapi/driver/odbc/bcp.cpp
index ca76b90..bee0c8e 100644
--- a/c++/src/dbapi/driver/odbc/bcp.cpp
+++ b/c++/src/dbapi/driver/odbc/bcp.cpp
@@ -1,4 +1,4 @@
-/* $Id: bcp.cpp 440505 2014-07-14 19:00:33Z ucko $
+/* $Id: bcp.cpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -71,7 +71,7 @@ CODBC_BCPInCmd::CODBC_BCPInCmd(CODBC_Connection& conn,
                                const string&     table_name) :
     CStatementBase(conn, table_name),
     m_Cmd(cmd),
-    m_HasTextImage(false),
+    m_HasBlob(false),
     m_WasBound(false)
 {
     string extra_msg = "Table Name: " + table_name;
@@ -151,6 +151,7 @@ CODBC_BCPInCmd::x_GetBCPDataType(EDB_Type type)
         bcp_datatype = SQLDATETIME;
         break;
     case eDB_Text:
+    case eDB_VarCharMax:
 //TODO: Make different type depending on type of underlying column
 /*#ifdef UNICODE
         bcp_datatype = SQLNTEXT;
@@ -159,8 +160,12 @@ CODBC_BCPInCmd::x_GetBCPDataType(EDB_Type type)
 //#endif
         break;
     case eDB_Image:
+    case eDB_VarBinaryMax:
         bcp_datatype = SQLIMAGE;
         break;
+    case eDB_Bit:
+        bcp_datatype = SQLBIT;
+        break;
     default:
         break;
     }
@@ -177,6 +182,7 @@ CODBC_BCPInCmd::x_GetDataTermSize(EDB_Type type)
     case eDB_VarChar:
     case eDB_LongChar:
     case eDB_Text:
+    case eDB_VarCharMax:
         return sizeof(odbc::TChar);
     default:
         break;
@@ -194,6 +200,7 @@ CODBC_BCPInCmd::x_GetDataTerminator(EDB_Type type)
     case eDB_VarChar:
     case eDB_LongChar:
     case eDB_Text:
+    case eDB_VarCharMax:
         return _T_NCBI_ODBC("");
     default:
         break;
@@ -203,18 +210,11 @@ CODBC_BCPInCmd::x_GetDataTerminator(EDB_Type type)
 }
 
 
+inline
 const void*
 CODBC_BCPInCmd::x_GetDataPtr(EDB_Type type, void* pb)
 {
-    switch (type) {
-    case eDB_Text:
-    case eDB_Image:
-        return NULL;
-    default:
-        break;
-    }
-
-    return pb;
+    return CDB_Object::IsBlobType(type) ? NULL : pb;
 }
 
 
@@ -226,6 +226,7 @@ CODBC_BCPInCmd::x_GetBCPDataSize(EDB_Type type)
     case eDB_Binary:
     case eDB_VarBinary:
     case eDB_LongBinary:
+    case eDB_VarBinaryMax:
         return 1;
     default:
         break;
@@ -257,7 +258,7 @@ bool CODBC_BCPInCmd::x_AssignParams(void* pb)
                              x_GetBCPDataType(data_type),
                              i + 1);
 
-                m_HasTextImage = m_HasTextImage || (data_type == eDB_Image || data_type == eDB_Text);
+                m_HasBlob = m_HasBlob || CDB_Object::IsBlobType(data_type);
             }
 
             if (r != SUCCEED) {
@@ -278,9 +279,15 @@ bool CODBC_BCPInCmd::x_AssignParams(void* pb)
             CDB_Object& param = *GetBindParamsImpl().GetParam(i);
 
             switch ( param.GetType() ) {
-            case eDB_Bit:
-                DATABASE_DRIVER_ERROR("Bit data type is not supported", 10005);
+            case eDB_Bit: {
+                CDB_Bit& val = dynamic_cast<CDB_Bit&> (param);
+                r = bcp_colptr(GetHandle(), (BYTE*) val.BindVal(), i + 1)
+                    == SUCCEED &&
+                    bcp_collen(GetHandle(), val.IsNULL() ? SQL_NULL_DATA : 1, i + 1)
+                    == SUCCEED ? SUCCEED : FAIL;
+
                 break;
+            }
             case eDB_Int: {
                 CDB_Int& val = dynamic_cast<CDB_Int&> (param);
                 r = bcp_colptr(GetHandle(), (BYTE*) val.BindVal(), i + 1)
@@ -430,8 +437,9 @@ bool CODBC_BCPInCmd::x_AssignParams(void* pb)
                 pb = (void*) (dt + 1);
             }
             break;
-            case eDB_Text: {
-                CDB_Text& val = dynamic_cast<CDB_Text&> (param);
+            case eDB_Text:
+            case eDB_VarCharMax: {
+                CDB_Stream& val = dynamic_cast<CDB_Stream&> (param);
                 if (val.IsNULL()) {
                     r = bcp_colptr(GetHandle(), (BYTE*) pb, i + 1)
                         == SUCCEED &&
@@ -440,15 +448,18 @@ bool CODBC_BCPInCmd::x_AssignParams(void* pb)
                 }
                 else {
                     r = bcp_bind(GetHandle(), (BYTE*) NULL, 0, (DBINT) val.Size(),
-                                 static_cast<LPCBYTE>(x_GetDataTerminator(eDB_Text)),
-                                 static_cast<INT>(x_GetDataTermSize(eDB_Text)),
-                                 x_GetBCPDataType(eDB_Text),
+                                 static_cast<LPCBYTE>(x_GetDataTerminator
+                                                      (param.GetType())),
+                                 static_cast<INT>(x_GetDataTermSize
+                                                  (param.GetType())),
+                                 x_GetBCPDataType(param.GetType()),
                                  i + 1);
                 }
             }
             break;
-            case eDB_Image: {
-                CDB_Image& val = dynamic_cast<CDB_Image&> (param);
+            case eDB_Image:
+            case eDB_VarBinaryMax: {
+                CDB_Stream& val = dynamic_cast<CDB_Stream&> (param);
                 // Null images doesn't work in odbc
                 // (at least in those tests that exists in dbapi_unit_test)
                 r = bcp_collen(GetHandle(),  (DBINT) val.Size(), i + 1);
@@ -488,17 +499,19 @@ bool CODBC_BCPInCmd::Send(void)
         DATABASE_DRIVER_ERROR( err_message, 423005 );
     }
 
-    if (m_HasTextImage) { // send text/image data
-        char buff[1800]; // text/image page size
+    if (m_HasBlob) { // send BLOB data
+        char buff[1800]; // BLOB page size
 
         for (unsigned int i = 0; i < GetBindParamsImpl().NofParams(); ++i) {
             if (GetBindParamsImpl().GetParamStatus(i) == 0)
                 continue;
 
             CDB_Object& param = *GetBindParamsImpl().GetParam(i);
+            EBlobType   blob_type = CDB_Object::GetBlobType(param.GetType());
 
-            if (param.GetType() != eDB_Image &&
-                (param.GetType() != eDB_Text  ||  param.IsNULL()))
+            // x_AssignParams would have already rejected any NULL binary blobs
+            if (blob_type == eBlobType_none
+                ||  (blob_type == eBlobType_Text  &&  param.IsNULL()))
                 continue;
 
             CDB_Stream& val = dynamic_cast<CDB_Stream&> (param);
@@ -533,13 +546,10 @@ bool CODBC_BCPInCmd::Send(void)
                     SetHasFailed();
                     ReportErrors();
 
-                    string err_text;
-                    if (param.GetType() == eDB_Text) {
-                        err_text = "bcp_moretext for text failed.";
-                    } else {
-                        err_text = "bcp_moretext for image failed.";
-                    }
-                    DATABASE_DRIVER_ERROR( err_text, 423006 );
+                    DATABASE_DRIVER_ERROR(
+                        string("bcp_moretext for ")
+                        + CDB_Object::GetTypeName(param.GetType()) + " failed",
+                        423006);
                 }
 
                 if (!valid_len) {
diff --git a/c++/src/dbapi/driver/odbc/connection.cpp b/c++/src/dbapi/driver/odbc/connection.cpp
index 44663d6..b141ca3 100644
--- a/c++/src/dbapi/driver/odbc/connection.cpp
+++ b/c++/src/dbapi/driver/odbc/connection.cpp
@@ -1,4 +1,4 @@
-/* $Id: connection.cpp 440505 2014-07-14 19:00:33Z ucko $
+/* $Id: connection.cpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -66,7 +66,7 @@ bool IsBCPCapable(void)
 }
 
 static bool ODBC_xSendDataPrepare(CStatementBase& stmt,
-                                  CDB_ITDescriptor& descr_in,
+                                  CDB_BlobDescriptor& descr_in,
                                   SQLLEN size,
                                   bool is_text,
                                   bool logit,
@@ -260,7 +260,8 @@ CODBC_Connection::x_GetDriverName(const IRegistry& registry)
     const string odbc_driver_name =
         registry.GetString("ODBC", "DRIVER_NAME", "'SQL Server'");
 
-    NStr::Tokenize(odbc_driver_name, " ", driver_names);
+    NStr::Split(odbc_driver_name, " ", driver_names,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     EState state = eStInitial;
     string driver_name;
 
@@ -398,14 +399,14 @@ CDB_CursorCmd* CODBC_Connection::Cursor(const string& cursor_name,
 }
 
 
-CDB_SendDataCmd* CODBC_Connection::SendDataCmd(I_ITDescriptor& descr_in,
+CDB_SendDataCmd* CODBC_Connection::SendDataCmd(I_BlobDescriptor& descr_in,
                                                size_t data_size,
                                                bool log_it,
                                                bool dump_results)
 {
     CODBC_SendDataCmd* sd_cmd =
         new CODBC_SendDataCmd(*this,
-                              (CDB_ITDescriptor&)descr_in,
+                              (CDB_BlobDescriptor&)descr_in,
                               data_size,
                               log_it,
                               dump_results);
@@ -413,7 +414,8 @@ CDB_SendDataCmd* CODBC_Connection::SendDataCmd(I_ITDescriptor& descr_in,
 }
 
 
-bool CODBC_Connection::SendData(I_ITDescriptor& desc, CDB_Stream& lob, bool log_it)
+bool CODBC_Connection::SendData(I_BlobDescriptor& desc, CDB_Stream& lob,
+                                bool log_it)
 {
     CStatementBase stmt(*this, kEmptyStr);
 
@@ -421,19 +423,20 @@ bool CODBC_Connection::SendData(I_ITDescriptor& desc, CDB_Stream& lob, bool log_
     SQLLEN      s = lob.Size();
     SQLLEN      ph;
 
-    CDB_ITDescriptor::ETDescriptorType desc_type = CDB_ITDescriptor::eUnknown;
+    CDB_BlobDescriptor::ETDescriptorType desc_type
+        = CDB_BlobDescriptor::eUnknown;
 
-    if (lob.GetType() == eDB_Image) {
-            desc_type = CDB_ITDescriptor::eBinary;
+    if (CDB_Object::GetBlobType(lob.GetType()) == eBlobType_Binary) {
+        desc_type = CDB_BlobDescriptor::eBinary;
     } else {
-            desc_type = CDB_ITDescriptor::eText;
+        desc_type = CDB_BlobDescriptor::eText;
     }
 
     if((!ODBC_xSendDataPrepare(
             stmt,
-            (CDB_ITDescriptor&)desc,
+            (CDB_BlobDescriptor&)desc,
             s,
-            (desc_type == CDB_ITDescriptor::eText),
+            (desc_type == CDB_BlobDescriptor::eText),
             log_it,
             p,
             &ph
@@ -562,7 +565,7 @@ ODBC_xCheckSIE(int rc, CStatementBase& stmt)
 }
 
 static bool ODBC_xSendDataPrepare(CStatementBase& stmt,
-                                  CDB_ITDescriptor& descr_in,
+                                  CDB_BlobDescriptor& descr_in,
                                   SQLLEN size,
                                   bool is_text,
                                   bool logit,
@@ -591,12 +594,12 @@ static bool ODBC_xSendDataPrepare(CStatementBase& stmt,
 #endif
 
 
-    CDB_ITDescriptor::ETDescriptorType descr_type = descr_in.GetColumnType();
-    if (descr_type == CDB_ITDescriptor::eUnknown) {
+    CDB_BlobDescriptor::ETDescriptorType descr_type = descr_in.GetColumnType();
+    if (descr_type == CDB_BlobDescriptor::eUnknown) {
         if (is_text) {
-            descr_type = CDB_ITDescriptor::eText;
+            descr_type = CDB_BlobDescriptor::eText;
         } else {
-            descr_type = CDB_ITDescriptor::eBinary;
+            descr_type = CDB_BlobDescriptor::eBinary;
         }
     }
 
@@ -605,7 +608,7 @@ static bool ODBC_xSendDataPrepare(CStatementBase& stmt,
     int c_type = 0;
     int sql_type = 0;
 
-    if (descr_type == CDB_ITDescriptor::eText) {
+    if (descr_type == CDB_BlobDescriptor::eText) {
         // New code ...
         if (stmt.IsMultibyteClientEncoding()) {
             c_type = SQL_C_WCHAR;
@@ -679,9 +682,10 @@ static bool ODBC_xSendDataGetId(CStatementBase& stmt,
     }
 }
 
-bool CODBC_Connection::x_SendData(CDB_ITDescriptor::ETDescriptorType descr_type,
-                                  CStatementBase& stmt,
-                                  CDB_Stream& stream)
+bool
+CODBC_Connection::x_SendData(CDB_BlobDescriptor::ETDescriptorType descr_type,
+                             CStatementBase& stmt,
+                             CDB_Stream& stream)
 {
     char buff[1800];
 
@@ -696,7 +700,7 @@ bool CODBC_Connection::x_SendData(CDB_ITDescriptor::ETDescriptorType descr_type,
 //         size_t valid_len = len;
 //
 //         if (stmt.GetClientEncoding() == eEncoding_UTF8 &&
-//             descr_type == CDB_ITDescriptor::eText) {
+//             descr_type == CDB_BlobDescriptor::eText) {
 //
 //             valid_len = CStringUTF8::GetValidBytesCount(buff, len);
 //             invalid_len = len - valid_len;
@@ -714,7 +718,7 @@ bool CODBC_Connection::x_SendData(CDB_ITDescriptor::ETDescriptorType descr_type,
 //         }
 //
 //         if (stmt.GetClientEncoding() == eEncoding_UTF8 &&
-//             descr_type == CDB_ITDescriptor::eText) {
+//             descr_type == CDB_BlobDescriptor::eText) {
 //
 //             if (valid_len < len) {
 //                 memmove(buff, buff + valid_len, invalid_len);
@@ -725,7 +729,7 @@ bool CODBC_Connection::x_SendData(CDB_ITDescriptor::ETDescriptorType descr_type,
 
         // Old code ...
         if (stmt.GetClientEncoding() == eEncoding_UTF8 &&
-            descr_type == CDB_ITDescriptor::eText) {
+            descr_type == CDB_BlobDescriptor::eText) {
 
             size_t valid_len = impl::GetValidUTF8Len(CTempString(buff, len));
             invalid_len = len - valid_len;
@@ -1051,6 +1055,16 @@ CStatementBase::Type2String(const CDB_Object& param) const
     case eDB_Image:
         type_str = "image";
         break;
+    case eDB_VarCharMax:
+        if (IsMultibyteClientEncoding()) {
+            type_str = "nvarchar(max)";
+        } else {
+            type_str = "varchar(max)";
+        }
+        break;
+    case eDB_VarBinaryMax:
+        type_str = "varbinary(max)";
+        break;
     default:
         break;
     }
@@ -1119,6 +1133,7 @@ CStatementBase::x_GetCType(const CDB_Object& param) const
     case eDB_Char:
     case eDB_VarChar:
     case eDB_LongChar:
+    case eDB_VarCharMax:
         // New code ...
         if (IsMultibyteClientEncoding()) {
             type = SQL_C_WCHAR;
@@ -1136,6 +1151,7 @@ CStatementBase::x_GetCType(const CDB_Object& param) const
     case eDB_Binary:
     case eDB_VarBinary:
     case eDB_LongBinary:
+    case eDB_VarBinaryMax:
         type = SQL_C_BINARY;
         break;
     case eDB_Float:
@@ -1191,6 +1207,7 @@ CStatementBase::x_GetSQLType(const CDB_Object& param) const
 // #endif
         break;
     case eDB_LongChar:
+    case eDB_VarCharMax:
         // New code ...
         if (IsMultibyteClientEncoding()) {
             type = SQL_WLONGVARCHAR;
@@ -1210,6 +1227,9 @@ CStatementBase::x_GetSQLType(const CDB_Object& param) const
     case eDB_LongBinary:
         type = SQL_VARBINARY;
         break;
+    case eDB_VarBinaryMax:
+        type = SQL_LONGVARBINARY;
+        break;
     case eDB_Float:
         type = SQL_REAL;
         break;
@@ -1290,6 +1310,30 @@ CStatementBase::x_GetMaxDataSize(const CDB_Object& param) const
     case eDB_DateTime:
         size = 23;
         break;
+    case eDB_VarCharMax:
+#if 0
+        if (IsMultibyteClientEncoding()) {
+            size = kMax_UInt / sizeof(odbc::TChar);
+        } else {
+            size = kMax_UInt;
+        }
+#else
+        size = static_cast<const CDB_VarCharMax&>(param).Size();
+        if (size == 0) {
+            size = 1;
+        }
+#endif
+        break;
+    case eDB_VarBinaryMax:
+#if 0
+        size = kMax_UInt;
+#else
+        size = static_cast<const CDB_VarBinaryMax&>(param).Size();
+        if (size == 0) {
+            size = 1;
+        }
+#endif
+        break;
     default:
         break;
     }
@@ -1326,6 +1370,13 @@ CStatementBase::x_GetCurDataSize(const CDB_Object& param) const
     case eDB_DateTime:
         size = sizeof(SQL_TIMESTAMP_STRUCT);
         break;
+    case eDB_VarCharMax:
+        size = dynamic_cast<const CDB_VarCharMax&>(param).Size()
+            * sizeof(odbc::TChar);
+        break;
+    case eDB_VarBinaryMax:
+        size = dynamic_cast<const CDB_VarBinaryMax&>(param).Size();
+        break;
     default:
         break;
     }
@@ -1357,6 +1408,11 @@ CStatementBase::x_GetIndicator(const CDB_Object& param) const
     case eDB_DateTime:
         return sizeof(SQL_TIMESTAMP_STRUCT);
         break;
+    case eDB_VarCharMax:
+        return dynamic_cast<const CDB_VarCharMax&>(param).Size()
+            * sizeof(TSqlChar);
+    case eDB_VarBinaryMax:
+        return dynamic_cast<const CDB_VarBinaryMax&>(param).Size();
     default:
         break;
     }
@@ -1447,6 +1503,17 @@ CStatementBase::x_GetData(const CDB_Object& param,
             data = ts;
         }
         break;
+    case eDB_VarCharMax:
+    case eDB_VarBinaryMax:
+        if( !param.IsNULL() ) {
+            CDB_Stream& par = static_cast<CDB_Stream&>
+                (const_cast<CDB_Object&>(param));
+            size_t n = par.Size();
+            data = bind_guard.Alloc(n);
+            par.MoveTo(0);
+            _VERIFY(par.Read(data, n) == n);
+        }
+        break;
     default:
         break;
     }
@@ -1498,14 +1565,14 @@ CStatementBase::Close(void) const
 //
 
 CODBC_SendDataCmd::CODBC_SendDataCmd(CODBC_Connection& conn,
-                                     CDB_ITDescriptor& descr,
+                                     CDB_BlobDescriptor& descr,
                                      size_t nof_bytes,
                                      bool logit,
                                      bool dump_results) :
     CStatementBase(conn, kEmptyStr),
     impl::CSendDataCmd(conn, nof_bytes),
-    m_DescrType(descr.GetColumnType() == CDB_ITDescriptor::eText ?
-                CDB_ITDescriptor::eText : CDB_ITDescriptor::eBinary),
+    m_DescrType(descr.GetColumnType() == CDB_BlobDescriptor::eText ?
+                CDB_BlobDescriptor::eText : CDB_BlobDescriptor::eBinary),
     m_Res(NULL),
     m_HasMoreResults(false),
     m_DumpResults(dump_results)
@@ -1532,7 +1599,7 @@ size_t CODBC_SendDataCmd::SendChunk(const void* chunk_ptr, size_t nof_bytes)
 //     size_t valid_len = nof_bytes;
 //
 //     if (GetClientEncoding() == eEncoding_UTF8 &&
-//         m_DescrType == CDB_ITDescriptor::eText) {
+//         m_DescrType == CDB_BlobDescriptor::eText) {
 //
 //         valid_len = CStringUTF8::GetValidBytesCount(static_cast<const char*>(chunk_ptr),
 //                                                     nof_bytes);
@@ -1558,7 +1625,7 @@ size_t CODBC_SendDataCmd::SendChunk(const void* chunk_ptr, size_t nof_bytes)
 
     // Old code ...
     if (GetClientEncoding() == eEncoding_UTF8 &&
-        m_DescrType == CDB_ITDescriptor::eText) {
+        m_DescrType == CDB_BlobDescriptor::eText) {
         size_t valid_len = 0;
 
         valid_len = impl::GetValidUTF8Len(
diff --git a/c++/src/dbapi/driver/odbc/cursor.cpp b/c++/src/dbapi/driver/odbc/cursor.cpp
index 5e8d26d..209e793 100644
--- a/c++/src/dbapi/driver/odbc/cursor.cpp
+++ b/c++/src/dbapi/driver/odbc/cursor.cpp
@@ -1,4 +1,4 @@
-/* $Id: cursor.cpp 440505 2014-07-14 19:00:33Z ucko $
+/* $Id: cursor.cpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -148,7 +148,7 @@ bool CODBC_CursorCmd::Update(const string&, const string& upd_query)
     return true;
 }
 
-CDB_ITDescriptor* CODBC_CursorCmd::x_GetITDescriptor(unsigned int item_num)
+CDB_BlobDescriptor* CODBC_CursorCmd::x_GetBlobDescriptor(unsigned int item_num)
 {
     if(!CursorIsOpen() || m_Res.get() == 0) {
         return NULL;
@@ -156,30 +156,29 @@ CDB_ITDescriptor* CODBC_CursorCmd::x_GetITDescriptor(unsigned int item_num)
 
     string cond = "current of " + GetCmdName();
 
-    return m_CursCmd.m_Res->GetImageOrTextDescriptor(item_num, cond);
+    return m_CursCmd.m_Res->GetBlobDescriptor(item_num, cond);
 }
 
-bool CODBC_CursorCmd::UpdateTextImage(unsigned int item_num, CDB_Stream& data,
-                    bool log_it)
+bool CODBC_CursorCmd::UpdateBlob(unsigned int item_num, CDB_Stream& data,
+                                 bool log_it)
 {
-    CDB_ITDescriptor* desc= x_GetITDescriptor(item_num);
+    CDB_BlobDescriptor* desc = x_GetBlobDescriptor(item_num);
     if(desc == 0) return false;
-    auto_ptr<I_ITDescriptor> g((I_ITDescriptor*)desc);
+    auto_ptr<I_BlobDescriptor> g((I_BlobDescriptor*)desc);
 
-    return (data.GetType() == eDB_Text)?
-        GetConnection().SendData(*desc, (CDB_Text&)data, log_it) :
-        GetConnection().SendData(*desc, (CDB_Image&)data, log_it);
+    return GetConnection().SendData(*desc, data, log_it);
 }
 
 CDB_SendDataCmd* CODBC_CursorCmd::SendDataCmd(unsigned int item_num, size_t size,
                                               bool log_it,
                                               bool dump_results)
 {
-    CDB_ITDescriptor* desc= x_GetITDescriptor(item_num);
+    CDB_BlobDescriptor* desc = x_GetBlobDescriptor(item_num);
     if(desc == 0) return 0;
-    auto_ptr<I_ITDescriptor> g((I_ITDescriptor*)desc);
+    auto_ptr<I_BlobDescriptor> g((I_BlobDescriptor*)desc);
 
-    return GetConnection().SendDataCmd((I_ITDescriptor&)*desc, size, log_it, dump_results);
+    return GetConnection().SendDataCmd((I_BlobDescriptor&)*desc, size, log_it,
+                                       dump_results);
 }
 
 bool CODBC_CursorCmd::Delete(const string& table_name)
@@ -316,7 +315,8 @@ bool CODBC_CursorCmdExpl::Update(const string&, const string& upd_query)
     return true;
 }
 
-CDB_ITDescriptor* CODBC_CursorCmdExpl::x_GetITDescriptor(unsigned int item_num)
+CDB_BlobDescriptor*
+CODBC_CursorCmdExpl::x_GetBlobDescriptor(unsigned int item_num)
 {
     if(!CursorIsOpen() || m_Res.get() == 0 || m_LCmd.get() == 0) {
         return NULL;
@@ -324,34 +324,33 @@ CDB_ITDescriptor* CODBC_CursorCmdExpl::x_GetITDescriptor(unsigned int item_num)
 
     string cond = "current of " + GetCmdName();
 
-    return m_LCmd->m_Res->GetImageOrTextDescriptor(item_num, cond);
+    return m_LCmd->m_Res->GetBlobDescriptor(item_num, cond);
 }
 
-bool CODBC_CursorCmdExpl::UpdateTextImage(unsigned int item_num, CDB_Stream& data,
-                    bool log_it)
+bool CODBC_CursorCmdExpl::UpdateBlob(unsigned int item_num, CDB_Stream& data,
+                                     bool log_it)
 {
-    CDB_ITDescriptor* desc= x_GetITDescriptor(item_num);
+    CDB_BlobDescriptor* desc = x_GetBlobDescriptor(item_num);
     if(desc == 0) return false;
-    auto_ptr<I_ITDescriptor> g((I_ITDescriptor*)desc);
+    auto_ptr<I_BlobDescriptor> g((I_BlobDescriptor*)desc);
 
     m_LCmd->Cancel();
 
-    return (data.GetType() == eDB_Text)?
-        GetConnection().SendData(*desc, (CDB_Text&)data, log_it) :
-        GetConnection().SendData(*desc, (CDB_Image&)data, log_it);
+    return GetConnection().SendData(*desc, data, log_it);
 }
 
 CDB_SendDataCmd* CODBC_CursorCmdExpl::SendDataCmd(unsigned int item_num, size_t size,
                                                   bool log_it,
                                                   bool dump_results)
 {
-    CDB_ITDescriptor* desc= x_GetITDescriptor(item_num);
+    CDB_BlobDescriptor* desc = x_GetBlobDescriptor(item_num);
     if(desc == 0) return 0;
-    auto_ptr<I_ITDescriptor> g((I_ITDescriptor*)desc);
+    auto_ptr<I_BlobDescriptor> g((I_BlobDescriptor*)desc);
 
     m_LCmd->Cancel();
 
-    return GetConnection().SendDataCmd((I_ITDescriptor&)*desc, size, log_it, dump_results);
+    return GetConnection().SendDataCmd((I_BlobDescriptor&)*desc, size, log_it,
+                                       dump_results);
 }
 
 bool CODBC_CursorCmdExpl::Delete(const string& table_name)
diff --git a/c++/src/dbapi/driver/odbc/result.cpp b/c++/src/dbapi/driver/odbc/result.cpp
index af2441d..7de91be 100644
--- a/c++/src/dbapi/driver/odbc/result.cpp
+++ b/c++/src/dbapi/driver/odbc/result.cpp
@@ -1,4 +1,4 @@
-/* $Id: result.cpp 440505 2014-07-14 19:00:33Z ucko $
+/* $Id: result.cpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -282,9 +282,10 @@ bool CODBC_RowResult::CheckSIENoD_Text(CDB_Stream* val)
         ReportErrors();
     default:
         {
-            string err_message = "SQLGetData failed while retrieving text/image into CDB_Text." +
-                GetDbgInfo();
-            DATABASE_DRIVER_ERROR( err_message, 430021 );
+            DATABASE_DRIVER_ERROR(
+                string("SQLGetData failed while retrieving BLOB into C") +
+                CDB_Object::GetTypeName(val->GetType()) + '.',
+                430021);
         }
     }
 
@@ -326,9 +327,10 @@ bool CODBC_RowResult::CheckSIENoD_WText(CDB_Stream* val)
         ReportErrors();
     default:
         {
-            string err_message = "SQLGetData failed while retrieving text/image into CDB_Text." +
-                GetDbgInfo();
-            DATABASE_DRIVER_ERROR( err_message, 430021 );
+            DATABASE_DRIVER_ERROR(
+                string("SQLGetData failed while retrieving BLOB into C") +
+                CDB_Object::GetTypeName(val->GetType()) + '.',
+                430021);
         }
     }
 
@@ -357,9 +359,10 @@ bool CODBC_RowResult::CheckSIENoD_Binary(CDB_Stream* val)
         ReportErrors();
     default:
         {
-            string err_message = "SQLGetData failed while retrieving text/image into CDB_Image." +
-                GetDbgInfo();
-            DATABASE_DRIVER_ERROR( err_message, 430022 );
+            DATABASE_DRIVER_ERROR(
+                string("SQLGetData failed while retrieving BLOB into C") +
+                CDB_Object::GetTypeName(val->GetType()) + '.',
+                430022);
         }
     }
 
@@ -738,7 +741,8 @@ CDB_Object* CODBC_RowResult::x_LoadItem(I_Result::EGetItem policy, CDB_Object* i
     case SQL_LONGVARBINARY:
     case SQL_LONGVARCHAR:
         switch(item_buf->GetType()) {
-        case eDB_Text: {
+        case eDB_Text:
+        case eDB_VarCharMax: {
 			if (policy == I_Result::eAssignLOB) {
 				static_cast<CDB_Stream*>(item_buf)->Truncate();
 			}
@@ -748,7 +752,8 @@ CDB_Object* CODBC_RowResult::x_LoadItem(I_Result::EGetItem policy, CDB_Object* i
             }
             break;
         }
-        case eDB_Image: {
+        case eDB_Image:
+        case eDB_VarBinaryMax: {
 			if (policy == I_Result::eAssignLOB) {
 				static_cast<CDB_Stream*>(item_buf)->Truncate();
 			}
@@ -1070,8 +1075,8 @@ size_t CODBC_RowResult::ReadItem(void* buffer,size_t buffer_size,bool* is_null)
 }
 
 
-CDB_ITDescriptor* CODBC_RowResult::GetImageOrTextDescriptor(int item_no,
-                                                            const string& cond)
+CDB_BlobDescriptor* CODBC_RowResult::GetBlobDescriptor(int item_no,
+                                                       const string& cond)
 {
     enum {eNameStrLen = 128};
     SQLSMALLINT slp;
@@ -1137,25 +1142,24 @@ CDB_ITDescriptor* CODBC_RowResult::GetImageOrTextDescriptor(int item_no,
         }
     }
 
-    CDB_ITDescriptor::ETDescriptorType type = CDB_ITDescriptor::eUnknown;
+    CDB_BlobDescriptor::ETDescriptorType type = CDB_BlobDescriptor::eUnknown;
     switch (column_type) {
     case SQL_BINARY:
     case SQL_VARBINARY:
     case SQL_LONGVARBINARY:
-        type = CDB_ITDescriptor::eBinary;
+        type = CDB_BlobDescriptor::eBinary;
         break;
     case SQL_LONGVARCHAR:
-        type = CDB_ITDescriptor::eText;
+        type = CDB_BlobDescriptor::eText;
         break;
     };
 
-    return new CDB_ITDescriptor(base_table, base_column, cond, type);
+    return new CDB_BlobDescriptor(base_table, base_column, cond, type);
 }
 
-I_ITDescriptor* CODBC_RowResult::GetImageOrTextDescriptor()
+I_BlobDescriptor* CODBC_RowResult::GetBlobDescriptor()
 {
-    return (I_ITDescriptor*) GetImageOrTextDescriptor(m_CurrItem,
-                                                      "don't use me");
+    return (I_BlobDescriptor*) GetBlobDescriptor(m_CurrItem, "don't use me");
 }
 
 bool CODBC_RowResult::SkipItem()
@@ -1342,9 +1346,9 @@ size_t CODBC_CursorResult::ReadItem(void* buffer, size_t buffer_size,
 }
 
 
-I_ITDescriptor* CODBC_CursorResult::GetImageOrTextDescriptor()
+I_BlobDescriptor* CODBC_CursorResult::GetBlobDescriptor()
 {
-    return m_Res ? m_Res->GetImageOrTextDescriptor() : 0;
+    return m_Res ? m_Res->GetBlobDescriptor() : 0;
 }
 
 
diff --git a/c++/src/dbapi/driver/parameters.cpp b/c++/src/dbapi/driver/parameters.cpp
index 4f22bc6..154e81c 100644
--- a/c++/src/dbapi/driver/parameters.cpp
+++ b/c++/src/dbapi/driver/parameters.cpp
@@ -1,4 +1,4 @@
-/* $Id: parameters.cpp 441150 2014-07-21 19:10:46Z ucko $
+/* $Id: parameters.cpp 487444 2015-12-17 18:38:53Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -134,7 +134,7 @@ CDB_Params::GetParamNum(unsigned int param_no, const string& param_name)
                 // Parameter not found ...
 		CHECK_DRIVER_ERROR(IsLocked(), "Parameters are locked. New bindins are not allowed.", 20001);
                 m_Params.resize(m_Params.size() + 1);
-                return m_Params.size() - 1;
+                return (unsigned int)(m_Params.size() - 1);
             }
         }
     } else {
diff --git a/c++/src/dbapi/driver/public.cpp b/c++/src/dbapi/driver/public.cpp
index 6b0bc9c..88cdd15 100644
--- a/c++/src/dbapi/driver/public.cpp
+++ b/c++/src/dbapi/driver/public.cpp
@@ -1,4 +1,4 @@
-/* $Id: public.cpp 458199 2015-02-02 19:18:09Z ucko $
+/* $Id: public.cpp 498367 2016-04-15 17:18:04Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -377,7 +377,7 @@ CDB_CursorCmd* CDB_Connection::Cursor(const string& cursor_name,
     return m_ConnImpl->Cursor(cursor_name, query, batch_size);
 }
 
-CDB_SendDataCmd* CDB_Connection::SendDataCmd(I_ITDescriptor& desc,
+CDB_SendDataCmd* CDB_Connection::SendDataCmd(I_BlobDescriptor& desc,
                                              size_t data_size,
                                              bool log_it,
                                              bool dump_results)
@@ -387,7 +387,8 @@ CDB_SendDataCmd* CDB_Connection::SendDataCmd(I_ITDescriptor& desc,
     return m_ConnImpl->SendDataCmd(desc, data_size, log_it, dump_results);
 }
 
-bool CDB_Connection::SendData(I_ITDescriptor& desc, CDB_Stream& lob, bool log_it)
+bool CDB_Connection::SendData(I_BlobDescriptor& desc, CDB_Stream& lob,
+                              bool log_it)
 {
     CHECK_CONNECTION(m_ConnImpl);
     _TRACE("Sending " << lob.Size() << " byte(s) of data");
@@ -538,6 +539,18 @@ void CDB_Connection::SetCancelTimeout(size_t nof_secs)
     m_ConnImpl->SetCancelTimeout(nof_secs);
 }
 
+size_t CDB_Connection::GetTimeout(void) const
+{
+    CHECK_CONNECTION(m_ConnImpl);
+    return m_ConnImpl->GetTimeout();
+}
+
+size_t CDB_Connection::GetCancelTimeout(void) const
+{
+    CHECK_CONNECTION(m_ConnImpl);
+    return m_ConnImpl->GetCancelTimeout();
+}
+
 I_ConnectionExtra& CDB_Connection::GetExtraFeatures(void)
 {
     CHECK_CONNECTION(m_ConnImpl);
@@ -654,10 +667,10 @@ size_t CDB_Result::ReadItem(void* buffer, size_t buffer_size, bool* is_null)
     return GetIResult().ReadItem(buffer, buffer_size, is_null);
 }
 
-I_ITDescriptor* CDB_Result::GetImageOrTextDescriptor()
+I_BlobDescriptor* CDB_Result::GetBlobDescriptor()
 {
     CHECK_RESULT( GetIResultPtr() );
-    return GetIResult().GetImageOrTextDescriptor();
+    return GetIResult().GetBlobDescriptor();
 }
 
 bool CDB_Result::SkipItem()
@@ -1027,10 +1040,11 @@ bool CDB_CursorCmd::Update(const string& table_name, const string& upd_query)
     return m_CmdImpl->Update(table_name, upd_query);
 }
 
-bool CDB_CursorCmd::UpdateTextImage(unsigned int item_num, CDB_Stream& data, bool log_it)
+bool CDB_CursorCmd::UpdateBlob(unsigned int item_num, CDB_Stream& data,
+                               bool log_it)
 {
     CHECK_COMMAND( m_CmdImpl );
-    return m_CmdImpl->UpdateTextImage(item_num, data, log_it);
+    return m_CmdImpl->UpdateBlob(item_num, data, log_it);
 }
 
 CDB_SendDataCmd* CDB_CursorCmd::SendDataCmd(unsigned int item_num,
@@ -1133,10 +1147,10 @@ CDB_SendDataCmd::~CDB_SendDataCmd()
 
 
 /////////////////////////////////////////////////////////////////////////////
-//  CDB_ITDescriptor::
+//  CDB_BlobDescriptor::
 //
 
-CDB_ITDescriptor::CDB_ITDescriptor(const string& table_name,
+CDB_BlobDescriptor::CDB_BlobDescriptor(const string& table_name,
                                    const string& column_name,
                                    const string& search_conditions,
                                    ETDescriptorType column_type)
@@ -1147,11 +1161,11 @@ CDB_ITDescriptor::CDB_ITDescriptor(const string& table_name,
 {
 }
 
-CDB_ITDescriptor::~CDB_ITDescriptor()
+CDB_BlobDescriptor::~CDB_BlobDescriptor()
 {
 }
 
-int CDB_ITDescriptor::DescriptorType() const
+int CDB_BlobDescriptor::DescriptorType() const
 {
     return 0;
 }
diff --git a/c++/src/dbapi/driver/types.cpp b/c++/src/dbapi/driver/types.cpp
index 614e3c8..7bbbb67 100644
--- a/c++/src/dbapi/driver/types.cpp
+++ b/c++/src/dbapi/driver/types.cpp
@@ -1,4 +1,4 @@
-/* $Id: types.cpp 441148 2014-07-21 18:58:42Z ucko $
+/* $Id: types.cpp 498375 2016-04-15 17:20:50Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -574,6 +574,8 @@ CDB_Object* CDB_Object::Create(EDB_Type type, size_t size)
     case eDB_Numeric         : return new CDB_Numeric       ();
     case eDB_LongBinary      : return new CDB_LongBinary(size);
     case eDB_LongChar        : return new CDB_LongChar  (size);
+    case eDB_VarCharMax      : return new CDB_VarCharMax    ();
+    case eDB_VarBinaryMax    : return new CDB_VarBinaryMax  ();
     case eDB_UnsupportedType : break;
     }
     DATABASE_DRIVER_ERROR("unknown type " + NStr::IntToString(type), 2);
@@ -601,6 +603,8 @@ const char* CDB_Object::GetTypeName(EDB_Type db_type, bool throw_on_unknown)
     case eDB_Numeric         : return "DB_Numeric";
     case eDB_LongBinary      : return "DB_LongBinary";
     case eDB_LongChar        : return "DB_LongChar";
+    case eDB_VarCharMax      : return "DB_VarCharMax";
+    case eDB_VarBinaryMax    : return "DB_VarBinaryMax";
     case eDB_UnsupportedType : return "DB_UnsupportedType";
     }
 
@@ -624,16 +628,11 @@ string CDB_Object::GetLogString(void) const
     unsigned int max_length = TDbapi_MaxLoggedParamLength::GetDefault();
     string       result;
 
-    switch (GetType()) {
-    case eDB_Image:
-    case eDB_Text:
-    {
+    if (IsBlobType(GetType())) {
         const CDB_Stream& s = static_cast<const CDB_Stream&>(*this);
         AutoArray<char> buff(max_length + 1);
-        result.assign(buff.get(), s.Peek(buff.get(), max_length + 1));
-        break;
-    }
-    default:
+        result.assign(buff.get(), s.PeekAt(buff.get(), 0, max_length + 1));
+    } else {
         try {
             result = (string)ConvertSQL(*this);
         } catch (exception& e) {
@@ -641,7 +640,6 @@ string CDB_Object::GetLogString(void) const
                      << GetTypeName(GetType()) << ": " << e.what());
             return "???";
         }
-        break;
     }
 
     if (result.length() > max_length) {
@@ -1503,17 +1501,19 @@ void CDB_LongChar::SetValue(const char* str,
                             size_t len,
                             EEncoding enc)
 {
-    CheckStringTruncation(CDB_VarChar(str, len, enc).Size(), m_Size);
+    CDB_VarChar vc(str, len, enc);
+    CheckStringTruncation(vc.Size(), m_Size);
 
-    Assign(str, m_Size, enc);
+    Assign(vc.AsCString(), m_Size, enc);
 }
 
 
 void CDB_LongChar::SetValue(const TStringUCS2& str, size_t len)
 {
-    CheckStringTruncation(CDB_VarChar(str, len).Size(), m_Size);
+    CDB_VarChar vc(str, len);
+    CheckStringTruncation(vc.Size(), m_Size);
 
-    Assign(str, m_Size);
+    Assign(vc.Data(), m_Size);
 }
 
 
@@ -1579,7 +1579,7 @@ CDB_VarBinary::~CDB_VarBinary(void)
 
 void CDB_VarBinary::SetValue(const void* v, size_t l)
 {
-    if (v  &&  l) {
+    if (v != NULL) {
         if (m_Value.Empty()) {
             m_Value.Reset(new TValue);
         }
@@ -1660,7 +1660,7 @@ CDB_Binary::CDB_Binary(const CDB_Binary& v, bool share_data)
 
 void CDB_Binary::SetValue(const void* v, size_t v_size)
 {
-    if (v && v_size) {
+    if (v != NULL) {
         CheckBinaryTruncation(v_size, m_Size);
 
         if (m_Value.Empty()) {
@@ -1756,7 +1756,7 @@ CDB_LongBinary::CDB_LongBinary(const CDB_LongBinary& v, bool share_data)
 
 void CDB_LongBinary::SetValue(const void* v, size_t v_size)
 {
-    if (v && v_size) {
+    if (v != NULL) {
         m_DataSize = min(v_size, m_Size);
         CheckBinaryTruncation(v_size, m_Size);
         if (m_Value.Empty()) {
@@ -1937,14 +1937,15 @@ void CDB_Double::AssignValue(const CDB_Object& v)
 //
 
 CDB_Stream::CDB_Stream()
-    : CDB_Object(true)
+    : CDB_Object(true), m_Encoding(eBulkEnc_RawBytes)
+
 {
     m_Store = new CMemStore;
     m_Store->AddReference();
 }
 
 CDB_Stream::CDB_Stream(const CDB_Stream& s, bool share_data)
-    : CDB_Object(s), m_Store(s.m_Store)
+    : CDB_Object(s), m_Encoding(s.m_Encoding), m_Store(s.m_Store)
 {
     if (share_data) {
         m_Store->AddReference();
@@ -1959,6 +1960,7 @@ CDB_Stream& CDB_Stream::Assign(const CDB_Stream& v)
 {
     SetNULL(v.IsNULL());
     m_Store->Truncate();
+    m_Encoding = v.m_Encoding;
     if ( !IsNULL() ) {
         char buff[1024];
         CMemStore* s = const_cast<CMemStore*>(&*v.m_Store);
@@ -1990,6 +1992,11 @@ size_t CDB_Stream::Peek(void* buff, size_t nof_bytes) const
     return m_Store->Peek(buff, nof_bytes);
 }
 
+size_t CDB_Stream::PeekAt(void* buff, size_t start, size_t nof_bytes) const
+{
+    return m_Store->PeekAt(buff, start, nof_bytes);
+}
+
 size_t CDB_Stream::Append(const void* buff, size_t nof_bytes)
 {
     /* if (buff && (nof_bytes > 0)) */ SetNULL(false);
@@ -2015,8 +2022,7 @@ void CDB_Stream::Truncate(size_t nof_bytes)
 
 void CDB_Stream::AssignValue(const CDB_Object& v)
 {
-    CHECK_DRIVER_ERROR(
-        (v.GetType() != eDB_Image) && (v.GetType() != eDB_Text),
+    CHECK_DRIVER_ERROR( !IsBlobType(v.GetType()),
         string("wrong type of CDB_Object: ") + GetTypeName(v.GetType(), false),
         2
         );
@@ -2031,6 +2037,59 @@ CDB_Stream::~CDB_Stream()
     NCBI_CATCH_ALL_X( 7, NCBI_CURRENT_FUNCTION )
 }
 
+void CDB_Stream::x_SetEncoding(EBulkEnc e)
+{
+    if (e == eBulkEnc_UCS2FromChar) {
+        e = eBulkEnc_RawUCS2;
+    }
+    if (e != m_Encoding  &&  Size() > 0) {
+        // Alternatively, arrange to recode existing text?
+        ERR_POST_X(8, string("Creating a mixed-encoding C")
+                   + GetTypeName(GetType()) + " object.");
+    }
+    m_Encoding = e;
+}
+
+size_t CDB_Stream::x_Append(const void* buff, size_t nof_bytes)
+{
+    if (buff == NULL) {
+        // return 0;
+        buff = kEmptyCStr;
+    }
+    // Warn if nof_bytes == 0?
+    return CDB_Stream::Append
+        (buff, nof_bytes ? nof_bytes : strlen((const char*) buff));
+}
+
+size_t CDB_Stream::x_Append(const CTempString& s, EEncoding enc)
+{
+    switch (m_Encoding) {
+    case eBulkEnc_RawBytes:
+        return Append(s.data(), s.size());
+    case eBulkEnc_RawUCS2:
+    {
+        TStringUCS2 s2 = CUtf8::AsBasicString<TCharUCS2>
+            (CUtf8::AsUTF8(s, enc));
+        s_MakeLittleEndian(s2);
+        return Append(s2.data(), s2.size() * sizeof(TCharUCS2));
+    }
+    default:
+        _TROUBLE;
+        return 0;
+    }
+}
+
+size_t CDB_Stream::x_Append(const TStringUCS2& s)
+{
+    x_SetEncoding(eBulkEnc_RawUCS2);
+#ifdef WORDS_BIGENDIAN
+    TStringUCS2 s2(s);
+    s_MakeLittleEndian(s2);
+    return Append(s2.data(), s2.size() * sizeof(TCharUCS2));
+#else
+    return Append(s.data(), s.size() * sizeof(TCharUCS2));
+#endif
+}
 
 /////////////////////////////////////////////////////////////////////////////
 //  CDB_Image::
@@ -2071,16 +2130,58 @@ CDB_Object* CDB_Image::ShallowClone() const
 
 
 /////////////////////////////////////////////////////////////////////////////
+//  CDB_VarBinaryMax::
+//
+
+CDB_VarBinaryMax::CDB_VarBinaryMax(void)
+{
+}
+
+CDB_VarBinaryMax::CDB_VarBinaryMax(const CDB_VarBinaryMax& v, bool share_data)
+    : CDB_Stream(v, share_data)
+{
+}
+
+CDB_VarBinaryMax::CDB_VarBinaryMax(const void* v, size_t l)
+{
+    Append(v, l);
+}
+
+CDB_VarBinaryMax::~CDB_VarBinaryMax(void)
+{
+}
+
+CDB_VarBinaryMax& CDB_VarBinaryMax::operator= (const CDB_VarBinaryMax& v)
+{
+    return dynamic_cast<CDB_VarBinaryMax&>(Assign(v));
+}
+
+EDB_Type CDB_VarBinaryMax::GetType() const
+{
+    return eDB_VarBinaryMax;
+}
+
+CDB_Object* CDB_VarBinaryMax::Clone() const
+{
+    return new CDB_VarBinaryMax(*this);
+}
+
+CDB_Object* CDB_VarBinaryMax::ShallowClone() const
+{
+    return new CDB_VarBinaryMax(*this, true);
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
 //  CDB_Text::
 //
 
 CDB_Text::CDB_Text(void)
-    : m_Encoding(eBulkEnc_RawBytes)
 {
 }
 
 CDB_Text::CDB_Text(const CDB_Text& text, bool share_data)
-    : CDB_Stream(text, share_data), m_Encoding(text.m_Encoding)
+    : CDB_Stream(text, share_data)
 {
 }
 
@@ -2090,59 +2191,25 @@ CDB_Text::~CDB_Text(void)
 
 void CDB_Text::SetEncoding(EBulkEnc e)
 {
-    if (e == eBulkEnc_UCS2FromChar) {
-        e = eBulkEnc_RawUCS2;
-    }
-    if (e != m_Encoding  &&  Size() > 0) {
-        // Alternatively, arrange to recode existing text?
-        ERR_POST_X(8, "Creating a mixed-encoding CDB_Text object.");
-    }
-    m_Encoding = e;
+    x_SetEncoding(e);
 }
 
 size_t CDB_Text::Append(const void* buff, size_t nof_bytes)
 {
-    if (buff == NULL) {
-        // return 0;
-        buff = kEmptyCStr;
-    }
-    // Warn if nof_bytes == 0?
-    return CDB_Stream::Append
-        (buff, nof_bytes ? nof_bytes : strlen((const char*) buff));
+    return x_Append(buff, nof_bytes);
 }
 
 size_t CDB_Text::Append(const CTempString& s, EEncoding enc)
 {
-    switch (m_Encoding) {
-    case eBulkEnc_RawBytes:
-        return CDB_Stream::Append(s.data(), s.size());
-    case eBulkEnc_RawUCS2:
-    {
-        TStringUCS2 s2 = CUtf8::AsBasicString<TCharUCS2>
-            (CUtf8::AsUTF8(s, enc));
-        s_MakeLittleEndian(s2);
-        return CDB_Stream::Append(s2.data(), s2.size() * sizeof(TCharUCS2));
-    }
-    default:
-        _TROUBLE;
-        return 0;
-    }
+    return x_Append(s, enc);
 }
 
 
 size_t CDB_Text::Append(const TStringUCS2& s)
 {
-    SetEncoding(eBulkEnc_RawUCS2);
-#ifdef WORDS_BIGENDIAN
-    TStringUCS2 s2(s);
-    s_MakeLittleEndian(s2);
-    return CDB_Stream::Append(s2.data(), s2.size() * sizeof(TCharUCS2));
-#else
-    return CDB_Stream::Append(s.data(), s.size() * sizeof(TCharUCS2));
-#endif
+    return x_Append(s);
 }
 
-
 CDB_Text& CDB_Text::operator= (const CDB_Text& text)
 {
     m_Encoding = text.m_Encoding;
@@ -2166,6 +2233,86 @@ CDB_Object* CDB_Text::ShallowClone() const
 
 
 /////////////////////////////////////////////////////////////////////////////
+//  CDB_VarCharMax::
+//
+
+CDB_VarCharMax::CDB_VarCharMax(void)
+{
+}
+
+CDB_VarCharMax::CDB_VarCharMax(const CDB_VarCharMax& v, bool share_data)
+    : CDB_Stream(v, share_data)
+{
+}
+
+CDB_VarCharMax::CDB_VarCharMax(const string& s, EEncoding enc)
+{
+    SetValue(s, enc);
+}
+
+CDB_VarCharMax::CDB_VarCharMax(const char* s, EEncoding enc)
+{
+    SetValue(s, enc);
+}
+
+CDB_VarCharMax::CDB_VarCharMax(const char* s, size_t l, EEncoding enc)
+{
+    SetValue(s, l, enc);
+}
+
+CDB_VarCharMax::CDB_VarCharMax(const TStringUCS2& s)
+{
+    SetValue(s);
+}
+
+CDB_VarCharMax::~CDB_VarCharMax(void)
+{
+}
+
+void CDB_VarCharMax::SetEncoding(EBulkEnc e)
+{
+    x_SetEncoding(e);
+}
+
+size_t CDB_VarCharMax::Append(const void* buff, size_t nof_bytes)
+{
+    return x_Append(buff, nof_bytes);
+}
+
+size_t CDB_VarCharMax::Append(const CTempString& s, EEncoding enc)
+{
+    return x_Append(s, enc);
+}
+
+size_t CDB_VarCharMax::Append(const TStringUCS2& s)
+{
+    return x_Append(s);
+}
+
+CDB_VarCharMax& CDB_VarCharMax::operator= (const CDB_VarCharMax& v)
+{
+    m_Encoding = v.m_Encoding;
+    return dynamic_cast<CDB_VarCharMax&>(Assign(v));
+}
+
+EDB_Type CDB_VarCharMax::GetType() const
+{
+    return eDB_VarCharMax;
+}
+
+CDB_Object* CDB_VarCharMax::Clone() const
+{
+    return new CDB_VarCharMax(*this);
+}
+
+CDB_Object* CDB_VarCharMax::ShallowClone() const
+{
+    return new CDB_VarCharMax(*this, true);
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////////
 //  CDB_SmallDateTime::
 //
 
@@ -2705,7 +2852,7 @@ void CDB_Numeric::x_MakeFromString(unsigned int precision, unsigned int scale,
         precision = (unsigned int) s.size();
         if (scale == 0) {
             SIZE_TYPE dot_pos = s.find('.');
-            scale = (dot_pos == NPOS) ? 0 : precision - dot_pos;
+            scale = (dot_pos == NPOS) ? 0 : precision - (unsigned int) dot_pos;
             if (scale > 1)
                 --scale;
         }
diff --git a/c++/src/dbapi/driver_mgr.cpp b/c++/src/dbapi/driver_mgr.cpp
index a5d04fe..5399a64 100644
--- a/c++/src/dbapi/driver_mgr.cpp
+++ b/c++/src/dbapi/driver_mgr.cpp
@@ -1,4 +1,4 @@
-/* $Id: driver_mgr.cpp 403742 2013-06-18 15:26:09Z grichenk $
+/* $Id: driver_mgr.cpp 497437 2016-04-06 17:56:55Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -23,7 +23,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: driver_mgr.cpp 403742 2013-06-18 15:26:09Z grichenk $
+* File Name:  $Id: driver_mgr.cpp 497437 2016-04-06 17:56:55Z ivanov $
 *
 * Author:  Michael Kholodov, Denis Vakatov
 *
@@ -127,7 +127,7 @@ IDataSource* CDriverManager::CreateDsFrom(const string&    drivers,
     CMutexGuard mg(m_Mutex);
 
     list<string> names;
-    NStr::Split(drivers, ":", names);
+    NStr::Split(drivers, ":", names, NStr::fSplit_Tokenize);
 
     list<string>::iterator i_name = names.begin();
     for( ; i_name != names.end(); ++i_name ) {
diff --git a/c++/src/dbapi/rs_impl.cpp b/c++/src/dbapi/rs_impl.cpp
index 2beff34..5dbee97 100644
--- a/c++/src/dbapi/rs_impl.cpp
+++ b/c++/src/dbapi/rs_impl.cpp
@@ -1,4 +1,4 @@
-/* $Id: rs_impl.cpp 440005 2014-07-08 17:43:59Z ucko $
+/* $Id: rs_impl.cpp 498375 2016-04-15 17:20:50Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -23,7 +23,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: rs_impl.cpp 440005 2014-07-08 17:43:59Z ucko $
+* File Name:  $Id: rs_impl.cpp 498375 2016-04-15 17:20:50Z ivanov $
 *
 * Author:  Michael Kholodov
 *
@@ -209,7 +209,7 @@ bool CResultSet::Next()
     if( more && !IsDisableBind() ) {
         for(unsigned int i = 0; i < m_rs->NofItems(); ++i ) {
             EDB_Type type = m_rs->ItemDataType(i);
-            if( type == eDB_Text || type == eDB_Image )  {
+            if (CDB_Object::IsBlobType(type)) {
                 break;
             }
             ++m_column;
@@ -256,9 +256,9 @@ void CResultSet::x_CacheItems(int last_num) {
         EDB_Type type = m_rs->ItemDataType(ind);
 
         CVariant& var = m_data[ind];
-        if (type == eDB_Text  ||  type == eDB_Image) {
+        if (CDB_Object::IsBlobType(type)) {
             ((CDB_Stream*)var.GetNonNullData())->Truncate();
-            var.SetITDescriptor(m_rs->GetImageOrTextDescriptor());
+            var.SetBlobDescriptor(m_rs->GetBlobDescriptor());
         }
         m_rs->GetItem(var.GetNonNullData());
 
@@ -286,7 +286,7 @@ size_t CResultSet::Read(void* buf, size_t size)
         return 0;
     }
     else {
-        int ret = m_rs->ReadItem(buf, size, &m_wasNull);
+        size_t ret = m_rs->ReadItem(buf, size, &m_wasNull);
         if( ret == 0 ) {
             m_column = m_rs->CurrentItemNo();
         }
@@ -359,14 +359,14 @@ CNcbiOstream& CResultSet::xGetBlobOStream(CDB_Connection *cdb_conn,
 
     // GetConnAux() returns pointer to pooled CDB_Connection.
     // we need to delete it every time we request new one.
-    // The same with ITDescriptor
+    // The same with BlobDescriptor
     delete m_ostr;
 
-    // Call ReadItem(0, 0) before getting text/image descriptor
+    // Call ReadItem(0, 0) before getting BLOB descriptor
     m_rs->ReadItem(0, 0);
 
 
-    auto_ptr<I_ITDescriptor> desc(m_rs->GetImageOrTextDescriptor());
+    auto_ptr<I_BlobDescriptor> desc(m_rs->GetBlobDescriptor());
     if(desc.get() == NULL) {
 #ifdef _DEBUG
         NcbiCerr << "CResultSet::GetBlobOStream(): zero IT Descriptor" << endl;
diff --git a/c++/src/dbapi/rsmeta_impl.cpp b/c++/src/dbapi/rsmeta_impl.cpp
index 81f1341..6c8985c 100644
--- a/c++/src/dbapi/rsmeta_impl.cpp
+++ b/c++/src/dbapi/rsmeta_impl.cpp
@@ -1,4 +1,4 @@
-/* $Id: rsmeta_impl.cpp 119133 2008-02-05 21:14:42Z ssikorsk $
+/* $Id: rsmeta_impl.cpp 487444 2015-12-17 18:38:53Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE                          
@@ -23,7 +23,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: rsmeta_impl.cpp 119133 2008-02-05 21:14:42Z ssikorsk $
+* File Name:  $Id: rsmeta_impl.cpp 487444 2015-12-17 18:38:53Z ucko $
 *
 * Author:  Michael Kholodov
 *   
@@ -81,7 +81,7 @@ unsigned int CResultSetMetaData::FindParamPosInternal(const string& name) const
 {
     const size_t param_num = m_colInfo.size();
 
-    for (size_t i = 0; i < param_num; ++i) {
+    for (unsigned int i = 0; i < param_num; ++i) {
         if (m_colInfo[i].m_name == name) {
             return i;
         }
@@ -93,7 +93,7 @@ unsigned int CResultSetMetaData::FindParamPosInternal(const string& name) const
 
 unsigned int CResultSetMetaData::GetTotalColumns() const 
 {
-    return m_colInfo.size();
+    return (unsigned int)m_colInfo.size();
 }
 
 EDB_Type CResultSetMetaData::GetType(const CDBParamVariant& param) const 
diff --git a/c++/src/dbapi/rw_impl.cpp b/c++/src/dbapi/rw_impl.cpp
index da2b51d..dcb00d4 100644
--- a/c++/src/dbapi/rw_impl.cpp
+++ b/c++/src/dbapi/rw_impl.cpp
@@ -1,4 +1,4 @@
-/* $Id: rw_impl.cpp 426478 2014-02-10 19:48:45Z ucko $
+/* $Id: rw_impl.cpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE                          
@@ -90,7 +90,7 @@ CxBlobWriter::CxBlobWriter(CDB_CursorCmd* curCmd,
 }
 
 CxBlobWriter::CxBlobWriter(CDB_Connection* conn,
-                         I_ITDescriptor &d,
+                         I_BlobDescriptor &d,
                          size_t blobsize, 
                          TBlobOStreamFlags flags,
                          bool destroy)
diff --git a/c++/src/dbapi/rw_impl.hpp b/c++/src/dbapi/rw_impl.hpp
index dd991f3..020ba6f 100644
--- a/c++/src/dbapi/rw_impl.hpp
+++ b/c++/src/dbapi/rw_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef _RW_IMPL_HPP_
 #define _RW_IMPL_HPP_
 
-/* $Id: rw_impl.hpp 426478 2014-02-10 19:48:45Z ucko $
+/* $Id: rw_impl.hpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE                          
@@ -60,14 +60,14 @@ private:
     CResultSet *m_rs;
 };
 
-class I_ITDescriptor;
+class I_BlobDescriptor;
 
 class NCBI_DBAPI_EXPORT CxBlobWriter : public IWriter
 {
 public:
 
     CxBlobWriter(CDB_Connection* conn,
-                I_ITDescriptor &d,
+                I_BlobDescriptor &d,
                 size_t blobsize, 
                 TBlobOStreamFlags flags,
 				bool destroy);
diff --git a/c++/src/dbapi/stmt_impl.cpp b/c++/src/dbapi/stmt_impl.cpp
index 1251ccc..64d2062 100644
--- a/c++/src/dbapi/stmt_impl.cpp
+++ b/c++/src/dbapi/stmt_impl.cpp
@@ -1,4 +1,4 @@
-/* $Id: stmt_impl.cpp 426478 2014-02-10 19:48:45Z ucko $
+/* $Id: stmt_impl.cpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -23,7 +23,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: stmt_impl.cpp 426478 2014-02-10 19:48:45Z ucko $
+* File Name:  $Id: stmt_impl.cpp 498367 2016-04-15 17:18:04Z ivanov $
 *
 * Author:  Michael Kholodov
 *
@@ -289,7 +289,7 @@ bool CStatement::HasRows()
     return m_irs != 0;
 }
 
-IWriter* CStatement::GetBlobWriter(I_ITDescriptor &d, size_t blob_size,
+IWriter* CStatement::GetBlobWriter(I_BlobDescriptor &d, size_t blob_size,
                                    TBlobOStreamFlags flags)
 {
     delete m_wr;
@@ -299,7 +299,7 @@ IWriter* CStatement::GetBlobWriter(I_ITDescriptor &d, size_t blob_size,
     return m_wr;
 }
 
-CNcbiOstream& CStatement::GetBlobOStream(I_ITDescriptor &d, size_t blob_size,
+CNcbiOstream& CStatement::GetBlobOStream(I_BlobDescriptor &d, size_t blob_size,
                                          TBlobOStreamFlags flags,
                                          size_t buf_size)
 {
diff --git a/c++/src/dbapi/stmt_impl.hpp b/c++/src/dbapi/stmt_impl.hpp
index 1e3b5ff..fde06c5 100644
--- a/c++/src/dbapi/stmt_impl.hpp
+++ b/c++/src/dbapi/stmt_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef _STMT_IMPL_HPP_
 #define _STMT_IMPL_HPP_
 
-/* $Id: stmt_impl.hpp 426478 2014-02-10 19:48:45Z ucko $
+/* $Id: stmt_impl.hpp 498367 2016-04-15 17:18:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE                          
@@ -26,7 +26,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: stmt_impl.hpp 426478 2014-02-10 19:48:45Z ucko $
+* File Name:  $Id: stmt_impl.hpp 498367 2016-04-15 17:18:04Z ivanov $
 *
 * Author:  Michael Kholodov
 *   
@@ -78,19 +78,19 @@ public:
 
     virtual IConnection* GetParentConn();
 
-    virtual IWriter* GetBlobWriter(I_ITDescriptor &d, size_t blob_size,
+    virtual IWriter* GetBlobWriter(I_BlobDescriptor &d, size_t blob_size,
                                    TBlobOStreamFlags flags);
-    virtual IWriter* GetBlobWriter(I_ITDescriptor &d, size_t blob_size,
+    virtual IWriter* GetBlobWriter(I_BlobDescriptor &d, size_t blob_size,
                                    EAllowLog log_it)
     {
         return IStatement::GetBlobWriter(d, blob_size, log_it);
     }
 
-    virtual CNcbiOstream& GetBlobOStream(I_ITDescriptor &d, 
+    virtual CNcbiOstream& GetBlobOStream(I_BlobDescriptor &d, 
                                          size_t blob_size, 
                                          TBlobOStreamFlags flags,
                                          size_t buf_size);
-    virtual CNcbiOstream& GetBlobOStream(I_ITDescriptor &d, 
+    virtual CNcbiOstream& GetBlobOStream(I_BlobDescriptor &d, 
 		                                 size_t blob_size, 
 										 EAllowLog log_it,
                                          size_t buf_size)
diff --git a/c++/src/dbapi/variant.cpp b/c++/src/dbapi/variant.cpp
index 58054ba..3d4025f 100644
--- a/c++/src/dbapi/variant.cpp
+++ b/c++/src/dbapi/variant.cpp
@@ -1,4 +1,4 @@
-/* $Id: variant.cpp 420801 2013-12-05 16:20:55Z ucko $
+/* $Id: variant.cpp 498375 2016-04-15 17:20:50Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -23,7 +23,7 @@
 *
 * ===========================================================================
 *
-* File Name:  $Id: variant.cpp 420801 2013-12-05 16:20:55Z ucko $
+* File Name:  $Id: variant.cpp 498375 2016-04-15 17:20:50Z ivanov $
 *
 * Author:  Michael Kholodov
 *
@@ -117,6 +117,17 @@ CVariant CVariant::VarChar(const TStringUCS2 &s, size_t len)
     return CVariant(len ? new CDB_VarChar(s, len) : new CDB_VarChar(s));
 }
 
+CVariant CVariant::VarCharMax(const char *p, size_t len)
+{
+    return CVariant(p ? (len ? new CDB_VarCharMax(p, len)
+                         : new CDB_VarCharMax(p))
+                    : new CDB_VarCharMax());
+}
+CVariant CVariant::VarCharMax(const TStringUCS2 &s, size_t len)
+{
+    return CVariant(len ? new CDB_VarCharMax(s, len) : new CDB_VarCharMax(s));
+}
+
 CVariant CVariant::Char(size_t size, const char *p)
 {
     return CVariant(p ? new CDB_Char(size, p) : new CDB_Char(size));
@@ -137,6 +148,11 @@ CVariant CVariant::VarBinary(const void *p, size_t len)
     return CVariant(p ? new CDB_VarBinary(p, len) : new CDB_VarBinary());
 }
 
+CVariant CVariant::VarBinaryMax(const void *p, size_t len)
+{
+    return CVariant(p ? new CDB_VarBinaryMax(p, len) : new CDB_VarBinaryMax());
+}
+
 CVariant CVariant::Binary(size_t size, const void *p, size_t len)
 {
     return CVariant(p ? new CDB_Binary(size, p, len) : new CDB_Binary(size));
@@ -229,6 +245,12 @@ CVariant::CVariant(EDB_Type type, size_t size)
     case eDB_Image:
         m_data = new CDB_Image();
         return;
+    case eDB_VarCharMax:
+        m_data = new CDB_VarCharMax();
+        return;
+    case eDB_VarBinaryMax:
+        m_data = new CDB_VarBinaryMax();
+        return;
     case eDB_Bit:
         m_data = new CDB_Bit();
         return;
@@ -423,19 +445,15 @@ string CVariant::GetString(void) const
                 break;
             case eDB_Text:
             case eDB_Image:
+            case eDB_VarCharMax:
+            case eDB_VarBinaryMax:
                 {
                     CDB_Stream* stream = (CDB_Stream*)GetData();
-                    char* buff[4096];
-                    size_t read_bytes = 0;
-                
-                    s.reserve(stream->Size());
-                    while ((read_bytes = stream->Read(buff, sizeof(buff))) != 0) {
-                        s.append((const char*) buff, read_bytes);
-
-                        if (read_bytes < sizeof(buff)) {
-                            break;
-                        }
-                    }
+                    size_t n = stream->Size();
+                    s.resize(n);
+                    size_t n2 = stream->PeekAt(&s[0], 0, n);
+                    _ASSERT(n2 == n);
+                    s.resize(n2);
                 }
                 break;
             default:
@@ -618,11 +636,9 @@ size_t CVariant::Read(void* buf, size_t len) const
 {
     if( !IsNull() )
     {
-        switch(GetType()) {
-        case eDB_Image:
-        case eDB_Text:
+        if (CDB_Object::IsBlobType(GetType())) {
             return ((CDB_Stream*)GetData())->Read(buf, len);
-        default:
+        } else {
             x_Inapplicable_Method("Read()");
         }
     }
@@ -631,12 +647,9 @@ size_t CVariant::Read(void* buf, size_t len) const
 
 size_t CVariant::Append(const void* buf, size_t len)
 {
-    switch(GetType()) {
-    case eDB_Image:
-    case eDB_Text:
+    if (CDB_Object::IsBlobType(GetType())) {
         return ((CDB_Stream*)GetData())->Append(buf, len);
-
-    default:
+    } else {
         x_Inapplicable_Method("Append()");
     }
     return 0;
@@ -648,6 +661,9 @@ size_t CVariant::Append(const string& str)
     case eDB_Text:
         return ((CDB_Text*)GetData())->Append(str);
 
+    case eDB_VarCharMax:
+        return ((CDB_VarCharMax*)GetData())->Append(str);
+
     default:
         x_Inapplicable_Method("Append()");
     }
@@ -660,6 +676,9 @@ size_t CVariant::Append(const TStringUCS2& str)
     case eDB_Text:
         return ((CDB_Text*)GetData())->Append(str);
 
+    case eDB_VarCharMax:
+        return ((CDB_VarCharMax*)GetData())->Append(str);
+
     default:
         x_Inapplicable_Method("Append()");
     }
@@ -668,11 +687,9 @@ size_t CVariant::Append(const TStringUCS2& str)
 
 size_t CVariant::GetBlobSize() const
 {
-    switch(GetType()) {
-    case eDB_Image:
-    case eDB_Text:
+    if (CDB_Object::IsBlobType(GetType())) {
         return ((CDB_Stream*)GetData())->Size();
-    default:
+    } else {
         x_Inapplicable_Method("GetBlobSize()");
     }
     return 0;
@@ -680,14 +697,9 @@ size_t CVariant::GetBlobSize() const
 
 void CVariant::Truncate(size_t len)
 {
-    switch(GetType()) {
-    case eDB_Image:
-        ((CDB_Image*)GetData())->Truncate(len);
-        break;
-    case eDB_Text:
-        ((CDB_Text*)GetData())->Truncate(len);
-        break;
-    default:
+    if (CDB_Object::IsBlobType(GetType())) {
+        ((CDB_Stream*)GetData())->Truncate(len);
+    } else {
         x_Inapplicable_Method("Truncate()");
     }
     return;
@@ -695,12 +707,9 @@ void CVariant::Truncate(size_t len)
 
 bool CVariant::MoveTo(size_t pos) const
 {
-    switch(GetType()) {
-    case eDB_Image:
-        return ((CDB_Image*)GetData())->MoveTo(pos);
-    case eDB_Text:
-        return ((CDB_Text*)GetData())->MoveTo(pos);
-    default:
+    if (CDB_Object::IsBlobType(GetType())) {
+        return ((CDB_Stream*)GetData())->MoveTo(pos);
+    } else {
         x_Inapplicable_Method("MoveTo()");
     }
     return false;
@@ -951,6 +960,8 @@ EBulkEnc CVariant::GetBulkInsertionEnc(void) const
         return ((const CDB_String*)GetData())->GetBulkInsertionEnc();
     case eDB_Text:
         return ((const CDB_Text*)GetData())->GetEncoding();
+    case eDB_VarCharMax:
+        return ((const CDB_VarCharMax*)GetData())->GetEncoding();
     default:
         return eBulkEnc_RawBytes;
     }
@@ -971,6 +982,9 @@ void CVariant::SetBulkInsertionEnc(EBulkEnc e)
     case eDB_Text:
         ((CDB_Text*)GetData())->SetEncoding(e);
         break;
+    case eDB_VarCharMax:
+        ((CDB_VarCharMax*)GetData())->SetEncoding(e);
+        break;
     default:
         break;
     }
diff --git a/c++/src/objects/Makefile.in b/c++/src/objects/Makefile.in
index 1db09a8..78a9c4d 100644
--- a/c++/src/objects/Makefile.in
+++ b/c++/src/objects/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in 485953 2015-11-30 17:53:34Z blastadm $
+# $Id: Makefile.in 437784 2014-06-10 14:26:24Z fongah2 $
 
 # Meta-makefile("objects" project)
 #################################
diff --git a/c++/src/objects/Makefile.sources b/c++/src/objects/Makefile.sources
index c03c805..cad3b3b 100644
--- a/c++/src/objects/Makefile.sources
+++ b/c++/src/objects/Makefile.sources
@@ -1,4 +1,4 @@
-# $Id: Makefile.sources 485953 2015-11-30 17:53:34Z blastadm $
+# $Id: Makefile.sources 484985 2015-11-17 19:49:04Z ucko $
 #
 # Generate ASN.1 serialization code in the "objects/" projects
 
@@ -24,7 +24,7 @@ all all_files sources makefiles directories purge_sources purge_all_sources purg
 	+cd $(srcdir) || exit 2; \
 	for i in $(MODULES); do \
 	  if test -f "$$i/$$i.asn"; then \
-	    MAKE=$(MAKE); export MAKE; \
+	    MAKE="$(MAKE) $(MFLAGS)"; export MAKE; \
 	    ( cd $$i && $(new_module) $$i $@; ) \
 	    || case "$(MFLAGS)" in *k*) ;; *) exit 2 ;; esac; \
 	  else \
diff --git a/c++/src/objects/biotree/biotree.asn b/c++/src/objects/biotree/biotree.asn
index c6e7b57..e07dd73 100644
--- a/c++/src/objects/biotree/biotree.asn
+++ b/c++/src/objects/biotree/biotree.asn
@@ -1,4 +1,4 @@
---$Revision: 480521 $
+--$Revision: 480916 $
 --*********************************************************************
 --
 --  biotree.asn
diff --git a/c++/src/objects/blast/blast.asn b/c++/src/objects/blast/blast.asn
index 4ed027e..02200b7 100644
--- a/c++/src/objects/blast/blast.asn
+++ b/c++/src/objects/blast/blast.asn
@@ -69,7 +69,8 @@ Blast4-archive ::= SEQUENCE {
     request                 Blast4-request,
 
     -- Results of search
-    results                 Blast4-get-search-results-reply
+    results                 Blast4-get-search-results-reply,
+    messages                SEQUENCE OF Blast4-error OPTIONAL 
 }
 
 Blast4-request-body ::= CHOICE {
@@ -164,16 +165,6 @@ Blast4-queue-search-request ::= SEQUENCE {
     format-options          Blast4-parameters OPTIONAL
 }
 
--- Simplified search submission structure
-Blast4-queue-search-request-lite ::= SEQUENCE {
-    -- query sequence: provide a FASTA sequence, a gi number, or an accession
-    query                   VisibleString,      
-    -- Name of BLAST database to search
-    database-name           VisibleString,
-    -- BLAST options
-    options                 Blast4-options-lite
-}
-
 -- Request to retrieve the status of a given search
 Blast4-get-search-status-request ::= SEQUENCE {
     request-id              VisibleString
@@ -377,77 +368,6 @@ Blast4-error-code ::= INTEGER {
 
 --  --------------------------------------------------------------------
 --
---  Data types to be used in BLAST4 "Lite"
---
---  --------------------------------------------------------------------
-
-Blast4-common-options-db-restriction-by-organism ::= CHOICE {
-    organism-restriction        VisibleString,          -- additional restriction on the database to search
-    taxid-restriction           INTEGER                 -- same as above, specified with a taxid
-}
-
-Blast4-common-options-db-restriction ::= SEQUENCE {
-    entrez-query                VisibleString OPTIONAL, -- entrez query restriction on the database to search
-    organism                    Blast4-common-options-db-restriction-by-organism OPTIONAL
-}
-
-Blast4-common-options-repeats-filtering ::= SEQUENCE {
-    organism-taxid              INTEGER DEFAULT 9606    -- defaults to human
-}
-
-Blast4-common-options-query-filtering ::= SEQUENCE {
-    -- use SEG filtering with default parameters
-    use-seg-filtering           BOOLEAN OPTIONAL, 
-    -- use DUST filtering with default parameters
-    use-dust-filtering          BOOLEAN OPTIONAL,
-    -- mask for lookup table only (i.e.: soft masking)
-    mask-for-lookup-table-only  BOOLEAN OPTIONAL,
-    repeats-filtering           Blast4-common-options-repeats-filtering OPTIONAL,
-    -- user specified masking locations
-    user-specified-masks        SEQUENCE OF Blast4-mask OPTIONAL,
-    -- This overrides all other filtering options
-    no-filtering                BOOLEAN OPTIONAL
-}
-
-Blast4-common-options-discontiguous-megablast ::= SEQUENCE {
-    template-type               INTEGER,
-    template-length             INTEGER
-}
-
-Blast4-common-options-nucleotide-query ::= SEQUENCE {
-    strand-type-list            SEQUENCE OF Blast4-strand-type OPTIONAL, -- one per query
-    disco-megablast-options     Blast4-common-options-discontiguous-megablast OPTIONAL
-}
-
-Blast4-common-options-scoring ::= SEQUENCE {
-    matrix-name                 VisibleString OPTIONAL, -- e.g.: BLOSUM62, PAM30, etc
-    gap-opening-penalty         INTEGER OPTIONAL,
-    gap-extension-penalty       INTEGER OPTIONAL,
-    match-reward                INTEGER OPTIONAL,
-    mismatch-penalty            INTEGER OPTIONAL
-}
-
-Blast4-common-options ::= SEQUENCE {
-    percent-identity            REAL OPTIONAL,          -- percent identity of matches (0-100)
-    evalue                      REAL OPTIONAL,          -- e-value threshold
-    word-size                   INTEGER OPTIONAL,       -- word size to use in lookup table construction
-    hitlist-size                INTEGER OPTIONAL,       -- max number of database sequences to align
-    db-restriction              Blast4-common-options-db-restriction OPTIONAL,
-    query-filtering             Blast4-common-options-query-filtering OPTIONAL,
-    nucl-query-options          Blast4-common-options-nucleotide-query OPTIONAL,
-    scoring-options             Blast4-common-options-scoring OPTIONAL,
-    phi-pattern                 VisibleString OPTIONAL, -- PHI-BLAST pattern
-    eff-search-space            REAL OPTIONAL,          -- effective search space
-    comp-based-statistics       INTEGER OPTIONAL        -- Composition based statistics
-}
-
-Blast4-options-lite ::= SEQUENCE {
-    task                        VisibleString,
-    options                     Blast4-common-options OPTIONAL
-}
-
---  --------------------------------------------------------------------
---
 --  Other types in alphabetical order
 --
 --  --------------------------------------------------------------------
diff --git a/c++/src/objects/entrez2/Entrez2_id_list.cpp b/c++/src/objects/entrez2/Entrez2_id_list.cpp
index acd366d..5f7fa0a 100644
--- a/c++/src/objects/entrez2/Entrez2_id_list.cpp
+++ b/c++/src/objects/entrez2/Entrez2_id_list.cpp
@@ -1,4 +1,4 @@
-/* $Id: Entrez2_id_list.cpp 403742 2013-06-18 15:26:09Z grichenk $
+/* $Id: Entrez2_id_list.cpp 481294 2015-10-08 14:03:49Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -80,12 +80,12 @@ void CEntrez2_id_list::Resize(size_t size)
 }
 
 
-void CEntrez2_id_list::AssignUids(const vector<int>& uids)
+void CEntrez2_id_list::AssignUids(const vector<TUid>& uids)
 {
     Resize(uids.size());
 
     TUidIterator it = GetUidIterator();
-    ITERATE (vector<int>, iter, uids) {
+    ITERATE (vector<TUid>, iter, uids) {
         *it++ = *iter;
     }
 }
diff --git a/c++/src/objects/entrez2/entrez2_client.cpp b/c++/src/objects/entrez2/entrez2_client.cpp
index 1fb62cb..528478c 100644
--- a/c++/src/objects/entrez2/entrez2_client.cpp
+++ b/c++/src/objects/entrez2/entrez2_client.cpp
@@ -1,4 +1,4 @@
-/* $Id: entrez2_client.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/* $Id: entrez2_client.cpp 481294 2015-10-08 14:03:49Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -71,21 +71,22 @@ CEntrez2Client::~CEntrez2Client(void)
 /// A simplified interface for getting neighbors (links)
 
 /// This form just yields a vector of UIDs
-void CEntrez2Client::GetNeighbors(int query_uid, const string& db,
+void CEntrez2Client::GetNeighbors(TUid query_uid,
+                                  const string& db,
                                   const string& link_type,
-                                  vector<int>& neighbor_uids)
+                                  vector<TUid>& neighbor_uids)
 {
-    vector<int> uids;
+    vector<TUid> uids;
     uids.push_back(query_uid);
     GetNeighbors(uids, db, link_type, neighbor_uids);
 }
 
 
 /// This form just yields a vector of UIDs
-void CEntrez2Client::GetNeighbors(const vector<int>& query_uids,
+void CEntrez2Client::GetNeighbors(const vector<TUid>& query_uids,
                                   const string& db,
                                   const string& link_type,
-                                  vector<int>& neighbor_uids)
+                                  vector<TUid>& neighbor_uids)
 {
     // first retrieve the link_set
     CRef<CEntrez2_link_set> link_set;
@@ -105,11 +106,11 @@ void CEntrez2Client::GetNeighbors(const vector<int>& query_uids,
 
 /// This form returns the entire CEntrez2_link_set object,
 /// which includes scores.
-CRef<CEntrez2_link_set> CEntrez2Client::GetNeighbors(int query_uid,
+CRef<CEntrez2_link_set> CEntrez2Client::GetNeighbors(TUid query_uid,
                                                      const string& db,
                                                      const string& link_type)
 {
-    vector<int> uids;
+    vector<TUid> uids;
     uids.push_back(query_uid);
     return GetNeighbors(uids, db, link_type);
 }
@@ -118,7 +119,7 @@ CRef<CEntrez2_link_set> CEntrez2Client::GetNeighbors(int query_uid,
 /// This form returns the entire CEntrez2_link_set object,
 /// which includes scores.
 CRef<CEntrez2_link_set>
-CEntrez2Client::GetNeighbors(const vector<int>& query_uids,
+CEntrez2Client::GetNeighbors(const vector<TUid>& query_uids,
                              const string& db,
                              const string& link_type)
 {
@@ -137,7 +138,7 @@ CEntrez2Client::GetNeighbors(const vector<int>& query_uids,
 
 /// Retrieve counts of the various types of neighbors available
 CRef<CEntrez2_link_count_list>
-CEntrez2Client::GetNeighborCounts(int query_uid,
+CEntrez2Client::GetNeighborCounts(TUid query_uid,
                                   const string& db)
 {
     CEntrez2_id uid;
@@ -148,9 +149,11 @@ CEntrez2Client::GetNeighborCounts(int query_uid,
 
 
 /// Query a db with a string, returning uids as integers
-void CEntrez2Client::Query(const string& query, const string& db,
-                           vector<int>& result_uids,
-                           size_t start, size_t count,
+void CEntrez2Client::Query(const string& query,
+                           const string& db,
+                           vector<TUid>& result_uids,
+                           size_t start,
+                           size_t count,
                            TReply* reply)
 {
     CRef<CEntrez2_boolean_element> bel(new CEntrez2_boolean_element);
@@ -193,9 +196,10 @@ void CEntrez2Client::Query(const string& query, const string& db,
 /// Note: If a uid appears more than once in query_uids and
 /// matches the query string, it may or may not appear more
 /// more than once in the result.
-void CEntrez2Client::FilterIds(const vector<int>& query_uids, const string& db,
+void CEntrez2Client::FilterIds(const vector<TUid>& query_uids,
+                               const string& db,
                                const string& query_string,
-                               vector<int>& result_uids)
+                               vector<TUid>& result_uids)
 {
     const unsigned int kMaxIdsInQueryString = 2500;
 
@@ -207,18 +211,18 @@ void CEntrez2Client::FilterIds(const vector<int>& query_uids, const string& db,
         // Query with a big query string that includes
         // all the query_uids OR'd together
         string uids;
-        ITERATE (vector<int>, uid, query_uids) {
+        ITERATE (vector<TUid>, uid, query_uids) {
             if ( !uids.empty() ) {
                 uids += " OR ";
             }
-            uids += NStr::IntToString(*uid) + "[UID]";
+            uids += NStr::NumericToString(*uid) + "[UID]";
         }
 
         string whole_query = "(" + query_string + ") AND (" + uids + ")";
         Query(whole_query, db, result_uids);
     } else {
         // Break query_uids into chunks <= kMaxIdsInQueryString
-        vector<int> subset_query_uids;
+        vector<TUid> subset_query_uids;
         subset_query_uids.reserve(kMaxIdsInQueryString);
         for (size_t start = 0;  start < query_uids.size();
              start += kMaxIdsInQueryString) {
@@ -237,7 +241,7 @@ void CEntrez2Client::FilterIds(const vector<int>& query_uids, const string& db,
 
 
 CRef<CEntrez2_docsum_list>
-CEntrez2Client::GetDocsums(const vector<int>& uids,
+CEntrez2Client::GetDocsums(const vector<TUid>& uids,
                            const string& db)
 {
     CEntrez2_id_list ids;
@@ -249,9 +253,9 @@ CEntrez2Client::GetDocsums(const vector<int>& uids,
 
 /// Retrieve the docsums for a single UID
 CRef<CEntrez2_docsum_list>
-CEntrez2Client::GetDocsums(int uid, const string& db)
+CEntrez2Client::GetDocsums(TUid uid, const string& db)
 {
-    vector<int> uids;
+    vector<TUid> uids;
     uids.push_back(uid);
     return GetDocsums(uids, db);
 }
@@ -300,6 +304,108 @@ CEntrez2Client::GetAffinity(const CEntrez2_request& request) const
 }
 
 
+#ifdef NCBI_STRICT_GI
+
+void CEntrez2Client::GetNeighbors(TGi query_uid,
+                                  const string& db_from,
+                                  const string& db_to,
+                                  vector<TGi>& neighbor_uids)
+{
+    vector<TUid> vi_neighbor_uids;
+    GetNeighbors(GI_TO(TUid, query_uid), db_from, db_to, vi_neighbor_uids);
+    ITERATE(vector<TUid>, it, vi_neighbor_uids) {
+        neighbor_uids.push_back(GI_FROM(TUid, *it));
+    }
+}
+
+void CEntrez2Client::GetNeighbors(const vector<TGi>& query_uids,
+                                  const string& db,
+                                  const string& link_type,
+                                  vector<TGi>& neighbor_uids)
+{
+    vector<TUid> vi_query_uids;
+    ITERATE(vector<TGi>, it, query_uids) {
+        vi_query_uids.push_back(GI_TO(TUid, *it));
+    }
+    vector<TUid> vi_neighbor_uids;
+    GetNeighbors(vi_query_uids, db, link_type, vi_neighbor_uids);
+    ITERATE(vector<TUid>, it, vi_neighbor_uids) {
+        neighbor_uids.push_back(GI_FROM(TUid, *it));
+    }
+}
+
+CRef<CEntrez2_link_set> CEntrez2Client::GetNeighbors(TGi query_uid,
+                                                     const string& db_from,
+                                                     const string& db_to)
+{
+    return GetNeighbors(GI_TO(TUid, query_uid), db_from, db_to);
+}
+
+CRef<CEntrez2_link_set> CEntrez2Client::GetNeighbors(const vector<TGi>& query_uids,
+                                                     const string& db_from,
+                                                     const string& db_to)
+{
+    vector<TUid> vi_query_uids;
+    ITERATE(vector<TGi>, it, query_uids) {
+        vi_query_uids.push_back(GI_TO(TUid, *it));
+    }
+    return GetNeighbors(vi_query_uids, db_from, db_to);
+}
+
+CRef<CEntrez2_link_count_list> CEntrez2Client::GetNeighborCounts(TGi query_uid,
+                                                                 const string& db)
+{
+    return GetNeighborCounts(GI_TO(TUid, query_uid), db);
+}
+
+void CEntrez2Client::Query(const string& query,
+                           const string& db,
+                           vector<TGi>& result_uids,
+                           size_t start_offs,
+                           size_t count,
+                           TReply* reply)
+{
+    vector<TUid> vi_result_uids;
+    Query(query, db, vi_result_uids, start_offs, count, reply);
+    ITERATE(vector<TUid>, it, vi_result_uids) {
+        result_uids.push_back(GI_FROM(TUid, *it));
+    }
+}
+
+void CEntrez2Client::FilterIds(const vector<TGi>& query_uids,
+                               const string& db,
+                               const string& query_string,
+                               vector<TGi>& result_uids)
+{
+    vector<TUid> vi_query_uids;
+    ITERATE(vector<TGi>, it, query_uids) {
+        vi_query_uids.push_back(GI_TO(TUid, *it));
+    }
+    vector<TUid> vi_result_uids;
+    FilterIds(vi_query_uids, db, query_string, vi_result_uids);
+    ITERATE(vector<TUid>, it, vi_result_uids) {
+        result_uids.push_back(GI_FROM(TUid, *it));
+    }
+}
+
+CRef<CEntrez2_docsum_list> CEntrez2Client::GetDocsums(const vector<TGi>& uids,
+                                                      const string& db)
+{
+    vector<TUid> vi_uids;
+    ITERATE(vector<TGi>, it, uids) {
+        vi_uids.push_back(GI_TO(TUid, *it));
+    }
+    return GetDocsums(vi_uids, db);
+}
+
+CRef<CEntrez2_docsum_list> CEntrez2Client::GetDocsums(TGi uid,
+                                                      const string& db)
+{
+    return GetDocsums(GI_TO(TUid, uid), db);
+}
+
+#endif
+
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
diff --git a/c++/src/objects/general/Dbtag.cpp b/c++/src/objects/general/Dbtag.cpp
index af64dee..3b93b33 100644
--- a/c++/src/objects/general/Dbtag.cpp
+++ b/c++/src/objects/general/Dbtag.cpp
@@ -1,4 +1,4 @@
-/* $Id: Dbtag.cpp 469010 2015-05-29 22:47:32Z kans $
+/* $Id: Dbtag.cpp 497059 2016-04-04 14:45:02Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -73,6 +73,7 @@ static const TDbxrefPair kApprovedDbXrefs[] = {
     { "BDGP_INS", CDbtag::eDbtagType_BDGP_INS },
     { "BEEBASE", CDbtag::eDbtagType_BEEBASE },
     { "BEETLEBASE", CDbtag::eDbtagType_BEETLEBASE },
+    { "BEI", CDbtag::eDbtagType_BEI },
     { "BGD", CDbtag::eDbtagType_BGD },
     { "BOLD", CDbtag::eDbtagType_BoLD },
     { "CDD", CDbtag::eDbtagType_CDD },
@@ -91,7 +92,6 @@ static const TDbxrefPair kApprovedDbXrefs[] = {
     { "FLYBASE", CDbtag::eDbtagType_FLYBASE },
     { "GABI", CDbtag::eDbtagType_GABI },
     { "GDB", CDbtag::eDbtagType_GDB },
-    { "GI", CDbtag::eDbtagType_GI },
     { "GO", CDbtag::eDbtagType_GO },
     { "GOA", CDbtag::eDbtagType_GOA },
     { "GRIN", CDbtag::eDbtagType_GRIN },
@@ -103,6 +103,7 @@ static const TDbxrefPair kApprovedDbXrefs[] = {
     { "HMP", CDbtag::eDbtagType_HMP },
     { "HOMD", CDbtag::eDbtagType_HOMD },
     { "HSSP", CDbtag::eDbtagType_HSSP },
+    { "I5KNAL", CDbtag::eDbtagType_I5KNAL },
     { "IKMC", CDbtag::eDbtagType_IKMC },
     { "IMGT/GENE-DB", CDbtag::eDbtagType_IMGT_GENEDB },
     { "IMGT/HLA", CDbtag::eDbtagType_IMGT_HLA },
@@ -159,6 +160,7 @@ static const TDbxrefPair kApprovedDbXrefs[] = {
     { "UniProtKB/TrEMBL", CDbtag::eDbtagType_UniProt_TrEMBL },
     { "UniSTS", CDbtag::eDbtagType_UniSTS },
     { "VBASE2", CDbtag::eDbtagType_VBASE2 },
+    { "VISTA", CDbtag::eDbtagType_VISTA },
     { "VectorBase", CDbtag::eDbtagType_VectorBase },
     { "Vega", CDbtag::eDbtagType_Vega },
     { "ViPR", CDbtag::eDbtagType_ViPR },
@@ -203,6 +205,7 @@ static const TDbxrefPair kApprovedSrcDbXrefs[] = {
     { "ATCC(dna)", CDbtag::eDbtagType_ATCC_dna },
     { "ATCC(in host)", CDbtag::eDbtagType_ATCC_in_host },
     { "AntWeb", CDbtag::eDbtagType_AntWeb },
+    { "BEI", CDbtag::eDbtagType_BEI },
     { "BOLD", CDbtag::eDbtagType_BoLD },
     { "FANTOM_DB", CDbtag::eDbtagType_FANTOM_DB },
     { "FBOL", CDbtag::eDbtagType_FBOL },
@@ -555,7 +558,7 @@ typedef SStaticPair<CDbtag::EDbtagType, const char*>    TDbtUrl;
 static const TDbtUrl sc_url_prefix[] = {
     { CDbtag::eDbtagType_AFTOL, "http://wasabi.lutzonilab.net/pub/displayTaxonInfo?aftol_id=" },
     { CDbtag::eDbtagType_APHIDBASE, "http://bipaa.genouest.org/apps/grs-2.3/grs?reportID=aphidbase_transcript_report&objectID=" },
-    { CDbtag::eDbtagType_ASAP, "https://asap.ahabs.wisc.edu/annotation/php/feature_info.php?FeatureID=" },
+    { CDbtag::eDbtagType_ASAP, "https://asap.genetics.wisc.edu/asap/feature_info.php?FeatureID=" },
     { CDbtag::eDbtagType_ATCC, "http://www.atcc.org/Products/All/" },
     { CDbtag::eDbtagType_AceView_WormGenes, "http://www.ncbi.nlm.nih.gov/IEB/Research/Acembly/av.cgi?db=worm&c=gene&q=" },
     { CDbtag::eDbtagType_AntWeb, "http://www.antweb.org/specimen.do?name=" },
@@ -631,7 +634,7 @@ static const TDbtUrl sc_url_prefix[] = {
     { CDbtag::eDbtagType_RBGE_garden, "http://data.rbge.org.uk/living/" },
     { CDbtag::eDbtagType_RBGE_herbarium, "http://data.rbge.org.uk/herb/" },
     { CDbtag::eDbtagType_REBASE, "http://rebase.neb.com/rebase/enz/" },
-    { CDbtag::eDbtagType_RFAM, "http://www.sanger.ac.uk/cgi-bin/Rfam/getacc?" },
+    { CDbtag::eDbtagType_RFAM, "http://rfam.xfam.org/family/" },
     { CDbtag::eDbtagType_RGD, "http://rgd.mcw.edu/rgdweb/search/search.html?term=" },
     { CDbtag::eDbtagType_RiceGenes, "http://ars-genome.cornell.edu/cgi-bin/WebAce/webace?db=ricegenes&class=Marker&object=" },
     { CDbtag::eDbtagType_SEED, "http://www.theseed.org/linkin.cgi?id=" },
@@ -641,7 +644,7 @@ static const TDbtUrl sc_url_prefix[] = {
     { CDbtag::eDbtagType_SRPDB, "http://rnp.uthscsa.edu/rnp/SRPDB/rna/sequences/fasta/" },
     { CDbtag::eDbtagType_SubtiList, "http://genolist.pasteur.fr/SubtiList/genome.cgi?external_query+" },
     { CDbtag::eDbtagType_TAIR, "http://www.arabidopsis.org/servlets/TairObject?type=locus&name=" },
-    { CDbtag::eDbtagType_TIGRFAM, "http://cmr.tigr.org/tigr-scripts/CMR/HmmReport.cgi?hmm_acc=" },
+    { CDbtag::eDbtagType_TIGRFAM, "http://www.jcvi.org/cgi-bin/tigrfams/HmmReportPage.cgi?acc=" },
     { CDbtag::eDbtagType_UNITE, "http://unite.ut.ee/bl_forw.php?nimi=" },
     { CDbtag::eDbtagType_UniGene, "http://www.ncbi.nlm.nih.gov/unigene?term=" },
     { CDbtag::eDbtagType_UniProt_SwissProt, "http://www.uniprot.org/uniprot/" },
@@ -665,7 +668,7 @@ static const TDbtUrl sc_url_prefix[] = {
     { CDbtag::eDbtagType_dictyBase, "http://dictybase.org/db/cgi-bin/gene_page.pl?dictybaseid=" },
     { CDbtag::eDbtagType_miRBase, "http://www.mirbase.org/cgi-bin/mirna_entry.pl?acc=" },
     { CDbtag::eDbtagType_niaEST, "http://lgsun.grc.nia.nih.gov/cgi-bin/pro3?sname1=" },
-    { CDbtag::eDbtagType_taxon, "http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?" },
+    { CDbtag::eDbtagType_taxon, "https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?" },
     { CDbtag::eDbtagType_BEEBASE, "http://hymenopteragenome.org/cgi-bin/gb2/gbrowse/bee_genome45/?name=" },
     { CDbtag::eDbtagType_NASONIABASE, "http://hymenopteragenome.org/cgi-bin/gbrowse/nasonia10_scaffold/?name=" },
     { CDbtag::eDbtagType_BioProject, "http://www.ncbi.nlm.nih.gov/bioproject/" },
@@ -683,6 +686,9 @@ static const TDbtUrl sc_url_prefix[] = {
     { CDbtag::eDbtagType_GenBank, "http://www.ncbi.nlm.nih.gov/nuccore/" },
     { CDbtag::eDbtagType_BioSample, "http://www.ncbi.nlm.nih.gov/biosample/" },
     { CDbtag::eDbtagType_ISHAM_ITS, "http://its.mycologylab.org/BioloMICS.aspx?Table=Sequences&ExactMatch=T&Name=MITS" },
+    { CDbtag::eDbtagType_I5KNAL, "https://i5k.nal.usda.gov/" },
+    { CDbtag::eDbtagType_VISTA, "http://enhancer.lbl.gov/cgi-bin/dbxref.pl?id=" },
+    { CDbtag::eDbtagType_BEI, "https://www.beiresources.org/Catalog/animalViruses/" },
 };
 
 typedef CStaticPairArrayMap<CDbtag::EDbtagType, const char*> TUrlPrefixMap;
@@ -781,6 +787,10 @@ string CDbtag::GetUrl(const string & genus,
         }
         break;
 
+    case eDbtagType_BEI:
+        tag += ".aspx";
+        break;
+
     case CDbtag::eDbtagType_Fungorum:
         {
             int num_skip = 0;
diff --git a/c++/src/objects/general/User_field.cpp b/c++/src/objects/general/User_field.cpp
index bcb57b4..2dde71e 100644
--- a/c++/src/objects/general/User_field.cpp
+++ b/c++/src/objects/general/User_field.cpp
@@ -1,4 +1,4 @@
-/* $Id: User_field.cpp 405847 2013-07-09 13:56:53Z gouriano $
+/* $Id: User_field.cpp 490266 2016-01-22 16:40:57Z kornbluh $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -54,35 +54,78 @@ CUser_field::~CUser_field(void)
 }
 
 
-
 /// add fields to the current user field
-CUser_field& CUser_field::AddField(const string& label, int value)
+CUser_field& CUser_field::AddField(const string& label,
+                                   const string& value,
+                                   EParseField parse)
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetInt(value);
+    field->SetValue(value, parse);
     SetData().SetFields().push_back(field);
     return *this;
 }
 
 
-/// add fields to the current user field
 CUser_field& CUser_field::AddField(const string& label,
-                                   const CUser_field_Base::TData::TStr& value)
+                                   const string& value)
+{
+    return AddField(label, value, eParse_String);
+}
+
+
+CUser_field& CUser_field::AddField(const string& label,
+                                   const char* value)
+{
+    return AddField(label, string(value), eParse_String);
+}
+
+
+CUser_field& CUser_field::AddField(const string& label,
+                                   const char* value,
+                                   EParseField parse)
+{
+    return AddField(label, string(value), parse);
+}
+
+
+CUser_field& CUser_field::AddField(const string& label, int value)
+{
+    CRef<CUser_field> field(new CUser_field());
+    field->SetLabel().SetStr(label);
+    field->SetValue(value);
+    SetData().SetFields().push_back(field);
+    return *this;
+}
+
+
+CUser_field& CUser_field::AddField(const string& label, Int8 value)
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetStr(value);
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
 
 
+#ifdef NCBI_STRICT_GI
+CUser_field& CUser_field::AddField(const string& label, TGi value)
+{
+    CRef<CUser_field> field(new CUser_field());
+    field->SetLabel().SetStr(label);
+    field->SetValue(value);
+    SetData().SetFields().push_back(field);
+    return *this;
+}
+#endif
+
+
 CUser_field& CUser_field::AddField(const string& label, double value)
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetReal(value);
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
@@ -92,7 +135,7 @@ CUser_field& CUser_field::AddField(const string& label, bool value)
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetBool(value);
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
@@ -102,8 +145,7 @@ CUser_field& CUser_field::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(value.size());
-    field->SetData().SetStrs() = value;
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
@@ -113,8 +155,7 @@ CUser_field& CUser_field::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(value.size());
-    field->SetData().SetInts() = value;
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
@@ -125,8 +166,7 @@ CUser_field& CUser_field::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(value.size());
-    field->SetData().SetReals() = value;
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
@@ -137,7 +177,7 @@ CUser_field& CUser_field::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetObject(value);
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
@@ -148,8 +188,7 @@ CUser_field& CUser_field::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(value.size());
-    field->SetData().SetObjects() = value;
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
@@ -160,8 +199,7 @@ CUser_field& CUser_field::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(value.size());
-    field->SetData().SetFields() = value;
+    field->SetValue(value);
     SetData().SetFields().push_back(field);
     return *this;
 }
@@ -171,9 +209,10 @@ CUser_field& CUser_field::AddField(const string& label,
 /// string 'str' on the delimiters; if the field doesn't exist, an
 /// exception will be thrown.
 const CUser_field& CUser_field::GetField(const string& str,
-                                         const string& delim) const
+                                         const string& delim,
+                                         NStr::ECase use_case) const
 {
-    CConstRef<CUser_field> f = GetFieldRef(str, delim);
+    CConstRef<CUser_field> f = GetFieldRef(str, delim, use_case);
     if ( !f ) {
         NCBI_THROW(CException, eUnknown,
                    "failed to find field named " + str);
@@ -185,7 +224,8 @@ const CUser_field& CUser_field::GetField(const string& str,
 /// Return a field reference representing the tokenized key, or a
 /// NULL reference if the key doesn't exist.
 CConstRef<CUser_field> CUser_field::GetFieldRef(const string& str,
-                                                const string& delim) const
+                                                const string& delim,
+                                                NStr::ECase use_case) const
 {
     list<string> toks;
     NStr::Split(str, delim, toks);
@@ -193,7 +233,9 @@ CConstRef<CUser_field> CUser_field::GetFieldRef(const string& str,
     CConstRef<CUser_field> f(this);
     if ( !f->GetData().IsFields() ) {
         if (toks.size() == 1  &&
-            f->GetLabel().IsStr()  &&  f->GetLabel().GetStr() == toks.front()) {
+            f->GetLabel().IsStr()  &&
+            NStr::Equal(f->GetLabel().GetStr(), toks.front(), use_case))
+        {
             return f;
         } else {
             return CConstRef<CUser_field>();
@@ -210,7 +252,9 @@ CConstRef<CUser_field> CUser_field::GetFieldRef(const string& str,
             ITERATE (TData::TFields, field_iter, f->GetData().GetFields()) {
                 const CUser_field& field = **field_iter;
                 if (field.GetLabel().IsStr()
-                    &&  field.GetLabel().GetStr() == *iter) {
+                    &&  NStr::Equal(
+                        field.GetLabel().GetStr(), *iter, use_case) )
+                {
                     if (iter != last  &&  field.GetData().IsFields()) {
                         new_f = *field_iter;
                         break;
@@ -285,9 +329,10 @@ void CUser_field::GetFieldsMap(
 /// Access a named field in this user field.  This will tokenize the
 /// string 'str' on the delimiters and recursively add fields where needed
 CUser_field& CUser_field::SetField(const string& str,
-                                   const string& delim)
+                                   const string& delim,
+                                   NStr::ECase use_case)
 {
-    CRef<CUser_field> f = SetFieldRef(str, delim);
+    CRef<CUser_field> f = SetFieldRef(str, delim, use_case);
     return *f;
 }
 
@@ -295,7 +340,8 @@ CUser_field& CUser_field::SetField(const string& str,
 /// Return a field reference representing the tokenized key, or a
 /// NULL reference if the key cannot be created for some reason.
 CRef<CUser_field> CUser_field::SetFieldRef(const string& str,
-                                           const string& delim)
+                                           const string& delim,
+                                           NStr::ECase use_case)
 {
     list<string> toks;
     NStr::Split(str, delim, toks);
@@ -311,7 +357,8 @@ CRef<CUser_field> CUser_field::SetFieldRef(const string& str,
         CRef<CUser_field> new_f;
         NON_CONST_ITERATE (TData::TFields, field_iter, f->SetData().SetFields()) {
             const CUser_field& field = **field_iter;
-            if (field.GetLabel().GetStr() == *iter) {
+            if (NStr::Equal(field.GetLabel().GetStr(), *iter, use_case) )
+            {
                 if (iter == last) {
                     new_f = *field_iter;
                     break;
@@ -341,9 +388,10 @@ CRef<CUser_field> CUser_field::SetFieldRef(const string& str,
 
 /// Verify that a named field exists
 bool CUser_field::HasField(const string& str,
-                           const string& delim) const
+                           const string& delim,
+                           NStr::ECase use_case) const
 {
-    CConstRef<CUser_field> f = GetFieldRef(str, delim);
+    CConstRef<CUser_field> f = GetFieldRef(str, delim, use_case);
     return f.GetPointer() != NULL;
 }
 
@@ -351,7 +399,8 @@ bool CUser_field::HasField(const string& str,
 
 /// delete a named field.
 bool CUser_field::DeleteField(const string& str,
-                              const string& delim)
+                              const string& delim,
+                              NStr::ECase use_case)
 {
     list<string> toks;
     NStr::Split(str, delim, toks);
@@ -368,7 +417,8 @@ bool CUser_field::DeleteField(const string& str,
         NON_CONST_ITERATE (TData::TFields, field_iter, f->SetData().SetFields()) {
             const CUser_field& field = **field_iter;
             if (field.GetLabel().IsStr()
-                &&  field.GetLabel().GetStr() == *iter) {
+                &&  NStr::Equal(field.GetLabel().GetStr(), *iter, use_case) )
+            {
                 if (iter != last  &&  field.GetData().IsFields()) {
                     new_f = *field_iter;
                     break;
@@ -389,8 +439,119 @@ bool CUser_field::DeleteField(const string& str,
 }
 
 
+CUser_field& CUser_field::SetString(const char* value)
+{
+    return SetValue(string(value));
+}
+
+
+CUser_field& CUser_field::SetValue(const string& value, EParseField parse)
+{
+    if ( parse == eParse_Number ) {
+        try {
+            return SetValue(NStr::StringToNumeric<TData::TInt>(value));
+        }
+        catch (...) {
+        }
+
+        try {
+            return SetValue(NStr::StringToDouble(value));
+        }
+        catch (...) {
+        }
+    }
+    return SetValue(value);
+}
+
+
+CUser_field& CUser_field::SetValue(const char* value, EParseField parse)
+{
+    return SetValue(string(value), parse);
+}
+
+
+// 15 digits of REAL numbers are preserved in serialization roundtrip
+// so if the value has 15 digits or less we'll store it in 'real' field
+static const Int8 kMaxAsReal = NCBI_CONST_INT8(999999999999999);
+
+
+CUser_field& CUser_field::SetInt8(Int8 value)
+{
+    if ( value == int(value) ) {
+        // value fits in 'int' field
+        return SetInt(int(value));
+    }
+    if ( value >= -kMaxAsReal && value <= kMaxAsReal ) {
+        return SetDouble(double(value));
+    }
+    // otherwise the value is stored into 'str' field
+    return SetString(NStr::NumericToString(value));
+}
+
+
+CUser_field& CUser_field::SetValue(const vector<int>&    value)
+{
+    SetNum(value.size());
+    SetData().SetInts() = value;
+    return *this;
+}
+
+
+CUser_field& CUser_field::SetValue(const vector<double>& value)
+{
+    SetNum(value.size());
+    SetData().SetReals() = value;
+    return *this;
+}
+
+
+CUser_field& CUser_field::SetValue(const vector<string>& value)
+{
+    SetNum(value.size());
+    SetData().SetStrs() = value;
+    return *this;
+}
+
+
+CUser_field& CUser_field::SetValue(CUser_object& value)
+{
+    SetData().SetObject(value);
+    return *this;
+}
+
+
+CUser_field& CUser_field::SetValue(const vector< CRef<CUser_object> >& value)
+{
+    SetNum(value.size());
+    SetData().SetObjects() = value;
+    return *this;
+}
+
+
+CUser_field& CUser_field::SetValue(const vector< CRef<CUser_field> >& value)
+{
+    SetNum(value.size());
+    SetData().SetFields() = value;
+    return *this;
+}
+
+
+Int8 CUser_field::GetInt8(void) const
+{
+    const C_Data& data = GetData();
+    if ( data.IsInt() ) {
+        return data.GetInt();
+    }
+    if ( data.IsReal() ) {
+        double v = data.GetReal();
+        if ( v >= -kMaxAsReal && v <= kMaxAsReal ) {
+            return Int8(v);
+        }
+    }
+    return NStr::StringToNumeric<Int8>(data.GetStr());
+}
+
+
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
-
-/* Original file checksum: lines: 64, chars: 1886, CRC32: 5dc82940 */
diff --git a/c++/src/objects/general/User_object.cpp b/c++/src/objects/general/User_object.cpp
index fac10ca..d9789f2 100644
--- a/c++/src/objects/general/User_object.cpp
+++ b/c++/src/objects/general/User_object.cpp
@@ -1,4 +1,4 @@
-/* $Id: User_object.cpp 482748 2015-10-26 17:00:43Z ivanov $
+/* $Id: User_object.cpp 490266 2016-01-22 16:40:57Z kornbluh $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -48,6 +48,12 @@ BEGIN_NCBI_SCOPE
 
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
+
+SAFE_CONST_STATIC_STRING(kUnverifiedOrganism,     "Organism");
+SAFE_CONST_STATIC_STRING(kUnverifiedMisassembled, "Misassembled");
+SAFE_CONST_STATIC_STRING(kUnverifiedFeature,      "Features");
+
+
 // destructor
 CUser_object::~CUser_object(void)
 {
@@ -59,9 +65,10 @@ CUser_object::~CUser_object(void)
 // on a set of user-defined delimiters
 //
 const CUser_field& CUser_object::GetField(const string& str,
-                                          const string& delim) const
+                                          const string& delim,
+                                          NStr::ECase use_case) const
 {
-    CConstRef<CUser_field> ref(GetFieldRef(str, delim));
+    CConstRef<CUser_field> ref(GetFieldRef(str, delim, use_case));
     if (ref.Empty()) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "Unable to find User-field " + str);
@@ -71,7 +78,8 @@ const CUser_field& CUser_object::GetField(const string& str,
 
 
 CConstRef<CUser_field> CUser_object::GetFieldRef(const string& str,
-                                                 const string& delim) const
+                                                 const string& delim,
+                                                 NStr::ECase use_case) const
 {
     list<string> toks;
     NStr::Split(str, delim, toks);
@@ -101,7 +109,7 @@ CConstRef<CUser_field> CUser_object::GetFieldRef(const string& str,
         const CUser_field& field = **field_iter;
         if (field.IsSetLabel()  &&  field.GetLabel().IsStr()) {
             const string& this_label = field.GetLabel().GetStr();
-            if (this_label == first) {
+            if ( NStr::Equal(this_label, first, use_case) ) {
                 found = true;
             }
         }
@@ -111,7 +119,7 @@ CConstRef<CUser_field> CUser_object::GetFieldRef(const string& str,
 
         if ( !sub.empty() ) {
             CConstRef<CUser_field> field_ref =
-                (*field_iter)->GetFieldRef(sub, delim);
+                (*field_iter)->GetFieldRef(sub, delim, use_case);
             if (field_ref) {
                 return field_ref;
             }
@@ -124,9 +132,10 @@ CConstRef<CUser_field> CUser_object::GetFieldRef(const string& str,
 
 
 bool CUser_object::HasField(const string& str,
-                            const string& delim) const
+                            const string& delim,
+                            NStr::ECase use_case) const
 {
-    return GetFieldRef(str, delim).GetPointer() ? true : false;
+    return GetFieldRef(str, delim, use_case).GetPointer() ? true : false;
 }
 
 
@@ -136,15 +145,17 @@ bool CUser_object::HasField(const string& str,
 //
 CUser_field& CUser_object::SetField(const string& str,
                                     const string& delim,
-                                    const string& obj_subtype)
+                                    const string& obj_subtype,
+                                    NStr::ECase use_case)
 {
-    return *SetFieldRef(str, delim, obj_subtype);
+    return *SetFieldRef(str, delim, obj_subtype, use_case);
 }
 
 
 CRef<CUser_field> CUser_object::SetFieldRef(const string& str,
                                             const string& delim,
-                                            const string& /* obj_subtype */)
+                                            const string& /* obj_subtype */,
+                                            NStr::ECase use_case)
 {
     list<string> toks;
     NStr::Split(str, delim, toks);
@@ -155,7 +166,8 @@ CRef<CUser_field> CUser_object::SetFieldRef(const string& str,
     NON_CONST_ITERATE(TData, field_iter, SetData()) {
         CUser_field& field = **field_iter;
         if (field.GetLabel().IsStr()  &&
-            field.GetLabel().GetStr() == toks.front()) {
+            NStr::Equal(field.GetLabel().GetStr(), toks.front(), use_case))
+        {
             field_ref = *field_iter;
             break;
         }
@@ -170,7 +182,7 @@ CRef<CUser_field> CUser_object::SetFieldRef(const string& str,
     toks.pop_front();
     if (toks.size()) {
         string s = NStr::Join(toks, delim);
-        CRef<CUser_field> f = field_ref->SetFieldRef(s, delim);
+        CRef<CUser_field> f = field_ref->SetFieldRef(s, delim, use_case);
         field_ref = f;
     }
 
@@ -185,54 +197,65 @@ CUser_object& CUser_object::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    switch (parse) {
-    case eParse_Number:
-        try {
-            int i = NStr::StringToInt(value);
-            field->SetData().SetInt(i);
-            break;
-        }
-        catch (...) {
-        }
+    field->SetValue(value, CUser_field::EParseField(parse));
 
-        try {
-            double d = NStr::StringToDouble(value);
-            field->SetData().SetReal(d);
-            break;
-        }
-        catch (...) {
-        }
-        field->SetData().SetStr(CUtf8::AsUTF8(value,eEncoding_UTF8));
-        break;
+    SetData().push_back(field);
+    return *this;
+}
 
-    default:
-    case eParse_String:
-        field->SetData().SetStr(CUtf8::AsUTF8(value,eEncoding_UTF8));
-        break;
-    }
+
+CUser_object& CUser_object::AddField(const string& label,
+                                     const char* value,
+                                     EParseField parse)
+{
+    return AddField(label, string(value), parse);
+}
+
+
+CUser_object& CUser_object::AddField(const string& label,
+                                     Int8          value)
+{
+    CRef<CUser_field> field(new CUser_field());
+    field->SetLabel().SetStr(label);
+    field->SetValue(value);
 
     SetData().push_back(field);
     return *this;
 }
 
+
 CUser_object& CUser_object::AddField(const string& label,
                                      int           value)
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetInt(value);
+    field->SetValue(value);
 
     SetData().push_back(field);
     return *this;
 }
 
 
+#ifdef NCBI_STRICT_GI
+CUser_object& CUser_object::AddField(const string& label,
+                                     TGi           value)
+{
+    CRef<CUser_field> field(new CUser_field());
+    field->SetLabel().SetStr(label);
+    field->SetValue(value);
+
+    SetData().push_back(field);
+    return *this;
+}
+#endif
+
+
 CUser_object& CUser_object::AddField(const string& label,
                                      double        value)
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetReal(value);
+    field->SetValue(value);
 
     SetData().push_back(field);
     return *this;
@@ -244,7 +267,7 @@ CUser_object& CUser_object::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetBool(value);
+    field->SetValue(value);
 
     SetData().push_back(field);
     return *this;
@@ -257,7 +280,7 @@ CUser_object& CUser_object::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetData().SetObject(object);
+    field->SetValue(object);
 
     SetData().push_back(field);
     return *this;
@@ -269,13 +292,7 @@ CUser_object& CUser_object::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(value.size());
-
-    CUser_field_Base::C_Data::TStrs& dest = field->SetData().SetStrs();
-    dest.clear();
-    ITERATE(vector<string>, v, value) {
-        dest.push_back( CUtf8::AsUTF8( *v,eEncoding_UTF8));
-    }
+    field->SetValue(value);
 
     SetData().push_back(field);
     return *this;
@@ -287,8 +304,7 @@ CUser_object& CUser_object::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(value.size());
-    field->SetData().SetInts() = value;
+    field->SetValue(value);
 
     SetData().push_back(field);
     return *this;
@@ -300,8 +316,7 @@ CUser_object& CUser_object::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(value.size());
-    field->SetData().SetReals() = value;
+    field->SetValue(value);
 
     SetData().push_back(field);
     return *this;
@@ -314,8 +329,7 @@ CUser_object::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(objects.size());
-    field->SetData().SetObjects() = objects;
+    field->SetValue(objects);
 
     SetData().push_back(field);
     return *this;
@@ -327,8 +341,7 @@ CUser_object& CUser_object::AddField(const string& label,
 {
     CRef<CUser_field> field(new CUser_field());
     field->SetLabel().SetStr(label);
-    field->SetNum(objects.size());
-    field->SetData().SetFields() = objects;
+    field->SetValue(objects);
 
     SetData().push_back(field);
     return *this;
@@ -337,12 +350,12 @@ CUser_object& CUser_object::AddField(const string& label,
 
 
 // static consts here allow us to use reference counting
-static const char* s_ncbi("NCBI");
-static const char* s_expres("experimental_results");
-static const char* s_exp("experiment");
-static const char* s_sage("SAGE");
-static const char* s_tag("tag");
-static const char* s_count("count");
+static const char* s_ncbi   = "NCBI";
+static const char* s_expres = "experimental_results";
+static const char* s_exp    = "experiment";
+static const char* s_sage   = "SAGE";
+static const char* s_tag    = "tag";
+static const char* s_count  = "count";
 
 
 // accessors: classify a given user object
@@ -490,7 +503,7 @@ static string s_GetUserObjectContent(const CUser_object& obj)
                         label += " ";
                     }
                     label += string(s_count) + "=" +
-                        NStr::IntToString(count->GetData().GetInt());
+                        NStr::NumericToString(count->GetData().GetInt());
                 }
 
                 return label;
@@ -576,14 +589,14 @@ CUser_object& CUser_object::SetExperiment(EExperiment category)
 }
 
 
-const string kDBLink = "DBLink";
-const string kStructuredComment = "StructuredComment";
-const string kOriginalId = "OriginalID";
-const string kOrigIdAltSpell = "OrginalID";
-const string kUnverified = "Unverified";
-const string kValidationSuppression = "ValidationSuppression";
-const string kNcbiCleanup = "NcbiCleanup";
-const string kAutoDefOptions = "AutodefOptions";
+static const char* kDBLink                = "DBLink";
+static const char* kStructuredComment     = "StructuredComment";
+static const char* kOriginalId            = "OriginalID";
+static const char* kOrigIdAltSpell        = "OrginalID";
+static const char* kUnverified            = "Unverified";
+static const char* kValidationSuppression = "ValidationSuppression";
+static const char* kNcbiCleanup           = "NcbiCleanup";
+static const char* kAutoDefOptions        = "AutodefOptions";
 
 CUser_object::EObjectType CUser_object::GetObjectType() const
 {
@@ -685,10 +698,7 @@ void CUser_object::x_AddUnverifiedType(const string& val)
         // value already set, nothing to do
         return;
     }
-    CRef<CUser_field> f(new CUser_field());
-    f->SetLabel().SetStr("Type");
-    f->SetData().SetStr(val);
-    SetData().push_back(f);
+    AddField("Type", val);
 }
 
 
@@ -714,43 +724,57 @@ void CUser_object::x_RemoveUnverifiedType(const string& val)
 }
 
 
-static const string kUnverifiedOrganism = "Organism";
-
 bool CUser_object::IsUnverifiedOrganism() const
 {
-    return x_IsUnverifiedType(kUnverifiedOrganism);
+    return x_IsUnverifiedType(kUnverifiedOrganism.Get());
 }
 
 
 void CUser_object::AddUnverifiedOrganism()
 {
-    x_AddUnverifiedType(kUnverifiedOrganism);
+    x_AddUnverifiedType(kUnverifiedOrganism.Get());
 }
 
 
 void CUser_object::RemoveUnverifiedOrganism()
 {
-    x_RemoveUnverifiedType(kUnverifiedOrganism);
+    x_RemoveUnverifiedType(kUnverifiedOrganism.Get());
 }
 
 
-static const string kUnverifiedFeature = "Features";
-
 bool CUser_object::IsUnverifiedFeature() const
 {
-    return x_IsUnverifiedType(kUnverifiedFeature);
+    return x_IsUnverifiedType(kUnverifiedFeature.Get());
 }
 
 
 void CUser_object::AddUnverifiedFeature()
 {
-    x_AddUnverifiedType(kUnverifiedFeature);
+    x_AddUnverifiedType(kUnverifiedFeature.Get());
 }
 
 
 void CUser_object::RemoveUnverifiedFeature()
 {
-    x_RemoveUnverifiedType(kUnverifiedFeature);
+    x_RemoveUnverifiedType(kUnverifiedFeature.Get());
+}
+
+
+bool CUser_object::IsUnverifiedMisassembled() const
+{
+    return x_IsUnverifiedType(kUnverifiedMisassembled.Get());
+}
+
+
+void CUser_object::AddUnverifiedMisassembled()
+{
+    x_AddUnverifiedType(kUnverifiedMisassembled.Get());
+}
+
+
+void CUser_object::RemoveUnverifiedMisassembled()
+{
+    x_RemoveUnverifiedType(kUnverifiedMisassembled.Get());
 }
 
 
@@ -758,9 +782,9 @@ void CUser_object::UpdateNcbiCleanup(int version)
 {
     SetObjectType(eObjectType_Cleanup);
     CRef<CUser_field> method = SetFieldRef("method");
-    method->SetData().SetStr(CUtf8::AsUTF8("ExtendedSeqEntryCleanup", eEncoding_Ascii));
+    method->SetValue("ExtendedSeqEntryCleanup");
     CRef<CUser_field> version_field = SetFieldRef("version");
-    version_field->SetData().SetInt(version);
+    version_field->SetValue(version);
 
     // get current time
     CTime curr_time(CTime::eCurrent);
@@ -776,5 +800,3 @@ void CUser_object::UpdateNcbiCleanup(int version)
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
-
-/* Original file checksum: lines: 64, chars: 1893, CRC32: f7a70d1d */
diff --git a/c++/src/objects/genomecoll/GCClient_GetAssemblyReques.cpp b/c++/src/objects/genomecoll/GCClient_GetAssemblyReques.cpp
index 464f369..e7e7318 100755
--- a/c++/src/objects/genomecoll/GCClient_GetAssemblyReques.cpp
+++ b/c++/src/objects/genomecoll/GCClient_GetAssemblyReques.cpp
@@ -1,4 +1,4 @@
-/* $Id: GCClient_GetAssemblyReques.cpp 483944 2015-11-05 13:38:24Z ivanov $
+/* $Id: GCClient_GetAssemblyReques.cpp 486570 2015-12-07 17:17:13Z shchekot $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -119,7 +119,6 @@ bool CGCClient_GetAssemblyRequest::SRequestParam::SetMode(EAssemblyMode mode)
         assembly_flags   = eGCClient_AttributeFlags_none;
         chromosome_flags = eGCClient_AttributeFlags_exclude_aligndb;
         scaffold_flags   = eGCClient_AttributeFlags_include_UCSC_pseudo_scaffolds |
-                           eGCClient_AttributeFlags_include_unordered_scaffolds |
                            eGCClient_AttributeFlags_get_wgs_contigs;
         component_flags  = eGCClient_AttributeFlags_none;
         break;
@@ -129,33 +128,6 @@ bool CGCClient_GetAssemblyRequest::SRequestParam::SetMode(EAssemblyMode mode)
     return true;
 }
 
-bool CGCClient_GetAssemblyRequest::SRequestParam::SetMode(const string& mode)
-{
-    level            = CGCClient_GetAssemblyRequest::eLevel_component;
-    assembly_flags   = eGCClient_AttributeFlags_none;
-    chromosome_flags = eGCClient_AttributeFlags_biosource;
-    scaffold_flags   = eGCClient_AttributeFlags_none;
-    component_flags  = eGCClient_AttributeFlags_none;
-
-	if(mode == "Gbench")
-	{
-        level            = CGCClient_GetAssemblyRequest::eLevel_scaffold;
-        assembly_flags   = eGCClient_AttributeFlags_none;
-        chromosome_flags = eGCClient_AttributeFlags_biosource |
-                           eGCClient_AttributeFlags_exclude_aligndb;
-	}
-	else if(mode == "Gbench_chrs")
-	{
-        level            = CGCClient_GetAssemblyRequest::eLevel_replicon;
-        assembly_flags   = eGCClient_AttributeFlags_none;
-        chromosome_flags = eGCClient_AttributeFlags_biosource;
-	}
-	else
-        return false;
-
-    return true;
-}
-
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
diff --git a/c++/src/objects/genomecoll/GC_Sequence.cpp b/c++/src/objects/genomecoll/GC_Sequence.cpp
index f51b4a1..904be51 100644
--- a/c++/src/objects/genomecoll/GC_Sequence.cpp
+++ b/c++/src/objects/genomecoll/GC_Sequence.cpp
@@ -1,4 +1,4 @@
-/* $Id: GC_Sequence.cpp 479299 2015-09-18 11:47:36Z ivanov $
+/* $Id: GC_Sequence.cpp 479064 2015-09-16 12:18:23Z smithrg $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objects/genomecoll/Makefile.gencoll_client.lib b/c++/src/objects/genomecoll/Makefile.gencoll_client.lib
index 3165234..d9775f5 100644
--- a/c++/src/objects/genomecoll/Makefile.gencoll_client.lib
+++ b/c++/src/objects/genomecoll/Makefile.gencoll_client.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.gencoll_client.lib 481642 2015-10-14 15:58:55Z ivanov $
+# $Id: Makefile.gencoll_client.lib 482112 2015-10-20 19:24:36Z zherikov $
 
 ASN = gencoll_client
 
@@ -12,7 +12,7 @@ LIB_OR_DLL = lib
 
 #REQUIRES = objects dbapi
 
-WATCHERS = shchekot dicuccio
+WATCHERS = shchekot dicuccio zherikov
 
 
 USES_LIBRARIES =  \
diff --git a/c++/src/objects/genomecoll/Makefile.genome_collection.lib b/c++/src/objects/genomecoll/Makefile.genome_collection.lib
index 5f18821..5239740 100644
--- a/c++/src/objects/genomecoll/Makefile.genome_collection.lib
+++ b/c++/src/objects/genomecoll/Makefile.genome_collection.lib
@@ -1,9 +1,9 @@
-# $Id: Makefile.genome_collection.lib 481642 2015-10-14 15:58:55Z ivanov $
+# $Id: Makefile.genome_collection.lib 482112 2015-10-20 19:24:36Z zherikov $
 
 LIB = genome_collection
 SRC = genome_collection__ genome_collection___
 
-WATCHERS = dicuccio shchekot
+WATCHERS = dicuccio shchekot zherikov
 
 
 USES_LIBRARIES =  \
diff --git a/c++/src/objects/genomecoll/gencoll_client.asn b/c++/src/objects/genomecoll/gencoll_client.asn
index bdc5bd5..6047cf6 100755
--- a/c++/src/objects/genomecoll/gencoll_client.asn
+++ b/c++/src/objects/genomecoll/gencoll_client.asn
@@ -1,4 +1,4 @@
--- $Id: gencoll_client.asn 479931 2015-09-24 17:18:23Z ivanov $
+-- $Id: gencoll_client.asn 486883 2015-12-11 13:03:03Z zherikov $
 -- **********************************************************************
 --
 --  NCBI Genome Collections Statistics
@@ -147,9 +147,11 @@ GCClient-ValidateChrTypeLocResponse ::= SEQUENCE {
 
 GCClient-FindBestAssemblyFilter ::= INTEGER {
     any(0),
+    latest-major-annotated(0),
     latest(1),
     major(2),
-    annotated(3)
+    annotated(3),
+    all(4)
 }
 
 GCClient-FindBestAssemblySort ::= INTEGER {
@@ -162,7 +164,7 @@ GCClient-FindBestAssemblySort ::= INTEGER {
 GCClient-FindBestAssemblyRequest ::= SEQUENCE {
     seq-id-acc SET OF VisibleString,
 
-    filter GCClient-FindBestAssemblyFilter DEFAULT any,
+    filter GCClient-FindBestAssemblyFilter DEFAULT latest-major-annotated,
 
     sort GCClient-FindBestAssemblySort DEFAULT default,
 
diff --git a/c++/src/objects/genomecoll/genomic_collections_cli.cpp b/c++/src/objects/genomecoll/genomic_collections_cli.cpp
index a3b086b..083f2b8 100644
--- a/c++/src/objects/genomecoll/genomic_collections_cli.cpp
+++ b/c++/src/objects/genomecoll/genomic_collections_cli.cpp
@@ -1,4 +1,4 @@
-/* $Id: genomic_collections_cli.cpp 482676 2015-10-26 14:13:21Z ivanov $
+/* $Id: genomic_collections_cli.cpp 499302 2016-04-25 15:35:38Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -61,28 +61,7 @@ static const STimeout kTimeout = {600, 0};
 CGenomicCollectionsService::CGenomicCollectionsService()
 {
     SetTimeout(&kTimeout);
-}
-
-CGenomicCollectionsService::CGenomicCollectionsService(const string& url)
-: m_url(url)
-{
-    SetTimeout(&kTimeout);
-}
-
-string CGenomicCollectionsService::x_GetURL()
-{
-    return m_url;
-}
-
-void CGenomicCollectionsService::x_Connect()
-{
-#ifdef _DEBUG
-    LOG_POST(Info << "Connecting to url:" << x_GetURL().c_str());
-#endif
-    if(x_GetURL().empty())
-        CGenomicCollectionsService_Base::x_Connect();
-    else
-        x_ConnectURL(x_GetURL());
+    SetRetryLimit(20);
 }
 
 template<typename TReq>
@@ -95,13 +74,22 @@ void LogRequest(const TReq& req)
 #endif
 }
 
-CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(const string& acc, 
+static void ValidateAsmAccession(const string& acc)
+{
+    if(acc.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.") != string::npos)
+        NCBI_THROW(CException, eUnknown, "Invalid accession format: " + acc);
+}
+
+CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(const string& acc_,
                                             int level, 
                                             int asmAttrFlags, 
                                             int chrAttrFlags, 
                                             int scafAttrFlags, 
                                             int compAttrFlags)
 {
+    string acc = NStr::TruncateSpaces(acc_);
+    ValidateAsmAccession(acc);
+
     CGCClient_GetAssemblyRequest req;
     CGCClientResponse reply;
 
@@ -134,7 +122,7 @@ CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(int releaseId,
 {
     CGCClient_GetAssemblyRequest req;
     CGCClientResponse reply;
-    
+
     req.SetRelease_id(releaseId);
     req.SetLevel(level);
     req.SetAssm_flags(asmAttrFlags);
@@ -154,64 +142,38 @@ CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(int releaseId,
     }
 }
 
-CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(const string& acc, CGCClient_GetAssemblyRequest::EAssemblyMode mode)
+static string ToStringMode(CGCClient_GetAssemblyRequest::EAssemblyMode mode)
 {
-    CGCClient_GetAssemblyRequest::SRequestParam params;
-    if(!params.SetMode(mode))
-        NCBI_THROW(CException, eUnknown, "GetAssembly: Illegal mode passed.");
-
-    return GetAssembly(acc,
-                       params.level,
-                       params.assembly_flags,
-                       params.chromosome_flags,
-                       params.scaffold_flags,
-                       params.component_flags);
+    switch (mode) {
+        case CGCClient_GetAssemblyRequest::eAssemblyMode_assembly_only: return "AssemblyOnly";
+        case CGCClient_GetAssemblyRequest::eAssemblyMode_eukaryotic_annotation: return "EukAnnotation";
+        case CGCClient_GetAssemblyRequest::eAssemblyMode_prokaryotic_annotation: return "ProkAnnotation";
+        case CGCClient_GetAssemblyRequest::eAssemblyMode_entrez_indexing: return "EntrezIndexing";
+        case CGCClient_GetAssemblyRequest::eAssemblyMode_assembly_backend: return "AssemblyBackend";
+        case CGCClient_GetAssemblyRequest::eAssemblyMode_sequence_names: return "SequenceNames";
+        case CGCClient_GetAssemblyRequest::eAssemblyMode_ftp_export: return "AllSequencesWithAlignments";
+        default: NCBI_THROW(CException, eUnknown, "GetAssembly: Illegal mode passed.");
+    }
 }
 
-CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(int releaseId, CGCClient_GetAssemblyRequest::EAssemblyMode mode)
+CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(const string& acc_, CGCClient_GetAssemblyRequest::EAssemblyMode mode)
 {
-    CGCClient_GetAssemblyRequest::SRequestParam params;
-    if(!params.SetMode(mode))
-        NCBI_THROW(CException, eUnknown, "GetAssembly: Illegal mode passed.");
-
-    return GetAssembly(releaseId,
-                       params.level,
-                       params.assembly_flags,
-                       params.chromosome_flags,
-                       params.scaffold_flags,
-                       params.component_flags);
-}
+    string acc = NStr::TruncateSpaces(acc_);
+    ValidateAsmAccession(acc);
 
-CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(const string& acc, const string& mode)
-{
-    CGCClient_GetAssemblyRequest::SRequestParam params;
-    if(!params.SetMode(mode))
-        NCBI_THROW(CException, eUnknown, "GetAssembly: Illegal mode passed.");
-
-    return GetAssembly(acc,
-                       params.level,
-                       params.assembly_flags,
-                       params.chromosome_flags,
-                       params.scaffold_flags,
-                       params.component_flags);
+    return GetAssembly(acc, ToStringMode(mode));
 }
 
-CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(int releaseId, const string& mode)
+CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(int releaseId, CGCClient_GetAssemblyRequest::EAssemblyMode mode)
 {
-    CGCClient_GetAssemblyRequest::SRequestParam params;
-    if(!params.SetMode(mode))
-        NCBI_THROW(CException, eUnknown, "GetAssembly: Illegal mode passed.");
-
-    return GetAssembly(releaseId,
-                       params.level,
-                       params.assembly_flags,
-                       params.chromosome_flags,
-                       params.scaffold_flags,
-                       params.component_flags);
+    return GetAssembly(releaseId, ToStringMode(mode));
 }
 
-CRef<CGC_Assembly> CGenomicCollectionsService::_GetAssemblyNew(const string& acc, const string& mode)
+CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(const string& acc_, const string& mode)
 {
+    string acc = NStr::TruncateSpaces(acc_);
+    ValidateAsmAccession(acc);
+
     CGCClient_GetAssemblyBlobRequest req;
     CGCClientResponse reply;
 
@@ -230,7 +192,7 @@ CRef<CGC_Assembly> CGenomicCollectionsService::_GetAssemblyNew(const string& acc
     }
 }
 
-CRef<CGC_Assembly> CGenomicCollectionsService::_GetAssemblyNew(int releaseId, const string& mode)
+CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(int releaseId, const string& mode)
 {
     CGCClient_GetAssemblyBlobRequest req;
     CGCClientResponse reply;
diff --git a/c++/src/objects/seq/Seq_inst.cpp b/c++/src/objects/id2/ID2_Request_Packet.cpp
similarity index 64%
copy from c++/src/objects/seq/Seq_inst.cpp
copy to c++/src/objects/id2/ID2_Request_Packet.cpp
index b73293f..f240aea 100644
--- a/c++/src/objects/seq/Seq_inst.cpp
+++ b/c++/src/objects/id2/ID2_Request_Packet.cpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_inst.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/* $Id: ID2_Request_Packet.cpp 486265 2015-12-02 19:22:44Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -30,15 +30,18 @@
  *
  * Remark:
  *   This code was originally generated by application DATATOOL
- *   using specifications from the data definition file
- *   'seq.asn'.
+ *   using the following specifications:
+ *   'id2.asn'.
  */
 
 // standard includes
+#include <ncbi_pch.hpp>
 
 // generated includes
-#include <ncbi_pch.hpp>
-#include <objects/seq/Seq_inst.hpp>
+#include <objects/id2/ID2_Request_Packet.hpp>
+
+#include <objects/id2/id2processor.hpp>
+#include <objects/id2/id2processor_interface.hpp>
 
 // generated classes
 
@@ -47,13 +50,45 @@ BEGIN_NCBI_SCOPE
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
 // destructor
-CSeq_inst::~CSeq_inst(void)
+CID2_Request_Packet::~CID2_Request_Packet(void)
+{
+}
+
+
+CID2ProcessorResolver::CID2ProcessorResolver(void)
+{
+}
+
+
+CID2ProcessorResolver::~CID2ProcessorResolver(void)
+{
+}
+
+
+CID2Processor::CID2Processor(void)
+{
+}
+
+
+CID2Processor::~CID2Processor(void)
 {
 }
 
 
 END_objects_SCOPE // namespace ncbi::objects::
 
-END_NCBI_SCOPE
 
-/* Original file checksum: lines: 64, chars: 1872, CRC32: f553d25a */
+CPluginManager_DllResolver*
+CDllResolver_Getter<objects::CID2Processor>::operator()(void)
+{
+    CPluginManager_DllResolver* resolver =
+        new CPluginManager_DllResolver
+        (CInterfaceVersion<objects::CID2Processor>::GetName(),
+         kEmptyStr,
+         CVersionInfo::kAny,
+         CDll::eAutoUnload);
+    resolver->SetDllNamePrefix("ncbi");
+    return resolver;
+}
+
+END_NCBI_SCOPE
diff --git a/c++/src/objects/id2/id2.asn b/c++/src/objects/id2/id2.asn
index 8cc5270..8745bea 100644
--- a/c++/src/objects/id2/id2.asn
+++ b/c++/src/objects/id2/id2.asn
@@ -1,4 +1,4 @@
---$Revision: 484991 $
+--$Revision: 484952 $
 --********************************************************************
 --
 --  Network Id server network access
diff --git a/c++/src/objects/seq/Seq_inst.cpp b/c++/src/objects/id2/id2_client.cpp
similarity index 58%
copy from c++/src/objects/seq/Seq_inst.cpp
copy to c++/src/objects/id2/id2_client.cpp
index b73293f..2305a43 100644
--- a/c++/src/objects/seq/Seq_inst.cpp
+++ b/c++/src/objects/id2/id2_client.cpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_inst.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/* $Id: id2_client.cpp 477911 2015-09-02 16:03:12Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -30,15 +30,16 @@
  *
  * Remark:
  *   This code was originally generated by application DATATOOL
- *   using specifications from the data definition file
- *   'seq.asn'.
+ *   using the following specifications:
+ *   'id2.asn'.
  */
 
 // standard includes
+#include <ncbi_pch.hpp>
 
 // generated includes
-#include <ncbi_pch.hpp>
-#include <objects/seq/Seq_inst.hpp>
+#include <objects/id2/id2_client.hpp>
+#include <objects/id2/ID2_Request_Packet.hpp>
 
 // generated classes
 
@@ -47,13 +48,42 @@ BEGIN_NCBI_SCOPE
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
 // destructor
-CSeq_inst::~CSeq_inst(void)
+CID2Client::~CID2Client(void)
+{
+}
+
+
+void CID2Client::WriteRequest(CObjectOStream& out, const TRequest& request)
 {
+    // send a packet with single request
+    CID2_Request_Packet packet;
+    packet.Set().push_back(Ref(&const_cast<TRequest&>(request)));
+    out << packet;
+}
+
+
+void CID2Client::ReadReply(CObjectIStream& in, TReply& reply)
+{
+    m_Replies.clear();
+    // read all replies until 'end-of-reply' is set
+    do {
+        in >> reply;
+        if ( reply.IsSetDiscard() ) {
+            // if 'discard' is set we should ignore the reply
+            continue;
+        }
+        if ( reply.IsSetEnd_of_reply() && reply.CanBeDeleted() ) {
+            // last reply can be stored directly if it's allocated in heap
+            m_Replies.push_back(Ref(&reply));
+        }
+        else {
+            // otherwise we store a copy of the reply
+            m_Replies.push_back(Ref(SerialClone(reply)));
+        }
+    } while ( !reply.IsSetEnd_of_reply() );
 }
 
 
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
-
-/* Original file checksum: lines: 64, chars: 1872, CRC32: f553d25a */
diff --git a/c++/src/objects/macro/Field_type.cpp b/c++/src/objects/macro/Field_type.cpp
index 0f9dfc0..a9fbac6 100644
--- a/c++/src/objects/macro/Field_type.cpp
+++ b/c++/src/objects/macro/Field_type.cpp
@@ -1,4 +1,4 @@
-/* $Id: Field_type.cpp 436427 2014-05-28 13:24:42Z chenj $
+/* $Id: Field_type.cpp 487739 2015-12-21 18:35:12Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -100,7 +100,7 @@ CRef <CFeature_field> CField_type :: FeatureFieldFromCDSGeneProtField (ECDSGeneP
    return (CRef <CFeature_field> (0));
 };
 
-static const string dblink_name[] = {
+static const char* dblink_name[] = {
    "Trace Assembly Archive",
    "BioSample",
    "ProbeDB",
@@ -113,7 +113,7 @@ string CField_type :: GetDBLinkFieldFromUserObject(const CUser_object& user_obj,
 {
   string str(kEmptyStr);
   if (user_obj.GetType().IsStr() && user_obj.GetType().GetStr() == "DBLink") {
-    string field_name = dblink_name[(int)dblink_tp];
+    CTempString field_name(dblink_name[(int)dblink_tp]);
     ITERATE (vector <CRef <CUser_field> >, it, user_obj.GetData()) {
        if ( (*it)->GetLabel().IsStr() 
                 && ((*it)->GetLabel().GetStr() == field_name) ) {
diff --git a/c++/src/objects/macro/String_constraint.cpp b/c++/src/objects/macro/String_constraint.cpp
index ebb8391..f9d75d6 100644
--- a/c++/src/objects/macro/String_constraint.cpp
+++ b/c++/src/objects/macro/String_constraint.cpp
@@ -1,4 +1,4 @@
-/* $Id: String_constraint.cpp 454397 2014-12-15 14:13:39Z asztalos $
+/* $Id: String_constraint.cpp 494819 2016-03-10 18:53:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -90,6 +90,27 @@ bool CString_constraint :: x_IsAllPunctuation(const string& str) const
    return true;
 }
 
+bool CString_constraint::x_IsSkippable(const char ch) const
+{
+    if (ispunct(ch) && GetIgnore_punct()) {
+        return true;
+    } else if (isspace(ch) && GetIgnore_space()) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+bool CString_constraint::x_IsAllSkippable(const string& str) const
+{
+    for (unsigned i = 0; i < str.size(); i++) {
+        if (!x_IsSkippable(Uint1(str[i]))) {
+            return false;
+        }
+    }
+    return true;
+}
+
 bool CString_constraint :: x_IsFirstCap(const string& str) const
 {
     // ignore punctuation and spaces at the beginning of the phrase
@@ -134,7 +155,7 @@ bool CString_constraint :: x_IsFirstEachCap(const string& str) const
 }
 
 
-static const string weasels[] = {
+static const char* weasels[] = {
   "candidate",
   "hypothetical",
   "novel",
@@ -148,17 +169,15 @@ static const string weasels[] = {
   "unique"
 };
 
-bool CString_constraint :: x_IsWeasel(const string& str) const
+bool CString_constraint::x_IsWeasel(const string& str) const
 {
-  size_t sz = ArraySize(weasels);
-  const string *begin = weasels;
-  const string *end = &(weasels[sz]);
-
-  if (find(begin, end, str) != end) {
-        return true;
-  } else {
-        return false;
-  }
+    size_t n = ArraySize(weasels);
+    for (size_t i = 0; i < n; i++) {
+        if (str == weasels[i]) {
+            return true;
+        }
+    }
+    return false;
 };
 
 string CString_constraint :: x_SkipWeasel(const string& str) const
@@ -167,7 +186,7 @@ string CString_constraint :: x_SkipWeasel(const string& str) const
     return kEmptyStr;
   }
   string ret_str;
-  vector <string> arr;
+  vector<string> arr;
   arr = NStr::Tokenize(str, " ", arr);
 
   bool found = false;
@@ -271,10 +290,15 @@ bool CString_constraint :: x_PartialCompare(const string& str, const string& pat
             }
         }
     }
+
     if (pattern.length() == 0) {
         return true;
     }
+
     if (str.length() == 0) {
+        if (x_IsAllSkippable(pattern)) {
+            return true;
+        }
         // special case: can continue if the next character is a space, might have words to ignore
         if (isspace(pattern[0])) {
             return x_PartialCompare(str, pattern.substr(1), ' ', match_len);
diff --git a/c++/src/objects/macro/macro.asn b/c++/src/objects/macro/macro.asn
index 3ac1995..b0e4260 100755
--- a/c++/src/objects/macro/macro.asn
+++ b/c++/src/objects/macro/macro.asn
@@ -1,4 +1,4 @@
---$Revision: 465458 $
+--$Revision: 488818 $
 --**********************************************************************
 --
 --  NCBI ASN.1 macro editing language specifications
@@ -552,7 +552,8 @@ Technique-type ::= ENUMERATED {
   barcode (21) ,
   composite-wgs-htgs (22) ,
   tsa (23) ,
-  other (24) }
+  targeted (24) ,
+  other (25) }
 
 Completedness-type ::= ENUMERATED {
   unknown (0) ,
diff --git a/c++/src/objects/mmdb/Makefile.sources b/c++/src/objects/mmdb/Makefile.sources
index 9be2b11..841081e 100644
--- a/c++/src/objects/mmdb/Makefile.sources
+++ b/c++/src/objects/mmdb/Makefile.sources
@@ -1,11 +1,13 @@
-# $Id: Makefile.sources 213965 2010-11-30 16:10:30Z ucko $
+# $Id: Makefile.sources 484943 2015-11-17 16:41:13Z ucko $
 
 all: sources
 
 include $(builddir)/Makefile.mk
 
 sources:
-	status=0 ; \
+	+status=0 ; \
+	MAKE="$(MAKE) $(MFLAGS)"; \
+	export MAKE; \
 	for x in mmdb1 mmdb2 mmdb3; do \
 	    d=$(srcdir)/../$$x ; \
 	    (cd $$d  &&  $(builddir)/new_module.sh) || status=9 ; \
diff --git a/c++/src/objects/nt_sources.sh b/c++/src/objects/nt_sources.sh
index c83cede..a9d8f9f 100644
--- a/c++/src/objects/nt_sources.sh
+++ b/c++/src/objects/nt_sources.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $Id: nt_sources.sh 485953 2015-11-30 17:53:34Z blastadm $
+# $Id: nt_sources.sh 38156 2004-04-13 20:10:40Z ucko $
 #
 # Script to update ASN.1 objects' sources on Windows-NT
 #       (using BASH and DATATOOL)
diff --git a/c++/src/objects/seq/Bioseq.cpp b/c++/src/objects/seq/Bioseq.cpp
index c3eb538..9a7e9b1 100644
--- a/c++/src/objects/seq/Bioseq.cpp
+++ b/c++/src/objects/seq/Bioseq.cpp
@@ -1,4 +1,4 @@
-/* $Id: Bioseq.cpp 474382 2015-07-28 16:24:11Z ivanov $
+/* $Id: Bioseq.cpp 474093 2015-07-24 20:13:24Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objects/seq/Makefile.sources b/c++/src/objects/seq/Makefile.sources
index fc6132c..0a2dca2 100644
--- a/c++/src/objects/seq/Makefile.sources
+++ b/c++/src/objects/seq/Makefile.sources
@@ -1,9 +1,11 @@
-# $Id: Makefile.sources 213964 2010-11-30 16:10:04Z ucko $
+# $Id: Makefile.sources 484943 2015-11-17 16:41:13Z ucko $
 
 all: sources
 
 sources:
-	status=0 ; \
+	+status=0 ; \
+	MAKE="$(MAKE) $(MFLAGS)"; \
+	export MAKE; \
 	for x in seqalign seqblock seqfeat seqloc seqres seqtable; do \
 	    d=$(srcdir)/../$$x ; \
 	    (cd $$d  &&  $(builddir)/new_module.sh) || status=9 ; \
diff --git a/c++/src/objects/seq/Seq_gap.cpp b/c++/src/objects/seq/Seq_gap.cpp
index 3a71be1..3963714 100644
--- a/c++/src/objects/seq/Seq_gap.cpp
+++ b/c++/src/objects/seq/Seq_gap.cpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_gap.cpp 442805 2014-08-07 13:46:05Z bollin $
+/* $Id: Seq_gap.cpp 499433 2016-04-26 14:13:30Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -46,6 +46,30 @@ BEGIN_NCBI_SCOPE
 
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
+namespace
+{
+    string CanonicalizeString(const CTempString& sValue)
+    {
+        string newString;
+        newString.reserve(sValue.length());
+
+        ITERATE_0_IDX(ii, sValue.length()) {
+            const char ch = sValue[ii];
+            if (isupper(ch)) {
+                newString.push_back(tolower(ch));
+            }
+            else if (ch == ' ' || ch == '_') {
+                newString.push_back('-');
+            }
+            else {
+                newString.push_back(ch);
+            }
+        }
+
+        return newString;
+    }
+};
+
 // destructor
 CSeq_gap::~CSeq_gap(void)
 {
@@ -130,6 +154,44 @@ bool CSeq_gap::AddLinkageEvidence(CLinkage_evidence::TType evidence_type)
     return found || changed;
 }
 
+const CSeq_gap::SGapTypeInfo *
+CSeq_gap::NameToGapTypeInfo(const CTempString & sName)
+{
+    const CSeq_gap::TGapTypeMap & gapTypeMap =
+        GetNameToGapTypeInfoMap();
+
+    TGapTypeMap::const_iterator find_iter =
+        gapTypeMap.find(CanonicalizeString(sName).c_str());
+    if (find_iter == gapTypeMap.end()) {
+        // not found
+        return NULL;
+    }
+    else {
+        return &find_iter->second;
+    }
+}
+
+// static
+const CSeq_gap::TGapTypeMap &
+CSeq_gap::GetNameToGapTypeInfoMap(void)
+{
+    // gap-type name to info
+    typedef SStaticPair<const char*, CSeq_gap::SGapTypeInfo> TGapTypeElem;
+    static const TGapTypeElem sc_gap_type_map[] = {
+        { "between-scaffolds", { CSeq_gap::eType_contig, eLinkEvid_Required } },
+        { "centromere", { CSeq_gap::eType_centromere, eLinkEvid_Forbidden } },
+        { "heterochromatin", { CSeq_gap::eType_heterochromatin, eLinkEvid_Forbidden } },
+        { "repeat-between-scaffolds", { CSeq_gap::eType_repeat, eLinkEvid_Forbidden } },
+        { "repeat-within-scaffold", { CSeq_gap::eType_repeat, eLinkEvid_Required } },
+        { "short-arm", { CSeq_gap::eType_short_arm, eLinkEvid_Forbidden } },
+        { "telomere", { CSeq_gap::eType_telomere, eLinkEvid_Forbidden } },
+        { "unknown", { CSeq_gap::eType_unknown, eLinkEvid_UnspecifiedOnly } },
+        { "within-scaffold", { CSeq_gap::eType_scaffold, eLinkEvid_Forbidden } },
+    };
+    DEFINE_STATIC_ARRAY_MAP(TGapTypeMap, sc_GapTypeMap, sc_gap_type_map);
+    return sc_GapTypeMap;
+}
+
 
 END_objects_SCOPE // namespace ncbi::objects::
 
diff --git a/c++/src/objects/seq/Seq_inst.cpp b/c++/src/objects/seq/Seq_inst.cpp
index b73293f..b2a372f 100644
--- a/c++/src/objects/seq/Seq_inst.cpp
+++ b/c++/src/objects/seq/Seq_inst.cpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_inst.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/* $Id: Seq_inst.cpp 489361 2016-01-12 17:31:56Z choi $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -52,6 +52,33 @@ CSeq_inst::~CSeq_inst(void)
 }
 
 
+typedef SStaticPair<CSeq_inst::EMol, const char*> TMolKey;
+
+static const TMolKey mol_key_to_str[] = {
+    { CSeq_inst::eMol_not_set, " " } ,
+    { CSeq_inst::eMol_dna,     "DNA" } ,
+    { CSeq_inst::eMol_rna,     "RNA" } ,
+    { CSeq_inst::eMol_aa,      "protein" } ,
+    { CSeq_inst::eMol_na,      "nucleotide" } ,
+    { CSeq_inst::eMol_other,   "other" }
+};
+
+
+// dump the array into a map for faster searching
+typedef CStaticPairArrayMap <CSeq_inst::EMol, const char*> TMolMap;
+DEFINE_STATIC_ARRAY_MAP(TMolMap, sm_EMolKeys, mol_key_to_str);
+
+
+string CSeq_inst::GetMoleculeClass(CSeq_inst::EMol mol)
+{
+    TMolMap::const_iterator g_iter = sm_EMolKeys.find(mol);
+    if (g_iter != sm_EMolKeys.end()) {
+        return g_iter->second;
+    }
+    return kEmptyStr;
+}
+
+
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
diff --git a/c++/src/objects/seq/seq.asn b/c++/src/objects/seq/seq.asn
index 1148f83..ac53fde 100644
--- a/c++/src/objects/seq/seq.asn
+++ b/c++/src/objects/seq/seq.asn
@@ -1,4 +1,4 @@
---$Revision: 375987 $
+--$Revision: 488585 $
 --**********************************************************************
 --
 --  NCBI Sequence elements
@@ -133,6 +133,7 @@ MolInfo ::= SEQUENCE {
         barcode (21) ,          -- barcode of life project
         composite-wgs-htgs (22) , -- composite of WGS and HTGS
         tsa (23) ,              -- transcriptome shotgun assembly
+        targeted (24) ,         -- targeted locus sets/studies
         other (255) }           -- use Source.techexp
                DEFAULT unknown ,
     techexp VisibleString OPTIONAL ,   -- explanation if tech not enough
diff --git a/c++/src/objects/seq/seq_align_mapper_base.cpp b/c++/src/objects/seq/seq_align_mapper_base.cpp
index b5568be..44d55e5 100644
--- a/c++/src/objects/seq/seq_align_mapper_base.cpp
+++ b/c++/src/objects/seq/seq_align_mapper_base.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_align_mapper_base.cpp 482403 2015-10-22 18:03:40Z ivanov $
+/*  $Id: seq_align_mapper_base.cpp 481221 2015-10-07 18:25:55Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objects/seq/seq_id_tree.cpp b/c++/src/objects/seq/seq_id_tree.cpp
index f6201c0..e7ed6b5 100644
--- a/c++/src/objects/seq/seq_id_tree.cpp
+++ b/c++/src/objects/seq/seq_id_tree.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_id_tree.cpp 467602 2015-05-14 17:44:35Z vasilche $
+/*  $Id: seq_id_tree.cpp 488780 2016-01-05 19:38:09Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1316,6 +1316,7 @@ void CSeq_id_Textseq_Tree::FindReverseMatch(const CSeq_id_Handle& id,
         id_list.insert(id);
     }
     if ( id.IsPacked() ) {
+        TReadLockGuard guard(m_TreeLock);
         const CSeq_id_Textseq_Info* info =
             static_cast<const CSeq_id_Textseq_Info*>(GetInfo(id));
         if ( !mine ) { // weak matching
@@ -1339,6 +1340,7 @@ void CSeq_id_Textseq_Tree::FindReverseMatch(const CSeq_id_Handle& id,
     const CTextseq_id& orig_tid = x_Get(*orig_id);
 
     if ( !mine ) {
+        TReadLockGuard guard(m_TreeLock);
         // search only existing accessions
         if ( orig_tid.IsSetAccession() ) {
             x_FindRevMatchByAcc(id_list, orig_tid.GetAccession(), &orig_tid);
diff --git a/c++/src/objects/seq/seq_loc_mapper_base.cpp b/c++/src/objects/seq/seq_loc_mapper_base.cpp
index 8e6c312..975afec 100644
--- a/c++/src/objects/seq/seq_loc_mapper_base.cpp
+++ b/c++/src/objects/seq/seq_loc_mapper_base.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_loc_mapper_base.cpp 485927 2015-11-30 16:04:45Z ivanov $
+/*  $Id: seq_loc_mapper_base.cpp 493266 2016-02-25 16:13:50Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1199,9 +1199,29 @@ void CSeq_loc_Mapper_Base::x_InitializeLocs(const CSeq_loc& source,
 }
 
 
+bool CSeq_loc_Mapper_Base::x_IsSynonym(const CSeq_id& id,
+                                       const TSynonyms& synonyms) const
+{
+    CSeq_id_Handle idh = CSeq_id_Handle::GetHandle(id);
+    ITERATE(TSynonyms, it, synonyms) {
+        if (idh == *it) return true;
+    }
+    return false;
+}
+
+
 void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
                                              const CSeq_id&    to_id)
 {
+    IMapper_Sequence_Info::TSynonyms to_syn;
+    CSeq_id_Handle to_idh = CSeq_id_Handle::GetHandle(to_id);
+    CollectSynonyms(to_idh, to_syn);
+    x_InitializeAlign(map_align, to_syn);
+}
+
+void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
+                                             const TSynonyms&  to_ids)
+{
     // When finding the destination row, the first row with required seq-id
     // is used. Do not check if there are multiple rows with the same id.
     switch ( map_align.GetSegs().Which() ) {
@@ -1211,7 +1231,7 @@ void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
             ITERATE(TDendiag, diag_it, diags) {
                 size_t to_row = size_t(-1);
                 for (size_t i = 0; i < (*diag_it)->GetIds().size(); ++i) {
-                    if ( (*diag_it)->GetIds()[i]->Equals(to_id) ) {
+                    if ( x_IsSynonym(*(*diag_it)->GetIds()[i], to_ids) ) {
                         to_row = i;
                         break;
                     }
@@ -1231,7 +1251,7 @@ void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
             const CDense_seg& dseg = map_align.GetSegs().GetDenseg();
             size_t to_row = size_t(-1);
             for (size_t i = 0; i < dseg.GetIds().size(); ++i) {
-                if (dseg.GetIds()[i]->Equals(to_id)) {
+                if ( x_IsSynonym(*dseg.GetIds()[i], to_ids) ) {
                     to_row = i;
                     break;
                 }
@@ -1250,7 +1270,7 @@ void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
                 size_t to_row = size_t(-1);
                 if ((*std_seg)->IsSetIds()  &&  !(*std_seg)->GetIds().empty()) {
                     for (size_t i = 0; i < (*std_seg)->GetIds().size(); ++i) {
-                        if ((*std_seg)->GetIds()[i]->Equals(to_id)) {
+                        if ( x_IsSynonym(*(*std_seg)->GetIds()[i], to_ids) ) {
                             to_row = i;
                             break;
                         }
@@ -1261,7 +1281,7 @@ void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
                     // Try to parse seq-locs.
                     for (size_t i = 0; i < (*std_seg)->GetLoc().size(); ++i) {
                         const CSeq_id* row_id = (*std_seg)->GetLoc()[i]->GetId();
-                        if (row_id  &&  row_id->Equals(to_id)) {
+                        if (row_id  &&  x_IsSynonym(*row_id, to_ids)) {
                             to_row = i;
                             break;
                         }
@@ -1282,7 +1302,7 @@ void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
             const CPacked_seg& pseg = map_align.GetSegs().GetPacked();
             size_t to_row = size_t(-1);
             for (size_t i = 0; i < pseg.GetIds().size(); ++i) {
-                if (pseg.GetIds()[i]->Equals(to_id)) {
+                if ( x_IsSynonym(*pseg.GetIds()[i], to_ids) ) {
                     to_row = i;
                     break;
                 }
@@ -1301,13 +1321,13 @@ void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
                 // Each sub-alignment forms a separate group.
                 // See SetMergeBySeg().
                 m_CurrentGroup++;
-                x_InitializeAlign(**aln, to_id);
+                x_InitializeAlign(**aln, to_ids);
             }
             break;
         }
     case CSeq_align::C_Segs::e_Spliced:
         {
-            x_InitSpliced(map_align.GetSegs().GetSpliced(), to_id);
+            x_InitSpliced(map_align.GetSegs().GetSpliced(), to_ids);
             break;
         }
     case CSeq_align::C_Segs::e_Sparse:
@@ -1317,11 +1337,11 @@ void CSeq_loc_Mapper_Base::x_InitializeAlign(const CSeq_align& map_align,
             ITERATE(CSparse_seg::TRows, it, sparse.GetRows()) {
                 // Prefer to map from the second subrow to the first one
                 // if their ids are the same.
-                if ((*it)->GetFirst_id().Equals(to_id)) {
+                if ( x_IsSynonym((*it)->GetFirst_id(), to_ids) ) {
                     m_MapOptions &= ~fAlign_Sparse_ToSecond;
                     m_MapOptions |= fAlign_Sparse_ToFirst;
                 }
-                else if ((*it)->GetSecond_id().Equals(to_id)) {
+                else if ( x_IsSynonym((*it)->GetSecond_id(), to_ids) ) {
                     m_MapOptions &= ~fAlign_Sparse_ToFirst;
                     m_MapOptions |= fAlign_Sparse_ToSecond;
                 }
@@ -1691,15 +1711,15 @@ void CSeq_loc_Mapper_Base::x_InitAlign(const CPacked_seg& pseg, size_t to_row)
 
 
 void CSeq_loc_Mapper_Base::x_InitSpliced(const CSpliced_seg& spliced,
-                                         const CSeq_id&      to_id)
+                                         const TSynonyms&    to_ids)
 {
     // Assume the same seq-id can not be used in both genomic and product rows,
     // try find the correct row.
-    if (spliced.IsSetGenomic_id()  &&  spliced.GetGenomic_id().Equals(to_id)) {
+    if (spliced.IsSetGenomic_id()  &&  x_IsSynonym(spliced.GetGenomic_id(), to_ids)) {
         x_InitSpliced(spliced, eSplicedRow_Gen);
         return;
     }
-    if (spliced.IsSetProduct_id()  &&  spliced.GetProduct_id().Equals(to_id)) {
+    if (spliced.IsSetProduct_id()  &&  x_IsSynonym(spliced.GetProduct_id(), to_ids)) {
         x_InitSpliced(spliced, eSplicedRow_Prod);
         return;
     }
@@ -1710,11 +1730,11 @@ void CSeq_loc_Mapper_Base::x_InitSpliced(const CSpliced_seg& spliced,
     // than only those exons, which contain the requested id.
     ITERATE(CSpliced_seg::TExons, it, spliced.GetExons()) {
         const CSpliced_exon& ex = **it;
-        if (ex.IsSetGenomic_id()  &&  ex.GetGenomic_id().Equals(to_id)) {
+        if (ex.IsSetGenomic_id()  &&  x_IsSynonym(ex.GetGenomic_id(), to_ids)) {
             x_InitSpliced(spliced, eSplicedRow_Gen);
             return;
         }
-        if (ex.IsSetProduct_id()  &&  ex.GetProduct_id().Equals(to_id)) {
+        if (ex.IsSetProduct_id()  &&  x_IsSynonym(ex.GetProduct_id(), to_ids)) {
             x_InitSpliced(spliced, eSplicedRow_Prod);
             return;
         }
@@ -2627,14 +2647,23 @@ void CSeq_loc_Mapper_Base::x_OptimizeSeq_loc(CRef<CSeq_loc>& loc) const
         return;
     case CSeq_loc::e_Mix:
         {
-            // remove final NULL, if any
+            // remove final NULLs (optionally except one), if any
             {{
                 CSeq_loc_mix::Tdata &mix_locs = loc->SetMix().Set();
-                while( (mix_locs.size() > 1) && 
-                       (mix_locs.back()->IsNull()) ) 
+                bool have_null = false;
+                while (mix_locs.size() > 1  &&
+                       mix_locs.back()->IsNull())
                 {
+                    have_null = true;
                     mix_locs.pop_back();
                 }
+                // NULLs may indicate removed ranges, in this case preserve one NULL.
+                if (GetNonMappingAsNull()  &&  have_null  &&
+                    mix_locs.size() > 0  &&  !mix_locs.back()->IsNull()) {
+                    CRef<CSeq_loc> null_loc(new CSeq_loc);
+                    null_loc->SetNull();
+                    mix_locs.push_back(null_loc);
+                }
             }}
 
             switch ( loc->GetMix().Get().size() ) {
@@ -2800,7 +2829,7 @@ bool CSeq_loc_Mapper_Base::x_MapNextRange(const TRange&     src_rg,
     }
     // If the previous range could not be mapped and was removed,
     // indicate it using fuzz.
-    if ( m_LastTruncated ) {
+    if ( !GetNonMappingAsNull() && m_LastTruncated ) {
         // TODO: Reconsider this "if" after we switch permanently to C++
         if ( ((m_FuzzOption & fFuzzOption_CStyle) == 0) && !fuzz.first ) {
             if( (m_FuzzOption & fFuzzOption_RemoveLimTlOrTr) != 0 ) {
@@ -2867,6 +2896,11 @@ void CSeq_loc_Mapper_Base::x_SetLastTruncated(void)
         return;
     }
     m_LastTruncated = true;
+    if ( GetNonMappingAsNull() ) {
+        // Replace the original range with NULL.
+        x_PushNullLoc();
+        return;
+    }
     // Update the mapped location before checking its properties.
     x_PushRangesToDstMix();
     // If the mapped location does not have any fuzz set, set it to
@@ -3109,6 +3143,9 @@ void CSeq_loc_Mapper_Base::x_MapSeq_loc(const CSeq_loc& src_loc)
                 loc->Assign(src_loc);
                 x_PushLocToDstMix(loc);
             }
+            else if ( GetNonMappingAsNull() ) {
+                x_PushNullLoc();
+            }
             else {
                 m_Partial = true;
             }
@@ -3728,6 +3765,15 @@ void CSeq_loc_Mapper_Base::x_PushLocToDstMix(CRef<CSeq_loc> loc)
 }
 
 
+void CSeq_loc_Mapper_Base::x_PushNullLoc(void)
+{
+    CRef<CSeq_loc> null_loc(new CSeq_loc);
+    null_loc->SetNull();
+    x_PushRangesToDstMix();
+    x_PushLocToDstMix(null_loc);
+}
+
+
 bool CSeq_loc_Mapper_Base::x_ReverseRangeOrder(int str) const
 {
     if (m_MergeFlag == eMergeContained  || m_MergeFlag == eMergeAll) {
@@ -4090,17 +4136,14 @@ CSeq_loc_Mapper_Base::Map(CSeq_annot& annot, TAnnotMapFlags flags)
         {
             CSeq_annot::C_Data::TAlign& aligns = annot.SetData().SetAlign();
             string error;
-            bool mapped = false;
             ERASE_ITERATE(CSeq_annot::C_Data::TAlign, it, aligns) {
                 error.clear();
-                mapped = false;
                 CRef<CSeq_align> align;
                 try {
                     align = Map(**it);
                 }
                 catch (CAnnotMapperException& e) {
                     error = e.GetMsg();
-                    mapped = false;
                 }
                 if ( align ) {
                     *it = align;
@@ -4130,17 +4173,14 @@ CSeq_loc_Mapper_Base::Map(CSeq_annot& annot, TAnnotMapFlags flags)
         {
             CSeq_annot::C_Data::TGraph& graphs = annot.SetData().SetGraph();
             string error;
-            bool mapped = false;
             ERASE_ITERATE(CSeq_annot::C_Data::TGraph, it, graphs) {
                 error.clear();
-                mapped = false;
                 CRef<CSeq_graph> graph;
                 try {
                     graph = Map(**it);
                 }
                 catch (CAnnotMapperException& e) {
                     error = e.GetMsg();
-                    mapped = false;
                 }
                 if ( graph ) {
                     *it = graph;
@@ -4194,5 +4234,17 @@ void CSeq_loc_Mapper_Base::x_SetMiscFlag(EMiscFlags flag, bool value)
 }
 
 
+NCBI_PARAM_DECL(bool, Mapper, NonMapping_As_Null);
+NCBI_PARAM_DEF_EX(bool, Mapper, NonMapping_As_Null, false, eParam_NoThread,
+                  MAPPER_NONMAPPING_AS_NULL);
+typedef NCBI_PARAM_TYPE(Mapper, NonMapping_As_Null) TNonMappingAsNullParam;
+
+
+bool CSeq_loc_Mapper_Base::GetNonMappingAsNull(void)
+{
+    return TNonMappingAsNullParam::GetDefault();
+}
+
+
 END_SCOPE(objects)
 END_NCBI_SCOPE
diff --git a/c++/src/objects/seq/sofa_map.cpp b/c++/src/objects/seq/sofa_map.cpp
index 46d78d3..036de1b 100644
--- a/c++/src/objects/seq/sofa_map.cpp
+++ b/c++/src/objects/seq/sofa_map.cpp
@@ -1,4 +1,4 @@
-/*  $Id: sofa_map.cpp 350959 2012-01-25 13:15:51Z ludwigf $
+/*  $Id: sofa_map.cpp 500108 2016-05-02 15:38:01Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,6 +33,8 @@
 //#include <objects/seq/genbank_type.hpp>
 #include <objects/seq/sofa_type.hpp>
 #include <objects/seq/sofa_map.hpp>
+#include <objects/seqfeat/RNA_ref.hpp>
+#include <objects/seqfeat/RNA_gen.hpp>
 
 BEGIN_NCBI_SCOPE
 USING_SCOPE(objects);
@@ -69,25 +71,31 @@ void CSofaMap::x_Init()
     m_Map[ GT( e_Imp, eSubtype_D_loop ) ]       = SofaType( 297, "D_loop" );
     m_Map[ GT( e_Imp, eSubtype_D_segment ) ]    = SofaType( 458, "D_gene_segment" );
     m_Map[ GT( e_Imp, eSubtype_exon ) ]         = SofaType( 147, "exon" );
-    m_Map[ GT( e_Imp, eSubtype_GC_signal ) ]    = SofaType( 173, "GC_rich_region" );
+    m_Map[ GT( e_Imp, eSubtype_GC_signal ) ]    = SofaType( 173, "GC_rich_promoter" );
     m_Map[ GT( e_Imp, eSubtype_J_segment ) ]    = SofaType( 470, "J_gene_segment" );
     m_Map[ GT( e_Imp, eSubtype_LTR ) ]          = SofaType( 286, "long_terminal_repeat" );
+    m_Map[ GT( e_Imp, eSubtype_N_region ) ]     = SofaType( 1835, "N_region" );
     m_Map[ GT( e_Imp, eSubtype_RBS ) ]          = SofaType( 139, "ribosome_entry_site" );
     m_Map[ GT( e_Imp, eSubtype_STS ) ]          = SofaType( 331, "STS" );
+    m_Map[ GT( e_Imp, eSubtype_S_region ) ]     = SofaType( 1836, "S_region" );
     m_Map[ GT( e_Imp, eSubtype_TATA_signal ) ]  = SofaType( 174, "TATA_box" );
-    m_Map[ GT( e_Imp, eSubtype_attenuator ) ]   = SofaType( 140, "attenuator" );
-    m_Map[ GT( e_Imp, eSubtype_enhancer ) ]     = SofaType( 165, "enhancer" );
+    m_Map[ GT( e_Imp, eSubtype_V_region ) ]     = SofaType( 1833, "V_region");
+    m_Map[ GT( e_Imp, eSubtype_assembly_gap ) ] = SofaType( 730, "gap" );
+    m_Map[ GT( e_Imp, eSubtype_attenuator)]     = SofaType(140, "attenuator");
+    m_Map[ GT( e_Imp, eSubtype_centromere)]     = SofaType( 577, "centromere");
+    m_Map[ GT( e_Imp, eSubtype_conflict)]       = SofaType( 1085, "sequence_conflict");
+    m_Map[ GT( e_Imp, eSubtype_enhancer)]       = SofaType( 165, "enhancer");
     m_Map[ GT( e_Imp, eSubtype_gap ) ]          = SofaType( 730, "gap" );
     m_Map[ GT( e_Imp, eSubtype_iDNA ) ]         = SofaType( 723, "iDNA" );
     m_Map[ GT( e_Imp, eSubtype_intron ) ]       = SofaType( 188, "intron" );
     m_Map[ GT( e_Imp, eSubtype_mat_peptide ) ]  = SofaType( 419, "mature_peptide" );
-    m_Map[ GT( e_Imp, eSubtype_misc_RNA ) ]     = SofaType( 673, "transcript" );
     m_Map[ GT( e_Imp, eSubtype_misc_binding ) ] = SofaType( 409, "binding_site" );
     m_Map[ GT( e_Imp, eSubtype_misc_difference) ] = SofaType( 413, "sequence_difference" );
-    m_Map[ GT( e_Imp, eSubtype_misc_feature ) ] = SofaType( 1, "region" );
+    m_Map[ GT( e_Imp, eSubtype_misc_feature ) ] = SofaType( 110, "sequence_feature" );
     m_Map[ GT( e_Imp, eSubtype_misc_recomb ) ]  = SofaType( 298, "recombination_feature" );
     m_Map[ GT( e_Imp, eSubtype_misc_signal ) ]  = SofaType( 5836, "regulatory_region" );
     m_Map[ GT( e_Imp, eSubtype_misc_structure ) ] = SofaType( 2, "sequence_secondary_structure" );
+    m_Map[ GT( e_Imp, eSubtype_mobile_element ) ]= SofaType( 1037, "mobile_genetic_element" );
     m_Map[ GT( e_Imp, eSubtype_modified_base ) ]= SofaType( 305, "modified_base_site" );
     m_Map[ GT( e_Imp, eSubtype_operon ) ]       = SofaType( 178, "operon" );
     m_Map[ GT( e_Imp, eSubtype_oriT ) ]         = SofaType( 724, "oriT" );
@@ -98,18 +106,126 @@ void CSofaMap::x_Init()
     m_Map[ GT( e_Imp, eSubtype_primer_bind ) ]  = SofaType( 5850, "primer_binding_site" );
     m_Map[ GT( e_Imp, eSubtype_promoter ) ]     = SofaType( 167, "promoter" );
     m_Map[ GT( e_Imp, eSubtype_protein_bind ) ] = SofaType( 410, "protein_binding_site" );
+    m_Map[ GT( e_Imp, eSubtype_rep_origin ) ] = SofaType( 296, "origin_of_replication" );
     m_Map[ GT( e_Imp, eSubtype_repeat_region ) ] = SofaType( 657, "repeat_region" );
     m_Map[ GT( e_Imp, eSubtype_repeat_unit ) ]  = SofaType( 726, "repeat_unit" );
     m_Map[ GT( e_Imp, eSubtype_satellite ) ]    = SofaType( 5, "satellite_DNA" );
     m_Map[ GT( e_Imp, eSubtype_sig_peptide ) ]  = SofaType( 418, "signal_peptide" );
+    m_Map[ GT( e_Imp, eSubtype_site_ref ) ]       = SofaType( 408, "site" );
     m_Map[ GT( e_Imp, eSubtype_source ) ]       = SofaType( 2000061, "databank_entry" );
     m_Map[ GT( e_Imp, eSubtype_stem_loop ) ]    = SofaType( 313, "stem_loop" );
+    m_Map[ GT( e_Imp, eSubtype_telomere ) ]   = SofaType( 624, "telomere" );
     m_Map[ GT( e_Imp, eSubtype_terminator ) ]   = SofaType( 141, "terminator" );
     m_Map[ GT( e_Imp, eSubtype_transit_peptide ) ] = SofaType( 725, "transit_peptide" );
+    m_Map[ GT( e_Imp, eSubtype_unsure ) ] = SofaType( 1086, "sequence_uncertainty" );
     m_Map[ GT( e_Imp, eSubtype_V_segment ) ]    = SofaType( 466, "V_gene_segment" );
-    m_Map[ GT( e_Imp, eSubtype_variation ) ]    = SofaType( 109, "sequence_variant" );
+    m_Map[ GT( e_Imp, eSubtype_variation ) ]    = SofaType( 1059, "sequence_alteration" );
+    m_Map[ GT( e_Imp, eSubtype_virion ) ]    = SofaType( 1041, "viral_sequence" );
+
+    m_Map[ GT( e_Comment, eSubtype_comment ) ]  = SofaType( 700, "remark" );
+
+    m_Map[ GT( e_Prot, eSubtype_mat_peptide_aa ) ]  = SofaType( 419, "mature_protein_region" );
+    m_Map[ GT( e_Prot, eSubtype_preprotein ) ]  = SofaType( 1063, "immature_peptide_region" );
+    m_Map[ GT( e_Prot, eSubtype_prot ) ]  = SofaType( 358, "polypeptide" );
+    m_Map[ GT( e_Prot, eSubtype_sig_peptide_aa ) ]  = SofaType( 418, "signal_peptide" );
+    m_Map[ GT( e_Prot, eSubtype_transit_peptide_aa ) ]  = SofaType( 725, "transit_peptide" );
+
+    m_Map[ GT( e_Psec_str, eSubtype_psec_str ) ]  = SofaType( 2, "sequence_secondary_structure" );
+
+    m_Map[ GT( e_Rsite, eSubtype_rsite ) ]  = SofaType( 168, "restriction_enzyme_cut_site" );
+
+    m_Map[ GT( e_Variation, eSubtype_variation_ref ) ]  = SofaType( 1059, "sequence_alteration" );
+
+    //m_Map[ GT( e_Site, eSubtype_site ) ]  = SofaType( 408, "site" );
 };
 
+
+string
+CSofaMap::FeatureToSofaType(
+    const CSeq_feat& feat)
+{
+    const CSeqFeatData& data = feat.GetData();
+    CSeqFeatData::ESubtype subtype = data.GetSubtype();
+    if (subtype == CSeqFeatData::eSubtype_bond) {
+        switch(data.GetBond()) {
+        default:
+            return MappedName(data.Which(), subtype);
+        case CSeqFeatData::eBond_disulfide:
+            return "disulfide_bond";
+        case CSeqFeatData::eBond_xlink:
+            return "cross_link"; 
+        }
+    }
+    if (subtype == CSeqFeatData::eSubtype_regulatory) {
+        string regulatoryClass = feat.GetNamedQual("regulatory_class");
+        if (regulatoryClass.empty()) {
+             return MappedName(data.Which(), subtype);
+       }
+        if (regulatoryClass == "attenuator") {
+            return "attenuator";
+        }
+        if (regulatoryClass == "CAAT_signal") {
+            return "CAAT_signal";
+        }
+        if (regulatoryClass == "enhancer") {
+            return "enhancer";
+        }
+        if (regulatoryClass == "enhancer_blocking_element") {
+            return "insulator";
+        }
+        if (regulatoryClass == "GC_signal") {
+            return "GC_rich_promoter_region";
+        }
+        if (regulatoryClass == "insulator") {
+            return "boundary_element";
+        }
+        if (regulatoryClass == "locus_control_region") {
+            return "locus_control_region";
+        }
+        if (regulatoryClass == "minus_35_signal") {
+            return "minus_35_signal";
+        }
+        if (regulatoryClass == "minus_10_signal") {
+            return "minus_10_signal";
+        }
+        if (regulatoryClass == "polyA_signal_sequence") {
+            return "polyA_signal_sequence";
+        }
+        if (regulatoryClass == "promoter") {
+            return "promoter";
+        }
+        if (regulatoryClass == "ribosome_binding_site") {
+            return "Shine_Dalgarno_sequence";
+        }
+        if (regulatoryClass == "riboswitch") {
+            return "riboswitch";
+        }
+        if (regulatoryClass == "silencer") {
+            return "silencer";
+        }
+        if (regulatoryClass == "TATA_box") {
+            return "TATA_box";
+        }
+        if (regulatoryClass == "terminator") {
+            return "terminator";
+        }
+        return MappedName(data.Which(), subtype);
+    }
+    if (subtype == CSeqFeatData::eSubtype_ncRNA) {
+        const CSeqFeatData::TRna& rna = data.GetRna();
+        if ( !rna.IsSetExt() ) {
+            return MappedName(data.Which(), subtype);
+        }
+        const CRNA_ref::TExt& ext = rna.GetExt();
+        if ( !ext.IsGen()  ||  !ext.GetGen().IsSetClass()) {
+            return MappedName(data.Which(), subtype);
+        }
+        string ncrnaClass = ext.GetGen().GetClass();
+    }    
+    return MappedName(data.Which(), subtype);
+}
+
+
 #undef GT
         
 END_NCBI_SCOPE
diff --git a/c++/src/objects/seqfeat/BioSource.cpp b/c++/src/objects/seqfeat/BioSource.cpp
index fe98624..710ffe0 100644
--- a/c++/src/objects/seqfeat/BioSource.cpp
+++ b/c++/src/objects/seqfeat/BioSource.cpp
@@ -1,4 +1,4 @@
-/* $Id: BioSource.cpp 483244 2015-10-29 14:26:03Z ivanov $
+/* $Id: BioSource.cpp 489235 2016-01-11 17:03:30Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -70,13 +70,13 @@ CBioSource::~CBioSource(void)
 }
 
 
-int CBioSource::GetGenCode(void) const
+int CBioSource::GetGenCode(int def) const
 {
     try {
         TGenome genome = CanGetGenome() ? GetGenome() : eGenome_unknown;
 
         if ( !CanGetOrg()  ||  !GetOrg().CanGetOrgname() ) {
-            return 1; // assume standard genetic code
+            return def; // assume standard genetic code
         }
         const COrgName& orn = GetOrg().GetOrgname();
 
@@ -84,12 +84,13 @@ int CBioSource::GetGenCode(void) const
         case eGenome_kinetoplast:
         case eGenome_mitochondrion:
         case eGenome_hydrogenosome:
+        case eGenome_plasmid_in_mitochondrion:
             {
                 // mitochondrial code
                 if (orn.IsSetMgcode()) {
                     return orn.GetMgcode();
                 }
-                return 1;
+                return def;
             }
         case eGenome_chloroplast:
         case eGenome_chromoplast:
@@ -98,6 +99,8 @@ int CBioSource::GetGenCode(void) const
         case eGenome_apicoplast:
         case eGenome_leucoplast:
         case eGenome_proplastid:
+        case eGenome_chromatophore:
+        case eGenome_plasmid_in_plastid:
             {
                 // bacteria and plant plastid code
                 if (orn.IsSetPgcode()) {
@@ -112,11 +115,11 @@ int CBioSource::GetGenCode(void) const
                 if (orn.IsSetGcode()) {
                     return orn.GetGcode();
                 }
-                return 1;
+                return def;
             }
         }
     } catch (...) {
-        return 1; // was 0(!)
+        return def; // was 0(!)
     }
 }
 
@@ -125,6 +128,7 @@ typedef SStaticPair<const char *, CBioSource::EGenome> TGenomeKey;
 static const TGenomeKey genome_key_to_subtype [] = {
     {  "apicoplast",                CBioSource::eGenome_apicoplast        },
     {  "chloroplast",               CBioSource::eGenome_chloroplast       },
+    {  "chromatophore",             CBioSource::eGenome_chromatophore     },
     {  "chromoplast",               CBioSource::eGenome_chromoplast       },
     {  "cyanelle",                  CBioSource::eGenome_cyanelle          },
     {  "endogenous_virus",          CBioSource::eGenome_endogenous_virus  },
@@ -142,7 +146,8 @@ static const TGenomeKey genome_key_to_subtype [] = {
     {  "plastid",                   CBioSource::eGenome_plastid           },
     {  "plastid:apicoplast",        CBioSource::eGenome_apicoplast        },
     {  "plastid:chloroplast",       CBioSource::eGenome_chloroplast       },
-    {  "plastid:chromoplast",       CBioSource::eGenome_chromoplast       },
+    {  "plastid:chromatophore", CBioSource::eGenome_chromatophore         },
+    {  "plastid:chromoplast", CBioSource::eGenome_chromoplast             },
     {  "plastid:cyanelle",          CBioSource::eGenome_cyanelle          },
     {  "plastid:leucoplast",        CBioSource::eGenome_leucoplast        },
     {  "plastid:proplastid",        CBioSource::eGenome_proplastid        },
@@ -207,7 +212,7 @@ CBioSource::EGenome CBioSource::GetGenomeByOrganelle (const string& organelle, N
 
 string CBioSource::GetOrganelleByGenome (unsigned int genome)
 {
-    string organelle = "";
+    string organelle = kEmptyStr;
     TGenomeMap::const_iterator g_iter = sm_GenomeKeys.begin();
     while (g_iter != sm_GenomeKeys.end() &&
            unsigned(g_iter->second) != genome) {
@@ -232,7 +237,6 @@ static const TOriginKey origin_key_to_subtype [] = {
     {  "unknown",                   CBioSource::eOrigin_unknown       }
 };
 
-
 static const TOriginKey origin_synonyms [] = {
     {  "mut",                       CBioSource::eOrigin_mut           },
     {  "nat mut",                   CBioSource::eOrigin_natmut        },
@@ -440,6 +444,8 @@ string CBioSource::GetRepliconName(void) const
     if (IsSetGenome()) {
         switch (GetGenome()) {
             case CBioSource::eGenome_plasmid:
+            case CBioSource::eGenome_plasmid_in_mitochondrion:
+            case CBioSource::eGenome_plasmid_in_plastid:
                 return "unnamed";
                 break;
             case CBioSource::eGenome_chromosome:
@@ -454,21 +460,29 @@ string CBioSource::GetRepliconName(void) const
             case CBioSource::eGenome_apicoplast:
             case CBioSource::eGenome_leucoplast:
             case CBioSource::eGenome_proplastid:
+            case CBioSource::eGenome_chromatophore:
                 return "Pltd";
                 break;
             case CBioSource::eGenome_mitochondrion:
+            case CBioSource::eGenome_hydrogenosome:
                 return "MT";
                 break;
         }
     }
-    return "";
+    return kEmptyStr;
 }
 
 
 string CBioSource::GetBioprojectType (void) const
 {
-    if (IsSetGenome() && GetGenome() == CBioSource::eGenome_plasmid) {
-        return "ePlasmid";
+    if (IsSetGenome()) {
+        switch (GetGenome()) {
+            case CBioSource::eGenome_plasmid:
+            case CBioSource::eGenome_plasmid_in_mitochondrion:
+            case CBioSource::eGenome_plasmid_in_plastid:
+                return "ePlasmid";
+                break;
+        }
     }
 
     ITERATE (CBioSource::TSubtype, sit, GetSubtype()) {
@@ -557,20 +571,19 @@ string CBioSource::GetBioprojectLocation(void) const
                 break;
         }
     }
-
     if (NStr::Equal(GetBioprojectType(), "ePlasmid")) {
         return "eNuclearProkaryote";
     }
 
-    return "";
+    return kEmptyStr;
 }
 
-const string kDisableStrainForwardAttrib = "nomodforward";
+static const char* kDisableStrainForwardAttrib = "nomodforward";
 
 void CBioSource::SetDisableStrainForwarding(bool val)
 {
     if (val) {
-        string attrib = "";
+        string attrib = kEmptyStr;
         if (IsSetOrg() && GetOrg().IsSetOrgname() && GetOrg().GetOrgname().IsSetAttrib()) {
             attrib = GetOrg().GetOrgname().GetAttrib();
         }
@@ -613,9 +626,8 @@ bool s_MustCopy (int subtype)
                || subtype == CSubSource::eSubtype_plasmid_name
                || subtype == CSubSource::eSubtype_other) {
         return false;
-    } else {
-        return true;
     }
+    return true;
 }
 
 
@@ -723,10 +735,10 @@ void CBioSource::x_ClearCoordinatedBioSampleSubSources()
 }
 
 
-const string kOrgModNote = "orgmod_note";
-const string kSubSrcNote = "subsrc_note";
-const string kOrganismName = "Organism Name";
-const string kTaxId = "Tax ID";
+static const char* kOrgModNote   = "orgmod_note";
+static const char* kSubSrcNote   = "subsrc_note";
+static const char* kOrganismName = "Organism Name";
+static const char* kTaxId        = "Tax ID";
 
 CBioSource::TNameValList CBioSource::GetNameValPairs() const
 {
@@ -739,8 +751,8 @@ CBioSource::TNameValList CBioSource::GetNameValPairs() const
         int taxid = GetOrg().GetTaxId();
         if (taxid > 0) {
             try {
-                    string val = NStr::NumericToString(taxid);
-                    list.push_back(TNameVal(kTaxId, val));
+                string val = NStr::NumericToString(taxid);
+                list.push_back(TNameVal(kTaxId, val));
             } catch (...) {
             }
         }
@@ -865,11 +877,7 @@ static const TCIgnoreCaseQualsSet s_IgnoreCaseQualsSet(s_IgnoreCaseQuals, sizeof
 
 bool s_MayIgnoreCase(const string& value)
 {   
-    if (s_IgnoreCaseQualsSet.find(value.c_str()) != s_IgnoreCaseQualsSet.end()) {
-        return true;
-    } else {
-        return false;
-    }
+    return s_IgnoreCaseQualsSet.find(value.c_str()) != s_IgnoreCaseQualsSet.end();
 }
 
 
@@ -891,57 +899,52 @@ static const TCTaxNameElementQualsSet s_TaxNameElementQualsSet(s_TaxNameElementQ
 
 bool s_IsTaxNameElement(const string& value)
 {   
-    if (s_TaxNameElementQualsSet.find(value.c_str()) != s_TaxNameElementQualsSet.end()) {
-        return true;
-    } else {
-        return false;
-    }
+    return s_TaxNameElementQualsSet.find(value.c_str()) != s_TaxNameElementQualsSet.end();
 }
 
 
 typedef enum {
-  eConflictIgnoreAll = 0,
-  eConflictIgnoreMissingInBioSource,
-  eConflictIgnoreMissingInBioSample
+    eConflictIgnoreAll = 0,
+    eConflictIgnoreMissingInBioSource,
+    eConflictIgnoreMissingInBioSample
 } EConflictIgnoreType;
 
 
 typedef struct ignoreconflict {
-  string qual_name;
-  EConflictIgnoreType ignore_type;
+    const char*         qual_name;
+    EConflictIgnoreType ignore_type;
 } IgnoreConflictData;
 
 
 static IgnoreConflictData sIgnoreConflictList[] = {
-  { "chromosome", eConflictIgnoreMissingInBioSample } ,
-  { "endogenous-virus-name", eConflictIgnoreMissingInBioSample } ,
-  { "germline", eConflictIgnoreMissingInBioSample } ,
-  { "insertion-seq-name", eConflictIgnoreMissingInBioSample } ,
-  { "linkage-group", eConflictIgnoreMissingInBioSample } ,
-  { "map", eConflictIgnoreMissingInBioSample } ,
-  { "plasmid-name", eConflictIgnoreMissingInBioSample } ,
-  { "pop-variant", eConflictIgnoreMissingInBioSample } ,
-  { "rearranged", eConflictIgnoreMissingInBioSample } ,
-  { "segment", eConflictIgnoreMissingInBioSample } ,
-  { "transgenic", eConflictIgnoreMissingInBioSample } ,
-  { "transposon-name", eConflictIgnoreMissingInBioSample } ,
-  { "whole-replicon", eConflictIgnoreMissingInBioSample } ,
-  { "acronym", eConflictIgnoreAll },
-  { "common", eConflictIgnoreAll } ,
-  { "dosage", eConflictIgnoreAll } ,
-  { "gb-acronym", eConflictIgnoreAll } ,
-  { "gb-anamorph", eConflictIgnoreAll } ,
-  { "gb-synonym", eConflictIgnoreAll } ,
-  { "lineage", eConflictIgnoreAll } ,
-  { "old-lineage", eConflictIgnoreAll } ,
-  { "old-name", eConflictIgnoreAll } ,
-  { "synonym", eConflictIgnoreAll } ,
-  { "type-material", eConflictIgnoreAll },
-  { "StructuredCommentPrefix", eConflictIgnoreAll} ,
-  { "StructuredCommentSuffix", eConflictIgnoreAll}
+    { "chromosome", eConflictIgnoreMissingInBioSample } ,
+    { "endogenous-virus-name", eConflictIgnoreMissingInBioSample } ,
+    { "germline", eConflictIgnoreMissingInBioSample } ,
+    { "insertion-seq-name", eConflictIgnoreMissingInBioSample } ,
+    { "linkage-group", eConflictIgnoreMissingInBioSample } ,
+    { "map", eConflictIgnoreMissingInBioSample } ,
+    { "plasmid-name", eConflictIgnoreMissingInBioSample } ,
+    { "pop-variant", eConflictIgnoreMissingInBioSample } ,
+    { "rearranged", eConflictIgnoreMissingInBioSample } ,
+    { "segment", eConflictIgnoreMissingInBioSample } ,
+    { "transgenic", eConflictIgnoreMissingInBioSample } ,
+    { "transposon-name", eConflictIgnoreMissingInBioSample } ,
+    { "whole-replicon", eConflictIgnoreMissingInBioSample } ,
+    { "acronym", eConflictIgnoreAll },
+    { "common", eConflictIgnoreAll } ,
+    { "dosage", eConflictIgnoreAll } ,
+    { "gb-acronym", eConflictIgnoreAll } ,
+    { "gb-anamorph", eConflictIgnoreAll } ,
+    { "gb-synonym", eConflictIgnoreAll } ,
+    { "lineage", eConflictIgnoreAll } ,
+    { "old-lineage", eConflictIgnoreAll } ,
+    { "old-name", eConflictIgnoreAll } ,
+    { "synonym", eConflictIgnoreAll } ,
+    { "type-material", eConflictIgnoreAll },
+    { "StructuredCommentPrefix", eConflictIgnoreAll} ,
+    { "StructuredCommentSuffix", eConflictIgnoreAll}
 };
 
-static const int kNumIgnoreConflictList = sizeof (sIgnoreConflictList) / sizeof (IgnoreConflictData);
 
 bool s_SameExceptPrecision (double val1, double val2)
 {
@@ -954,15 +957,14 @@ bool s_SameExceptPrecision (double val1, double val2)
     sprintf(buf2, "%0.2f", val2);
     if (strcmp(buf1, buf2) == 0) {
         return true;
-    } else {
-        return false;
     }
+    return false;
 }
     
 
 bool CBioSource::ShouldIgnoreConflict(const string& label, string src_val, string sample_val, bool is_local_copy)
 {
-    int i;
+    size_t i;
     bool rval = false;
 
     // ignore if BioSource value is blank and BioSample value is a stop word
@@ -1004,8 +1006,8 @@ bool CBioSource::ShouldIgnoreConflict(const string& label, string src_val, strin
         }
     }
 
-    for (i = 0; i < kNumIgnoreConflictList; i++) {
-        if (NStr::EqualNocase (label, sIgnoreConflictList[i].qual_name)) {
+    for (i = 0; i < ArraySize(sIgnoreConflictList); i++) {
+        if (NStr::EqualNocase(label, sIgnoreConflictList[i].qual_name)) {
             EConflictIgnoreType ignore_type = sIgnoreConflictList[i].ignore_type;
             if (is_local_copy && ignore_type == eConflictIgnoreMissingInBioSample) {
                 ignore_type = eConflictIgnoreAll;
@@ -1299,94 +1301,92 @@ void CBioSource::RemoveCultureNotes(bool is_species_level)
     }
 }
 
-static const string s_SpecialLineageWords[] = {
-  "Class",
-  "Classification",
-  "Domain",
-  "Family",
-  "Genus",
-  "Kingdom",
-  "Lineage",
-  "Note",
-  "Order",
-  "Organism",
-  "Phylum",
-  "Species",
-  "Superfamily",
-  "Tax class/lineage",
-  "Taxonomic classification", 
-  "Taxonomic Classification is",
-  "Taxonomy"
+static const char* s_SpecialLineageWords[] = {
+    "Class",
+    "Classification",
+    "Domain",
+    "Family",
+    "Genus",
+    "Kingdom",
+    "Lineage",
+    "Note",
+    "Order",
+    "Organism",
+    "Phylum",
+    "Species",
+    "Superfamily",
+    "Tax class/lineage",
+    "Taxonomic classification", 
+    "Taxonomic Classification is",
+    "Taxonomy"
 };
 
+typedef vector<CTempString> TWordList;
+
 // workaround for std::replace_if
-static inline bool s_IsPunct( char ch ) { return ispunct((unsigned char) ch) != 0; }
+static inline bool s_IsPunct( char ch ) { return ispunct((unsigned char)ch) != 0; }
 
-static void s_GetWordListFromText(string& str, vector<string>& word_list)
+static void s_GetWordListFromText(string& str, TWordList& word_list)
 {
-    if (NStr::IsBlank(str))
+    if (str.empty()) {
         return;
-
-    vector<string> tokens;
-    std::replace_if(str.begin(), str.end(), s_IsPunct, ' ');
-    NStr::Tokenize(str, " ", tokens, NStr::eMergeDelims);
-    for (size_t i = 0; i < tokens.size(); ++i) {
-        word_list.push_back(tokens[i]);
     }
+    std::replace_if(str.begin(), str.end(), s_IsPunct, ' ');
+    NStr::Tokenize(str, " ", word_list, NStr::eMergeDelims);
 }
 
-static bool s_DoesTextContainOnlyTheseWords(const string& text, const vector<string>& word_list)
+
+static bool s_DoesTextContainOnlyTheseWords(const string& text, const TWordList& word_list)
 {
-    if (NStr::IsBlank(text)) 
+    if (text.empty()) {
         return false;
-
-    bool match = false, at_least_one = false;
+    }
+    bool match = true, at_least_one = false;
 
     const char* orig = text.c_str();
     const char* ch = orig;
 
-    while (isspace(*ch) || ispunct(*ch)) {
+    while (isspace((unsigned char)(*ch)) || ispunct((unsigned char)(*ch))) {
         ++ch;
     }
-    
-    match = true;
     while (*ch != 0 && match) {
         match = false;
-        for (vector<string>::const_iterator word = word_list.begin(); word != word_list.end() && !match; ++word) {
-            size_t length = (*word).size();
-            if (NStr::strncasecmp(ch, (*word).c_str(), length) == 0 &&
-                (*(ch + length) == 0 || isspace(*(ch + length)) || ispunct(*(ch + length)))) {
-                match = true;
-                ch += length;
-                at_least_one = true;
+        for (TWordList::const_iterator word = word_list.begin(); word != word_list.end() && !match; ++word) {
+            size_t length = word->size();
+            if (NStr::strncasecmp(ch, word->data(), length) == 0) {
+                unsigned char next = *(ch + length);
+                if (next == '\0' || isspace(next) || ispunct(next)) {
+                    match = true;
+                    ch += length;
+                    at_least_one = true;
+                }
             }
         }
-        while (isspace(*ch) || ispunct(*ch)) {
+        while (isspace((unsigned char)(*ch)) || ispunct((unsigned char)(*ch))) {
             ++ch;
         }
     }
-    
     return (match && at_least_one);
 }
 
+
 bool CBioSource::RemoveLineageSourceNotes()
 {
     if (!IsSetOrg()  || !IsSetLineage() || GetOrg().GetTaxId() == 0) {
         return false;
     }
-
     bool any_removed = false;
 
     // gather all words that appear in lineage, taxname and in s_SpecialLineageWords
-    vector<string> word_list;
+    TWordList word_list;
 
     string lineage(GetLineage());
-    s_GetWordListFromText( lineage, word_list );
-    
+    s_GetWordListFromText(lineage, word_list);
+   
     string taxname(GetTaxname());
-    s_GetWordListFromText( taxname, word_list );
+    s_GetWordListFromText(taxname, word_list);
     
-    for (unsigned int i = 0; i < sizeof(s_SpecialLineageWords)/sizeof(s_SpecialLineageWords[0]); ++i) {
+    for (unsigned int i = 0; i < ArraySize(s_SpecialLineageWords); ++i) {
         word_list.push_back(s_SpecialLineageWords[i]);
     }
 
@@ -1441,6 +1441,7 @@ bool CBioSource::RemoveLineageSourceNotes()
     return any_removed;
 }
 
+
 bool CBioSource::RemoveSubSource(int subtype)
 {
     bool rval = false;
@@ -1485,7 +1486,8 @@ bool CBioSource::RemoveOrgMod(int subtype)
 }
 
 
-#define MAKE_COMMON_INT(o1,o2,o3,Field) if (o1.IsSet##Field() && o2.IsSet##Field() && o1.Get##Field() == o2.Get##Field()) o3.Set##Field(o1.Get##Field());
+#define MAKE_COMMON_INT(o1,o2,o3,Field) \
+    if (o1.IsSet##Field() && o2.IsSet##Field() && o1.Get##Field() == o2.Get##Field()) o3.Set##Field(o1.Get##Field());
 
 CRef<CBioSource> CBioSource::MakeCommon( const CBioSource& other) const
 {
diff --git a/c++/src/objects/seqfeat/Gb_qual.cpp b/c++/src/objects/seqfeat/Gb_qual.cpp
index bf0db9c..f8b2275 100644
--- a/c++/src/objects/seqfeat/Gb_qual.cpp
+++ b/c++/src/objects/seqfeat/Gb_qual.cpp
@@ -1,4 +1,4 @@
-/* $Id: Gb_qual.cpp 481760 2015-10-15 15:32:51Z ivanov $
+/* $Id: Gb_qual.cpp 493884 2016-03-02 14:18:51Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -44,6 +44,7 @@
 #include <serial/enumvalues.hpp>
 #include <serial/serialimpl.hpp>
 
+
 // generated classes
 
 
@@ -82,11 +83,11 @@ static const char * const valid_inf_prefixes [] = {
 void CGb_qual::ParseExperiment(const string& orig, string& category, string& experiment, string& doi)
 {
     experiment = orig;
-    category = "";
-    doi = "";
+    category.clear();
+    doi.clear();
     NStr::TruncateSpacesInPlace(experiment);
 
-    for (unsigned int i = 0; i < sizeof (valid_inf_categories) / sizeof (char *); i++) {
+    for (unsigned int i = 0; i < ArraySize(valid_inf_categories); i++) {
         if (NStr::StartsWith (experiment, valid_inf_categories[i])) {
             category = valid_inf_categories[i];
             experiment = experiment.substr(category.length());
@@ -101,7 +102,7 @@ void CGb_qual::ParseExperiment(const string& orig, string& category, string& exp
     if (NStr::EndsWith(experiment, "]")) {
         size_t start_doi = NStr::Find(experiment, "[");
 
-        if (start_doi != string::npos) {
+        if (start_doi != NPOS) {
             doi = experiment.substr(start_doi + 1);
             doi = doi.substr(0, doi.length() - 1);
             experiment = experiment.substr(0, start_doi);
@@ -112,7 +113,7 @@ void CGb_qual::ParseExperiment(const string& orig, string& category, string& exp
 
 string CGb_qual::BuildExperiment(const string& category, const string& experiment, const string& doi)
 {
-    string rval = "";
+    string rval;
     if (!NStr::IsBlank(category)) {
         rval += category + ":";
     }
@@ -159,10 +160,10 @@ bool CGb_qual::CleanupRptUnitRange(string& val)
     if (NStr::IsBlank(val)) {
         return false;
     }
-    if (NStr::Find(val, ".") != string::npos) {
+    if (NStr::Find(val, ".") != NPOS) {
         return false;
     }
-    if (NStr::Find(val, "-") == string::npos) {
+    if (NStr::Find(val, "-") == NPOS) {
         return false;
     }
     if (string::npos != val.find_first_not_of("0123456789-")) {
@@ -173,6 +174,94 @@ bool CGb_qual::CleanupRptUnitRange(string& val)
 }
 
 
+const CGb_qual::TLegalRepeatTypeSet &
+CGb_qual::GetSetOfLegalRepeatTypes(void)
+{
+    static char * const repeat_types[] = {
+        "centromeric_repeat",
+        "direct",
+        "dispersed",
+        "engineered_foreign_repetitive_element",
+        "flanking",
+        "inverted",
+        "long_terminal_repeat",
+        "non_LTR_retrotransposon_polymeric_tract",
+        "other",
+        "tandem",
+        "telomeric_repeat",
+        "terminal",
+        "X_element_combinatorial_repeat",
+        "Y_prime_element"
+    };
+
+
+    DEFINE_STATIC_ARRAY_MAP_WITH_COPY(
+        TLegalRepeatTypeSet, sc_LegalRepeatTypes, repeat_types);
+
+    return sc_LegalRepeatTypes;
+}
+
+
+bool CGb_qual::IsValidRptTypeValue(const string& val)
+{
+    const TLegalRepeatTypeSet& repeat_types = GetSetOfLegalRepeatTypes();
+
+    bool error = false;
+
+    // look for list of values
+    vector<string> rpt_types;
+    NStr::Tokenize(val, ",", rpt_types);
+    ITERATE(vector<string>, it, rpt_types) {
+        string v = (*it);
+        NStr::TruncateSpacesInPlace(v);
+        if (NStr::StartsWith(v, "(")) {
+            v = v.substr(1);
+        }
+        if (NStr::EndsWith(v, ")")) {
+            v = v.substr(0, v.length() - 1);
+        }
+        NStr::TruncateSpacesInPlace(v);
+        if (repeat_types.find(v.c_str()) == repeat_types.end()) {
+            error = true;
+            break;
+        }
+    }
+
+    return !error;
+}
+
+
+const CGb_qual::TLegalPseudogeneSet &
+CGb_qual::GetSetOfLegalPseudogenes(void)
+{
+    static char * const pseudogenes[] = {
+        "allelic",
+        "processed",
+        "unitary",
+        "unknown",
+        "unprocessed"
+    };
+
+
+    DEFINE_STATIC_ARRAY_MAP_WITH_COPY(
+        TLegalPseudogeneSet, sc_LegalPseudogenes, pseudogenes);
+
+    return sc_LegalPseudogenes;
+}
+
+
+bool CGb_qual::IsValidPseudogeneValue(const string& val)
+{
+    const TLegalPseudogeneSet& pseudogenes = GetSetOfLegalPseudogenes();
+
+    if (pseudogenes.find(val.c_str()) == pseudogenes.end()) {
+        return false;
+    } else {
+        return true;
+    }
+}
+
+
 // constructor
 CInferencePrefixList::CInferencePrefixList(void)
 {
@@ -186,12 +275,12 @@ CInferencePrefixList::~CInferencePrefixList(void)
 
 void CInferencePrefixList::GetPrefixAndRemainder (const string& inference, string& prefix, string& remainder)
 {
-    string category = "";
-    prefix = "";
-    remainder = "";
+    string category;
+    prefix.clear();
+    remainder.clear();
     string check = inference;
 
-    for (unsigned int i = 0; i < sizeof (valid_inf_categories) / sizeof (char *); i++) {
+    for (unsigned int i = 0; i < ArraySize(valid_inf_categories); i++) {
         if (NStr::StartsWith (check, valid_inf_categories[i])) {
             category = valid_inf_categories[i];
             check = check.substr(category.length());
@@ -205,7 +294,7 @@ void CInferencePrefixList::GetPrefixAndRemainder (const string& inference, strin
             break;
         }
     }
-    for (unsigned int i = 0; i < sizeof (valid_inf_prefixes) / sizeof (char *); i++) {
+    for (unsigned int i = 0; i < ArraySize(valid_inf_prefixes); i++) {
         if (NStr::StartsWith (check, valid_inf_prefixes[i], NStr::eNocase)) {
             prefix = valid_inf_prefixes[i];
         }
@@ -216,7 +305,7 @@ void CInferencePrefixList::GetPrefixAndRemainder (const string& inference, strin
 }
 
 
-static string s_LegalMobileElementStrings[] = {
+static const char* s_LegalMobileElementStrings[] = {
     "transposon",
     "retrotransposon",
     "integron",
@@ -234,16 +323,14 @@ static string s_LegalMobileElementStrings[] = {
 
 void CGb_qual::GetMobileElementValueElements(const string& val, string& element_type, string& element_name)
 {
-    element_type = "";
-    element_name = "";
-    for (size_t i = 0;
-        i < sizeof(s_LegalMobileElementStrings) / sizeof(string);
-        ++i) {
+    element_type.clear();
+    element_name.clear();
+    for (size_t i = 0; i < ArraySize(s_LegalMobileElementStrings); ++i) {
         if (NStr::StartsWith(val, s_LegalMobileElementStrings[i], NStr::eNocase)) {
-            element_name = val.substr(s_LegalMobileElementStrings[i].length());
+            element_name = val.substr(strlen(s_LegalMobileElementStrings[i]));
             if (!NStr::IsBlank(element_name) &&
                 (!NStr::StartsWith(element_name, ":") || NStr::Equal(element_name, ":"))) {
-                element_name = "";
+                element_name.clear();
             } else {
                 element_type = s_LegalMobileElementStrings[i];
             }
@@ -268,7 +355,7 @@ bool CGb_qual::IsLegalMobileElementValue(const string& val)
 }
 
 
-static string s_IllegalQualNameStrings[] = {
+static const char* s_IllegalQualNameStrings[] = {
     "anticodon",
     "citation",
     "codon_start",
@@ -287,9 +374,7 @@ static string s_IllegalQualNameStrings[] = {
 
 bool CGb_qual::IsIllegalQualName(const string& val)
 {
-    for (size_t i = 0;
-        i < sizeof(s_IllegalQualNameStrings) / sizeof(string);
-        ++i) {
+    for (size_t i = 0;  i < ArraySize(s_IllegalQualNameStrings); ++i) {
         if (NStr::EqualNocase(val, s_IllegalQualNameStrings[i])) {
             return true;
         }
@@ -297,6 +382,227 @@ bool CGb_qual::IsIllegalQualName(const string& val)
     return false;
 }
 
+static string s_FindInArray(const string &val, const char **arr)
+{
+    string result;
+    for (unsigned int i = 0; arr[i][0] != '\0'; i++) 
+        if (arr[i] == val)
+        {
+            result = val;
+            break;
+        }
+    return result;
+}
+
+void CGb_qual::ParseInferenceString(string val, string &category, string &type_str, bool &is_same_species, string &database, 
+                                    string &accession, string &program, string &version, string &acc_list)
+{
+    category.clear();
+    static const char *categories[] = {"COORDINATES", "DESCRIPTION", "EXISTENCE", "\0"};
+    for (unsigned int i = 0; categories[i][0] != '\0'; i++) 
+    {
+        if (NStr::StartsWith(val, categories[i], NStr::eNocase)) {
+            category = categories[i];
+            val = val.substr(strlen(categories[i]));
+            NStr::TruncateSpacesInPlace(val);
+            if (NStr::StartsWith(val, ":")) {
+                val = val.substr(1);
+                NStr::TruncateSpacesInPlace(val);
+            }
+            break;
+        }
+    }
+
+    static const char *types[] = {
+        "similar to sequence",
+        "similar to protein",
+        "similar to DNA",
+        "similar to RNA",
+        "similar to mRNA",
+        "similar to EST",
+        "similar to other RNA",
+        "profile",
+        "nucleotide motif",
+        "protein motif",
+        "ab initio prediction",
+        "alignment",
+        "\0"};
+
+    type_str.clear();
+    is_same_species = false;
+    // start with 1 - first item is blank
+    for (unsigned int i = 0; types[i][0] != '\0'; i++) 
+    {
+        if (NStr::StartsWith(val, types[i], NStr::eNocase)) 
+        {
+            type_str = types[i];
+            val = val.substr(strlen(types[i]));
+            NStr::TruncateSpacesInPlace(val);
+            if (NStr::StartsWith(val, "(same species)", NStr::eNocase)) {
+                is_same_species = true;
+                val = val.substr(14);
+                NStr::TruncateSpacesInPlace(val);
+            }
+	    if (NStr::StartsWith(val, ":")) {
+                val = val.substr(1);
+                NStr::TruncateSpacesInPlace(val);
+            }
+            break;
+        }
+    }
+
+    // add type-dependent extra data
+    if (NStr::StartsWith(type_str, "similar to ")) {
+
+        static const char *choices[] = {
+            "GenBank",
+            "EMBL",
+            "DDBJ",
+            "INSD",
+            "RefSeq",
+            "UniProt",
+            "Other",
+            "\0"};
+     
+        NStr::TruncateSpacesInPlace(val);
+        while (NStr::StartsWith(val, "|")) {
+            val = val.substr(1);
+            NStr::TruncateSpacesInPlace(val);
+        }
+        size_t pos = NStr::Find(val, ":");
+        if (pos == NPOS) {
+            database = s_FindInArray(val, choices);
+            if (database.empty())
+                accession = val;            
+            else
+                accession.clear();
+        } else {
+            string part1 = val.substr(0, pos);
+            string part2 = val.substr(pos + 1);
+            database = s_FindInArray(part1, choices);
+            if (!database.empty())
+            {
+                accession = part2;            
+            }
+            else
+            {
+                if (NStr::IsBlank(part1)) 
+                {
+                    accession = part2;
+                } else 
+                {
+                    accession = val;
+                }
+            }
+        }
+    } else if (NStr::EqualNocase(type_str, "profile") 
+		         || NStr::EqualNocase(type_str, "nucleotide motif")
+		         || NStr::EqualNocase(type_str, "protein motif")) {
+
+        if (NStr::IsBlank (val)) {
+            program.clear();
+            version.clear();
+        } else {
+            size_t pos = NStr::Find(val, ":");
+            if (pos == NPOS) {
+                program = val;
+                version.clear();
+            } else {
+                string part1 = val.substr(0, pos);
+                string part2 = val.substr(pos + 1);
+                program = part1;
+                version = part2;
+            }
+        }
+    } else if (NStr::EqualNocase(type_str, "ab initio prediction")) {
+
+        if (NStr::IsBlank (val)) {
+            program.clear();
+            version.clear();
+        } else {
+            size_t pos = NStr::Find(val, ":");
+            if (pos == NPOS) {
+                program = val;
+                version.clear();
+            } else {
+                string part1 = val.substr(0, pos);
+                string part2 = val.substr(pos + 1);
+                program = part1;
+                version = part2;
+            }
+        }
+    } else if (NStr::EqualNocase(type_str, "alignment")) {
+
+        string acc_list_str;
+        if (NStr::IsBlank (val)) {
+            program.clear();
+            version.clear();
+        } else {
+            size_t pos = NStr::Find(val, ":");
+            if (pos == NPOS) {
+                program = val;
+                version.clear();
+            } else {
+                string part1 = val.substr(0, pos);
+                string part2 = val.substr(pos + 1);
+                program = part1;
+                pos = NStr::Find(part2, ":");
+                if (pos == NPOS) {
+                    version = part2;
+                    // set alignment list blank
+                    acc_list.clear();
+                } else {
+                    string ver_str = part2.substr(0, pos);
+                    acc_list_str = part2.substr(pos + 1);
+                    version = ver_str;
+                    // set alignment list
+                    NStr::ReplaceInPlace(acc_list_str, ",", "\n");
+                    acc_list = acc_list_str;
+                }
+            }
+        }
+    }
+}
+
+static void ReplaceIfNotFound(string &inference, const string &find, const string &replace)
+{
+    size_t start = 0;
+    while (start != NPOS)
+    {
+        size_t pos1 = NStr::Find(inference, find, start);
+        size_t pos2 = NStr::Find(inference, replace, start);
+        if (pos1 == NPOS)
+            break;
+        if (pos1 != pos2)
+            NStr::ReplaceInPlace(inference, find, replace, start, 1);
+        start = pos1 + find.length();
+    }
+}
+
+string CGb_qual::CleanupAndRepairInference( const string &orig_inference )
+{
+    string inference(orig_inference);
+    if( inference.empty() ) {
+        return inference;
+    }
+
+    string old_inf;
+    while (old_inf != inference)
+    {
+        old_inf = inference;
+        NStr::ReplaceInPlace(inference,"  ", " ");
+        NStr::ReplaceInPlace(inference," :", ":");
+        // NStr::ReplaceInPlace(inference,"::", ":");
+        NStr::ReplaceInPlace(inference,":  ", ": ");
+    }
+
+    ReplaceIfNotFound(inference, "COORDINATES:", "COORDINATES: ");
+    ReplaceIfNotFound(inference, "DESCRIPTION:", "DESCRIPTION: ");
+    ReplaceIfNotFound(inference, "EXISTENCE:", "EXISTENCE: ");
+
+    return inference;
+}
+
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
diff --git a/c++/src/objects/seqfeat/Genetic_code_table.cpp b/c++/src/objects/seqfeat/Genetic_code_table.cpp
index 54b206a..dd7cd74 100644
--- a/c++/src/objects/seqfeat/Genetic_code_table.cpp
+++ b/c++/src/objects/seqfeat/Genetic_code_table.cpp
@@ -1,4 +1,4 @@
-/* $Id: Genetic_code_table.cpp 419452 2013-11-25 20:43:11Z kans $
+/* $Id: Genetic_code_table.cpp 498881 2016-04-20 13:36:43Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -729,7 +729,10 @@ const char * CGen_code_table_imp::sm_GenCodeTblMemStr [] =
     "sncbieaa \"---M---------------M---------------M---------------M------------\" } ,\n",
     "{ name \"Candidate Division SR1 and Gracilibacteria\" , id 25 ,\n",
     "ncbieaa  \"FFLLSSSSYY**CCGWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG\",\n",
-    "sncbieaa \"---M-------------------------------M---------------M------------\" } };\n",
+    "sncbieaa \"---M-------------------------------M---------------M------------\" } ,\n",
+    "{ name \"Pachysolen tannophilus Nuclear\" , id 26 ,\n",
+    "ncbieaa  \"FFLLSSSSYY**CC*WLLLAPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG\",\n",
+    "sncbieaa \"-------------------M---------------M----------------------------\" } };\n",
     0  // to indicate that there is no more data
 };
 
diff --git a/c++/src/objects/seqfeat/OrgMod.cpp b/c++/src/objects/seqfeat/OrgMod.cpp
index b6e8fe3..5aeb7df 100644
--- a/c++/src/objects/seqfeat/OrgMod.cpp
+++ b/c++/src/objects/seqfeat/OrgMod.cpp
@@ -1,4 +1,4 @@
-/* $Id: OrgMod.cpp 485528 2015-11-23 16:15:43Z ivanov $
+/* $Id: OrgMod.cpp 500234 2016-05-03 15:01:20Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -41,6 +41,8 @@
 #include <util/line_reader.hpp>
 #include <serial/enumvalues.hpp>
 
+#include <objects/general/general_macros.hpp>
+
 // generated includes
 #include <objects/seqfeat/OrgMod.hpp>
 
@@ -68,7 +70,7 @@ COrgMod::TSubtype COrgMod::GetSubtypeValue(const string& str,
         NStr::EqualNocase(name, "orgmod-note")) {
         return eSubtype_other;
     } else if (vocabulary == eVocabulary_insdc) {
-        if (name == "host") {
+        if (name == "host" || name == "specific-host") {
             return eSubtype_nat_host;
         } else if (name == "sub-strain") {
             return eSubtype_substrain;
@@ -166,7 +168,7 @@ bool COrgMod::ParseStructuredVoucher(const string& str, string& inst, string& co
 	}
 	inst = str.substr(0, pos);
 	id = str.substr(pos + 1);
-	coll = "";
+	coll.clear();
 	pos = NStr::Find(id, ":");
 	if (pos != string::npos) {
 		coll = id.substr(0, pos);
@@ -192,7 +194,8 @@ static TInstitutionCodeMap s_CultureCollectionInstitutionCodeMap;
 static TInstitutionCodeMap s_CompleteInstitutionCodeMap;
 static TInstitutionCodeMap s_CompleteInstitutionFullNameMap;
 static TInstitutionCodeMap s_InstitutionCodeTypeMap;
-static bool                    s_InstitutionCollectionCodeMapInitialized = false;
+static bool                s_InstitutionCollectionCodeMapInitialized = false;
+
 DEFINE_STATIC_FAST_MUTEX(s_InstitutionCollectionCodeMutex);
 
 #include "institution_codes.inc"
@@ -272,7 +275,7 @@ bool COrgMod::IsInstitutionCodeValid(const string& inst_coll, string &voucher_ty
     is_miscapitalized = false;
     needs_country = false;
     erroneous_country = false;
-    correct_cap = "";
+    correct_cap.clear();
 
     s_InitializeInstitutionCollectionCodeMaps();
 
@@ -329,7 +332,7 @@ string
 COrgMod::IsSpecimenVoucherValid(const string& specimen_voucher)
 {
     if (NStr::Find(specimen_voucher, ":") == string::npos) {
-        return "";
+        return kEmptyStr;
     } else {
         return IsStructuredVoucherValid(specimen_voucher, "s");
     }
@@ -340,28 +343,33 @@ string
 COrgMod::IsBiomaterialValid(const string& biomaterial)
 {
     if (NStr::Find(biomaterial, ":") == string::npos) {
-        return "";
+        return kEmptyStr;
     } else {
         return IsStructuredVoucherValid(biomaterial, "b");
     }
 }
 
 
+const string kMissingInst = "Voucher is missing institution code";
+const string kMissingId = "Voucher is missing specific identifier";
+
 string 
 COrgMod::IsStructuredVoucherValid(const string& val, const string& v_type)
 {
-    string inst_code = "";
-    string coll_code = "";
-    string inst_coll = "";
-    string id = "";
+    string inst_code;
+    string coll_code;
+    string inst_coll;
+    string id;
+
     if (!ParseStructuredVoucher(val, inst_code, coll_code, id)) {
+        string rval = kEmptyStr;
         if (NStr::IsBlank(inst_code)) {
-            return "Voucher is missing institution code";
+            rval = kMissingInst;
         }
         if (NStr::IsBlank(id)) {
-             return "Voucher is missing specific identifier";
+            rval = NStr::IsBlank(rval) ? kMissingId : rval + "\n" + kMissingId;
         }
-        return "";
+        return rval;
     }
 
     if (NStr::IsBlank (coll_code)) {
@@ -393,13 +401,13 @@ COrgMod::IsStructuredVoucherValid(const string& val, const string& v_type)
                     return "Institution code " + inst_coll + " should be specimen_voucher";
                 }
             }
-            return "";
+            return kEmptyStr;
         } 
     } else if (NStr::StartsWith(inst_coll, "personal", NStr::eNocase)) {
         if (NStr::EqualNocase (inst_code, "personal") && NStr::IsBlank (coll_code)) {
             return "Personal collection does not have name of collector";
         }
-        return "";
+        return kEmptyStr;
     } else if (NStr::IsBlank(coll_code)) {
         return "Institution code " + inst_coll + " is not in list";
     } else if (IsInstitutionCodeValid(inst_code, voucher_type, is_miscapitalized, correct_cap, needs_country, erroneous_country)) {
@@ -421,15 +429,15 @@ COrgMod::IsStructuredVoucherValid(const string& val, const string& v_type)
     } else {
         return "Institution code " + inst_coll + " is not in list";
     }
-    return "";
+    return kEmptyStr;
 }
 
 
 string COrgMod::MakeStructuredVoucher(const string& inst, const string& coll, const string& id)
 {
-    string rval = "";
+    string rval;
     if (NStr::IsBlank(inst) && NStr::IsBlank(coll) && NStr::IsBlank(id)) {
-        rval = "";
+        rval = kEmptyStr;
     } else if (NStr::IsBlank(inst) && NStr::IsBlank(coll)) {
         rval = id;
     } else if (NStr::IsBlank(coll)) {
@@ -514,9 +522,10 @@ bool COrgMod::AddStructureToVoucher(string& val, const string& v_type)
 bool 
 COrgMod::FixStructuredVoucher(string& val, const string& v_type)
 {
-    string inst_code = "";
-    string coll_code = "";
-    string id = "";
+    string inst_code;
+    string coll_code;
+    string id;
+
     if (!ParseStructuredVoucher(val, inst_code, coll_code, id)
         || NStr::IsBlank(inst_code)) {
         return AddStructureToVoucher(val, v_type);
@@ -584,20 +593,20 @@ COrgMod::GetInstitutionShortName( const string &full_name )
 string COrgMod::CheckMultipleVouchers(const vector<string>& vouchers)
 {
     ITERATE(vector<string>, it, vouchers) {
-        string inst1 = "", coll1 = "", id1 = "";
+        string inst1, coll1, id1;
         if (!COrgMod::ParseStructuredVoucher(*it, inst1, coll1, id1)) continue;
         if (NStr::EqualNocase(inst1, "personal") || NStr::EqualCase(coll1, "DNA")) continue;
 
         vector<string>::const_iterator it_next = it;
         for (++it_next; it_next != vouchers.end(); ++it_next) {
-            string inst2 = "", coll2 = "", id2 = "";
+            string inst2, coll2, id2;
             if (!COrgMod::ParseStructuredVoucher(*it_next, inst2, coll2, id2)) continue;
             if (NStr::EqualNocase(inst2, "personal") || NStr::EqualCase(coll2, "DNA")) continue;
             if (!NStr::EqualNocase (inst1, inst2) || NStr::IsBlank(inst1)) continue;
             return NStr::EqualNocase(coll1, coll2) && !NStr::IsBlank(coll1) ? "Multiple vouchers with same institution:collection" : "Multiple vouchers with same institution";
         }
     }
-    return "";
+    return kEmptyStr;
 }
 
 
@@ -627,7 +636,7 @@ bool s_FixStrainForPrefix(const string& prefix, string& strain)
 }
 
 
-string COrgMod::FixStrain( const string& strain)
+string s_FixOneStrain( const string& strain)
 {
     string new_val = strain;
     if (s_FixStrainForPrefix("ATCC", new_val)) {
@@ -636,12 +645,32 @@ string COrgMod::FixStrain( const string& strain)
         // fixed for DSM
     } else {
         // no fix
-        new_val = "";
+        new_val = kEmptyStr;
     }
     return new_val;
 }
 
 
+string COrgMod::FixStrain( const string& strain)
+{
+    string new_val = strain;
+    vector<string> words;
+    vector<string> results;
+    NStr::Tokenize(strain, ";", words);
+    FOR_EACH_STRING_IN_VECTOR(itr, words) {
+        string str = *itr;
+        NStr::TruncateSpacesInPlace(str);
+        string fixed = s_FixOneStrain(str);
+        if (fixed.empty()) {
+            results.push_back (str);
+        } else {
+            results.push_back (fixed);
+        }
+    }
+    return NStr::Join(results,"; ");
+}
+
+
 const char* sm_KnownHostWords[] = {
   "alfalfa",
   "almond",
@@ -818,7 +847,7 @@ void COrgMod::FixCapitalization()
 
 string COrgMod::AutoFix(TSubtype subtype, const string& value)
 {
-    string new_val = "";
+    string new_val;
     switch (subtype) {
         case COrgMod::eSubtype_strain:
             new_val = FixStrain(value);
diff --git a/c++/src/objects/seqfeat/Org_ref.cpp b/c++/src/objects/seqfeat/Org_ref.cpp
index a2e5562..a4c42b9 100644
--- a/c++/src/objects/seqfeat/Org_ref.cpp
+++ b/c++/src/objects/seqfeat/Org_ref.cpp
@@ -1,4 +1,4 @@
-/* $Id: Org_ref.cpp 472019 2015-07-06 16:40:21Z ivanov $
+/* $Id: Org_ref.cpp 471648 2015-06-30 12:36:49Z kornbluh $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objects/seqfeat/Prot_ref.cpp b/c++/src/objects/seqfeat/Prot_ref.cpp
index 1abc79a..a49bc6d 100644
--- a/c++/src/objects/seqfeat/Prot_ref.cpp
+++ b/c++/src/objects/seqfeat/Prot_ref.cpp
@@ -1,4 +1,4 @@
-/* $Id: Prot_ref.cpp 444281 2014-08-22 16:25:37Z vasilche $
+/* $Id: Prot_ref.cpp 489218 2016-01-11 15:30:48Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -210,6 +210,21 @@ const string& CProt_ref::GetECNumberReplacement(const string& old_ecno)
 }
 
 
+bool CProt_ref::IsECNumberSplit(const string& old_ecno)
+{
+    if (GetECNumberStatus(old_ecno) != eEC_replaced) {
+        return false;
+    }
+   
+    const string& replacement = GetECNumberReplacement(old_ecno);
+    if (NStr::Find(replacement, "\t") != string::npos) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
 bool CProt_ref::IsValidECNumberFormat (const string&  ecno)
 {
     char     ch;
diff --git a/c++/src/objects/seqfeat/RNA_ref.cpp b/c++/src/objects/seqfeat/RNA_ref.cpp
index 4aabf07..f5b3e77 100644
--- a/c++/src/objects/seqfeat/RNA_ref.cpp
+++ b/c++/src/objects/seqfeat/RNA_ref.cpp
@@ -1,4 +1,4 @@
-/* $Id: RNA_ref.cpp 473602 2015-07-21 16:58:12Z ivanov $
+/* $Id: RNA_ref.cpp 500107 2016-05-02 15:37:38Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -40,7 +40,6 @@
 // generated includes
 #include <objects/seqfeat/RNA_ref.hpp>
 #include <objects/seqfeat/Trna_ext.hpp>
-#include <util/sequtil/sequtil_convert.hpp>
 
 // generated classes
 
@@ -81,7 +80,7 @@ string CRNA_ref::GetRnaTypeName (const CRNA_ref::EType rna_type)
     return rna_type_name;
 }
 
-static const string s_TrnaList[] = {
+static const char* sc_TrnaList[] = {
   "tRNA-Gap",
   "tRNA-Ala",
   "tRNA-Asx",
@@ -93,7 +92,7 @@ static const string s_TrnaList[] = {
   "tRNA-His",
   "tRNA-Ile",
   "tRNA-Xle",
-  "tRNA-Lys",
+  "tRNA-Lys", 
   "tRNA-Leu",
   "tRNA-Met",
   "tRNA-Asn",
@@ -108,45 +107,42 @@ static const string s_TrnaList[] = {
   "tRNA-Trp",
   "tRNA-OTHER",
   "tRNA-Tyr",
-  "tRNA-Glx",
+  "tRNA-Glx", 
   "tRNA-TERM"
 };
 
-static const string& s_AaName(int aa)
+static CTempString s_AaName(int aa)
 {
     int idx = 255;
 
     if (aa != '*') {
         idx = aa - 64;
     } else {
-        idx = 28;   
+        idx = 27;  
     }
-    if ( idx > 0 && idx < 28 ) {
-        return s_TrnaList [idx];
+
+    if (idx > 0 && idx < ArraySize(sc_TrnaList)) {
+        return sc_TrnaList [idx];
     }
     return kEmptyStr;
 }
 
-static int s_ToIupacaa(int aa)
-{
-    vector<char> n(1, static_cast<char>(aa));
-    vector<char> i;
-    CSeqConvert::Convert(n, CSeqUtil::e_Ncbieaa, 0, 1, i, CSeqUtil::e_Iupacaa);
-    return i.front();
-}
 
-static const string& s_GetTrnaProduct(const CTrna_ext& trna)
+static CTempString s_GetTrnaProduct(const CTrna_ext& trna)
 {
     int aa = 0;
-    if ( trna.IsSetAa()  &&  trna.GetAa().IsNcbieaa() ) {
-        aa = trna.GetAa().GetNcbieaa();
-    }
-    aa = s_ToIupacaa(aa);
+    if ( trna.IsSetAa() ) {
+        if (trna.GetAa().IsNcbieaa()) {
+            aa = trna.GetAa().GetNcbieaa();
+        } else if (trna.GetAa().IsIupacaa()) {
+            aa = trna.GetAa().GetIupacaa();
+        }
+    } 
 
     return s_AaName(aa);
 }
 
-const string& CRNA_ref::GetRnaProductName(void) const
+string CRNA_ref::GetRnaProductName(void) const
 {
     if (!IsSetExt()) {
         return kEmptyStr;
@@ -163,6 +159,7 @@ const string& CRNA_ref::GetRnaProductName(void) const
     return kEmptyStr;
 }
 
+
 static void s_SetTrnaProduct(CTrna_ext& trna, const string& product, string& remainder)
 {
     remainder = kEmptyStr;
@@ -171,7 +168,6 @@ static void s_SetTrnaProduct(CTrna_ext& trna, const string& product, string& rem
         return;
     }
 
-    int num_names = sizeof(s_TrnaList) / sizeof (string);
     string test = product;
     if (!NStr::StartsWith(product, "tRNA-")) {
         test = "tRNA-" + test;
@@ -186,13 +182,43 @@ static void s_SetTrnaProduct(CTrna_ext& trna, const string& product, string& rem
         }
     } else {
         remainder = product;
-        for (int i = 0; i < num_names - 1; i++) {
-            if (NStr::StartsWith(test, s_TrnaList[i], NStr::eNocase)) {
+        bool found_three_letter_code = false;
+        for (size_t i = 0; i < ArraySize(sc_TrnaList); ++i) {
+            if (NStr::StartsWith(test, sc_TrnaList[i], NStr::eNocase)) {
                 trna.SetAa().SetNcbieaa(i + 64);
-                remainder = test.substr(s_TrnaList[i].length());
+                remainder = test.substr(CTempString(sc_TrnaList[i]).length());
+                found_three_letter_code = true;
                 break;
             }
         }
+        if (!found_three_letter_code && test.length() > 5) {
+            int ch = test.c_str()[5];
+            int after = test.c_str()[6];
+            if (!isalpha(after)) {
+                if (isalpha(ch)) {
+                    int aa = 65 + ch - 'A';
+                    trna.SetAa().SetNcbieaa(aa);
+                    remainder = test.substr(6);
+                } else if (ch == '*') {
+                    trna.SetAa().SetNcbieaa(42);
+                    remainder = test.substr(6);
+                }
+            }
+        }
+    }
+    if (remainder.length() == 5 && NStr::StartsWith(remainder, "(") && NStr::EndsWith(remainder, ")")) {
+        string codon = remainder.substr(1, 3);
+        codon = NStr::ToUpper(codon);
+        NStr::ReplaceInPlace(codon, "U", "T");
+        // will parse a single codon recognized
+        CRef<CTrna_ext> ext(new CTrna_ext());
+        if (CTrna_ext::ParseDegenerateCodon(*ext, codon)) {
+            trna.ResetCodon();
+            ITERATE(CTrna_ext::TCodon, c, ext->GetCodon()) {
+                trna.SetCodon().push_back(*c);
+            }
+            remainder = kEmptyStr;
+        }
     }
 }
 
diff --git a/c++/src/objects/seqfeat/SeqFeatData.cpp b/c++/src/objects/seqfeat/SeqFeatData.cpp
index 872fd7d..5c2961f 100644
--- a/c++/src/objects/seqfeat/SeqFeatData.cpp
+++ b/c++/src/objects/seqfeat/SeqFeatData.cpp
@@ -1,4 +1,4 @@
-/* $Id: SeqFeatData.cpp 481786 2015-10-15 18:26:27Z ivanov $
+/* $Id: SeqFeatData.cpp 500232 2016-05-03 15:00:20Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -868,6 +868,7 @@ START_SUBTYPE(cdregion)
     ADD_QUAL(codon);
     ADD_QUAL(codon_start);
     ADD_QUAL(db_xref);
+    ADD_QUAL(evidence);
     ADD_QUAL(exception);
     ADD_QUAL(experiment);
     ADD_QUAL(function);
@@ -875,13 +876,13 @@ START_SUBTYPE(cdregion)
     ADD_QUAL(gene);
     ADD_QUAL(gene_synonym);
     ADD_QUAL(inference);
-    ADD_QUAL(label);
     ADD_QUAL(locus_tag);
     ADD_QUAL(map);
     ADD_QUAL(note);
     ADD_QUAL(number);
     ADD_QUAL(old_locus_tag);
     ADD_QUAL(operon);
+    ADD_QUAL(partial);
     ADD_QUAL(product);
     ADD_QUAL(protein_id);
     ADD_QUAL(pseudo);
@@ -956,6 +957,7 @@ START_SUBTYPE(mat_peptide_aa)
     ADD_QUAL(citation);
     ADD_QUAL(db_xref);
     ADD_QUAL(derived_from);
+    ADD_QUAL(evidence);
     ADD_QUAL(exception);
     ADD_QUAL(experiment);
     ADD_QUAL(function);
@@ -1065,12 +1067,12 @@ START_SUBTYPE(mRNA)
     ADD_QUAL(gene);
     ADD_QUAL(gene_synonym);
     ADD_QUAL(inference);
-    ADD_QUAL(label);
     ADD_QUAL(locus_tag);
     ADD_QUAL(map);
     ADD_QUAL(note);
     ADD_QUAL(old_locus_tag);
     ADD_QUAL(operon);
+    ADD_QUAL(partial);
     ADD_QUAL(product);
     ADD_QUAL(pseudo);
     ADD_QUAL(pseudogene);
@@ -1482,12 +1484,12 @@ START_SUBTYPE(exon)
     ADD_QUAL(gene);
     ADD_QUAL(gene_synonym);
     ADD_QUAL(inference);
-    ADD_QUAL(label);
     ADD_QUAL(locus_tag);
     ADD_QUAL(map);
     ADD_QUAL(note);
     ADD_QUAL(number);
     ADD_QUAL(old_locus_tag);
+    ADD_QUAL(partial);
     ADD_QUAL(product);
     ADD_QUAL(pseudo);
     ADD_QUAL(pseudogene);
@@ -1552,12 +1554,12 @@ START_SUBTYPE(intron)
     ADD_QUAL(gene);
     ADD_QUAL(gene_synonym);
     ADD_QUAL(inference);
-    ADD_QUAL(label);
     ADD_QUAL(locus_tag);
     ADD_QUAL(map);
     ADD_QUAL(note);
     ADD_QUAL(number);
     ADD_QUAL(old_locus_tag);
+    ADD_QUAL(partial);
     ADD_QUAL(pseudo);
     ADD_QUAL(pseudogene);
     ADD_QUAL(standard_name);
@@ -2041,6 +2043,7 @@ START_SUBTYPE(repeat_region)
     ADD_QUAL(mobile_element);
     ADD_QUAL(note);
     ADD_QUAL(old_locus_tag);
+    ADD_QUAL(partial);
     ADD_QUAL(rpt_family);
     ADD_QUAL(rpt_type);
     ADD_QUAL(rpt_unit);
@@ -2298,6 +2301,7 @@ START_SUBTYPE(terminator)
     ADD_QUAL(allele);
     ADD_QUAL(citation);
     ADD_QUAL(db_xref);
+    ADD_QUAL(evidence);
     ADD_QUAL(exception);
     ADD_QUAL(experiment);
     ADD_QUAL(gene);
@@ -2797,14 +2801,81 @@ START_SUBTYPE(mobile_element)
     ADD_QUAL(old_locus_tag);
     ADD_QUAL(rpt_family);
     ADD_QUAL(rpt_type);
-    ADD_QUAL(satellite);
     ADD_QUAL(standard_name);
     ADD_QUAL(transposon);
     ADD_QUAL(usedin);
 END_SUBTYPE
 
-//START_SUBTYPE(biosrc)
-//END_SUBTYPE
+START_SUBTYPE(biosrc)
+ADD_QUAL(PCR_primers);
+ADD_QUAL(altitude);
+ADD_QUAL(bio_material);
+ADD_QUAL(cell_line);
+ADD_QUAL(cell_type);
+ADD_QUAL(chloroplast);
+ADD_QUAL(chromoplast);
+ADD_QUAL(chromosome);
+ADD_QUAL(citation);
+ADD_QUAL(clone);
+ADD_QUAL(clone_lib);
+ADD_QUAL(collected_by);
+ADD_QUAL(collection_date);
+ADD_QUAL(country);
+ADD_QUAL(cultivar);
+ADD_QUAL(culture_collection);
+ADD_QUAL(cyanelle);
+ADD_QUAL(db_xref);
+ADD_QUAL(dev_stage);
+ADD_QUAL(ecotype);
+ADD_QUAL(environmental_sample);
+ADD_QUAL(exception);
+ADD_QUAL(focus);
+ADD_QUAL(frequency);
+ADD_QUAL(germline);
+ADD_QUAL(haplogroup);
+ADD_QUAL(haplotype);
+ADD_QUAL(host);
+ADD_QUAL(identified_by);
+ADD_QUAL(isolate);
+ADD_QUAL(isolation_source);
+ADD_QUAL(kinetoplast);
+ADD_QUAL(lab_host);
+ADD_QUAL(label);
+ADD_QUAL(lat_lon);
+ADD_QUAL(linkage_group);
+ADD_QUAL(macronuclear);
+ADD_QUAL(map);
+ADD_QUAL(mating_type);
+ADD_QUAL(metagenomic);
+ADD_QUAL(mitochondrion);
+ADD_QUAL(mol_type);
+ADD_QUAL(note);
+ADD_QUAL(organelle);
+ADD_QUAL(organism);
+ADD_QUAL(plasmid);
+ADD_QUAL(pop_variant);
+ADD_QUAL(proviral);
+ADD_QUAL(rearranged);
+ADD_QUAL(segment);
+ADD_QUAL(sequenced_mol);
+ADD_QUAL(serotype);
+ADD_QUAL(serovar);
+ADD_QUAL(sex);
+ADD_QUAL(specimen_voucher);
+ADD_QUAL(strain);
+ADD_QUAL(sub_clone);
+ADD_QUAL(sub_species);
+ADD_QUAL(sub_strain);
+ADD_QUAL(tissue_lib);
+ADD_QUAL(tissue_type);
+ADD_QUAL(transgenic);
+ADD_QUAL(transposon);
+ADD_QUAL(type_material);
+ADD_QUAL(usedin);
+ADD_QUAL(variety);
+ADD_QUAL(virion);
+ADD_QUAL(whole_replicon);
+END_SUBTYPE
 
 //START_SUBTYPE(clone)
 //END_SUBTYPE
diff --git a/c++/src/objects/seqfeat/Seq_feat.cpp b/c++/src/objects/seqfeat/Seq_feat.cpp
index 3a7d8aa..d79e44d 100644
--- a/c++/src/objects/seqfeat/Seq_feat.cpp
+++ b/c++/src/objects/seqfeat/Seq_feat.cpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_feat.cpp 468197 2015-05-21 12:53:40Z kornbluh $
+/* $Id: Seq_feat.cpp 490392 2016-01-25 17:20:58Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -442,6 +442,87 @@ bool CSeq_feat::HasExceptionText(const string & exception_text ) const
         p_exception_text_set->end() );
 }
 
+
+// second element in pair indicates whether exception text is
+// permitted only for RefSeq records
+typedef SStaticPair<const char*, bool>  TExceptionPairElem;
+static const TExceptionPairElem k_LegalExceptionMap[] = {
+    { "16S ribosomal RNA and 23S ribosomal RNA overlap", true },
+    { "16S ribosomal RNA and 5S ribosomal RNA overlap", true },
+    { "23S ribosomal RNA and 16S ribosomal RNA overlap", true },
+    { "23S ribosomal RNA and 5S ribosomal RNA overlap", true },
+    { "5S ribosomal RNA and 16S ribosomal RNA overlap", true },
+    { "5S ribosomal RNA and 23S ribosomal RNA overlap", true },
+    { "adjusted for low-quality genome", true },
+    { "alternative processing", false },
+    { "alternative start codon", false },
+    { "annotated by transcript or proteomic data", false },
+    { "artificial frameshift", false },
+    { "artificial location", false },
+    { "dicistronic gene", false },
+    { "gene split at contig boundary", false },
+    { "gene split at sequence boundary", false },
+    { "genetic code exception", false },
+    { "heterogeneous population sequenced", false },
+    { "low-quality sequence region", false },
+    { "mismatches in transcription", true },
+    { "mismatches in translation", true },
+    { "modified codon recognition", false },
+    { "nonconsensus splice site", false },
+    { "rearrangement required for product", false },
+    { "reasons given in citation", false },
+    { "ribosomal slippage", false },
+    { "RNA editing", false },
+    { "trans-splicing", false },
+    { "transcribed product replaced", false },
+    { "transcribed pseudogene", false },
+    { "translated product replaced", false },
+    { "translation initiation by tRNA-Leu at CUG codon", true },
+    { "unclassified transcription discrepancy", true },
+    { "unclassified translation discrepancy", true },
+    { "unextendable partial coding region", false }
+};
+typedef CStaticArrayMap<const char*, bool, PNocase_CStr> TExceptionPairMap;
+DEFINE_STATIC_ARRAY_MAP(TExceptionPairMap, sc_ExceptionPairMap, k_LegalExceptionMap);
+
+vector<string> CSeq_feat::GetListOfLegalExceptions(bool include_refseq)
+{
+    vector<string> exception_list;
+
+    TExceptionPairMap::const_iterator it = sc_ExceptionPairMap.begin();
+    while (it != sc_ExceptionPairMap.end()) {
+        if (include_refseq || !it->second) {
+            exception_list.push_back(it->first);
+        }
+        ++it;
+    }
+
+    return exception_list;
+}
+
+
+bool CSeq_feat::IsExceptionTextInLegalList(const string& exception_text, bool allow_refseq)
+{
+    TExceptionPairMap::const_iterator it = sc_ExceptionPairMap.find(exception_text.c_str());
+    if (it != sc_ExceptionPairMap.end() && (allow_refseq || !it->second)) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+bool CSeq_feat::IsExceptionTextRefSeqOnly(const string& exception_text)
+{
+    TExceptionPairMap::const_iterator it = sc_ExceptionPairMap.find(exception_text.c_str());
+    if (it == sc_ExceptionPairMap.end()) {
+        return false;
+    } else {
+        return it->second;
+    }
+}
+
+
 CConstRef<CUser_object> CSeq_feat::FindExt(const string& ext_type) const
 {
     CConstRef<CUser_object> ret;
diff --git a/c++/src/objects/seqfeat/SubSource.cpp b/c++/src/objects/seqfeat/SubSource.cpp
index 2984518..cc59c0b 100644
--- a/c++/src/objects/seqfeat/SubSource.cpp
+++ b/c++/src/objects/seqfeat/SubSource.cpp
@@ -1,4 +1,4 @@
-/* $Id: SubSource.cpp 484821 2015-11-16 16:24:41Z ivanov $
+/* $Id: SubSource.cpp 499841 2016-04-28 16:08:34Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -43,6 +43,7 @@
 
 #include <math.h>
 #include <objects/misc/sequence_util_macros.hpp>
+#include <corelib/ncbitime.hpp>
 
 // generated classes
 
@@ -109,7 +110,6 @@ CSubSource::TSubtype CSubSource::GetSubtypeValue(const string& str,
             return eSubtype_subclone;
         }
     }
-
     return ENUM_METHOD_NAME(ESubtype)()->FindValue(name);
 }
 
@@ -127,9 +127,6 @@ bool CSubSource::IsValidSubtypeName(const string& str,
          NStr::EqualNocase(name, "subsrc-note")) {
          return true;
     }
-
-
-
     if (vocabulary == eVocabulary_insdc) {
         // consider a table if more special cases arise.
         if (name == "insertion-seq" || 
@@ -139,7 +136,6 @@ bool CSubSource::IsValidSubtypeName(const string& str,
             return true;
         } 
     }
-       
     return ENUM_METHOD_NAME(ESubtype)()->IsValidName(name);
 }
 
@@ -191,7 +187,6 @@ bool CSubSource::IsMultipleValuesAllowed(TSubtype subtype)
 }
 
 
-
 bool CSubSource::NeedsNoText(const TSubtype& subtype)
 {
     if (subtype == eSubtype_germline
@@ -225,61 +220,22 @@ bool CSubSource::IsDiscouraged(const TSubtype subtype)
 }
 
 
-static const char* const sm_LegalMonths [] = {
-  "Jan",
-  "Feb",
-  "Mar",
-  "Apr",
-  "May",
-  "Jun",
-  "Jul",
-  "Aug",
-  "Sep",
-  "Oct",
-  "Nov",
-  "Dec",
-};
-
-
-static const int sm_daysPerMonth [] = {
-  31,
-  28,
-  31,
-  30,
-  31,
-  30,
-  31,
-  31,
-  30,
-  31,
-  30,
-  31
-};
-
-
 bool CSubSource::IsDayValueOkForMonth(int day, int month, int year)
 {
-    bool rval = true;
-    if (month < 1 || month > 12) {
+    if (month < 1 || month > 12 || day < 1) {
         return false;
     }
-    if (day < 1) {
+    bool rval = true;
+    if (year < 100) {
+        year += 2000;
+    } else if (year > 3000) {
+        return false;
+    } else if (year < 1538) {
         return false;
     }
-    int dpm = sm_daysPerMonth [month - 1];
-
-    if (day > dpm) {
+    CTime month_o(year, month, 1);
+    if (day > month_o.DaysInMonth()) {
         rval = false;
-        if (month == 2 && day == 29) {
-            // true only if this is a leap year
-            if (! (year % 400)) {
-                rval = true;
-            } else if (!(year % 100)) {
-                rval = false;
-            } else if (!(year % 4)) {
-                rval = true;
-            }
-        }
     }
     return rval;
 }
@@ -291,23 +247,22 @@ CRef<CDate> CSubSource::DateFromCollectionDate (const string& test) THROWS((CExc
         NCBI_THROW (CException, eUnknown,
                         "collection-date string is blank");
     }
-    string str = test;
-    NStr::TruncateSpacesInPlace(str);
+    string str = NStr::TruncateSpaces(test);
 
     if (IsISOFormatDate(str)) {
         return GetDateFromISODate(str);
     }
 
     size_t pos = NStr::Find(str, "-");
-    string year = "";
-    string month = "";
-    string day = "";
+    string year;
+    string month;
+    string day;
 
-    if (pos == string::npos) {
+    if (pos == NPOS) {
         year = str;
     } else {
         size_t pos2 = NStr::Find(str, "-", pos + 1);
-        if (pos2 == string::npos) {
+        if (pos2 == NPOS) {
             month = str.substr(0, pos);
             year = str.substr(pos + 1);
             if (NStr::IsBlank(month)) {
@@ -327,13 +282,9 @@ CRef<CDate> CSubSource::DateFromCollectionDate (const string& test) THROWS((CExc
 
     int month_val = 0;
     if (!NStr::IsBlank(month)) {
-        for (size_t i = 0; i < ArraySize(sm_LegalMonths); i++) {
-            if (NStr::Equal(month, sm_LegalMonths[i])) {
-                month_val = int(i + 1);
-                break;
-            }
-        }
-        if (month_val == 0) {
+        try {
+            month_val = CTime::MonthNameToNum(month);
+        } catch (CTimeException& ex) {
             NCBI_THROW (CException, eUnknown,
                             "collection-date string has invalid month");
         }
@@ -475,9 +426,9 @@ void CSubSource::IsCorrectDateFormat(const string& date_string, bool& bad_format
             // if there are two dashes, then the first token needs to be the day, and the
             // day has to have two numbers, a leading zero if the day is less than 10
             size_t pos = NStr::Find(date_string, "-");
-            if (pos != string::npos) {
+            if (pos != NPOS) {
                 size_t pos2 = NStr::Find(date_string, "-", pos + 1);
-                if (pos2 != string::npos && pos != 2) {
+                if (pos2 != NPOS  &&  pos != 2) {
                     bad_format = true;
                 }
             }
@@ -495,41 +446,99 @@ void CSubSource::IsCorrectDateFormat(const string& date_string, bool& bad_format
     }
 }
 
+size_t CSubSource::CheckDateFormat(const string& date_string)
+{
+    size_t rval = eDateFormatFlag_ok;
+    vector<string> pieces;
+    NStr::Tokenize(date_string, "/", pieces);
+    if (pieces.size() > 2) {
+        rval |= eDateFormatFlag_bad_format;
+    } else if (pieces.size() == 2) {
+        bool first_bad = false;
+        bool first_future = false;
+        bool second_bad = false;
+        bool second_future = false;
+        rval |= CheckDateFormat(pieces[0]);
+        rval |= CheckDateFormat(pieces[1]);
+        if (rval == eDateFormatFlag_ok) {
+            try {
+                CRef<CDate> d1 = CSubSource::DateFromCollectionDate(pieces[0]);
+                CRef<CDate> d2 = CSubSource::DateFromCollectionDate(pieces[1]);
+                if (d2->Compare(*d1) == CDate::eCompare_before) {
+                    rval |= eDateFormatFlag_out_of_order;
+                }
+            } catch (CException) {
+                rval |= eDateFormatFlag_bad_format;
+            }
+        }
+        return rval;
+    }
+
+    try {
+        CRef<CDate> coll_date = CSubSource::DateFromCollectionDate(date_string);
+
+        if (!IsISOFormatDate(date_string)) {
+            // if there are two dashes, then the first token needs to be the day, and the
+            // day has to have two numbers, a leading zero if the day is less than 10
+            size_t pos = NStr::Find(date_string, "-");
+            if (pos != NPOS) {
+                size_t pos2 = NStr::Find(date_string, "-", pos + 1);
+                if (pos2 != NPOS  &&  pos != 2) {
+                    rval |= eDateFormatFlag_bad_format;
+                }
+            }
+        }
+
+        if (rval == eDateFormatFlag_ok) {
+            time_t t;
+
+            time(&t);
+            if (IsCollectionDateAfterTime(*coll_date, t)) {
+                rval |= eDateFormatFlag_in_future;
+            }
+        }
+    } catch (CException) {
+        rval |= eDateFormatFlag_bad_format;
+    }
+    return rval;
+}
 
 string CSubSource::GetCollectionDateProblem (const string& date_string)
 {
-    string problem = "";
+    string problem;
     bool bad_format = false;
     bool in_future = false;
 
-    IsCorrectDateFormat(date_string, bad_format, in_future);
-    if (bad_format) {
+    size_t rval = CheckDateFormat(date_string);
+    if (rval & eDateFormatFlag_bad_format) {
         problem = "Collection_date format is not in DD-Mmm-YYYY format";
-    } else if (in_future) {
+    } else if (rval & eDateFormatFlag_in_future) {
         problem = "Collection_date is in the future";
+    } else if (rval & eDateFormatFlag_out_of_order) {
+        problem = "Collection_dates are out of order";
     }
     return problem;
 }
 
 
-string CSubSource::x_ParseDateRangeWithDelimiter(const string& orig_date, const string& delim)
+string CSubSource::x_ParseDateRangeWithDelimiter(const string& orig_date, CTempString delim)
 {
     size_t pos = NStr::Find(orig_date, delim, NStr::eNocase);
-    if (pos == string::npos) {
-        return "";
+    if (pos == NPOS) {
+        return kEmptyStr;
     }
     size_t second_pos = NStr::Find(orig_date.substr(pos + 1), delim, NStr::eNocase);
-    if (second_pos != string::npos) {
-        return "";
+    if (second_pos != NPOS) {
+        return kEmptyStr;
     }
     bool month_ambig = false;
     string first_date = FixDateFormat(orig_date.substr(0, pos), true, month_ambig);
     if (month_ambig || NStr::IsBlank(first_date)) {
-        return "";
+        return kEmptyStr;
     }
     string second_date = FixDateFormat(orig_date.substr(pos + delim.length()), true, month_ambig);
     if (month_ambig || NStr::IsBlank(second_date)) {
-        return "";
+        return kEmptyStr;
     }
     string fix = first_date + "/" + second_date;
     return fix;
@@ -542,10 +551,10 @@ string CSubSource::FixDateFormat (const string& orig_date)
 
     string fix = FixDateFormat(orig_date, true, month_ambiguous);
     if (month_ambiguous) {
-        fix = "";
+        fix.clear();
     } else if (NStr::IsBlank(fix)) {
-        static const string delimiters[] = {"/", " to ", " and ", "-", "_"};
-        for (size_t i = 0; i < sizeof (delimiters) / sizeof (string); i++) {
+        static const char* delimiters[] = {"/", " to ", " and ", "-", "_"};
+        for (size_t i = 0; i < ArraySize(delimiters); i++) {
             fix = x_ParseDateRangeWithDelimiter(orig_date, delimiters[i]);
             if (!NStr::IsBlank(fix)) {
                 break;
@@ -565,15 +574,15 @@ bool CSubSource::IsISOFormatTime(const string& orig_time, int& hour, int& min, i
     int offset_hour = 0;
     int offset_min = 0;
     size_t suffix = NStr::Find(orig_time, "Z");
-    if (suffix == string::npos) {
+    if (suffix == NPOS) {
         suffix = NStr::Find(orig_time, "+");
-        if (suffix == string::npos ||
+        if (suffix == NPOS ||
             orig_time.substr(suffix).length() != 6 ||
-            !isdigit(orig_time.c_str()[suffix + 1]) ||
-            !isdigit(orig_time.c_str()[suffix + 2]) ||
-            orig_time.c_str()[suffix + 3] != ':' ||
-            !isdigit(orig_time.c_str()[suffix + 4]) ||
-            !isdigit(orig_time.c_str()[suffix + 5])) {
+            !isdigit((unsigned char)orig_time[suffix + 1]) ||
+            !isdigit((unsigned char)orig_time[suffix + 2]) ||
+            orig_time[suffix + 3] != ':' ||
+            !isdigit((unsigned char)orig_time[suffix + 4]) ||
+            !isdigit((unsigned char)orig_time[suffix + 5])) {
             return false;
         }
         try {
@@ -587,7 +596,7 @@ bool CSubSource::IsISOFormatTime(const string& orig_time, int& hour, int& min, i
         return false;
     }
 
-    if (!isdigit(orig_time.c_str()[0]) || !isdigit(orig_time.c_str()[1])) {
+    if (!isdigit((unsigned char)orig_time[0]) || !isdigit((unsigned char)orig_time[1])) {
         return false;
     }
     hour = 0;
@@ -603,7 +612,7 @@ bool CSubSource::IsISOFormatTime(const string& orig_time, int& hour, int& min, i
         return false;
     }
     if (suffix > 2) {
-        if (!isdigit(orig_time.c_str()[3]) || !isdigit(orig_time.c_str()[4])) {
+        if (!isdigit((unsigned char)orig_time[3]) || !isdigit((unsigned char)orig_time[4])) {
             return false;
         }
         try {
@@ -617,7 +626,7 @@ bool CSubSource::IsISOFormatTime(const string& orig_time, int& hour, int& min, i
         min -= offset_min;
     }
     if (suffix == 8) {
-        if (!isdigit(orig_time.c_str()[6]) || !isdigit(orig_time.c_str()[7])) {
+        if (!isdigit((unsigned char)orig_time[6]) || !isdigit((unsigned char)orig_time[7])) {
             return false;
         }
         try {
@@ -692,7 +701,7 @@ bool CSubSource::IsISOFormatDate(const string& orig_date)
     string cpy = orig_date;
     NStr::TruncateSpacesInPlace(cpy);
     size_t time_pos = NStr::Find(cpy, "T");
-    if (time_pos == string::npos) {
+    if (time_pos == NPOS) {
         return IsISOFormatDateOnly(cpy);
     } else {
         int h, m, s;
@@ -723,19 +732,6 @@ CRef<CDate> CSubSource::GetDateFromISODate(const string& orig_date)
 }
 
 
-// return 1-based month number if found, 0 for error
-static
-int GetMonthNumberFromString(const string& month) 
-{
-    for (size_t i = 0; i < ArraySize(sm_LegalMonths); i++) {
-        if (NStr::StartsWith(month, sm_LegalMonths[i], NStr::eNocase)) {
-            return int(i + 1);
-        }
-    }
-    return 0;
-}
-
-
 vector<string> CSubSource::x_GetDateTokens(const string& orig_date)
 {
     vector<string> tokens;
@@ -745,15 +741,61 @@ vector<string> CSubSource::x_GetDateTokens(const string& orig_date)
     string cpy = orig_date;
     NStr::TruncateSpacesInPlace (cpy);
 
-    string one_token;    
-    for (i = 0; i < 4; i++) {
-        one_token = NStr::GetField (cpy, i, token_delimiters, NStr::eMergeDelims);
-        if (NStr::IsBlank (one_token)) {
-            break;
+    string curr_token;
+    bool is_chars = false;
+    ITERATE(string, s, cpy) {
+        if (token_delimiters.find(*s) != NPOS) {
+            if (!NStr::IsBlank(curr_token)) {
+                tokens.push_back(curr_token);
+            }
+            curr_token.clear();
+            is_chars = false;
+        } else if (is_chars && !isalpha((unsigned char)(*s))) {
+            // previous token was all letters, do not add non-letter characters
+            if (!NStr::IsBlank(curr_token)) {
+                tokens.push_back(curr_token);
+            }
+            curr_token = *s;
+            is_chars = false;
+        } else if (!NStr::IsBlank(curr_token) && !is_chars && isalpha(*s)) {
+            // previous token had no letters
+            tokens.push_back(curr_token);
+            curr_token = *s;
+            is_chars = true;
         } else {
-            tokens.push_back (one_token);
+            curr_token += *s;
+            if (isalpha(*s)) {
+                is_chars = true;
+            }
+        }
+    }
+    if (!NStr::IsBlank(curr_token)) {
+        tokens.push_back(curr_token);
+    }
+
+    // reattach 'st', 'nd', 'rd', and 'th' to numbers if present
+    if (tokens.size() > 3) {
+        vector<string>::iterator p = tokens.begin();  
+        bool prev_is_number = isdigit((unsigned char)(*p)[0]);
+        vector<string>::iterator s = p;
+        ++s;
+        while (s != tokens.end()) {
+            if (prev_is_number &&
+                (NStr::EqualNocase(*s, "st") ||
+                NStr::EqualNocase(*s, "nd") ||
+                NStr::EqualNocase(*s, "rd") ||
+                NStr::EqualNocase(*s, "th"))) {
+                *p += *s;
+                s = tokens.erase(s);
+                prev_is_number = false;
+            } else {
+                ++p;
+                ++s;
+                prev_is_number = isdigit((unsigned char)(*p)[0]);
+            }
         }
     }
+
     return tokens;
 }
 
@@ -769,24 +811,24 @@ bool s_ChooseMonthAndDay(const string& token1, const string& token2, bool month_
         } else if (val1 < 13 && val2 < 13) {
             if (val1 == val2) {
                 // no need to call this ambiguous
-                month = sm_LegalMonths[val1 - 1];
+                month = CTime::MonthNumToName(val1, CTime::eAbbr);
                 day = val2;
             } else {
                 // both numbers could be month
                 month_ambiguous = true;
                 if (month_first) {
-                    month = sm_LegalMonths[val1 - 1];
+                    month = CTime::MonthNumToName(val1, CTime::eAbbr);
                     day = val2;
                 } else {
-                    month = sm_LegalMonths[val2 - 1];
+                    month = CTime::MonthNumToName(val2, CTime::eAbbr);
                     day = val1;
                 }
             }
         } else if (val1 < 13) {
-            month = sm_LegalMonths[val1 - 1];
+            month = CTime::MonthNumToName(val1, CTime::eAbbr);
             day = val2;
         } else {
-            month = sm_LegalMonths[val2 - 1];
+            month = CTime::MonthNumToName(val2, CTime::eAbbr);
             day = val1;
         }
         return true;
@@ -805,10 +847,10 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
         return orig_date;
     }
 
-    string reformatted_date = "";
-    string month = "";
+    string reformatted_date;
+    string month;
     int year = 0, day = 0;
-    string token_delimiters = " ,-/=_.";
+    //string token_delimiters = " ,-/=_.";
     size_t num_original_tokens = 0;
 
     month_ambiguous = false;
@@ -817,7 +859,7 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
     num_original_tokens = tokens.size();
     if (tokens.size() < 1 || tokens.size() > 3) {
         // no tokens or too many tokens
-        return "";
+        return kEmptyStr;
     }
 
     string one_token;    
@@ -835,24 +877,25 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
             day = 3;
             found = true;
         } else if (one_token.length() > 0
-                   && isdigit(one_token.c_str()[0])
+                   && isdigit((unsigned char)one_token[0])
                    && NStr::EndsWith(one_token, "th")) {
             try {
                 day = NStr::StringToInt (one_token.substr(0, one_token.length() - 2));
                 found = true;
             } catch ( ... ) {
                 // threw exception while converting to int
-                return "";
+                return kEmptyStr;
             }
-        } else if (isalpha(one_token.c_str()[0])) {
-            if (!NStr::IsBlank (month)) {
+        } else if (isalpha((unsigned char)one_token[0])) {
+            if (!NStr::IsBlank(month)) {
                 // already have month, error
-                return "";
+                return kEmptyStr;
             }
-            size_t month_num = GetMonthNumberFromString(one_token);
-            if (month_num > 0) {
-                month = sm_LegalMonths[month_num - 1];
+            try {
+                int month_num = CTime::MonthNameToNum(one_token);
                 found = true;
+                month = CTime::MonthNumToName(month_num, CTime::eAbbr);
+            } catch (CTimeException& e) {
             }
         } else {
             try {
@@ -860,18 +903,18 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
                 int min = 1;
                 int max = 31;
                 if (this_val < min) {
-                    return "";
+                    return kEmptyStr;
                 } else if (this_val > max) {
                     if (year > 0) {
                         // already have year, error
-                        return "";
+                        return kEmptyStr;
                     }
                     year = this_val;
                     found = true;
                 }
             } catch ( ... ) {
                 // threw exception while converting to int
-                return "";
+                return kEmptyStr;
             }
         }
         if (found) {
@@ -891,13 +934,13 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
                 year += 2000;
             }
             if (!s_ChooseMonthAndDay(tokens[0], tokens[1], month_first, month, day, month_ambiguous)) {
-                return "";
+                return kEmptyStr;
             }
             // mark month as ambiguous, since we are guessing about year
             month_ambiguous = true;
         } catch ( ... ) {
             // threw exception while converting to int
-            return "";
+            return kEmptyStr;
         }
     } else if (tokens.size() == 1) {
         try {
@@ -907,10 +950,10 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
             } else {
                 if (NStr::IsBlank (month)) {
                     if (val > 0 && val < 13) {
-                        month = sm_LegalMonths[val - 1];
+                        month = CTime::MonthNumToName(val, CTime::eAbbr);
                     } else {
                         // month number out of range
-                        return "";
+                        return kEmptyStr;
                     }
                 } else {
                     day = val;
@@ -918,7 +961,7 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
             }
         } catch ( ... ) {
             // threw exception while converting to int
-            return "";
+            return kEmptyStr;
         }
     } else if (!NStr::IsBlank (month)) {
         if (tokens.size() == 2) {
@@ -930,7 +973,7 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
                 val2 = NStr::StringToInt (tokens[1]);
             } catch (CException& /*e*/) {
                 // not actually numbers
-                return "";
+                return kEmptyStr;
             }
             bool zero_pad_1 = NStr::StartsWith(tokens[0], "0");
             bool zero_pad_2 = NStr::StartsWith(tokens[1], "0");
@@ -947,24 +990,33 @@ string CSubSource::FixDateFormat (const string& test, bool month_first, bool& mo
                 day = val2;
                 year = val1 + 2000;
             } else {
-                return "";
+                int month_num = CTime::MonthNameToNum(month); 
+                if (IsDayValueOkForMonth(val1, month_num, val2 + 2000)) {
+                    day = val1;
+                    year = val2 + 2000;
+                } else {
+                    day = val2;
+                    year = val1 + 2000;
+                }                
             }
         } else {
-            return "";
+            return kEmptyStr;
         }
     } else {
         if (!s_ChooseMonthAndDay(tokens[0], tokens[1], month_first, month, day, month_ambiguous)) {
-            return "";
+            return kEmptyStr;
         }
     }
 
     // make sure day is valid
     if (day > 0 && !NStr::IsBlank(month) && year > -1) {
-        int month_num = GetMonthNumberFromString(month);
-        if (month_num == 0) {
-            return "";
-        } else if (!IsDayValueOkForMonth(day, month_num, year)) {
-            return "";
+        try {
+            int month_num = CTime::MonthNameToNum(month);
+            if (!IsDayValueOkForMonth(day, month_num, year)) {
+                return kEmptyStr;
+            }
+        } catch (CTimeException& ex) {
+            return kEmptyStr;
         }
     }
         
@@ -1100,16 +1152,8 @@ void CSubSource::IsCorrectLatLonFormat (string lat_lon, bool& format_correct, bo
         vector<string> pieces;
         NStr::Tokenize(lat_lon, " ", pieces);
         if (pieces.size() > 3) {
-            int precision_lat = 0;
-            size_t pos = NStr::Find(pieces[0], ".");
-            if (pos != string::npos) {
-                precision_lat = int(pieces[0].length() - pos - 1);
-            }
-            int precision_lon = 0;
-            pos = NStr::Find(pieces[2], ".");
-            if (pos != string::npos) {
-                precision_lon = int(pieces[2].length() - pos - 1);
-            }
+            int precision_lat = x_GetPrecision(pieces[0]);
+            int precision_lon = x_GetPrecision(pieces[2]);
 
             char reformatted[1000];
             sprintf (reformatted, "%.*lf %c %.*lf %c", precision_lat, ns, lat,
@@ -1119,7 +1163,7 @@ void CSubSource::IsCorrectLatLonFormat (string lat_lon, bool& format_correct, bo
             if (NStr::StartsWith(lat_lon, reformatted)
                 && (len == lat_lon.length() 
                   || (len < lat_lon.length() 
-                      && lat_lon.c_str()[len] == ';'))) {
+                      && lat_lon[len] == ';'))) {
                 format_correct = true;
                 if (ns <= 90 && ns >= 0) {
                     lat_in_range = true;
@@ -1140,12 +1184,12 @@ static void s_TrimInternalSpaces (string& token)
 {
     size_t pos;
 
-    while ((pos = NStr::Find (token, "  ")) != string::npos) {
+    while ((pos = NStr::Find (token, "  ")) != NPOS) {
         string before = token.substr(0, pos);
         string after = token.substr(pos + 1);
         token = before + after;
     }
-    while ((pos = NStr::Find (token, " '")) != string::npos) {
+    while ((pos = NStr::Find (token, " '")) != NPOS) {
         string before = token.substr(0, pos);
         string after = token.substr(pos + 1);
         token = before + after;
@@ -1153,9 +1197,9 @@ static void s_TrimInternalSpaces (string& token)
 }
 
 
-string s_GetDefaultDir(bool is_negative, string default_dir)
+string s_GetDefaultDir(bool is_negative, const string& default_dir)
 {
-    string dir = "";
+    string dir;
     if (is_negative) {
         if (NStr::Equal("N", default_dir)) {
             dir = "S";
@@ -1168,9 +1212,9 @@ string s_GetDefaultDir(bool is_negative, string default_dir)
     return dir;
 }
 
+
 static void s_RemoveLeadingZeros(string& token)
 {
-
     size_t index = 0;
     while (index < token.size() &&
         token[index] == '0' &&
@@ -1183,19 +1227,20 @@ static void s_RemoveLeadingZeros(string& token)
 }
 
 
-static string s_GetNumFromLatLonToken (string token, string default_dir)
+static string s_GetNumFromLatLonToken (string token, const string& default_dir)
 {
     NStr::TruncateSpacesInPlace(token);
-    string dir = "";
-    if (NStr::StartsWith (token, "N") || NStr::StartsWith (token, "S") || NStr::StartsWith (token, "E") || NStr::StartsWith (token, "W")) {
-        dir = token.substr(0, 1);
+    string dir;
+    char ch = token[0];
+    if (ch == 'N' || ch == 'S' || ch == 'E' || ch == 'W') {
+        dir = ch;
         token = token.substr(1);
     } else {
         dir = token.substr(token.length() - 1, 1);
-        if (isalpha(dir.c_str()[0])) {
+        if (isalpha((unsigned char)dir[0])) {
             token = token.substr(0, token.length() - 1);
         } else {
-            dir = "";
+            dir.clear();
         }
     }
     NStr::TruncateSpacesInPlace(token);
@@ -1204,7 +1249,7 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
 
     // find leading negative sign
     bool is_negative = false;
-    if (NStr::StartsWith(token, "-")) {
+    if (token[0] == '-') {
         is_negative = true;
         token = token.substr(1);
     }
@@ -1212,7 +1257,7 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
     if (NStr::IsBlank(dir)) {
         dir = s_GetDefaultDir(is_negative, default_dir);
     } else if (is_negative) {
-        return "";
+        return kEmptyStr;
     }
 
     size_t pos = 0;
@@ -1221,12 +1266,13 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
     size_t prec = 0;
     bool seen_period = false;
     bool last_is_sep = false;
+
     while (pos < token.length()) {
-        char ch = token.c_str()[pos];
+        char ch = token[pos];
         if (ch == ' ' || ch == ':' || ch == '-') {
             if (pos == prev_start) {
                 // too many separators
-                return "";
+                return kEmptyStr;
             }
             string num_str = token.substr(prev_start, pos - prev_start);
             double this_val = NStr::StringToDouble (num_str);
@@ -1240,10 +1286,10 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
                 prec += 2;
             } else {
                 // too many separators
-                return "";
+                return kEmptyStr;
             }
             size_t p_pos = NStr::Find (num_str, ".");
-            if (p_pos != string::npos) {
+            if (p_pos != NPOS) {
                 prec += num_str.substr(p_pos + 1).length();
             }
             num_sep++;
@@ -1253,10 +1299,10 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
         } else if (ch == '\'') {
             string num_str = token.substr(prev_start, pos - prev_start);
             double this_val = NStr::StringToDouble (num_str);
-            if (token.c_str()[pos + 1] == '\'') {
+            if (token[pos + 1] == '\'') {
                 if (num_sep > 2) {
                     // already found seconds
-                    return "";
+                    return kEmptyStr;
                 }
                 // seconds
                 val += (this_val) / (3600.0);
@@ -1270,18 +1316,18 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
             } else {
                 if (num_sep > 1) {
                     // already found minutes
-                    return "";
+                    return kEmptyStr;
                 }
                 val += (this_val) / (60.0);
                 prec += 2;
                 num_sep ++;
             }
             size_t p_pos = NStr::Find (num_str, ".");
-            if (p_pos != string::npos) {
+            if (p_pos != NPOS) {
                 prec += num_str.substr(p_pos + 1).length();
             }
             pos++;
-            while (isspace (token.c_str()[pos])) {
+            while (isspace((unsigned char)token[pos])) {
                 pos++;
             }
             prev_start = pos;
@@ -1291,13 +1337,13 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
             last_is_sep = false;
         } else if (ch == '.') {
             if (seen_period) {
-                return "";
+                return kEmptyStr;
             }
             seen_period = true;
             pos++;
             last_is_sep = false;
         } else {
-            return "";
+            return kEmptyStr;
         }
     }
     if (num_sep > 0 && !last_is_sep) {
@@ -1306,7 +1352,7 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
             // if we have seen minutes but not seconds we'll treat this last value as seconds
         } else {
             // otherwise this is a bad format
-            return "";
+            return kEmptyStr;
         }
     }
 
@@ -1332,10 +1378,10 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
                 prec += 2;
             } else {
                 // too many separators
-                return "";
+                return kEmptyStr;
             }
             size_t p_pos = NStr::Find (num_str, ".");
-            if (p_pos != string::npos) {
+            if (p_pos != NPOS) {
                 prec += num_str.substr(p_pos + 1).length();
             }
         }
@@ -1356,7 +1402,7 @@ static string s_GetNumFromLatLonToken (string token, string default_dir)
         }
         string val_str = NStr::NumericToString (val, NStr::fDoubleFixed);
         pos = NStr::Find (val_str, ".");
-        if (pos != string::npos && prec > 0) {
+        if (pos != NPOS  &&  prec > 0) {
             while (val_str.substr(pos + 1).length() < prec) {
                 val_str += "0";
             }
@@ -1381,7 +1427,7 @@ static bool s_IsNumberStringInRange(const string& val_str, double max)
     char dir;
     int processed;
 
-    if (sscanf (val_str.c_str(), "%lf %c%n", &val, &dir, &processed) != 2
+    if (sscanf(val_str.c_str(), "%lf %c%n", &val, &dir, &processed) != 2
         || size_t(processed) != val_str.length()
         || val < 0.0 || val > max) {
         return false;
@@ -1405,18 +1451,18 @@ static void s_RemoveExtraText (string& token, string& extra_text)
 {
     size_t comma_pos = NStr::Find (token, ",");
     size_t semicolon_pos = NStr::Find (token, ";");
-    size_t sep_pos = string::npos;
+    size_t sep_pos = NPOS;
 
-    if (comma_pos == string::npos) {
+    if (comma_pos == NPOS) {
         sep_pos = semicolon_pos;
-    } else if (semicolon_pos != string::npos) {
+    } else if (semicolon_pos != NPOS) {
         if (semicolon_pos < comma_pos) {
             sep_pos = semicolon_pos;
         } else {
             sep_pos = comma_pos;
         }
     }
-    if (sep_pos != string::npos) {
+    if (sep_pos != NPOS) {
         extra_text = token.substr(sep_pos + 1);
         NStr::TruncateSpacesInPlace(extra_text);
         token = token.substr(0, sep_pos - 1);
@@ -1430,17 +1476,16 @@ string CSubSource::FixLatLonFormat (string orig_lat_lon, bool guess)
     string cpy;
     size_t pos;
 
-    if (NStr::IsBlank (orig_lat_lon))
-    {
-        return "";
+    if (NStr::IsBlank (orig_lat_lon)) {
+        return kEmptyStr;
     }
 
     cpy = orig_lat_lon;
     
     // replace all 'O' (capital o) following non-alpha characters with '0' (zero)
     pos = NStr::Find (cpy, "O");
-    while (pos != string::npos) {
-        if (pos > 0 && !isalpha(cpy.c_str()[pos - 1])) {
+    while (pos != NPOS) {
+        if (pos > 0  &&  !isalpha((unsigned char)cpy[pos - 1])) {
             string before = cpy.substr(0, pos);
             string after = cpy.substr(pos + 1);
             cpy = before + "0" + after;
@@ -1449,9 +1494,9 @@ string CSubSource::FixLatLonFormat (string orig_lat_lon, bool guess)
     }
     // replace all 'o' with non-alpha characters before and after with space
     pos = NStr::Find (cpy, "o");
-    while (pos != string::npos) {
-        if ((pos == 0 || !isalpha(cpy.c_str()[pos - 1]))
-            && !isalpha (cpy.c_str()[pos + 1])) {
+    while (pos != NPOS) {
+        if ((pos == 0 || !isalpha((unsigned char)cpy[pos - 1]))
+            && !isalpha ((unsigned char)cpy[pos + 1])) {
             string before = cpy.substr(0, pos);
             string after = cpy.substr(pos + 1);
             cpy = before + " " + after;
@@ -1471,14 +1516,15 @@ string CSubSource::FixLatLonFormat (string orig_lat_lon, bool guess)
 
     // replace commas that should be periods
     pos = NStr::Find (cpy, ",");
-    while (pos != string::npos) {
-        if (pos > 0 && isdigit (cpy.c_str()[pos + 1]) && isdigit (cpy.c_str()[pos - 1])) {
+    while (pos != NPOS) {
+        if (pos > 0  &&  isdigit((unsigned char)cpy[pos + 1])  
+                     &&  isdigit((unsigned char)cpy[pos - 1])) {
             // follow digits all the way back, make sure character before digits is not '.'
             size_t dpos = pos - 2;
-            while (dpos > 0 && isdigit (cpy.c_str()[dpos])) {
+            while (dpos > 0 && isdigit((unsigned char)cpy[dpos])) {
                 dpos--;
             }
-            if (cpy.c_str()[dpos] != '.') {
+            if (cpy[dpos] != '.') {
                 string before = cpy.substr(0, pos);
                 string after = cpy.substr(pos + 1);
                 cpy = before + " " + after;
@@ -1494,8 +1540,8 @@ string CSubSource::FixLatLonFormat (string orig_lat_lon, bool guess)
 
     // get rid of periods after letters not before numbers
     pos = NStr::Find (cpy, ".");
-    while (pos != string::npos) {
-        if (pos > 0 && isalpha(cpy.c_str()[pos - 1])) {
+    while (pos != NPOS) {
+        if (pos > 0 && isalpha((unsigned char)cpy[pos - 1])) {
             string before = cpy.substr(0, pos);
             string after = cpy.substr(pos + 1);
             cpy = before + " " + after;
@@ -1532,70 +1578,69 @@ string CSubSource::FixLatLonFormat (string orig_lat_lon, bool guess)
 
     size_t lat_pos = NStr::Find (cpy, "LAT");
     size_t lon_pos = NStr::Find (cpy, "LO");
-    if ((lat_pos == string::npos && lon_pos != string::npos)
-        || (lat_pos != string::npos && lon_pos == string::npos)) {
+    if ((lat_pos == NPOS  &&  lon_pos != NPOS)
+        || (lat_pos != NPOS  &&  lon_pos == NPOS)) {
         // must specify both lat and lon or neither
-        return "";
+        return kEmptyStr;
     }
-    if (lat_pos != string::npos && NStr::Find (cpy, "LAT", lat_pos + 1) != string::npos) {
+    if (lat_pos != NPOS  &&  NStr::Find (cpy, "LAT", lat_pos + 1) != NPOS) {
         // better not find two
-        return "";
+        return kEmptyStr;
     }
-    if (lon_pos != string::npos && NStr::Find (cpy, "LO", lon_pos + 1) != string::npos) {
+    if (lon_pos != NPOS  &&  NStr::Find (cpy, "LO", lon_pos + 1) != NPOS) {
         // better not find two
-        return "";
+        return kEmptyStr;
     }
 
     size_t ns_pos = NStr::Find (cpy, "N");
-    if (ns_pos == string::npos) {
+    if (ns_pos == NPOS) {
         ns_pos = NStr::Find (cpy, "S");
-        if (ns_pos != string::npos && NStr::Find(cpy, "S", ns_pos + 1) != string::npos) {
+        if (ns_pos != NPOS  &&  NStr::Find(cpy, "S", ns_pos + 1) != NPOS) {
             // better not find two
-            return "";
+            return kEmptyStr;
         }
-    } else if (NStr::Find (cpy, "S") != string::npos || NStr::Find (cpy, "N", ns_pos + 1) != string::npos) {
+    } else if (NStr::Find (cpy, "S") != NPOS  ||  NStr::Find (cpy, "N", ns_pos + 1) != NPOS) {
         // better not find two
-        return "";
+        return kEmptyStr;
     }
 
     size_t ew_pos = NStr::Find (cpy, "E");
-    if (ew_pos == string::npos) {
+    if (ew_pos == NPOS) {
         ew_pos = NStr::Find (cpy, "W");
-        if (ew_pos != string::npos && NStr::Find(cpy, "W", ew_pos + 1) != string::npos) {
+        if (ew_pos != NPOS  &&  NStr::Find(cpy, "W", ew_pos + 1) != NPOS) {
             // better not find two
-            return "";
+            return kEmptyStr;
         }
-    } else if (NStr::Find (cpy, "W") != string::npos || NStr::Find (cpy, "E", ew_pos + 1) != string::npos) {
+    } else if (NStr::Find (cpy, "W") != NPOS  ||  NStr::Find (cpy, "E", ew_pos + 1) != NPOS) {
         // better not find two
-        return "";
+        return kEmptyStr;
     }
 
     // todo - figure out how to use degrees as ew_pos markers
 
     // need to have both or neither
-    if ((ns_pos == string::npos && ew_pos != string::npos)
-        || (ns_pos != string::npos && ew_pos == string::npos)) {
-        return "";
+    if ((ns_pos == NPOS  &&  ew_pos != NPOS) || (ns_pos != NPOS  &&  ew_pos == NPOS)) {
+        return kEmptyStr;
     }
 
-    string extra_text = "";
-    string la_token = "";
-    string lo_token = "";
+    string extra_text;
+    string la_token;
+    string lo_token;
     bool la_first = true;
 
-    if (lat_pos == string::npos) {
-        if (ns_pos == string::npos) {
+    if (lat_pos == NPOS) {
+        if (ns_pos == NPOS) {
             if (guess) {
                 // do we have just two numbers, separated by either a comma or just a space?
                 s_TrimInternalSpaces(cpy);
                 size_t sep_pos = NStr::Find (cpy, ",");
-                if (sep_pos == string::npos) {
+                if (sep_pos == NPOS) {
                     sep_pos = NStr::Find (cpy, " ");
-                    if (sep_pos == string::npos || NStr::Find (cpy, " ", sep_pos + 1) != string::npos) {
-                        return "";
+                    if (sep_pos == NPOS  ||  NStr::Find (cpy, " ", sep_pos + 1) != NPOS) {
+                        return kEmptyStr;
                     }
-                } else if (NStr::Find (cpy, ",", sep_pos + 1) != string::npos) {
-                    return "";
+                } else if (NStr::Find (cpy, ",", sep_pos + 1) != NPOS) {
+                    return kEmptyStr;
                 }
                 la_token = cpy.substr(0, sep_pos);
                 lo_token = cpy.substr(sep_pos + 1);                 
@@ -1612,7 +1657,7 @@ string CSubSource::FixLatLonFormat (string orig_lat_lon, bool guess)
                   lo_token = "E " + lo_token;
                 }
             } else {
-                return "";
+                return kEmptyStr;
             }
         } else if (ns_pos < ew_pos) {
             // as it should be
@@ -1663,22 +1708,22 @@ string CSubSource::FixLatLonFormat (string orig_lat_lon, bool guess)
                 la_token = cpy.substr(lon_pos + 2);
             }
         }
-        NStr::ReplaceInPlace (la_token, "LAT", "");
-        NStr::ReplaceInPlace (lo_token, "LO", "");
-        if (NStr::Find (la_token, "E") != string::npos || NStr::Find (la_token, "W") != string::npos) {
-            return "";
-        } else if (NStr::Find (lo_token, "N") != string::npos || NStr::Find (lo_token, "S") != string::npos) {
-            return "";
+        NStr::ReplaceInPlace (la_token, "LAT", kEmptyStr);
+        NStr::ReplaceInPlace (lo_token, "LO",  kEmptyStr);
+        if (NStr::Find (la_token, "E") != NPOS || NStr::Find (la_token, "W") != NPOS) {
+            return kEmptyStr;
+        } else if (NStr::Find (lo_token, "N") != NPOS || NStr::Find (lo_token, "S") != NPOS) {
+            return kEmptyStr;
         }
     }
     if (la_first) {
-        NStr::ReplaceInPlace (la_token, ",", "");
-        NStr::ReplaceInPlace (la_token, ";", "");
+        NStr::ReplaceInPlace (la_token, ",", kEmptyStr);
+        NStr::ReplaceInPlace (la_token, ";", kEmptyStr);
         s_RemoveLeadingCommaOrSemicolon (lo_token);
         s_RemoveExtraText (lo_token, extra_text);
     } else {
-        NStr::ReplaceInPlace (lo_token, ",", "");
-        NStr::ReplaceInPlace (lo_token, ";", "");
+        NStr::ReplaceInPlace (lo_token, ",", kEmptyStr);
+        NStr::ReplaceInPlace (lo_token, ";", kEmptyStr);
         s_RemoveLeadingCommaOrSemicolon (la_token);
         s_RemoveExtraText (lo_token, extra_text);
     }
@@ -1686,14 +1731,14 @@ string CSubSource::FixLatLonFormat (string orig_lat_lon, bool guess)
     la_token = s_GetNumFromLatLonToken (la_token, "N");
     if (NStr::IsBlank (la_token)
         || !s_IsNumberStringInRange(la_token, 90.0)) {
-        return "";
+        return kEmptyStr;
     }
 
     lo_token = s_GetNumFromLatLonToken (lo_token, "E");
 
     if (NStr::IsBlank (lo_token)
         || !s_IsNumberStringInRange(lo_token, 180.0)) {
-        return "";
+        return kEmptyStr;
     }
 
     string fix = la_token + " " + lo_token;
@@ -1910,7 +1955,7 @@ static string x_FindSurroundingOcean (string& water)
     if( new_water_pair_iter != sc_WaterPairMap.end() ) {
         return new_water_pair_iter->second;
     }
-    return "";
+    return kEmptyStr;
 }
 
 
@@ -1919,7 +1964,7 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
     errcode = eLatLonCountryErr_None;
     string countryname = input_countryname;
     if (NStr::IsBlank(countryname) || NStr::IsBlank(lat_lon)) {
-        return "";
+        return kEmptyStr;
     }
 
     if ( m_LatLonCountryMap.get() == 0 ) {
@@ -1937,8 +1982,8 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
                                lat_value, lon_value);
     if (!format_correct) {
         // may have comma and then altitude, so just get lat_lon component */
-        size_t pos = NStr::Find(lat_lon, ",", 0, string::npos, NStr::eLast);
-        if (pos != string::npos) {
+        size_t pos = NStr::Find(lat_lon, ",", 0, NPOS, NStr::eLast);
+        if (pos != NPOS) {
             lat_lon = lat_lon.substr(0, pos);
             CSubSource::IsCorrectLatLonFormat (lat_lon, format_correct, precision_correct,
                                        lat_in_range, lon_in_range,
@@ -1951,16 +1996,16 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
         // incorrect lat_lon format should be reported elsewhere
         // incorrect latitude range should be reported elsewhere
         // incorrect longitude range should be reported elsewhere
-        return "";
+        return kEmptyStr;
     }
 
     // get rid of comments after semicolon or comma in country name
     size_t pos = NStr::Find(countryname, ";");
-    if (pos != string::npos) {
+    if (pos != NPOS) {
          countryname = countryname.substr(0, pos);
         }
     pos = NStr::Find(countryname, ",");
-    if (pos != string::npos) {
+    if (pos != NPOS) {
          countryname = countryname.substr(0, pos);
     }
 
@@ -1970,9 +2015,9 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
     }
 
     string country = countryname;
-    string province = "";
+    string province;
     pos = NStr::Find(country, ":");
-    if (pos != string::npos) {
+    if (pos != NPOS) {
         // is the full string in the list?
         if (m_LatLonCountryMap->HaveLatLonForRegion(countryname)) {
             province = country.substr(pos + 1);
@@ -1982,28 +2027,28 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
         NStr::TruncateSpacesInPlace(country, NStr::eTrunc_Both);
     }
     if (NStr::IsBlank(country)) {
-        return "";
+        return kEmptyStr;
     }
 
     // known exceptions - don't even bother calculating any further
     if (NStr::EqualNocase (country, "Antarctica") && lat_value < -60.0) {
-        return "";
+        return kEmptyStr;
     }
 
     if (! NStr::IsBlank(province)) {
         // do not attempt quick exit
     } else if (m_LatLonCountryMap->HaveLatLonForRegion(country)) {
         if (m_LatLonCountryMap->IsCountryInLatLon(country, lat_value, lon_value)) {
-            return "";
+            return kEmptyStr;
         }
     } else if (m_LatLonWaterMap->HaveLatLonForRegion(country)) {
         if (m_LatLonWaterMap->IsCountryInLatLon(country, lat_value, lon_value)) {
-            return "";
+            return kEmptyStr;
         }
     } else if (NStr::EqualNocase (country, "Palestine") || NStr::EqualNocase (country, "State of Palestine")) {
     } else {
         // report unrecognized country
-        return "";
+        return kEmptyStr;
     }
 
     CLatLonCountryId *id = x_CalculateLatLonId(lat_value, lon_value, country, province);
@@ -2014,23 +2059,23 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
     string cguess = id->GetGuessCountry();
 
     if (NStr::EqualNocase (country, "China") && NStr::EqualNocase (cguess, "Hong Kong")) {
-        return "";
+        return kEmptyStr;
     }
     if (NStr::EqualNocase (country, "USA") && NStr::EqualNocase (cguess, "Puerto Rico")) {
-        return "";
+        return kEmptyStr;
     }
     if ((NStr::EqualNocase (country, "Palestine") ||
          NStr::EqualNocase (country, "State of Palestine")) &&
         (NStr::EqualNocase (cguess, "Gaza Strip") ||
          NStr::EqualNocase (cguess, "West Bank"))) {
-        return "";
+        return kEmptyStr;
     }
 
     if (NStr::IsBlank (cguess) && (! NStr::IsBlank (wguess))) {
         string parent = x_FindSurroundingOcean (wguess);
         if ((! NStr::IsBlank (parent)) && NStr::EqualNocase (country, parent)) {
             delete id;
-            return "";
+            return kEmptyStr;
         }
     }
 
@@ -2040,7 +2085,7 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
 
     if (!flags && m_LatLonCountryMap->IsNearLatLon(lat_value, lon_value, 2.0, neardist, country) && neardist < 5.0) {
         id->SetGuessCountry (country);
-        id->SetGuessProvince ("");
+        id->SetGuessProvince (kEmptyStr);
         flags = id->Classify(country, province);
     }
 
@@ -2098,7 +2143,7 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
         }
     }
 
-    string error = "";
+    string error;
 
     if (adjustment != CLatLonCountryMap::fNone) {
         if (adjustment == CLatLonCountryMap::fFlip) {
@@ -2136,7 +2181,7 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
         if (flags & (CLatLonCountryId::fCountryClosest | CLatLonCountryId::fProvinceClosest)) {
             bool suppress = false;
             string reportregion;
-            string nosubphrase = "";
+            string nosubphrase;
             string desphrase = "designated subregion ";
             string subphrase = "another subregion ";
             string phrase = nosubphrase;
@@ -2146,7 +2191,7 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
                 // for now, will not report
                 // this is a policy decision
                 suppress = true;
-            } else if (NStr::Find(countryname, "Island") != string::npos) {
+            } else if (NStr::Find(countryname, "Island") != NPOS) {
                 suppress = true;
             }
 
@@ -2190,7 +2235,11 @@ string CSubSource::ValidateLatLonCountry (const string& input_countryname, strin
         }
     } else if (!NStr::IsBlank(id->GetGuessCountry())) {
         if (NStr::IsBlank(id->GetClaimedFull())) {
-            errcode = eLatLonCountryErr_Country;
+            if (NStr::Equal(id->GetGuessCountry(), country) && !NStr::Equal(id->GetGuessProvince(), province)) {
+                errcode = eLatLonCountryErr_State;
+            } else {
+                errcode = eLatLonCountryErr_Country;
+            }
             error = "Lat_lon '" + lat_lon + "' maps to '" + id->GetFullGuess() + "' instead of '"
                         + countryname + "'";
         } else {
@@ -2241,6 +2290,7 @@ const char* sm_ValidSexQualifierTokens[] = {
   "female",
   "gelding",
   "hermaphrodite",
+  "intersex",
   "m",
   "male",
   "mixed",
@@ -2324,9 +2374,9 @@ string CSubSource::FixSexQualifierValue (const string& value)
     NStr::Tokenize(str," ,/",words);
 
     if (words.size() == 0) {
-        return "";
+        return kEmptyStr;
     }
-    size_t max = sizeof(sm_ValidSexQualifierTokens) / sizeof(const char*);
+    size_t max = ArraySize(sm_ValidSexQualifierTokens);
 
     const char* *begin = sm_ValidSexQualifierTokens;
     const char* *end = &(sm_ValidSexQualifierTokens[max]);
@@ -2351,13 +2401,13 @@ string CSubSource::FixSexQualifierValue (const string& value)
                 }
             } else {
                 // if any bad values, can't autofix
-                return "";
+                return kEmptyStr;
             }
         }
     }
     if (good_values.size() == 0) {
         // no good tokens, can't autofix
-        return "";
+        return kEmptyStr;
     }
 
     string fixed = good_values[0];
@@ -2379,8 +2429,8 @@ string CSubSource::FixSexQualifierValue (const string& value)
 
 void s_CollectNumberAndUnits(const string& value, string& number, string& units)
 {
-    number = "";
-    units = "";
+    number.clear();
+    units.clear();
 
     if (NStr::IsBlank(value)) {
         return;
@@ -2400,7 +2450,7 @@ void s_CollectNumberAndUnits(const string& value, string& number, string& units)
     }
 
     if (it == value.end()) {
-        number = "";
+        number.clear();
         return;
     }
 
@@ -2415,7 +2465,7 @@ void s_CollectNumberAndUnits(const string& value, string& number, string& units)
     }
 
     if (it == value.end() || *it != ' ' || !any_digit) {
-        number = "";
+        number.clear();
         return;
     }
 
@@ -2433,8 +2483,8 @@ bool CSubSource::IsAltitudeValid (const string& value)
         return false;
     }
 
-    string number = "";
-    string units = "";
+    string number;
+    string units;
     s_CollectNumberAndUnits(value, number, units);
     if (NStr::IsBlank(number) || !NStr::EqualCase(units, "m")) {
         return false;
@@ -2445,21 +2495,41 @@ bool CSubSource::IsAltitudeValid (const string& value)
 }
 
 
+int CSubSource::x_GetPrecision(const string& num_str)
+{
+    int precision = 0;
+    size_t pos = NStr::Find(num_str, ".");
+    if (pos != NPOS) {
+        precision = int(num_str.length() - pos - 1);
+    }
+    return precision;
+}
+
+
+string CSubSource::x_FormatWithPrecision(double val, int precision)
+{
+    char reformatted[1000];
+    sprintf(reformatted, "%.*lf", precision, val);
+    string rval = reformatted;
+    return rval;
+}
+
 string CSubSource::FixAltitude (const string& value)
 {
     if (NStr::IsBlank(value)) {
-        return "";
+        return kEmptyStr;
     }
 
-    string number = "";
-    string units = "";
+    string number;
+    string units;
     s_CollectNumberAndUnits(value, number, units);
     if (NStr::IsBlank(number)) {
-        return "";
+        return kEmptyStr;
     } else if (NStr::Equal(units, "ft.") || NStr::Equal(units, "ft") || NStr::Equal(units, "feet") || NStr::Equal(units, "foot")) {
+        int precision = x_GetPrecision(number);
         double val = NStr::StringToDouble(number);
         val *= 0.3048;
-        NStr::NumericToString(number, val);
+        number = x_FormatWithPrecision(val, precision);
         units = "m";
     } 
     
@@ -2469,7 +2539,7 @@ string CSubSource::FixAltitude (const string& value)
         || NStr::Equal(units, "m")) {
         return number + " " + "m";
     } else {
-        return "";
+        return kEmptyStr;
     }
 }
 
@@ -2520,7 +2590,7 @@ static void s_InitializeCellLineContaminationMap(void)
 
 string CSubSource::CheckCellLine(const string& cell_line, const string& organism)
 {
-    string rval = "";
+    string rval;
 
     s_InitializeCellLineContaminationMap();
     string cell_line_search = cell_line;
@@ -2755,9 +2825,11 @@ static const char* const s_Countries[] = {
     "Ross Sea",
     "Russia",
     "Rwanda",
+    "Saint Barthelemy",
     "Saint Helena",
     "Saint Kitts and Nevis",
     "Saint Lucia",
+    "Saint Martin",
     "Saint Pierre and Miquelon",
     "Saint Vincent and the Grenadines",
     "Samoa",
@@ -2848,7 +2920,7 @@ bool CCountries::IsValid(const string& country)
     string name = country;
     size_t pos = country.find(':');
 
-    if ( pos != string::npos ) {
+    if ( pos != NPOS ) {
         if (pos == country.length() - 1) {
             return false;
         }
@@ -2871,7 +2943,7 @@ bool CCountries::IsValid(const string& country, bool& is_miscapitalized)
     string name = country;
     size_t pos = country.find(':');
 
-    if ( pos != string::npos ) {
+    if ( pos != NPOS ) {
         name = country.substr(0, pos);
         if (pos == country.length() - 1) {
             return false;
@@ -2910,7 +2982,7 @@ bool CCountries::WasValid(const string& country)
     string name = country;
     size_t pos = country.find(':');
 
-    if ( pos != string::npos ) {
+    if ( pos != NPOS ) {
         name = country.substr(0, pos);
     }
 
@@ -2924,7 +2996,7 @@ bool CCountries::WasValid(const string& country, bool& is_miscapitalized)
     string name = country;
     size_t pos = country.find(':');
 
-    if ( pos != string::npos ) {
+    if ( pos != NPOS ) {
         name = country.substr(0, pos);
     }
 
@@ -3081,7 +3153,6 @@ static const SStaticPair<const char*, const char*> s_map_country_name_fixes[] =
 {"HRV", "Croatia"},
 {"HTI", "Haiti"},
 {"HUN", "Hungary"},
-{"Hawaii", "USA: Hawaii"},
 {"Heard Island", "Heard Island and McDonald Islands: Heard Island"},
 {"Heard Island & McDonald Islands", "Heard Island and McDonald Islands"},
 {"IDN", "Indonesia"},
@@ -3309,6 +3380,11 @@ static const SStaticPair<const char*, const char*> s_map_country_name_fixes[] =
 
 DEFINE_STATIC_ARRAY_MAP(TCStringPairsMap,k_country_name_fixes, s_map_country_name_fixes);
 
+// to be expanded to include other states
+static const char* s_USAStates[] = {
+    "Hawaii"
+};
+
 string CCountries::CapitalizeFirstLetterOfEveryWord (const string &phrase)
 {
     vector<string> words;
@@ -3323,8 +3399,19 @@ string CCountries::WholeCountryFix(string country)
 {
     string new_country;
     TCStringPairsMap::const_iterator found = k_whole_country_fixes.find(NStr::ToLower(country).c_str());
-    if (found != k_whole_country_fixes.end())
+    if (found != k_whole_country_fixes.end()) {
         new_country = found->second;
+        return new_country;
+    }
+
+    const size_t num_states = sizeof(s_USAStates) / sizeof(s_USAStates[0]);
+    for (size_t i = 0; i < num_states; ++i) {
+        if (NStr::EqualNocase(s_USAStates[i], country)) {
+            new_country = "USA: " + CTempString(s_USAStates[i]);
+            break;
+        }
+    }
+
     return new_country;
 }
 
@@ -3355,7 +3442,7 @@ bool CCountries::ContainsMultipleCountryNames (const string &phrase)
     {
         string country(*c);
         size_t pos = NStr::FindNoCase(phrase,country);
-        while (pos != string::npos)
+        while (pos != NPOS)
         {
             if (!((pos+country.length()<phrase.length() && isalpha(phrase[pos+country.length()]))
                   || (pos > 0 && isalpha(phrase[pos-1]))
@@ -3399,12 +3486,12 @@ void CCountries::x_RemoveDelimitersFromEnds(string& val, bool except_paren)
             val = val.substr(0, val.length() - 1);
             any_found = true;
             NStr::TruncateSpacesInPlace(val);
-        } else if (NStr::EndsWith(val, "the") && val.length() > 3 && !isalpha(val.c_str()[val.length() - 4])) {
+        } else if (NStr::EndsWith(val, "the") && val.length() > 3 && !isalpha((unsigned char)val[val.length() - 4])) {
             val = val.substr(0, val.length() - 4);
             any_found = true;
         } else if (NStr::EndsWith(val, ".")) {
             size_t len = val.length();
-            if (len > 1 && isspace(val.c_str()[len - 2])) {
+            if (len > 1 && isspace((unsigned char)val[len - 2])) {
                 val = val.substr(0, val.length() - 1);
                 any_found = true;
                 NStr::TruncateSpacesInPlace(val);
@@ -3414,7 +3501,7 @@ void CCountries::x_RemoveDelimitersFromEnds(string& val, bool except_paren)
                 size_t pos = val.length() - 2;
                 size_t dist = 0;
                 while (dist < 4 && do_remove) {
-                    if (isspace(val.c_str()[pos]) || ispunct(val.c_str()[pos])) {
+                    if (isspace((unsigned char)val[pos]) || ispunct((unsigned char)val[pos])) {
                         do_remove = false;
                     }
                     pos--;
@@ -3438,12 +3525,12 @@ vector<string> CCountries::x_Tokenize(const string& val)
     vector<string>::iterator it = tokens.begin();
     while (it != tokens.end()) {
         size_t pos = NStr::Find(*it, ".");
-        if (pos != string::npos && pos > 3 && (*it).length() - pos > 4) {
+        if (pos != NPOS  &&  pos > 3 && (*it).length() - pos > 4) {
             string first = (*it).substr(0, pos);
             string remainder = (*it).substr(pos + 1);
             size_t space_pos = NStr::Find(first, " ");
             size_t len_to_space = first.length();
-            while (space_pos != string::npos) {
+            while (space_pos != NPOS) {
                 first = first.substr(space_pos + 1);
                 len_to_space = first.length();
                 space_pos = NStr::Find(first, " ");
@@ -3464,15 +3551,14 @@ vector<string> CCountries::x_Tokenize(const string& val)
 
 bool s_ContainsWholeWord(const string& test, const string& word, NStr::ECase case_sense)
 {
-    size_t pos = NStr::Find(test, word, 0, string::npos, NStr::eFirst, case_sense);
-    while (pos != string::npos) {
-        if ((pos == 0 || !isalpha(test.c_str()[pos - 1]))
-            && !isalpha(test.c_str()[pos + word.length()])) {
+    size_t pos = NStr::Find(test, word, 0, NPOS, NStr::eFirst, case_sense);
+    while (pos != NPOS) {
+        if ((pos == 0 || !isalpha((unsigned char)test[pos-1]))
+            && !isalpha((unsigned char)test[pos + word.length()])) {
             return true;
         }
-        pos = NStr::Find(test, word, pos + 1, string::npos, NStr::eFirst, case_sense);
+        pos = NStr::Find(test, word, pos + 1, NPOS, NStr::eFirst, case_sense);
     }
-
     return false;
 }
 
@@ -3495,11 +3581,10 @@ string CCountries::NewFixCountry (const string& test)
         if (IsValid(test)) {
             return test;
         } else {
-            return "";
+            return kEmptyStr;
         }
     }
 
-
     string input = test;
     if (NStr::StartsWith(input, "\"") && NStr::EndsWith(input, "\"")) {
         input = input.substr(1, input.length() - 2);
@@ -3609,8 +3694,7 @@ string CCountries::CountryFixupItem(const string &input, bool capitalize_after_c
     if (country_end_pos != NPOS)
     {
         SIZE_TYPE pos = country_end_pos;
-        while (country.c_str()[pos] == ',' || country.c_str()[pos] == ':' 
-               || isspace(country.c_str()[pos])) 
+        while (country[pos] == ','  ||  country[pos] == ':'  ||  isspace((unsigned char)country[pos])) 
         {
             pos++;
         }
@@ -4080,7 +4164,20 @@ void CSubSource::FixCapitalization()
         return;
     }
 
-    string new_val = FixCapitalization(GetSubtype(), GetName());
+    TSubtype subtype = GetSubtype();
+
+    if (subtype == CSubSource::eSubtype_sex) {
+        string upr = GetName();
+        string lwr = upr;
+        NStr::ToLower(lwr);
+        if (! NStr::Equal(upr, lwr)) {
+            SetName(lwr);
+        }
+    }
+
+    const string& name = GetName();
+
+    string new_val = FixCapitalization(subtype, name);
 
     if (!NStr::IsBlank(new_val)) {
         SetName(new_val);
@@ -4091,7 +4188,7 @@ void CSubSource::FixCapitalization()
 
 string CSubSource::AutoFix(TSubtype subtype, const string& value)
 {
-    string new_val = "";
+    string new_val;
     switch (subtype) {
         case CSubSource::eSubtype_country:
             new_val = CCountries::NewFixCountry(value);
@@ -4121,17 +4218,23 @@ void CSubSource::AutoFix()
         return;
     }
 
-    string new_val = AutoFix(GetSubtype(), GetName());
+    TSubtype subtype = GetSubtype();
+    string new_val = AutoFix(subtype, GetName());
 
     if (!NStr::IsBlank(new_val)) {
         SetName(new_val);
+    } else if (subtype == CSubSource::eSubtype_sex) {
+        string upr = GetName();
+        string lwr = upr;
+        NStr::ToLower(lwr);
+        if (! NStr::Equal(upr, lwr)) {
+            SetName(lwr);
+        }
     }
-
 }
    
 
 
-
 static const char * s_RemovableCultureNotes[] = {
  "[BankIt_uncultured16S_wizard]; [universal primers]; [tgge]",
  "[BankIt_uncultured16S_wizard]; [universal primers]; [dgge]",
@@ -4185,7 +4288,7 @@ void CSubSource::RemoveCultureNotes (string& value, bool is_species_level)
         string to_remove = s_RemovableCultureNotes[i];
         size_t remove_len = to_remove.length();
         size_t pos = NStr::FindNoCase(value, to_remove);
-        while (pos != string::npos) {
+        while (pos != NPOS) {
             size_t extra_len = strspn (value.c_str() + pos + remove_len, " ;");
             value = value.substr(0, pos) + value.substr(pos + remove_len + extra_len);
             pos = NStr::FindNoCase(value, to_remove);
@@ -4301,9 +4404,9 @@ CCountryExtreme::CCountryExtreme (const string & country_name, int min_x, int mi
 {
     m_Area = (1 + m_MaxY - m_MinY) * (1 + m_MaxX - m_MinX);
     size_t pos = NStr::Find(country_name, ":");
-    if (pos == string::npos) {
+    if (pos == NPOS) {
         m_Level0 = country_name;
-        m_Level1 = "";
+        m_Level1.clear();
     } else {
         m_Level0 = country_name.substr(0, pos);
         NStr::TruncateSpacesInPlace(m_Level0);
@@ -4436,22 +4539,12 @@ bool CCountryExtreme::PreferTo(const CCountryExtreme* other_block, const string
 
 
 CLatLonCountryId::CLatLonCountryId(float lat, float lon)
-{
-    m_Lat = lat;
-    m_Lon = lon;
-    m_FullGuess = "";
-    m_GuessCountry = "";
-    m_GuessProvince = "";
-    m_GuessWater = "";
-    m_ClosestFull = "";
-    m_ClosestCountry = "";
-    m_ClosestProvince = "";
-    m_ClosestWater = "";
-    m_ClaimedFull = "";
-    m_LandDistance = -1;
-    m_WaterDistance = -1;
-    m_ClaimedDistance = -1;
-}
+    : m_Lat(lat),
+      m_Lon(lon),
+      m_LandDistance(-1),
+      m_WaterDistance(-1),
+      m_ClaimedDistance(-1)
+{}
 
 
 CLatLonCountryId::TClassificationFlags CLatLonCountryId::Classify(string country, string province)
@@ -4519,32 +4612,29 @@ CLatLonCountryId::~CLatLonCountryId(void)
 
 
 #include "lat_lon_country.inc"
-
-static const int k_NumLatLonCountryText = sizeof (s_DefaultLatLonCountryText) / sizeof (char *);
+static const int k_NumLatLonCountryText = ArraySize(s_DefaultLatLonCountryText);
 
 #include "lat_lon_water.inc"
-
-static const int k_NumLatLonWaterText = sizeof (s_DefaultLatLonWaterText) / sizeof (char *);
+static const int k_NumLatLonWaterText = ArraySize(s_DefaultLatLonWaterText);
 
 void CLatLonCountryMap::x_InitFromDefaultList(const char * const *list, int num)
 {
       // initialize list of country lines
     m_CountryLineList.clear();
     m_Scale = 20.0;
-    string current_country = "";
+    string current_country;
 
     for (int i = 0; i < num; i++) {
-            const string& line = list[i];
-
-        if (line.c_str()[0] == '-') {
+        CTempString line = list[i];
+        if (line[0] == '-') {
             // skip comment
-        } else if (isalpha (line.c_str()[0])) {
+        } else if (isalpha ((unsigned char)line[0])) {
             current_country = line;
-        } else if (isdigit (line.c_str()[0])) {
+        } else if (isdigit ((unsigned char)line[0])) {
             m_Scale = NStr::StringToDouble(line);
         } else {          
             vector<string> tokens;
-              NStr::Tokenize(line, "\t", tokens);
+             NStr::Tokenize(line, "\t", tokens);
             if (tokens.size() > 3) {
                 double x = NStr::StringToDouble(tokens[1]);
                 for (size_t j = 2; j < tokens.size() - 1; j+=2) {
@@ -4570,7 +4660,7 @@ bool CLatLonCountryMap::x_InitFromFile(const string& filename)
         return false;
     } else {
         m_Scale = 20.0;
-        string current_country = "";
+        string current_country;
 
         // make sure to clear before using.  in this outer
         // scope in the interest of speed (avoid repeated 
@@ -4582,9 +4672,9 @@ bool CLatLonCountryMap::x_InitFromFile(const string& filename)
             CTempString line = *++*lr;
             if (line[0] == '-') {
                 // skip comment
-            } else if (isalpha (line[0])) {
+            } else if (isalpha ((unsigned char)line[0])) {
                 current_country = line;
-            } else if (isdigit (line[0])) {
+            } else if (isdigit ((unsigned char)line[0])) {
                 m_Scale = NStr::StringToDouble(line);
             } else {          
                 // NStr::Tokenize would be much simpler, but
@@ -5050,7 +5140,7 @@ bool CLatLonCountryMap::IsClosestToLatLon(const string& comp_country,
     // binary search to lowest lat
     size_t R = x_GetLatStartIndex(min_y);
 
-    string country = "";
+    string country;
     double closest = 0.0;
     int smallest_area = -1;
 
diff --git a/c++/src/objects/entrez2/Entrez2_id_list.cpp b/c++/src/objects/seqfeat/Trna_ext.cpp
similarity index 53%
copy from c++/src/objects/entrez2/Entrez2_id_list.cpp
copy to c++/src/objects/seqfeat/Trna_ext.cpp
index acd366d..254bb8d 100644
--- a/c++/src/objects/entrez2/Entrez2_id_list.cpp
+++ b/c++/src/objects/seqfeat/Trna_ext.cpp
@@ -1,4 +1,4 @@
-/* $Id: Entrez2_id_list.cpp 403742 2013-06-18 15:26:09Z grichenk $
+/* $Id: Trna_ext.cpp 500112 2016-05-02 15:52:06Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -30,17 +30,15 @@
  *
  * Remark:
  *   This code was originally generated by application DATATOOL
- *   using specifications from the ASN data definition file
- *   'entrez2.asn'.
+ *   using the following specifications:
+ *   'seqfeat.asn'.
  */
 
 // standard includes
-
-// generated includes
 #include <ncbi_pch.hpp>
-#include <objects/entrez2/Entrez2_id_list.hpp>
 
-#include <corelib/ncbi_safe_static.hpp>
+// generated includes
+#include <objects/seqfeat/Trna_ext.hpp>
 
 // generated classes
 
@@ -48,55 +46,62 @@ BEGIN_NCBI_SCOPE
 
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
-static const size_t kUidSize = 32; // bits
-const size_t        CEntrez2_id_list::sm_UidSize = kUidSize / 8; // bytes
-CSafeStatic<CEntrez2_id_list::TUids> s_EmptyList;
-
-CEntrez2_id_list::TUidIterator CEntrez2_id_list::GetUidIterator()
-{
-    return TUidIterator(SetUids(), kUidSize);
-}
-
-CEntrez2_id_list::TConstUidIterator
-CEntrez2_id_list::GetConstUidIterator() const
-{
-    if (CanGetUids()) {
-        return TConstUidIterator(GetUids(), kUidSize);
-    } else {
-        return TConstUidIterator(s_EmptyList.Get(), kUidSize);
-    }
-}
-
 // destructor
-CEntrez2_id_list::~CEntrez2_id_list(void)
+CTrna_ext::~CTrna_ext(void)
 {
 }
 
 
-void CEntrez2_id_list::Resize(size_t size)
+static const char *codonLetterExpand[] =
 {
-    SetUids().resize(sm_UidSize * size);
-    SetNum(size);
-}
+    "?", "A", "C", "AC",
+    "G", "AG", "CG", "ACG",
+    "T", "AT", "CT", "ACT",
+    "GT", "AGT", "CGT", "ACGT",
+    NULL
+};
 
 
-void CEntrez2_id_list::AssignUids(const vector<int>& uids)
+bool CTrna_ext::ParseDegenerateCodon(CTrna_ext & tRNA, const string & codon)
 {
-    Resize(uids.size());
+    const static string intToChr = "?ACMGRSVTWYHKDBN";
 
-    TUidIterator it = GetUidIterator();
-    ITERATE (vector<int>, iter, uids) {
-        *it++ = *iter;
+    if (codon.length() < 3) {
+        return false;
     }
-}
 
+    // the first two have to be real nucleotides
+    const string::size_type first_bad_char = codon.find_first_not_of("ACGT");
+    if (first_bad_char != string::npos && first_bad_char < 2) {
+        return false;
+    }
+
+    int idx = intToChr.find(codon[2]);
+    if (idx == (int)string::npos) return false;
+
+    const char *expanded_codon_letter = codonLetterExpand[idx];
+    const char *iter = expanded_codon_letter;
+    char ch = *iter;
+    int tRNA_codon_idx = 0;
+    string codon_copy = codon;
+    codon_copy.erase(3);
+    tRNA.SetCodon().clear();
+    while (*iter != '\0' && tRNA_codon_idx < 6) {
+        codon_copy[2] = ch;
+        tRNA.SetCodon().push_back(CGen_code_table::CodonToIndex(codon_copy)); // TODO: make sure Seq_code_iupacna
+
+        // prepare for next iteration
+        iter++;
+        ch = *iter;
+        tRNA_codon_idx++;
+    }
 
-// append an item to the list
-void push_back(int uid);
+    return true;
+}
 
 
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
 
-/* Original file checksum: lines: 61, chars: 1906, CRC32: 6647067f */
+/* Original file checksum: lines: 57, chars: 1721, CRC32: d561a0b8 */
diff --git a/c++/src/objects/seqfeat/ecnum_ambiguous.inc b/c++/src/objects/seqfeat/ecnum_ambiguous.inc
index 9c68845..8e7d179 100644
--- a/c++/src/objects/seqfeat/ecnum_ambiguous.inc
+++ b/c++/src/objects/seqfeat/ecnum_ambiguous.inc
@@ -1,4 +1,4 @@
-/*  $Id: ecnum_ambiguous.inc 453849 2014-12-08 18:54:49Z kans $
+/*  $Id: ecnum_ambiguous.inc 483918 2015-11-04 22:53:59Z kans $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -133,12 +133,18 @@ static const char* const kECNum_ambiguous[] = {
     "1.6.1.n	With NAD(+) or NADP(+) as acceptor",
     "1.6.2.-	With a heme protein as acceptor",
     "1.6.2.n	With a heme protein as acceptor",
-    "1.6.3.-	With a oxygen as acceptor",
-    "1.6.3.n	With a oxygen as acceptor",
+    "1.6.3.-	With oxygen as acceptor",
+    "1.6.3.n	With oxygen as acceptor",
+    "1.6.4.-	With a disulfide as acceptor",
+    "1.6.4.n	With a disulfide as acceptor",
     "1.6.5.-	With a quinone or similar compound as acceptor",
     "1.6.5.n	With a quinone or similar compound as acceptor",
     "1.6.6.-	With a nitrogenous group as acceptor",
     "1.6.6.n	With a nitrogenous group as acceptor",
+    "1.6.7.-	With a iron-sulfur protein as acceptor",
+    "1.6.7.n	With a iron-sulfur protein as acceptor",
+    "1.6.8.-	With a flavin as acceptor",
+    "1.6.8.n	With a flavin as acceptor",
     "1.6.99.-	With other acceptors",
     "1.6.99.n	With other acceptors",
     "1.7.-.-	Acting on other nitrogenous compounds as donors",
@@ -171,6 +177,8 @@ static const char* const kECNum_ambiguous[] = {
     "1.8.4.n	With a disulfide as acceptor",
     "1.8.5.-	With a quinone or similar compound as acceptor",
     "1.8.5.n	With a quinone or similar compound as acceptor",
+    "1.8.6.-	With an nitrogenous group as acceptor",
+    "1.8.6.n	With an nitrogenous group as acceptor",
     "1.8.7.-	With an iron-sulfur protein as acceptor",
     "1.8.7.n	With an iron-sulfur protein as acceptor",
     "1.8.98.-	With other, known, acceptors",
@@ -195,6 +203,8 @@ static const char* const kECNum_ambiguous[] = {
     "1.10.2.n	With a cytochrome as acceptor",
     "1.10.3.-	With oxygen as acceptor",
     "1.10.3.n	With oxygen as acceptor",
+    "1.10.5.-	With a quinone or related compound as acceptor",
+    "1.10.5.n	With a quinone or related compound as acceptor",
     "1.10.9.-	With a copper protein as acceptor",
     "1.10.9.n	With a copper protein as acceptor",
     "1.10.98.-	With other, known, acceptors",
@@ -207,8 +217,8 @@ static const char* const kECNum_ambiguous[] = {
     "1.11.1.n	Peroxidases",
     "1.11.2.-	With H(2)O(2) as acceptor, one oxygen atom of which is incorporated into the product",
     "1.11.2.n	With H(2)O(2) as acceptor, one oxygen atom of which is incorporated into the product",
-    "1.12.-.-	Acting on hydrogen as donor",
-    "1.12.n.n	Acting on hydrogen as donor",
+    "1.12.-.-	Acting on hydrogen as donors",
+    "1.12.n.n	Acting on hydrogen as donors",
     "1.12.1.-	With NAD(+) or NADP(+) as acceptor",
     "1.12.1.n	With NAD(+) or NADP(+) as acceptor",
     "1.12.2.-	With a cytochrome as acceptor",
@@ -217,20 +227,28 @@ static const char* const kECNum_ambiguous[] = {
     "1.12.5.n	With a quinone or similar compound as acceptor",
     "1.12.7.-	With an iron-sulfur protein as acceptor",
     "1.12.7.n	With an iron-sulfur protein as acceptor",
-    "1.12.98.-	With other known acceptors",
-    "1.12.98.n	With other known acceptors",
+    "1.12.98.-	With other, known, acceptors",
+    "1.12.98.n	With other, known, acceptors",
     "1.12.99.-	With other acceptors",
     "1.12.99.n	With other acceptors",
-    "1.13.-.-	Acting on single donors with incorporation of molecular oxygen",
-    "1.13.n.n	Acting on single donors with incorporation of molecular oxygen",
+    "1.13.-.-	Acting on single donors with incorporation of molecular oxygen (oxygenases). The oxygen incorporated need not be derived from O(2)",
+    "1.13.n.n	Acting on single donors with incorporation of molecular oxygen (oxygenases). The oxygen incorporated need not be derived from O(2)",
+    "1.13.1.-	With NADH or NADPH as one donor",
+    "1.13.1.n	With NADH or NADPH as one donor",
     "1.13.11.-	With incorporation of two atoms of oxygen",
     "1.13.11.n	With incorporation of two atoms of oxygen",
-    "1.13.12.-	With incorporation of one atom of oxygen",
-    "1.13.12.n	With incorporation of one atom of oxygen",
-    "1.13.99.-	Miscellaneous (requires further characterization)",
-    "1.13.99.n	Miscellaneous (requires further characterization)",
-    "1.14.-.-	Acting on paired donors, with incorporation or reduction of molecular oxygen",
-    "1.14.n.n	Acting on paired donors, with incorporation or reduction of molecular oxygen",
+    "1.13.12.-	With incorporation of one atom of oxygen (internal monooxygenases or internal mixed function oxidases)",
+    "1.13.12.n	With incorporation of one atom of oxygen (internal monooxygenases or internal mixed function oxidases)",
+    "1.13.99.-	Miscellaneous",
+    "1.13.99.n	Miscellaneous",
+    "1.14.-.-	Acting on paired donors, with incorporation or reduction of molecular oxygen. The oxygen incorporated need not be derived from O(2)",
+    "1.14.n.n	Acting on paired donors, with incorporation or reduction of molecular oxygen. The oxygen incorporated need not be derived from O(2)",
+    "1.14.1.-	With NADH or NADPH as one donor",
+    "1.14.1.n	With NADH or NADPH as one donor",
+    "1.14.2.-	With ascorbate as one donor",
+    "1.14.2.n	With ascorbate as one donor",
+    "1.14.3.-	With reduced pteridine as one donor",
+    "1.14.3.n	With reduced pteridine as one donor",
     "1.14.11.-	With 2-oxoglutarate as one donor, and incorporation of one atom each of oxygen into both donors",
     "1.14.11.n	With 2-oxoglutarate as one donor, and incorporation of one atom each of oxygen into both donors",
     "1.14.12.-	With NADH or NADPH as one donor, and incorporation of two atoms of oxygen into one donor",
@@ -239,8 +257,8 @@ static const char* const kECNum_ambiguous[] = {
     "1.14.13.n	With NADH or NADPH as one donor, and incorporation of one atom of oxygen",
     "1.14.14.-	With reduced flavin or flavoprotein as one donor, and incorporation of one atom of oxygen",
     "1.14.14.n	With reduced flavin or flavoprotein as one donor, and incorporation of one atom of oxygen",
-    "1.14.15.-	With a reduced iron-sulfur protein as one donor, and incorporation of one atom of oxygen",
-    "1.14.15.n	With a reduced iron-sulfur protein as one donor, and incorporation of one atom of oxygen",
+    "1.14.15.-	With reduced iron-sulfur protein as one donor, and incorporation of one atom of oxygen",
+    "1.14.15.n	With reduced iron-sulfur protein as one donor, and incorporation of one atom of oxygen",
     "1.14.16.-	With reduced pteridine as one donor, and incorporation of one atom of oxygen",
     "1.14.16.n	With reduced pteridine as one donor, and incorporation of one atom of oxygen",
     "1.14.17.-	With reduced ascorbate as one donor, and incorporation of one atom of oxygen",
@@ -253,8 +271,8 @@ static const char* const kECNum_ambiguous[] = {
     "1.14.20.n	With 2-oxoglutarate as one donor, and the other dehydrogenated",
     "1.14.21.-	With NADH or NADPH as one donor, and the other dehydrogenated",
     "1.14.21.n	With NADH or NADPH as one donor, and the other dehydrogenated",
-    "1.14.99.-	Miscellaneous (requires further characterization)",
-    "1.14.99.n	Miscellaneous (requires further characterization)",
+    "1.14.99.-	Miscellaneous",
+    "1.14.99.n	Miscellaneous",
     "1.15.-.-	Acting on superoxide as acceptor",
     "1.15.n.n	Acting on superoxide as acceptor",
     "1.15.1.-	Acting on superoxide as acceptor",
@@ -267,8 +285,8 @@ static const char* const kECNum_ambiguous[] = {
     "1.16.3.n	With oxygen as acceptor",
     "1.16.5.-	With a quinone or similar compound as acceptor",
     "1.16.5.n	With a quinone or similar compound as acceptor",
-    "1.16.8.-	With flavin as acceptor",
-    "1.16.8.n	With flavin as acceptor",
+    "1.16.8.-	With a flavin as acceptor",
+    "1.16.8.n	With a flavin as acceptor",
     "1.16.9.-	With a copper protein as acceptor",
     "1.16.9.n	With a copper protein as acceptor",
     "1.16.98.-	With other known acceptors",
@@ -287,14 +305,24 @@ static const char* const kECNum_ambiguous[] = {
     "1.17.5.n	With a quinone or similar compound as acceptor",
     "1.17.7.-	With an iron-sulfur protein as acceptor",
     "1.17.7.n	With an iron-sulfur protein as acceptor",
+    "1.17.98.-	With other, known, acceptors",
+    "1.17.98.n	With other, known, acceptors",
     "1.17.99.-	With other acceptors",
     "1.17.99.n	With other acceptors",
     "1.18.-.-	Acting on iron-sulfur proteins as donors",
     "1.18.n.n	Acting on iron-sulfur proteins as donors",
     "1.18.1.-	With NAD(+) or NADP(+) as acceptor",
     "1.18.1.n	With NAD(+) or NADP(+) as acceptor",
+    "1.18.2.-	With dinitrogen as acceptor",
+    "1.18.2.n	With dinitrogen as acceptor",
+    "1.18.3.-	With H(+) as acceptor",
+    "1.18.3.n	With H(+) as acceptor",
     "1.18.6.-	With dinitrogen as acceptor",
     "1.18.6.n	With dinitrogen as acceptor",
+    "1.18.96.-	With other, known, acceptors",
+    "1.18.96.n	With other, known, acceptors",
+    "1.18.99.-	With H(+) as acceptor",
+    "1.18.99.n	With H(+) as acceptor",
     "1.19.-.-	Acting on reduced flavodoxin as donor",
     "1.19.n.n	Acting on reduced flavodoxin as donor",
     "1.19.6.-	With dinitrogen as acceptor",
@@ -313,14 +341,16 @@ static const char* const kECNum_ambiguous[] = {
     "1.20.98.n	With other, known acceptors",
     "1.20.99.-	With other acceptors",
     "1.20.99.n	With other acceptors",
-    "1.21.-.-	Catalyzing the reaction X-H + Y-H = X-Y",
-    "1.21.n.n	Catalyzing the reaction X-H + Y-H = X-Y",
+    "1.21.-.-	Catalyzing the reaction X-H + Y-H = 'X-Y'",
+    "1.21.n.n	Catalyzing the reaction X-H + Y-H = 'X-Y'",
     "1.21.1.-	With NAD(+) or NADP(+) as acceptor",
     "1.21.1.n	With NAD(+) or NADP(+) as acceptor",
     "1.21.3.-	With oxygen as acceptor",
     "1.21.3.n	With oxygen as acceptor",
     "1.21.4.-	With a disulfide as acceptor",
     "1.21.4.n	With a disulfide as acceptor",
+    "1.21.98.-	With other, known acceptors",
+    "1.21.98.n	With other, known acceptors",
     "1.21.99.-	With other acceptors",
     "1.21.99.n	With other acceptors",
     "1.22.-.-	Acting on halogen in donors",
@@ -331,10 +361,22 @@ static const char* const kECNum_ambiguous[] = {
     "1.23.n.n	Reducing C-O-C group as acceptor",
     "1.23.1.-	With NADH or NADPH as donor",
     "1.23.1.n	With NADH or NADPH as donor",
+    "1.23.5.-	With a quinone or similar compound as acceptor",
+    "1.23.5.n	With a quinone or similar compound as acceptor",
     "1.97.-.-	Other oxidoreductases",
     "1.97.n.n	Other oxidoreductases",
-    "1.97.1.-	Sole sub-subclass for oxidoreductases that do not belong in the other subclasses",
-    "1.97.1.n	Sole sub-subclass for oxidoreductases that do not belong in the other subclasses",
+    "1.97.1.-	Other oxidoreductases",
+    "1.97.1.n	Other oxidoreductases",
+    "1.98.-.-	Enzymes using H(2) as reductant",
+    "1.98.n.n	Enzymes using H(2) as reductant",
+    "1.98.1.-	Other oxidoreductases",
+    "1.98.1.n	Other oxidoreductases",
+    "1.99.-.-	Other enzymes using O(2) as oxidant",
+    "1.99.n.n	Other enzymes using O(2) as oxidant",
+    "1.99.1.-	Hydroxylases",
+    "1.99.1.n	Hydroxylases",
+    "1.99.2.-	Oxygenases",
+    "1.99.2.n	Oxygenases",
     "2.-.-.-	Transferases",
     "2.n.n.n	Transferases",
     "2.1.-.-	Transferring one-carbon groups",
@@ -343,12 +385,12 @@ static const char* const kECNum_ambiguous[] = {
     "2.1.1.n	Methyltransferases",
     "2.1.2.-	Hydroxymethyl-, formyl- and related transferases",
     "2.1.2.n	Hydroxymethyl-, formyl- and related transferases",
-    "2.1.3.-	Carboxyl- and carbamoyltransferases",
-    "2.1.3.n	Carboxyl- and carbamoyltransferases",
+    "2.1.3.-	Carboxy- and carbamoyltransferases",
+    "2.1.3.n	Carboxy- and carbamoyltransferases",
     "2.1.4.-	Amidinotransferases",
     "2.1.4.n	Amidinotransferases",
-    "2.2.-.-	Transferring aldehyde or ketone residues",
-    "2.2.n.n	Transferring aldehyde or ketone residues",
+    "2.2.-.-	Transferring aldehyde or ketonic groups",
+    "2.2.n.n	Transferring aldehyde or ketonic groups",
     "2.2.1.-	Transketolases and transaldolases",
     "2.2.1.n	Transketolases and transaldolases",
     "2.3.-.-	Acyltransferases",
@@ -357,8 +399,8 @@ static const char* const kECNum_ambiguous[] = {
     "2.3.1.n	Transferring groups other than amino-acyl groups",
     "2.3.2.-	Aminoacyltransferases",
     "2.3.2.n	Aminoacyltransferases",
-    "2.3.3.-	Acyl groups converted into alkyl on transfer",
-    "2.3.3.n	Acyl groups converted into alkyl on transfer",
+    "2.3.3.-	Acyl groups converted into alkyl groups on transfer",
+    "2.3.3.n	Acyl groups converted into alkyl groups on transfer",
     "2.4.-.-	Glycosyltransferases",
     "2.4.n.n	Glycosyltransferases",
     "2.4.1.-	Hexosyltransferases",
@@ -373,22 +415,26 @@ static const char* const kECNum_ambiguous[] = {
     "2.5.1.n	Transferring alkyl or aryl groups, other than methyl groups",
     "2.6.-.-	Transferring nitrogenous groups",
     "2.6.n.n	Transferring nitrogenous groups",
-    "2.6.1.-	Transaminases (aminotransferases)",
-    "2.6.1.n	Transaminases (aminotransferases)",
+    "2.6.1.-	Transaminases",
+    "2.6.1.n	Transaminases",
+    "2.6.2.-	Amidinotransferases",
+    "2.6.2.n	Amidinotransferases",
     "2.6.3.-	Oximinotransferases",
     "2.6.3.n	Oximinotransferases",
     "2.6.99.-	Transferring other nitrogenous groups",
     "2.6.99.n	Transferring other nitrogenous groups",
-    "2.7.-.-	Transferring phosphorous-containing groups",
-    "2.7.n.n	Transferring phosphorous-containing groups",
+    "2.7.-.-	Transferring phosphorus-containing groups",
+    "2.7.n.n	Transferring phosphorus-containing groups",
     "2.7.1.-	Phosphotransferases with an alcohol group as acceptor",
     "2.7.1.n	Phosphotransferases with an alcohol group as acceptor",
-    "2.7.2.-	Phosphotransferases with a carboxyl group as acceptor",
-    "2.7.2.n	Phosphotransferases with a carboxyl group as acceptor",
+    "2.7.2.-	Phosphotransferases with a carboxy group as acceptor",
+    "2.7.2.n	Phosphotransferases with a carboxy group as acceptor",
     "2.7.3.-	Phosphotransferases with a nitrogenous group as acceptor",
     "2.7.3.n	Phosphotransferases with a nitrogenous group as acceptor",
     "2.7.4.-	Phosphotransferases with a phosphate group as acceptor",
     "2.7.4.n	Phosphotransferases with a phosphate group as acceptor",
+    "2.7.5.-	Phosphotransferases with regeneration of donors, apparently catalyzing intramolecular transfers",
+    "2.7.5.n	Phosphotransferases with regeneration of donors, apparently catalyzing intramolecular transfers",
     "2.7.6.-	Diphosphotransferases",
     "2.7.6.n	Diphosphotransferases",
     "2.7.7.-	Nucleotidyltransferases",
@@ -455,40 +501,56 @@ static const char* const kECNum_ambiguous[] = {
     "3.1.13.n	Exoribonucleases producing 5'-phosphomonoesters",
     "3.1.14.-	Exoribonucleases producing 3'-phosphomonoesters",
     "3.1.14.n	Exoribonucleases producing 3'-phosphomonoesters",
-    "3.1.15.-	Exonucleases active with either ribo- or deoxyribonucleic acid and producing 5'-phosphomonoesters",
-    "3.1.15.n	Exonucleases active with either ribo- or deoxyribonucleic acid and producing 5'-phosphomonoesters",
-    "3.1.16.-	Exonucleases active with either ribo- or deoxyribonucleic acid and producing 3'-phosphomonoesters",
-    "3.1.16.n	Exonucleases active with either ribo- or deoxyribonucleic acid and producing 3'-phosphomonoesters",
+    "3.1.15.-	Exonucleases active with either ribo- or deoxyribonucleic acids and producing 5'-phosphomonoesters",
+    "3.1.15.n	Exonucleases active with either ribo- or deoxyribonucleic acids and producing 5'-phosphomonoesters",
+    "3.1.16.-	Exonucleases active with either ribo- or deoxyribonucleic acids and producing 3'-phosphomonoesters",
+    "3.1.16.n	Exonucleases active with either ribo- or deoxyribonucleic acids and producing 3'-phosphomonoesters",
     "3.1.21.-	Endodeoxyribonucleases producing 5'-phosphomonoesters",
     "3.1.21.n	Endodeoxyribonucleases producing 5'-phosphomonoesters",
     "3.1.22.-	Endodeoxyribonucleases producing other than 5'-phosphomonoesters",
     "3.1.22.n	Endodeoxyribonucleases producing other than 5'-phosphomonoesters",
+    "3.1.23.-	Site specific endodeoxyribonucleases: cleavage is sequence specific",
+    "3.1.23.n	Site specific endodeoxyribonucleases: cleavage is sequence specific",
+    "3.1.24.-	Site specific endodeoxyribonucleases: cleavage is not sequence specific",
+    "3.1.24.n	Site specific endodeoxyribonucleases: cleavage is not sequence specific",
     "3.1.25.-	Site-specific endodeoxyribonucleases specific for altered bases",
     "3.1.25.n	Site-specific endodeoxyribonucleases specific for altered bases",
     "3.1.26.-	Endoribonucleases producing 5'-phosphomonoesters",
     "3.1.26.n	Endoribonucleases producing 5'-phosphomonoesters",
     "3.1.27.-	Endoribonucleases producing other than 5'-phosphomonoesters",
     "3.1.27.n	Endoribonucleases producing other than 5'-phosphomonoesters",
-    "3.1.30.-	Endoribonucleases active with either ribo- or deoxyribonucleic acid and producing 5'-phosphomonoesters",
-    "3.1.30.n	Endoribonucleases active with either ribo- or deoxyribonucleic acid and producing 5'-phosphomonoesters",
-    "3.1.31.-	Endoribonucleases active with either ribo- or deoxyribonucleic acid and producing 3'-phosphomonoesters",
-    "3.1.31.n	Endoribonucleases active with either ribo- or deoxyribonucleic acid and producing 3'-phosphomonoesters",
+    "3.1.30.-	Endoribonucleases active with either ribo- or deoxyribonucleic acids and producing 5'-phosphomonoesters",
+    "3.1.30.n	Endoribonucleases active with either ribo- or deoxyribonucleic acids and producing 5'-phosphomonoesters",
+    "3.1.31.-	Endoribonucleases active with either ribo- or deoxyribonucleic acids and producing 3'-phosphomonoesters",
+    "3.1.31.n	Endoribonucleases active with either ribo- or deoxyribonucleic acids and producing 3'-phosphomonoesters",
     "3.2.-.-	Glycosylases",
     "3.2.n.n	Glycosylases",
     "3.2.1.-	Glycosidases, i.e. enzymes hydrolyzing O- and S-glycosyl compounds",
     "3.2.1.n	Glycosidases, i.e. enzymes hydrolyzing O- and S-glycosyl compounds",
     "3.2.2.-	Hydrolyzing N-glycosyl compounds",
     "3.2.2.n	Hydrolyzing N-glycosyl compounds",
+    "3.2.3.-	Hydrolyzing S-glycosyl compounds",
+    "3.2.3.n	Hydrolyzing S-glycosyl compounds",
     "3.3.-.-	Acting on ether bonds",
     "3.3.n.n	Acting on ether bonds",
     "3.3.1.-	Thioether and trialkylsulfonium hydrolases",
     "3.3.1.n	Thioether and trialkylsulfonium hydrolases",
     "3.3.2.-	Ether hydrolases",
     "3.3.2.n	Ether hydrolases",
-    "3.4.-.-	Acting on peptide bonds (peptide hydrolases)",
-    "3.4.n.n	Acting on peptide bonds (peptide hydrolases)",
+    "3.4.-.-	Acting on peptide bonds (peptidases)",
+    "3.4.n.n	Acting on peptide bonds (peptidases)",
+    "3.4.1.-	alpha-Amino-acyl-peptide hydrolases",
+    "3.4.1.n	alpha-Amino-acyl-peptide hydrolases",
+    "3.4.2.-	Peptidyl-amino-acid hydrolases",
+    "3.4.2.n	Peptidyl-amino-acid hydrolases",
+    "3.4.3.-	Dipeptide hydrolases",
+    "3.4.3.n	Dipeptide hydrolases",
+    "3.4.4.-	Peptidyl peptide hydrolases",
+    "3.4.4.n	Peptidyl peptide hydrolases",
     "3.4.11.-	Aminopeptidases",
     "3.4.11.n	Aminopeptidases",
+    "3.4.12.-	Peptidylamino-acid hydrolases or acylamino-acid hydrolases",
+    "3.4.12.n	Peptidylamino-acid hydrolases or acylamino-acid hydrolases",
     "3.4.13.-	Dipeptidases",
     "3.4.13.n	Dipeptidases",
     "3.4.14.-	Dipeptidyl-peptidases and tripeptidyl-peptidases",
@@ -531,14 +593,14 @@ static const char* const kECNum_ambiguous[] = {
     "3.5.99.n	In other compounds",
     "3.6.-.-	Acting on acid anhydrides",
     "3.6.n.n	Acting on acid anhydrides",
-    "3.6.1.-	In phosphorous-containing anhydrides",
-    "3.6.1.n	In phosphorous-containing anhydrides",
+    "3.6.1.-	In phosphorus-containing anhydrides",
+    "3.6.1.n	In phosphorus-containing anhydrides",
     "3.6.2.-	In sulfonyl-containing anhydrides",
     "3.6.2.n	In sulfonyl-containing anhydrides",
     "3.6.3.-	Acting on acid anhydrides; catalyzing transmembrane movement of substances",
     "3.6.3.n	Acting on acid anhydrides; catalyzing transmembrane movement of substances",
-    "3.6.4.-	Acting on acid anhydrides; involved in cellular and subcellular movement",
-    "3.6.4.n	Acting on acid anhydrides; involved in cellular and subcellular movement",
+    "3.6.4.-	Acting on ATP; involved in cellular and subcellular movement",
+    "3.6.4.n	Acting on ATP; involved in cellular and subcellular movement",
     "3.6.5.-	Acting on GTP; involved in cellular and subcellular movement",
     "3.6.5.n	Acting on GTP; involved in cellular and subcellular movement",
     "3.7.-.-	Acting on carbon-carbon bonds",
@@ -549,6 +611,8 @@ static const char* const kECNum_ambiguous[] = {
     "3.8.n.n	Acting on halide bonds",
     "3.8.1.-	In C-halide compounds",
     "3.8.1.n	In C-halide compounds",
+    "3.8.2.-	In P-halide compounds",
+    "3.8.2.n	In P-halide compounds",
     "3.9.-.-	Acting on phosphorus-nitrogen bonds",
     "3.9.n.n	Acting on phosphorus-nitrogen bonds",
     "3.9.1.-	Acting on phosphorus-nitrogen bonds",
@@ -619,8 +683,8 @@ static const char* const kECNum_ambiguous[] = {
     "4.7.1.n	Carbon-phosphorus lyases",
     "4.99.-.-	Other lyases",
     "4.99.n.n	Other lyases",
-    "4.99.1.-	Sole sub-subclass for lyases that do not belong in the other subclasses",
-    "4.99.1.n	Sole sub-subclass for lyases that do not belong in the other subclasses",
+    "4.99.1.-	Other lyases",
+    "4.99.1.n	Other lyases",
     "5.-.-.-	Isomerases",
     "5.n.n.n	Isomerases",
     "5.1.-.-	Racemases and epimerases",
@@ -635,22 +699,22 @@ static const char* const kECNum_ambiguous[] = {
     "5.1.99.n	Acting on other compounds",
     "5.2.-.-	Cis-trans-isomerases",
     "5.2.n.n	Cis-trans-isomerases",
-    "5.2.1.-	Cis-trans Isomerases",
-    "5.2.1.n	Cis-trans Isomerases",
+    "5.2.1.-	Cis-trans isomerases",
+    "5.2.1.n	Cis-trans isomerases",
     "5.3.-.-	Intramolecular oxidoreductases",
     "5.3.n.n	Intramolecular oxidoreductases",
-    "5.3.1.-	Interconverting aldoses and ketoses, and related compounds",
-    "5.3.1.n	Interconverting aldoses and ketoses, and related compounds",
-    "5.3.2.-	Interconverting keto- and enol- groups",
-    "5.3.2.n	Interconverting keto- and enol- groups",
-    "5.3.3.-	Transposing C==C bonds",
-    "5.3.3.n	Transposing C==C bonds",
+    "5.3.1.-	Interconverting aldoses and ketoses",
+    "5.3.1.n	Interconverting aldoses and ketoses",
+    "5.3.2.-	Interconverting keto- and enol-groups",
+    "5.3.2.n	Interconverting keto- and enol-groups",
+    "5.3.3.-	Transposing C=C bonds",
+    "5.3.3.n	Transposing C=C bonds",
     "5.3.4.-	Transposing S-S bonds",
     "5.3.4.n	Transposing S-S bonds",
     "5.3.99.-	Other intramolecular oxidoreductases",
     "5.3.99.n	Other intramolecular oxidoreductases",
-    "5.4.-.-	Intramolecular transferases (mutases)",
-    "5.4.n.n	Intramolecular transferases (mutases)",
+    "5.4.-.-	Intramolecular transferases",
+    "5.4.n.n	Intramolecular transferases",
     "5.4.1.-	Transferring acyl groups",
     "5.4.1.n	Transferring acyl groups",
     "5.4.2.-	Phosphotransferases (phosphomutases)",
@@ -667,8 +731,8 @@ static const char* const kECNum_ambiguous[] = {
     "5.5.1.n	Intramolecular lyases",
     "5.99.-.-	Other isomerases",
     "5.99.n.n	Other isomerases",
-    "5.99.1.-	Sole sub-subclass for isomerases that do not belong in the other subclasses",
-    "5.99.1.n	Sole sub-subclass for isomerases that do not belong in the other subclasses",
+    "5.99.1.-	Other isomerases",
+    "5.99.1.n	Other isomerases",
     "6.-.-.-	Ligases",
     "6.n.n.n	Ligases",
     "6.1.-.-	Forming carbon-oxygen bonds",
@@ -683,8 +747,8 @@ static const char* const kECNum_ambiguous[] = {
     "6.2.1.n	Acid--thiol ligases",
     "6.3.-.-	Forming carbon-nitrogen bonds",
     "6.3.n.n	Forming carbon-nitrogen bonds",
-    "6.3.1.-	Acid--ammonia (or amide) ligases (amide synthases)",
-    "6.3.1.n	Acid--ammonia (or amide) ligases (amide synthases)",
+    "6.3.1.-	Acid--ammonia (or amine) ligases (amide synthases)",
+    "6.3.1.n	Acid--ammonia (or amine) ligases (amide synthases)",
     "6.3.2.-	Acid--amino-acid ligases (peptide synthases)",
     "6.3.2.n	Acid--amino-acid ligases (peptide synthases)",
     "6.3.3.-	Cyclo-ligases",
@@ -695,12 +759,12 @@ static const char* const kECNum_ambiguous[] = {
     "6.3.5.n	Carbon--nitrogen ligases with glutamine as amido-N-donor",
     "6.4.-.-	Forming carbon-carbon bonds",
     "6.4.n.n	Forming carbon-carbon bonds",
-    "6.4.1.-	Ligases that form carbon-carbon bonds",
-    "6.4.1.n	Ligases that form carbon-carbon bonds",
+    "6.4.1.-	Forming carbon-carbon bonds",
+    "6.4.1.n	Forming carbon-carbon bonds",
     "6.5.-.-	Forming phosphoric ester bonds",
     "6.5.n.n	Forming phosphoric ester bonds",
-    "6.5.1.-	Ligases that form phosphoric-ester bonds",
-    "6.5.1.n	Ligases that form phosphoric-ester bonds",
+    "6.5.1.-	Forming phosphoric ester bonds",
+    "6.5.1.n	Forming phosphoric ester bonds",
     "6.6.-.-	Forming nitrogen-metal bonds",
     "6.6.n.n	Forming nitrogen-metal bonds",
     "6.6.1.-	Forming coordination complexes",
diff --git a/c++/src/objects/seqfeat/ecnum_ambiguous.txt b/c++/src/objects/seqfeat/ecnum_ambiguous.txt
index b674b9d..d8d761a 100644
--- a/c++/src/objects/seqfeat/ecnum_ambiguous.txt
+++ b/c++/src/objects/seqfeat/ecnum_ambiguous.txt
@@ -100,12 +100,18 @@
 1.6.1.n	With NAD(+) or NADP(+) as acceptor
 1.6.2.-	With a heme protein as acceptor
 1.6.2.n	With a heme protein as acceptor
-1.6.3.-	With a oxygen as acceptor
-1.6.3.n	With a oxygen as acceptor
+1.6.3.-	With oxygen as acceptor
+1.6.3.n	With oxygen as acceptor
+1.6.4.-	With a disulfide as acceptor
+1.6.4.n	With a disulfide as acceptor
 1.6.5.-	With a quinone or similar compound as acceptor
 1.6.5.n	With a quinone or similar compound as acceptor
 1.6.6.-	With a nitrogenous group as acceptor
 1.6.6.n	With a nitrogenous group as acceptor
+1.6.7.-	With a iron-sulfur protein as acceptor
+1.6.7.n	With a iron-sulfur protein as acceptor
+1.6.8.-	With a flavin as acceptor
+1.6.8.n	With a flavin as acceptor
 1.6.99.-	With other acceptors
 1.6.99.n	With other acceptors
 1.7.-.-	Acting on other nitrogenous compounds as donors
@@ -138,6 +144,8 @@
 1.8.4.n	With a disulfide as acceptor
 1.8.5.-	With a quinone or similar compound as acceptor
 1.8.5.n	With a quinone or similar compound as acceptor
+1.8.6.-	With an nitrogenous group as acceptor
+1.8.6.n	With an nitrogenous group as acceptor
 1.8.7.-	With an iron-sulfur protein as acceptor
 1.8.7.n	With an iron-sulfur protein as acceptor
 1.8.98.-	With other, known, acceptors
@@ -162,6 +170,8 @@
 1.10.2.n	With a cytochrome as acceptor
 1.10.3.-	With oxygen as acceptor
 1.10.3.n	With oxygen as acceptor
+1.10.5.-	With a quinone or related compound as acceptor
+1.10.5.n	With a quinone or related compound as acceptor
 1.10.9.-	With a copper protein as acceptor
 1.10.9.n	With a copper protein as acceptor
 1.10.98.-	With other, known, acceptors
@@ -174,8 +184,8 @@
 1.11.1.n	Peroxidases
 1.11.2.-	With H(2)O(2) as acceptor, one oxygen atom of which is incorporated into the product
 1.11.2.n	With H(2)O(2) as acceptor, one oxygen atom of which is incorporated into the product
-1.12.-.-	Acting on hydrogen as donor
-1.12.n.n	Acting on hydrogen as donor
+1.12.-.-	Acting on hydrogen as donors
+1.12.n.n	Acting on hydrogen as donors
 1.12.1.-	With NAD(+) or NADP(+) as acceptor
 1.12.1.n	With NAD(+) or NADP(+) as acceptor
 1.12.2.-	With a cytochrome as acceptor
@@ -184,20 +194,28 @@
 1.12.5.n	With a quinone or similar compound as acceptor
 1.12.7.-	With an iron-sulfur protein as acceptor
 1.12.7.n	With an iron-sulfur protein as acceptor
-1.12.98.-	With other known acceptors
-1.12.98.n	With other known acceptors
+1.12.98.-	With other, known, acceptors
+1.12.98.n	With other, known, acceptors
 1.12.99.-	With other acceptors
 1.12.99.n	With other acceptors
-1.13.-.-	Acting on single donors with incorporation of molecular oxygen
-1.13.n.n	Acting on single donors with incorporation of molecular oxygen
+1.13.-.-	Acting on single donors with incorporation of molecular oxygen (oxygenases). The oxygen incorporated need not be derived from O(2)
+1.13.n.n	Acting on single donors with incorporation of molecular oxygen (oxygenases). The oxygen incorporated need not be derived from O(2)
+1.13.1.-	With NADH or NADPH as one donor
+1.13.1.n	With NADH or NADPH as one donor
 1.13.11.-	With incorporation of two atoms of oxygen
 1.13.11.n	With incorporation of two atoms of oxygen
-1.13.12.-	With incorporation of one atom of oxygen
-1.13.12.n	With incorporation of one atom of oxygen
-1.13.99.-	Miscellaneous (requires further characterization)
-1.13.99.n	Miscellaneous (requires further characterization)
-1.14.-.-	Acting on paired donors, with incorporation or reduction of molecular oxygen
-1.14.n.n	Acting on paired donors, with incorporation or reduction of molecular oxygen
+1.13.12.-	With incorporation of one atom of oxygen (internal monooxygenases or internal mixed function oxidases)
+1.13.12.n	With incorporation of one atom of oxygen (internal monooxygenases or internal mixed function oxidases)
+1.13.99.-	Miscellaneous
+1.13.99.n	Miscellaneous
+1.14.-.-	Acting on paired donors, with incorporation or reduction of molecular oxygen. The oxygen incorporated need not be derived from O(2)
+1.14.n.n	Acting on paired donors, with incorporation or reduction of molecular oxygen. The oxygen incorporated need not be derived from O(2)
+1.14.1.-	With NADH or NADPH as one donor
+1.14.1.n	With NADH or NADPH as one donor
+1.14.2.-	With ascorbate as one donor
+1.14.2.n	With ascorbate as one donor
+1.14.3.-	With reduced pteridine as one donor
+1.14.3.n	With reduced pteridine as one donor
 1.14.11.-	With 2-oxoglutarate as one donor, and incorporation of one atom each of oxygen into both donors
 1.14.11.n	With 2-oxoglutarate as one donor, and incorporation of one atom each of oxygen into both donors
 1.14.12.-	With NADH or NADPH as one donor, and incorporation of two atoms of oxygen into one donor
@@ -206,8 +224,8 @@
 1.14.13.n	With NADH or NADPH as one donor, and incorporation of one atom of oxygen
 1.14.14.-	With reduced flavin or flavoprotein as one donor, and incorporation of one atom of oxygen
 1.14.14.n	With reduced flavin or flavoprotein as one donor, and incorporation of one atom of oxygen
-1.14.15.-	With a reduced iron-sulfur protein as one donor, and incorporation of one atom of oxygen
-1.14.15.n	With a reduced iron-sulfur protein as one donor, and incorporation of one atom of oxygen
+1.14.15.-	With reduced iron-sulfur protein as one donor, and incorporation of one atom of oxygen
+1.14.15.n	With reduced iron-sulfur protein as one donor, and incorporation of one atom of oxygen
 1.14.16.-	With reduced pteridine as one donor, and incorporation of one atom of oxygen
 1.14.16.n	With reduced pteridine as one donor, and incorporation of one atom of oxygen
 1.14.17.-	With reduced ascorbate as one donor, and incorporation of one atom of oxygen
@@ -220,8 +238,8 @@
 1.14.20.n	With 2-oxoglutarate as one donor, and the other dehydrogenated
 1.14.21.-	With NADH or NADPH as one donor, and the other dehydrogenated
 1.14.21.n	With NADH or NADPH as one donor, and the other dehydrogenated
-1.14.99.-	Miscellaneous (requires further characterization)
-1.14.99.n	Miscellaneous (requires further characterization)
+1.14.99.-	Miscellaneous
+1.14.99.n	Miscellaneous
 1.15.-.-	Acting on superoxide as acceptor
 1.15.n.n	Acting on superoxide as acceptor
 1.15.1.-	Acting on superoxide as acceptor
@@ -234,8 +252,8 @@
 1.16.3.n	With oxygen as acceptor
 1.16.5.-	With a quinone or similar compound as acceptor
 1.16.5.n	With a quinone or similar compound as acceptor
-1.16.8.-	With flavin as acceptor
-1.16.8.n	With flavin as acceptor
+1.16.8.-	With a flavin as acceptor
+1.16.8.n	With a flavin as acceptor
 1.16.9.-	With a copper protein as acceptor
 1.16.9.n	With a copper protein as acceptor
 1.16.98.-	With other known acceptors
@@ -254,14 +272,24 @@
 1.17.5.n	With a quinone or similar compound as acceptor
 1.17.7.-	With an iron-sulfur protein as acceptor
 1.17.7.n	With an iron-sulfur protein as acceptor
+1.17.98.-	With other, known, acceptors
+1.17.98.n	With other, known, acceptors
 1.17.99.-	With other acceptors
 1.17.99.n	With other acceptors
 1.18.-.-	Acting on iron-sulfur proteins as donors
 1.18.n.n	Acting on iron-sulfur proteins as donors
 1.18.1.-	With NAD(+) or NADP(+) as acceptor
 1.18.1.n	With NAD(+) or NADP(+) as acceptor
+1.18.2.-	With dinitrogen as acceptor
+1.18.2.n	With dinitrogen as acceptor
+1.18.3.-	With H(+) as acceptor
+1.18.3.n	With H(+) as acceptor
 1.18.6.-	With dinitrogen as acceptor
 1.18.6.n	With dinitrogen as acceptor
+1.18.96.-	With other, known, acceptors
+1.18.96.n	With other, known, acceptors
+1.18.99.-	With H(+) as acceptor
+1.18.99.n	With H(+) as acceptor
 1.19.-.-	Acting on reduced flavodoxin as donor
 1.19.n.n	Acting on reduced flavodoxin as donor
 1.19.6.-	With dinitrogen as acceptor
@@ -280,14 +308,16 @@
 1.20.98.n	With other, known acceptors
 1.20.99.-	With other acceptors
 1.20.99.n	With other acceptors
-1.21.-.-	Catalyzing the reaction X-H + Y-H = X-Y
-1.21.n.n	Catalyzing the reaction X-H + Y-H = X-Y
+1.21.-.-	Catalyzing the reaction X-H + Y-H = 'X-Y'
+1.21.n.n	Catalyzing the reaction X-H + Y-H = 'X-Y'
 1.21.1.-	With NAD(+) or NADP(+) as acceptor
 1.21.1.n	With NAD(+) or NADP(+) as acceptor
 1.21.3.-	With oxygen as acceptor
 1.21.3.n	With oxygen as acceptor
 1.21.4.-	With a disulfide as acceptor
 1.21.4.n	With a disulfide as acceptor
+1.21.98.-	With other, known acceptors
+1.21.98.n	With other, known acceptors
 1.21.99.-	With other acceptors
 1.21.99.n	With other acceptors
 1.22.-.-	Acting on halogen in donors
@@ -298,10 +328,22 @@
 1.23.n.n	Reducing C-O-C group as acceptor
 1.23.1.-	With NADH or NADPH as donor
 1.23.1.n	With NADH or NADPH as donor
+1.23.5.-	With a quinone or similar compound as acceptor
+1.23.5.n	With a quinone or similar compound as acceptor
 1.97.-.-	Other oxidoreductases
 1.97.n.n	Other oxidoreductases
-1.97.1.-	Sole sub-subclass for oxidoreductases that do not belong in the other subclasses
-1.97.1.n	Sole sub-subclass for oxidoreductases that do not belong in the other subclasses
+1.97.1.-	Other oxidoreductases
+1.97.1.n	Other oxidoreductases
+1.98.-.-	Enzymes using H(2) as reductant
+1.98.n.n	Enzymes using H(2) as reductant
+1.98.1.-	Other oxidoreductases
+1.98.1.n	Other oxidoreductases
+1.99.-.-	Other enzymes using O(2) as oxidant
+1.99.n.n	Other enzymes using O(2) as oxidant
+1.99.1.-	Hydroxylases
+1.99.1.n	Hydroxylases
+1.99.2.-	Oxygenases
+1.99.2.n	Oxygenases
 2.-.-.-	Transferases
 2.n.n.n	Transferases
 2.1.-.-	Transferring one-carbon groups
@@ -310,12 +352,12 @@
 2.1.1.n	Methyltransferases
 2.1.2.-	Hydroxymethyl-, formyl- and related transferases
 2.1.2.n	Hydroxymethyl-, formyl- and related transferases
-2.1.3.-	Carboxyl- and carbamoyltransferases
-2.1.3.n	Carboxyl- and carbamoyltransferases
+2.1.3.-	Carboxy- and carbamoyltransferases
+2.1.3.n	Carboxy- and carbamoyltransferases
 2.1.4.-	Amidinotransferases
 2.1.4.n	Amidinotransferases
-2.2.-.-	Transferring aldehyde or ketone residues
-2.2.n.n	Transferring aldehyde or ketone residues
+2.2.-.-	Transferring aldehyde or ketonic groups
+2.2.n.n	Transferring aldehyde or ketonic groups
 2.2.1.-	Transketolases and transaldolases
 2.2.1.n	Transketolases and transaldolases
 2.3.-.-	Acyltransferases
@@ -324,8 +366,8 @@
 2.3.1.n	Transferring groups other than amino-acyl groups
 2.3.2.-	Aminoacyltransferases
 2.3.2.n	Aminoacyltransferases
-2.3.3.-	Acyl groups converted into alkyl on transfer
-2.3.3.n	Acyl groups converted into alkyl on transfer
+2.3.3.-	Acyl groups converted into alkyl groups on transfer
+2.3.3.n	Acyl groups converted into alkyl groups on transfer
 2.4.-.-	Glycosyltransferases
 2.4.n.n	Glycosyltransferases
 2.4.1.-	Hexosyltransferases
@@ -340,22 +382,26 @@
 2.5.1.n	Transferring alkyl or aryl groups, other than methyl groups
 2.6.-.-	Transferring nitrogenous groups
 2.6.n.n	Transferring nitrogenous groups
-2.6.1.-	Transaminases (aminotransferases)
-2.6.1.n	Transaminases (aminotransferases)
+2.6.1.-	Transaminases
+2.6.1.n	Transaminases
+2.6.2.-	Amidinotransferases
+2.6.2.n	Amidinotransferases
 2.6.3.-	Oximinotransferases
 2.6.3.n	Oximinotransferases
 2.6.99.-	Transferring other nitrogenous groups
 2.6.99.n	Transferring other nitrogenous groups
-2.7.-.-	Transferring phosphorous-containing groups
-2.7.n.n	Transferring phosphorous-containing groups
+2.7.-.-	Transferring phosphorus-containing groups
+2.7.n.n	Transferring phosphorus-containing groups
 2.7.1.-	Phosphotransferases with an alcohol group as acceptor
 2.7.1.n	Phosphotransferases with an alcohol group as acceptor
-2.7.2.-	Phosphotransferases with a carboxyl group as acceptor
-2.7.2.n	Phosphotransferases with a carboxyl group as acceptor
+2.7.2.-	Phosphotransferases with a carboxy group as acceptor
+2.7.2.n	Phosphotransferases with a carboxy group as acceptor
 2.7.3.-	Phosphotransferases with a nitrogenous group as acceptor
 2.7.3.n	Phosphotransferases with a nitrogenous group as acceptor
 2.7.4.-	Phosphotransferases with a phosphate group as acceptor
 2.7.4.n	Phosphotransferases with a phosphate group as acceptor
+2.7.5.-	Phosphotransferases with regeneration of donors, apparently catalyzing intramolecular transfers
+2.7.5.n	Phosphotransferases with regeneration of donors, apparently catalyzing intramolecular transfers
 2.7.6.-	Diphosphotransferases
 2.7.6.n	Diphosphotransferases
 2.7.7.-	Nucleotidyltransferases
@@ -422,40 +468,56 @@
 3.1.13.n	Exoribonucleases producing 5'-phosphomonoesters
 3.1.14.-	Exoribonucleases producing 3'-phosphomonoesters
 3.1.14.n	Exoribonucleases producing 3'-phosphomonoesters
-3.1.15.-	Exonucleases active with either ribo- or deoxyribonucleic acid and producing 5'-phosphomonoesters
-3.1.15.n	Exonucleases active with either ribo- or deoxyribonucleic acid and producing 5'-phosphomonoesters
-3.1.16.-	Exonucleases active with either ribo- or deoxyribonucleic acid and producing 3'-phosphomonoesters
-3.1.16.n	Exonucleases active with either ribo- or deoxyribonucleic acid and producing 3'-phosphomonoesters
+3.1.15.-	Exonucleases active with either ribo- or deoxyribonucleic acids and producing 5'-phosphomonoesters
+3.1.15.n	Exonucleases active with either ribo- or deoxyribonucleic acids and producing 5'-phosphomonoesters
+3.1.16.-	Exonucleases active with either ribo- or deoxyribonucleic acids and producing 3'-phosphomonoesters
+3.1.16.n	Exonucleases active with either ribo- or deoxyribonucleic acids and producing 3'-phosphomonoesters
 3.1.21.-	Endodeoxyribonucleases producing 5'-phosphomonoesters
 3.1.21.n	Endodeoxyribonucleases producing 5'-phosphomonoesters
 3.1.22.-	Endodeoxyribonucleases producing other than 5'-phosphomonoesters
 3.1.22.n	Endodeoxyribonucleases producing other than 5'-phosphomonoesters
+3.1.23.-	Site specific endodeoxyribonucleases: cleavage is sequence specific
+3.1.23.n	Site specific endodeoxyribonucleases: cleavage is sequence specific
+3.1.24.-	Site specific endodeoxyribonucleases: cleavage is not sequence specific
+3.1.24.n	Site specific endodeoxyribonucleases: cleavage is not sequence specific
 3.1.25.-	Site-specific endodeoxyribonucleases specific for altered bases
 3.1.25.n	Site-specific endodeoxyribonucleases specific for altered bases
 3.1.26.-	Endoribonucleases producing 5'-phosphomonoesters
 3.1.26.n	Endoribonucleases producing 5'-phosphomonoesters
 3.1.27.-	Endoribonucleases producing other than 5'-phosphomonoesters
 3.1.27.n	Endoribonucleases producing other than 5'-phosphomonoesters
-3.1.30.-	Endoribonucleases active with either ribo- or deoxyribonucleic acid and producing 5'-phosphomonoesters
-3.1.30.n	Endoribonucleases active with either ribo- or deoxyribonucleic acid and producing 5'-phosphomonoesters
-3.1.31.-	Endoribonucleases active with either ribo- or deoxyribonucleic acid and producing 3'-phosphomonoesters
-3.1.31.n	Endoribonucleases active with either ribo- or deoxyribonucleic acid and producing 3'-phosphomonoesters
+3.1.30.-	Endoribonucleases active with either ribo- or deoxyribonucleic acids and producing 5'-phosphomonoesters
+3.1.30.n	Endoribonucleases active with either ribo- or deoxyribonucleic acids and producing 5'-phosphomonoesters
+3.1.31.-	Endoribonucleases active with either ribo- or deoxyribonucleic acids and producing 3'-phosphomonoesters
+3.1.31.n	Endoribonucleases active with either ribo- or deoxyribonucleic acids and producing 3'-phosphomonoesters
 3.2.-.-	Glycosylases
 3.2.n.n	Glycosylases
 3.2.1.-	Glycosidases, i.e. enzymes hydrolyzing O- and S-glycosyl compounds
 3.2.1.n	Glycosidases, i.e. enzymes hydrolyzing O- and S-glycosyl compounds
 3.2.2.-	Hydrolyzing N-glycosyl compounds
 3.2.2.n	Hydrolyzing N-glycosyl compounds
+3.2.3.-	Hydrolyzing S-glycosyl compounds
+3.2.3.n	Hydrolyzing S-glycosyl compounds
 3.3.-.-	Acting on ether bonds
 3.3.n.n	Acting on ether bonds
 3.3.1.-	Thioether and trialkylsulfonium hydrolases
 3.3.1.n	Thioether and trialkylsulfonium hydrolases
 3.3.2.-	Ether hydrolases
 3.3.2.n	Ether hydrolases
-3.4.-.-	Acting on peptide bonds (peptide hydrolases)
-3.4.n.n	Acting on peptide bonds (peptide hydrolases)
+3.4.-.-	Acting on peptide bonds (peptidases)
+3.4.n.n	Acting on peptide bonds (peptidases)
+3.4.1.-	alpha-Amino-acyl-peptide hydrolases
+3.4.1.n	alpha-Amino-acyl-peptide hydrolases
+3.4.2.-	Peptidyl-amino-acid hydrolases
+3.4.2.n	Peptidyl-amino-acid hydrolases
+3.4.3.-	Dipeptide hydrolases
+3.4.3.n	Dipeptide hydrolases
+3.4.4.-	Peptidyl peptide hydrolases
+3.4.4.n	Peptidyl peptide hydrolases
 3.4.11.-	Aminopeptidases
 3.4.11.n	Aminopeptidases
+3.4.12.-	Peptidylamino-acid hydrolases or acylamino-acid hydrolases
+3.4.12.n	Peptidylamino-acid hydrolases or acylamino-acid hydrolases
 3.4.13.-	Dipeptidases
 3.4.13.n	Dipeptidases
 3.4.14.-	Dipeptidyl-peptidases and tripeptidyl-peptidases
@@ -498,14 +560,14 @@
 3.5.99.n	In other compounds
 3.6.-.-	Acting on acid anhydrides
 3.6.n.n	Acting on acid anhydrides
-3.6.1.-	In phosphorous-containing anhydrides
-3.6.1.n	In phosphorous-containing anhydrides
+3.6.1.-	In phosphorus-containing anhydrides
+3.6.1.n	In phosphorus-containing anhydrides
 3.6.2.-	In sulfonyl-containing anhydrides
 3.6.2.n	In sulfonyl-containing anhydrides
 3.6.3.-	Acting on acid anhydrides; catalyzing transmembrane movement of substances
 3.6.3.n	Acting on acid anhydrides; catalyzing transmembrane movement of substances
-3.6.4.-	Acting on acid anhydrides; involved in cellular and subcellular movement
-3.6.4.n	Acting on acid anhydrides; involved in cellular and subcellular movement
+3.6.4.-	Acting on ATP; involved in cellular and subcellular movement
+3.6.4.n	Acting on ATP; involved in cellular and subcellular movement
 3.6.5.-	Acting on GTP; involved in cellular and subcellular movement
 3.6.5.n	Acting on GTP; involved in cellular and subcellular movement
 3.7.-.-	Acting on carbon-carbon bonds
@@ -516,6 +578,8 @@
 3.8.n.n	Acting on halide bonds
 3.8.1.-	In C-halide compounds
 3.8.1.n	In C-halide compounds
+3.8.2.-	In P-halide compounds
+3.8.2.n	In P-halide compounds
 3.9.-.-	Acting on phosphorus-nitrogen bonds
 3.9.n.n	Acting on phosphorus-nitrogen bonds
 3.9.1.-	Acting on phosphorus-nitrogen bonds
@@ -586,8 +650,8 @@
 4.7.1.n	Carbon-phosphorus lyases
 4.99.-.-	Other lyases
 4.99.n.n	Other lyases
-4.99.1.-	Sole sub-subclass for lyases that do not belong in the other subclasses
-4.99.1.n	Sole sub-subclass for lyases that do not belong in the other subclasses
+4.99.1.-	Other lyases
+4.99.1.n	Other lyases
 5.-.-.-	Isomerases
 5.n.n.n	Isomerases
 5.1.-.-	Racemases and epimerases
@@ -602,22 +666,22 @@
 5.1.99.n	Acting on other compounds
 5.2.-.-	Cis-trans-isomerases
 5.2.n.n	Cis-trans-isomerases
-5.2.1.-	Cis-trans Isomerases
-5.2.1.n	Cis-trans Isomerases
+5.2.1.-	Cis-trans isomerases
+5.2.1.n	Cis-trans isomerases
 5.3.-.-	Intramolecular oxidoreductases
 5.3.n.n	Intramolecular oxidoreductases
-5.3.1.-	Interconverting aldoses and ketoses, and related compounds
-5.3.1.n	Interconverting aldoses and ketoses, and related compounds
-5.3.2.-	Interconverting keto- and enol- groups
-5.3.2.n	Interconverting keto- and enol- groups
-5.3.3.-	Transposing C==C bonds
-5.3.3.n	Transposing C==C bonds
+5.3.1.-	Interconverting aldoses and ketoses
+5.3.1.n	Interconverting aldoses and ketoses
+5.3.2.-	Interconverting keto- and enol-groups
+5.3.2.n	Interconverting keto- and enol-groups
+5.3.3.-	Transposing C=C bonds
+5.3.3.n	Transposing C=C bonds
 5.3.4.-	Transposing S-S bonds
 5.3.4.n	Transposing S-S bonds
 5.3.99.-	Other intramolecular oxidoreductases
 5.3.99.n	Other intramolecular oxidoreductases
-5.4.-.-	Intramolecular transferases (mutases)
-5.4.n.n	Intramolecular transferases (mutases)
+5.4.-.-	Intramolecular transferases
+5.4.n.n	Intramolecular transferases
 5.4.1.-	Transferring acyl groups
 5.4.1.n	Transferring acyl groups
 5.4.2.-	Phosphotransferases (phosphomutases)
@@ -634,8 +698,8 @@
 5.5.1.n	Intramolecular lyases
 5.99.-.-	Other isomerases
 5.99.n.n	Other isomerases
-5.99.1.-	Sole sub-subclass for isomerases that do not belong in the other subclasses
-5.99.1.n	Sole sub-subclass for isomerases that do not belong in the other subclasses
+5.99.1.-	Other isomerases
+5.99.1.n	Other isomerases
 6.-.-.-	Ligases
 6.n.n.n	Ligases
 6.1.-.-	Forming carbon-oxygen bonds
@@ -650,8 +714,8 @@
 6.2.1.n	Acid--thiol ligases
 6.3.-.-	Forming carbon-nitrogen bonds
 6.3.n.n	Forming carbon-nitrogen bonds
-6.3.1.-	Acid--ammonia (or amide) ligases (amide synthases)
-6.3.1.n	Acid--ammonia (or amide) ligases (amide synthases)
+6.3.1.-	Acid--ammonia (or amine) ligases (amide synthases)
+6.3.1.n	Acid--ammonia (or amine) ligases (amide synthases)
 6.3.2.-	Acid--amino-acid ligases (peptide synthases)
 6.3.2.n	Acid--amino-acid ligases (peptide synthases)
 6.3.3.-	Cyclo-ligases
@@ -662,12 +726,12 @@
 6.3.5.n	Carbon--nitrogen ligases with glutamine as amido-N-donor
 6.4.-.-	Forming carbon-carbon bonds
 6.4.n.n	Forming carbon-carbon bonds
-6.4.1.-	Ligases that form carbon-carbon bonds
-6.4.1.n	Ligases that form carbon-carbon bonds
+6.4.1.-	Forming carbon-carbon bonds
+6.4.1.n	Forming carbon-carbon bonds
 6.5.-.-	Forming phosphoric ester bonds
 6.5.n.n	Forming phosphoric ester bonds
-6.5.1.-	Ligases that form phosphoric-ester bonds
-6.5.1.n	Ligases that form phosphoric-ester bonds
+6.5.1.-	Forming phosphoric ester bonds
+6.5.1.n	Forming phosphoric ester bonds
 6.6.-.-	Forming nitrogen-metal bonds
 6.6.n.n	Forming nitrogen-metal bonds
 6.6.1.-	Forming coordination complexes
diff --git a/c++/src/objects/seqfeat/ecnum_deleted.inc b/c++/src/objects/seqfeat/ecnum_deleted.inc
index 9298deb..f8373c4 100644
--- a/c++/src/objects/seqfeat/ecnum_deleted.inc
+++ b/c++/src/objects/seqfeat/ecnum_deleted.inc
@@ -1,4 +1,4 @@
-/*  $Id: ecnum_deleted.inc 453849 2014-12-08 18:54:49Z kans $
+/*  $Id: ecnum_deleted.inc 493886 2016-03-02 14:19:14Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -55,6 +55,7 @@ static const char* const kECNum_deleted[] = {
     "1.7.1.8",
     "1.7.99.2",
     "1.8.1.1",
+    "1.8.99.1",
     "1.12.99.2",
     "1.13.1.7",
     "1.13.11.7",
@@ -162,6 +163,7 @@ static const char* const kECNum_deleted[] = {
     "3.4.99.39",
     "3.4.99.40",
     "3.4.99.42",
+    "3.5.1.27",
     "3.13.1.2",
     "4.1.1.13",
     "4.1.2.3",
diff --git a/c++/src/objects/seqfeat/ecnum_deleted.txt b/c++/src/objects/seqfeat/ecnum_deleted.txt
index 37ebca1..8cc8e74 100644
--- a/c++/src/objects/seqfeat/ecnum_deleted.txt
+++ b/c++/src/objects/seqfeat/ecnum_deleted.txt
@@ -22,6 +22,7 @@
 1.7.1.8
 1.7.99.2
 1.8.1.1
+1.8.99.1
 1.12.99.2
 1.13.1.7
 1.13.11.7
@@ -129,6 +130,7 @@
 3.4.99.39
 3.4.99.40
 3.4.99.42
+3.5.1.27
 3.13.1.2
 4.1.1.13
 4.1.2.3
diff --git a/c++/src/objects/seqfeat/ecnum_replaced.inc b/c++/src/objects/seqfeat/ecnum_replaced.inc
index b95e017..0256c15 100644
--- a/c++/src/objects/seqfeat/ecnum_replaced.inc
+++ b/c++/src/objects/seqfeat/ecnum_replaced.inc
@@ -1,4 +1,4 @@
-/*  $Id: ecnum_replaced.inc 453849 2014-12-08 18:54:49Z kans $
+/*  $Id: ecnum_replaced.inc 493886 2016-03-02 14:19:14Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -70,6 +70,8 @@ static const char* const kECNum_replaced[] = {
     "1.1.3.34	1.14.21.3",
     "1.1.3.35	1.14.21.4",
     "1.1.3.36	1.14.21.5",
+    "1.1.4.1	1.17.4.4",
+    "1.1.4.2	1.17.4.5",
     "1.1.98.1	1.1.9.1",
     "1.1.99.5	1.1.5.3",
     "1.1.99.8	1.1.2.7	1.1.2.8",
@@ -98,16 +100,20 @@ static const char* const kECNum_replaced[] = {
     "1.2.4.3	1.2.4.4",
     "1.2.7.9	1.2.7.3",
     "1.2.99.1	1.17.99.4",
+    "1.2.99.3	1.2.5.2",
+    "1.2.99.4	1.2.98.1",
     "1.3.1.4	1.3.1.22",
     "1.3.1.26	1.17.1.8",
     "1.3.1.30	1.3.1.22",
+    "1.3.1.35	1.14.19.22",
     "1.3.1.50	1.1.1.252",
     "1.3.1.52	1.3.8.5",
+    "1.3.1.63	1.21.1.2",
     "1.3.1.n1	1.3.1.87",
     "1.3.2.1	1.3.8.1",
     "1.3.2.2	1.3.8.7",
     "1.3.3.1	1.3.98.1",
-    "1.3.3.2	1.14.21.6",
+    "1.3.3.2	1.14.19.20",
     "1.3.7.10	1.14.19.8",
     "1.3.98.2	1.3.4.1",
     "1.3.99.2	1.3.8.1",
@@ -120,6 +126,7 @@ static const char* const kECNum_replaced[] = {
     "1.3.99.15	1.3.7.8",
     "1.3.99.20	1.3.7.9",
     "1.3.99.21	1.3.8.3",
+    "1.3.99.34	1.3.7.11",
     "1.3.99.n2	4.1.99.19",
     "1.3.99.n3	1.3.99.36",
     "1.4.1.6	1.21.4.1",
@@ -128,6 +135,7 @@ static const char* const kECNum_replaced[] = {
     "1.4.3.17	1.3.3.10",
     "1.4.4.1	1.21.4.1",
     "1.4.98.1	1.4.9.1",
+    "1.4.99.1	1.4.99.6",
     "1.4.99.3	1.4.9.1",
     "1.4.99.4	1.4.9.2",
     "1.5.1.4	1.5.1.3",
@@ -185,6 +193,7 @@ static const char* const kECNum_replaced[] = {
     "1.6.8.2	1.5.1.30",
     "1.6.99.2	1.6.5.2",
     "1.6.99.4	1.18.1.2",
+    "1.6.99.5	1.6.5.11",
     "1.6.99.6	1.6.5.10",
     "1.6.99.7	1.5.1.34",
     "1.6.99.8	1.16.1.3",
@@ -203,9 +212,12 @@ static const char* const kECNum_replaced[] = {
     "1.8.6.1	2.5.1.18",
     "1.8.99.4	1.8.4.8",
     "1.9.3.2	1.7.2.1",
+    "1.9.99.1	1.9.98.1",
     "1.10.3.7	1.21.3.4",
     "1.10.3.8	1.21.3.5",
     "1.10.99.1	1.10.9.1",
+    "1.10.99.2	1.10.5.1",
+    "1.10.99.3	1.23.5.1",
     "1.11.1.4	1.13.11.11",
     "1.12.1.1	1.12.7.2",
     "1.12.7.1	1.12.7.2",
@@ -238,12 +250,12 @@ static const char* const kECNum_replaced[] = {
     "1.13.99.5	1.13.11.47",
     "1.14.1.1	1.14.14.1",
     "1.14.1.2	1.14.13.9",
-    "1.14.1.3	1.14.13.132	5.4.99.7",
+    "1.14.1.3	1.14.14.17	5.4.99.7",
     "1.14.1.4	1.14.99.2",
     "1.14.1.5	1.14.13.5",
     "1.14.1.6	1.14.15.4",
-    "1.14.1.7	1.14.99.9",
-    "1.14.1.8	1.14.99.10",
+    "1.14.1.7	1.14.14.19",
+    "1.14.1.8	1.14.14.16",
     "1.14.1.10	1.14.99.11",
     "1.14.2.1	1.14.17.1",
     "1.14.2.2	1.13.11.27",
@@ -252,12 +264,17 @@ static const char* const kECNum_replaced[] = {
     "1.14.11.n1	1.14.11.39",
     "1.14.12.2	1.14.13.35",
     "1.14.12.6	1.14.13.66",
-    "1.14.12.n1	1.14.12.21",
+    "1.14.12.21	1.14.13.208",
+    "1.14.12.n1	1.14.13.208",
     "1.14.13.3	1.14.14.9",
+    "1.14.13.26	1.14.18.4",
     "1.14.13.45	1.14.18.2",
     "1.14.13.60	1.14.13.100",
     "1.14.13.86	1.14.13.136",
+    "1.14.13.95	1.14.18.8",
+    "1.14.13.132	1.14.14.17",
     "1.14.13.164	1.13.11.65",
+    "1.14.13.169	1.14.18.5",
     "1.14.13.n1	1.14.13.124",
     "1.14.13.n2	1.14.13.125",
     "1.14.13.n3	1.14.13.127",
@@ -274,16 +291,23 @@ static const char* const kECNum_replaced[] = {
     "1.14.19.n1	1.14.19.4",
     "1.14.19.n2	1.14.19.5",
     "1.14.19.n3	1.14.19.6",
+    "1.14.21.6	1.14.19.20",
+    "1.14.99.3	1.14.14.18",
     "1.14.99.5	1.14.19.1",
     "1.14.99.6	1.14.19.2",
-    "1.14.99.7	1.14.13.132",
+    "1.14.99.7	1.14.14.17",
     "1.14.99.8	1.14.14.1",
+    "1.14.99.9	1.14.14.19",
+    "1.14.99.10	1.14.14.16",
     "1.14.99.13	1.14.13.23",
     "1.14.99.16	1.14.13.72",
     "1.14.99.17	1.14.16.5",
     "1.14.99.25	1.14.19.3",
     "1.14.99.28	1.14.13.151",
     "1.14.99.30	1.3.5.6",
+    "1.14.99.31	1.14.19.24",
+    "1.14.99.32	1.14.19.5",
+    "1.14.99.33	1.14.19.39",
     "1.14.99.40	1.13.11.79",
     "1.14.99.41	1.13.11.75",
     "1.14.99.n1	1.13.11.75",
@@ -291,25 +315,31 @@ static const char* const kECNum_replaced[] = {
     "1.14.99.n3	1.14.99.42",
     "1.14.99.n5	1.13.11.70",
     "1.16.98.1	1.16.9.1",
-    "1.17.1.6	1.17.99.5",
+    "1.17.1.6	1.17.98.1",
+    "1.17.1.7	1.2.1.91",
     "1.17.4.3	1.17.7.1",
+    "1.17.99.5	1.17.98.1",
     "1.18.2.1	1.18.6.1",
     "1.18.3.1	1.12.7.2",
     "1.18.96.1	1.15.1.2",
     "1.18.99.1	1.12.7.2",
     "1.20.98.1	1.20.9.1",
+    "1.21.99.2	1.21.98.1",
+    "1.22.1.1	1.21.1.1",
     "1.97.1.3	1.12.98.4",
     "1.97.1.5	1.20.4.1",
     "1.97.1.6	1.20.99.1",
     "1.97.1.7	1.20.4.2",
+    "1.97.1.10	1.21.99.4",
+    "1.97.1.11	1.21.99.3",
     "1.98.1.1	1.12.7.2",
     "1.99.1.1	1.14.14.1",
     "1.99.1.2	1.14.16.1",
     "1.99.1.5	1.14.13.9",
     "1.99.1.7	1.14.15.4",
-    "1.99.1.9	1.14.99.9",
-    "1.99.1.11	1.14.99.10",
-    "1.99.1.13	1.14.13.132	5.4.99.7",
+    "1.99.1.9	1.14.14.19",
+    "1.99.1.11	1.14.14.16",
+    "1.99.1.13	1.14.14.17	5.4.99.7",
     "1.99.1.14	1.13.11.27",
     "1.99.2.1	1.13.11.12",
     "1.99.2.2	1.13.11.1",
@@ -317,7 +347,7 @@ static const char* const kECNum_replaced[] = {
     "1.99.2.4	1.13.11.4",
     "1.99.2.5	1.13.11.5",
     "1.99.2.6	1.13.99.1",
-    "2.1.1.23	2.1.1.124	2.1.1.125	2.1.1.126",
+    "2.1.1.23	2.1.1.319	2.1.1.320	2.1.1.321	2.1.1.322",
     "2.1.1.24	2.1.1.77	2.1.1.80	2.1.1.100",
     "2.1.1.29	2.1.1.202	2.1.1.203	2.1.1.204",
     "2.1.1.31	2.1.1.221	2.1.1.228",
@@ -332,6 +362,9 @@ static const char* const kECNum_replaced[] = {
     "2.1.1.81	2.1.1.49",
     "2.1.1.92	2.1.1.69",
     "2.1.1.93	2.1.1.70",
+    "2.1.1.124	2.1.1.319	2.1.1.320	2.1.1.321	2.1.1.322",
+    "2.1.1.125	2.1.1.319	2.1.1.320	2.1.1.321	2.1.1.322",
+    "2.1.1.126	2.1.1.319	2.1.1.320	2.1.1.321	2.1.1.322",
     "2.1.1.134	2.1.1.129",
     "2.1.1.135	1.16.1.8",
     "2.1.1.149	2.1.1.267",
@@ -352,6 +385,7 @@ static const char* const kECNum_replaced[] = {
     "2.1.3.14	6.1.2.2",
     "2.3.1.55	2.3.1.82",
     "2.3.1.104	2.3.1.25",
+    "2.3.1.119	1.1.1.330	1.3.1.93	2.3.1.199	4.2.1.134",
     "2.3.1.n1	2.3.1.191",
     "2.3.1.n8	2.3.1.199",
     "2.3.1.n9	2.3.1.211",
@@ -414,6 +448,7 @@ static const char* const kECNum_replaced[] = {
     "2.6.1.n1	2.6.1.87",
     "2.6.1.n2	2.6.1.105",
     "2.6.2.1	2.1.4.1",
+    "2.6.99.4	2.3.1.234",
     "2.7.1.37	2.7.11.1	2.7.11.8	2.7.11.9	2.7.11.10	2.7.11.11	2.7.11.12	2.7.11.13	2.7.11.21	2.7.11.22	2.7.11.24	2.7.11.25	2.7.11.30	2.7.12.1",
     "2.7.1.38	2.7.11.19",
     "2.7.1.70	2.7.11.1",
@@ -506,12 +541,14 @@ static const char* const kECNum_replaced[] = {
     "3.1.3.n3	3.1.3.78",
     "3.1.3.n4	3.1.3.87",
     "3.1.3.n5	3.1.3.93",
+    "3.1.3.n6	3.1.3.96",
     "3.1.4.5	3.1.21.1",
     "3.1.4.6	3.1.22.1",
     "3.1.4.7	3.1.31.1",
     "3.1.4.8	3.1.27.3",
     "3.1.4.9	3.1.30.2",
     "3.1.4.10	4.6.1.13",
+    "3.1.4.15	2.7.7.89",
     "3.1.4.18	3.1.16.1",
     "3.1.4.19	3.1.13.3",
     "3.1.4.20	3.1.13.1",
@@ -762,6 +799,7 @@ static const char* const kECNum_replaced[] = {
     "3.6.1.49	3.6.5.4",
     "3.6.1.50	3.6.5.5",
     "3.6.1.51	3.6.5.6",
+    "3.6.1.n4	3.6.1.67",
     "3.6.1.n5	3.6.1.54",
     "3.6.3.13	3.6.3.1",
     "3.6.3.45	3.6.3.44",
@@ -770,7 +808,7 @@ static const char* const kECNum_replaced[] = {
     "3.7.1.16	3.3.2.12",
     "3.7.1.n1	3.7.1.14",
     "3.7.1.n2	3.7.1.22",
-    "3.8.1.4	1.97.1.10",
+    "3.8.1.4	1.21.99.4",
     "3.8.2.1	3.1.8.2",
     "4.1.1.10	4.1.1.12",
     "4.1.1.26	4.1.1.28",
@@ -815,6 +853,7 @@ static const char* const kECNum_replaced[] = {
     "4.1.99.8	4.2.3.119	4.2.3.120",
     "4.1.99.9	4.2.3.15",
     "4.1.99.10	4.2.3.16",
+    "4.1.99.21	4.2.3.153",
     "4.2.1.4	4.2.1.3",
     "4.2.1.13	4.3.1.17",
     "4.2.1.14	4.3.1.18",
@@ -885,6 +924,7 @@ static const char* const kECNum_replaced[] = {
     "4.6.1.9	4.2.3.11",
     "4.6.1.10	4.2.3.12",
     "4.6.1.11	4.2.3.13",
+    "5.1.1.n1	5.1.1.20",
     "5.1.3.n1	5.1.3.24",
     "5.1.3.n2	5.1.3.29",
     "5.1.3.n3	5.1.3.32",
@@ -914,9 +954,12 @@ static const char* const kECNum_replaced[] = {
     "6.3.1.3	6.3.4.13",
     "6.3.1.16	6.3.3.6",
     "6.3.2.15	6.3.2.10",
+    "6.3.2.19	2.3.2.23	2.3.2.27	6.2.1.45",
     "6.3.2.22	6.3.1.14",
     "6.3.2.27	6.3.2.38	6.3.2.39",
+    "6.3.2.28	6.3.2.49",
     "6.3.2.n1	6.3.2.37",
+    "6.3.2.n2	6.3.1.19",
     "6.3.2.n4	6.3.2.43",
     "6.3.2.n5	6.3.2.44",
     "6.3.2.n6	6.3.2.41",
diff --git a/c++/src/objects/seqfeat/ecnum_replaced.txt b/c++/src/objects/seqfeat/ecnum_replaced.txt
index 1d4c3e7..920a25b 100644
--- a/c++/src/objects/seqfeat/ecnum_replaced.txt
+++ b/c++/src/objects/seqfeat/ecnum_replaced.txt
@@ -37,6 +37,8 @@
 1.1.3.34	1.14.21.3
 1.1.3.35	1.14.21.4
 1.1.3.36	1.14.21.5
+1.1.4.1	1.17.4.4
+1.1.4.2	1.17.4.5
 1.1.98.1	1.1.9.1
 1.1.99.5	1.1.5.3
 1.1.99.8	1.1.2.7	1.1.2.8
@@ -65,16 +67,20 @@
 1.2.4.3	1.2.4.4
 1.2.7.9	1.2.7.3
 1.2.99.1	1.17.99.4
+1.2.99.3	1.2.5.2
+1.2.99.4	1.2.98.1
 1.3.1.4	1.3.1.22
 1.3.1.26	1.17.1.8
 1.3.1.30	1.3.1.22
+1.3.1.35	1.14.19.22
 1.3.1.50	1.1.1.252
 1.3.1.52	1.3.8.5
+1.3.1.63	1.21.1.2
 1.3.1.n1	1.3.1.87
 1.3.2.1	1.3.8.1
 1.3.2.2	1.3.8.7
 1.3.3.1	1.3.98.1
-1.3.3.2	1.14.21.6
+1.3.3.2	1.14.19.20
 1.3.7.10	1.14.19.8
 1.3.98.2	1.3.4.1
 1.3.99.2	1.3.8.1
@@ -87,6 +93,7 @@
 1.3.99.15	1.3.7.8
 1.3.99.20	1.3.7.9
 1.3.99.21	1.3.8.3
+1.3.99.34	1.3.7.11
 1.3.99.n2	4.1.99.19
 1.3.99.n3	1.3.99.36
 1.4.1.6	1.21.4.1
@@ -95,6 +102,7 @@
 1.4.3.17	1.3.3.10
 1.4.4.1	1.21.4.1
 1.4.98.1	1.4.9.1
+1.4.99.1	1.4.99.6
 1.4.99.3	1.4.9.1
 1.4.99.4	1.4.9.2
 1.5.1.4	1.5.1.3
@@ -152,6 +160,7 @@
 1.6.8.2	1.5.1.30
 1.6.99.2	1.6.5.2
 1.6.99.4	1.18.1.2
+1.6.99.5	1.6.5.11
 1.6.99.6	1.6.5.10
 1.6.99.7	1.5.1.34
 1.6.99.8	1.16.1.3
@@ -170,9 +179,12 @@
 1.8.6.1	2.5.1.18
 1.8.99.4	1.8.4.8
 1.9.3.2	1.7.2.1
+1.9.99.1	1.9.98.1
 1.10.3.7	1.21.3.4
 1.10.3.8	1.21.3.5
 1.10.99.1	1.10.9.1
+1.10.99.2	1.10.5.1
+1.10.99.3	1.23.5.1
 1.11.1.4	1.13.11.11
 1.12.1.1	1.12.7.2
 1.12.7.1	1.12.7.2
@@ -205,12 +217,12 @@
 1.13.99.5	1.13.11.47
 1.14.1.1	1.14.14.1
 1.14.1.2	1.14.13.9
-1.14.1.3	1.14.13.132	5.4.99.7
+1.14.1.3	1.14.14.17	5.4.99.7
 1.14.1.4	1.14.99.2
 1.14.1.5	1.14.13.5
 1.14.1.6	1.14.15.4
-1.14.1.7	1.14.99.9
-1.14.1.8	1.14.99.10
+1.14.1.7	1.14.14.19
+1.14.1.8	1.14.14.16
 1.14.1.10	1.14.99.11
 1.14.2.1	1.14.17.1
 1.14.2.2	1.13.11.27
@@ -219,12 +231,17 @@
 1.14.11.n1	1.14.11.39
 1.14.12.2	1.14.13.35
 1.14.12.6	1.14.13.66
-1.14.12.n1	1.14.12.21
+1.14.12.21	1.14.13.208
+1.14.12.n1	1.14.13.208
 1.14.13.3	1.14.14.9
+1.14.13.26	1.14.18.4
 1.14.13.45	1.14.18.2
 1.14.13.60	1.14.13.100
 1.14.13.86	1.14.13.136
+1.14.13.95	1.14.18.8
+1.14.13.132	1.14.14.17
 1.14.13.164	1.13.11.65
+1.14.13.169	1.14.18.5
 1.14.13.n1	1.14.13.124
 1.14.13.n2	1.14.13.125
 1.14.13.n3	1.14.13.127
@@ -241,16 +258,23 @@
 1.14.19.n1	1.14.19.4
 1.14.19.n2	1.14.19.5
 1.14.19.n3	1.14.19.6
+1.14.21.6	1.14.19.20
+1.14.99.3	1.14.14.18
 1.14.99.5	1.14.19.1
 1.14.99.6	1.14.19.2
-1.14.99.7	1.14.13.132
+1.14.99.7	1.14.14.17
 1.14.99.8	1.14.14.1
+1.14.99.9	1.14.14.19
+1.14.99.10	1.14.14.16
 1.14.99.13	1.14.13.23
 1.14.99.16	1.14.13.72
 1.14.99.17	1.14.16.5
 1.14.99.25	1.14.19.3
 1.14.99.28	1.14.13.151
 1.14.99.30	1.3.5.6
+1.14.99.31	1.14.19.24
+1.14.99.32	1.14.19.5
+1.14.99.33	1.14.19.39
 1.14.99.40	1.13.11.79
 1.14.99.41	1.13.11.75
 1.14.99.n1	1.13.11.75
@@ -258,25 +282,31 @@
 1.14.99.n3	1.14.99.42
 1.14.99.n5	1.13.11.70
 1.16.98.1	1.16.9.1
-1.17.1.6	1.17.99.5
+1.17.1.6	1.17.98.1
+1.17.1.7	1.2.1.91
 1.17.4.3	1.17.7.1
+1.17.99.5	1.17.98.1
 1.18.2.1	1.18.6.1
 1.18.3.1	1.12.7.2
 1.18.96.1	1.15.1.2
 1.18.99.1	1.12.7.2
 1.20.98.1	1.20.9.1
+1.21.99.2	1.21.98.1
+1.22.1.1	1.21.1.1
 1.97.1.3	1.12.98.4
 1.97.1.5	1.20.4.1
 1.97.1.6	1.20.99.1
 1.97.1.7	1.20.4.2
+1.97.1.10	1.21.99.4
+1.97.1.11	1.21.99.3
 1.98.1.1	1.12.7.2
 1.99.1.1	1.14.14.1
 1.99.1.2	1.14.16.1
 1.99.1.5	1.14.13.9
 1.99.1.7	1.14.15.4
-1.99.1.9	1.14.99.9
-1.99.1.11	1.14.99.10
-1.99.1.13	1.14.13.132	5.4.99.7
+1.99.1.9	1.14.14.19
+1.99.1.11	1.14.14.16
+1.99.1.13	1.14.14.17	5.4.99.7
 1.99.1.14	1.13.11.27
 1.99.2.1	1.13.11.12
 1.99.2.2	1.13.11.1
@@ -284,7 +314,7 @@
 1.99.2.4	1.13.11.4
 1.99.2.5	1.13.11.5
 1.99.2.6	1.13.99.1
-2.1.1.23	2.1.1.124	2.1.1.125	2.1.1.126
+2.1.1.23	2.1.1.319	2.1.1.320	2.1.1.321	2.1.1.322
 2.1.1.24	2.1.1.77	2.1.1.80	2.1.1.100
 2.1.1.29	2.1.1.202	2.1.1.203	2.1.1.204
 2.1.1.31	2.1.1.221	2.1.1.228
@@ -299,6 +329,9 @@
 2.1.1.81	2.1.1.49
 2.1.1.92	2.1.1.69
 2.1.1.93	2.1.1.70
+2.1.1.124	2.1.1.319	2.1.1.320	2.1.1.321	2.1.1.322
+2.1.1.125	2.1.1.319	2.1.1.320	2.1.1.321	2.1.1.322
+2.1.1.126	2.1.1.319	2.1.1.320	2.1.1.321	2.1.1.322
 2.1.1.134	2.1.1.129
 2.1.1.135	1.16.1.8
 2.1.1.149	2.1.1.267
@@ -319,6 +352,7 @@
 2.1.3.14	6.1.2.2
 2.3.1.55	2.3.1.82
 2.3.1.104	2.3.1.25
+2.3.1.119	1.1.1.330	1.3.1.93	2.3.1.199	4.2.1.134
 2.3.1.n1	2.3.1.191
 2.3.1.n8	2.3.1.199
 2.3.1.n9	2.3.1.211
@@ -381,6 +415,7 @@
 2.6.1.n1	2.6.1.87
 2.6.1.n2	2.6.1.105
 2.6.2.1	2.1.4.1
+2.6.99.4	2.3.1.234
 2.7.1.37	2.7.11.1	2.7.11.8	2.7.11.9	2.7.11.10	2.7.11.11	2.7.11.12	2.7.11.13	2.7.11.21	2.7.11.22	2.7.11.24	2.7.11.25	2.7.11.30	2.7.12.1
 2.7.1.38	2.7.11.19
 2.7.1.70	2.7.11.1
@@ -473,12 +508,14 @@
 3.1.3.n3	3.1.3.78
 3.1.3.n4	3.1.3.87
 3.1.3.n5	3.1.3.93
+3.1.3.n6	3.1.3.96
 3.1.4.5	3.1.21.1
 3.1.4.6	3.1.22.1
 3.1.4.7	3.1.31.1
 3.1.4.8	3.1.27.3
 3.1.4.9	3.1.30.2
 3.1.4.10	4.6.1.13
+3.1.4.15	2.7.7.89
 3.1.4.18	3.1.16.1
 3.1.4.19	3.1.13.3
 3.1.4.20	3.1.13.1
@@ -729,6 +766,7 @@
 3.6.1.49	3.6.5.4
 3.6.1.50	3.6.5.5
 3.6.1.51	3.6.5.6
+3.6.1.n4	3.6.1.67
 3.6.1.n5	3.6.1.54
 3.6.3.13	3.6.3.1
 3.6.3.45	3.6.3.44
@@ -737,7 +775,7 @@
 3.7.1.16	3.3.2.12
 3.7.1.n1	3.7.1.14
 3.7.1.n2	3.7.1.22
-3.8.1.4	1.97.1.10
+3.8.1.4	1.21.99.4
 3.8.2.1	3.1.8.2
 4.1.1.10	4.1.1.12
 4.1.1.26	4.1.1.28
@@ -782,6 +820,7 @@
 4.1.99.8	4.2.3.119	4.2.3.120
 4.1.99.9	4.2.3.15
 4.1.99.10	4.2.3.16
+4.1.99.21	4.2.3.153
 4.2.1.4	4.2.1.3
 4.2.1.13	4.3.1.17
 4.2.1.14	4.3.1.18
@@ -852,6 +891,7 @@
 4.6.1.9	4.2.3.11
 4.6.1.10	4.2.3.12
 4.6.1.11	4.2.3.13
+5.1.1.n1	5.1.1.20
 5.1.3.n1	5.1.3.24
 5.1.3.n2	5.1.3.29
 5.1.3.n3	5.1.3.32
@@ -881,9 +921,12 @@
 6.3.1.3	6.3.4.13
 6.3.1.16	6.3.3.6
 6.3.2.15	6.3.2.10
+6.3.2.19	2.3.2.23	2.3.2.27	6.2.1.45
 6.3.2.22	6.3.1.14
 6.3.2.27	6.3.2.38	6.3.2.39
+6.3.2.28	6.3.2.49
 6.3.2.n1	6.3.2.37
+6.3.2.n2	6.3.1.19
 6.3.2.n4	6.3.2.43
 6.3.2.n5	6.3.2.44
 6.3.2.n6	6.3.2.41
diff --git a/c++/src/objects/seqfeat/ecnum_specific.inc b/c++/src/objects/seqfeat/ecnum_specific.inc
index 021e2d5..6cc5dc3 100644
--- a/c++/src/objects/seqfeat/ecnum_specific.inc
+++ b/c++/src/objects/seqfeat/ecnum_specific.inc
@@ -1,4 +1,4 @@
-/*  $Id: ecnum_specific.inc 457265 2015-01-21 19:09:40Z kans $
+/*  $Id: ecnum_specific.inc 493886 2016-03-02 14:19:14Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -81,8 +81,8 @@ static const char* const kECNum_specific[] = {
     "1.1.1.49	Glucose-6-phosphate dehydrogenase (NADP(+))",
     "1.1.1.50	3-alpha-hydroxysteroid 3-dehydrogenase (Si-specific)",
     "1.1.1.51	3(or 17)-beta-hydroxysteroid dehydrogenase",
-    "1.1.1.52	3-alpha-hydroxycholanate dehydrogenase",
-    "1.1.1.53	3-alpha-(or 20-beta)-hydroxysteroid dehydrogenase",
+    "1.1.1.52	3-alpha-hydroxycholanate dehydrogenase (NAD(+) )",
+    "1.1.1.53	3-alpha(or 20-beta)-hydroxysteroid dehydrogenase",
     "1.1.1.54	Allyl-alcohol dehydrogenase",
     "1.1.1.55	Lactaldehyde reductase (NADPH)",
     "1.1.1.56	Ribitol 2-dehydrogenase",
@@ -111,7 +111,7 @@ static const char* const kECNum_specific[] = {
     "1.1.1.83	D-malate dehydrogenase (decarboxylating)",
     "1.1.1.84	Dimethylmalate dehydrogenase",
     "1.1.1.85	3-isopropylmalate dehydrogenase",
-    "1.1.1.86	Ketol-acid reductoisomerase",
+    "1.1.1.86	Ketol-acid reductoisomerase (NADP(+))",
     "1.1.1.87	Homoisocitrate dehydrogenase",
     "1.1.1.88	Hydroxymethylglutaryl-CoA reductase",
     "1.1.1.90	Aryl-alcohol dehydrogenase",
@@ -286,7 +286,7 @@ static const char* const kECNum_specific[] = {
     "1.1.1.273	Vellosimine dehydrogenase",
     "1.1.1.274	2,5-didehydrogluconate reductase (2-dehydro-D-gluconate-forming)",
     "1.1.1.275	(+)-trans-carveol dehydrogenase",
-    "1.1.1.276	Serine 3-dehydrogenase",
+    "1.1.1.276	Serine 3-dehydrogenase (NADP(+))",
     "1.1.1.277	3-beta-hydroxy-5-beta-steroid dehydrogenase",
     "1.1.1.278	3-beta-hydroxy-5-alpha-steroid dehydrogenase",
     "1.1.1.279	(R)-3-hydroxyacid-ester dehydrogenase",
@@ -388,6 +388,18 @@ static const char* const kECNum_specific[] = {
     "1.1.1.376	L-arabinose 1-dehydrogenase (NAD(P)(+))",
     "1.1.1.377	L-rhamnose 1-dehydrogenase (NADP(+))",
     "1.1.1.378	L-rhamnose 1-dehydrogenase (NAD(P)(+))",
+    "1.1.1.379	(R)-mandelate dehydrogenase",
+    "1.1.1.380	L-gulonate 5-dehydrogenase",
+    "1.1.1.381	3-hydroxy acid dehydrogenase",
+    "1.1.1.382	Ketol-acid reductoisomerase (NAD(+))",
+    "1.1.1.383	Ketol-acid reductoisomerase (NAD(P)(+))",
+    "1.1.1.384	dTDP-3,4-didehydro-2,6-dideoxy-alpha-D-glucose 3-reductase",
+    "1.1.1.385	Dihydroanticapsin 7-dehydrogenase",
+    "1.1.1.386	Ipsdienol dehydrogenase",
+    "1.1.1.387	L-serine 3-dehydrogenase (NAD(+))",
+    "1.1.1.388	Glucose-6-phosphate dehydrogenase (NAD(+))",
+    "1.1.1.389	2-dehydro-3-deoxy-L-galactonate 5-dehydrogenase",
+    "1.1.1.390	Sulfoquinovose 1-dehydrogenase",
     "1.1.1.n4	(-)-trans-carveol dehydrogenase",
     "1.1.1.n5	3-methylmalate dehydrogenase",
     "1.1.1.n11	Succinic semialdehyde reductase",
@@ -432,8 +444,8 @@ static const char* const kECNum_specific[] = {
     "1.1.3.44	6'''-hydroxyneomycin C oxidase",
     "1.1.3.45	Aclacinomycin-N oxidase",
     "1.1.3.46	4-hydroxymandelate oxidase",
-    "1.1.4.1	Vitamin-K-epoxide reductase (warfarin-sensitive)",
-    "1.1.4.2	Vitamin-K-epoxide reductase (warfarin-insensitive)",
+    "1.1.3.47	5-(hydroxymethyl)furfural oxidase",
+    "1.1.3.48	3-deoxy-alpha-D-manno-octulosonate 8-oxidase",
     "1.1.5.2	Quinoprotein glucose dehydrogenase (PQQ, quinone)",
     "1.1.5.3	Glycerol-3-phosphate dehydrogenase",
     "1.1.5.4	Malate dehydrogenase (quinone)",
@@ -531,7 +543,7 @@ static const char* const kECNum_specific[] = {
     "1.2.1.61	4-hydroxymuconic-semialdehyde dehydrogenase",
     "1.2.1.62	4-formylbenzenesulfonate dehydrogenase",
     "1.2.1.63	6-oxohexanoate dehydrogenase",
-    "1.2.1.64	4-hydroxybenzaldehyde dehydrogenase",
+    "1.2.1.64	4-hydroxybenzaldehyde dehydrogenase (NAD(+))",
     "1.2.1.65	Salicylaldehyde dehydrogenase",
     "1.2.1.67	Vanillin dehydrogenase",
     "1.2.1.68	Coniferyl-aldehyde dehydrogenase",
@@ -556,6 +568,14 @@ static const char* const kECNum_specific[] = {
     "1.2.1.87	Propanal dehydrogenase (CoA-propanoylating)",
     "1.2.1.88	L-glutamate gamma-semialdehyde dehydrogenase",
     "1.2.1.89	D-glyceraldehyde dehydrogenase (NADP(+))",
+    "1.2.1.90	Glyceraldehyde-3-phosphate dehydrogenase (NAD(P)(+))",
+    "1.2.1.91	3-oxo-5,6-dehydrosuberyl-CoA semialdehyde dehydrogenase",
+    "1.2.1.92	3,6-anhydro-alpha-L-galactose dehydrogenase",
+    "1.2.1.93	Formate dehydrogenase (NAD(+), ferredoxin)",
+    "1.2.1.94	Farnesal dehydrogenase",
+    "1.2.1.95	L-2-aminoadipate reductase",
+    "1.2.1.96	4-hydroxybenzaldehyde dehydrogenase (NADP(+))",
+    "1.2.1.97	3-sulfolactaldehyde dehydrogenase",
     "1.2.1.n2	Fatty acyl-CoA reductase",
     "1.2.2.1	Formate dehydrogenase (cytochrome)",
     "1.2.2.3	Formate dehydrogenase (cytochrome c-553)",
@@ -574,6 +594,7 @@ static const char* const kECNum_specific[] = {
     "1.2.4.2	Oxoglutarate dehydrogenase (succinyl-transferring)",
     "1.2.4.4	3-methyl-2-oxobutanoate dehydrogenase (2-methylpropanoyl-transferring)",
     "1.2.5.1	Pyruvate dehydrogenase (quinone)",
+    "1.2.5.2	Aldehyde dehydrogenase (quinone)",
     "1.2.7.1	Pyruvate synthase",
     "1.2.7.3	2-oxoglutarate synthase",
     "1.2.7.4	Carbon-monoxide dehydrogenase (ferredoxin)",
@@ -583,9 +604,8 @@ static const char* const kECNum_specific[] = {
     "1.2.7.8	Indolepyruvate ferredoxin oxidoreductase",
     "1.2.7.10	Oxalate oxidoreductase",
     "1.2.7.11	2-oxoacid oxidoreductase (ferredoxin)",
+    "1.2.98.1	Formaldehyde dismutase",
     "1.2.99.2	Carbon-monoxide dehydrogenase (acceptor)",
-    "1.2.99.3	Aldehyde dehydrogenase (pyrroloquinoline-quinone)",
-    "1.2.99.4	Formaldehyde dismutase",
     "1.2.99.5	Formylmethanofuran dehydrogenase",
     "1.2.99.6	Carboxylate reductase",
     "1.2.99.7	Aldehyde dehydrogenase (FAD-independent)",
@@ -621,7 +641,6 @@ static const char* const kECNum_specific[] = {
     "1.3.1.32	Maleylacetate reductase",
     "1.3.1.33	Protochlorophyllide reductase",
     "1.3.1.34	2,4-dienoyl-CoA reductase (NADPH)",
-    "1.3.1.35	Phosphatidylcholine desaturase",
     "1.3.1.36	Geissoschizine dehydrogenase",
     "1.3.1.37	Cis-2-enoyl-CoA reductase (NADPH)",
     "1.3.1.38	Trans-2-enoyl-CoA reductase (NADPH)",
@@ -644,7 +663,6 @@ static const char* const kECNum_specific[] = {
     "1.3.1.58	2,3-dihydroxy-2,3-dihydro-p-cumate dehydrogenase",
     "1.3.1.60	Dibenzothiophene dihydrodiol dehydrogenase",
     "1.3.1.62	Pimeloyl-CoA dehydrogenase",
-    "1.3.1.63	2,4-dichlorobenzoyl-CoA reductase",
     "1.3.1.64	Phthalate 4,5-cis-dihydrodiol dehydrogenase",
     "1.3.1.65	5,6-dihydroxy-3-methyl-2-oxo-1,2,5,6-tetrahydroquinoline dehydrogenase",
     "1.3.1.66	Cis-dihydroethylcatechol dehydrogenase",
@@ -689,6 +707,9 @@ static const char* const kECNum_specific[] = {
     "1.3.1.105	2-methylene-furan-3-one reductase",
     "1.3.1.106	Cobalt-precorrin-6A reductase",
     "1.3.1.107	Sanguinarine reductase",
+    "1.3.1.108	Caffeoyl-CoA reductase",
+    "1.3.1.109	Butanoyl-CoA dehydrogenase (NAD(+),ferredoxin)",
+    "1.3.1.110	Lactate dehydrogenase (NAD(+),ferredoxin)",
     "1.3.1.n2	Camalexin synthase",
     "1.3.1.n3	Curcumin reductase",
     "1.3.2.3	L-galactonolactone dehydrogenase",
@@ -720,6 +741,7 @@ static const char* const kECNum_specific[] = {
     "1.3.7.7	Ferredoxin:protochlorophyllide reductase (ATP-dependent)",
     "1.3.7.8	Benzoyl-CoA reductase",
     "1.3.7.9	4-hydroxybenzoyl-CoA reductase",
+    "1.3.7.11	2,3-bis-O-geranylgeranyl-sn-glycero-phospholipid reductase",
     "1.3.8.1	Short-chain acyl-CoA dehydrogenase",
     "1.3.8.2	4,4'-diapophytoene desaturase (4,4'-diapolycopene-forming)",
     "1.3.8.3	(R)-benzylsuccinyl-CoA dehydrogenase",
@@ -731,6 +753,7 @@ static const char* const kECNum_specific[] = {
     "1.3.8.9	Very-long-chain acyl-CoA dehydrogenase",
     "1.3.8.10	Cyclohex-1-ene-1-carbonyl-CoA dehydrogenase",
     "1.3.8.11	Cyclohexane-1-carbonyl-CoA dehydrogenase",
+    "1.3.8.12	(2S)-methylsuccinyl-CoA dehydrogenase",
     "1.3.98.1	Dihydroorotate oxidase (fumarate)",
     "1.3.99.4	3-oxosteroid 1-dehydrogenase",
     "1.3.99.5	3-oxo-5-alpha-steroid 4-dehydrogenase (acceptor)",
@@ -754,9 +777,9 @@ static const char* const kECNum_specific[] = {
     "1.3.99.31	Phytoene desaturase (lycopene-forming)",
     "1.3.99.32	Glutaryl-CoA dehydrogenase (acceptor)",
     "1.3.99.33	Urocanate reductase",
-    "1.3.99.34	2,3-bis-O-geranylgeranyl-sn-glycerol 1-phosphate reductase (donor)",
     "1.3.99.35	Chlorophyllide a reductase",
     "1.3.99.36	Cypemycin cysteine dehydrogenase (decarboxylating)",
+    "1.3.99.37	1-hydroxy-2-isopentenylcarotenoid 3,4-desaturase",
     "1.3.99.n1	3-hydroxybenzoyl-CoA reductase",
     "1.4.1.1	Alanine dehydrogenase",
     "1.4.1.2	Glutamate dehydrogenase",
@@ -806,10 +829,10 @@ static const char* const kECNum_specific[] = {
     "1.4.7.1	Glutamate synthase (ferredoxin)",
     "1.4.9.1	Methylamine dehydrogenase (amicyanin)",
     "1.4.9.2	Aralkylamine dehydrogenase (azurin)",
-    "1.4.99.1	D-amino-acid dehydrogenase",
     "1.4.99.2	Taurine dehydrogenase",
     "1.4.99.5	Glycine dehydrogenase (cyanide-forming)",
-    "1.5.1.1	Pyrroline-2-carboxylate reductase",
+    "1.4.99.6	D-arginine dehydrogenase",
+    "1.5.1.1	1-piperideine-2-carboxylate/1-pyrroline-2-carboxylate reductase (NAD(P)H)",
     "1.5.1.2	Pyrroline-5-carboxylate reductase",
     "1.5.1.3	Dihydrofolate reductase",
     "1.5.1.5	Methylenetetrahydrofolate dehydrogenase (NADP(+))",
@@ -825,7 +848,7 @@ static const char* const kECNum_specific[] = {
     "1.5.1.18	Ephedrine dehydrogenase",
     "1.5.1.19	D-nopaline dehydrogenase",
     "1.5.1.20	Methylenetetrahydrofolate reductase (NAD(P)H)",
-    "1.5.1.21	Delta(1)-piperideine-2-carboxylate reductase",
+    "1.5.1.21	1-piperideine-2-carboxylate/1-pyrroline-2-carboxylate reductase (NADPH)",
     "1.5.1.22	Strombine dehydrogenase",
     "1.5.1.23	Tauropine dehydrogenase",
     "1.5.1.24	N(5)-(carboxyethyl)ornithine synthase",
@@ -851,6 +874,8 @@ static const char* const kECNum_specific[] = {
     "1.5.1.46	Agroclavine dehydrogenase",
     "1.5.1.47	Dihydromethanopterin reductase (NAD(P)(+))",
     "1.5.1.48	2-methyl-1-pyrroline reductase",
+    "1.5.1.49	1-pyrroline-2-carboxylate reductase (NAD(P)H)",
+    "1.5.1.50	Dihydromonapterin reductase",
     "1.5.3.1	Sarcosine oxidase",
     "1.5.3.2	N-methyl-L-amino-acid oxidase",
     "1.5.3.4	N(6)-methyl-lysine oxidase",
@@ -891,6 +916,8 @@ static const char* const kECNum_specific[] = {
     "1.6.1.1	NAD(P)(+) transhydrogenase (Si-specific)",
     "1.6.1.2	NAD(P)(+) transhydrogenase (Re/Si-specific)",
     "1.6.1.3	NAD(P)(+) transhydrogenase",
+    "1.6.1.4	NAD(P)(+) transhydrogenase (ferredoxin)",
+    "1.6.1.5	Proton-translocating NAD(P)(+) transhydrogenase",
     "1.6.2.2	Cytochrome-b5 reductase",
     "1.6.2.4	NADPH--hemoprotein reductase",
     "1.6.2.5	NADPH--cytochrome-c2 reductase",
@@ -909,10 +936,11 @@ static const char* const kECNum_specific[] = {
     "1.6.5.8	NADH:ubiquinone reductase (Na(+)-transporting)",
     "1.6.5.9	NADH:ubiquinone reductase (non-electrogenic)",
     "1.6.5.10	NADPH dehydrogenase (quinone)",
+    "1.6.5.11	NADH dehydrogenase (quinone)",
+    "1.6.5.12	Demethylphylloquinone reductase",
     "1.6.6.9	Trimethylamine-N-oxide reductase",
     "1.6.99.1	NADPH dehydrogenase",
     "1.6.99.3	NADH dehydrogenase",
-    "1.6.99.5	NADH dehydrogenase (quinone)",
     "1.6.99.n1	NADPH dehydrogenase (coenzyme F420 dependent)",
     "1.7.1.1	Nitrate reductase (NADH)",
     "1.7.1.2	Nitrate reductase (NAD(P)H)",
@@ -947,7 +975,7 @@ static const char* const kECNum_specific[] = {
     "1.7.99.1	Hydroxylamine reductase",
     "1.7.99.4	Nitrate reductase",
     "1.7.99.8	Hydrazine oxidoreductase",
-    "1.8.1.2	Sulfite reductase (NADPH)",
+    "1.8.1.2	Assimilatory sulfite reductase (NADPH)",
     "1.8.1.3	Hypotaurine dehydrogenase",
     "1.8.1.4	Dihydrolipoyl dehydrogenase",
     "1.8.1.5	2-oxopropyl-CoM reductase (carboxylating)",
@@ -991,17 +1019,17 @@ static const char* const kECNum_specific[] = {
     "1.8.5.2	Thiosulfate dehydrogenase (quinone)",
     "1.8.5.3	Dimethylsulfoxide reductase",
     "1.8.5.4	Sulfide:quinone reductase",
-    "1.8.7.1	Sulfite reductase (ferredoxin)",
+    "1.8.7.1	Assimilatory sulfite reductase (ferredoxin)",
     "1.8.7.2	Ferredoxin:thioredoxin reductase",
     "1.8.98.1	CoB--CoM heterodisulfide reductase",
     "1.8.98.2	Sulfiredoxin",
     "1.8.98.3	Sulfite reductase (coenzyme F420)",
-    "1.8.99.1	Sulfite reductase",
     "1.8.99.2	Adenylyl-sulfate reductase",
     "1.8.99.3	Hydrogensulfite reductase",
+    "1.8.99.5	Dissimilatory sulfite reductase",
     "1.9.3.1	Cytochrome-c oxidase",
     "1.9.6.1	Nitrate reductase (cytochrome)",
-    "1.9.99.1	Iron--cytochrome-c reductase",
+    "1.9.98.1	Iron--cytochrome-c reductase",
     "1.10.1.1	Trans-acenaphthene-1,2-diol dehydrogenase",
     "1.10.2.1	L-ascorbate--cytochrome-b5 reductase",
     "1.10.2.2	Quinol--cytochrome-c reductase",
@@ -1018,9 +1046,8 @@ static const char* const kECNum_specific[] = {
     "1.10.3.13	Caldariellaquinol oxidase (H(+)-transporting)",
     "1.10.3.14	Ubiquinol oxidase (electrogenic, non H(+)-transporting)",
     "1.10.3.15	Grixazone synthase",
+    "1.10.5.1	Ribosyldihydronicotinamide dehydrogenase (quinone)",
     "1.10.9.1	Plastoquinol--plastocyanin reductase",
-    "1.10.99.2	Ribosyldihydronicotinamide dehydrogenase (quinone)",
-    "1.10.99.3	Violaxanthin de-epoxidase",
     "1.11.1.1	NADH peroxidase",
     "1.11.1.2	NADPH peroxidase",
     "1.11.1.3	Fatty-acid peroxidase",
@@ -1075,7 +1102,7 @@ static const char* const kECNum_specific[] = {
     "1.13.11.15	3,4-dihydroxyphenylacetate 2,3-dioxygenase",
     "1.13.11.16	3-carboxyethylcatechol 2,3-dioxygenase",
     "1.13.11.17	Indole 2,3-dioxygenase",
-    "1.13.11.18	Sulfur dioxygenase",
+    "1.13.11.18	Persulfide dioxygenase",
     "1.13.11.19	Cysteamine dioxygenase",
     "1.13.11.20	Cysteine dioxygenase",
     "1.13.11.22	Caffeate 3,4-dioxygenase",
@@ -1133,6 +1160,9 @@ static const char* const kECNum_specific[] = {
     "1.13.11.77	Oleate 10S-lipoxygenase",
     "1.13.11.78	2-amino-1-hydroxyethylphosphonate dioxygenase (glycine-forming)",
     "1.13.11.79	5,6-dimethylbenzimidazole synthase",
+    "1.13.11.80	(3,5-dihydroxyphenyl)acetyl-CoA 1,2-dioxygenase",
+    "1.13.11.81	7,8-dihydroneopterin oxygenase",
+    "1.13.11.82	8'-apo-carotenoid 13,14-cleaving dioxygenase",
     "1.13.12.1	Arginine 2-monooxygenase",
     "1.13.12.2	Lysine 2-monooxygenase",
     "1.13.12.3	Tryptophan 2-monooxygenase",
@@ -1150,6 +1180,7 @@ static const char* const kECNum_specific[] = {
     "1.13.12.19	2-oxuglutarate dioxygenase (ethylene-forming)",
     "1.13.12.20	Noranthrone monooxygenase",
     "1.13.12.21	Tetracenomycin-F1 monooxygenase",
+    "1.13.12.22	Deoxynogalonate monooxygenase",
     "1.13.99.1	Inositol oxygenase",
     "1.13.99.3	Tryptophan 2'-dioxygenase",
     "1.14.11.1	Gamma-butyrobetaine dioxygenase",
@@ -1198,6 +1229,8 @@ static const char* const kECNum_specific[] = {
     "1.14.11.45	L-isoleucine 4-hydroxylase",
     "1.14.11.46	2-aminoethylphosphonate dioxygenase",
     "1.14.11.47	50S ribosomal protein L16 3-hydroxylase",
+    "1.14.11.48	Xanthine dioxygenase",
+    "1.14.11.49	Uridine-5'-phosphate dioxygenase",
     "1.14.11.n2	Methylcytosine dioxygenase",
     "1.14.11.n3	L-proline cis-4-hydroxylase",
     "1.14.11.n4	Ankyrin-repeat-histidine dioxagenase",
@@ -1219,8 +1252,9 @@ static const char* const kECNum_specific[] = {
     "1.14.12.18	Biphenyl 2,3-dioxygenase",
     "1.14.12.19	3-phenylpropanoate dioxygenase",
     "1.14.12.20	Pheophorbide a oxygenase",
-    "1.14.12.21	Benzoyl-CoA 2,3-dioxygenase",
     "1.14.12.22	Carbazole 1,9a-dioxygenase",
+    "1.14.12.23	Nitroarene dioxygenase",
+    "1.14.12.24	2,4-dinitrotoluene dioxygenase",
     "1.14.13.1	Salicylate 1-monooxygenase",
     "1.14.13.2	4-hydroxybenzoate 3-monooxygenase",
     "1.14.13.4	Melilotate 3-monooxygenase",
@@ -1245,7 +1279,6 @@ static const char* const kECNum_specific[] = {
     "1.14.13.23	3-hydroxybenzoate 4-monooxygenase",
     "1.14.13.24	3-hydroxybenzoate 6-monooxygenase",
     "1.14.13.25	Methane monooxygenase (soluble)",
-    "1.14.13.26	Phosphatidylcholine 12-monooxygenase",
     "1.14.13.27	4-aminobenzoate 1-monooxygenase",
     "1.14.13.28	3,9-dihydroxypterocarpan 6A-monooxygenase",
     "1.14.13.29	4-nitrophenol 2-monooxygenase",
@@ -1258,7 +1291,7 @@ static const char* const kECNum_specific[] = {
     "1.14.13.36	5-O-(4-coumaroyl)-D-quinate 3'-monooxygenase",
     "1.14.13.37	Methyltetrahydroprotoberberine 14-monooxygenase",
     "1.14.13.38	Anhydrotetracycline monooxygenase",
-    "1.14.13.39	Nitric-oxide synthase (NADPH dependent)",
+    "1.14.13.39	Nitric-oxide synthase (NADPH)",
     "1.14.13.40	Anthraniloyl-CoA monooxygenase",
     "1.14.13.41	Tyrosine N-monooxygenase",
     "1.14.13.43	Questin monooxygenase",
@@ -1309,7 +1342,6 @@ static const char* const kECNum_specific[] = {
     "1.14.13.92	Phenylacetone monooxygenase",
     "1.14.13.93	(+)-abscisic acid 8'-hydroxylase",
     "1.14.13.94	Lithocholate 6-beta-hydroxylase",
-    "1.14.13.95	7-alpha-hydroxycholest-4-en-3-one 12-alpha-hydroxylase",
     "1.14.13.96	5-beta-cholestane-3-alpha,7-alpha-diol 12-alpha-hydroxylase",
     "1.14.13.97	Taurochenodeoxycholate 6-alpha-hydroxylase",
     "1.14.13.98	Cholesterol 24-hydroxylase",
@@ -1346,7 +1378,6 @@ static const char* const kECNum_specific[] = {
     "1.14.13.129	Beta-carotene 3-hydroxylase",
     "1.14.13.130	Pyrrole-2-carboxylate monooxygenase",
     "1.14.13.131	Dimethyl-sulfide monooxygenase",
-    "1.14.13.132	Squalene monooxygenase",
     "1.14.13.133	Pentalenene oxygenase",
     "1.14.13.134	Beta-amyrin 11-oxidase",
     "1.14.13.135	1-hydroxy-2-naphthoate hydroxylase",
@@ -1378,11 +1409,10 @@ static const char* const kECNum_specific[] = {
     "1.14.13.161	(+)-camphor 6-exo-hydroxylase",
     "1.14.13.162	2,5-diketocamphane 1,2-monooxygenase",
     "1.14.13.163	6-hydroxy-3-succinoylpyridine 3-monooxygenase",
-    "1.14.13.165	Nitric-oxide synthase (NAD(P)H-dependent)",
+    "1.14.13.165	Nitric-oxide synthase (NAD(P)H)",
     "1.14.13.166	4-nitrocatechol 4-monooxygenase",
     "1.14.13.167	4-nitrophenol 4-monooxygenase",
     "1.14.13.168	Indole-3-pyruvate monooxygenase",
-    "1.14.13.169	Sphinganine C(4)-monooxygenase",
     "1.14.13.170	Pentalenolactone D synthase",
     "1.14.13.171	Neopentalenolactone D synthase",
     "1.14.13.172	Salicylate 5-hydroxylase",
@@ -1414,6 +1444,15 @@ static const char* const kECNum_specific[] = {
     "1.14.13.198	Monacolin L hydroxylase",
     "1.14.13.199	Docosahexaenoic acid omega-hydroxylase",
     "1.14.13.200	Tetracenomycin A2 monooxygenase-diooxygenase",
+    "1.14.13.201	Beta-amyrin 28-monooxygenase",
+    "1.14.13.202	Methyl farnesoate epoxidase",
+    "1.14.13.203	Farnesoate epoxidase",
+    "1.14.13.204	Long-chain acyl-CoA omega-monooxygenase",
+    "1.14.13.205	Long-chain fatty acid omega-monooxygenase",
+    "1.14.13.206	Laurate 7-monooxygenase",
+    "1.14.13.207	Ipsdienol synthase",
+    "1.14.13.208	Benzoyl-CoA 2,3-epoxidase",
+    "1.14.13.209	Salicyloyl-CoA 5-hydroxylase",
     "1.14.13.n5	Dihomomethionine N-hydroxylase",
     "1.14.13.n6	Hexahomomethionine N-hydroxylase",
     "1.14.13.n7	4-nitrophenol 2-hydroxylase",
@@ -1429,6 +1468,10 @@ static const char* const kECNum_specific[] = {
     "1.14.14.13	4-(gamma-L-glutamylamino)butanoyl-[BtrI acyl-carrier protein] monooxygenase",
     "1.14.14.14	Aromatase",
     "1.14.14.15	(3S)-3-amino-3-(3-chloro-4-hydroxyphenyl)propanoyl-[peptidyl-carrier protein SgcC2] monooxygenase",
+    "1.14.14.16	Steroid 21-monooxygenase",
+    "1.14.14.17	Squalene monooxygenase",
+    "1.14.14.18	Heme oxygenase (biliverdin-producing)",
+    "1.14.14.19	Steroid 17-alpha-monooxygenase",
     "1.14.15.1	Camphor 5-monooxygenase",
     "1.14.15.3	Alkane 1-monooxygenase",
     "1.14.15.4	Steroid 11-beta-monooxygenase",
@@ -1441,6 +1484,7 @@ static const char* const kECNum_specific[] = {
     "1.14.15.11	Pentalenic acid synthase",
     "1.14.15.12	Pimeloyl-[acyl-carrier protein] synthase",
     "1.14.15.13	Pulcherriminic acid synthase",
+    "1.14.15.14	Methyl-branched lipid omega-hydroxylase",
     "1.14.16.1	Phenylalanine 4-monooxygenase",
     "1.14.16.2	Tyrosine 3-monooxygenase",
     "1.14.16.3	Anthranilate 3-monooxygenase",
@@ -1454,14 +1498,57 @@ static const char* const kECNum_specific[] = {
     "1.14.18.1	Tyrosinase",
     "1.14.18.2	CMP-N-acetylneuraminate monooxygenase",
     "1.14.18.3	Methane monooxygenase (particulate)",
+    "1.14.18.4	Phosphatidylcholine 12-monooxygenase",
+    "1.14.18.5	Sphingolipid C4-monooxygenase",
+    "1.14.18.6	4-hydroxysphinganine ceramide fatty acyl 2-hydroxylase",
+    "1.14.18.7	Dihydroceramide fatty acyl 2-hydroxylase",
+    "1.14.18.8	7-alpha-hydroxycholest-4-en-3-one 12-alpha-hydroxylase",
     "1.14.19.1	Stearoyl-CoA 9-desaturase",
-    "1.14.19.2	Acyl-[acyl-carrier-protein] desaturase",
-    "1.14.19.3	Linoleoyl-CoA desaturase",
-    "1.14.19.4	Delta(8)-fatty-acid desaturase",
-    "1.14.19.5	Delta(11)-fatty-acid desaturase",
-    "1.14.19.6	Delta(12)-fatty-acid desaturase",
+    "1.14.19.2	Stearoyl-[acyl-carrier-protein] 9-desaturase",
+    "1.14.19.3	Acyl-CoA 6-desaturase",
+    "1.14.19.4	Acyl-lipid (11-3)-desaturase",
+    "1.14.19.5	Acyl-CoA 11-(Z)-desaturase",
+    "1.14.19.6	Acyl-CoA (9+3)-desaturase",
     "1.14.19.8	Pentalenolactone synthase",
     "1.14.19.9	Tryptophan 7-halogenase",
+    "1.14.19.10	Icosanoyl-CoA 5-desaturase",
+    "1.14.19.11	Acyl-[acyl-carrier-protein] 4-desaturase",
+    "1.14.19.12	Acyl-lipid omega-(9-4) desaturase",
+    "1.14.19.13	Acyl-CoA 15-desaturase",
+    "1.14.19.14	Linoleoyl-lipid Delta(9) conjugase",
+    "1.14.19.15	(11Z)-hexadec-11-enoyl-CoA conjugase",
+    "1.14.19.16	Linoleoyl-lipid Delta(12) conjugase (11E,13Z-forming)",
+    "1.14.19.17	Sphingolipid 4-desaturase",
+    "1.14.19.18	Sphingolipid 8-(E)-desaturase",
+    "1.14.19.19	Sphingolipid 10-desaturase",
+    "1.14.19.20	Delta(7)-sterol 5(6)-desaturase",
+    "1.14.19.21	Cholesterol 7-desaturase",
+    "1.14.19.22	Acyl-lipid omega-6 desaturase (cytochrome b5)",
+    "1.14.19.23	Acyl-lipid (n+3)-(Z)-desaturase (ferredoxin)",
+    "1.14.19.24	Acyl-CoA 11-(E)-desaturase",
+    "1.14.19.25	Acyl-lipid omega-3 desaturase (cytochrome b5)",
+    "1.14.19.26	Acyl-[acyl-carrier-protein] 6-desaturase",
+    "1.14.19.27	sn-2 palmitoyl-lipid 9-desaturase",
+    "1.14.19.28	sn-1 stearoyl-lipid 9-desaturase",
+    "1.14.19.29	Sphingolipid 8-(E/Z)-desaturase",
+    "1.14.19.30	Acyl-lipid (8-3)-desaturase",
+    "1.14.19.31	Acyl-lipid (7-3)-desaturase",
+    "1.14.19.32	Palmitoyl-CoA 14-(E/Z)-desaturase",
+    "1.14.19.33	Delta(12) acyl-lipid conjugase (11E,13E-forming)",
+    "1.14.19.34	Acyl-lipid (9+3)-(E)-desaturase",
+    "1.14.19.35	sn-2 acyl-lipid omega-3 desaturase (ferredoxin)",
+    "1.14.19.36	sn-1 acyl-lipid omega-3 desaturase (ferredoxin)",
+    "1.14.19.37	Acyl-CoA 5-desaturase",
+    "1.14.19.38	Acyl-lipid Delta(6)-acetylenase",
+    "1.14.19.39	Acyl-lipid Delta(12)-acetylenase",
+    "1.14.19.40	Hex-5-enoyl-[acyl-carrier protein] acetylenase",
+    "1.14.19.41	Sterol 22-desaturase",
+    "1.14.19.42	Palmitoyl-[glycerolipid] 7-desaturase",
+    "1.14.19.43	Palmitoyl-[glycerolipid] 3-(E)-desaturase",
+    "1.14.19.44	Acyl-CoA (8-3)-desaturase",
+    "1.14.19.45	sn-1 oleoyl-lipid 12-desaturase",
+    "1.14.19.46	sn-1 linoleoyl-lipid 6-desaturase",
+    "1.14.19.47	Acyl-lipid (9-3)-desaturase",
     "1.14.19.n4	Stearoyl-CoA 9-desaturase",
     "1.14.19.n5	Versicolorin B desaturase",
     "1.14.20.1	Deacetoxycephalosporin-C synthase",
@@ -1472,17 +1559,13 @@ static const char* const kECNum_specific[] = {
     "1.14.21.3	Berbamunine synthase",
     "1.14.21.4	Salutaridine synthase",
     "1.14.21.5	(S)-canadine synthase",
-    "1.14.21.6	Lathosterol oxidase",
     "1.14.21.7	Biflaviolin synthase",
     "1.14.21.8	Pseudobaptigenin synthase",
     "1.14.21.9	Mycocyclosin synthase",
     "1.14.21.10	Fumitremorgin C synthase",
     "1.14.99.1	Prostaglandin-endoperoxide synthase",
     "1.14.99.2	Kynurenine 7,8-hydroxylase",
-    "1.14.99.3	Heme oxygenase (biliverdin-producing)",
     "1.14.99.4	Progesterone monooxygenase",
-    "1.14.99.9	Steroid 17-alpha-monooxygenase",
-    "1.14.99.10	Steroid 21-monooxygenase",
     "1.14.99.11	Estradiol 6-beta-monooxygenase",
     "1.14.99.12	Androst-4-ene-3,17-dione monooxygenase",
     "1.14.99.14	Progesterone 11-alpha-monooxygenase",
@@ -1496,9 +1579,6 @@ static const char* const kECNum_specific[] = {
     "1.14.99.26	2-hydroxypyridine 5-monooxygenase",
     "1.14.99.27	Juglone 3-monooxygenase",
     "1.14.99.29	Deoxyhypusine monooxygenase",
-    "1.14.99.31	Myristoyl-CoA 11-(E) desaturase",
-    "1.14.99.32	Myristoyl-CoA 11-(Z) desaturase",
-    "1.14.99.33	Delta(12)-fatty acid dehydrogenase",
     "1.14.99.34	Monoprenyl isoflavone epoxidase",
     "1.14.99.35	Thiophene-2-carbonyl-CoA monooxygenase",
     "1.14.99.36	Beta-carotene 15,15'-monooxygenase",
@@ -1513,6 +1593,9 @@ static const char* const kECNum_specific[] = {
     "1.14.99.47	(+)-larreatricin hydroxylase",
     "1.14.99.48	Heme oxygenase (staphylobilin-producing)",
     "1.14.99.49	2-hydroxy-5-methyl-1-naphthoate 7-hydroxylase",
+    "1.14.99.50	Gamma-glutamyl hercynylcysteine S-oxide synthase",
+    "1.14.99.51	Hercynylcysteine S-oxide synthase",
+    "1.14.99.52	L-cysteinyl-L-histidinylsulfoxide synthase",
     "1.14.99.n4	Carotenoid 9,10-dioxygenase",
     "1.15.1.1	Superoxide dismutase",
     "1.15.1.2	Superoxide reductase",
@@ -1536,7 +1619,6 @@ static const char* const kECNum_specific[] = {
     "1.17.1.3	Leucoanthocyanidin reductase",
     "1.17.1.4	Xanthine dehydrogenase",
     "1.17.1.5	Nicotinate dehydrogenase",
-    "1.17.1.7	3-oxo-5,6-dehydrosuberyl-CoA semialdehyde dehydrogenase",
     "1.17.1.8	4-hydroxy-tetrahydrodipicolinate reductase",
     "1.17.2.1	Nicotinate dehydrogenase (cytochrome)",
     "1.17.2.2	Lupanine 17-hydroxylase (cytochrome c)",
@@ -1545,15 +1627,19 @@ static const char* const kECNum_specific[] = {
     "1.17.3.3	6-hydroxynicotinate dehydrogenase",
     "1.17.4.1	Ribonucleoside-diphosphate reductase",
     "1.17.4.2	Ribonucleoside-triphosphate reductase",
+    "1.17.4.4	Vitamin-K-epoxide reductase (warfarin-sensitive)",
+    "1.17.4.5	Vitamin-K-epoxide reductase (warfarin-insensitive)",
     "1.17.5.1	Phenylacetyl-CoA dehydrogenase",
     "1.17.5.2	Caffeine dehydrogenase",
-    "1.17.7.1	(E)-4-hydroxy-3-methylbut-2-enyl-diphosphate synthase",
+    "1.17.7.1	(E)-4-hydroxy-3-methylbut-2-enyl-diphosphate synthase (ferredoxin)",
     "1.17.7.2	7-hydroxymethyl chlorophyll a reductase",
+    "1.17.7.3	(E)-4-hydroxy-3-methylbut-2-enyl-diphosphate synthase (flavodoxin)",
+    "1.17.98.1	Bile-acid 7-alpha-dehydroxylase",
     "1.17.99.1	4-methylphenol dehydrogenase (hydroxylating)",
     "1.17.99.2	Ethylbenzene hydroxylase",
     "1.17.99.3	3-alpha,7-alpha,12-alpha-trihydroxy-5-beta-cholestanoyl-CoA 24-hydroxylase",
     "1.17.99.4	Uracil/thymine dehydrogenase",
-    "1.17.99.5	Bile-acid 7-alpha-dehydroxylase",
+    "1.17.99.6	Epoxyqueuosine reductase",
     "1.18.1.1	Rubredoxin--NAD(+) reductase",
     "1.18.1.2	Ferredoxin--NADP(+) reductase",
     "1.18.1.3	Ferredoxin--NAD(+) reductase",
@@ -1561,6 +1647,7 @@ static const char* const kECNum_specific[] = {
     "1.18.1.5	Putidaredoxin--NAD(+) reductase",
     "1.18.1.6	Adrenodoxin-NADP(+) reductase",
     "1.18.1.7	Ferredoxin--NAD(P)(+) reductase (naphthalene dioxygenase ferredoxin-specific)",
+    "1.18.1.8	Ferredoxin-NAD(+) oxidoreductase (Na(+)-transporting)",
     "1.18.6.1	Nitrogenase",
     "1.19.6.1	Nitrogenase (flavodoxin)",
     "1.20.1.1	Phosphonate dehydrogenase",
@@ -1568,8 +1655,11 @@ static const char* const kECNum_specific[] = {
     "1.20.4.1	Arsenate reductase (glutaredoxin)",
     "1.20.4.2	Methylarsonate reductase",
     "1.20.4.3	Mycoredoxin",
+    "1.20.4.4	Arsenate reductase (thioredoxin)",
     "1.20.9.1	Arsenate reductase (azurin)",
     "1.20.99.1	Arsenate reductase (donor)",
+    "1.21.1.1	Iodotyrosine deiodinase",
+    "1.21.1.2	2,4-dichlorobenzoyl-CoA reductase",
     "1.21.3.1	Isopenicillin-N synthase",
     "1.21.3.2	Columbamine oxidase",
     "1.21.3.3	Reticuline oxidase",
@@ -1583,20 +1673,20 @@ static const char* const kECNum_specific[] = {
     "1.21.4.2	Glycine reductase",
     "1.21.4.3	Sarcosine reductase",
     "1.21.4.4	Betaine reductase",
+    "1.21.98.1	Cyclic dehypoxanthinyl futalosine synthase",
     "1.21.99.1	Beta-cyclopiazonate dehydrogenase",
-    "1.21.99.2	Cyclic dehypoxanthinyl futalosine synthase",
-    "1.22.1.1	Iodotyrosine deiodinase",
+    "1.21.99.3	Thyroxine 5-deiodinase",
+    "1.21.99.4	Thyroxine 5'-deiodinase",
     "1.23.1.1	(+)-pinoresinol reductase",
     "1.23.1.2	(+)-lariciresinol reductase",
     "1.23.1.3	(-)-pinoresinol reductase",
     "1.23.1.4	(-)-lariciresinol reductase",
+    "1.23.5.1	Violaxanthin de-epoxidase",
     "1.97.1.1	Chlorate reductase",
     "1.97.1.2	Pyrogallol hydroxytransferase",
     "1.97.1.4	[Formate-C-acetyltransferase]-activating enzyme",
     "1.97.1.8	Tetrachloroethene reductive dehalogenase",
     "1.97.1.9	Selenate reductase",
-    "1.97.1.10	Thyroxine 5'-deiodinase",
-    "1.97.1.11	Thyroxine 5-deiodinase",
     "1.97.1.12	Photosystem I",
     "2.1.1.1	Nicotinamide N-methyltransferase",
     "2.1.1.2	Guanidinoacetate N-methyltransferase",
@@ -1705,9 +1795,6 @@ static const char* const kECNum_specific[] = {
     "2.1.1.121	6-O-methylnorlaudanosoline 5'-O-methyltransferase",
     "2.1.1.122	(S)-tetrahydroprotoberberine N-methyltransferase",
     "2.1.1.123	[Cytochrome c]-methionine S-methyltransferase",
-    "2.1.1.124	[Cytochrome c]-arginine N-methyltransferase",
-    "2.1.1.125	Histone-arginine N-methyltransferase",
-    "2.1.1.126	[Myelin basic protein]-arginine N-methyltransferase",
     "2.1.1.127	[Ribulose-bisphosphate carboxylase]-lysine N-methyltransferase",
     "2.1.1.128	(RS)-norcoclaurine 6-O-methyltransferase",
     "2.1.1.129	Inositol 4-methyltransferase",
@@ -1884,6 +1971,21 @@ static const char* const kECNum_specific[] = {
     "2.1.1.305	8-demethyl-8-alpha-L-rhamnosyl tetracenomycin-C 2'-O-methyltransferase",
     "2.1.1.306	8-demethyl-8-(2-methoxy-alpha-L-rhamnosyl)-tetracenomycin-C 3'-O-methyltransferase",
     "2.1.1.307	8-demethyl-8-(2,3-dimethoxy-alpha-L-rhamnosyl)-tetracenomycin-C 4'-O-methyltransferase",
+    "2.1.1.308	2-hydroxyethylphosphonate methyltransferase",
+    "2.1.1.309	18S rRNA (guanine(1575)-N(7))-methyltransferase",
+    "2.1.1.310	25S rRNA (cytosine(2870)-C(5))-methyltransferase",
+    "2.1.1.311	25S rRNA (cytosine(2278)-C(5))-methyltransferase",
+    "2.1.1.312	25S rRNA (uracil(2843)-N(3))-methyltransferase",
+    "2.1.1.313	25S rRNA (uracil(2634)-N(3))-methyltransferase",
+    "2.1.1.314	Diphthine methyl ester synthase",
+    "2.1.1.315	27-O-demethylrifamycin SV methyltransferase",
+    "2.1.1.316	Mitomycin 6-O-methyltransferase",
+    "2.1.1.317	Sphingolipid C(9)-methyltransferase",
+    "2.1.1.318	[Trehalose-6-phosphate synthase]-L-cysteine S-methyltransferase",
+    "2.1.1.319	Type I protein arginine methyltransferase",
+    "2.1.1.320	Type II protein arginine methyltransferase",
+    "2.1.1.321	Type III protein arginine methyltransferase",
+    "2.1.1.322	Type IV protein arginine methyltransferase",
     "2.1.1.n1	Resorcinol O-methyltransferase",
     "2.1.1.n4	Thiocyanate methyltransferase",
     "2.1.1.n7	5-pentadecatrienyl resorcinol O-methyltransferase",
@@ -1925,6 +2027,7 @@ static const char* const kECNum_specific[] = {
     "2.2.1.9	2-succinyl-5-enolpyruvyl-6-hydroxy-3-cyclohexene-1-carboxylic-acid synthase",
     "2.2.1.10	2-amino-3,7-dideoxy-D-threo-hept-6-ulosonate synthase",
     "2.2.1.11	6-deoxy-5-ketofructose 1-phosphate synthase",
+    "2.2.1.12	3-acetyloctanal synthase",
     "2.3.1.1	Amino-acid N-acetyltransferase",
     "2.3.1.2	Imidazole N-acetyltransferase",
     "2.3.1.3	Glucosamine N-acetyltransferase",
@@ -1983,7 +2086,7 @@ static const char* const kECNum_specific[] = {
     "2.3.1.57	Diamine N-acetyltransferase",
     "2.3.1.58	2,3-diaminopropionate N-oxalyltransferase",
     "2.3.1.59	Gentamicin 2'-N-acetyltransferase",
-    "2.3.1.60	Gentamicin 3'-N-acetyltransferase",
+    "2.3.1.60	Gentamicin 3-N-acetyltransferase",
     "2.3.1.61	Dihydrolipoyllysine-residue succinyltransferase",
     "2.3.1.62	2-acylglycerophosphocholine O-acyltransferase",
     "2.3.1.63	1-alkylglycerophosphocholine O-acyltransferase",
@@ -2003,8 +2106,8 @@ static const char* const kECNum_specific[] = {
     "2.3.1.78	Heparan-alpha-glucosaminide N-acetyltransferase",
     "2.3.1.79	Maltose O-acetyltransferase",
     "2.3.1.80	Cysteine-S-conjugate N-acetyltransferase",
-    "2.3.1.81	Aminoglycoside N(3')-acetyltransferase",
-    "2.3.1.82	Aminoglycoside N(6')-acetyltransferase",
+    "2.3.1.81	Aminoglycoside N(3)-acetyltransferase",
+    "2.3.1.82	Aminoglycoside 6'-N-acetyltransferase",
     "2.3.1.83	Phosphatidylcholine--dolichol O-acyltransferase",
     "2.3.1.84	Alcohol O-acetyltransferase",
     "2.3.1.85	Fatty-acid synthase",
@@ -2040,7 +2143,6 @@ static const char* const kECNum_specific[] = {
     "2.3.1.116	Flavonol-3-O-beta-glucoside O-malonyltransferase",
     "2.3.1.117	2,3,4,5-tetrahydropyridine-2,6-dicarboxylate N-succinyltransferase",
     "2.3.1.118	N-hydroxyarylamine O-acetyltransferase",
-    "2.3.1.119	Icosanoyl-CoA synthase",
     "2.3.1.121	1-alkenylglycerophosphoethanolamine O-acyltransferase",
     "2.3.1.122	Trehalose O-mycolyltransferase",
     "2.3.1.123	Dolichol O-acyltransferase",
@@ -2153,6 +2255,24 @@ static const char* const kECNum_specific[] = {
     "2.3.1.231	tRNA(Phe) (7-(3-amino-3-(methoxycarbonyl)propyl)wyosine(37)-N)-methoxycarbonyltransferase",
     "2.3.1.232	Methanol O-anthraniloyltransferase",
     "2.3.1.233	1,3,6,8-tetrahydroxynaphthalene synthase",
+    "2.3.1.234	N(6)-L-threonylcarbamoyladenine synthase",
+    "2.3.1.235	Tetracenomycin F2 synthase",
+    "2.3.1.236	5-methylnaphthoic acid synthase",
+    "2.3.1.237	Neocarzinostatin naphthoate synthase",
+    "2.3.1.238	Monacolin J acid methylbutanoate transferase",
+    "2.3.1.239	10-deoxymethynolide syntase",
+    "2.3.1.240	Narbonolide synthase",
+    "2.3.1.241	Kdo(2)-lipid IV(A) lauroyltransferase",
+    "2.3.1.242	Kdo(2)-lipid IV(A) palmitoleoyltransferase",
+    "2.3.1.243	Lauroyl-Kdo(2)-lipid IV(A) myristoyltransferase",
+    "2.3.1.244	2-methylbutanoate polyketide synthase",
+    "2.3.1.245	3-hydroxy-5-phosphonooxypentane-2,4-dione thiolase",
+    "2.3.1.246	3,5-dihydroxyphenylacetyl-CoA synthase",
+    "2.3.1.247	3-keto-5-aminohexanoate cleavage enzyme",
+    "2.3.1.248	Spermidine disinapoyl transferase",
+    "2.3.1.249	Spermidine dicoumaroyl transferase",
+    "2.3.1.250	[Wnt protein] O-palmitoleoyl transferase",
+    "2.3.1.251	Lipid IV(A) palmitoyltransferase",
     "2.3.1.n2	Phosphate acyltransferase",
     "2.3.1.n3	Glycerol-3-phosphate acyltransferase (acyl-phosphate transferring)",
     "2.3.1.n4	1-acyl-sn-glycerol-3-phosphate acyltransferase",
@@ -2182,6 +2302,12 @@ static const char* const kECNum_specific[] = {
     "2.3.2.20	Cyclo(L-leucyl-L-phenylalanyl) synthase",
     "2.3.2.21	Cyclo(L-tyrosyl-L-tyrosyl) synthase",
     "2.3.2.22	Cyclo(L-leucyl-L-leucyl) synthase",
+    "2.3.2.23	E2 ubiquitin-conjugating enzyme",
+    "2.3.2.24	(E3-independent) E2 ubiquitin-conjugating enzyme",
+    "2.3.2.25	N-terminal E2 ubiquitin-conjugating enzyme",
+    "2.3.2.26	HECT-type E3 ubiquitin transferase",
+    "2.3.2.27	RING-type E3 ubiquitin transferase",
+    "2.3.2.28	L-allo-isoleucyltransferase",
     "2.3.3.1	Citrate (Si)-synthase",
     "2.3.3.2	Decylcitrate synthase",
     "2.3.3.3	Citrate (Re)-synthase",
@@ -2228,7 +2354,7 @@ static const char* const kECNum_specific[] = {
     "2.4.1.30	1,3-beta-oligoglucan phosphorylase",
     "2.4.1.31	Laminaribiose phosphorylase",
     "2.4.1.32	Glucomannan 4-beta-mannosyltransferase",
-    "2.4.1.33	Alginate synthase",
+    "2.4.1.33	Mannuronan synthase",
     "2.4.1.34	1,3-beta-glucan synthase",
     "2.4.1.35	Phenol beta-glucosyltransferase",
     "2.4.1.36	Alpha,alpha-trehalose-phosphate synthase (GDP-forming)",
@@ -2328,7 +2454,7 @@ static const char* const kECNum_specific[] = {
     "2.4.1.149	N-acetyllactosaminide beta-1,3-N-acetylglucosaminyltransferase",
     "2.4.1.150	N-acetyllactosaminide beta-1,6-N-acetylglucosaminyl-transferase",
     "2.4.1.152	4-galactosyl-N-acetylglucosaminide 3-alpha-L-fucosyltransferase",
-    "2.4.1.153	Dolichyl-phosphate alpha-N-acetylglucosaminyltransferase",
+    "2.4.1.153	UDP-N-acetylglucosamine--dolichyl-phosphate N-acetylglucosaminyltransferase",
     "2.4.1.155	Alpha-1,6-mannosyl-glycoprotein 6-beta-N-acetylglucosaminyltransferase",
     "2.4.1.156	Indolylacetyl-myo-inositol galactosyltransferase",
     "2.4.1.157	1,2-diacylglycerol 3-glucosyltransferase",
@@ -2471,7 +2597,7 @@ static const char* const kECNum_specific[] = {
     "2.4.1.299	Cyanidin 3-O-glucoside 5-O-glucosyltransferase (acyl-glucose)",
     "2.4.1.300	Cyanidin 3-O-glucoside 7-O-glucosyltransferase (acyl-glucose)",
     "2.4.1.301	2'-deamino-2'-hydroxyneamine 1-alpha-D-kanosaminyltransferase",
-    "2.4.1.302	L-noviosyl transferase",
+    "2.4.1.302	L-demethylnoviosyl transferase",
     "2.4.1.303	UDP-Gal:alpha-D-GlcNAc-diphosphoundecaprenol beta-1,3-galactosyltransferase",
     "2.4.1.304	UDP-Gal:alpha-D-GlcNAc-diphosphoundecaprenol beta-1,4-galactosyltransferase",
     "2.4.1.305	UDP-Glc:alpha-D-GlcNAc-glucosaminyl-diphosphoundecaprenol beta-1,3-glucosyltransferase",
@@ -2495,12 +2621,18 @@ static const char* const kECNum_specific[] = {
     "2.4.1.323	7-deoxyloganetic acid glucosyltransferase",
     "2.4.1.324	7-deoxyloganetin glucosyltransferase",
     "2.4.1.325	TDP-N-acetylfucosamine:lipid II N-acetylfucosaminyltransferase",
-    "2.4.1.326	Aklavinone 7-beta-L-rhodosaminyltransferase",
+    "2.4.1.326	Aklavinone 7-L-rhodosaminyltransferase",
     "2.4.1.327	Aclacinomycin-T 2-deoxy-L-fucose transferase",
     "2.4.1.328	Erythronolide mycarosyltransferase",
     "2.4.1.329	Sucrose 6(F)-phosphate phosphorylase",
     "2.4.1.330	Beta-D-glucosyl crocetin beta-1,6-glucosyltransferase",
     "2.4.1.331	8-demethyltetracenomycin C L-rhamnosyltransferase",
+    "2.4.1.332	1,2-alpha-glucosylglycerol phosphorylase",
+    "2.4.1.333	1,2-beta-oligoglucan phosphorylase",
+    "2.4.1.334	1,3-alpha-oligoglucan phosphorylase",
+    "2.4.1.335	Dolichyl N-acetyl-alpha-D-glucosaminyl phosphate 3-beta-D-2,3-diacetamido-2,3-dideoxy-beta-D-glucuronosyltransferase",
+    "2.4.1.336	Monoglucosyldiacylglycerol synthase",
+    "2.4.1.337	1,2-diacylglycerol 3-alpha-glucosyltransferase",
     "2.4.1.n2	Loliose synthase",
     "2.4.2.1	Purine-nucleoside phosphorylase",
     "2.4.2.2	Pyrimidine-nucleoside phosphorylase",
@@ -2552,7 +2684,7 @@ static const char* const kECNum_specific[] = {
     "2.4.2.51	Anthocyanidin 3-O-glucoside 2'''-O-xylosyltransferase",
     "2.4.2.52	Triphosphoribosyl-dephospho-CoA synthase",
     "2.4.2.53	Undecaprenyl-phosphate 4-deoxy-4-formamido-L-arabinose transferase",
-    "2.4.2.54	Beta-ribofuranosylaminobenzene 5'-phosphate synthase",
+    "2.4.2.54	Beta-ribofuranosylphenol 5'-phosphate synthase",
     "2.4.2.55	Nicotinate D-ribonucleotide:phenol phospho-D-ribosyltransferase",
     "2.4.2.56	Kaempferol 3-O-xylosyltransferase",
     "2.4.2.57	AMP phosphorylase",
@@ -2570,17 +2702,18 @@ static const char* const kECNum_specific[] = {
     "2.4.99.10	Neolactotetraosylceramide alpha-2,3-sialyltransferase",
     "2.4.99.11	Lactosylceramide alpha-2,6-N-sialyltransferase",
     "2.4.99.12	Lipid IV(A) 3-deoxy-D-manno-octulosonic acid transferase",
-    "2.4.99.13	(KDO)-lipid IV(A) 3-deoxy-D-manno-octulosonic acid transferase",
-    "2.4.99.14	(KDO)(2)-lipid IV(A) (2-8) 3-deoxy-D-manno-octulosonic acid transferase",
-    "2.4.99.15	(KDO)(3)-lipid IV(A) (2-4) 3-deoxy-D-manno-octulosonic acid transferase",
+    "2.4.99.13	(Kdo)-lipid IV(A) 3-deoxy-D-manno-octulosonic acid transferase",
+    "2.4.99.14	(Kdo)(2)-lipid IV(A) (2-8) 3-deoxy-D-manno-octulosonic acid transferase",
+    "2.4.99.15	(Kdo)(3)-lipid IV(A) (2-4) 3-deoxy-D-manno-octulosonic acid transferase",
     "2.4.99.16	Starch synthase (maltosyl-transferring)",
     "2.4.99.17	S-adenosylmethionine:tRNA ribosyltransferase-isomerase",
     "2.4.99.18	Dolichyl-diphosphooligosaccharide--protein glycotransferase",
     "2.4.99.19	Undecaprenyl-diphosphooligosaccharide--protein glycotransferase",
     "2.4.99.20	2'-phospho-ADP-ribosyl cyclase/2'-phospho-cyclic-ADP-ribose transferase",
+    "2.4.99.21	Dolichyl-phosphooligosaccharide-protein glycotransferase",
     "2.5.1.1	Dimethylallyltranstransferase",
     "2.5.1.2	Thiamine pyridinylase",
-    "2.5.1.3	Thiamine-phosphate diphosphorylase",
+    "2.5.1.3	Thiamine phosphate synthase",
     "2.5.1.4	Adenosylmethionine cyclotransferase",
     "2.5.1.5	Galactose-6-sulfurylase",
     "2.5.1.6	Methionine adenosyltransferase",
@@ -2696,6 +2829,10 @@ static const char* const kECNum_specific[] = {
     "2.5.1.125	7-geranyloxy-5-hydroxy-2-methoxy-3-methylnaphthalene-1,4-dione synthase",
     "2.5.1.126	Norspermine synthase",
     "2.5.1.127	Caldopentamine synthase",
+    "2.5.1.128	N(4)-bis(aminopropyl)spermidine synthase",
+    "2.5.1.129	Flavin prenyltransferase",
+    "2.5.1.130	2-carboxy-1,4-naphthoquinone phytyltransferase",
+    "2.5.1.131	(4-(4-(2-(gamma-L-glutamylamino)ethyl)phenoxymethyl)furan-2-yl)methanamine synthase",
     "2.5.1.n9	Heptaprenylglyceryl phosphate synthase",
     "2.6.1.1	Aspartate transaminase",
     "2.6.1.2	Alanine transaminase",
@@ -2797,11 +2934,12 @@ static const char* const kECNum_specific[] = {
     "2.6.1.105	Lysine--8-amino-7-oxononanoate transaminase",
     "2.6.1.106	dTDP-3-amino-3,4,6-trideoxy-alpha-D-glucose transaminase",
     "2.6.1.107	Beta-methylphenylalanine transaminase",
+    "2.6.1.108	(5-formylfuran-3-yl)methyl phosphate transaminase",
+    "2.6.1.109	8-amino-3,8-dideoxy-alpha-D-manno-octulosonate transaminase",
     "2.6.3.1	Oximinotransferase",
     "2.6.99.1	dATP(dGTP)--DNA purinetransferase",
     "2.6.99.2	Pyridoxine 5'-phosphate synthase",
     "2.6.99.3	O-ureido-L-serine synthase",
-    "2.6.99.4	N(6)-L-threonylcarbamoyladenine synthase",
     "2.7.1.1	Hexokinase",
     "2.7.1.2	Glucokinase",
     "2.7.1.3	Ketohexokinase",
@@ -2955,6 +3093,10 @@ static const char* const kECNum_specific[] = {
     "2.7.1.184	Sulfofructose kinase",
     "2.7.1.185	Mevalonate 3-kinase",
     "2.7.1.186	Mevalonate-3-phosphate 5-kinase",
+    "2.7.1.187	Acarbose 7(IV)-phosphotransferase",
+    "2.7.1.188	2-epi-5-epi-valiolone 7-kinase",
+    "2.7.1.189	Autoinducer-2 kinase",
+    "2.7.1.190	Aminoglycoside 2''-phosphotransferase",
     "2.7.2.1	Acetate kinase",
     "2.7.2.2	Carbamate kinase",
     "2.7.2.3	Phosphoglycerate kinase",
@@ -3005,6 +3147,9 @@ static const char* const kECNum_specific[] = {
     "2.7.4.26	Isopentenyl phosphate kinase",
     "2.7.4.27	([Pyruvate, phosphate dikinase] phosphate) phosphotransferase",
     "2.7.4.28	([Pyruvate, water dikinase] phosphate) phosphotransferase",
+    "2.7.4.29	Kdo(2)-lipid A phosphotransferase",
+    "2.7.4.30	Lipid A phosphoethanolamine transferase",
+    "2.7.4.31	(5-(aminomethyl)furan-3-yl)methyl phosphate kinase",
     "2.7.6.1	Ribose-phosphate diphosphokinase",
     "2.7.6.2	Thiamine diphosphokinase",
     "2.7.6.3	2-amino-4-hydroxy-6-hydroxymethyldihydropteridine diphosphokinase",
@@ -3067,7 +3212,7 @@ static const char* const kECNum_specific[] = {
     "2.7.7.64	UTP-monosaccharide-1-phosphate uridylyltransferase",
     "2.7.7.65	Diguanylate cyclase",
     "2.7.7.66	Malonate decarboxylase holo-[acyl-carrier protein] synthase",
-    "2.7.7.67	CDP-archaeol synthase",
+    "2.7.7.67	CDP-2,3-bis-(O-geranylgeranyl)-sn-glycerol synthase",
     "2.7.7.68	2-phospho-L-lactate guanylyltransferase",
     "2.7.7.69	GDP-L-galactose phosphorylase",
     "2.7.7.70	D-glycero-beta-D-manno-heptose 1-phosphate adenylyltransferase",
@@ -3088,6 +3233,8 @@ static const char* const kECNum_specific[] = {
     "2.7.7.85	Diadenylate cyclase",
     "2.7.7.86	Cyclic GMP-AMP synthase",
     "2.7.7.87	L-threonylcarbamoyladenylate synthase",
+    "2.7.7.88	GDP polyribonucleotidyltransferase",
+    "2.7.7.89	[Glutamate--ammonia ligase]-adenylyl-L-tyrosine phosphorylase",
     "2.7.7.n1	Adenosine monophosphate-protein transferase",
     "2.7.7.n6	Guanine phosphate-protein transferase",
     "2.7.8.1	Ethanolaminephosphotransferase",
@@ -3127,6 +3274,8 @@ static const char* const kECNum_specific[] = {
     "2.7.8.38	Archaetidylserine synthase",
     "2.7.8.39	Archaetidylinositol phosphate synthase",
     "2.7.8.40	UDP-N-acetylgalactosamine-undecaprenyl-phosphate N-acetylgalactosaminephosphotransferase",
+    "2.7.8.41	Cardiolipin synthase (CMP-forming)",
+    "2.7.8.42	Kdo(2)-lipid A phosphoethanolamine 7''-transferase",
     "2.7.8.n3	Ceramide phosphoethanolamine synthase",
     "2.7.9.1	Pyruvate, phosphate dikinase",
     "2.7.9.2	Pyruvate, water dikinase",
@@ -3187,6 +3336,8 @@ static const char* const kECNum_specific[] = {
     "2.8.1.10	Thiazole synthase",
     "2.8.1.11	Molybdopterin-synthase sulfurtransferase",
     "2.8.1.12	Molybdopterin synthase",
+    "2.8.1.13	tRNA-uridine 2-sulfurtransferase",
+    "2.8.1.14	tRNA-5-taurinomethyluridine 2-sulfurtransferase",
     "2.8.2.1	Aryl sulfotransferase",
     "2.8.2.2	Alcohol sulfotransferase",
     "2.8.2.3	Amine sulfotransferase",
@@ -3244,6 +3395,7 @@ static const char* const kECNum_specific[] = {
     "2.8.3.20	Succinyl-CoA--D-citramalate CoA-transferase",
     "2.8.3.21	L-carnitine CoA-transferase",
     "2.8.3.22	Succinyl-CoA--L-malate CoA-transferase",
+    "2.8.3.23	Caffeate CoA-transferase",
     "2.8.4.1	Coenzyme-B sulfoethylthiotransferase",
     "2.8.4.2	Arsenate-mycothiol transferase",
     "2.8.4.3	tRNA-2-methylthio-N(6)-dimethylallyladenosine synthase",
@@ -3341,6 +3493,8 @@ static const char* const kECNum_specific[] = {
     "3.1.1.94	Versiconal hemiacetal acetate esterase",
     "3.1.1.95	Aclacinomycin methylesterase",
     "3.1.1.96	D-aminoacyl-tRNA deacylase",
+    "3.1.1.97	Methylated diphthine methylhydrolase",
+    "3.1.1.98	[Wnt protein] O-palmitoleoyl-L-serine hydrolase",
     "3.1.1.n2	Protein-S-isoprenylcysteine alpha-carbonyl methylesterase",
     "3.1.2.1	Acetyl-CoA hydrolase",
     "3.1.2.2	Palmitoyl-CoA hydrolase",
@@ -3368,6 +3522,7 @@ static const char* const kECNum_specific[] = {
     "3.1.2.28	1,4-dihydroxy-2-naphthoyl-CoA hydrolase",
     "3.1.2.29	Fluoroacetyl-CoA thioesterase",
     "3.1.2.30	(3S)-malyl-CoA thioesterase",
+    "3.1.2.31	Dihydromonacolin L-[lovastatin nonaketide synthase] thioesterase",
     "3.1.3.1	Alkaline phosphatase",
     "3.1.3.2	Acid phosphatase",
     "3.1.3.3	Phosphoserine phosphatase",
@@ -3460,7 +3615,9 @@ static const char* const kECNum_specific[] = {
     "3.1.3.93	L-galactose 1-phosphate phosphatase",
     "3.1.3.94	D-galactose 1-phosphate phosphatase",
     "3.1.3.95	Phosphatidylinositol-3,5-bisphosphate 3-phosphatase",
-    "3.1.3.n6	Pseudouridine 5'-phosphatase",
+    "3.1.3.96	Pseudouridine 5'-phosphatase",
+    "3.1.3.97	3',5'-nucleoside bisphosphate phosphatase",
+    "3.1.3.98	Geranyl diphosphate phosphohydrolase",
     "3.1.4.1	Phosphodiesterase I",
     "3.1.4.2	Glycerophosphocholine phosphodiesterase",
     "3.1.4.3	Phospholipase C",
@@ -3469,7 +3626,6 @@ static const char* const kECNum_specific[] = {
     "3.1.4.12	Sphingomyelin phosphodiesterase",
     "3.1.4.13	Serine-ethanolaminephosphate phosphodiesterase",
     "3.1.4.14	[Acyl-carrier-protein] phosphodiesterase",
-    "3.1.4.15	Adenylyl-[glutamate--ammonia ligase] hydrolase",
     "3.1.4.16	2',3'-cyclic-nucleotide 2'-phosphodiesterase",
     "3.1.4.17	3',5'-cyclic-nucleotide phosphodiesterase",
     "3.1.4.35	3',5'-cyclic-GMP phosphodiesterase",
@@ -3804,6 +3960,7 @@ static const char* const kECNum_specific[] = {
     "3.3.2.11	Cholesterol-5,6-oxide hydrolase",
     "3.3.2.12	Oxepin-CoA hydrolase",
     "3.3.2.13	Chorismatase",
+    "3.3.2.14	2,4-dinitroanisole O-demethylase",
     "3.4.11.1	Leucyl aminopeptidase",
     "3.4.11.2	Membrane alanyl aminopeptidase",
     "3.4.11.3	Cystinyl aminopeptidase",
@@ -3847,6 +4004,7 @@ static const char* const kECNum_specific[] = {
     "3.4.14.10	Tripeptidyl-peptidase II",
     "3.4.14.11	Xaa-Pro dipeptidyl-peptidase",
     "3.4.14.12	Xaa-Xaa-Pro tripeptidyl-peptidase",
+    "3.4.14.13	Gamma-D-glutamyl-L-lysine dipeptidyl-peptidase",
     "3.4.15.1	Peptidyl-dipeptidase A",
     "3.4.15.4	Peptidyl-dipeptidase B",
     "3.4.15.5	Peptidyl-dipeptidase Dcp",
@@ -4167,6 +4325,8 @@ static const char* const kECNum_specific[] = {
     "3.4.24.85	S2P endopeptidase",
     "3.4.24.86	ADAM 17 endopeptidase",
     "3.4.24.87	ADAMTS13 endopeptidase",
+    "3.4.24.88	Desampylase",
+    "3.4.24.89	Pro-Pro endopeptidase",
     "3.4.25.1	Proteasome endopeptidase complex",
     "3.4.25.2	HslU--HslV peptidase",
     "3.5.1.1	Asparaginase",
@@ -4195,7 +4355,6 @@ static const char* const kECNum_specific[] = {
     "3.5.1.24	Choloylglycine hydrolase",
     "3.5.1.25	N-acetylglucosamine-6-phosphate deacetylase",
     "3.5.1.26	N(4)-(beta-N-acetylglucosaminyl)-L-asparaginase",
-    "3.5.1.27	N-formylmethionylaminoacyl-tRNA deformylase",
     "3.5.1.28	N-acetylmuramoyl-L-alanine amidase",
     "3.5.1.29	2-(acetamidomethylene)succinate hydrolase",
     "3.5.1.30	5-aminopentanamidase",
@@ -4282,6 +4441,8 @@ static const char* const kECNum_specific[] = {
     "3.5.1.115	Mycothiol S-conjugate amidase",
     "3.5.1.116	Ureidoglycolate amidohydrolase",
     "3.5.1.117	6-aminohexanoate-oligomer endohydrolase",
+    "3.5.1.118	Gamma-glutamyl hercynylcysteine S-oxide hydrolase",
+    "3.5.1.119	Pup amidohydrolase",
     "3.5.1.n3	4-deoxy-4-formamido-L-arabinose-phosphoundecaprenol deformylase",
     "3.5.2.1	Barbiturase",
     "3.5.2.2	Dihydropyrimidinase",
@@ -4301,6 +4462,7 @@ static const char* const kECNum_specific[] = {
     "3.5.2.17	Hydroxyisourate hydrolase",
     "3.5.2.18	Enamidase",
     "3.5.2.19	Streptothricin hydrolase",
+    "3.5.2.20	Isatin hydrolase",
     "3.5.3.1	Arginase",
     "3.5.3.2	Guanidinoacetase",
     "3.5.3.3	Creatinase",
@@ -4427,18 +4589,18 @@ static const char* const kECNum_specific[] = {
     "3.6.1.56	2-hydroxy-dATP diphosphatase",
     "3.6.1.57	UDP-2,4-diacetamido-2,4,6-trideoxy-beta-L-altropyranose hydrolase",
     "3.6.1.58	8-oxo-dGDP phosphatase",
-    "3.6.1.59	5'-(N(7)-methyl 5'-triphosphoguanosine)-(mRNA) diphosphatase",
+    "3.6.1.59	5'-(N(7)-methyl 5'-triphosphoguanosine)-[mRNA] diphosphatase",
     "3.6.1.60	Diadenosine hexaphosphate hydrolase (AMP-forming)",
     "3.6.1.61	Diadenosine hexaphosphate hydrolase (ATP-forming)",
-    "3.6.1.62	5'-(N(7)-methylguanosine 5'-triphospho)-(mRNA) hydrolase",
+    "3.6.1.62	5'-(N(7)-methylguanosine 5'-triphospho)-[mRNA] hydrolase",
     "3.6.1.63	Alpha-D-ribose 1-methylphosphonate 5-triphosphate diphosphatase",
     "3.6.1.64	Inosine diphosphate phosphatase",
     "3.6.1.65	(d)CTP diphosphatase",
     "3.6.1.66	XTP/dITP diphosphatase",
+    "3.6.1.67	Dihydroneopterin triphosphate diphosphatase",
     "3.6.1.n1	D-tyrosyl-tRNA(Tyr) hydrolase",
     "3.6.1.n2	L-cysteinyl-tRNA(Pro)",
     "3.6.1.n3	L-cysteinyl-tRNA(Cys) hydrolase",
-    "3.6.1.n4	Dihydroneopterin triphosphate diphosphatase",
     "3.6.2.1	Adenylylsulfatase",
     "3.6.2.2	Phosphoadenylylsulfatase",
     "3.6.3.1	Phospholipid-translocating ATPase",
@@ -4650,6 +4812,9 @@ static const char* const kECNum_specific[] = {
     "4.1.1.97	2-oxo-4-hydroxy-4-carboxy-5-ureidoimidazoline decarboxylase",
     "4.1.1.98	4-hydroxy-3-polyprenylbenzoate decarboxylase",
     "4.1.1.99	Phosphomevalonate decarboxylase",
+    "4.1.1.100	Prephenate decarboxylase",
+    "4.1.1.101	Malolactic enzyme",
+    "4.1.1.102	Phenacrylate decarboxylase",
     "4.1.2.2	Ketotetrose-phosphate aldolase",
     "4.1.2.4	Deoxyribose-phosphate aldolase",
     "4.1.2.5	L-threonine aldolase",
@@ -4684,7 +4849,7 @@ static const char* const kECNum_specific[] = {
     "4.1.2.41	Vanillin synthase",
     "4.1.2.42	D-threonine aldolase",
     "4.1.2.43	3-hexulose-6-phosphate synthase",
-    "4.1.2.44	Benzoyl-CoA-dihydrodiol lyase",
+    "4.1.2.44	2,3-epoxybenzoyl-CoA dihydrolase",
     "4.1.2.45	Trans-o-hydroxybenzylidenepyruvate hydratase-aldolase",
     "4.1.2.46	Aliphatic (R)-hydroxynitrile lyase",
     "4.1.2.47	(S)-hydroxynitrile lyase",
@@ -4871,16 +5036,23 @@ static const char* const kECNum_specific[] = {
     "4.2.1.152	Hydroperoxy icosatetraenoate dehydratase",
     "4.2.1.153	3-methylfumaryl-CoA hydratase",
     "4.2.1.154	Tetracenomycin F2 cyclase",
+    "4.2.1.155	Methylthioacryloyl-CoA hydratase",
+    "4.2.1.156	L-talarate dehydratase",
+    "4.2.1.157	(R)-2-hydroxyisocaproyl-CoA dehydratase",
+    "4.2.1.158	Galactarate dehydratase (D-threo-forming)",
+    "4.2.1.159	dTDP-4-dehydro-6-deoxy-alpha-D-glucopyranose 2,3-dehydratase",
+    "4.2.1.160	2,5-diamino-6-(5-phospho-D-ribosylamino)pyrimidin-4(3H)-one isomerase/dehydratase",
+    "4.2.1.161	Bisanhydrobacterioruberin hydratase",
     "4.2.2.1	Hyaluronate lyase",
     "4.2.2.2	Pectate lyase",
-    "4.2.2.3	Poly(beta-D-mannuronate) lyase",
+    "4.2.2.3	Mannuronate-specific alginate lyase",
     "4.2.2.5	Chondroitin AC lyase",
     "4.2.2.6	Oligogalacturonide lyase",
     "4.2.2.7	Heparin lyase",
     "4.2.2.8	Heparin-sulfate lyase",
     "4.2.2.9	Pectate disaccharide-lyase",
     "4.2.2.10	Pectin lyase",
-    "4.2.2.11	Poly(alpha-L-guluronate) lyase",
+    "4.2.2.11	Guluronate-specific alginate lyase",
     "4.2.2.12	Xanthan lyase",
     "4.2.2.13	Exo-(1->4)-alpha-D-glucan lyase",
     "4.2.2.14	Glucuronan lyase",
@@ -4895,6 +5067,7 @@ static const char* const kECNum_specific[] = {
     "4.2.2.23	Rhamnogalacturonan endolyase",
     "4.2.2.24	Rhamnogalacturonan exolyase",
     "4.2.2.25	Gellan lyase",
+    "4.2.2.26	Oligo-alginate lyase",
     "4.2.2.n1	Peptidoglycan lytic exotransglycosylase",
     "4.2.2.n2	Peptidoglycan lytic endotransglycosylase",
     "4.2.3.1	Threonine synthase",
@@ -5043,6 +5216,12 @@ static const char* const kECNum_specific[] = {
     "4.2.3.145	Ophiobolin F synthase",
     "4.2.3.146	Cyclooctat-9-en-7-ol synthase",
     "4.2.3.147	Pimaradiene synthase",
+    "4.2.3.148	Cembrene C synthase",
+    "4.2.3.149	Nephthenol synthase",
+    "4.2.3.150	Cembrene A synthase",
+    "4.2.3.151	Pentamethylcyclopentadecatrienol synthase",
+    "4.2.3.152	2-epi-5-epi-valiolone synthase",
+    "4.2.3.153	(5-formylfuran-3-yl)methyl phosphate synthase",
     "4.2.3.n2	Delta-selinene synthase",
     "4.2.3.n11	Selinene synthase",
     "4.2.99.12	Carboxymethyloxysuccinate lyase",
@@ -5115,6 +5294,12 @@ static const char* const kECNum_specific[] = {
     "4.4.1.25	L-cysteate sulfo-lyase",
     "4.4.1.26	Olivetolic acid cyclase",
     "4.4.1.27	Carbon disulfide lyase",
+    "4.4.1.28	L-cysteine desulfidase",
+    "4.4.1.29	Phycobiliprotein cysteine-84 phycobilin lyase",
+    "4.4.1.30	Phycobiliprotein beta-cysteine-155 phycobilin lyase",
+    "4.4.1.31	Phycoerythrocyanin alpha-cysteine-84 phycoviolobilin lyase/isomerase",
+    "4.4.1.32	C-phycocyanin alpha-cysteine-84 phycocyanobilin lyase",
+    "4.4.1.33	R-phycocyanin alpha-cysteine-84 phycourobilin lyase/isomerase",
     "4.5.1.1	DDT-dehydrochlorinase",
     "4.5.1.2	3-chloro-D-alanine dehydrochlorinase",
     "4.5.1.3	Dichloromethane dehalogenase",
@@ -5156,7 +5341,8 @@ static const char* const kECNum_specific[] = {
     "5.1.1.17	Isopenicillin-N epimerase",
     "5.1.1.18	Serine racemase",
     "5.1.1.19	O-ureido-serine racemase",
-    "5.1.1.n1	L-Ala-D/L-Glu epimerase",
+    "5.1.1.20	L-Ala-D/L-Glu epimerase",
+    "5.1.1.21	Isoleucine 2-epimerase",
     "5.1.2.1	Lactate racemase",
     "5.1.2.2	Mandelate racemase",
     "5.1.2.3	3-hydroxybutyryl-CoA epimerase",
@@ -5195,12 +5381,19 @@ static const char* const kECNum_specific[] = {
     "5.1.3.30	D-psicose 3-epimerase",
     "5.1.3.31	D-tagatose 3-epimerase",
     "5.1.3.32	L-rhamnose mutarotase",
+    "5.1.3.33	2-epi-5-epi-valiolone epimerase",
+    "5.1.3.34	Monoglucosyldiacylglycerol epimerase",
+    "5.1.3.35	2-epi-5-epi-valiolone 7-phosphate 2-epimerase",
+    "5.1.3.36	Heparosan-glucuronate 5-epimerase",
+    "5.1.3.37	Mannuronan 5-epimerase",
     "5.1.99.1	Methylmalonyl-CoA epimerase",
     "5.1.99.2	16-hydroxysteroid epimerase",
     "5.1.99.3	Allantoin racemase",
     "5.1.99.4	Alpha-methylacyl-CoA racemase",
     "5.1.99.5	Hydantoin racemase",
     "5.1.99.6	NAD(P)H-hydrate epimerase",
+    "5.1.99.7	Dihydroneopterin triphosphate 2'-epimerase",
+    "5.1.99.8	7,8-dihydroneopterin epimerase",
     "5.2.1.1	Maleate isomerase",
     "5.2.1.2	Maleylacetoacetate isomerase",
     "5.2.1.4	Maleylpyruvate isomerase",
@@ -5238,6 +5431,7 @@ static const char* const kECNum_specific[] = {
     "5.3.1.29	Ribose 1,5-bisphosphate isomerase",
     "5.3.1.30	5-deoxy-glucuronate isomerase",
     "5.3.1.31	Sulfoquinovose isomerase",
+    "5.3.1.32	(4S)-4-hydroxy-5-phosphonooxypentane-2,3-dione isomerase",
     "5.3.2.1	Phenylpyruvate tautomerase",
     "5.3.2.2	Oxaloacetate tautomerase",
     "5.3.2.3	TDP-4-oxo-6-deoxy-alpha-D-glucose-3,4-oxoisomerase (dTDP-3-dehydro-6-deoxy-alpha-D-galactopyranose-forming)",
@@ -5262,6 +5456,7 @@ static const char* const kECNum_specific[] = {
     "5.3.3.14	Trans-2-decenoyl-[acyl-carrier-protein] isomerase",
     "5.3.3.17	Trans-2,3-dihydro-3-hydroxyanthranilate isomerase",
     "5.3.3.18	2-(1,2-epoxy-1,2-dihydrophenyl)acetyl-CoA isomerase",
+    "5.3.3.19	3-((4R)-4-hydroxycyclohexa-1,5-dien-1-yl)-2-oxopropanoate isomerase",
     "5.3.4.1	Protein disulfide-isomerase",
     "5.3.99.2	Prostaglandin-D synthase",
     "5.3.99.3	Prostaglandin-E synthase",
@@ -5275,6 +5470,7 @@ static const char* const kECNum_specific[] = {
     "5.3.99.11	2-keto-myo-inositol isomerase",
     "5.4.1.1	Lysolecithin acylmutase",
     "5.4.1.3	2-methylfumaryl-CoA isomerase",
+    "5.4.1.4	D-galactarolactone isomerase",
     "5.4.2.2	Phosphoglucomutase (alpha-D-glucose-1,6-bisphosphate-dependent)",
     "5.4.2.3	Phosphoacetylglucosamine mutase",
     "5.4.2.4	Bisphosphoglycerate mutase",
@@ -5363,6 +5559,7 @@ static const char* const kECNum_specific[] = {
     "5.4.99.60	Cobalt-precorrin-8 methylmutase",
     "5.4.99.61	Precorrin-8X methylmutase",
     "5.4.99.62	D-ribose pyranase",
+    "5.4.99.63	Ethylmalonyl-CoA mutase",
     "5.5.1.1	Muconate cycloisomerase",
     "5.5.1.2	3-carboxy-cis,cis-muconate cycloisomerase",
     "5.5.1.3	Tetrahydroxypteridine cycloisomerase",
@@ -5386,6 +5583,9 @@ static const char* const kECNum_specific[] = {
     "5.5.1.22	(-)-bornyl diphosphate synthase",
     "5.5.1.23	Aklanonic acid methyl ester cyclase",
     "5.5.1.24	Tocopherol cyclase",
+    "5.5.1.25	3,6-anhydro-L-galactonate cycloisomerase",
+    "5.5.1.26	Nogalonic acid methyl ester cyclase",
+    "5.5.1.27	D-galactarolactone cycloisomerase",
     "5.99.1.1	Thiocyanate isomerase",
     "5.99.1.2	DNA topoisomerase",
     "5.99.1.3	DNA topoisomerase (ATP-hydrolyzing)",
@@ -5459,6 +5659,8 @@ static const char* const kECNum_specific[] = {
     "6.2.1.42	3-oxocholest-4-en-26-oate--CoA ligase",
     "6.2.1.43	2-hydroxy-7-methoxy-5-methyl-1-naphthoate--CoA ligase",
     "6.2.1.44	3-(methylthio)propionyl--CoA ligase",
+    "6.2.1.45	E1 ubiquitin-activating enzyme",
+    "6.2.1.46	L-allo-isoleucine:holo-[CmaA peptidyl-carrier protein] ligase",
     "6.2.1.n2	Amino acid--[acyl-carrier-protein] ligase",
     "6.2.1.n3	Malonate--CoA ligase",
     "6.3.1.1	Aspartate--ammonia ligase",
@@ -5477,6 +5679,7 @@ static const char* const kECNum_specific[] = {
     "6.3.1.15	8-demethylnovobiocic acid synthase",
     "6.3.1.17	Beta-citrylglutamate synthase",
     "6.3.1.18	Gamma-glutamylanilide synthase",
+    "6.3.1.19	Prokaryotic ubiquitin-like protein ligase",
     "6.3.2.1	Pantoate--beta-alanine ligase (AMP-forming)",
     "6.3.2.2	Glutamate--cysteine ligase",
     "6.3.2.3	Glutathione synthase",
@@ -5494,14 +5697,12 @@ static const char* const kECNum_specific[] = {
     "6.3.2.16	D-alanine--alanyl-poly(glycerolphosphate) ligase",
     "6.3.2.17	Tetrahydrofolate synthase",
     "6.3.2.18	Gamma-glutamylhistamine synthase",
-    "6.3.2.19	Ubiquitin--protein ligase",
     "6.3.2.20	Indoleacetate--lysine synthetase",
     "6.3.2.21	Ubiquitin--calmodulin ligase",
     "6.3.2.23	Homoglutathione synthase",
     "6.3.2.24	Tyrosine--arginine ligase",
     "6.3.2.25	Tubulin--tyrosine ligase",
     "6.3.2.26	N-(5-amino-5-carboxypentanoyl)-L-cysteinyl-D-valine synthase",
-    "6.3.2.28	L-amino-acid alpha-ligase",
     "6.3.2.29	Cyanophycin synthase (L-aspartate-adding)",
     "6.3.2.30	Cyanophycin synthase (L-arginine-adding)",
     "6.3.2.31	Coenzyme F420-0:L-glutamate ligase",
@@ -5518,7 +5719,11 @@ static const char* const kECNum_specific[] = {
     "6.3.2.42	N-acetylaspartylglutamylglutamate synthase",
     "6.3.2.43	[Lysine-biosynthesis-protein LysW]--L-2-aminoadipate ligase",
     "6.3.2.44	Pantoate--beta-alanine ligase (ADP-forming)",
-    "6.3.2.n2	Pup--protein ligase",
+    "6.3.2.45	UDP-N-acetylmuramate L-alanyl-gamma-D-glutamyl-meso-2,6-diaminoheptanedioate ligase",
+    "6.3.2.46	Fumarate--(S)-2,3-diaminopropanoate ligase",
+    "6.3.2.47	Dapdiamide A synthase",
+    "6.3.2.48	L-arginine-specific L-amino acid ligase",
+    "6.3.2.49	L-alanine--L-anticapsin ligase",
     "6.3.2.n3	ISG15--protein ligase",
     "6.3.3.1	Phosphoribosylformylglycinamidine cyclo-ligase",
     "6.3.3.2	5-formyltetrahydrofolate cyclo-ligase",
@@ -5548,6 +5753,7 @@ static const char* const kECNum_specific[] = {
     "6.3.4.21	Nicotinate phosphoribosyltransferase",
     "6.3.4.22	tRNA(Ile)(2)-agmatinylcytidine synthase",
     "6.3.4.23	Formate--phosphoribosylaminoimidazolecarboxamide ligase",
+    "6.3.4.24	Tyramine--L-glutamate ligase",
     "6.3.5.1	NAD(+) synthase (glutamine-hydrolyzing)",
     "6.3.5.2	GMP synthase (glutamine-hydrolyzing)",
     "6.3.5.3	Phosphoribosylformylglycinamidine synthase",
diff --git a/c++/src/objects/seqfeat/ecnum_specific.txt b/c++/src/objects/seqfeat/ecnum_specific.txt
index 7377053..26ec599 100644
--- a/c++/src/objects/seqfeat/ecnum_specific.txt
+++ b/c++/src/objects/seqfeat/ecnum_specific.txt
@@ -48,8 +48,8 @@
 1.1.1.49	Glucose-6-phosphate dehydrogenase (NADP(+))
 1.1.1.50	3-alpha-hydroxysteroid 3-dehydrogenase (Si-specific)
 1.1.1.51	3(or 17)-beta-hydroxysteroid dehydrogenase
-1.1.1.52	3-alpha-hydroxycholanate dehydrogenase
-1.1.1.53	3-alpha-(or 20-beta)-hydroxysteroid dehydrogenase
+1.1.1.52	3-alpha-hydroxycholanate dehydrogenase (NAD(+) )
+1.1.1.53	3-alpha(or 20-beta)-hydroxysteroid dehydrogenase
 1.1.1.54	Allyl-alcohol dehydrogenase
 1.1.1.55	Lactaldehyde reductase (NADPH)
 1.1.1.56	Ribitol 2-dehydrogenase
@@ -78,7 +78,7 @@
 1.1.1.83	D-malate dehydrogenase (decarboxylating)
 1.1.1.84	Dimethylmalate dehydrogenase
 1.1.1.85	3-isopropylmalate dehydrogenase
-1.1.1.86	Ketol-acid reductoisomerase
+1.1.1.86	Ketol-acid reductoisomerase (NADP(+))
 1.1.1.87	Homoisocitrate dehydrogenase
 1.1.1.88	Hydroxymethylglutaryl-CoA reductase
 1.1.1.90	Aryl-alcohol dehydrogenase
@@ -253,7 +253,7 @@
 1.1.1.273	Vellosimine dehydrogenase
 1.1.1.274	2,5-didehydrogluconate reductase (2-dehydro-D-gluconate-forming)
 1.1.1.275	(+)-trans-carveol dehydrogenase
-1.1.1.276	Serine 3-dehydrogenase
+1.1.1.276	Serine 3-dehydrogenase (NADP(+))
 1.1.1.277	3-beta-hydroxy-5-beta-steroid dehydrogenase
 1.1.1.278	3-beta-hydroxy-5-alpha-steroid dehydrogenase
 1.1.1.279	(R)-3-hydroxyacid-ester dehydrogenase
@@ -355,6 +355,18 @@
 1.1.1.376	L-arabinose 1-dehydrogenase (NAD(P)(+))
 1.1.1.377	L-rhamnose 1-dehydrogenase (NADP(+))
 1.1.1.378	L-rhamnose 1-dehydrogenase (NAD(P)(+))
+1.1.1.379	(R)-mandelate dehydrogenase
+1.1.1.380	L-gulonate 5-dehydrogenase
+1.1.1.381	3-hydroxy acid dehydrogenase
+1.1.1.382	Ketol-acid reductoisomerase (NAD(+))
+1.1.1.383	Ketol-acid reductoisomerase (NAD(P)(+))
+1.1.1.384	dTDP-3,4-didehydro-2,6-dideoxy-alpha-D-glucose 3-reductase
+1.1.1.385	Dihydroanticapsin 7-dehydrogenase
+1.1.1.386	Ipsdienol dehydrogenase
+1.1.1.387	L-serine 3-dehydrogenase (NAD(+))
+1.1.1.388	Glucose-6-phosphate dehydrogenase (NAD(+))
+1.1.1.389	2-dehydro-3-deoxy-L-galactonate 5-dehydrogenase
+1.1.1.390	Sulfoquinovose 1-dehydrogenase
 1.1.1.n4	(-)-trans-carveol dehydrogenase
 1.1.1.n5	3-methylmalate dehydrogenase
 1.1.1.n11	Succinic semialdehyde reductase
@@ -399,8 +411,8 @@
 1.1.3.44	6'''-hydroxyneomycin C oxidase
 1.1.3.45	Aclacinomycin-N oxidase
 1.1.3.46	4-hydroxymandelate oxidase
-1.1.4.1	Vitamin-K-epoxide reductase (warfarin-sensitive)
-1.1.4.2	Vitamin-K-epoxide reductase (warfarin-insensitive)
+1.1.3.47	5-(hydroxymethyl)furfural oxidase
+1.1.3.48	3-deoxy-alpha-D-manno-octulosonate 8-oxidase
 1.1.5.2	Quinoprotein glucose dehydrogenase (PQQ, quinone)
 1.1.5.3	Glycerol-3-phosphate dehydrogenase
 1.1.5.4	Malate dehydrogenase (quinone)
@@ -498,7 +510,7 @@
 1.2.1.61	4-hydroxymuconic-semialdehyde dehydrogenase
 1.2.1.62	4-formylbenzenesulfonate dehydrogenase
 1.2.1.63	6-oxohexanoate dehydrogenase
-1.2.1.64	4-hydroxybenzaldehyde dehydrogenase
+1.2.1.64	4-hydroxybenzaldehyde dehydrogenase (NAD(+))
 1.2.1.65	Salicylaldehyde dehydrogenase
 1.2.1.67	Vanillin dehydrogenase
 1.2.1.68	Coniferyl-aldehyde dehydrogenase
@@ -523,6 +535,14 @@
 1.2.1.87	Propanal dehydrogenase (CoA-propanoylating)
 1.2.1.88	L-glutamate gamma-semialdehyde dehydrogenase
 1.2.1.89	D-glyceraldehyde dehydrogenase (NADP(+))
+1.2.1.90	Glyceraldehyde-3-phosphate dehydrogenase (NAD(P)(+))
+1.2.1.91	3-oxo-5,6-dehydrosuberyl-CoA semialdehyde dehydrogenase
+1.2.1.92	3,6-anhydro-alpha-L-galactose dehydrogenase
+1.2.1.93	Formate dehydrogenase (NAD(+), ferredoxin)
+1.2.1.94	Farnesal dehydrogenase
+1.2.1.95	L-2-aminoadipate reductase
+1.2.1.96	4-hydroxybenzaldehyde dehydrogenase (NADP(+))
+1.2.1.97	3-sulfolactaldehyde dehydrogenase
 1.2.1.n2	Fatty acyl-CoA reductase
 1.2.2.1	Formate dehydrogenase (cytochrome)
 1.2.2.3	Formate dehydrogenase (cytochrome c-553)
@@ -541,6 +561,7 @@
 1.2.4.2	Oxoglutarate dehydrogenase (succinyl-transferring)
 1.2.4.4	3-methyl-2-oxobutanoate dehydrogenase (2-methylpropanoyl-transferring)
 1.2.5.1	Pyruvate dehydrogenase (quinone)
+1.2.5.2	Aldehyde dehydrogenase (quinone)
 1.2.7.1	Pyruvate synthase
 1.2.7.3	2-oxoglutarate synthase
 1.2.7.4	Carbon-monoxide dehydrogenase (ferredoxin)
@@ -550,9 +571,8 @@
 1.2.7.8	Indolepyruvate ferredoxin oxidoreductase
 1.2.7.10	Oxalate oxidoreductase
 1.2.7.11	2-oxoacid oxidoreductase (ferredoxin)
+1.2.98.1	Formaldehyde dismutase
 1.2.99.2	Carbon-monoxide dehydrogenase (acceptor)
-1.2.99.3	Aldehyde dehydrogenase (pyrroloquinoline-quinone)
-1.2.99.4	Formaldehyde dismutase
 1.2.99.5	Formylmethanofuran dehydrogenase
 1.2.99.6	Carboxylate reductase
 1.2.99.7	Aldehyde dehydrogenase (FAD-independent)
@@ -588,7 +608,6 @@
 1.3.1.32	Maleylacetate reductase
 1.3.1.33	Protochlorophyllide reductase
 1.3.1.34	2,4-dienoyl-CoA reductase (NADPH)
-1.3.1.35	Phosphatidylcholine desaturase
 1.3.1.36	Geissoschizine dehydrogenase
 1.3.1.37	Cis-2-enoyl-CoA reductase (NADPH)
 1.3.1.38	Trans-2-enoyl-CoA reductase (NADPH)
@@ -611,7 +630,6 @@
 1.3.1.58	2,3-dihydroxy-2,3-dihydro-p-cumate dehydrogenase
 1.3.1.60	Dibenzothiophene dihydrodiol dehydrogenase
 1.3.1.62	Pimeloyl-CoA dehydrogenase
-1.3.1.63	2,4-dichlorobenzoyl-CoA reductase
 1.3.1.64	Phthalate 4,5-cis-dihydrodiol dehydrogenase
 1.3.1.65	5,6-dihydroxy-3-methyl-2-oxo-1,2,5,6-tetrahydroquinoline dehydrogenase
 1.3.1.66	Cis-dihydroethylcatechol dehydrogenase
@@ -656,6 +674,9 @@
 1.3.1.105	2-methylene-furan-3-one reductase
 1.3.1.106	Cobalt-precorrin-6A reductase
 1.3.1.107	Sanguinarine reductase
+1.3.1.108	Caffeoyl-CoA reductase
+1.3.1.109	Butanoyl-CoA dehydrogenase (NAD(+),ferredoxin)
+1.3.1.110	Lactate dehydrogenase (NAD(+),ferredoxin)
 1.3.1.n2	Camalexin synthase
 1.3.1.n3	Curcumin reductase
 1.3.2.3	L-galactonolactone dehydrogenase
@@ -687,6 +708,7 @@
 1.3.7.7	Ferredoxin:protochlorophyllide reductase (ATP-dependent)
 1.3.7.8	Benzoyl-CoA reductase
 1.3.7.9	4-hydroxybenzoyl-CoA reductase
+1.3.7.11	2,3-bis-O-geranylgeranyl-sn-glycero-phospholipid reductase
 1.3.8.1	Short-chain acyl-CoA dehydrogenase
 1.3.8.2	4,4'-diapophytoene desaturase (4,4'-diapolycopene-forming)
 1.3.8.3	(R)-benzylsuccinyl-CoA dehydrogenase
@@ -698,6 +720,7 @@
 1.3.8.9	Very-long-chain acyl-CoA dehydrogenase
 1.3.8.10	Cyclohex-1-ene-1-carbonyl-CoA dehydrogenase
 1.3.8.11	Cyclohexane-1-carbonyl-CoA dehydrogenase
+1.3.8.12	(2S)-methylsuccinyl-CoA dehydrogenase
 1.3.98.1	Dihydroorotate oxidase (fumarate)
 1.3.99.4	3-oxosteroid 1-dehydrogenase
 1.3.99.5	3-oxo-5-alpha-steroid 4-dehydrogenase (acceptor)
@@ -721,9 +744,9 @@
 1.3.99.31	Phytoene desaturase (lycopene-forming)
 1.3.99.32	Glutaryl-CoA dehydrogenase (acceptor)
 1.3.99.33	Urocanate reductase
-1.3.99.34	2,3-bis-O-geranylgeranyl-sn-glycerol 1-phosphate reductase (donor)
 1.3.99.35	Chlorophyllide a reductase
 1.3.99.36	Cypemycin cysteine dehydrogenase (decarboxylating)
+1.3.99.37	1-hydroxy-2-isopentenylcarotenoid 3,4-desaturase
 1.3.99.n1	3-hydroxybenzoyl-CoA reductase
 1.4.1.1	Alanine dehydrogenase
 1.4.1.2	Glutamate dehydrogenase
@@ -773,10 +796,10 @@
 1.4.7.1	Glutamate synthase (ferredoxin)
 1.4.9.1	Methylamine dehydrogenase (amicyanin)
 1.4.9.2	Aralkylamine dehydrogenase (azurin)
-1.4.99.1	D-amino-acid dehydrogenase
 1.4.99.2	Taurine dehydrogenase
 1.4.99.5	Glycine dehydrogenase (cyanide-forming)
-1.5.1.1	Pyrroline-2-carboxylate reductase
+1.4.99.6	D-arginine dehydrogenase
+1.5.1.1	1-piperideine-2-carboxylate/1-pyrroline-2-carboxylate reductase (NAD(P)H)
 1.5.1.2	Pyrroline-5-carboxylate reductase
 1.5.1.3	Dihydrofolate reductase
 1.5.1.5	Methylenetetrahydrofolate dehydrogenase (NADP(+))
@@ -792,7 +815,7 @@
 1.5.1.18	Ephedrine dehydrogenase
 1.5.1.19	D-nopaline dehydrogenase
 1.5.1.20	Methylenetetrahydrofolate reductase (NAD(P)H)
-1.5.1.21	Delta(1)-piperideine-2-carboxylate reductase
+1.5.1.21	1-piperideine-2-carboxylate/1-pyrroline-2-carboxylate reductase (NADPH)
 1.5.1.22	Strombine dehydrogenase
 1.5.1.23	Tauropine dehydrogenase
 1.5.1.24	N(5)-(carboxyethyl)ornithine synthase
@@ -818,6 +841,8 @@
 1.5.1.46	Agroclavine dehydrogenase
 1.5.1.47	Dihydromethanopterin reductase (NAD(P)(+))
 1.5.1.48	2-methyl-1-pyrroline reductase
+1.5.1.49	1-pyrroline-2-carboxylate reductase (NAD(P)H)
+1.5.1.50	Dihydromonapterin reductase
 1.5.3.1	Sarcosine oxidase
 1.5.3.2	N-methyl-L-amino-acid oxidase
 1.5.3.4	N(6)-methyl-lysine oxidase
@@ -858,6 +883,8 @@
 1.6.1.1	NAD(P)(+) transhydrogenase (Si-specific)
 1.6.1.2	NAD(P)(+) transhydrogenase (Re/Si-specific)
 1.6.1.3	NAD(P)(+) transhydrogenase
+1.6.1.4	NAD(P)(+) transhydrogenase (ferredoxin)
+1.6.1.5	Proton-translocating NAD(P)(+) transhydrogenase
 1.6.2.2	Cytochrome-b5 reductase
 1.6.2.4	NADPH--hemoprotein reductase
 1.6.2.5	NADPH--cytochrome-c2 reductase
@@ -876,10 +903,11 @@
 1.6.5.8	NADH:ubiquinone reductase (Na(+)-transporting)
 1.6.5.9	NADH:ubiquinone reductase (non-electrogenic)
 1.6.5.10	NADPH dehydrogenase (quinone)
+1.6.5.11	NADH dehydrogenase (quinone)
+1.6.5.12	Demethylphylloquinone reductase
 1.6.6.9	Trimethylamine-N-oxide reductase
 1.6.99.1	NADPH dehydrogenase
 1.6.99.3	NADH dehydrogenase
-1.6.99.5	NADH dehydrogenase (quinone)
 1.6.99.n1	NADPH dehydrogenase (coenzyme F420 dependent)
 1.7.1.1	Nitrate reductase (NADH)
 1.7.1.2	Nitrate reductase (NAD(P)H)
@@ -914,7 +942,7 @@
 1.7.99.1	Hydroxylamine reductase
 1.7.99.4	Nitrate reductase
 1.7.99.8	Hydrazine oxidoreductase
-1.8.1.2	Sulfite reductase (NADPH)
+1.8.1.2	Assimilatory sulfite reductase (NADPH)
 1.8.1.3	Hypotaurine dehydrogenase
 1.8.1.4	Dihydrolipoyl dehydrogenase
 1.8.1.5	2-oxopropyl-CoM reductase (carboxylating)
@@ -958,17 +986,17 @@
 1.8.5.2	Thiosulfate dehydrogenase (quinone)
 1.8.5.3	Dimethylsulfoxide reductase
 1.8.5.4	Sulfide:quinone reductase
-1.8.7.1	Sulfite reductase (ferredoxin)
+1.8.7.1	Assimilatory sulfite reductase (ferredoxin)
 1.8.7.2	Ferredoxin:thioredoxin reductase
 1.8.98.1	CoB--CoM heterodisulfide reductase
 1.8.98.2	Sulfiredoxin
 1.8.98.3	Sulfite reductase (coenzyme F420)
-1.8.99.1	Sulfite reductase
 1.8.99.2	Adenylyl-sulfate reductase
 1.8.99.3	Hydrogensulfite reductase
+1.8.99.5	Dissimilatory sulfite reductase
 1.9.3.1	Cytochrome-c oxidase
 1.9.6.1	Nitrate reductase (cytochrome)
-1.9.99.1	Iron--cytochrome-c reductase
+1.9.98.1	Iron--cytochrome-c reductase
 1.10.1.1	Trans-acenaphthene-1,2-diol dehydrogenase
 1.10.2.1	L-ascorbate--cytochrome-b5 reductase
 1.10.2.2	Quinol--cytochrome-c reductase
@@ -985,9 +1013,8 @@
 1.10.3.13	Caldariellaquinol oxidase (H(+)-transporting)
 1.10.3.14	Ubiquinol oxidase (electrogenic, non H(+)-transporting)
 1.10.3.15	Grixazone synthase
+1.10.5.1	Ribosyldihydronicotinamide dehydrogenase (quinone)
 1.10.9.1	Plastoquinol--plastocyanin reductase
-1.10.99.2	Ribosyldihydronicotinamide dehydrogenase (quinone)
-1.10.99.3	Violaxanthin de-epoxidase
 1.11.1.1	NADH peroxidase
 1.11.1.2	NADPH peroxidase
 1.11.1.3	Fatty-acid peroxidase
@@ -1042,7 +1069,7 @@
 1.13.11.15	3,4-dihydroxyphenylacetate 2,3-dioxygenase
 1.13.11.16	3-carboxyethylcatechol 2,3-dioxygenase
 1.13.11.17	Indole 2,3-dioxygenase
-1.13.11.18	Sulfur dioxygenase
+1.13.11.18	Persulfide dioxygenase
 1.13.11.19	Cysteamine dioxygenase
 1.13.11.20	Cysteine dioxygenase
 1.13.11.22	Caffeate 3,4-dioxygenase
@@ -1100,6 +1127,9 @@
 1.13.11.77	Oleate 10S-lipoxygenase
 1.13.11.78	2-amino-1-hydroxyethylphosphonate dioxygenase (glycine-forming)
 1.13.11.79	5,6-dimethylbenzimidazole synthase
+1.13.11.80	(3,5-dihydroxyphenyl)acetyl-CoA 1,2-dioxygenase
+1.13.11.81	7,8-dihydroneopterin oxygenase
+1.13.11.82	8'-apo-carotenoid 13,14-cleaving dioxygenase
 1.13.12.1	Arginine 2-monooxygenase
 1.13.12.2	Lysine 2-monooxygenase
 1.13.12.3	Tryptophan 2-monooxygenase
@@ -1117,6 +1147,7 @@
 1.13.12.19	2-oxuglutarate dioxygenase (ethylene-forming)
 1.13.12.20	Noranthrone monooxygenase
 1.13.12.21	Tetracenomycin-F1 monooxygenase
+1.13.12.22	Deoxynogalonate monooxygenase
 1.13.99.1	Inositol oxygenase
 1.13.99.3	Tryptophan 2'-dioxygenase
 1.14.11.1	Gamma-butyrobetaine dioxygenase
@@ -1165,6 +1196,8 @@
 1.14.11.45	L-isoleucine 4-hydroxylase
 1.14.11.46	2-aminoethylphosphonate dioxygenase
 1.14.11.47	50S ribosomal protein L16 3-hydroxylase
+1.14.11.48	Xanthine dioxygenase
+1.14.11.49	Uridine-5'-phosphate dioxygenase
 1.14.11.n2	Methylcytosine dioxygenase
 1.14.11.n3	L-proline cis-4-hydroxylase
 1.14.11.n4	Ankyrin-repeat-histidine dioxagenase
@@ -1186,8 +1219,9 @@
 1.14.12.18	Biphenyl 2,3-dioxygenase
 1.14.12.19	3-phenylpropanoate dioxygenase
 1.14.12.20	Pheophorbide a oxygenase
-1.14.12.21	Benzoyl-CoA 2,3-dioxygenase
 1.14.12.22	Carbazole 1,9a-dioxygenase
+1.14.12.23	Nitroarene dioxygenase
+1.14.12.24	2,4-dinitrotoluene dioxygenase
 1.14.13.1	Salicylate 1-monooxygenase
 1.14.13.2	4-hydroxybenzoate 3-monooxygenase
 1.14.13.4	Melilotate 3-monooxygenase
@@ -1212,7 +1246,6 @@
 1.14.13.23	3-hydroxybenzoate 4-monooxygenase
 1.14.13.24	3-hydroxybenzoate 6-monooxygenase
 1.14.13.25	Methane monooxygenase (soluble)
-1.14.13.26	Phosphatidylcholine 12-monooxygenase
 1.14.13.27	4-aminobenzoate 1-monooxygenase
 1.14.13.28	3,9-dihydroxypterocarpan 6A-monooxygenase
 1.14.13.29	4-nitrophenol 2-monooxygenase
@@ -1225,7 +1258,7 @@
 1.14.13.36	5-O-(4-coumaroyl)-D-quinate 3'-monooxygenase
 1.14.13.37	Methyltetrahydroprotoberberine 14-monooxygenase
 1.14.13.38	Anhydrotetracycline monooxygenase
-1.14.13.39	Nitric-oxide synthase (NADPH dependent)
+1.14.13.39	Nitric-oxide synthase (NADPH)
 1.14.13.40	Anthraniloyl-CoA monooxygenase
 1.14.13.41	Tyrosine N-monooxygenase
 1.14.13.43	Questin monooxygenase
@@ -1276,7 +1309,6 @@
 1.14.13.92	Phenylacetone monooxygenase
 1.14.13.93	(+)-abscisic acid 8'-hydroxylase
 1.14.13.94	Lithocholate 6-beta-hydroxylase
-1.14.13.95	7-alpha-hydroxycholest-4-en-3-one 12-alpha-hydroxylase
 1.14.13.96	5-beta-cholestane-3-alpha,7-alpha-diol 12-alpha-hydroxylase
 1.14.13.97	Taurochenodeoxycholate 6-alpha-hydroxylase
 1.14.13.98	Cholesterol 24-hydroxylase
@@ -1313,7 +1345,6 @@
 1.14.13.129	Beta-carotene 3-hydroxylase
 1.14.13.130	Pyrrole-2-carboxylate monooxygenase
 1.14.13.131	Dimethyl-sulfide monooxygenase
-1.14.13.132	Squalene monooxygenase
 1.14.13.133	Pentalenene oxygenase
 1.14.13.134	Beta-amyrin 11-oxidase
 1.14.13.135	1-hydroxy-2-naphthoate hydroxylase
@@ -1345,11 +1376,10 @@
 1.14.13.161	(+)-camphor 6-exo-hydroxylase
 1.14.13.162	2,5-diketocamphane 1,2-monooxygenase
 1.14.13.163	6-hydroxy-3-succinoylpyridine 3-monooxygenase
-1.14.13.165	Nitric-oxide synthase (NAD(P)H-dependent)
+1.14.13.165	Nitric-oxide synthase (NAD(P)H)
 1.14.13.166	4-nitrocatechol 4-monooxygenase
 1.14.13.167	4-nitrophenol 4-monooxygenase
 1.14.13.168	Indole-3-pyruvate monooxygenase
-1.14.13.169	Sphinganine C(4)-monooxygenase
 1.14.13.170	Pentalenolactone D synthase
 1.14.13.171	Neopentalenolactone D synthase
 1.14.13.172	Salicylate 5-hydroxylase
@@ -1381,6 +1411,15 @@
 1.14.13.198	Monacolin L hydroxylase
 1.14.13.199	Docosahexaenoic acid omega-hydroxylase
 1.14.13.200	Tetracenomycin A2 monooxygenase-diooxygenase
+1.14.13.201	Beta-amyrin 28-monooxygenase
+1.14.13.202	Methyl farnesoate epoxidase
+1.14.13.203	Farnesoate epoxidase
+1.14.13.204	Long-chain acyl-CoA omega-monooxygenase
+1.14.13.205	Long-chain fatty acid omega-monooxygenase
+1.14.13.206	Laurate 7-monooxygenase
+1.14.13.207	Ipsdienol synthase
+1.14.13.208	Benzoyl-CoA 2,3-epoxidase
+1.14.13.209	Salicyloyl-CoA 5-hydroxylase
 1.14.13.n5	Dihomomethionine N-hydroxylase
 1.14.13.n6	Hexahomomethionine N-hydroxylase
 1.14.13.n7	4-nitrophenol 2-hydroxylase
@@ -1396,6 +1435,10 @@
 1.14.14.13	4-(gamma-L-glutamylamino)butanoyl-[BtrI acyl-carrier protein] monooxygenase
 1.14.14.14	Aromatase
 1.14.14.15	(3S)-3-amino-3-(3-chloro-4-hydroxyphenyl)propanoyl-[peptidyl-carrier protein SgcC2] monooxygenase
+1.14.14.16	Steroid 21-monooxygenase
+1.14.14.17	Squalene monooxygenase
+1.14.14.18	Heme oxygenase (biliverdin-producing)
+1.14.14.19	Steroid 17-alpha-monooxygenase
 1.14.15.1	Camphor 5-monooxygenase
 1.14.15.3	Alkane 1-monooxygenase
 1.14.15.4	Steroid 11-beta-monooxygenase
@@ -1408,6 +1451,7 @@
 1.14.15.11	Pentalenic acid synthase
 1.14.15.12	Pimeloyl-[acyl-carrier protein] synthase
 1.14.15.13	Pulcherriminic acid synthase
+1.14.15.14	Methyl-branched lipid omega-hydroxylase
 1.14.16.1	Phenylalanine 4-monooxygenase
 1.14.16.2	Tyrosine 3-monooxygenase
 1.14.16.3	Anthranilate 3-monooxygenase
@@ -1421,14 +1465,57 @@
 1.14.18.1	Tyrosinase
 1.14.18.2	CMP-N-acetylneuraminate monooxygenase
 1.14.18.3	Methane monooxygenase (particulate)
+1.14.18.4	Phosphatidylcholine 12-monooxygenase
+1.14.18.5	Sphingolipid C4-monooxygenase
+1.14.18.6	4-hydroxysphinganine ceramide fatty acyl 2-hydroxylase
+1.14.18.7	Dihydroceramide fatty acyl 2-hydroxylase
+1.14.18.8	7-alpha-hydroxycholest-4-en-3-one 12-alpha-hydroxylase
 1.14.19.1	Stearoyl-CoA 9-desaturase
-1.14.19.2	Acyl-[acyl-carrier-protein] desaturase
-1.14.19.3	Linoleoyl-CoA desaturase
-1.14.19.4	Delta(8)-fatty-acid desaturase
-1.14.19.5	Delta(11)-fatty-acid desaturase
-1.14.19.6	Delta(12)-fatty-acid desaturase
+1.14.19.2	Stearoyl-[acyl-carrier-protein] 9-desaturase
+1.14.19.3	Acyl-CoA 6-desaturase
+1.14.19.4	Acyl-lipid (11-3)-desaturase
+1.14.19.5	Acyl-CoA 11-(Z)-desaturase
+1.14.19.6	Acyl-CoA (9+3)-desaturase
 1.14.19.8	Pentalenolactone synthase
 1.14.19.9	Tryptophan 7-halogenase
+1.14.19.10	Icosanoyl-CoA 5-desaturase
+1.14.19.11	Acyl-[acyl-carrier-protein] 4-desaturase
+1.14.19.12	Acyl-lipid omega-(9-4) desaturase
+1.14.19.13	Acyl-CoA 15-desaturase
+1.14.19.14	Linoleoyl-lipid Delta(9) conjugase
+1.14.19.15	(11Z)-hexadec-11-enoyl-CoA conjugase
+1.14.19.16	Linoleoyl-lipid Delta(12) conjugase (11E,13Z-forming)
+1.14.19.17	Sphingolipid 4-desaturase
+1.14.19.18	Sphingolipid 8-(E)-desaturase
+1.14.19.19	Sphingolipid 10-desaturase
+1.14.19.20	Delta(7)-sterol 5(6)-desaturase
+1.14.19.21	Cholesterol 7-desaturase
+1.14.19.22	Acyl-lipid omega-6 desaturase (cytochrome b5)
+1.14.19.23	Acyl-lipid (n+3)-(Z)-desaturase (ferredoxin)
+1.14.19.24	Acyl-CoA 11-(E)-desaturase
+1.14.19.25	Acyl-lipid omega-3 desaturase (cytochrome b5)
+1.14.19.26	Acyl-[acyl-carrier-protein] 6-desaturase
+1.14.19.27	sn-2 palmitoyl-lipid 9-desaturase
+1.14.19.28	sn-1 stearoyl-lipid 9-desaturase
+1.14.19.29	Sphingolipid 8-(E/Z)-desaturase
+1.14.19.30	Acyl-lipid (8-3)-desaturase
+1.14.19.31	Acyl-lipid (7-3)-desaturase
+1.14.19.32	Palmitoyl-CoA 14-(E/Z)-desaturase
+1.14.19.33	Delta(12) acyl-lipid conjugase (11E,13E-forming)
+1.14.19.34	Acyl-lipid (9+3)-(E)-desaturase
+1.14.19.35	sn-2 acyl-lipid omega-3 desaturase (ferredoxin)
+1.14.19.36	sn-1 acyl-lipid omega-3 desaturase (ferredoxin)
+1.14.19.37	Acyl-CoA 5-desaturase
+1.14.19.38	Acyl-lipid Delta(6)-acetylenase
+1.14.19.39	Acyl-lipid Delta(12)-acetylenase
+1.14.19.40	Hex-5-enoyl-[acyl-carrier protein] acetylenase
+1.14.19.41	Sterol 22-desaturase
+1.14.19.42	Palmitoyl-[glycerolipid] 7-desaturase
+1.14.19.43	Palmitoyl-[glycerolipid] 3-(E)-desaturase
+1.14.19.44	Acyl-CoA (8-3)-desaturase
+1.14.19.45	sn-1 oleoyl-lipid 12-desaturase
+1.14.19.46	sn-1 linoleoyl-lipid 6-desaturase
+1.14.19.47	Acyl-lipid (9-3)-desaturase
 1.14.19.n4	Stearoyl-CoA 9-desaturase
 1.14.19.n5	Versicolorin B desaturase
 1.14.20.1	Deacetoxycephalosporin-C synthase
@@ -1439,17 +1526,13 @@
 1.14.21.3	Berbamunine synthase
 1.14.21.4	Salutaridine synthase
 1.14.21.5	(S)-canadine synthase
-1.14.21.6	Lathosterol oxidase
 1.14.21.7	Biflaviolin synthase
 1.14.21.8	Pseudobaptigenin synthase
 1.14.21.9	Mycocyclosin synthase
 1.14.21.10	Fumitremorgin C synthase
 1.14.99.1	Prostaglandin-endoperoxide synthase
 1.14.99.2	Kynurenine 7,8-hydroxylase
-1.14.99.3	Heme oxygenase (biliverdin-producing)
 1.14.99.4	Progesterone monooxygenase
-1.14.99.9	Steroid 17-alpha-monooxygenase
-1.14.99.10	Steroid 21-monooxygenase
 1.14.99.11	Estradiol 6-beta-monooxygenase
 1.14.99.12	Androst-4-ene-3,17-dione monooxygenase
 1.14.99.14	Progesterone 11-alpha-monooxygenase
@@ -1463,9 +1546,6 @@
 1.14.99.26	2-hydroxypyridine 5-monooxygenase
 1.14.99.27	Juglone 3-monooxygenase
 1.14.99.29	Deoxyhypusine monooxygenase
-1.14.99.31	Myristoyl-CoA 11-(E) desaturase
-1.14.99.32	Myristoyl-CoA 11-(Z) desaturase
-1.14.99.33	Delta(12)-fatty acid dehydrogenase
 1.14.99.34	Monoprenyl isoflavone epoxidase
 1.14.99.35	Thiophene-2-carbonyl-CoA monooxygenase
 1.14.99.36	Beta-carotene 15,15'-monooxygenase
@@ -1480,6 +1560,9 @@
 1.14.99.47	(+)-larreatricin hydroxylase
 1.14.99.48	Heme oxygenase (staphylobilin-producing)
 1.14.99.49	2-hydroxy-5-methyl-1-naphthoate 7-hydroxylase
+1.14.99.50	Gamma-glutamyl hercynylcysteine S-oxide synthase
+1.14.99.51	Hercynylcysteine S-oxide synthase
+1.14.99.52	L-cysteinyl-L-histidinylsulfoxide synthase
 1.14.99.n4	Carotenoid 9,10-dioxygenase
 1.15.1.1	Superoxide dismutase
 1.15.1.2	Superoxide reductase
@@ -1503,7 +1586,6 @@
 1.17.1.3	Leucoanthocyanidin reductase
 1.17.1.4	Xanthine dehydrogenase
 1.17.1.5	Nicotinate dehydrogenase
-1.17.1.7	3-oxo-5,6-dehydrosuberyl-CoA semialdehyde dehydrogenase
 1.17.1.8	4-hydroxy-tetrahydrodipicolinate reductase
 1.17.2.1	Nicotinate dehydrogenase (cytochrome)
 1.17.2.2	Lupanine 17-hydroxylase (cytochrome c)
@@ -1512,15 +1594,19 @@
 1.17.3.3	6-hydroxynicotinate dehydrogenase
 1.17.4.1	Ribonucleoside-diphosphate reductase
 1.17.4.2	Ribonucleoside-triphosphate reductase
+1.17.4.4	Vitamin-K-epoxide reductase (warfarin-sensitive)
+1.17.4.5	Vitamin-K-epoxide reductase (warfarin-insensitive)
 1.17.5.1	Phenylacetyl-CoA dehydrogenase
 1.17.5.2	Caffeine dehydrogenase
-1.17.7.1	(E)-4-hydroxy-3-methylbut-2-enyl-diphosphate synthase
+1.17.7.1	(E)-4-hydroxy-3-methylbut-2-enyl-diphosphate synthase (ferredoxin)
 1.17.7.2	7-hydroxymethyl chlorophyll a reductase
+1.17.7.3	(E)-4-hydroxy-3-methylbut-2-enyl-diphosphate synthase (flavodoxin)
+1.17.98.1	Bile-acid 7-alpha-dehydroxylase
 1.17.99.1	4-methylphenol dehydrogenase (hydroxylating)
 1.17.99.2	Ethylbenzene hydroxylase
 1.17.99.3	3-alpha,7-alpha,12-alpha-trihydroxy-5-beta-cholestanoyl-CoA 24-hydroxylase
 1.17.99.4	Uracil/thymine dehydrogenase
-1.17.99.5	Bile-acid 7-alpha-dehydroxylase
+1.17.99.6	Epoxyqueuosine reductase
 1.18.1.1	Rubredoxin--NAD(+) reductase
 1.18.1.2	Ferredoxin--NADP(+) reductase
 1.18.1.3	Ferredoxin--NAD(+) reductase
@@ -1528,6 +1614,7 @@
 1.18.1.5	Putidaredoxin--NAD(+) reductase
 1.18.1.6	Adrenodoxin-NADP(+) reductase
 1.18.1.7	Ferredoxin--NAD(P)(+) reductase (naphthalene dioxygenase ferredoxin-specific)
+1.18.1.8	Ferredoxin-NAD(+) oxidoreductase (Na(+)-transporting)
 1.18.6.1	Nitrogenase
 1.19.6.1	Nitrogenase (flavodoxin)
 1.20.1.1	Phosphonate dehydrogenase
@@ -1535,8 +1622,11 @@
 1.20.4.1	Arsenate reductase (glutaredoxin)
 1.20.4.2	Methylarsonate reductase
 1.20.4.3	Mycoredoxin
+1.20.4.4	Arsenate reductase (thioredoxin)
 1.20.9.1	Arsenate reductase (azurin)
 1.20.99.1	Arsenate reductase (donor)
+1.21.1.1	Iodotyrosine deiodinase
+1.21.1.2	2,4-dichlorobenzoyl-CoA reductase
 1.21.3.1	Isopenicillin-N synthase
 1.21.3.2	Columbamine oxidase
 1.21.3.3	Reticuline oxidase
@@ -1550,20 +1640,20 @@
 1.21.4.2	Glycine reductase
 1.21.4.3	Sarcosine reductase
 1.21.4.4	Betaine reductase
+1.21.98.1	Cyclic dehypoxanthinyl futalosine synthase
 1.21.99.1	Beta-cyclopiazonate dehydrogenase
-1.21.99.2	Cyclic dehypoxanthinyl futalosine synthase
-1.22.1.1	Iodotyrosine deiodinase
+1.21.99.3	Thyroxine 5-deiodinase
+1.21.99.4	Thyroxine 5'-deiodinase
 1.23.1.1	(+)-pinoresinol reductase
 1.23.1.2	(+)-lariciresinol reductase
 1.23.1.3	(-)-pinoresinol reductase
 1.23.1.4	(-)-lariciresinol reductase
+1.23.5.1	Violaxanthin de-epoxidase
 1.97.1.1	Chlorate reductase
 1.97.1.2	Pyrogallol hydroxytransferase
 1.97.1.4	[Formate-C-acetyltransferase]-activating enzyme
 1.97.1.8	Tetrachloroethene reductive dehalogenase
 1.97.1.9	Selenate reductase
-1.97.1.10	Thyroxine 5'-deiodinase
-1.97.1.11	Thyroxine 5-deiodinase
 1.97.1.12	Photosystem I
 2.1.1.1	Nicotinamide N-methyltransferase
 2.1.1.2	Guanidinoacetate N-methyltransferase
@@ -1672,9 +1762,6 @@
 2.1.1.121	6-O-methylnorlaudanosoline 5'-O-methyltransferase
 2.1.1.122	(S)-tetrahydroprotoberberine N-methyltransferase
 2.1.1.123	[Cytochrome c]-methionine S-methyltransferase
-2.1.1.124	[Cytochrome c]-arginine N-methyltransferase
-2.1.1.125	Histone-arginine N-methyltransferase
-2.1.1.126	[Myelin basic protein]-arginine N-methyltransferase
 2.1.1.127	[Ribulose-bisphosphate carboxylase]-lysine N-methyltransferase
 2.1.1.128	(RS)-norcoclaurine 6-O-methyltransferase
 2.1.1.129	Inositol 4-methyltransferase
@@ -1851,6 +1938,21 @@
 2.1.1.305	8-demethyl-8-alpha-L-rhamnosyl tetracenomycin-C 2'-O-methyltransferase
 2.1.1.306	8-demethyl-8-(2-methoxy-alpha-L-rhamnosyl)-tetracenomycin-C 3'-O-methyltransferase
 2.1.1.307	8-demethyl-8-(2,3-dimethoxy-alpha-L-rhamnosyl)-tetracenomycin-C 4'-O-methyltransferase
+2.1.1.308	2-hydroxyethylphosphonate methyltransferase
+2.1.1.309	18S rRNA (guanine(1575)-N(7))-methyltransferase
+2.1.1.310	25S rRNA (cytosine(2870)-C(5))-methyltransferase
+2.1.1.311	25S rRNA (cytosine(2278)-C(5))-methyltransferase
+2.1.1.312	25S rRNA (uracil(2843)-N(3))-methyltransferase
+2.1.1.313	25S rRNA (uracil(2634)-N(3))-methyltransferase
+2.1.1.314	Diphthine methyl ester synthase
+2.1.1.315	27-O-demethylrifamycin SV methyltransferase
+2.1.1.316	Mitomycin 6-O-methyltransferase
+2.1.1.317	Sphingolipid C(9)-methyltransferase
+2.1.1.318	[Trehalose-6-phosphate synthase]-L-cysteine S-methyltransferase
+2.1.1.319	Type I protein arginine methyltransferase
+2.1.1.320	Type II protein arginine methyltransferase
+2.1.1.321	Type III protein arginine methyltransferase
+2.1.1.322	Type IV protein arginine methyltransferase
 2.1.1.n1	Resorcinol O-methyltransferase
 2.1.1.n4	Thiocyanate methyltransferase
 2.1.1.n7	5-pentadecatrienyl resorcinol O-methyltransferase
@@ -1892,6 +1994,7 @@
 2.2.1.9	2-succinyl-5-enolpyruvyl-6-hydroxy-3-cyclohexene-1-carboxylic-acid synthase
 2.2.1.10	2-amino-3,7-dideoxy-D-threo-hept-6-ulosonate synthase
 2.2.1.11	6-deoxy-5-ketofructose 1-phosphate synthase
+2.2.1.12	3-acetyloctanal synthase
 2.3.1.1	Amino-acid N-acetyltransferase
 2.3.1.2	Imidazole N-acetyltransferase
 2.3.1.3	Glucosamine N-acetyltransferase
@@ -1950,7 +2053,7 @@
 2.3.1.57	Diamine N-acetyltransferase
 2.3.1.58	2,3-diaminopropionate N-oxalyltransferase
 2.3.1.59	Gentamicin 2'-N-acetyltransferase
-2.3.1.60	Gentamicin 3'-N-acetyltransferase
+2.3.1.60	Gentamicin 3-N-acetyltransferase
 2.3.1.61	Dihydrolipoyllysine-residue succinyltransferase
 2.3.1.62	2-acylglycerophosphocholine O-acyltransferase
 2.3.1.63	1-alkylglycerophosphocholine O-acyltransferase
@@ -1970,8 +2073,8 @@
 2.3.1.78	Heparan-alpha-glucosaminide N-acetyltransferase
 2.3.1.79	Maltose O-acetyltransferase
 2.3.1.80	Cysteine-S-conjugate N-acetyltransferase
-2.3.1.81	Aminoglycoside N(3')-acetyltransferase
-2.3.1.82	Aminoglycoside N(6')-acetyltransferase
+2.3.1.81	Aminoglycoside N(3)-acetyltransferase
+2.3.1.82	Aminoglycoside 6'-N-acetyltransferase
 2.3.1.83	Phosphatidylcholine--dolichol O-acyltransferase
 2.3.1.84	Alcohol O-acetyltransferase
 2.3.1.85	Fatty-acid synthase
@@ -2007,7 +2110,6 @@
 2.3.1.116	Flavonol-3-O-beta-glucoside O-malonyltransferase
 2.3.1.117	2,3,4,5-tetrahydropyridine-2,6-dicarboxylate N-succinyltransferase
 2.3.1.118	N-hydroxyarylamine O-acetyltransferase
-2.3.1.119	Icosanoyl-CoA synthase
 2.3.1.121	1-alkenylglycerophosphoethanolamine O-acyltransferase
 2.3.1.122	Trehalose O-mycolyltransferase
 2.3.1.123	Dolichol O-acyltransferase
@@ -2120,6 +2222,24 @@
 2.3.1.231	tRNA(Phe) (7-(3-amino-3-(methoxycarbonyl)propyl)wyosine(37)-N)-methoxycarbonyltransferase
 2.3.1.232	Methanol O-anthraniloyltransferase
 2.3.1.233	1,3,6,8-tetrahydroxynaphthalene synthase
+2.3.1.234	N(6)-L-threonylcarbamoyladenine synthase
+2.3.1.235	Tetracenomycin F2 synthase
+2.3.1.236	5-methylnaphthoic acid synthase
+2.3.1.237	Neocarzinostatin naphthoate synthase
+2.3.1.238	Monacolin J acid methylbutanoate transferase
+2.3.1.239	10-deoxymethynolide syntase
+2.3.1.240	Narbonolide synthase
+2.3.1.241	Kdo(2)-lipid IV(A) lauroyltransferase
+2.3.1.242	Kdo(2)-lipid IV(A) palmitoleoyltransferase
+2.3.1.243	Lauroyl-Kdo(2)-lipid IV(A) myristoyltransferase
+2.3.1.244	2-methylbutanoate polyketide synthase
+2.3.1.245	3-hydroxy-5-phosphonooxypentane-2,4-dione thiolase
+2.3.1.246	3,5-dihydroxyphenylacetyl-CoA synthase
+2.3.1.247	3-keto-5-aminohexanoate cleavage enzyme
+2.3.1.248	Spermidine disinapoyl transferase
+2.3.1.249	Spermidine dicoumaroyl transferase
+2.3.1.250	[Wnt protein] O-palmitoleoyl transferase
+2.3.1.251	Lipid IV(A) palmitoyltransferase
 2.3.1.n2	Phosphate acyltransferase
 2.3.1.n3	Glycerol-3-phosphate acyltransferase (acyl-phosphate transferring)
 2.3.1.n4	1-acyl-sn-glycerol-3-phosphate acyltransferase
@@ -2149,6 +2269,12 @@
 2.3.2.20	Cyclo(L-leucyl-L-phenylalanyl) synthase
 2.3.2.21	Cyclo(L-tyrosyl-L-tyrosyl) synthase
 2.3.2.22	Cyclo(L-leucyl-L-leucyl) synthase
+2.3.2.23	E2 ubiquitin-conjugating enzyme
+2.3.2.24	(E3-independent) E2 ubiquitin-conjugating enzyme
+2.3.2.25	N-terminal E2 ubiquitin-conjugating enzyme
+2.3.2.26	HECT-type E3 ubiquitin transferase
+2.3.2.27	RING-type E3 ubiquitin transferase
+2.3.2.28	L-allo-isoleucyltransferase
 2.3.3.1	Citrate (Si)-synthase
 2.3.3.2	Decylcitrate synthase
 2.3.3.3	Citrate (Re)-synthase
@@ -2195,7 +2321,7 @@
 2.4.1.30	1,3-beta-oligoglucan phosphorylase
 2.4.1.31	Laminaribiose phosphorylase
 2.4.1.32	Glucomannan 4-beta-mannosyltransferase
-2.4.1.33	Alginate synthase
+2.4.1.33	Mannuronan synthase
 2.4.1.34	1,3-beta-glucan synthase
 2.4.1.35	Phenol beta-glucosyltransferase
 2.4.1.36	Alpha,alpha-trehalose-phosphate synthase (GDP-forming)
@@ -2295,7 +2421,7 @@
 2.4.1.149	N-acetyllactosaminide beta-1,3-N-acetylglucosaminyltransferase
 2.4.1.150	N-acetyllactosaminide beta-1,6-N-acetylglucosaminyl-transferase
 2.4.1.152	4-galactosyl-N-acetylglucosaminide 3-alpha-L-fucosyltransferase
-2.4.1.153	Dolichyl-phosphate alpha-N-acetylglucosaminyltransferase
+2.4.1.153	UDP-N-acetylglucosamine--dolichyl-phosphate N-acetylglucosaminyltransferase
 2.4.1.155	Alpha-1,6-mannosyl-glycoprotein 6-beta-N-acetylglucosaminyltransferase
 2.4.1.156	Indolylacetyl-myo-inositol galactosyltransferase
 2.4.1.157	1,2-diacylglycerol 3-glucosyltransferase
@@ -2438,7 +2564,7 @@
 2.4.1.299	Cyanidin 3-O-glucoside 5-O-glucosyltransferase (acyl-glucose)
 2.4.1.300	Cyanidin 3-O-glucoside 7-O-glucosyltransferase (acyl-glucose)
 2.4.1.301	2'-deamino-2'-hydroxyneamine 1-alpha-D-kanosaminyltransferase
-2.4.1.302	L-noviosyl transferase
+2.4.1.302	L-demethylnoviosyl transferase
 2.4.1.303	UDP-Gal:alpha-D-GlcNAc-diphosphoundecaprenol beta-1,3-galactosyltransferase
 2.4.1.304	UDP-Gal:alpha-D-GlcNAc-diphosphoundecaprenol beta-1,4-galactosyltransferase
 2.4.1.305	UDP-Glc:alpha-D-GlcNAc-glucosaminyl-diphosphoundecaprenol beta-1,3-glucosyltransferase
@@ -2462,12 +2588,18 @@
 2.4.1.323	7-deoxyloganetic acid glucosyltransferase
 2.4.1.324	7-deoxyloganetin glucosyltransferase
 2.4.1.325	TDP-N-acetylfucosamine:lipid II N-acetylfucosaminyltransferase
-2.4.1.326	Aklavinone 7-beta-L-rhodosaminyltransferase
+2.4.1.326	Aklavinone 7-L-rhodosaminyltransferase
 2.4.1.327	Aclacinomycin-T 2-deoxy-L-fucose transferase
 2.4.1.328	Erythronolide mycarosyltransferase
 2.4.1.329	Sucrose 6(F)-phosphate phosphorylase
 2.4.1.330	Beta-D-glucosyl crocetin beta-1,6-glucosyltransferase
 2.4.1.331	8-demethyltetracenomycin C L-rhamnosyltransferase
+2.4.1.332	1,2-alpha-glucosylglycerol phosphorylase
+2.4.1.333	1,2-beta-oligoglucan phosphorylase
+2.4.1.334	1,3-alpha-oligoglucan phosphorylase
+2.4.1.335	Dolichyl N-acetyl-alpha-D-glucosaminyl phosphate 3-beta-D-2,3-diacetamido-2,3-dideoxy-beta-D-glucuronosyltransferase
+2.4.1.336	Monoglucosyldiacylglycerol synthase
+2.4.1.337	1,2-diacylglycerol 3-alpha-glucosyltransferase
 2.4.1.n2	Loliose synthase
 2.4.2.1	Purine-nucleoside phosphorylase
 2.4.2.2	Pyrimidine-nucleoside phosphorylase
@@ -2519,7 +2651,7 @@
 2.4.2.51	Anthocyanidin 3-O-glucoside 2'''-O-xylosyltransferase
 2.4.2.52	Triphosphoribosyl-dephospho-CoA synthase
 2.4.2.53	Undecaprenyl-phosphate 4-deoxy-4-formamido-L-arabinose transferase
-2.4.2.54	Beta-ribofuranosylaminobenzene 5'-phosphate synthase
+2.4.2.54	Beta-ribofuranosylphenol 5'-phosphate synthase
 2.4.2.55	Nicotinate D-ribonucleotide:phenol phospho-D-ribosyltransferase
 2.4.2.56	Kaempferol 3-O-xylosyltransferase
 2.4.2.57	AMP phosphorylase
@@ -2537,17 +2669,18 @@
 2.4.99.10	Neolactotetraosylceramide alpha-2,3-sialyltransferase
 2.4.99.11	Lactosylceramide alpha-2,6-N-sialyltransferase
 2.4.99.12	Lipid IV(A) 3-deoxy-D-manno-octulosonic acid transferase
-2.4.99.13	(KDO)-lipid IV(A) 3-deoxy-D-manno-octulosonic acid transferase
-2.4.99.14	(KDO)(2)-lipid IV(A) (2-8) 3-deoxy-D-manno-octulosonic acid transferase
-2.4.99.15	(KDO)(3)-lipid IV(A) (2-4) 3-deoxy-D-manno-octulosonic acid transferase
+2.4.99.13	(Kdo)-lipid IV(A) 3-deoxy-D-manno-octulosonic acid transferase
+2.4.99.14	(Kdo)(2)-lipid IV(A) (2-8) 3-deoxy-D-manno-octulosonic acid transferase
+2.4.99.15	(Kdo)(3)-lipid IV(A) (2-4) 3-deoxy-D-manno-octulosonic acid transferase
 2.4.99.16	Starch synthase (maltosyl-transferring)
 2.4.99.17	S-adenosylmethionine:tRNA ribosyltransferase-isomerase
 2.4.99.18	Dolichyl-diphosphooligosaccharide--protein glycotransferase
 2.4.99.19	Undecaprenyl-diphosphooligosaccharide--protein glycotransferase
 2.4.99.20	2'-phospho-ADP-ribosyl cyclase/2'-phospho-cyclic-ADP-ribose transferase
+2.4.99.21	Dolichyl-phosphooligosaccharide-protein glycotransferase
 2.5.1.1	Dimethylallyltranstransferase
 2.5.1.2	Thiamine pyridinylase
-2.5.1.3	Thiamine-phosphate diphosphorylase
+2.5.1.3	Thiamine phosphate synthase
 2.5.1.4	Adenosylmethionine cyclotransferase
 2.5.1.5	Galactose-6-sulfurylase
 2.5.1.6	Methionine adenosyltransferase
@@ -2663,6 +2796,10 @@
 2.5.1.125	7-geranyloxy-5-hydroxy-2-methoxy-3-methylnaphthalene-1,4-dione synthase
 2.5.1.126	Norspermine synthase
 2.5.1.127	Caldopentamine synthase
+2.5.1.128	N(4)-bis(aminopropyl)spermidine synthase
+2.5.1.129	Flavin prenyltransferase
+2.5.1.130	2-carboxy-1,4-naphthoquinone phytyltransferase
+2.5.1.131	(4-(4-(2-(gamma-L-glutamylamino)ethyl)phenoxymethyl)furan-2-yl)methanamine synthase
 2.5.1.n9	Heptaprenylglyceryl phosphate synthase
 2.6.1.1	Aspartate transaminase
 2.6.1.2	Alanine transaminase
@@ -2764,11 +2901,12 @@
 2.6.1.105	Lysine--8-amino-7-oxononanoate transaminase
 2.6.1.106	dTDP-3-amino-3,4,6-trideoxy-alpha-D-glucose transaminase
 2.6.1.107	Beta-methylphenylalanine transaminase
+2.6.1.108	(5-formylfuran-3-yl)methyl phosphate transaminase
+2.6.1.109	8-amino-3,8-dideoxy-alpha-D-manno-octulosonate transaminase
 2.6.3.1	Oximinotransferase
 2.6.99.1	dATP(dGTP)--DNA purinetransferase
 2.6.99.2	Pyridoxine 5'-phosphate synthase
 2.6.99.3	O-ureido-L-serine synthase
-2.6.99.4	N(6)-L-threonylcarbamoyladenine synthase
 2.7.1.1	Hexokinase
 2.7.1.2	Glucokinase
 2.7.1.3	Ketohexokinase
@@ -2922,6 +3060,10 @@
 2.7.1.184	Sulfofructose kinase
 2.7.1.185	Mevalonate 3-kinase
 2.7.1.186	Mevalonate-3-phosphate 5-kinase
+2.7.1.187	Acarbose 7(IV)-phosphotransferase
+2.7.1.188	2-epi-5-epi-valiolone 7-kinase
+2.7.1.189	Autoinducer-2 kinase
+2.7.1.190	Aminoglycoside 2''-phosphotransferase
 2.7.2.1	Acetate kinase
 2.7.2.2	Carbamate kinase
 2.7.2.3	Phosphoglycerate kinase
@@ -2972,6 +3114,9 @@
 2.7.4.26	Isopentenyl phosphate kinase
 2.7.4.27	([Pyruvate, phosphate dikinase] phosphate) phosphotransferase
 2.7.4.28	([Pyruvate, water dikinase] phosphate) phosphotransferase
+2.7.4.29	Kdo(2)-lipid A phosphotransferase
+2.7.4.30	Lipid A phosphoethanolamine transferase
+2.7.4.31	(5-(aminomethyl)furan-3-yl)methyl phosphate kinase
 2.7.6.1	Ribose-phosphate diphosphokinase
 2.7.6.2	Thiamine diphosphokinase
 2.7.6.3	2-amino-4-hydroxy-6-hydroxymethyldihydropteridine diphosphokinase
@@ -3034,7 +3179,7 @@
 2.7.7.64	UTP-monosaccharide-1-phosphate uridylyltransferase
 2.7.7.65	Diguanylate cyclase
 2.7.7.66	Malonate decarboxylase holo-[acyl-carrier protein] synthase
-2.7.7.67	CDP-archaeol synthase
+2.7.7.67	CDP-2,3-bis-(O-geranylgeranyl)-sn-glycerol synthase
 2.7.7.68	2-phospho-L-lactate guanylyltransferase
 2.7.7.69	GDP-L-galactose phosphorylase
 2.7.7.70	D-glycero-beta-D-manno-heptose 1-phosphate adenylyltransferase
@@ -3055,6 +3200,8 @@
 2.7.7.85	Diadenylate cyclase
 2.7.7.86	Cyclic GMP-AMP synthase
 2.7.7.87	L-threonylcarbamoyladenylate synthase
+2.7.7.88	GDP polyribonucleotidyltransferase
+2.7.7.89	[Glutamate--ammonia ligase]-adenylyl-L-tyrosine phosphorylase
 2.7.7.n1	Adenosine monophosphate-protein transferase
 2.7.7.n6	Guanine phosphate-protein transferase
 2.7.8.1	Ethanolaminephosphotransferase
@@ -3094,6 +3241,8 @@
 2.7.8.38	Archaetidylserine synthase
 2.7.8.39	Archaetidylinositol phosphate synthase
 2.7.8.40	UDP-N-acetylgalactosamine-undecaprenyl-phosphate N-acetylgalactosaminephosphotransferase
+2.7.8.41	Cardiolipin synthase (CMP-forming)
+2.7.8.42	Kdo(2)-lipid A phosphoethanolamine 7''-transferase
 2.7.8.n3	Ceramide phosphoethanolamine synthase
 2.7.9.1	Pyruvate, phosphate dikinase
 2.7.9.2	Pyruvate, water dikinase
@@ -3154,6 +3303,8 @@
 2.8.1.10	Thiazole synthase
 2.8.1.11	Molybdopterin-synthase sulfurtransferase
 2.8.1.12	Molybdopterin synthase
+2.8.1.13	tRNA-uridine 2-sulfurtransferase
+2.8.1.14	tRNA-5-taurinomethyluridine 2-sulfurtransferase
 2.8.2.1	Aryl sulfotransferase
 2.8.2.2	Alcohol sulfotransferase
 2.8.2.3	Amine sulfotransferase
@@ -3211,6 +3362,7 @@
 2.8.3.20	Succinyl-CoA--D-citramalate CoA-transferase
 2.8.3.21	L-carnitine CoA-transferase
 2.8.3.22	Succinyl-CoA--L-malate CoA-transferase
+2.8.3.23	Caffeate CoA-transferase
 2.8.4.1	Coenzyme-B sulfoethylthiotransferase
 2.8.4.2	Arsenate-mycothiol transferase
 2.8.4.3	tRNA-2-methylthio-N(6)-dimethylallyladenosine synthase
@@ -3308,6 +3460,8 @@
 3.1.1.94	Versiconal hemiacetal acetate esterase
 3.1.1.95	Aclacinomycin methylesterase
 3.1.1.96	D-aminoacyl-tRNA deacylase
+3.1.1.97	Methylated diphthine methylhydrolase
+3.1.1.98	[Wnt protein] O-palmitoleoyl-L-serine hydrolase
 3.1.1.n2	Protein-S-isoprenylcysteine alpha-carbonyl methylesterase
 3.1.2.1	Acetyl-CoA hydrolase
 3.1.2.2	Palmitoyl-CoA hydrolase
@@ -3335,6 +3489,7 @@
 3.1.2.28	1,4-dihydroxy-2-naphthoyl-CoA hydrolase
 3.1.2.29	Fluoroacetyl-CoA thioesterase
 3.1.2.30	(3S)-malyl-CoA thioesterase
+3.1.2.31	Dihydromonacolin L-[lovastatin nonaketide synthase] thioesterase
 3.1.3.1	Alkaline phosphatase
 3.1.3.2	Acid phosphatase
 3.1.3.3	Phosphoserine phosphatase
@@ -3427,7 +3582,9 @@
 3.1.3.93	L-galactose 1-phosphate phosphatase
 3.1.3.94	D-galactose 1-phosphate phosphatase
 3.1.3.95	Phosphatidylinositol-3,5-bisphosphate 3-phosphatase
-3.1.3.n6	Pseudouridine 5'-phosphatase
+3.1.3.96	Pseudouridine 5'-phosphatase
+3.1.3.97	3',5'-nucleoside bisphosphate phosphatase
+3.1.3.98	Geranyl diphosphate phosphohydrolase
 3.1.4.1	Phosphodiesterase I
 3.1.4.2	Glycerophosphocholine phosphodiesterase
 3.1.4.3	Phospholipase C
@@ -3436,7 +3593,6 @@
 3.1.4.12	Sphingomyelin phosphodiesterase
 3.1.4.13	Serine-ethanolaminephosphate phosphodiesterase
 3.1.4.14	[Acyl-carrier-protein] phosphodiesterase
-3.1.4.15	Adenylyl-[glutamate--ammonia ligase] hydrolase
 3.1.4.16	2',3'-cyclic-nucleotide 2'-phosphodiesterase
 3.1.4.17	3',5'-cyclic-nucleotide phosphodiesterase
 3.1.4.35	3',5'-cyclic-GMP phosphodiesterase
@@ -3771,6 +3927,7 @@
 3.3.2.11	Cholesterol-5,6-oxide hydrolase
 3.3.2.12	Oxepin-CoA hydrolase
 3.3.2.13	Chorismatase
+3.3.2.14	2,4-dinitroanisole O-demethylase
 3.4.11.1	Leucyl aminopeptidase
 3.4.11.2	Membrane alanyl aminopeptidase
 3.4.11.3	Cystinyl aminopeptidase
@@ -3814,6 +3971,7 @@
 3.4.14.10	Tripeptidyl-peptidase II
 3.4.14.11	Xaa-Pro dipeptidyl-peptidase
 3.4.14.12	Xaa-Xaa-Pro tripeptidyl-peptidase
+3.4.14.13	Gamma-D-glutamyl-L-lysine dipeptidyl-peptidase
 3.4.15.1	Peptidyl-dipeptidase A
 3.4.15.4	Peptidyl-dipeptidase B
 3.4.15.5	Peptidyl-dipeptidase Dcp
@@ -4134,6 +4292,8 @@
 3.4.24.85	S2P endopeptidase
 3.4.24.86	ADAM 17 endopeptidase
 3.4.24.87	ADAMTS13 endopeptidase
+3.4.24.88	Desampylase
+3.4.24.89	Pro-Pro endopeptidase
 3.4.25.1	Proteasome endopeptidase complex
 3.4.25.2	HslU--HslV peptidase
 3.5.1.1	Asparaginase
@@ -4162,7 +4322,6 @@
 3.5.1.24	Choloylglycine hydrolase
 3.5.1.25	N-acetylglucosamine-6-phosphate deacetylase
 3.5.1.26	N(4)-(beta-N-acetylglucosaminyl)-L-asparaginase
-3.5.1.27	N-formylmethionylaminoacyl-tRNA deformylase
 3.5.1.28	N-acetylmuramoyl-L-alanine amidase
 3.5.1.29	2-(acetamidomethylene)succinate hydrolase
 3.5.1.30	5-aminopentanamidase
@@ -4249,6 +4408,8 @@
 3.5.1.115	Mycothiol S-conjugate amidase
 3.5.1.116	Ureidoglycolate amidohydrolase
 3.5.1.117	6-aminohexanoate-oligomer endohydrolase
+3.5.1.118	Gamma-glutamyl hercynylcysteine S-oxide hydrolase
+3.5.1.119	Pup amidohydrolase
 3.5.1.n3	4-deoxy-4-formamido-L-arabinose-phosphoundecaprenol deformylase
 3.5.2.1	Barbiturase
 3.5.2.2	Dihydropyrimidinase
@@ -4268,6 +4429,7 @@
 3.5.2.17	Hydroxyisourate hydrolase
 3.5.2.18	Enamidase
 3.5.2.19	Streptothricin hydrolase
+3.5.2.20	Isatin hydrolase
 3.5.3.1	Arginase
 3.5.3.2	Guanidinoacetase
 3.5.3.3	Creatinase
@@ -4394,18 +4556,18 @@
 3.6.1.56	2-hydroxy-dATP diphosphatase
 3.6.1.57	UDP-2,4-diacetamido-2,4,6-trideoxy-beta-L-altropyranose hydrolase
 3.6.1.58	8-oxo-dGDP phosphatase
-3.6.1.59	5'-(N(7)-methyl 5'-triphosphoguanosine)-(mRNA) diphosphatase
+3.6.1.59	5'-(N(7)-methyl 5'-triphosphoguanosine)-[mRNA] diphosphatase
 3.6.1.60	Diadenosine hexaphosphate hydrolase (AMP-forming)
 3.6.1.61	Diadenosine hexaphosphate hydrolase (ATP-forming)
-3.6.1.62	5'-(N(7)-methylguanosine 5'-triphospho)-(mRNA) hydrolase
+3.6.1.62	5'-(N(7)-methylguanosine 5'-triphospho)-[mRNA] hydrolase
 3.6.1.63	Alpha-D-ribose 1-methylphosphonate 5-triphosphate diphosphatase
 3.6.1.64	Inosine diphosphate phosphatase
 3.6.1.65	(d)CTP diphosphatase
 3.6.1.66	XTP/dITP diphosphatase
+3.6.1.67	Dihydroneopterin triphosphate diphosphatase
 3.6.1.n1	D-tyrosyl-tRNA(Tyr) hydrolase
 3.6.1.n2	L-cysteinyl-tRNA(Pro)
 3.6.1.n3	L-cysteinyl-tRNA(Cys) hydrolase
-3.6.1.n4	Dihydroneopterin triphosphate diphosphatase
 3.6.2.1	Adenylylsulfatase
 3.6.2.2	Phosphoadenylylsulfatase
 3.6.3.1	Phospholipid-translocating ATPase
@@ -4617,6 +4779,9 @@
 4.1.1.97	2-oxo-4-hydroxy-4-carboxy-5-ureidoimidazoline decarboxylase
 4.1.1.98	4-hydroxy-3-polyprenylbenzoate decarboxylase
 4.1.1.99	Phosphomevalonate decarboxylase
+4.1.1.100	Prephenate decarboxylase
+4.1.1.101	Malolactic enzyme
+4.1.1.102	Phenacrylate decarboxylase
 4.1.2.2	Ketotetrose-phosphate aldolase
 4.1.2.4	Deoxyribose-phosphate aldolase
 4.1.2.5	L-threonine aldolase
@@ -4651,7 +4816,7 @@
 4.1.2.41	Vanillin synthase
 4.1.2.42	D-threonine aldolase
 4.1.2.43	3-hexulose-6-phosphate synthase
-4.1.2.44	Benzoyl-CoA-dihydrodiol lyase
+4.1.2.44	2,3-epoxybenzoyl-CoA dihydrolase
 4.1.2.45	Trans-o-hydroxybenzylidenepyruvate hydratase-aldolase
 4.1.2.46	Aliphatic (R)-hydroxynitrile lyase
 4.1.2.47	(S)-hydroxynitrile lyase
@@ -4838,16 +5003,23 @@
 4.2.1.152	Hydroperoxy icosatetraenoate dehydratase
 4.2.1.153	3-methylfumaryl-CoA hydratase
 4.2.1.154	Tetracenomycin F2 cyclase
+4.2.1.155	Methylthioacryloyl-CoA hydratase
+4.2.1.156	L-talarate dehydratase
+4.2.1.157	(R)-2-hydroxyisocaproyl-CoA dehydratase
+4.2.1.158	Galactarate dehydratase (D-threo-forming)
+4.2.1.159	dTDP-4-dehydro-6-deoxy-alpha-D-glucopyranose 2,3-dehydratase
+4.2.1.160	2,5-diamino-6-(5-phospho-D-ribosylamino)pyrimidin-4(3H)-one isomerase/dehydratase
+4.2.1.161	Bisanhydrobacterioruberin hydratase
 4.2.2.1	Hyaluronate lyase
 4.2.2.2	Pectate lyase
-4.2.2.3	Poly(beta-D-mannuronate) lyase
+4.2.2.3	Mannuronate-specific alginate lyase
 4.2.2.5	Chondroitin AC lyase
 4.2.2.6	Oligogalacturonide lyase
 4.2.2.7	Heparin lyase
 4.2.2.8	Heparin-sulfate lyase
 4.2.2.9	Pectate disaccharide-lyase
 4.2.2.10	Pectin lyase
-4.2.2.11	Poly(alpha-L-guluronate) lyase
+4.2.2.11	Guluronate-specific alginate lyase
 4.2.2.12	Xanthan lyase
 4.2.2.13	Exo-(1->4)-alpha-D-glucan lyase
 4.2.2.14	Glucuronan lyase
@@ -4862,6 +5034,7 @@
 4.2.2.23	Rhamnogalacturonan endolyase
 4.2.2.24	Rhamnogalacturonan exolyase
 4.2.2.25	Gellan lyase
+4.2.2.26	Oligo-alginate lyase
 4.2.2.n1	Peptidoglycan lytic exotransglycosylase
 4.2.2.n2	Peptidoglycan lytic endotransglycosylase
 4.2.3.1	Threonine synthase
@@ -5010,6 +5183,12 @@
 4.2.3.145	Ophiobolin F synthase
 4.2.3.146	Cyclooctat-9-en-7-ol synthase
 4.2.3.147	Pimaradiene synthase
+4.2.3.148	Cembrene C synthase
+4.2.3.149	Nephthenol synthase
+4.2.3.150	Cembrene A synthase
+4.2.3.151	Pentamethylcyclopentadecatrienol synthase
+4.2.3.152	2-epi-5-epi-valiolone synthase
+4.2.3.153	(5-formylfuran-3-yl)methyl phosphate synthase
 4.2.3.n2	Delta-selinene synthase
 4.2.3.n11	Selinene synthase
 4.2.99.12	Carboxymethyloxysuccinate lyase
@@ -5082,6 +5261,12 @@
 4.4.1.25	L-cysteate sulfo-lyase
 4.4.1.26	Olivetolic acid cyclase
 4.4.1.27	Carbon disulfide lyase
+4.4.1.28	L-cysteine desulfidase
+4.4.1.29	Phycobiliprotein cysteine-84 phycobilin lyase
+4.4.1.30	Phycobiliprotein beta-cysteine-155 phycobilin lyase
+4.4.1.31	Phycoerythrocyanin alpha-cysteine-84 phycoviolobilin lyase/isomerase
+4.4.1.32	C-phycocyanin alpha-cysteine-84 phycocyanobilin lyase
+4.4.1.33	R-phycocyanin alpha-cysteine-84 phycourobilin lyase/isomerase
 4.5.1.1	DDT-dehydrochlorinase
 4.5.1.2	3-chloro-D-alanine dehydrochlorinase
 4.5.1.3	Dichloromethane dehalogenase
@@ -5123,7 +5308,8 @@
 5.1.1.17	Isopenicillin-N epimerase
 5.1.1.18	Serine racemase
 5.1.1.19	O-ureido-serine racemase
-5.1.1.n1	L-Ala-D/L-Glu epimerase
+5.1.1.20	L-Ala-D/L-Glu epimerase
+5.1.1.21	Isoleucine 2-epimerase
 5.1.2.1	Lactate racemase
 5.1.2.2	Mandelate racemase
 5.1.2.3	3-hydroxybutyryl-CoA epimerase
@@ -5162,12 +5348,19 @@
 5.1.3.30	D-psicose 3-epimerase
 5.1.3.31	D-tagatose 3-epimerase
 5.1.3.32	L-rhamnose mutarotase
+5.1.3.33	2-epi-5-epi-valiolone epimerase
+5.1.3.34	Monoglucosyldiacylglycerol epimerase
+5.1.3.35	2-epi-5-epi-valiolone 7-phosphate 2-epimerase
+5.1.3.36	Heparosan-glucuronate 5-epimerase
+5.1.3.37	Mannuronan 5-epimerase
 5.1.99.1	Methylmalonyl-CoA epimerase
 5.1.99.2	16-hydroxysteroid epimerase
 5.1.99.3	Allantoin racemase
 5.1.99.4	Alpha-methylacyl-CoA racemase
 5.1.99.5	Hydantoin racemase
 5.1.99.6	NAD(P)H-hydrate epimerase
+5.1.99.7	Dihydroneopterin triphosphate 2'-epimerase
+5.1.99.8	7,8-dihydroneopterin epimerase
 5.2.1.1	Maleate isomerase
 5.2.1.2	Maleylacetoacetate isomerase
 5.2.1.4	Maleylpyruvate isomerase
@@ -5205,6 +5398,7 @@
 5.3.1.29	Ribose 1,5-bisphosphate isomerase
 5.3.1.30	5-deoxy-glucuronate isomerase
 5.3.1.31	Sulfoquinovose isomerase
+5.3.1.32	(4S)-4-hydroxy-5-phosphonooxypentane-2,3-dione isomerase
 5.3.2.1	Phenylpyruvate tautomerase
 5.3.2.2	Oxaloacetate tautomerase
 5.3.2.3	TDP-4-oxo-6-deoxy-alpha-D-glucose-3,4-oxoisomerase (dTDP-3-dehydro-6-deoxy-alpha-D-galactopyranose-forming)
@@ -5229,6 +5423,7 @@
 5.3.3.14	Trans-2-decenoyl-[acyl-carrier-protein] isomerase
 5.3.3.17	Trans-2,3-dihydro-3-hydroxyanthranilate isomerase
 5.3.3.18	2-(1,2-epoxy-1,2-dihydrophenyl)acetyl-CoA isomerase
+5.3.3.19	3-((4R)-4-hydroxycyclohexa-1,5-dien-1-yl)-2-oxopropanoate isomerase
 5.3.4.1	Protein disulfide-isomerase
 5.3.99.2	Prostaglandin-D synthase
 5.3.99.3	Prostaglandin-E synthase
@@ -5242,6 +5437,7 @@
 5.3.99.11	2-keto-myo-inositol isomerase
 5.4.1.1	Lysolecithin acylmutase
 5.4.1.3	2-methylfumaryl-CoA isomerase
+5.4.1.4	D-galactarolactone isomerase
 5.4.2.2	Phosphoglucomutase (alpha-D-glucose-1,6-bisphosphate-dependent)
 5.4.2.3	Phosphoacetylglucosamine mutase
 5.4.2.4	Bisphosphoglycerate mutase
@@ -5330,6 +5526,7 @@
 5.4.99.60	Cobalt-precorrin-8 methylmutase
 5.4.99.61	Precorrin-8X methylmutase
 5.4.99.62	D-ribose pyranase
+5.4.99.63	Ethylmalonyl-CoA mutase
 5.5.1.1	Muconate cycloisomerase
 5.5.1.2	3-carboxy-cis,cis-muconate cycloisomerase
 5.5.1.3	Tetrahydroxypteridine cycloisomerase
@@ -5353,6 +5550,9 @@
 5.5.1.22	(-)-bornyl diphosphate synthase
 5.5.1.23	Aklanonic acid methyl ester cyclase
 5.5.1.24	Tocopherol cyclase
+5.5.1.25	3,6-anhydro-L-galactonate cycloisomerase
+5.5.1.26	Nogalonic acid methyl ester cyclase
+5.5.1.27	D-galactarolactone cycloisomerase
 5.99.1.1	Thiocyanate isomerase
 5.99.1.2	DNA topoisomerase
 5.99.1.3	DNA topoisomerase (ATP-hydrolyzing)
@@ -5426,6 +5626,8 @@
 6.2.1.42	3-oxocholest-4-en-26-oate--CoA ligase
 6.2.1.43	2-hydroxy-7-methoxy-5-methyl-1-naphthoate--CoA ligase
 6.2.1.44	3-(methylthio)propionyl--CoA ligase
+6.2.1.45	E1 ubiquitin-activating enzyme
+6.2.1.46	L-allo-isoleucine:holo-[CmaA peptidyl-carrier protein] ligase
 6.2.1.n2	Amino acid--[acyl-carrier-protein] ligase
 6.2.1.n3	Malonate--CoA ligase
 6.3.1.1	Aspartate--ammonia ligase
@@ -5444,6 +5646,7 @@
 6.3.1.15	8-demethylnovobiocic acid synthase
 6.3.1.17	Beta-citrylglutamate synthase
 6.3.1.18	Gamma-glutamylanilide synthase
+6.3.1.19	Prokaryotic ubiquitin-like protein ligase
 6.3.2.1	Pantoate--beta-alanine ligase (AMP-forming)
 6.3.2.2	Glutamate--cysteine ligase
 6.3.2.3	Glutathione synthase
@@ -5461,14 +5664,12 @@
 6.3.2.16	D-alanine--alanyl-poly(glycerolphosphate) ligase
 6.3.2.17	Tetrahydrofolate synthase
 6.3.2.18	Gamma-glutamylhistamine synthase
-6.3.2.19	Ubiquitin--protein ligase
 6.3.2.20	Indoleacetate--lysine synthetase
 6.3.2.21	Ubiquitin--calmodulin ligase
 6.3.2.23	Homoglutathione synthase
 6.3.2.24	Tyrosine--arginine ligase
 6.3.2.25	Tubulin--tyrosine ligase
 6.3.2.26	N-(5-amino-5-carboxypentanoyl)-L-cysteinyl-D-valine synthase
-6.3.2.28	L-amino-acid alpha-ligase
 6.3.2.29	Cyanophycin synthase (L-aspartate-adding)
 6.3.2.30	Cyanophycin synthase (L-arginine-adding)
 6.3.2.31	Coenzyme F420-0:L-glutamate ligase
@@ -5485,7 +5686,11 @@
 6.3.2.42	N-acetylaspartylglutamylglutamate synthase
 6.3.2.43	[Lysine-biosynthesis-protein LysW]--L-2-aminoadipate ligase
 6.3.2.44	Pantoate--beta-alanine ligase (ADP-forming)
-6.3.2.n2	Pup--protein ligase
+6.3.2.45	UDP-N-acetylmuramate L-alanyl-gamma-D-glutamyl-meso-2,6-diaminoheptanedioate ligase
+6.3.2.46	Fumarate--(S)-2,3-diaminopropanoate ligase
+6.3.2.47	Dapdiamide A synthase
+6.3.2.48	L-arginine-specific L-amino acid ligase
+6.3.2.49	L-alanine--L-anticapsin ligase
 6.3.2.n3	ISG15--protein ligase
 6.3.3.1	Phosphoribosylformylglycinamidine cyclo-ligase
 6.3.3.2	5-formyltetrahydrofolate cyclo-ligase
@@ -5515,6 +5720,7 @@
 6.3.4.21	Nicotinate phosphoribosyltransferase
 6.3.4.22	tRNA(Ile)(2)-agmatinylcytidine synthase
 6.3.4.23	Formate--phosphoribosylaminoimidazolecarboxamide ligase
+6.3.4.24	Tyramine--L-glutamate ligase
 6.3.5.1	NAD(+) synthase (glutamine-hydrolyzing)
 6.3.5.2	GMP synthase (glutamine-hydrolyzing)
 6.3.5.3	Phosphoribosylformylglycinamidine synthase
diff --git a/c++/src/objects/seqfeat/institution_codes.inc b/c++/src/objects/seqfeat/institution_codes.inc
index 16f96ba..9da0917 100644
--- a/c++/src/objects/seqfeat/institution_codes.inc
+++ b/c++/src/objects/seqfeat/institution_codes.inc
@@ -1,4 +1,4 @@
-/*  $Id: institution_codes.inc 484377 2015-11-10 16:38:18Z ivanov $
+/*  $Id: institution_codes.inc 497803 2016-04-11 13:56:31Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -38,6 +38,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "AAR	s	Reliquae Aaronsohnianae",
 "AARI	s	Anatolian Agricultural Research Institute",
 "AAS	s	British Antarctic Survey",
+"AASU	s	Armstrong State University",
 "AAU	s	University of Aarhus, Institute of Biological Sciences",
 "AAU<ETH>	s	Addis Ababa University, Department of Biology",
 "AAU<ETH>:A	s	Addis Ababa University, Department of Biology, Amphibian collection",
@@ -93,6 +94,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "ACOI	c	Coimbra Collection of Algae",
 "ACOR	s	Universidad Nacional de Cordoba",
 "ACTC	s	Austin College",
+"ACU	s	Abilene Christian University",
 "ACUNHC	s	Abilene Christian University, Natural History Collection",
 "AD	s	Plant Biodiversity Centre",
 "ADA	s	Herbarium, Department of Agriculture, South Australia",
@@ -119,7 +121,9 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "AFTC	s	Alaska Frozen Tissue Collection",
 "AGRITEC	b	AGRITEC, Ltd.",
 "AGRL	s	Lethbridge Research Station",
+"AGU	s	Astrakhan State University",
 "AGUAT	s	Universidad de San Carlos",
+"AGUCH	s	Facultad de Ciencias Agronomicas de la Universidad de Chile",
 "AH	s	Universidad de Alcala, Departamento de Biologia Vegetal",
 "AHBC	s	Dixie College",
 "AHF	s	Allan Hancock Foundation, University of Southern California",
@@ -142,6 +146,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "AJBC	s	Atkins Jardin Botanico de Cienfuegos",
 "AJOU	s	Ajou University, Biological Sciences Department",
 "AK	s	Auckland War Memorial Museum",
+"AKPM	s	Akita Prefectural Museum",
 "AKU<JPN>	c	Faculty of Agriculture",
 "AKU<NZ>	s	University of Auckland, School of Biological Sciences",
 "AL	s	Universite d'Alger",
@@ -159,6 +164,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "ALEX	s	University of Alexandria, Department of Botany",
 "ALF	s	Campus International de Baillarguet, Departement d'Elevage et de Medecine Veterinaire",
 "ALGOBANK	c	ALGOBANK",
+"ALGU	s	Universidade do Algarve",
 "ALIRU	c	Australian Legume Inoculants Research Unit",
 "ALK	s	Alnwick Scientific and Mechanical Institution",
 "ALM<FRA>	s	Museum National Historie Naturelle",
@@ -166,10 +172,12 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "ALMA	s	Alma College, Biology Department",
 "ALME	s	Estacion Experimental de Zonas Aridas",
 "ALN	s	Alnwick Botanical Society",
+"ALNHS	s	Natural Heritage Section-ALDCNR",
 "ALT	s	Curtis Museum",
 "ALTA	s	University of Alberta, Biological Sciences Department",
 "ALTB	s	University of Barnaul, Altai State University",
 "ALU	s	Alabama Museum of Natural History",
+"ALUH	s	Alzahra University",
 "AM	sb	Australian Museum",
 "AM:Arachnology	s	Australian Museum, Invertebrate Collections: Arachnology",
 "AM:EBU	sb	Australian Museum, Evolutionary Biology Unit Tissue Collection",
@@ -184,7 +192,9 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "AM:Palaeontology	s	Australian Museum, Palaeontology Collection",
 "AM<ARG>	s	Acatushun Museum at the Estancia Haberton",
 "AM<BLG>	s	Asenovgrad Paleontology Museum",
+"AMAL	s	Anniston Museum of Natural History",
 "AMAZ	s	Universidad Nacional de la Amazonia Peruana",
+"AMB	s	Associazione Micologica Bresadola",
 "AMC	c	Department of Biologics Research",
 "AMCC	s	Ambrose Monell Cryo Collection, American Museum of Natural History",
 "AMCL	s	Macapa, Museu Territorial de Historia Natural \"Angelo Moreira da Costa Lima\"",
@@ -213,6 +223,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "ANC	s	Universita di Ancona, Dipartimento di Biotecnologie Agrarie ed Ambientali",
 "ANCB	s	Museo Nacional de Historia Natural, La Paz",
 "AND	s	Slezske zemske muzeum Opava, Arboretum Nopvy Dvur, Dendrology Department",
+"ANDA	s	Andalas University",
 "ANDES	s	La Universidad de Los Andes",
 "ANDES:A	s	La Universidad de Los Andes, Amphibian Collection",
 "ANDES:O	s	La Universidad de Los Andes, Ornithology Collection",
@@ -223,6 +234,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "ANGU	s	Instituto Nacional de Tecnologia Agropecuaria",
 "ANGUC	s	Universite Catholiques de l'Ouest",
 "ANH	s	Andong National University, School of Bioresource Science",
+"ANHC	s	Arkansas Natural Heritage Commission",
 "ANIC	s	Australian National Insect Collection",
 "ANK	s	Ankara Ueniversitesi, Biyoloji Boeluemue",
 "ANKO	s	Forest Research Institute, Turkey",
@@ -251,7 +263,9 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "APP	s	Parco Nazionale del Gran Sasso e Monti della Laga - Universita di Camerino, Centro Richerche Floristiche dell'Appennino",
 "APSC	s	Austin Peay State University, Biology Department",
 "AQC	s	Aquinas College, Biology Department",
+"AQP	s	Estudios Fitogeograficos del Peru",
 "AQUI	s	Universita degli Studi di L'Aquila, Dipartimento di Scienze Ambientali",
+"AR	s	Pomor State University",
 "ARAGO	s	Universite Pierre et Marie Curie",
 "ARAN	s	Alto de Zorroaga s.n., Departamento de Botanica",
 "ARB	s	Salahiddin University, Biology Department",
@@ -264,9 +278,13 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "ARG	s	Argotti Botanic Garden",
 "ARIZ	s	University of Arizona, Department of Plant Sciences",
 "ARK	s	University of Arkansas",
+"ARKH	s	Chingan State Nature Reserve",
 "ARM	s	County Museum",
 "ARMFN	s	Armagh Field Naturalists' Society",
+"ARRI	s	Ayurveda Regional Research Institute",
 "ARSEF	c	ARS Collection of Entomopathogenic Fungi",
+"ARTH	s	Artvin Coruh University",
+"ARUN	s	Botanical Survey of India, Arunachal Pradesh Regional Centre",
 "AS	c	China General Microbiological Culture Collection Center",
 "AS<DEU>	s	Paleontological Collection",
 "AS<PRY>	s	Jardin Botanico",
@@ -290,6 +308,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "AST	s	University of Aston",
 "ASTC	s	Stephen F. Austin State University, Biology Department",
 "ASTN	s	Ashton-under-Lyne Linnean Botanical Society",
+"ASTU	s	Assiut University",
 "ASU	s	School of Life Sciences, Arizona State University",
 "ASUA	s	Ain Shams University",
 "ASUF	s	Rocky Mountain Research Station, USDA Forest Service",
@@ -308,18 +327,22 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "AU	s	Xiamen University, Biology Department",
 "AUA	s	Auburn University, Biological Sciences Department",
 "AUB	s	Andrews University",
+"AUBH	s	Athabasca University",
 "AUBL	s	Museum of Natural History, Beirut",
 "AUBSN	s	All-Union Botanical Society",
 "AUCE	s	El Azhar University",
 "AUEM	s	Auburn University Entomological Museum",
 "AUG	s	Augustana College, Biology Department",
 "AUGD	s	Department of Geology and Petroleum Geology",
+"AUH	s	Agriculture University Herbarium",
 "AUM	s	Auburn University Museum",
 "AUMC<EGY>	c	Assiut University Mycological Centre Culture Collection",
+"AURO	s	Auroville Foundation",
 "AUSPGRIS	b	Australian Plant Genetic Resource Information Service",
 "AUT	s	Museum d'Histoire Naturelle",
 "AUW	s	Acadia University, Wildlife Museum",
 "AV	s	Museum Requien",
+"AVCH	s	City of Alexandria",
 "AVE	s	Universidade de Aveiro, Departamento de Biologia",
 "AVU	s	Vrije Universiteit, Department of Systematic Botany",
 "AWH	s	Dr. Henri Van Heurck Museum",
@@ -339,9 +362,11 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "BAA	s	Universidad de Buenos Aires, Facultad de Agronomia",
 "BAAC	s	Musee de Beni Abbes",
 "BAB	s	Instituto Nacional de Tecnologia Agropecuaria, Instituto de Recursos Biologicos",
+"BABY	s	B. A. Bennett Herbarium, Yukon Government",
 "BAC<CHN>	s	Beijing Agricultural College",
 "BAC<UK>	s	Bacup Natural History Society",
 "BACC	c	Brucella AFSSA Culture Collection",
+"BACH	s	Botswana College of Agriculture",
 "BACP	s	CEFYBO, Unidad Botanica",
 "BAE	s	Willis Museum and Art Gallery",
 "BAF	s	Universidad de Buenos Aires, Facultad de Farmacia y Bioquimica",
@@ -355,15 +380,19 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "BAK	s	Academy of Sciences of Azerbaijan",
 "BAL	s	INTA, EEA Balcarce, Catedra de Botanica Agricola",
 "BALT	s	Towson University, Department of Biological Sciences",
+"BAMU	s	Dr. Babasaheb Ambedkar Marathwada University",
 "BAN	s	Banaras Hindu University, Botany Department",
+"BANG	s	Universite de Bangui,",
 "BAP	s	Oxford Botanic Garden",
 "BAR	s	University of the West Indies, Department of Biological and Chemical Sciences",
 "BARC	s	Systematic Botany and Mycology Laboratory, USDA/ARS",
 "BARO	s	Maharaja Sayajirao University of Baroda, Botany Department",
+"BART	s	Bartlett Arboretum",
 "BAS<BGR>	s	Bulgarian Academy of Science",
 "BAS<CHE>	s	Herbarium, Botanisches Institut, Universitat Basel",
 "BASBG	s	Universitaet Basel, Basler Botanische Gesellschaft",
 "BASSA	s	Museo Civico, Bassano del Grappa",
+"BASU	s	Bu-Ali Sina University",
 "BAT	s	Bagshaw Museum",
 "BATA	s	Instituto Nacional de Desarollo Forestal",
 "BATH	s	Bath Natural History Society",
@@ -380,6 +409,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "BBG	s	Birmingham Botanical Gardens",
 "BBH	s	National Science and Technology Development Agency",
 "BBLF	c	Institut fur Pflanzenschutz im Forst",
+"BBLM	s	Boise District Bureau of Land Management",
 "BBNP	s	Big Bend National Park",
 "BBPP	c	Bacteriology Branch, Plant Pathology and Microbiology Division, Department of Agricultural Science",
 "BBS	s	University of Suriname",
@@ -399,6 +429,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "BCCUSP	c	Brazilian Cyanobacteria Collection - University of Sao Paulo",
 "BCF	s	Universitat de Barcelona, Laboratori de Botanica",
 "BCFH	s	Bureau of Commercial Fisheries",
+"BCH	s	Berry College",
 "BCKN	s	Blackburn Museum and Art Gallery",
 "BCL	s	Bates College, Biology Department",
 "BCM<SPN>	s	Campus Universitario de Tafira, Departamento de Biologia",
@@ -449,6 +480,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "BER	s	Orto Botanico de Bergamo \"Lorenzo Rota\"",
 "BEREA	s	Berea College, Biology Department",
 "BERN	s	University of Bern",
+"BESA	s	Museum d'Histoire naturelle de Besancon",
 "BESM	s	Bvumbwe Experiment Station",
 "BEV	s	Borough of Beverley Art Gallery and Museum",
 "BEX	s	Bexhill Museum",
@@ -456,6 +488,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "BFD	s	Bedfordshire Natural History Society",
 "BFDL	s	Forest Products Laboratory",
 "BFIC	s	Museum National d'Histoire Naturelle",
+"BFRS	s	Blodgett Forest Research Station",
 "BFT	s	Queen's University, Botany Department",
 "BFUS	s	University of Sofia, Biology Faculty",
 "BFY	s	John Innes Horticultural Institution",
@@ -484,6 +517,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "BHU	s	Humboldt-Universitaet zu Berlin, Institut fuer Biologie",
 "BHUPM	s	Museum fuer Naturkunde, Institut fuer Palaeontologie",
 "BHUPP	s	Banaras Hindu University, Mycology and Plant Pathology Department",
+"BHZB	s	Fundacao Zoo-Botanica de Belo Horizonte",
 "BI	s	Istituto Ortobotanico",
 "BIA	s	British Institute of Archaeology",
 "BIDA	s	Boise State University",
@@ -540,6 +574,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "BMKB	s	Brunei Museum",
 "BMM	s	Buergermeister Mueller, Museum",
 "BMNH	s	Natural History Museum, London",
+"BMNH:ENT	s	Natural History Museum, London, Entomology collection",
 "BMNHC	s	Burpee Museum of Natural History",
 "BMPS	s	Bristol Museum and Philosophical Society",
 "BMR	s	Bureau of Mineral Resources",
@@ -1352,6 +1387,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "CZACC	s	Coleccion Zoologia, Academia de Ciencias de Cuba",
 "CZIP	s	Universidad de Magallanes, Instituto de la Patagonia (Chile)",
 "CZL	s	Centro de Zoologia",
+"CZRMA	s	Coleccion Zoologica Regional (Mammalia) del Instituto de Historia Natural y Ecologia",
 "CZUAA	s	Universidad Autonoma de Aguascalientes (Mexico)",
 "CZUG	s	Universidad de Guadalajara,Centro de Estudios en Zoologia, Entomologia",
 "DABUH	s	University of Helsinki, Department of Applied Biology",
@@ -1604,11 +1640,13 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "EBUAP	s	Laboratorio de Herpetologia, Escuela de Biologia, Benemerita Universidad Autonoma de Puebla",
 "EBUM	s	Universidad Michoacana de San Nicolas de Hidalgo",
 "EBV	s	Laboratoire de Biologie Generale et de Botanique",
-"ECACC	c	European Collection of Cell Cultures",
+"ECACC	c	European Collection of Authenticated Cell Cultures",
 "ECENT	s	East Central University",
 "ECH	s	Elmira College",
 "ECM	s	Hubei College of Traditional Chinese Medicine, Department of Chinese Materia Medica",
 "ECNB	s	Escuela Nacional Ciencias",
+"ECO-SC-M	s	Coleccion Mastozoologica de El Colegio de la Frontera Sur Unidad San Cristobal de las Casas, Chiapas",
+"ECOCHM	s	Coleccion de Mamiferos del Museo de Zoologia-ECOSUR",
 "ECOL	s	Collection du Laborataire d'Ecologie",
 "ECOMAR<FRA>	s	ECOMAR lab University of Reunion",
 "ECON	s	Harvard University",
@@ -1896,7 +1934,6 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "FSP-USP	s	Faculdade de Saude Publica, Universidade de Sao Paulo",
 "FSSR	s	Forest Service, USDA, Biological and Physical Resources Unit",
 "FSU	s	Florida State University, Department of Biological Science",
-"FSU<DEU>	c	Jena Microbial Resource Collection",
 "FSUM	s	Florida State University Museum",
 "FSUMC	s	Frostburg State University, Mammal Collection",
 "FSUNS	c	Faculty of Science, The University of Novi Sad",
@@ -1964,6 +2001,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "GDAC	s	Universidad de Granada, Departamento de Biologia Vegetal, Botanica",
 "GDGM	s	Guangdong Institute of Microbiology",
 "GDMA	s	Medical University of Gdansk, Department of Biology and Pharmaceutical Botany",
+"GDMCC	c	Guangdong Microbial Culture Collection Center",
 "GDMM	s	Guangdong Institute of Chinese Materia Medica",
 "GDMP	s	Guangdong Medical and Pharmaceutical College, Pharmacy Department",
 "GDOR	s	Museo Civico di Storia Naturale Giacomo Doria",
@@ -2256,7 +2294,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "HJBL	s	Escuela Nacional de Ciencias Forestales",
 "HJBS	s	Fundacio Jardi Botanic de Soller",
 "HK	s	Agriculture, Fisheries, and Conservation Department",
-"HKAS	s	Cryptogamic Herbarium of Kunming Institute of Botany",
+"HKAS	s	Cryptogamic Herbarium of Kunming Institute of Botany, Chinese Academy of Sciences",
 "HKBU	s	Hong Kong Baptist University, Biology Department",
 "HKFRS	s	Hong Kong Fisheries Research Station",
 "HKGL	s	Naturwissenschaftliche Sammlungen des Kantons Glarus",
@@ -2891,6 +2929,8 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "JLMP	s	Jilin Academy of Traditional Chinese Medicine and Materia Medica",
 "JM	s	Jura Museum, Eichstatt",
 "JMM	s	Earlham College, Joseph Moore Museum",
+"JMRC	c	Jena Microbial Resource Collection",
+"JMRC:SF	c	Jena Microbial Resource Collection, Subcollection Fungi",
 "JMSMC	s	Jiamusi Medical College, Department of Pharmacy",
 "JMUH	s	James Madison University, Department of Biology",
 "JN	s	Jinggang Mountain Nature Reserve",
@@ -3499,7 +3539,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "MARE	s	Marmara University, Department of Pharmaceutical Botany",
 "MARO	s	Marylhurst College",
 "MARS	s	Universite de Provence Centre St-Charles, case 4",
-"MARSSJ	s	Universite d'Aix-Marseille III, Laboratoire de Botanique et Ecologie Mediterraneenne",
+"MARSSJ	s	Universite Paul Cezanne",
 "MARY	s	University of Maryland",
 "MASE	s	Maseru Experiment Station",
 "MASS	s	University of Massachusetts, Biology Department",
@@ -4042,6 +4082,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "MUFM	s	Manipur University Fish Museum",
 "MUFS	s	Department of Animal Science, Miyazaki  University",
 "MUGM	s	Museo de Ciencias Naturales, Coleccion \"Gustavo Orces\" (Ecuador)",
+"MUGT	s	Museo de Ciencias Naturales de la Universidad de Guayaquil",
 "MUHW	s	Marshall University, Biological Sciences Department",
 "MUJ	s	Museo Javeriano de Historia Natural, Laboratoriao de Entomologia",
 "MUL	c	Department of Microbiology MUL-B 250",
@@ -4478,6 +4519,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "NMV<AUS>:P	s	Museum Victoria, Paleontology & Paleobotany",
 "NMV<AUS>:T	s	Museum Victoria, Entomlogy Type Collection",
 "NMV<AUS>:TRI	s	Museum Victoria, Trichoptera",
+"NMV<AUS>:Z	s	Museum Victoria, Tissue Collection",
 "NMV<JPN>	s	Nakagawa Museum at Nakagawa-cho",
 "NMW<AUT>	s	Naturhistorisches Museum, Wien",
 "NMW<GBR>	s	National Museums & Galleries of Wales, Department of Biodiversity and Systematic Biology",
@@ -4495,6 +4537,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "NOAA	s	National Oceanic and Atmospeheric Administration",
 "NOAA:MarFor	s	National Oceanic and Atmospeheric Administration, Marine Forensics",
 "NOAS	s	New Orleans Academy of Science",
+"NOCC	s	National Orchid Conservation Center",
 "NODCAR	c	marwa mokhtar Abd Rabo",
 "NoF	c	The Fungus Culture Collection of the Northern Forestry Centre",
 "NOI	s	Nanhai Oceanographic Institute",
@@ -4514,6 +4557,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "NPT	s	Newport Museum and Art Gallery",
 "NPWRC	s	Northern Prairie Research Center",
 "NRC	c	Division of Biological Sciences, National Research Council of Canada",
+"NRC<EGY>	s	National Research Centre",
 "NRCC	s	National Research Council of Canada",
 "NRCS	c	National Reference Center for Streptococci in Aachen",
 "NRIBAS	s	National Research Institute of Biology, Academia Sinica",
@@ -4751,6 +4795,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "PAL	s	Universita degli Studi di Palermo, Dipartimento de Scienze Botaniche",
 "PALEON	s	Wyoming Dinosaur International Society",
 "PAM	s	Pennsylvania Department of Agriculture",
+"PAMC	c	Polar and Alpine Microbial Collection",
 "PAMG	s	Empresa de Pesquisa Agropecuaria de Minas Gerais (EPAMIG), Departamento de Pesquisa",
 "PAMP	s	Universidad de Navarra, Departamento de Botanica",
 "PAN	s	Panjab University, Botany Department",
@@ -4796,7 +4841,8 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "PEFO	s	Petrified Forest",
 "PEI	cb	Paul-Ehrlich-Institut",
 "PEI<CAN>	s	Agriculture and Agri-Food Canada",
-"PEL	s	Universidade Federal de Pelotas, Departamento de Botanica",
+"PEL	sc	Universidade Federal de Pelotas, Departamento de Botanica",
+"PEL:LIPP	c	Universidade Federal de Pelotas, Departamento de Botanica, Laboratory Plant-Pathogen Interaction",
 "PEM<CHN>	s	Beijing Medical University, Botany Department",
 "PEM<ZAF>	s	Port Elizabeth Museum",
 "PEN	s	Penrith Museum",
@@ -5545,6 +5591,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "SM<MYS>	s	Sarawak Museum",
 "SM<USA-FL>	s	Sanford Museum Collections",
 "SM<USA-TX>	s	Strecker Museum, Baylor University",
+"SMAG	s	Southland Museum and Art Gallery",
 "SMAO	s	Simao Forestry Bureau",
 "SMB	s	Marianske Muzeum, Natural History Department",
 "SMBB	s	Stredoslovenske muzeum",
@@ -5967,6 +6014,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "TNS	s	National Science Museum, Department of Botany",
 "TNSC<BEL>	s	Thierry Neef de Sainval",
 "TNSC<USA-NJ>	s	Trailside Nature and Science Center",
+"TNSM	s	Thailand Natural History Museum",
 "TNU	s	National Taiwan Normal University, Herbarium",
 "TNZ	s	Tianjin Nat. Hist. Mus.",
 "TO	s	Universita degli Studi di Torino, Dipartimento di Biologia Vegetale",
@@ -5982,6 +6030,8 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "TONG	s	Tonghua Teachers College, Biology Department",
 "TOR	s	Torquay Museum",
 "TOYA	s	Toyama Science Museum, Botany Department",
+"TPI	s	The Pirbright Institute",
+"TPI:ENT	s	The Pirbright Institute, Entomology collection",
 "TPII	s	Thanksgiving Point Institute",
 "TPNG	s	Department of Primary Industry",
 "TPV	s	Prairie View A & M University, Biology Department",
@@ -6077,6 +6127,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "UADBA	s	University dAntananarivo, Department de Biologie Animale",
 "UADY	s	Universidad Autonoma de Yucatan, Departamento de Botanica",
 "UAEM	s	Univeridad Autonoma de Morelos",
+"UAEU	s	United Arab Emirates University",
 "UAGC	s	Universidad Autonoma de Guerrero, Area de Ciencias Naturales",
 "UAIC<CIV>	s	University of Abidjan",
 "UAIC<USA-AL>	s	University of Alabama, Ichthyological Collection",
@@ -6107,6 +6158,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "UANL	s	Universidad Autonoma de Nuevo Leon",
 "UARK	s	University of Arkansas",
 "UAS	s	Universidad Autonoma de Sinaloa",
+"UAS-B	s	University of Agricultural Sciences Bangalore",
 "UASB	s	University of Agricultural Sciences, Bangalore",
 "UASC	s	Museo de Historia Natural \"Noel Kempff Mercado\"",
 "UASK	s	Ukrainian Academy of Science",
@@ -6743,7 +6795,7 @@ static const char* const kInstitutionCollectionCodeList[] = {
 "WECO	s	Wesleyan University, Biology Department",
 "WEIC	s	Wau Ecology Institute",
 "WELC	s	Wellesley College, Biological Sciences Department",
-"WELT	s	Museum of New Zealand, Botany Department",
+"WELT	s	Museum of New Zealand Te Papa Tongarewa",
 "WELTU	s	Victoria University of Wellington",
 "WERN	s	Werneth Park Study Centre and Natural History Museum",
 "WET	s	Wartburg College, Biology Department",
diff --git a/c++/src/objects/seqfeat/institution_codes.txt b/c++/src/objects/seqfeat/institution_codes.txt
index 15578fa..f7fbdd8 100644
--- a/c++/src/objects/seqfeat/institution_codes.txt
+++ b/c++/src/objects/seqfeat/institution_codes.txt
@@ -5,6 +5,7 @@ AAPI	s	Plant Industry Laboratory
 AAR	s	Reliquae Aaronsohnianae
 AARI	s	Anatolian Agricultural Research Institute
 AAS	s	British Antarctic Survey
+AASU	s	Armstrong State University
 AAU	s	University of Aarhus, Institute of Biological Sciences
 AAU<ETH>	s	Addis Ababa University, Department of Biology
 AAU<ETH>:A	s	Addis Ababa University, Department of Biology, Amphibian collection
@@ -60,6 +61,7 @@ ACNS	s	Agriculture Canada Nova Scotia
 ACOI	c	Coimbra Collection of Algae
 ACOR	s	Universidad Nacional de Cordoba
 ACTC	s	Austin College
+ACU	s	Abilene Christian University
 ACUNHC	s	Abilene Christian University, Natural History Collection
 AD	s	Plant Biodiversity Centre
 ADA	s	Herbarium, Department of Agriculture, South Australia
@@ -86,7 +88,9 @@ AFSDU	s	Suleyman Demirel University, Agricultural Faculty
 AFTC	s	Alaska Frozen Tissue Collection
 AGRITEC	b	AGRITEC, Ltd.
 AGRL	s	Lethbridge Research Station
+AGU	s	Astrakhan State University
 AGUAT	s	Universidad de San Carlos
+AGUCH	s	Facultad de Ciencias Agronomicas de la Universidad de Chile
 AH	s	Universidad de Alcala, Departamento de Biologia Vegetal
 AHBC	s	Dixie College
 AHF	s	Allan Hancock Foundation, University of Southern California
@@ -109,6 +113,7 @@ AJ	c	Central Research Laboratories
 AJBC	s	Atkins Jardin Botanico de Cienfuegos
 AJOU	s	Ajou University, Biological Sciences Department
 AK	s	Auckland War Memorial Museum
+AKPM	s	Akita Prefectural Museum
 AKU<JPN>	c	Faculty of Agriculture
 AKU<NZ>	s	University of Auckland, School of Biological Sciences
 AL	s	Universite d'Alger
@@ -126,6 +131,7 @@ ALD	s	Alderney Society and Museum
 ALEX	s	University of Alexandria, Department of Botany
 ALF	s	Campus International de Baillarguet, Departement d'Elevage et de Medecine Veterinaire
 ALGOBANK	c	ALGOBANK
+ALGU	s	Universidade do Algarve
 ALIRU	c	Australian Legume Inoculants Research Unit
 ALK	s	Alnwick Scientific and Mechanical Institution
 ALM<FRA>	s	Museum National Historie Naturelle
@@ -133,10 +139,12 @@ ALM<GBR>	s	Art Gallery and Museum, Central Library
 ALMA	s	Alma College, Biology Department
 ALME	s	Estacion Experimental de Zonas Aridas
 ALN	s	Alnwick Botanical Society
+ALNHS	s	Natural Heritage Section-ALDCNR
 ALT	s	Curtis Museum
 ALTA	s	University of Alberta, Biological Sciences Department
 ALTB	s	University of Barnaul, Altai State University
 ALU	s	Alabama Museum of Natural History
+ALUH	s	Alzahra University
 AM	sb	Australian Museum
 AM:Arachnology	s	Australian Museum, Invertebrate Collections: Arachnology
 AM:EBU	sb	Australian Museum, Evolutionary Biology Unit Tissue Collection
@@ -151,7 +159,9 @@ AM:Ornithology	s	Australian Museum, Vertebrate Collections: Ornithology
 AM:Palaeontology	s	Australian Museum, Palaeontology Collection
 AM<ARG>	s	Acatushun Museum at the Estancia Haberton
 AM<BLG>	s	Asenovgrad Paleontology Museum
+AMAL	s	Anniston Museum of Natural History
 AMAZ	s	Universidad Nacional de la Amazonia Peruana
+AMB	s	Associazione Micologica Bresadola
 AMC	c	Department of Biologics Research
 AMCC	s	Ambrose Monell Cryo Collection, American Museum of Natural History
 AMCL	s	Macapa, Museu Territorial de Historia Natural "Angelo Moreira da Costa Lima"
@@ -180,6 +190,7 @@ ANACC<AUS>	c	Australian National Algae Culture Collection
 ANC	s	Universita di Ancona, Dipartimento di Biotecnologie Agrarie ed Ambientali
 ANCB	s	Museo Nacional de Historia Natural, La Paz
 AND	s	Slezske zemske muzeum Opava, Arboretum Nopvy Dvur, Dendrology Department
+ANDA	s	Andalas University
 ANDES	s	La Universidad de Los Andes
 ANDES:A	s	La Universidad de Los Andes, Amphibian Collection
 ANDES:O	s	La Universidad de Los Andes, Ornithology Collection
@@ -190,6 +201,7 @@ ANG	s	Arboretum de la Maulevrie
 ANGU	s	Instituto Nacional de Tecnologia Agropecuaria
 ANGUC	s	Universite Catholiques de l'Ouest
 ANH	s	Andong National University, School of Bioresource Science
+ANHC	s	Arkansas Natural Heritage Commission
 ANIC	s	Australian National Insect Collection
 ANK	s	Ankara Ueniversitesi, Biyoloji Boeluemue
 ANKO	s	Forest Research Institute, Turkey
@@ -218,7 +230,9 @@ APMJ	s	Aomori Prefectural Museum
 APP	s	Parco Nazionale del Gran Sasso e Monti della Laga - Universita di Camerino, Centro Richerche Floristiche dell'Appennino
 APSC	s	Austin Peay State University, Biology Department
 AQC	s	Aquinas College, Biology Department
+AQP	s	Estudios Fitogeograficos del Peru
 AQUI	s	Universita degli Studi di L'Aquila, Dipartimento di Scienze Ambientali
+AR	s	Pomor State University
 ARAGO	s	Universite Pierre et Marie Curie
 ARAN	s	Alto de Zorroaga s.n., Departamento de Botanica
 ARB	s	Salahiddin University, Biology Department
@@ -231,9 +245,13 @@ ARER	s	Associazione Romana di Entomologia
 ARG	s	Argotti Botanic Garden
 ARIZ	s	University of Arizona, Department of Plant Sciences
 ARK	s	University of Arkansas
+ARKH	s	Chingan State Nature Reserve
 ARM	s	County Museum
 ARMFN	s	Armagh Field Naturalists' Society
+ARRI	s	Ayurveda Regional Research Institute
 ARSEF	c	ARS Collection of Entomopathogenic Fungi
+ARTH	s	Artvin Coruh University
+ARUN	s	Botanical Survey of India, Arunachal Pradesh Regional Centre
 AS	c	China General Microbiological Culture Collection Center
 AS<DEU>	s	Paleontological Collection
 AS<PRY>	s	Jardin Botanico
@@ -257,6 +275,7 @@ ASSL	s	Academy of Sciences
 AST	s	University of Aston
 ASTC	s	Stephen F. Austin State University, Biology Department
 ASTN	s	Ashton-under-Lyne Linnean Botanical Society
+ASTU	s	Assiut University
 ASU	s	School of Life Sciences, Arizona State University
 ASUA	s	Ain Shams University
 ASUF	s	Rocky Mountain Research Station, USDA Forest Service
@@ -275,18 +294,22 @@ ATU	c	Dept.of Biotechnology University of Tokyo
 AU	s	Xiamen University, Biology Department
 AUA	s	Auburn University, Biological Sciences Department
 AUB	s	Andrews University
+AUBH	s	Athabasca University
 AUBL	s	Museum of Natural History, Beirut
 AUBSN	s	All-Union Botanical Society
 AUCE	s	El Azhar University
 AUEM	s	Auburn University Entomological Museum
 AUG	s	Augustana College, Biology Department
 AUGD	s	Department of Geology and Petroleum Geology
+AUH	s	Agriculture University Herbarium
 AUM	s	Auburn University Museum
 AUMC<EGY>	c	Assiut University Mycological Centre Culture Collection
+AURO	s	Auroville Foundation
 AUSPGRIS	b	Australian Plant Genetic Resource Information Service
 AUT	s	Museum d'Histoire Naturelle
 AUW	s	Acadia University, Wildlife Museum
 AV	s	Museum Requien
+AVCH	s	City of Alexandria
 AVE	s	Universidade de Aveiro, Departamento de Biologia
 AVU	s	Vrije Universiteit, Department of Systematic Botany
 AWH	s	Dr. Henri Van Heurck Museum
@@ -306,9 +329,11 @@ BA	s	Museo Argentino de Ciencias Naturales Bernardino Rivadavia
 BAA	s	Universidad de Buenos Aires, Facultad de Agronomia
 BAAC	s	Musee de Beni Abbes
 BAB	s	Instituto Nacional de Tecnologia Agropecuaria, Instituto de Recursos Biologicos
+BABY	s	B. A. Bennett Herbarium, Yukon Government
 BAC<CHN>	s	Beijing Agricultural College
 BAC<UK>	s	Bacup Natural History Society
 BACC	c	Brucella AFSSA Culture Collection
+BACH	s	Botswana College of Agriculture
 BACP	s	CEFYBO, Unidad Botanica
 BAE	s	Willis Museum and Art Gallery
 BAF	s	Universidad de Buenos Aires, Facultad de Farmacia y Bioquimica
@@ -322,15 +347,19 @@ BAJ	s	Instituto Municipal de Botanica, Parque Pte. Dr. Nicolas Avellaneda
 BAK	s	Academy of Sciences of Azerbaijan
 BAL	s	INTA, EEA Balcarce, Catedra de Botanica Agricola
 BALT	s	Towson University, Department of Biological Sciences
+BAMU	s	Dr. Babasaheb Ambedkar Marathwada University
 BAN	s	Banaras Hindu University, Botany Department
+BANG	s	Universite de Bangui,
 BAP	s	Oxford Botanic Garden
 BAR	s	University of the West Indies, Department of Biological and Chemical Sciences
 BARC	s	Systematic Botany and Mycology Laboratory, USDA/ARS
 BARO	s	Maharaja Sayajirao University of Baroda, Botany Department
+BART	s	Bartlett Arboretum
 BAS<BGR>	s	Bulgarian Academy of Science
 BAS<CHE>	s	Herbarium, Botanisches Institut, Universitat Basel
 BASBG	s	Universitaet Basel, Basler Botanische Gesellschaft
 BASSA	s	Museo Civico, Bassano del Grappa
+BASU	s	Bu-Ali Sina University
 BAT	s	Bagshaw Museum
 BATA	s	Instituto Nacional de Desarollo Forestal
 BATH	s	Bath Natural History Society
@@ -347,6 +376,7 @@ BBF	s	Conservatoire Botanique National de Midi-Pyrenees, Conservatoire botanique
 BBG	s	Birmingham Botanical Gardens
 BBH	s	National Science and Technology Development Agency
 BBLF	c	Institut fur Pflanzenschutz im Forst
+BBLM	s	Boise District Bureau of Land Management
 BBNP	s	Big Bend National Park
 BBPP	c	Bacteriology Branch, Plant Pathology and Microbiology Division, Department of Agricultural Science
 BBS	s	University of Suriname
@@ -366,6 +396,7 @@ BCCN	c	Brucella Culture Collection
 BCCUSP	c	Brazilian Cyanobacteria Collection - University of Sao Paulo
 BCF	s	Universitat de Barcelona, Laboratori de Botanica
 BCFH	s	Bureau of Commercial Fisheries
+BCH	s	Berry College
 BCKN	s	Blackburn Museum and Art Gallery
 BCL	s	Bates College, Biology Department
 BCM<SPN>	s	Campus Universitario de Tafira, Departamento de Biologia
@@ -416,6 +447,7 @@ BEOU	s	University of Belgrade, Faculty of Biology
 BER	s	Orto Botanico de Bergamo "Lorenzo Rota"
 BEREA	s	Berea College, Biology Department
 BERN	s	University of Bern
+BESA	s	Museum d'Histoire naturelle de Besancon
 BESM	s	Bvumbwe Experiment Station
 BEV	s	Borough of Beverley Art Gallery and Museum
 BEX	s	Bexhill Museum
@@ -423,6 +455,7 @@ BFBI	s	Biologisches Forschunsstation Burgenland
 BFD	s	Bedfordshire Natural History Society
 BFDL	s	Forest Products Laboratory
 BFIC	s	Museum National d'Histoire Naturelle
+BFRS	s	Blodgett Forest Research Station
 BFT	s	Queen's University, Botany Department
 BFUS	s	University of Sofia, Biology Faculty
 BFY	s	John Innes Horticultural Institution
@@ -451,6 +484,7 @@ BHSC	s	Black Hills State University, Biology Department
 BHU	s	Humboldt-Universitaet zu Berlin, Institut fuer Biologie
 BHUPM	s	Museum fuer Naturkunde, Institut fuer Palaeontologie
 BHUPP	s	Banaras Hindu University, Mycology and Plant Pathology Department
+BHZB	s	Fundacao Zoo-Botanica de Belo Horizonte
 BI	s	Istituto Ortobotanico
 BIA	s	British Institute of Archaeology
 BIDA	s	Boise State University
@@ -507,6 +541,7 @@ BMHP	s	Bermuda Department of Agriculture and Fisheries
 BMKB	s	Brunei Museum
 BMM	s	Buergermeister Mueller, Museum
 BMNH	s	Natural History Museum, London
+BMNH:ENT	s	Natural History Museum, London, Entomology collection
 BMNHC	s	Burpee Museum of Natural History
 BMPS	s	Bristol Museum and Philosophical Society
 BMR	s	Bureau of Mineral Resources
@@ -1319,6 +1354,7 @@ CZAA	s	Catedra de Zoologia Agricola
 CZACC	s	Coleccion Zoologia, Academia de Ciencias de Cuba
 CZIP	s	Universidad de Magallanes, Instituto de la Patagonia (Chile)
 CZL	s	Centro de Zoologia
+CZRMA	s	Coleccion Zoologica Regional (Mammalia) del Instituto de Historia Natural y Ecologia
 CZUAA	s	Universidad Autonoma de Aguascalientes (Mexico)
 CZUG	s	Universidad de Guadalajara,Centro de Estudios en Zoologia, Entomologia
 DABUH	s	University of Helsinki, Department of Applied Biology
@@ -1571,11 +1607,13 @@ EBRG	s	Museo de la Estacion Biologia de Rancho Grande
 EBUAP	s	Laboratorio de Herpetologia, Escuela de Biologia, Benemerita Universidad Autonoma de Puebla
 EBUM	s	Universidad Michoacana de San Nicolas de Hidalgo
 EBV	s	Laboratoire de Biologie Generale et de Botanique
-ECACC	c	European Collection of Cell Cultures
+ECACC	c	European Collection of Authenticated Cell Cultures
 ECENT	s	East Central University
 ECH	s	Elmira College
 ECM	s	Hubei College of Traditional Chinese Medicine, Department of Chinese Materia Medica
 ECNB	s	Escuela Nacional Ciencias
+ECO-SC-M	s	Coleccion Mastozoologica de El Colegio de la Frontera Sur Unidad San Cristobal de las Casas, Chiapas
+ECOCHM	s	Coleccion de Mamiferos del Museo de Zoologia-ECOSUR
 ECOL	s	Collection du Laborataire d'Ecologie
 ECOMAR<FRA>	s	ECOMAR lab University of Reunion
 ECON	s	Harvard University
@@ -1863,7 +1901,6 @@ FSMC	s	Florida State Museum
 FSP-USP	s	Faculdade de Saude Publica, Universidade de Sao Paulo
 FSSR	s	Forest Service, USDA, Biological and Physical Resources Unit
 FSU	s	Florida State University, Department of Biological Science
-FSU<DEU>	c	Jena Microbial Resource Collection
 FSUM	s	Florida State University Museum
 FSUMC	s	Frostburg State University, Mammal Collection
 FSUNS	c	Faculty of Science, The University of Novi Sad
@@ -1931,6 +1968,7 @@ GDA	s	Universidad de Granada
 GDAC	s	Universidad de Granada, Departamento de Biologia Vegetal, Botanica
 GDGM	s	Guangdong Institute of Microbiology
 GDMA	s	Medical University of Gdansk, Department of Biology and Pharmaceutical Botany
+GDMCC	c	Guangdong Microbial Culture Collection Center
 GDMM	s	Guangdong Institute of Chinese Materia Medica
 GDMP	s	Guangdong Medical and Pharmaceutical College, Pharmacy Department
 GDOR	s	Museo Civico di Storia Naturale Giacomo Doria
@@ -2223,7 +2261,7 @@ HIWNT	s	Hampshire and Isle of Wight Naturalists' Trust Ltd.
 HJBL	s	Escuela Nacional de Ciencias Forestales
 HJBS	s	Fundacio Jardi Botanic de Soller
 HK	s	Agriculture, Fisheries, and Conservation Department
-HKAS	s	Cryptogamic Herbarium of Kunming Institute of Botany
+HKAS	s	Cryptogamic Herbarium of Kunming Institute of Botany, Chinese Academy of Sciences
 HKBU	s	Hong Kong Baptist University, Biology Department
 HKFRS	s	Hong Kong Fisheries Research Station
 HKGL	s	Naturwissenschaftliche Sammlungen des Kantons Glarus
@@ -2858,6 +2896,8 @@ JLFC	s	Forestry College of Beihua University, Forestry Department
 JLMP	s	Jilin Academy of Traditional Chinese Medicine and Materia Medica
 JM	s	Jura Museum, Eichstatt
 JMM	s	Earlham College, Joseph Moore Museum
+JMRC	c	Jena Microbial Resource Collection
+JMRC:SF	c	Jena Microbial Resource Collection, Subcollection Fungi
 JMSMC	s	Jiamusi Medical College, Department of Pharmacy
 JMUH	s	James Madison University, Department of Biology
 JN	s	Jinggang Mountain Nature Reserve
@@ -3466,7 +3506,7 @@ MAR	c	Grasslands Rhizobium Collection
 MARE	s	Marmara University, Department of Pharmaceutical Botany
 MARO	s	Marylhurst College
 MARS	s	Universite de Provence Centre St-Charles, case 4
-MARSSJ	s	Universite d'Aix-Marseille III, Laboratoire de Botanique et Ecologie Mediterraneenne
+MARSSJ	s	Universite Paul Cezanne
 MARY	s	University of Maryland
 MASE	s	Maseru Experiment Station
 MASS	s	University of Massachusetts, Biology Department
@@ -4009,6 +4049,7 @@ MUFE	s	University of Marmara, Department of Botany
 MUFM	s	Manipur University Fish Museum
 MUFS	s	Department of Animal Science, Miyazaki  University
 MUGM	s	Museo de Ciencias Naturales, Coleccion "Gustavo Orces" (Ecuador)
+MUGT	s	Museo de Ciencias Naturales de la Universidad de Guayaquil
 MUHW	s	Marshall University, Biological Sciences Department
 MUJ	s	Museo Javeriano de Historia Natural, Laboratoriao de Entomologia
 MUL	c	Department of Microbiology MUL-B 250
@@ -4445,6 +4486,7 @@ NMV<AUS>:ODO	s	Museum Victoria, Odonata
 NMV<AUS>:P	s	Museum Victoria, Paleontology & Paleobotany
 NMV<AUS>:T	s	Museum Victoria, Entomlogy Type Collection
 NMV<AUS>:TRI	s	Museum Victoria, Trichoptera
+NMV<AUS>:Z	s	Museum Victoria, Tissue Collection
 NMV<JPN>	s	Nakagawa Museum at Nakagawa-cho
 NMW<AUT>	s	Naturhistorisches Museum, Wien
 NMW<GBR>	s	National Museums & Galleries of Wales, Department of Biodiversity and Systematic Biology
@@ -4462,6 +4504,7 @@ NO	s	Tulane University, Department of Ecology and Evolutionary Biology
 NOAA	s	National Oceanic and Atmospeheric Administration
 NOAA:MarFor	s	National Oceanic and Atmospeheric Administration, Marine Forensics
 NOAS	s	New Orleans Academy of Science
+NOCC	s	National Orchid Conservation Center
 NODCAR	c	marwa mokhtar Abd Rabo
 NoF	c	The Fungus Culture Collection of the Northern Forestry Centre
 NOI	s	Nanhai Oceanographic Institute
@@ -4481,6 +4524,7 @@ NPSC	s	Northern Prairie Science Center
 NPT	s	Newport Museum and Art Gallery
 NPWRC	s	Northern Prairie Research Center
 NRC	c	Division of Biological Sciences, National Research Council of Canada
+NRC<EGY>	s	National Research Centre
 NRCC	s	National Research Council of Canada
 NRCS	c	National Reference Center for Streptococci in Aachen
 NRIBAS	s	National Research Institute of Biology, Academia Sinica
@@ -4718,6 +4762,7 @@ PAE	s	Stiftung Herbarium Paul Aellen, Universitat Basel
 PAL	s	Universita degli Studi di Palermo, Dipartimento de Scienze Botaniche
 PALEON	s	Wyoming Dinosaur International Society
 PAM	s	Pennsylvania Department of Agriculture
+PAMC	c	Polar and Alpine Microbial Collection
 PAMG	s	Empresa de Pesquisa Agropecuaria de Minas Gerais (EPAMIG), Departamento de Pesquisa
 PAMP	s	Universidad de Navarra, Departamento de Botanica
 PAN	s	Panjab University, Botany Department
@@ -4763,7 +4808,8 @@ PECS	s	Janus Pannonius Museum, Natural History Department
 PEFO	s	Petrified Forest
 PEI	cb	Paul-Ehrlich-Institut
 PEI<CAN>	s	Agriculture and Agri-Food Canada
-PEL	s	Universidade Federal de Pelotas, Departamento de Botanica
+PEL	sc	Universidade Federal de Pelotas, Departamento de Botanica
+PEL:LIPP	c	Universidade Federal de Pelotas, Departamento de Botanica, Laboratory Plant-Pathogen Interaction
 PEM<CHN>	s	Beijing Medical University, Botany Department
 PEM<ZAF>	s	Port Elizabeth Museum
 PEN	s	Penrith Museum
@@ -5512,6 +5558,7 @@ SM<DEU-Langenaltheim>	s	Schwegler Museum
 SM<MYS>	s	Sarawak Museum
 SM<USA-FL>	s	Sanford Museum Collections
 SM<USA-TX>	s	Strecker Museum, Baylor University
+SMAG	s	Southland Museum and Art Gallery
 SMAO	s	Simao Forestry Bureau
 SMB	s	Marianske Muzeum, Natural History Department
 SMBB	s	Stredoslovenske muzeum
@@ -5934,6 +5981,7 @@ TNP	s	Museum of Tatra National Park
 TNS	s	National Science Museum, Department of Botany
 TNSC<BEL>	s	Thierry Neef de Sainval
 TNSC<USA-NJ>	s	Trailside Nature and Science Center
+TNSM	s	Thailand Natural History Museum
 TNU	s	National Taiwan Normal University, Herbarium
 TNZ	s	Tianjin Nat. Hist. Mus.
 TO	s	Universita degli Studi di Torino, Dipartimento di Biologia Vegetale
@@ -5949,6 +5997,8 @@ TOM<CAN>	c	Tomicus collection Canadian Forest Service
 TONG	s	Tonghua Teachers College, Biology Department
 TOR	s	Torquay Museum
 TOYA	s	Toyama Science Museum, Botany Department
+TPI	s	The Pirbright Institute
+TPI:ENT	s	The Pirbright Institute, Entomology collection
 TPII	s	Thanksgiving Point Institute
 TPNG	s	Department of Primary Industry
 TPV	s	Prairie View A & M University, Biology Department
@@ -6044,6 +6094,7 @@ UACCC	c	University of Alabama Chytrid Culture Collection
 UADBA	s	University dAntananarivo, Department de Biologie Animale
 UADY	s	Universidad Autonoma de Yucatan, Departamento de Botanica
 UAEM	s	Univeridad Autonoma de Morelos
+UAEU	s	United Arab Emirates University
 UAGC	s	Universidad Autonoma de Guerrero, Area de Ciencias Naturales
 UAIC<CIV>	s	University of Abidjan
 UAIC<USA-AL>	s	University of Alabama, Ichthyological Collection
@@ -6074,6 +6125,7 @@ UAMZC	s	University of Arkansas, Museum Zoological Collections
 UANL	s	Universidad Autonoma de Nuevo Leon
 UARK	s	University of Arkansas
 UAS	s	Universidad Autonoma de Sinaloa
+UAS-B	s	University of Agricultural Sciences Bangalore
 UASB	s	University of Agricultural Sciences, Bangalore
 UASC	s	Museo de Historia Natural "Noel Kempff Mercado"
 UASK	s	Ukrainian Academy of Science
@@ -6710,7 +6762,7 @@ WDNE	s	Bureau of Land Management, Winnemucca District
 WECO	s	Wesleyan University, Biology Department
 WEIC	s	Wau Ecology Institute
 WELC	s	Wellesley College, Biological Sciences Department
-WELT	s	Museum of New Zealand, Botany Department
+WELT	s	Museum of New Zealand Te Papa Tongarewa
 WELTU	s	Victoria University of Wellington
 WERN	s	Werneth Park Study Centre and Natural History Museum
 WET	s	Wartburg College, Biology Department
diff --git a/c++/src/objects/seqfeat/seqfeat.asn b/c++/src/objects/seqfeat/seqfeat.asn
index 3a0f8cc..303f779 100644
--- a/c++/src/objects/seqfeat/seqfeat.asn
+++ b/c++/src/objects/seqfeat/seqfeat.asn
@@ -1,4 +1,4 @@
---$Revision: 419814 $
+--$Revision: 488584 $
 --**********************************************************************
 --
 --  NCBI Sequence Feature elements
@@ -1194,7 +1194,9 @@ BioSource ::= SEQUENCE {
         endogenous-virus (19) ,
         hydrogenosome (20) ,
         chromosome (21) ,
-        chromatophore (22)
+        chromatophore (22) ,
+        plasmid-in-mitochondrion (23) ,
+        plasmid-in-plastid (24)
       } DEFAULT unknown ,
     origin INTEGER {
       unknown (0) ,
diff --git a/c++/src/objects/seqloc/Seq_id.cpp b/c++/src/objects/seqloc/Seq_id.cpp
index 3086a9e..d96b37d 100644
--- a/c++/src/objects/seqloc/Seq_id.cpp
+++ b/c++/src/objects/seqloc/Seq_id.cpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_id.cpp 483824 2015-11-04 17:35:33Z ivanov $
+/* $Id: Seq_id.cpp 499418 2016-04-26 14:08:21Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -781,7 +781,8 @@ void SAccGuide::AddRule(const CTempString& rule)
     if (tmp1.empty())
         return;
     tokens.reserve(3);
-    NStr::Tokenize(tmp1, " \t", tokens, NStr::eMergeDelims);
+    NStr::Split(tmp1, " \t", tokens,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     if (tokens.empty()) {
         return;
     } else if (tokens.size() == 2
@@ -1030,9 +1031,15 @@ void SAccGuide::x_Load(ILineReader& in)
     } while ( !in.AtEOF() );
 }
 
-static CSafeStatic<CRef<SAccGuide> > s_Guide;
+static CRef<SAccGuide>* s_CreateGuide(void)
+{
+    return new CRef<SAccGuide>(new SAccGuide);
+}
+
+static CSafeStatic<CRef<SAccGuide> > s_Guide(s_CreateGuide, NULL);
 
-CSeq_id::EAccessionInfo CSeq_id::IdentifyAccession(const CTempString& acc)
+CSeq_id::EAccessionInfo CSeq_id::IdentifyAccession(const CTempString& acc,
+                                                   TParseFlags flags)
 {
     SIZE_TYPE main_size = acc.find('.');
     bool has_version = true;
@@ -1052,18 +1059,19 @@ CSeq_id::EAccessionInfo CSeq_id::IdentifyAccession(const CTempString& acc)
             main_acc_buf[i] = toupper(ucdata[i]);
         }
         CTempString main_acc(main_acc_buf, main_size);
-        return x_IdentifyAccession(main_acc, has_version);
+        return x_IdentifyAccession(main_acc, flags, has_version);
     } else {
         // Unlikely to prove recognizable (far too long for any standard
-        // format as of September 2012), but try anyway.
+        // format as of January 2016), but try anyway.
         string main_acc(acc, 0, main_size);
         NStr::ToUpper(main_acc);
-        return x_IdentifyAccession(main_acc, has_version);
+        return x_IdentifyAccession(main_acc, flags, has_version);
     }
 }
      
 CSeq_id::EAccessionInfo
-CSeq_id::x_IdentifyAccession(const CTempString& main_acc, bool has_version)
+CSeq_id::x_IdentifyAccession(const CTempString& main_acc, TParseFlags flags,
+                             bool has_version)
 {
     SIZE_TYPE digit_pos = main_acc.find_first_of(kDigits),
         main_size = main_acc.size();
@@ -1073,7 +1081,7 @@ CSeq_id::x_IdentifyAccession(const CTempString& main_acc, bool has_version)
     } else {
         SIZE_TYPE non_dig_pos = main_acc.find_first_not_of(kDigits, digit_pos);
         const unsigned char* ucdata = (const unsigned char*)main_acc.data();
-        if (non_dig_pos != NPOS) {
+        if (non_dig_pos != NPOS  &&  (flags & fParse_RawText) != 0) {
             if ( !has_version  &&  digit_pos == 0  &&  main_size >= 4
                 &&  main_size <= 7  &&  isalnum(ucdata[1])
                 &&  isalnum(ucdata[2])  &&  isalnum(ucdata[3])) {
@@ -1095,7 +1103,11 @@ CSeq_id::x_IdentifyAccession(const CTempString& main_acc, bool has_version)
                         return eAcc_pdb;
                     }
                     break;
-                case 5: case 4:
+                case 5:
+                    if ((flags & fParse_ValidLocal) == 0) {
+                        break;
+                    } // else fall through
+                case 4:
                     return eAcc_pdb;
                 }
             }
@@ -1139,16 +1151,15 @@ CSeq_id::x_IdentifyAccession(const CTempString& main_acc, bool has_version)
     }
 
     if (digit_pos == 0) {
-        if ( !has_version  &&  main_acc[0] != '0'
+        if ((flags & fParse_RawGI) != 0  &&  !has_version
+            &&  main_acc[0] != '0'
             &&  main_acc.find_first_not_of(kDigits) == NPOS) {
             return eAcc_gi; // just digits
         } else {
             return eAcc_unknown; // PDB already handled
         }
-    }
-
-    if (s_Guide->Empty()) {
-        s_Guide->Reset(new SAccGuide);
+    } else if ((flags & fParse_RawText) == 0) {
+        return eAcc_unknown;
     }
 
     SIZE_TYPE flag_len = (flag_char == '\0') ? 0 : 1;
@@ -1192,7 +1203,7 @@ CSeq_id::x_IdentifyAccession(const CTempString& main_acc, bool has_version)
 }
 
 
-CSeq_id::EAccessionInfo CSeq_id::IdentifyAccession(void) const
+CSeq_id::EAccessionInfo CSeq_id::IdentifyAccession(TParseFlags flags) const
 {
     E_Choice type = Which();
     switch (type) {
@@ -1207,7 +1218,7 @@ CSeq_id::EAccessionInfo CSeq_id::IdentifyAccession(void) const
         if (tsid->IsSetAccession()) {
             // Can't necessarily go straight to x_IdentifyAccession, as
             // the accession may contain lowercase letters.
-            EAccessionInfo ai = IdentifyAccession(tsid->GetAccession());
+            EAccessionInfo ai = IdentifyAccession(tsid->GetAccession(), flags);
             if ((ai & eAcc_type_mask) == e_not_set) {
                 // We *know* what the type should be....
                 return (EAccessionInfo)((ai & eAcc_flag_mask) | type);
@@ -1223,10 +1234,6 @@ CSeq_id::EAccessionInfo CSeq_id::IdentifyAccession(void) const
 
     case e_General:
     {
-        if (s_Guide->Empty()) {
-            s_Guide->Reset(new SAccGuide);
-        }
-
         string db = GetGeneral().GetDb();
         NStr::ToUpper(db);
         SAccGuide::TPrefixes::const_iterator it = (*s_Guide)->general.find(db);
@@ -1749,16 +1756,11 @@ CSeq_id& CSeq_id::Set(const CTempString& the_id_in, TParseFlags flags)
         // If no (attempt at a) valid tag, tries to interpret the string
         // as a pure accession.
         if ((flags & fParse_AnyRaw) != 0) {
-            type = GetAccType(IdentifyAccession(the_id));
-            if ((flags & fParse_RawText) == 0  &&  type != e_Gi) {
-                type = e_not_set;
-            }
+            type = GetAccType(IdentifyAccession(the_id, flags));
         }
         switch (type) {
         case e_Gi:
-            if ((flags & fParse_RawGI) != 0) {
-                return Set(type, the_id);
-            } // else fall through
+            return Set(type, the_id);
         case e_not_set:
             if ((flags & fParse_ValidLocal) != 0
                 &&  ((flags & fParse_AnyLocal) == fParse_AnyLocal
@@ -1798,7 +1800,7 @@ CSeq_id& CSeq_id::Set(const CTempString& the_id_in, TParseFlags flags)
         }
     } else {
         list<CTempString> fasta_pieces;
-        NStr::Split(the_id, "|", fasta_pieces, NStr::eNoMergeDelims);
+        NStr::Split(the_id, "|", fasta_pieces, NStr::fSplit_NoMergeDelims);
         x_Init(fasta_pieces, type);
         if ( !fasta_pieces.empty() ) {
             // tolerate trailing parts if they're all empty.
@@ -2277,7 +2279,15 @@ int CSeq_id::BaseFastaNAScore(void) const
     case e_Local:                              return 230;
     case e_Gi:                                 return 120;
     case e_General:
-        return GetGeneral().GetDb() == "TMSMART" ? 240 : 50;
+        {
+        const string& db = GetGeneral().GetDb();
+        if (db.compare("TMSMART") == 0 ||
+            db.compare("BankIt") == 0 ||
+            db.compare("NCBIFILE") == 0 )
+            return 240;
+        else
+            return 50;
+        }
     case e_Patent:                             return 40;
     case e_Gibbsq: case e_Gibbmt: case e_Pdb:  return 30;
     case e_Other:                              return 15;
@@ -2293,7 +2303,15 @@ int CSeq_id::BaseFastaAAScore(void) const
     case e_Local:                  return 230;
     case e_Gi:                     return 120;
     case e_General:
-        return GetGeneral().GetDb() == "TMSMART" ? 240 : 90;
+        {
+        const string& db = GetGeneral().GetDb();
+        if (db.compare("TMSMART") == 0 ||
+            db.compare("BankIt") == 0 ||
+            db.compare("NCBIFILE") == 0)
+            return 240;
+        else
+            return 90;
+        }
     case e_Patent:                 return 80;
     case e_Prf:                    return 70;
     case e_Pdb:                    return 50;
diff --git a/c++/src/objects/seqloc/Seq_loc.cpp b/c++/src/objects/seqloc/Seq_loc.cpp
index 203b27c..904ce0f 100644
--- a/c++/src/objects/seqloc/Seq_loc.cpp
+++ b/c++/src/objects/seqloc/Seq_loc.cpp
@@ -1,4 +1,4 @@
-/* $Id: Seq_loc.cpp 475726 2015-08-11 18:12:56Z vasilche $
+/* $Id: Seq_loc.cpp 494243 2016-03-04 15:40:06Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -3038,7 +3038,7 @@ const CSeq_id* s_GetLabel
         *label += ":";
     }
     last_id = &itval.GetId();
-    if (itval.IsSetStrand()) {
+    if (itval.IsSetStrand() && itval.GetStrand() != eNa_strand_unknown) {
         *label += GetTypeInfo_enum_ENa_strand()
             ->FindName(itval.GetStrand(), true);
     }
@@ -4713,6 +4713,7 @@ void x_SubNoSort(CSeq_loc& dst,
     bool have_range = false;
     for (CSeq_loc_CI it(src, CSeq_loc_CI::eEmpty_Allow); it; ++it) {
         CSeq_id_Handle idh = syn_mapper.GetBestSynonym(it.GetSeq_id());
+        bool rev = IsReverse(it.GetStrand());
         TRangeWithFuzz it_range = TRangeWithFuzz(it);
         if ( it_range.IsWhole() ) {
             it_range.SetOpen(0, len_getter.GetLength(it.GetSeq_id()));
@@ -4721,6 +4722,7 @@ void x_SubNoSort(CSeq_loc& dst,
         TIdToRangeColl& rg_coll = IsReverse(it.GetStrand()) ?
             rg_coll_minus : rg_coll_plus;
         TIdToRangeColl::const_iterator id_it = rg_coll.find(idh);
+        list<TRangeWithFuzz> result_ranges;
         bool modified = false;
         if (id_it != rg_coll.end()) {
             // Check if there's anything to subtract
@@ -4728,12 +4730,20 @@ void x_SubNoSort(CSeq_loc& dst,
                 if ( it_rg_coll.IntersectingWith(*check_it) ) {
                     it_rg_coll -= id_it->second;
                     modified = true;
+                    ITERATE(TRangeColl, result_it, it_rg_coll) {
+                        if ( rev ) {
+                            result_ranges.push_front(*result_it);
+                        }
+                        else {
+                            result_ranges.push_back(*result_it);
+                        }
+                    }
                     break;
                 }
             }
         }
         if ( modified ) {
-            ITERATE(TRangeColl, rg_it, it_rg_coll) {
+            ITERATE(list<TRangeWithFuzz>, rg_it, result_ranges) {
                 TRangeWithFuzz curr_rg(*rg_it);
                 if (curr_rg.GetFrom() == it_range.GetFrom()) {
                     curr_rg.AddFuzzFrom(it_range);
diff --git a/c++/src/objects/seqloc/accguide.inc b/c++/src/objects/seqloc/accguide.inc
index 5f27b80..69eec7a 100644
--- a/c++/src/objects/seqloc/accguide.inc
+++ b/c++/src/objects/seqloc/accguide.inc
@@ -1,4 +1,4 @@
-/*  $Id: accguide.inc 485916 2015-11-30 15:11:54Z ucko $
+/*  $Id: accguide.inc 497278 2016-04-05 17:43:39Z ucko $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
  */
 
 static const char* const kBuiltInGuide[] = {
-    "# $Id: accguide.inc 485916 2015-11-30 15:11:54Z ucko $",
+    "# $Id: accguide.inc 497278 2016-04-05 17:43:39Z ucko $",
     "version  1 # of file format",
     "",
     "# 8-character protein accessions",
@@ -52,6 +52,11 @@ static const char* const kBuiltInGuide[] = {
     "3+5  L??  ddbj_tsa_prot",
     "3+5  M??  gb_wgs_prot",
     "3+5  N??  gb_wgs_prot",
+    "3+5  O??  gb_wgs_prot",
+    "3+5  P??  gb_wgs_prot",
+    "3+5  Q??  gb_prot",
+    "3+5  R??  gb_prot",
+    "3+5  S??  embl_prot",
     "3+5  ???  unreserved_prot",
     "",
     "# Genome pipeline accessions",
@@ -133,9 +138,15 @@ static const char* const kBuiltInGuide[] = {
     "4+8   O???  embl_tpa_wgs_nuc",
     "4+9   O???  embl_tpa_wgs_nuc",
     "4+10  O???  embl_tpa_wgs_nuc",
-    "4+8   P???  ddbj_wgs_nuc",
-    "4+9   P???  ddbj_wgs_nuc",
-    "4+10  P???  ddbj_wgs_nuc",
+    "4+8   P???  gb_wgs_nuc",
+    "4+9   P???  gb_wgs_nuc",
+    "4+10  P???  gb_wgs_nuc",
+    "4+8   Q???  gb_wgs_nuc",
+    "4+9   Q???  gb_wgs_nuc",
+    "4+10  Q???  gb_wgs_nuc",
+    "4+8   R???  gb_wgs_nuc",
+    "4+9   R???  gb_wgs_nuc",
+    "4+10  R???  gb_wgs_nuc",
     "",
     "# Mass sequence Genome for Annotation",
     "5+7   A???? ddbj_other_nuc",
@@ -475,6 +486,7 @@ static const char* const kBuiltInGuide[] = {
     "2+6  KT  gb_dirsub",
     "2+6  KU  gb_dirsub",
     "2+6  KV  gb_con",
+    "2+6  KX  gb_dirsub",
     "2+6  K?  gb_other_nuc",
     "2+6  LA  ddbj_tsa_nuc",
     "2+6  LB  ddbj_gss",
@@ -496,7 +508,7 @@ static const char* const kBuiltInGuide[] = {
     "2+6  LR  embl_other_nuc",
     "2+6  LS  embl_other_nuc",
     "2+6  LT  embl_other_nuc",
-    "2+6  LU  ddbj_other_nuc",
+    "2+6  LU  ddbj_est",
     "2+6  LV  ddbj_other_nuc",
     "2+6  LX  ddbj_other_nuc",
     "2+6  LY  ddbj_other_nuc",
@@ -9699,7 +9711,10 @@ static const char* const kBuiltInGuide[] = {
     "special  CEL78178-CEL78353  embl_tpa_prot",
     "special  CEL78355-CEL78878  embl_tpa_prot",
     "special  CRK77046           embl_tpa_prot",
+    "special  CTQ86077-CTQ86287  embl_tpa_prot",
+    "special  CUS27851-CUS27862  embl_tpa_prot",
+    "special  CUS58523-CUS58613  embl_tpa_prot",
     "## Err on the side of caution on as yet unassigned IDs, and hope that",
     "## there's not *too* much more backfilling.",
-    "#special CUL03805-CZZ99999  unreserved_prot"
+    "#special CUT08921-CZZ99999  unreserved_prot"
 };
diff --git a/c++/src/objects/seqloc/accguide.txt b/c++/src/objects/seqloc/accguide.txt
index ef2153c..3e66bfa 100644
--- a/c++/src/objects/seqloc/accguide.txt
+++ b/c++/src/objects/seqloc/accguide.txt
@@ -1,4 +1,4 @@
-# $Id: accguide.txt 485916 2015-11-30 15:11:54Z ucko $
+# $Id: accguide.txt 497278 2016-04-05 17:43:39Z ucko $
 version  1 # of file format
 
 # 8-character protein accessions
@@ -19,6 +19,11 @@ version  1 # of file format
 3+5  L??  ddbj_tsa_prot
 3+5  M??  gb_wgs_prot
 3+5  N??  gb_wgs_prot
+3+5  O??  gb_wgs_prot
+3+5  P??  gb_wgs_prot
+3+5  Q??  gb_prot
+3+5  R??  gb_prot
+3+5  S??  embl_prot
 3+5  ???  unreserved_prot
 
 # Genome pipeline accessions
@@ -100,9 +105,15 @@ version  1 # of file format
 4+8   O???  embl_tpa_wgs_nuc
 4+9   O???  embl_tpa_wgs_nuc
 4+10  O???  embl_tpa_wgs_nuc
-4+8   P???  ddbj_wgs_nuc
-4+9   P???  ddbj_wgs_nuc
-4+10  P???  ddbj_wgs_nuc
+4+8   P???  gb_wgs_nuc
+4+9   P???  gb_wgs_nuc
+4+10  P???  gb_wgs_nuc
+4+8   Q???  gb_wgs_nuc
+4+9   Q???  gb_wgs_nuc
+4+10  Q???  gb_wgs_nuc
+4+8   R???  gb_wgs_nuc
+4+9   R???  gb_wgs_nuc
+4+10  R???  gb_wgs_nuc
 
 # Mass sequence Genome for Annotation
 5+7   A???? ddbj_other_nuc
@@ -442,6 +453,7 @@ version  1 # of file format
 2+6  KT  gb_dirsub
 2+6  KU  gb_dirsub
 2+6  KV  gb_con
+2+6  KX  gb_dirsub
 2+6  K?  gb_other_nuc
 2+6  LA  ddbj_tsa_nuc
 2+6  LB  ddbj_gss
@@ -463,7 +475,7 @@ version  1 # of file format
 2+6  LR  embl_other_nuc
 2+6  LS  embl_other_nuc
 2+6  LT  embl_other_nuc
-2+6  LU  ddbj_other_nuc
+2+6  LU  ddbj_est
 2+6  LV  ddbj_other_nuc
 2+6  LX  ddbj_other_nuc
 2+6  LY  ddbj_other_nuc
@@ -9666,6 +9678,9 @@ special  CEL77190-CEL78176  embl_tpa_prot
 special  CEL78178-CEL78353  embl_tpa_prot
 special  CEL78355-CEL78878  embl_tpa_prot
 special  CRK77046           embl_tpa_prot
+special  CTQ86077-CTQ86287  embl_tpa_prot
+special  CUS27851-CUS27862  embl_tpa_prot
+special  CUS58523-CUS58613  embl_tpa_prot
 ## Err on the side of caution on as yet unassigned IDs, and hope that
 ## there's not *too* much more backfilling.
-#special CUL03805-CZZ99999  unreserved_prot
+#special CUT08921-CZZ99999  unreserved_prot
diff --git a/c++/src/objects/seqset/Bioseq_set.cpp b/c++/src/objects/seqset/Bioseq_set.cpp
index 6f9f8a6..cf9e6f1 100644
--- a/c++/src/objects/seqset/Bioseq_set.cpp
+++ b/c++/src/objects/seqset/Bioseq_set.cpp
@@ -1,4 +1,4 @@
-/* $Id: Bioseq_set.cpp 444516 2014-08-25 17:31:21Z vasilche $
+/* $Id: Bioseq_set.cpp 497874 2016-04-11 18:28:01Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -128,15 +128,28 @@ void CBioseq_set::GetLabel(string* label, ELabelType type) const
     }
 
     // Loop through CBioseqs looking for the best one to use for a label
-    bool best_is_na = false, best_has_gb = false, best_has_accession = false;
+    bool best_is_na = false;
     const CBioseq* best = 0;
+    const CSeq_id* best_seq_id = 0;
+    const CSeq_id* best_seq_id_with_gb = 0;
+    const CSeq_id* best_seq_id_with_accession = 0;
     int max = 0;
     for (CTypeConstIterator<CBioseq> si(ConstBegin(*this)); si && max < 100; ++si, ++max) {
-        bool takeit = false, is_na, has_gb = false, has_accession = false;
+        bool takeit = false, is_na;
+        const CSeq_id* current_seq_id = 0;
+        const CSeq_id* current_seq_id_with_gb = 0;
+        const CSeq_id* current_seq_id_with_accession = 0;
         is_na = s_is_na(*si);
         for (CTypeConstIterator<CSeq_id> ii(ConstBegin(*si)); ii; ++ii) {
-            has_gb = has_gb ? true : s_has_gb(*ii);
-            has_accession = has_accession ? true : s_has_accession(*ii);
+            if (!current_seq_id) {
+                current_seq_id = &(*ii);
+            }
+            if (s_has_gb(*ii)) {
+                current_seq_id_with_gb = &(*ii);
+            }
+            if (s_has_accession(*ii)) {
+                current_seq_id_with_accession = &(*ii);
+            }
         }
 
         if (!best) {
@@ -146,21 +159,21 @@ void CBioseq_set::GetLabel(string* label, ELabelType type) const
             if (si->GetInst().GetLength() > best->GetInst().GetLength()) {
                 longer = true;
             }
-            if(best_has_accession) {
-                if (has_accession) {
+            if (best_seq_id_with_accession) {
+                if (current_seq_id_with_accession) {
                     if(longer) {
                         takeit = true;
                     }
                 }
-            } else if (has_accession) {
+            } else if (current_seq_id_with_accession) {
                 takeit = true;
-            } else if (best_has_gb) {
-                if (has_gb) {
+            } else if (best_seq_id_with_gb) {
+                if (current_seq_id_with_gb) {
                     if (longer) {
                         takeit = true;
                     }
                 }
-            } else if (has_gb) {
+            } else if (current_seq_id_with_gb) {
                 takeit = true;
             } else if (best_is_na) {
                 if (is_na) {
@@ -177,28 +190,33 @@ void CBioseq_set::GetLabel(string* label, ELabelType type) const
 
         if (takeit) {
             best = &(*si);
-            best_has_accession = has_accession;
-            best_has_gb = has_gb;
+            best_seq_id = current_seq_id;
+            best_seq_id_with_gb = current_seq_id_with_gb;
+            best_seq_id_with_accession = current_seq_id_with_accession;
             best_is_na = is_na;
         }
     }
 
     // Add content to label.
-    if (!best) {
+    if (best_seq_id_with_accession) {
+        best_seq_id = best_seq_id_with_accession;
+    }
+    else if (best_seq_id_with_gb) {
+        best_seq_id = best_seq_id_with_gb;
+    }
+    if (!best_seq_id) {
         *label += "(No Bioseqs)";
     } else {
         CNcbiOstrstream os;
-        if (best->GetFirstId()) {
-            os << best->GetFirstId()->DumpAsFasta();
-            *label += CNcbiOstrstreamToString(os);
-            if (this->IsSetSeq_set()) {
-                const TSeq_set& sset = this->GetSeq_set();
-                size_t len = sset.size();
-                if (len > 1) {
-                    *label += " (" + NStr::SizetToString(sset.size()) + " components)";
-                } else if (len == 1) {
-                    *label += " (1 component)";
-                }
+        os << best_seq_id->DumpAsFasta();
+        *label += CNcbiOstrstreamToString(os);
+        if (this->IsSetSeq_set()) {
+            const TSeq_set& sset = this->GetSeq_set();
+            size_t len = sset.size();
+            if (len > 1) {
+                *label += " (" + NStr::SizetToString(sset.size()) + " components)";
+            } else if (len == 1) {
+                *label += " (1 component)";
             }
         }
     }
diff --git a/c++/src/objects/seqtable/SeqTable_multi_data.cpp b/c++/src/objects/seqtable/SeqTable_multi_data.cpp
index f244a03..921ef25 100644
--- a/c++/src/objects/seqtable/SeqTable_multi_data.cpp
+++ b/c++/src/objects/seqtable/SeqTable_multi_data.cpp
@@ -1,4 +1,4 @@
-/* $Id: SeqTable_multi_data.cpp 464942 2015-04-15 15:46:17Z vasilche $
+/* $Id: SeqTable_multi_data.cpp 484045 2015-11-05 19:59:38Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -327,6 +327,10 @@ CSeqTable_multi_data::E_Choice CSeqTable_multi_data::GetValueType(void) const
         return GetInt_delta().GetValueType();
     case e_Int_scaled:
         return GetInt_scaled().GetIntSize() <= sizeof(Int4)? e_Int: e_Int8;
+    case e_Common_string:
+        return e_String;
+    case e_Common_bytes:
+        return e_Bytes;
     default:
         return Which();
     }
diff --git a/c++/src/objects/seqtable/seqtable.def b/c++/src/objects/seqtable/seqtable.def
index 1b6f845..025bb99 100644
--- a/c++/src/objects/seqtable/seqtable.def
+++ b/c++/src/objects/seqtable/seqtable.def
@@ -18,6 +18,9 @@ loc._type      = vector
 id._type       = vector
 interval._type = vector
 
+[SeqTable-single-data]
+int8._type     = Int8
+
 [CommonString-table]
 strings._type       = vector
 indexes._type       = vector
diff --git a/c++/src/objects/taxon1/cache.cpp b/c++/src/objects/taxon1/cache.cpp
index 08c5d13..0c9592d 100644
--- a/c++/src/objects/taxon1/cache.cpp
+++ b/c++/src/objects/taxon1/cache.cpp
@@ -1,4 +1,4 @@
-/* $Id: cache.cpp 454784 2014-12-17 22:26:37Z domrach $
+/* $Id: cache.cpp 488663 2016-01-04 18:15:48Z domrach $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -100,7 +100,7 @@ COrgRefCache::Init( unsigned nCapacity )
 }
 
 bool
-COrgRefCache::Lookup( int tax_id, CTaxon1Node** ppNode )
+COrgRefCache::Lookup( TTaxId tax_id, CTaxon1Node** ppNode )
 {
     if( (unsigned)tax_id < m_nMaxTaxId ) {
         *ppNode = m_ppEntries[tax_id];
@@ -111,7 +111,7 @@ COrgRefCache::Lookup( int tax_id, CTaxon1Node** ppNode )
 }
 
 bool
-COrgRefCache::LookupAndAdd( int tax_id, CTaxon1Node** ppData )
+COrgRefCache::LookupAndAdd( TTaxId tax_id, CTaxon1Node** ppData )
 {
     *ppData = NULL;
     if( (unsigned)tax_id < m_nMaxTaxId ) {
@@ -177,7 +177,7 @@ COrgRefCache::LookupAndAdd( int tax_id, CTaxon1Node** ppData )
 }
 
 bool
-COrgRefCache::LookupAndInsert( int tax_id, CTaxon1_data** ppData )
+COrgRefCache::LookupAndInsert( TTaxId tax_id, CTaxon1_data** ppData )
 {
     CTaxon1Node* pNode = ( NULL );
     *ppData = NULL;
@@ -199,7 +199,7 @@ COrgRefCache::LookupAndInsert( int tax_id, CTaxon1_data** ppData )
 }
 
 bool
-COrgRefCache::LookupAndInsert( int tax_id, CTaxon2_data** ppData )
+COrgRefCache::LookupAndInsert( TTaxId tax_id, CTaxon2_data** ppData )
 {
     CTaxon1Node* pNode = ( NULL );
     *ppData = NULL;
@@ -221,7 +221,7 @@ COrgRefCache::LookupAndInsert( int tax_id, CTaxon2_data** ppData )
 }
 
 bool
-COrgRefCache::Lookup( int tax_id, CTaxon1_data** ppData )
+COrgRefCache::Lookup( TTaxId tax_id, CTaxon1_data** ppData )
 {
     if( (unsigned)tax_id < m_nMaxTaxId ) {
         CTaxon1Node* pNode = ( m_ppEntries[tax_id] );
@@ -239,7 +239,7 @@ COrgRefCache::Lookup( int tax_id, CTaxon1_data** ppData )
 }
 
 bool
-COrgRefCache::Lookup( int tax_id, CTaxon2_data** ppData )
+COrgRefCache::Lookup( TTaxId tax_id, CTaxon2_data** ppData )
 {
     if( (unsigned)tax_id < m_nMaxTaxId ) {
         CTaxon1Node* pNode = ( m_ppEntries[tax_id] );
@@ -1218,7 +1218,7 @@ COrgRefCache::InitDivisions()
 }
 
 void
-COrgRefCache::SetIndexEntry( int id, CTaxon1Node* pNode )
+COrgRefCache::SetIndexEntry( TTaxId id, CTaxon1Node* pNode )
 {
     m_ppEntries[id] = pNode;
 }
diff --git a/c++/src/objects/taxon1/cache.hpp b/c++/src/objects/taxon1/cache.hpp
index 7d10eb4..9fbe85a 100644
--- a/c++/src/objects/taxon1/cache.hpp
+++ b/c++/src/objects/taxon1/cache.hpp
@@ -1,7 +1,7 @@
 #ifndef NCBI_TAXON1_CACHE_HPP
 #define NCBI_TAXON1_CACHE_HPP
 
-/* $Id: cache.hpp 428223 2014-02-28 16:54:26Z domrach $
+/* $Id: cache.hpp 488663 2016-01-04 18:15:48Z domrach $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -55,12 +55,12 @@ public:
 
     bool Init( unsigned nCapacity = 10 );
 
-    bool Lookup( int tax_id, CTaxon1Node** ppNode );
-    bool LookupAndAdd( int tax_id, CTaxon1Node** ppData );
-    bool LookupAndInsert( int tax_id, CTaxon1_data** ppData );
-    bool LookupAndInsert( int tax_id, CTaxon2_data** ppData );
-    bool Lookup( int tax_id, CTaxon1_data** ppData );
-    bool Lookup( int tax_id, CTaxon2_data** ppData );
+    bool Lookup( TTaxId tax_id, CTaxon1Node** ppNode );
+    bool LookupAndAdd( TTaxId tax_id, CTaxon1Node** ppData );
+    bool LookupAndInsert( TTaxId tax_id, CTaxon1_data** ppData );
+    bool LookupAndInsert( TTaxId tax_id, CTaxon2_data** ppData );
+    bool Lookup( TTaxId tax_id, CTaxon1_data** ppData );
+    bool Lookup( TTaxId tax_id, CTaxon2_data** ppData );
 
     bool Insert1( CTaxon1Node& node );
     bool Insert2( CTaxon1Node& node );
@@ -95,7 +95,7 @@ public:
     CTreeCont& GetTree() { return m_tPartTree; }
     const CTreeCont& GetTree() const { return m_tPartTree; }
 
-    void  SetIndexEntry( int id, CTaxon1Node* pNode );
+    void  SetIndexEntry( TTaxId id, CTaxon1Node* pNode );
 
     COrgMod::ESubtype GetSubtypeFromName( string& sName );
 
@@ -195,7 +195,7 @@ public:
 	  m_cacheEntry( NULL ), m_flags( 0 ) {}
     virtual ~CTaxon1Node() {}
 
-    virtual int           GetTaxId() const { return m_ref->GetTaxid(); }
+    virtual TTaxId           GetTaxId() const { return m_ref->GetTaxid(); }
     virtual const string& GetName() const { return m_ref->GetOname(); }
     virtual const string& GetBlastName() const
     { return m_ref->CanGetUname() ? m_ref->GetUname() : kEmptyStr; }
diff --git a/c++/src/objects/taxon1/taxon1.cpp b/c++/src/objects/taxon1/taxon1.cpp
index d5bf59e..be92151 100644
--- a/c++/src/objects/taxon1/taxon1.cpp
+++ b/c++/src/objects/taxon1/taxon1.cpp
@@ -1,4 +1,4 @@
-/* $Id: taxon1.cpp 455142 2014-12-23 15:34:46Z domrach $
+/* $Id: taxon1.cpp 488663 2016-01-04 18:15:48Z domrach $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -157,6 +157,8 @@ CTaxon1::Init(const STimeout* timeout, unsigned reconnect_attempts,
 #endif
         pOut.reset( CObjectOStream::Open(m_eDataFormat, *pServer) );
         pIn.reset( CObjectIStream::Open(m_eDataFormat, *pServer) );
+	pOut->FixNonPrint(eFNP_Allow);
+	pIn->FixNonPrint(eFNP_Allow);
 
         req.SetInit();
 
@@ -213,7 +215,7 @@ CTaxon1::Fini(void)
 }
 
 CRef< CTaxon2_data >
-CTaxon1::GetById(int tax_id)
+CTaxon1::GetById(TTaxId tax_id)
 {
     SetLastError(NULL);
     if( !TAXON1_IS_INITED ) {
@@ -373,7 +375,7 @@ private:
 
 void
 CTaxon1::OrgRefAdjust( COrg_ref& inp_orgRef, const COrg_ref& db_orgRef,
-                       int tax_id )
+                       TTaxId tax_id )
 {
     inp_orgRef.ResetCommon();
     inp_orgRef.ResetSyn();
@@ -567,7 +569,7 @@ CTaxon1::OrgRefAdjust( COrg_ref& inp_orgRef, const COrg_ref& db_orgRef,
 }
 
 bool
-CTaxon1::LookupByOrgRef(const COrg_ref& inp_orgRef, int* pTaxid,
+CTaxon1::LookupByOrgRef(const COrg_ref& inp_orgRef, TTaxId* pTaxid,
                         COrgName::TMod& hitMods )
 {
     SetLastError(NULL);
@@ -700,7 +702,7 @@ CTaxon1::Lookup(const COrg_ref& inp_orgRef )
     // Check if this taxon is in cache
     CTaxon2_data* pData = 0;
     COrgName::TMod hitMod;
-    int tax_id = 0;
+    TTaxId tax_id = 0;
 
     if( LookupByOrgRef( inp_orgRef, &tax_id, hitMod )
         && tax_id > 0
@@ -751,7 +753,7 @@ CTaxon1::LookupMerge(COrg_ref& inp_orgRef )
 	}
     }
     COrgName::TMod hitMod;
-    int tax_id = 0; //GetTaxIdByOrgRef( inp_orgRef );
+    TTaxId tax_id = 0; //GetTaxIdByOrgRef( inp_orgRef );
 
     if( LookupByOrgRef( inp_orgRef, &tax_id, hitMod )
         && tax_id > 0
@@ -768,7 +770,7 @@ CTaxon1::LookupMerge(COrg_ref& inp_orgRef )
     return CConstRef<CTaxon2_data>(pData);
 }
 
-int
+TTaxId
 CTaxon1::GetTaxIdByOrgRef(const COrg_ref& inp_orgRef)
 {
     SetLastError(NULL);
@@ -794,7 +796,7 @@ CTaxon1::GetTaxIdByOrgRef(const COrg_ref& inp_orgRef)
     return 0;
 }
 
-int
+TTaxId
 CTaxon1::GetTaxIdByName(const string& orgname)
 {
     SetLastError(NULL);
@@ -807,7 +809,7 @@ CTaxon1::GetTaxIdByName(const string& orgname)
     return GetTaxIdByOrgRef(orgRef);
 }
 
-int
+TTaxId
 CTaxon1::FindTaxIdByName(const string& orgname)
 {
     SetLastError(NULL);
@@ -819,7 +821,7 @@ CTaxon1::FindTaxIdByName(const string& orgname)
     if( orgname.empty() )
         return 0;
 
-    int id( GetTaxIdByName(orgname) );
+    TTaxId id( GetTaxIdByName(orgname) );
 
     if(id < 1) {
 
@@ -854,7 +856,7 @@ CTaxon1::FindTaxIdByName(const string& orgname)
 //              -1 - if multiple nodes found
 //              -2 - error during processing occured
 ///
-int
+TTaxId
 CTaxon1::SearchTaxIdByName(const string& orgname, ESearch mode,
                            list< CRef< CTaxon1_name > >* pNameList)
 {
@@ -957,7 +959,7 @@ CTaxon1::GetAllTaxIdByName(const string& orgname, TTaxIdList& lIds)
 // pointer to internally stored OrgRef.
 ///
 CConstRef< COrg_ref >
-CTaxon1::GetOrgRef(int tax_id,
+CTaxon1::GetOrgRef(TTaxId tax_id,
                    bool& is_species,
                    bool& is_uncultured,
                    string& blast_name,
@@ -1012,8 +1014,8 @@ CTaxon1::SetSynonyms(bool on_off)
 // NOTE:
 //   Root of the tree has tax_id of 1
 ///
-int
-CTaxon1::GetParent(int id_tax)
+TTaxId
+CTaxon1::GetParent(TTaxId id_tax)
 {
     CTaxon1Node* pNode = 0;
     SetLastError(NULL);
@@ -1040,8 +1042,8 @@ CTaxon1::GetParent(int id_tax)
 // NOTE:
 //   Root of the tree has tax_id of 1
 ///
-int
-CTaxon1::GetSpecies(int id_tax, ESpeciesMode mode)
+TTaxId
+CTaxon1::GetSpecies(TTaxId id_tax, ESpeciesMode mode)
 {
     CTaxon1Node* pNode = 0;
     SetLastError(NULL);
@@ -1095,8 +1097,8 @@ CTaxon1::GetSpecies(int id_tax, ESpeciesMode mode)
 //               0 - no genus in the lineage
 //              -1 - if error
 ///
-int
-CTaxon1::GetGenus(int id_tax)
+TTaxId
+CTaxon1::GetGenus(TTaxId id_tax)
 {
     CTaxon1Node* pNode = 0;
     SetLastError(NULL);
@@ -1126,8 +1128,8 @@ CTaxon1::GetGenus(int id_tax)
 //               0 - no superkingdom in the lineage
 //              -1 - if error
 ///
-int
-CTaxon1::GetSuperkingdom(int id_tax)
+TTaxId
+CTaxon1::GetSuperkingdom(TTaxId id_tax)
 {
     CTaxon1Node* pNode = 0;
     SetLastError(NULL);
@@ -1151,6 +1153,90 @@ CTaxon1::GetSuperkingdom(int id_tax)
     return -1;
 }
 
+//---------------------------------------------
+// Get ancestor tax_id by rank name
+// rank name might be one of:
+// no rank
+// superkingdom
+// kingdom
+// subkingdom
+// superphylum
+// phylum
+// subphylum
+// superclass
+// class
+// subclass
+// infraclass
+// cohort
+// subcohort
+// superorder
+// order
+// suborder
+// infraorder
+// parvorder
+// superfamily
+// family
+// subfamily
+// tribe
+// subtribe
+// genus
+// subgenus
+// species group
+// species subgroup
+// species
+// subspecies
+// varietas
+// forma
+//
+// Returns: tax_id of properly ranked accessor or
+//               0 - no such rank in the lineage
+//              -1 - invalid rank name
+//              -2 - any other error (use GetLastError for details)
+///
+TTaxId
+CTaxon1::GetAncestorByRank(TTaxId id_tax, const char* rank_name)
+{
+    SetLastError(NULL);
+    if( !TAXON1_IS_INITED ) {
+	if( !Init() ) { 
+	    return -2;
+	}
+    }
+    if( rank_name ) {
+	short rank( m_plCache->FindRankByName( rank_name ) );
+	if( rank != -1000 ) {
+	    return GetAncestorByRank(id_tax, rank);
+	}
+    }
+    SetLastError( "rank not found" );
+    ERR_POST_X( 2, GetLastError() );
+    return -1;
+}
+
+TTaxId
+CTaxon1::GetAncestorByRank(TTaxId id_tax, short rank_id)
+{
+    CTaxon1Node* pNode = 0;
+    SetLastError(NULL);
+    if( !TAXON1_IS_INITED ) {
+	if( !Init() ) { 
+	    return -1;
+	}
+    }
+    if( m_plCache->LookupAndAdd( id_tax, &pNode )
+        && pNode ) {
+        while( !pNode->IsRoot() ) {
+            int rank( pNode->GetRank() );
+            if( rank == rank_id )
+                return pNode->GetTaxId();
+            if( (rank >= 0) && (rank < rank_id))
+                return 0;
+            pNode = pNode->GetParent();
+        }
+	return 0;
+    }
+    return -1;
+}
 
 //---------------------------------------------
 // Get taxids for all children of specified node.
@@ -1158,7 +1244,7 @@ CTaxon1::GetSuperkingdom(int id_tax)
 //          -1 - in case of error
 ///
 int
-CTaxon1::GetChildren(int id_tax, TTaxIdList& children_ids)
+CTaxon1::GetChildren(TTaxId id_tax, TTaxIdList& children_ids)
 {
     int count(0);
     CTaxon1Node* pNode = 0;
@@ -1338,10 +1424,10 @@ CTaxon1::GetNameClassId( const string& class_name )
 // ancestor)
 //          -1 - in case of an error
 ///
-int
-CTaxon1::Join(int taxid1, int taxid2)
+TTaxId
+CTaxon1::Join(TTaxId taxid1, TTaxId taxid2)
 {
-    int tax_id = 0;
+    TTaxId tax_id = 0;
     CTaxon1Node *pNode1, *pNode2;
     SetLastError(NULL);
     if( !TAXON1_IS_INITED ) {
@@ -1367,7 +1453,7 @@ CTaxon1::Join(int taxid1, int taxid2)
 // If unique is true then only unique names will be stored
 ///
 int
-CTaxon1::GetAllNames(int tax_id, TNameList& lNames, bool unique)
+CTaxon1::GetAllNames(TTaxId tax_id, TNameList& lNames, bool unique)
 {
     int count(0);
     SetLastError(NULL);
@@ -1412,7 +1498,7 @@ CTaxon1::GetAllNames(int tax_id, TNameList& lNames, bool unique)
 //          FALSE - failure
 ///
 bool
-CTaxon1::GetAllNamesEx(int tax_id, list< CRef< CTaxon1_name > >& lNames)
+CTaxon1::GetAllNamesEx(TTaxId tax_id, list< CRef< CTaxon1_name > >& lNames)
 {
     SetLastError(NULL);
     if( !TAXON1_IS_INITED ) {
@@ -1500,7 +1586,7 @@ CTaxon1::IsAlive(void)
 }
 
 bool
-CTaxon1::GetTaxId4GI(TGi gi, int& tax_id_out )
+CTaxon1::GetTaxId4GI(TGi gi, TTaxId& tax_id_out )
 {
     SetLastError(NULL);
     if( !TAXON1_IS_INITED ) {
@@ -1527,7 +1613,7 @@ CTaxon1::GetTaxId4GI(TGi gi, int& tax_id_out )
 }
 
 bool
-CTaxon1::GetBlastName(int tax_id, string& blast_name_out )
+CTaxon1::GetBlastName(TTaxId tax_id, string& blast_name_out )
 {
     CTaxon1Node* pNode = 0;
     SetLastError(NULL);
@@ -1621,6 +1707,8 @@ CTaxon1::SendRequest( CTaxon1_req& req, CTaxon1_resp& resp, bool bShouldReconnec
 
                 pOut.reset( CObjectOStream::Open(m_eDataFormat, *pServer) );
                 pIn.reset( CObjectIStream::Open(m_eDataFormat, *pServer) );
+                pOut->FixNonPrint(eFNP_Allow);
+                pIn->FixNonPrint(eFNP_Allow);
                 m_pServer = pServer.release();
                 m_pIn = pIn.release();
                 m_pOut = pOut.release();
@@ -1674,7 +1762,7 @@ CTaxon1::GetPopsetJoin( const TTaxIdList& ids_in, TTaxIdList& ids_out )
 	}
     }
     if( ids_in.size() > 0 ) {
-        map< int, CTaxon1Node* > nodeMap;
+        map< TTaxId, CTaxon1Node* > nodeMap;
         CTaxon1Node *pParent = 0, *pNode = 0, *pNewParent = 0;
         CTreeCont tPartTree; // Partial tree
         CTreeIterator* pIt = tPartTree.GetIterator();
@@ -1685,7 +1773,7 @@ CTaxon1::GetPopsetJoin( const TTaxIdList& ids_in, TTaxIdList& ids_out )
         for( TTaxIdList::const_iterator ci = ids_in.begin();
              ci != ids_in.end();
              ++ci ) {
-            map< int, CTaxon1Node* >::iterator nmi = nodeMap.find( *ci );
+            map< TTaxId, CTaxon1Node* >::iterator nmi = nodeMap.find( *ci );
             if( nmi == nodeMap.end() ) {
                 if( m_plCache->LookupAndAdd( *ci, &pNode ) ) {
                     if( !tPartTree.GetRoot() ) {
@@ -1693,7 +1781,7 @@ CTaxon1::GetPopsetJoin( const TTaxIdList& ids_in, TTaxIdList& ids_out )
                             ( *static_cast<const CTaxon1Node*>
                               (m_plCache->GetTree().GetRoot()) );
                         tPartTree.SetRoot( pNewParent );
-                        nodeMap.insert( map< int,CTaxon1Node* >::value_type
+                        nodeMap.insert( map< TTaxId,CTaxon1Node* >::value_type
                                         (pNewParent->GetTaxId(), pNewParent) );
                     }
                     if( pNode ) {
@@ -1719,7 +1807,7 @@ CTaxon1::GetPopsetJoin( const TTaxIdList& ids_in, TTaxIdList& ids_out )
                              i != vLin.rend();
                              ++i ) {
                             pNode = *i;
-                            nodeMap.insert( map< int,CTaxon1Node* >::value_type
+                            nodeMap.insert( map< TTaxId,CTaxon1Node* >::value_type
                                             ( pNode->GetTaxId(), pNode ) );
                             pIt->AddChild( pNode );
                             pIt->GoNode( pNode );
@@ -1758,7 +1846,7 @@ CTaxon1::GetPopsetJoin( const TTaxIdList& ids_in, TTaxIdList& ids_out )
 //-----------------------------------
 //  Tree-related functions
 bool
-CTaxon1::LoadSubtreeEx( int tax_id, int levels, const ITaxon1Node** ppNode )
+CTaxon1::LoadSubtreeEx( TTaxId tax_id, int levels, const ITaxon1Node** ppNode )
 {
     CTaxon1Node* pNode = 0;
     SetLastError(NULL);
@@ -1865,7 +1953,7 @@ CTaxon1::GetTreeIterator( CTaxon1::EIteratorMode mode )
 }
 
 CRef< ITreeIterator >
-CTaxon1::GetTreeIterator( int tax_id, CTaxon1::EIteratorMode mode )
+CTaxon1::GetTreeIterator( TTaxId tax_id, CTaxon1::EIteratorMode mode )
 {
     CRef< ITreeIterator > pIt;
     CTaxon1Node* pData = 0;
@@ -1887,7 +1975,7 @@ CTaxon1::GetTreeIterator( int tax_id, CTaxon1::EIteratorMode mode )
 }
 
 bool
-CTaxon1::GetNodeProperty( int tax_id, const string& prop_name,
+CTaxon1::GetNodeProperty( TTaxId tax_id, const string& prop_name,
                           string& prop_val )
 {
     SetLastError(NULL);
@@ -1939,7 +2027,7 @@ CTaxon1::GetNodeProperty( int tax_id, const string& prop_name,
 }
 
 bool
-CTaxon1::GetNodeProperty( int tax_id, const string& prop_name,
+CTaxon1::GetNodeProperty( TTaxId tax_id, const string& prop_name,
                           bool& prop_val )
 {
     SetLastError(NULL);
@@ -1991,7 +2079,7 @@ CTaxon1::GetNodeProperty( int tax_id, const string& prop_name,
 }
 
 bool
-CTaxon1::GetNodeProperty( int tax_id, const string& prop_name,
+CTaxon1::GetNodeProperty( TTaxId tax_id, const string& prop_name,
                           int& prop_val )
 {
     SetLastError(NULL);
@@ -2208,7 +2296,7 @@ CTaxon1::CheckOrgRef( const COrg_ref& orgRef, TOrgRefStatus& stat_out )
 {
     CDiagAutoPrefix( "Taxon1::CheckOrgRef" );
     SetLastError(NULL);
-    int tax_id;
+    TTaxId tax_id;
 
     tax_id = GetTaxIdByOrgRef( orgRef );
     stat_out = eStatus_Ok;
@@ -2353,7 +2441,7 @@ CTaxon1::CheckOrgRef( const COrg_ref& orgRef, TOrgRefStatus& stat_out )
 //          false when call failed
 ///
 bool
-CTaxon1::GetTypeMaterial( int tax_id, TNameList& type_material_list_out )
+CTaxon1::GetTypeMaterial( TTaxId tax_id, TNameList& type_material_list_out )
 {
     CTaxon1Node* pNode = 0;
     SetLastError(NULL);
@@ -2429,7 +2517,7 @@ CTaxon1::GetTypeMaterial( int tax_id, TNameList& type_material_list_out )
 // This function returns the maximal value for taxid
 // or -1 in case of error
 ///
-int 
+TTaxId 
 CTaxon1::GetMaxTaxId( void )
 {
     SetLastError(NULL);
@@ -2453,7 +2541,7 @@ CTaxon1::GetMaxTaxId( void )
 // Returns: true on success, false in case of error
 ///
 bool
-CTaxon1::GetDisplayCommonName( int tax_id, string& disp_name_out )
+CTaxon1::GetDisplayCommonName( TTaxId tax_id, string& disp_name_out )
 {
     CTaxon1Node* pNode = 0;
     SetLastError(NULL);
@@ -2496,7 +2584,7 @@ CTaxon1::GetDisplayCommonName( int tax_id, string& disp_name_out )
 	// 3)
 // 	if( pNode->GetRank() == m_plCache->GetSubspeciesRank() ) {
 	    // Get corresponding species
-	    int species_id = GetSpecies(tax_id);
+	    TTaxId species_id = GetSpecies(tax_id);
 	    if( species_id < 0 ) {
 		return false;
 	    } else if( species_id > 0 && species_id != tax_id ) {
diff --git a/c++/src/objects/taxon1/taxon1.def b/c++/src/objects/taxon1/taxon1.def
index 09f0e4e..415b483 100644
--- a/c++/src/objects/taxon1/taxon1.def
+++ b/c++/src/objects/taxon1/taxon1.def
@@ -4,3 +4,6 @@ _export = NCBI_TAXON1_EXPORT
 [Taxon1-req]
 id4gi._type = ncbi::TGi
 id4gi._storage_type = ncbi::TIntId
+
+[Taxon1-name]
+taxid._type = ncbi::TTaxId
diff --git a/c++/src/objects/taxon3/Makefile.taxon3.lib b/c++/src/objects/taxon3/Makefile.taxon3.lib
index 4f7c359..90a35ed 100644
--- a/c++/src/objects/taxon3/Makefile.taxon3.lib
+++ b/c++/src/objects/taxon3/Makefile.taxon3.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.taxon3.lib 478176 2015-09-04 15:51:52Z ivanov $
+# $Id: Makefile.taxon3.lib 473759 2015-07-22 14:02:22Z holmesbr $
 
 LIB = taxon3
 SRC = taxon3__ taxon3___ taxon3 cached_taxon3
diff --git a/c++/src/objects/taxon3/cached_taxon3.cpp b/c++/src/objects/taxon3/cached_taxon3.cpp
index 96e004a..c855b01 100755
--- a/c++/src/objects/taxon3/cached_taxon3.cpp
+++ b/c++/src/objects/taxon3/cached_taxon3.cpp
@@ -1,4 +1,4 @@
-/* $Id: cached_taxon3.cpp 478176 2015-09-04 15:51:52Z ivanov $
+/* $Id: cached_taxon3.cpp 488358 2015-12-30 15:22:53Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -51,7 +51,7 @@
 BEGIN_NCBI_SCOPE
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
-const string kInvalidReplyMsg = "Taxonomy service returned invalid reply";
+static const char* kInvalidReplyMsg = "Taxonomy service returned invalid reply";
 
 
 CCachedTaxon3::CCachedTaxon3(AutoPtr<ITaxon3> taxon, TSizeType capacity)
diff --git a/c++/src/objects/taxon3/taxon3.cpp b/c++/src/objects/taxon3/taxon3.cpp
index 38d415d..565f10d 100644
--- a/c++/src/objects/taxon3/taxon3.cpp
+++ b/c++/src/objects/taxon3/taxon3.cpp
@@ -1,4 +1,4 @@
-/* $Id: taxon3.cpp 483221 2015-10-29 14:17:48Z ivanov $
+/* $Id: taxon3.cpp 475514 2015-08-10 15:53:39Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objects/trackmgr/Makefile.trackmgrgridcli.lib b/c++/src/objects/trackmgr/Makefile.trackmgrgridcli.lib
index 0d301d0..1232028 100644
--- a/c++/src/objects/trackmgr/Makefile.trackmgrgridcli.lib
+++ b/c++/src/objects/trackmgr/Makefile.trackmgrgridcli.lib
@@ -1,10 +1,12 @@
-# $Id: Makefile.trackmgrgridcli.lib 471666 2015-06-30 14:25:22Z ivanov $
+# $Id: Makefile.trackmgrgridcli.lib 478100 2015-09-03 19:05:40Z meric $
 
 LIB = trackmgrgridcli
 
 SRC = tms_exception blast_client displaytrack_client \
       createusertrack_client removeusertrack_client \
-      item_resolver_client switch_context_client track_attrvalue_client
+      item_resolver_client switch_context_client track_attrvalue_client \
+      trackset_client createtrackset_client \
+      supported_assemblies_client
 
 LIB_OR_DLL = lib
 
diff --git a/c++/src/objects/trackmgr/TMgr_IdentityId.cpp b/c++/src/objects/trackmgr/TMgr_IdentityId.cpp
index 0607bb1..ac9d43e 100644
--- a/c++/src/objects/trackmgr/TMgr_IdentityId.cpp
+++ b/c++/src/objects/trackmgr/TMgr_IdentityId.cpp
@@ -1,4 +1,4 @@
-/* $Id: TMgr_IdentityId.cpp 404012 2013-06-19 18:40:03Z meric $
+/* $Id: TMgr_IdentityId.cpp 477867 2015-09-02 13:52:21Z meric $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -50,8 +50,14 @@ CTMgr_IdentityId::~CTMgr_IdentityId(void)
 CRef<CTMgr_IdentityId>
 CTMgr_IdentityId::FromMyNCBIId(const int myncbi_id)
 {
+    return FromMyNCBIId(NStr::IntToString(myncbi_id));
+}
+
+CRef<CTMgr_IdentityId>
+CTMgr_IdentityId::FromMyNCBIId(const string& myncbi_id)
+{
     CRef<CTMgr_IdentityId> id(new CTMgr_IdentityId());
-    id->SetId(NStr::IntToString(myncbi_id));
+    id->SetId(myncbi_id);
     id->SetId_type(eTMgr_IdentityIdType_myncbi_id);
     return id;
 }
diff --git a/c++/src/objects/trackmgr/createtrackset_client.cpp b/c++/src/objects/trackmgr/createtrackset_client.cpp
new file mode 100644
index 0000000..a5f5ade
--- /dev/null
+++ b/c++/src/objects/trackmgr/createtrackset_client.cpp
@@ -0,0 +1,77 @@
+/* $Id: createtrackset_client.cpp 477317 2015-08-27 21:13:02Z meric $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *   Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors: Peter Meric
+ *
+ * File Description:  NetSchedule grid client for TrackManager trackset request/reply
+ *
+ */
+
+#include <ncbi_pch.hpp>
+#include <objects/trackmgr/trackmgr__.hpp>
+#include <objects/trackmgr/createtrackset_client.hpp>
+
+
+BEGIN_NCBI_SCOPE
+USING_SCOPE(objects);
+
+
+CTMS_CreateTrackSet_Client::CTMS_CreateTrackSet_Client(const string& NS_service,
+                                           const string& NS_queue,
+                                           const string& client_name,
+                                           const string& NC_registry_section
+                                          )
+    : TBaseClient(NS_service, NS_queue, client_name, NC_registry_section)
+{
+}
+
+CTMS_CreateTrackSet_Client::CTMS_CreateTrackSet_Client(const string& NS_registry_section,
+                                           const string& NC_registry_section
+                                          )
+    : TBaseClient(NS_registry_section, NC_registry_section)
+{
+}
+
+CTMS_CreateTrackSet_Client::~CTMS_CreateTrackSet_Client()
+{
+}
+
+CTMS_CreateTrackSet_Client::TReplyRef
+CTMS_CreateTrackSet_Client::Fetch(const TRequest& request) const
+{
+    CRef<TReply> reply;
+    try {
+        reply.Reset(new TReply());
+        TBaseClient::Ask(request, *reply);
+    }
+    catch (const CException& e) {
+        NCBI_REPORT_EXCEPTION("Exception communicating with TMS-CreateTrackset service ", e);
+        reply.Reset();
+    }
+    return reply;
+}
+
+
+END_NCBI_SCOPE
diff --git a/c++/src/objects/trackmgr/supported_assemblies_client.cpp b/c++/src/objects/trackmgr/supported_assemblies_client.cpp
new file mode 100644
index 0000000..574904b
--- /dev/null
+++ b/c++/src/objects/trackmgr/supported_assemblies_client.cpp
@@ -0,0 +1,109 @@
+/* $Id: supported_assemblies_client.cpp 478179 2015-09-04 16:42:53Z meric $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *   Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors: Peter Meric
+ *
+ * File Description:  NetSchedule grid client for TrackManager supported-assemblies request/reply
+ *
+ */
+
+#include <ncbi_pch.hpp>
+#include <objects/trackmgr/trackmgr__.hpp>
+#include <objects/trackmgr/supported_assemblies_client.hpp>
+
+
+BEGIN_NCBI_SCOPE
+USING_SCOPE(objects);
+
+
+CTMS_SupportedAssemblies_Client::CTMS_SupportedAssemblies_Client(
+    const string& NS_service,
+    const string& NS_queue,
+    const string& client_name,
+    const string& NC_registry_section
+   )
+    : TBaseClient(NS_service, NS_queue, client_name, NC_registry_section)
+{
+}
+
+CTMS_SupportedAssemblies_Client::CTMS_SupportedAssemblies_Client(
+    const string& NS_registry_section,
+    const string& NC_registry_section
+   )
+    : TBaseClient(NS_registry_section, NC_registry_section)
+{
+}
+
+CTMS_SupportedAssemblies_Client::~CTMS_SupportedAssemblies_Client()
+{
+}
+
+CTMS_SupportedAssemblies_Client::TReplyRef
+CTMS_SupportedAssemblies_Client::Fetch(const TRequest& request) const
+{
+    CRef<TReply> reply;
+    try {
+        reply.Reset(new TReply());
+        TBaseClient::Ask(request, *reply);
+    }
+    catch (const CException& e) {
+        NCBI_REPORT_EXCEPTION("Exception communicating with TMS-SupportedAssemblies service ", e);
+        reply.Reset();
+    }
+    return reply;
+}
+
+bool
+CTMS_SupportedAssemblies_Client::IsAssemblySupported(const string& assm_acc) const
+{
+    CRef<TRequest> req(new TRequest());
+    req->SetAssembly_acc(assm_acc);
+    CConstRef<TReply> reply = Fetch(*req);
+    if (reply.IsNull()) {
+        NCBI_THROW(CException, eUnknown, "Unable to determine support for assembly");
+    }
+    if (reply->IsSetMessages()) {
+        ITERATE (TReply::TMessages, it, reply->GetMessages()) {
+            CConstRef<CTMgr_Message> e = *it;
+            switch (e->GetLevel()) {
+            case eTMgr_MessageLevel_warning:
+                ERR_POST(Warning << e->GetMessage());
+                break;
+            case eTMgr_MessageLevel_info:
+                ERR_POST(Info << e->GetMessage());
+                break;
+            default:
+                ERR_POST(e->GetMessage());
+            }
+        }
+    }
+    if (!reply->IsSetReply()) {
+        NCBI_THROW(CException, eUnknown, "Unable to determine support for assembly");
+    }
+    return reply->GetReply().GetAssembly_acc();
+}
+
+
+END_NCBI_SCOPE
diff --git a/c++/src/objects/trackmgr/trackmgr.asn b/c++/src/objects/trackmgr/trackmgr.asn
index d6f6e97..e5860c7 100644
--- a/c++/src/objects/trackmgr/trackmgr.asn
+++ b/c++/src/objects/trackmgr/trackmgr.asn
@@ -1,4 +1,4 @@
---- $Id: trackmgr.asn 469220 2015-06-02 17:28:19Z meric $
+--- $Id: trackmgr.asn 478159 2015-09-04 13:57:39Z meric $
 ---
 --- Definitions for the TrackManager service
 ---
@@ -6,13 +6,15 @@
 NCBI-TrackManager DEFINITIONS ::=
 BEGIN
 
-EXPORTS TMgr-Request, TMgr-Reply, TMgr-GenomeContext,
+EXPORTS TMgr-Request, TMgr-Reply, TMgr-GenomeContext, TMgr-Status,
         TMgr-ClientInfo, TMgr-DisplayTrackRequest,
         TMgr-DisplayTrackReply, TMgr-AssemblySpec,TMgr-AttrSpec,
         TMgr-BlastRIDDetail, TMgr-Assembly, TMgr-Attribute, TMgr-DisplayTrack,
         TMgr-DTrackId, TMgr-DatasetItem, TMgr-DisplayTrackChoice,
         TMgr-CreateUserTrackRequest, TMgr-CreateUserTrackReply, TMgr-Identity,
         TMgr-TrackAttrValueRequest, TMgr-TrackAttrValueReply,
+        TMgr-RetrieveTracksetRequest, TMgr-RetrieveTracksetReply,
+        TMgr-CreateTracksetRequest, TMgr-CreateTracksetReply,
         TMgr-AttrRequest, TMgr-AttrReply, TMgr-ValueRequest, TMgr-AttrValueReply,
         TMgr-TrackAttributes, TMgr-MessageLevel, TMgr-Message, TMgr-DatasetItemSeq;
 
@@ -28,7 +30,11 @@ TMgr-Request ::= CHOICE {
     blast-tracks TMgr-BlastRIDRequest,
     create-user-tracks TMgr-CreateUserTrackRequest,
     resolve-track-items TMgr-ItemResolverRequest,
-    remove-user-tracks TMgr-RemoveUserTrackRequest
+    remove-user-tracks TMgr-RemoveUserTrackRequest,
+    retrieve-tracksets TMgr-RetrieveTracksetRequest,
+    create-trackset TMgr-CreateTracksetRequest,
+    rename-trackset TMgr-RenameMyNCBICollectionRequest,
+    supported-assemblies TMgr-SupportedAssembliesRequest
 }
 
 TMgr-Reply ::= CHOICE {
@@ -38,7 +44,11 @@ TMgr-Reply ::= CHOICE {
     blast-tracks TMgr-BlastRIDReply,
     create-user-tracks TMgr-CreateUserTrackReply,
     resolve-track-items TMgr-ItemResolverReply,
-    remove-user-tracks TMgr-RemoveUserTrackReply
+    remove-user-tracks TMgr-RemoveUserTrackReply,
+    retrieve-tracksets TMgr-RetrieveTracksetReply,
+    create-trackset TMgr-CreateTracksetReply,
+    rename-trackset TMgr-RenameMyNCBICollectionReply,
+    supported-assemblies TMgr-SupportedAssembliesReply
 }
 
 TMgr-GenomeContext ::= CHOICE {
@@ -278,6 +288,11 @@ TMgr-RemoveUserTrackRequest ::= SEQUENCE {
     dtrack-ids SET OF TMgr-DTrackId
 }
 
+TMgr-Status ::= INTEGER {
+    success (0),
+    failure (1)
+}
+
 TMgr-RemoveUserTrackReply ::= SEQUENCE {
     messages SEQUENCE OF TMgr-Message OPTIONAL
 }
@@ -344,6 +359,66 @@ TMgr-AnnotCounts ::= SEQUENCE {
     counts SET OF TMgr-TypeStat
 }
 
+TMgr-TrackSetType ::= INTEGER {
+    tms (0),
+    myncbi-collection (1)
+}
+
+TMgr-TrackSet ::= SEQUENCE {
+    type TMgr-TrackSetType,
+    id VisibleString, -- internal identifier
+    genome-context TMgr-GenomeContext,
+    name UTF8String,
+    description UTF8String OPTIONAL,
+    tracks SEQUENCE OF TMgr-DisplayTrack
+}
+
+TMgr-RetrieveTracksetRequest ::= SEQUENCE {
+    genome-context TMgr-GenomeContext,
+    identity TMgr-Identity OPTIONAL
+}
+
+TMgr-RetrieveTracksetReply ::= SEQUENCE {
+    messages SEQUENCE OF TMgr-Message OPTIONAL,
+    tracksets SET OF TMgr-TrackSet OPTIONAL
+}
+
+TMgr-CreateTracksetRequest ::= SEQUENCE {
+    identity TMgr-Identity OPTIONAL,
+    genome-context TMgr-GenomeContext,
+    name UTF8String,
+    description UTF8String OPTIONAL,
+    tracks SEQUENCE OF TMgr-DTrackId
+}
+
+TMgr-CreateTracksetReply ::= SEQUENCE {
+    messages SEQUENCE OF TMgr-Message OPTIONAL,
+    status TMgr-Status,
+    trackset-id VisibleString OPTIONAL
+}
+
+TMgr-RenameMyNCBICollectionRequest ::= SEQUENCE {
+    collection-id VisibleString,
+    name VisibleString
+}
+
+TMgr-RenameMyNCBICollectionReply ::= SEQUENCE {
+    messages SEQUENCE OF TMgr-Message OPTIONAL,
+    status TMgr-Status
+}
+
+TMgr-SupportedAssembliesRequest ::= CHOICE {
+    assembly-acc VisibleString
+    --tax-id INTEGER (0..MAXINT)
+}
+
+TMgr-SupportedAssembliesReply ::= SEQUENCE {
+    messages SEQUENCE OF TMgr-Message OPTIONAL,
+    reply CHOICE {
+        assembly-acc BOOLEAN
+        --tax-id SET OF VisibleString
+    } OPTIONAL
+}
 
 END
 
diff --git a/c++/src/objects/trackmgr/trackset_client.cpp b/c++/src/objects/trackmgr/trackset_client.cpp
new file mode 100644
index 0000000..87f1496
--- /dev/null
+++ b/c++/src/objects/trackmgr/trackset_client.cpp
@@ -0,0 +1,77 @@
+/* $Id: trackset_client.cpp 476457 2015-08-18 21:48:00Z meric $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *   Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors: Peter Meric
+ *
+ * File Description:  NetSchedule grid client for TrackManager trackset request/reply
+ *
+ */
+
+#include <ncbi_pch.hpp>
+#include <objects/trackmgr/trackmgr__.hpp>
+#include <objects/trackmgr/trackset_client.hpp>
+
+
+BEGIN_NCBI_SCOPE
+USING_SCOPE(objects);
+
+
+CTMS_TrackSet_Client::CTMS_TrackSet_Client(const string& NS_service,
+                                           const string& NS_queue,
+                                           const string& client_name,
+                                           const string& NC_registry_section
+                                          )
+    : TBaseClient(NS_service, NS_queue, client_name, NC_registry_section)
+{
+}
+
+CTMS_TrackSet_Client::CTMS_TrackSet_Client(const string& NS_registry_section,
+                                           const string& NC_registry_section
+                                          )
+    : TBaseClient(NS_registry_section, NC_registry_section)
+{
+}
+
+CTMS_TrackSet_Client::~CTMS_TrackSet_Client()
+{
+}
+
+CTMS_TrackSet_Client::TReplyRef
+CTMS_TrackSet_Client::Fetch(const TRequest& request) const
+{
+    CRef<TReply> reply;
+    try {
+        reply.Reset(new TReply());
+        TBaseClient::Ask(request, *reply);
+    }
+    catch (const CException& e) {
+        NCBI_REPORT_EXCEPTION("Exception communicating with TMS-RetrieveTrackset service ", e);
+        reply.Reset();
+    }
+    return reply;
+}
+
+
+END_NCBI_SCOPE
diff --git a/c++/src/objects/valerr/ValidErrItem.cpp b/c++/src/objects/valerr/ValidErrItem.cpp
index 3518c30..dc21742 100644
--- a/c++/src/objects/valerr/ValidErrItem.cpp
+++ b/c++/src/objects/valerr/ValidErrItem.cpp
@@ -1,4 +1,4 @@
-/* $Id: ValidErrItem.cpp 473633 2015-07-21 17:05:11Z ivanov $
+/* $Id: ValidErrItem.cpp 493799 2016-03-02 13:50:42Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -51,7 +51,7 @@ BEGIN_objects_SCOPE // namespace ncbi::objects::
 typedef SStaticPair<const char*, const char*> TErrStrs;
 typedef SStaticPair<unsigned int, TErrStrs> TErrTypStrs;
 
-const TErrTypStrs sc_ErrStrs [] = {
+static const TErrTypStrs sc_ErrStrs [] = {
     { eErr_ALL,
     {  "ALL", "ALL" } },
     { eErr_UNKNOWN,
@@ -637,7 +637,7 @@ require a taxonomy consult." } },
 require a taxonomy consult." } },
    { eErr_SEQ_DESCR_BadAltitude,
    { "BadAltitude",
-"The altitude must be reported as a number followed by m (for meters) and a period." } },
+"The altitude must be reported as a number followed by a space and the letter m (for meters)." } },
    { eErr_SEQ_DESCR_RefGeneTrackingOnNucProtSet,
    { "RefGeneTrackingOnNucProtSet",
 "The RefGeneTracking user object should not be on a nuc-prot set." } },
diff --git a/c++/src/objects/valid/Comment_rule.cpp b/c++/src/objects/valid/Comment_rule.cpp
index 07f4727..fb97824 100644
--- a/c++/src/objects/valid/Comment_rule.cpp
+++ b/c++/src/objects/valid/Comment_rule.cpp
@@ -1,4 +1,4 @@
-/* $Id: Comment_rule.cpp 438310 2014-06-13 19:38:30Z bollin $
+/* $Id: Comment_rule.cpp 493827 2016-03-02 13:59:27Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -48,6 +48,7 @@
 #include <objects/valid/Dependent_field_rule.hpp>
 #include <objects/general/User_field.hpp>
 #include <objects/general/Object_id.hpp>
+#include <objects/valid/Phrase_list.hpp>
 // generated classes
 
 BEGIN_NCBI_SCOPE
@@ -78,9 +79,9 @@ void CComment_rule::NormalizePrefix(string& prefix)
 }
 
 
-const string kStructuredComment = "StructuredComment";
-const string kStructuredCommentPrefix = "StructuredCommentPrefix";
-const string kStructuredCommentSuffix = "StructuredCommentSuffix";
+static const char* kStructuredComment       = "StructuredComment";
+static const char* kStructuredCommentPrefix = "StructuredCommentPrefix";
+static const char* kStructuredCommentSuffix = "StructuredCommentSuffix";
 
 bool CComment_rule::IsStructuredComment (const CUser_object& user)
 {
@@ -94,7 +95,7 @@ bool CComment_rule::IsStructuredComment (const CUser_object& user)
 }
 
 
-string CComment_rule::GetStructuredCommentPrefix (const CUser_object& user)
+string CComment_rule::GetStructuredCommentPrefix (const CUser_object& user, bool normalize)
 {
     if (!IsStructuredComment(user) || !user.IsSetData()) {
         return "";
@@ -109,7 +110,9 @@ string CComment_rule::GetStructuredCommentPrefix (const CUser_object& user)
             break;
         }
     }
-    CComment_rule::NormalizePrefix(prefix);
+    if (normalize) {
+        CComment_rule::NormalizePrefix(prefix);
+    }
     return prefix;
 }
 
@@ -197,6 +200,89 @@ CConstRef<CField_rule> CComment_rule::FindFieldRuleRef (const string& field_name
 }
 
 
+void CComment_rule::CheckGeneralFieldName(const string& label, TErrorList& errors)
+{
+    if (NStr::IsBlank(label)) {
+        errors.push_back(TError(eSeverity_level_error,
+            "Structured Comment contains field without label"));
+    }
+
+    if (NStr::Find(label, "::") != string::npos) {
+        errors.push_back(TError(eSeverity_level_reject, "Structured comment field '" + label + "' contains double colons"));
+    }
+}
+
+
+void CComment_rule::CheckGeneralFieldValue(const string& value, TErrorList& errors)
+{
+    if (NStr::Find(value, "::") != string::npos) {
+        errors.push_back(TError(eSeverity_level_reject, "Structured comment value '" + value + "' contains double colons"));
+    }
+}
+
+
+void CComment_rule::CheckGeneralField(const CUser_field& field, TErrorList& errors)
+{
+    string label = "";
+
+    if (field.IsSetLabel()) {
+        if (field.GetLabel().IsStr()) {
+            label = field.GetLabel().GetStr();
+        } else {
+            label = NStr::IntToString(field.GetLabel().GetId());
+        }
+    }
+    CheckGeneralFieldName(label, errors);
+
+    string value = "";
+    if (field.GetData().IsStr()) {
+        value = (field.GetData().GetStr());
+    } else if (field.GetData().IsInt()) {
+        value = NStr::IntToString(field.GetData().GetInt());
+    }
+    CheckGeneralFieldValue(value, errors);
+}
+
+
+void CComment_rule::CheckFieldValue(CConstRef<CField_rule> field_rule, const string& value, TErrorList& errors) const
+{
+    if (field_rule) {
+        if (!field_rule->DoesStringMatchRuleExpression(value)) {
+            // post error about not matching format
+            CField_rule::TSeverity sev = field_rule->GetSeverity();
+            if (NStr::EqualNocase(field_rule->GetField_name(), "Finishing Goal")
+                && NStr::EqualNocase(GetPrefix(), "##Genome-Assembly-Data-START##")) {
+                sev = eSeverity_level_error;
+            } else if (NStr::EqualNocase(field_rule->GetField_name(), "Current Finishing Status")
+                && NStr::EqualNocase(GetPrefix(), "##Genome-Assembly-Data-START##")) {
+                sev = eSeverity_level_error;
+            }
+            errors.push_back(TError(sev, value + " is not a valid value for " + field_rule->GetField_name()));
+        }
+    }
+    if (IsSetForbidden_phrases()) {
+        ITERATE(CComment_rule::TForbidden_phrases::Tdata, it, GetForbidden_phrases().Get()) {
+            if (NStr::FindNoCase(value, *it) != string::npos) {
+                errors.push_back(TError(eSeverity_level_error, "'" + value + "' is inappropriate for a GenBank submisison"));
+            }
+        }
+    }
+    CheckGeneralFieldValue(value, errors);
+}
+
+
+void CComment_rule::CheckFieldValue(CConstRef< CField_rule> rule, const CUser_field& field, TErrorList& errors) const
+{
+    string value = "";
+    if (field.GetData().IsStr()) {
+        value = (field.GetData().GetStr());
+    } else if (field.GetData().IsInt()) {
+        value = NStr::IntToString(field.GetData().GetInt());
+    }
+    CheckFieldValue(rule, value, errors);
+}
+
+
 CComment_rule::TErrorList CComment_rule::IsValid(const CUser_object& user) const
 {
     TErrorList errors;
@@ -207,79 +293,61 @@ CComment_rule::TErrorList CComment_rule::IsValid(const CUser_object& user) const
     CUser_object::TData::const_iterator field = user.GetData().begin();
     while (field_rule != GetFields().Get().end()
            && field != user.GetData().end()) {
+        string encountered_field = kEmptyStr;
         if ((*field)->IsSetLabel()) {
-            string label = "";
             if ((*field)->GetLabel().IsStr()) {
-                label = (*field)->GetLabel().GetStr();
+                encountered_field = (*field)->GetLabel().GetStr();
             } else {
-                label = NStr::IntToString((*field)->GetLabel().GetId());
+                encountered_field = NStr::IntToString((*field)->GetLabel().GetId());
             }
+        }
             // skip suffix and prefix
-            if (NStr::Equal(label, "StructuredCommentPrefix")
-                || NStr::Equal(label, "StructuredCommentSuffix")) {
-                ++field;
-                continue;
-            }
-            const string & expected_field = (*field_rule)->GetField_name();
-            if (NStr::Equal(expected_field, label)) {
-                // field in correct order
-                // is value correct?
-                string value = "";
-                if ((*field)->GetData().IsStr()) {
-                    value = ((*field)->GetData().GetStr());
-                } else if ((*field)->GetData().IsInt()) {
-                    value = NStr::IntToString((*field)->GetData().GetInt());
-                }
-                if (!(*field_rule)->DoesStringMatchRuleExpression(value)) {
-                    // post error about not matching format
-                    sev = (*field_rule)->GetSeverity();
-                    if (NStr::EqualNocase (label, "Finishing Goal")
-                        && NStr::EqualNocase(GetPrefix(), "##Genome-Assembly-Data-START##")) {
-                        sev = eSeverity_level_error;
-                    } else if (NStr::EqualNocase (label, "Current Finishing Status")
-                               && NStr::EqualNocase(GetPrefix(), "##Genome-Assembly-Data-START##")) {
-                        sev = eSeverity_level_error;
-                    }
-                    errors.push_back(TError(sev, value + " is not a valid value for " + label));
+        if (NStr::Equal(encountered_field, "StructuredCommentPrefix")
+            || NStr::Equal(encountered_field, "StructuredCommentSuffix")) {
+            ++field;
+            continue;
+        } else if (NStr::IsBlank(encountered_field)) {
+            CheckGeneralField(**field, errors);
+            ++field;
+        }
+
+        const string & expected_field = (*field_rule)->GetField_name();
+        if (NStr::Equal(expected_field, encountered_field)) {
+            // field in correct order
+            // is value correct?
+            CheckFieldValue(*field_rule, **field, errors);
+            ++field;
+            ++field_rule;
+        } else {
+            // find field for this rule and validate it
+            CConstRef<CUser_field> p_other_field = user.GetFieldRef(expected_field);
+            if( ! p_other_field ) {
+                if ((*field_rule)->IsSetRequired() && (*field_rule)->GetRequired()) {
+                    errors.push_back(TError((*field_rule)->GetSeverity(),
+                                            "Required field " + (*field_rule)->GetField_name() + " is missing"));
                 }
-                ++field;
-                ++field_rule;
             } else {
-                // find rule for this field
-                // find field for this rule and validate it
-                CConstRef<CUser_field> p_other_field = user.GetFieldRef(expected_field);
-                if( ! p_other_field ) {
-                    if ((*field_rule)->IsSetRequired() && (*field_rule)->GetRequired()) {
-                        errors.push_back(TError((*field_rule)->GetSeverity(),
-                                                "Required field " + (*field_rule)->GetField_name() + " is missing"));
-                    }
-                } else {
-
-                    const CUser_field& other_field = *p_other_field;
-                    if (GetRequire_order()) {
-                        errors.push_back(TError((*field_rule)->GetSeverity(),
-                                                expected_field + " field is out of order"));
-                    }
-                    string value = "";
-                    if (other_field.GetData().IsStr()) {
-                        value = (other_field.GetData().GetStr());
-                    } else if (other_field.GetData().IsInt()) {
-                        value = NStr::IntToString(other_field.GetData().GetInt());
-                    }
-                    if (!(*field_rule)->DoesStringMatchRuleExpression(value)) {
-                        // post error about not matching format
-                        errors.push_back(TError((*field_rule)->GetSeverity(),
-                                                value + " is not a valid value for " + expected_field));
-                    }
+                const CUser_field& other_field = *p_other_field;
+                if (GetRequire_order()) {
+                    errors.push_back(TError((*field_rule)->GetSeverity(),
+                                            expected_field + " field is out of order"));
                 }
+                CheckFieldValue(*field_rule, other_field, errors);
 
-                ++field_rule;
             }
-        } else {
-            // post error about field without label
-            errors.push_back(TError(eSeverity_level_error,
-                     "Structured Comment contains field without label"));
-            ++field;
+            ++field_rule;
+
+            // find rule for this field
+            CConstRef<CField_rule> real_field_rule = FindFieldRuleRef(encountered_field);
+            if (!real_field_rule) {
+                if (!IsSetAllow_unlisted()) {
+                    // field not found, not legitimate field name
+                    errors.push_back(TError(eSeverity_level_error,
+                        encountered_field + " is not a valid field name"));
+                }
+                CheckGeneralField(**field, errors);
+                ++field;
+            }
         }
     }
 
@@ -322,11 +390,10 @@ CComment_rule::TErrorList CComment_rule::IsValid(const CUser_object& user) const
                     errors.push_back(TError(eSeverity_level_error,
                                             label + " is not a valid field name"));
                 }
+                CheckGeneralField(**field, errors);
             }
         } else {
-            // post error about field without label
-            errors.push_back(TError(eSeverity_level_warning,
-                         "Structured Comment contains field without label"));
+            CheckGeneralField(**field, errors);
         }
         ++field;
     }
@@ -475,6 +542,21 @@ bool CComment_rule::ReorderFields(CUser_object& user) const
 }
 
 
+CComment_rule::TErrorList CComment_rule::CheckGeneralStructuredComment(const CUser_object& user)
+{
+    TErrorList errors;
+
+    if (!user.IsSetData()) {
+        return errors;
+    }
+
+    ITERATE(CUser_object::TData, it, user.GetData()) {
+        CheckGeneralField(**it, errors);
+    }
+    return errors;
+}
+
+
 END_objects_SCOPE // namespace ncbi::objects::
 
 END_NCBI_SCOPE
diff --git a/c++/src/objects/valid/validrules.inc b/c++/src/objects/valid/validrules.inc
index eef21bb..dd36001 100644
--- a/c++/src/objects/valid/validrules.inc
+++ b/c++/src/objects/valid/validrules.inc
@@ -1,4 +1,4 @@
-/*  $Id: validrules.inc 462948 2015-03-23 17:57:46Z bollin $
+/*  $Id: validrules.inc 493824 2016-03-02 13:58:25Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -803,11 +803,11 @@ static const char* const s_Defaultvalidrules[] = {
     "      {",
     "        field-name \"Finishing Goal\" ,",
     "        match-expression \"^\\([Ss][Tt][Aa][Nn][Dd][Aa][Rr][Dd] [Dd][Rr][Aa][Ff][Tt]\\|[Hh][Ii][Gg][Hh]-[Qq][Uu][Aa][Ll][Ii][Tt][Yy] [Dd][Rr][Aa][Ff][Tt]\\|[Ii][Mm][Pp][Rr][Oo][Vv][Ee][Dd] [Hh][Ii][Gg][Hh]-[Qq][Uu][Aa][Ll][Ii][Tt][Yy] [Dd][Rr][Aa][Ff][Tt]\\|Annotation-Directed Improvement\\|Noncontiguous Finished\\|Finished\\)$\" ,",
-    "        severity info } ,",
+    "        severity error } ,",
     "      {",
     "        field-name \"Current Finishing Status\" ,",
     "        match-expression \"^\\([Ss][Tt][Aa][Nn][Dd][Aa][Rr][Dd] [Dd][Rr][Aa][Ff][Tt]\\|[Hh][Ii][Gg][Hh]-[Qq][Uu][Aa][Ll][Ii][Tt][Yy] [Dd][Rr][Aa][Ff][Tt]\\|[Ii][Mm][Pp][Rr][Oo][Vv][Ee][Dd] [Hh][Ii][Gg][Hh]-[Qq][Uu][Aa][Ll][Ii][Tt][Yy] [Dd][Rr][Aa][Ff][Tt]\\|Annotation-Directed Improvement\\|Noncontiguous Finished\\|Finished\\)$\" ,",
-    "        severity info } ,",
+    "        severity error } ,",
     "      {",
     "        field-name \"Assembly Date\" ,",
     "        match-expression \"^\\(\\(\\(0\\|1\\|2\\|3\\)\\(0\\|1\\|2\\|3\\|4\\|5\\|6\\|7\\|8\\|9\\)-",
@@ -1025,7 +1025,65 @@ static const char* const s_Defaultvalidrules[] = {
     "        field-name \"coordinatePrecision\" ,",
     "        required FALSE } } ,",
     "    require-order FALSE ,",
-    "    allow-unlisted TRUE }",
+    "    allow-unlisted TRUE } ,",
+    "  {",
+    "    prefix \"##Taxonomic-Update-Statistics-START##\" ,",
+    "    fields {",
+    "      {",
+    "        field-name \"This Genome (query)\" ,",
+    "        required TRUE } ,",
+    "      { ",
+    "        field-name \"Current Name\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"Previous Name\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"Date Updated\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"Analysis Type\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"Analysis 1 (A1)\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A1 Genome (subject)\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A1 Name\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A1 ANI\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A1 Query Coverage\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A1 Subject Coverage\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"Analysis 2 (A2)\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A2 Genome (subject)\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A2 Name\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A2 ANI\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A2 Query Coverage\" ,",
+    "        required TRUE } ,",
+    "      {",
+    "        field-name \"A2 Subject Coverage\" ,",
+    "        required TRUE }",
+    "    } ,",
+    "    require-order TRUE ,",
+    "    allow-unlisted FALSE ",
+    "  }",
     "}",
     ""
 };
diff --git a/c++/src/objects/valid/validrules.prt b/c++/src/objects/valid/validrules.prt
index 301b274..4e49165 100644
--- a/c++/src/objects/valid/validrules.prt
+++ b/c++/src/objects/valid/validrules.prt
@@ -770,11 +770,11 @@ nelle\)$" ,
       {
         field-name "Finishing Goal" ,
         match-expression "^\([Ss][Tt][Aa][Nn][Dd][Aa][Rr][Dd] [Dd][Rr][Aa][Ff][Tt]\|[Hh][Ii][Gg][Hh]-[Qq][Uu][Aa][Ll][Ii][Tt][Yy] [Dd][Rr][Aa][Ff][Tt]\|[Ii][Mm][Pp][Rr][Oo][Vv][Ee][Dd] [Hh][Ii][Gg][Hh]-[Qq][Uu][Aa][Ll][Ii][Tt][Yy] [Dd][Rr][Aa][Ff][Tt]\|Annotation-Directed Improvement\|Noncontiguous Finished\|Finished\)$" ,
-        severity info } ,
+        severity error } ,
       {
         field-name "Current Finishing Status" ,
         match-expression "^\([Ss][Tt][Aa][Nn][Dd][Aa][Rr][Dd] [Dd][Rr][Aa][Ff][Tt]\|[Hh][Ii][Gg][Hh]-[Qq][Uu][Aa][Ll][Ii][Tt][Yy] [Dd][Rr][Aa][Ff][Tt]\|[Ii][Mm][Pp][Rr][Oo][Vv][Ee][Dd] [Hh][Ii][Gg][Hh]-[Qq][Uu][Aa][Ll][Ii][Tt][Yy] [Dd][Rr][Aa][Ff][Tt]\|Annotation-Directed Improvement\|Noncontiguous Finished\|Finished\)$" ,
-        severity info } ,
+        severity error } ,
       {
         field-name "Assembly Date" ,
         match-expression "^\(\(\(0\|1\|2\|3\)\(0\|1\|2\|3\|4\|5\|6\|7\|8\|9\)-
@@ -992,6 +992,64 @@ AR\|APR\|MAY\|JUN\|JUL\|AUG\|SEP\|OCT\|NOV\|DEC\)-\(19\|20\)\(0\|1\|2\|3\|4\|5
         field-name "coordinatePrecision" ,
         required FALSE } } ,
     require-order FALSE ,
-    allow-unlisted TRUE }
+    allow-unlisted TRUE } ,
+  {
+    prefix "##Taxonomic-Update-Statistics-START##" ,
+    fields {
+      {
+        field-name "This Genome (query)" ,
+        required TRUE } ,
+      { 
+        field-name "Current Name" ,
+        required TRUE } ,
+      {
+        field-name "Previous Name" ,
+        required TRUE } ,
+      {
+        field-name "Date Updated" ,
+        required TRUE } ,
+      {
+        field-name "Analysis Type" ,
+        required TRUE } ,
+      {
+        field-name "Analysis 1 (A1)" ,
+        required TRUE } ,
+      {
+        field-name "A1 Genome (subject)" ,
+        required TRUE } ,
+      {
+        field-name "A1 Name" ,
+        required TRUE } ,
+      {
+        field-name "A1 ANI" ,
+        required TRUE } ,
+      {
+        field-name "A1 Query Coverage" ,
+        required TRUE } ,
+      {
+        field-name "A1 Subject Coverage" ,
+        required TRUE } ,
+      {
+        field-name "Analysis 2 (A2)" ,
+        required TRUE } ,
+      {
+        field-name "A2 Genome (subject)" ,
+        required TRUE } ,
+      {
+        field-name "A2 Name" ,
+        required TRUE } ,
+      {
+        field-name "A2 ANI" ,
+        required TRUE } ,
+      {
+        field-name "A2 Query Coverage" ,
+        required TRUE } ,
+      {
+        field-name "A2 Subject Coverage" ,
+        required TRUE }
+    } ,
+    require-order TRUE ,
+    allow-unlisted FALSE 
+  }
 }
 
diff --git a/c++/src/objmgr/Makefile.objmgr.lib b/c++/src/objmgr/Makefile.objmgr.lib
index 26ebe3b..5b7f8f5 100644
--- a/c++/src/objmgr/Makefile.objmgr.lib
+++ b/c++/src/objmgr/Makefile.objmgr.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.objmgr.lib 427420 2014-02-20 13:35:49Z gouriano $
+# $Id: Makefile.objmgr.lib 496835 2016-03-31 15:49:15Z ivanov $
 
 # Build library "xobjmgr"
 #################################
@@ -23,7 +23,8 @@ SRC = seq_table_setters seq_table_info seq_annot_info table_field \
       tse_assigner scope_transaction scope_transaction_impl \
       edit_commands_impl bioseq_edit_commands seq_entry_edit_commands \
       bioseq_set_edit_commands edit_saver unsupp_editsaver \
-      edits_db_engine edits_db_saver annot_finder gc_assembly_parser
+      edits_db_engine edits_db_saver annot_finder gc_assembly_parser \
+      split_parser seq_id_sort
 
 LIB    = xobjmgr
 
diff --git a/c++/src/objmgr/annot_collector.cpp b/c++/src/objmgr/annot_collector.cpp
index 26e6ebc..966f31e 100644
--- a/c++/src/objmgr/annot_collector.cpp
+++ b/c++/src/objmgr/annot_collector.cpp
@@ -1,4 +1,4 @@
-/*  $Id: annot_collector.cpp 478075 2015-09-03 17:21:33Z ivanov $
+/*  $Id: annot_collector.cpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -159,7 +159,7 @@ CAnnotMapping_Info::GetMappedSeq_align(const CSeq_align& orig) const
             SafeCast(m_MappedObject.GetPointer()));
 
         CRef<CSeq_align> dst;
-        cvts.Convert(orig, &dst);
+        cvts.Convert(orig, dst);
 
         CRange<TSeqPos>& range = const_cast<CRange<TSeqPos>&>(m_TotalRange);
         range = range.GetEmpty();
@@ -1760,10 +1760,36 @@ void CAnnot_Collector::x_Initialize(const SAnnotSelector& selector,
 }
 
 
+bool CAnnot_Collector::x_CheckAdaptive(const CBioseq_Handle& bh) const
+{
+    int adaptive_flags = GetSelector().GetAdaptiveDepthFlags();
+    if ( !(adaptive_flags & SAnnotSelector::fAdaptive_ByPolicy) &&
+         (adaptive_flags & (SAnnotSelector::fAdaptive_ByTriggers |
+                            SAnnotSelector::fAdaptive_BySubtypes)) ) {
+        return false;
+    }
+    return bh && bh.GetFeatureFetchPolicy() == bh.eFeatureFetchPolicy_default;
+}
+
+
+bool CAnnot_Collector::x_CheckAdaptive(const CSeq_id_Handle& id) const
+{
+    int adaptive_flags = GetSelector().GetAdaptiveDepthFlags();
+    if ( !(adaptive_flags & SAnnotSelector::fAdaptive_ByPolicy) &&
+         (adaptive_flags & (SAnnotSelector::fAdaptive_ByTriggers |
+                            SAnnotSelector::fAdaptive_BySubtypes)) ) {
+        return false;
+    }
+    CBioseq_Handle bh = x_GetBioseqHandle(id);
+    return bh && bh.GetFeatureFetchPolicy() == bh.eFeatureFetchPolicy_default;
+}
+
+
 void CAnnot_Collector::x_SearchMaster(const CBioseq_Handle& bh,
                                       const CSeq_id_Handle& master_id,
                                       const CHandleRange& master_range)
 {
+    bool check_adaptive = x_CheckAdaptive(bh);
     if ( m_Selector->m_LimitObjectType == SAnnotSelector::eLimit_None ) {
         // any data source
         const CTSE_Handle& tse = bh.GetTSE_Handle();
@@ -1775,7 +1801,7 @@ void CAnnot_Collector::x_SearchMaster(const CBioseq_Handle& bh,
                 CConstRef<CSynonymsSet> syns = m_Scope->GetSynonyms(bh);
                 ITERATE(CSynonymsSet, syn_it, *syns) {
                     x_SearchTSE(tse, syns->GetSeq_id_Handle(syn_it),
-                                master_range, 0);
+                                master_range, 0, check_adaptive);
                     if ( x_NoMoreObjects() ) {
                         break;
                     }
@@ -1787,7 +1813,7 @@ void CAnnot_Collector::x_SearchMaster(const CBioseq_Handle& bh,
                 ITERATE ( CBioseq_Handle::TId, syn_it, syns ) {
                     if ( !only_gi || syn_it->IsGi() ) {
                         x_SearchTSE(tse, *syn_it,
-                                    master_range, 0);
+                                    master_range, 0, check_adaptive);
                         if ( x_NoMoreObjects() ) {
                             break;
                         }
@@ -1807,7 +1833,7 @@ void CAnnot_Collector::x_SearchMaster(const CBioseq_Handle& bh,
                 m_FromOtherTSE = tse_it->first != bh.GetTSE_Handle();
                 tse.AddUsedTSE(tse_it->first);
                 x_SearchTSE(tse_it->first, tse_it->second,
-                            master_range, 0);
+                            master_range, 0, check_adaptive);
                 if ( x_NoMoreObjects() ) {
                     break;
                 }
@@ -1829,13 +1855,13 @@ void CAnnot_Collector::x_SearchMaster(const CBioseq_Handle& bh,
                 }
                 if ( !syns ) {
                     x_SearchTSE(tse_it->second, master_id,
-                                master_range, 0);
+                                master_range, 0, check_adaptive);
                 }
                 else {
                     ITERATE(CSynonymsSet, syn_it, *syns) {
                         x_SearchTSE(tse_it->second,
                                     syns->GetSeq_id_Handle(syn_it),
-                                    master_range, 0);
+                                    master_range, 0, check_adaptive);
                         if ( x_NoMoreObjects() ) {
                             break;
                         }
@@ -1848,7 +1874,7 @@ void CAnnot_Collector::x_SearchMaster(const CBioseq_Handle& bh,
                 ITERATE ( CBioseq_Handle::TId, syn_it, syns ) {
                     if ( !only_gi || syn_it->IsGi() ) {
                         x_SearchTSE(tse_it->second, *syn_it,
-                                    master_range, 0);
+                                    master_range, 0, check_adaptive);
                         if ( x_NoMoreObjects() ) {
                             break;
                         }
@@ -1888,6 +1914,9 @@ void CAnnot_Collector::x_CollectSegments(const CBioseq_Handle& bh,
     if ( adaptive_flags & SAnnotSelector::fAdaptive_ByPolicy ) {
         sel.SetByFeaturePolicy();
     }
+    if ( adaptive_flags & SAnnotSelector::fAdaptive_BySeqClass) {
+        sel.SetBySequenceClass();
+    }
 
     const CRange<TSeqPos>& range = master_range.begin()->first;
     for ( CSeqMap_CI smit(bh, sel, range);
@@ -1933,6 +1962,9 @@ bool CAnnot_Collector::x_SearchSegments(const CBioseq_Handle& bh,
     if ( adaptive_flags & SAnnotSelector::fAdaptive_ByPolicy ) {
         sel.SetByFeaturePolicy();
     }
+    if ( adaptive_flags & SAnnotSelector::fAdaptive_BySeqClass) {
+        sel.SetBySequenceClass();
+    }
 
     bool has_more = false;
     const CRange<TSeqPos>& range = master_range.begin()->first;
@@ -1974,13 +2006,21 @@ CScope::EGetBioseqFlag sx_GetFlag(const SAnnotSelector& selector)
 }
 
 
+CBioseq_Handle CAnnot_Collector::x_GetBioseqHandle(const CSeq_id_Handle& id,
+                                                   bool top_level) const
+{
+    CScope::EGetBioseqFlag flag =
+        top_level? CScope::eGetBioseq_All: sx_GetFlag(GetSelector());
+    return m_Scope->GetBioseqHandle(id, flag);
+}
+
+
 void CAnnot_Collector::x_CollectSegments(const CHandleRangeMap& master_loc,
                                          int level,
                                          CSeq_loc_Conversion_Set& cvt_set)
 {
     ITERATE ( CHandleRangeMap::TLocMap, idit, master_loc.GetMap() ) {
-        CBioseq_Handle bh =
-            m_Scope->GetBioseqHandle(idit->first, sx_GetFlag(GetSelector()));
+        CBioseq_Handle bh = x_GetBioseqHandle(idit->first);
         if ( !bh ) {
             if (m_Selector->m_UnresolvedFlag == SAnnotSelector::eFailUnresolved) {
                 // resolve by Seq-id only
@@ -2016,6 +2056,9 @@ void CAnnot_Collector::x_CollectSegments(const CHandleRangeMap& master_loc,
         if ( adaptive_flags & SAnnotSelector::fAdaptive_ByPolicy ) {
             sel.SetByFeaturePolicy();
         }
+        if ( adaptive_flags & SAnnotSelector::fAdaptive_BySeqClass) {
+            sel.SetBySequenceClass();
+        }
 
         CHandleRange::TRange range = idit->second.GetOverlappingRange();
         for ( CSeqMap_CI smit(bh, sel, range);
@@ -2043,8 +2086,7 @@ bool CAnnot_Collector::x_SearchSegments(const CHandleRangeMap& master_loc,
 {
     bool has_more = false;
     ITERATE ( CHandleRangeMap::TLocMap, idit, master_loc.GetMap() ) {
-        CBioseq_Handle bh =
-            m_Scope->GetBioseqHandle(idit->first, sx_GetFlag(GetSelector()));
+        CBioseq_Handle bh = x_GetBioseqHandle(idit->first);
         if ( !bh ) {
             if (m_Selector->m_UnresolvedFlag == SAnnotSelector::eFailUnresolved) {
                 // resolve by Seq-id only
@@ -2085,6 +2127,9 @@ bool CAnnot_Collector::x_SearchSegments(const CHandleRangeMap& master_loc,
         if ( adaptive_flags & SAnnotSelector::fAdaptive_ByPolicy ) {
             sel.SetByFeaturePolicy();
         }
+        if ( adaptive_flags & SAnnotSelector::fAdaptive_BySeqClass) {
+            sel.SetBySequenceClass();
+        }
 
         CHandleRange::TRange range = idit->second.GetOverlappingRange();
         for ( CSeqMap_CI smit(bh, sel, range);
@@ -2440,10 +2485,11 @@ void CAnnot_Collector::x_GetTSE_Info(void)
 bool CAnnot_Collector::x_SearchTSE(const CTSE_Handle&    tseh,
                                    const CSeq_id_Handle& id,
                                    const CHandleRange&   hr,
-                                   CSeq_loc_Conversion*  cvt)
+                                   CSeq_loc_Conversion*  cvt,
+                                   bool check_adaptive)
 {
     if ( !m_Selector->m_SourceLoc ) {
-        return x_SearchTSE2(tseh, id, hr, cvt);
+        return x_SearchTSE2(tseh, id, hr, cvt, check_adaptive);
     }
     const CHandleRangeMap& src_hrm = *m_Selector->m_SourceLoc;
     CHandleRangeMap::const_iterator it = src_hrm.find(id);
@@ -2452,14 +2498,15 @@ bool CAnnot_Collector::x_SearchTSE(const CTSE_Handle&    tseh,
         return false;
     }
     CHandleRange hr2(hr, it->second.GetOverlappingRange());
-    return !hr2.Empty() && x_SearchTSE2(tseh, id, hr2, cvt);
+    return !hr2.Empty() && x_SearchTSE2(tseh, id, hr2, cvt, check_adaptive);
 }
 
 
 bool CAnnot_Collector::x_SearchTSE2(const CTSE_Handle&    tseh,
                                     const CSeq_id_Handle& id,
                                     const CHandleRange&   hr,
-                                    CSeq_loc_Conversion*  cvt)
+                                    CSeq_loc_Conversion*  cvt,
+                                    bool check_adaptive)
 {
     const CTSE_Info& tse = tseh.x_GetTSE_Info();
     bool found = false;
@@ -2476,8 +2523,9 @@ bool CAnnot_Collector::x_SearchTSE2(const CTSE_Handle&    tseh,
     //}
 
     SAnnotSelector::TAdaptiveDepthFlags adaptive_flags = 0;
-    if ( !m_Selector->GetExactDepth() ||
-         m_Selector->GetResolveDepth() == kMax_Int ) {
+    if ( check_adaptive &&
+         (!m_Selector->GetExactDepth() ||
+          m_Selector->GetResolveDepth() == kMax_Int) ) {
         adaptive_flags = m_Selector->GetAdaptiveDepthFlags();
     }
     if ( (adaptive_flags & SAnnotSelector::fAdaptive_ByTriggers) &&
@@ -2695,8 +2743,9 @@ void CAnnot_Collector::x_SearchRange(const CTSE_Handle&    tseh,
     typedef vector<const CTSE_Chunk_Info*> TStubs;
     typedef map<const CTSE_Split_Info*, CTSE_Split_Info::TChunkIds> TStubMap;
     TStubs stubs;
+    bool restart = false;
     do {
-        if ( !stubs.empty() ) {
+        if ( restart ) {
             _ASSERT(!enough);
 
             TStubMap stubmap;
@@ -2706,6 +2755,7 @@ void CAnnot_Collector::x_SearchRange(const CTSE_Handle&    tseh,
                     push_back(chunk.GetChunkId());
             }
             stubs.clear();
+            restart = false;
 
             // Release lock for tse update:
             guard.Release();
@@ -2770,11 +2820,12 @@ void CAnnot_Collector::x_SearchRange(const CTSE_Handle&    tseh,
 
                     if ( annot_info.IsChunkStub() ) {
                         const CTSE_Chunk_Info& chunk = annot_info.GetChunk_Info();
-                        if ( !chunk.NotLoaded() ) {
+                        if ( !chunk.NotLoaded() && !tse.x_DirtyAnnotIndex() ) {
                             // Skip chunk stub
                             continue;
                         }
-                        if ( stubs.empty() ) {
+                        if ( !restart ) {
+                            restart = true;
                             // New annot objects are to be loaded,
                             // so we'll need to restart scan of current range.
                             // Forget already found objects
@@ -2783,9 +2834,11 @@ void CAnnot_Collector::x_SearchRange(const CTSE_Handle&    tseh,
                             // Update start index for the new search
                             from_idx = index;
                         }
-                        stubs.push_back(&chunk);
+                        if ( chunk.NotLoaded() ) {
+                            stubs.push_back(&chunk);
+                        }
                     }
-                    if ( !stubs.empty() ) {
+                    if ( restart ) {
                         _ASSERT(!enough);
                         continue;
                     }
@@ -2867,7 +2920,7 @@ void CAnnot_Collector::x_SearchRange(const CTSE_Handle&    tseh,
                             x_SearchLoc(ref_rmap, &*locs_cvt, &tseh);
                         }
                         if ( x_NoMoreObjects() ) {
-                            _ASSERT(stubs.empty());
+                            _ASSERT(!restart);
                             enough = true;
                             break;
                         }
@@ -2935,21 +2988,21 @@ void CAnnot_Collector::x_SearchRange(const CTSE_Handle&    tseh,
                                     aoit->second.m_AnnotLocationIndex);
                     }
                     if ( x_NoMoreObjects() ) {
-                        _ASSERT(stubs.empty());
+                        _ASSERT(!restart);
                         enough = true;
                         break;
                     }
                 }
                 if ( enough ) {
-                    _ASSERT(stubs.empty());
+                    _ASSERT(!restart);
                     break;
                 }
-                if ( !stubs.empty() ) {
+                if ( restart ) {
                     _ASSERT(!enough);
                     continue;
                 }
             }
-            if ( !stubs.empty() ) {
+            if ( restart ) {
                 _ASSERT(!enough);
                 continue;
             }
@@ -2960,15 +3013,15 @@ void CAnnot_Collector::x_SearchRange(const CTSE_Handle&    tseh,
                                 m_AnnotSet.end());
             }
             if ( enough ) {
-                _ASSERT(stubs.empty());
+                _ASSERT(!restart);
                 break;
             }
         }
         if ( enough ) {
-            _ASSERT(stubs.empty());
+            _ASSERT(!restart);
             break;
         }
-    } while ( !stubs.empty() );
+    } while ( restart );
 }
 
 
@@ -2985,9 +3038,7 @@ bool CAnnot_Collector::x_SearchLoc(const CHandleRangeMap& loc,
         if ( m_Selector->m_LimitObjectType == SAnnotSelector::eLimit_None ) {
             // any data source
             const CTSE_Handle* tse = 0;
-            CScope::EGetBioseqFlag flag =
-                top_level? CScope::eGetBioseq_All: sx_GetFlag(GetSelector());
-            CBioseq_Handle bh = m_Scope->GetBioseqHandle(idit->first, flag);
+            CBioseq_Handle bh = x_GetBioseqHandle(idit->first, top_level);
             if ( !bh ) {
                 if ( m_Selector->m_UnresolvedFlag ==
                     SAnnotSelector::eFailUnresolved ) {
@@ -3006,6 +3057,7 @@ bool CAnnot_Collector::x_SearchLoc(const CHandleRangeMap& loc,
                     using_tse->AddUsedTSE(*tse);
                 }
             }
+            bool check_adaptive = x_CheckAdaptive(bh);
             if ( m_Selector->m_ExcludeExternal ) {
                 if ( !bh ) {
                     // no sequence tse
@@ -3020,7 +3072,7 @@ bool CAnnot_Collector::x_SearchLoc(const CHandleRangeMap& loc,
                     ITERATE(CSynonymsSet, syn_it, *syns) {
                         found |= x_SearchTSE(*tse,
                                              syns->GetSeq_id_Handle(syn_it),
-                                             idit->second, cvt);
+                                             idit->second, cvt, check_adaptive);
                         if ( x_NoMoreObjects() ) {
                             break;
                         }
@@ -3032,7 +3084,7 @@ bool CAnnot_Collector::x_SearchLoc(const CHandleRangeMap& loc,
                     ITERATE ( CBioseq_Handle::TId, syn_it, syns ) {
                         if ( !only_gi || syn_it->IsGi() ) {
                             found |= x_SearchTSE(*tse, *syn_it,
-                                                 idit->second, cvt);
+                                                 idit->second, cvt, check_adaptive);
                             if ( x_NoMoreObjects() ) {
                                 break;
                             }
@@ -3055,7 +3107,7 @@ bool CAnnot_Collector::x_SearchLoc(const CHandleRangeMap& loc,
                     }
                     m_FromOtherTSE = !bh || tse_it->first != bh.GetTSE_Handle();
                     found |= x_SearchTSE(tse_it->first, tse_it->second,
-                                         idit->second, cvt);
+                                         idit->second, cvt, check_adaptive);
                     if ( x_NoMoreObjects() ) {
                         break;
                     }
@@ -3068,15 +3120,17 @@ bool CAnnot_Collector::x_SearchLoc(const CHandleRangeMap& loc,
                   m_Selector->m_LimitObject ) {
             // external annotations only
             m_FromOtherTSE = true;
+            bool check_adaptive = x_CheckAdaptive(idit->first);
             ITERATE ( TTSE_LockMap, tse_it, m_TSE_LockMap ) {
                 const CTSE_Info& tse_info = *tse_it->first;
                 tse_info.UpdateAnnotIndex();
                 found |= x_SearchTSE(tse_it->second, idit->first,
-                                     idit->second, cvt);
+                                     idit->second, cvt, check_adaptive);
             }
         }
         else {
             // Search in the limit objects
+            bool check_adaptive = x_CheckAdaptive(idit->first);
             CConstRef<CSynonymsSet> syns;
             bool syns_initialized = false;
             ITERATE ( TTSE_LockMap, tse_it, m_TSE_LockMap ) {
@@ -3090,13 +3144,13 @@ bool CAnnot_Collector::x_SearchLoc(const CHandleRangeMap& loc,
                     }
                     if ( !syns ) {
                         found |= x_SearchTSE(tse_it->second, idit->first,
-                                             idit->second, cvt);
+                                             idit->second, cvt, check_adaptive);
                     }
                     else {
                         ITERATE(CSynonymsSet, syn_it, *syns) {
                             found |= x_SearchTSE(tse_it->second,
                                                  syns->GetSeq_id_Handle(syn_it),
-                                                 idit->second, cvt);
+                                                 idit->second, cvt, check_adaptive);
                             if ( x_NoMoreObjects() ) {
                                 break;
                             }
@@ -3110,7 +3164,7 @@ bool CAnnot_Collector::x_SearchLoc(const CHandleRangeMap& loc,
                     ITERATE ( CBioseq_Handle::TId, syn_it, syns ) {
                         if ( !only_gi || syn_it->IsGi() ) {
                             found |= x_SearchTSE(tse_it->second, *syn_it,
-                                                 idit->second, cvt);
+                                                 idit->second, cvt, check_adaptive);
                             if ( x_NoMoreObjects() ) {
                                 break;
                             }
diff --git a/c++/src/objmgr/annot_object.cpp b/c++/src/objmgr/annot_object.cpp
index f649b98..5774d23 100644
--- a/c++/src/objmgr/annot_object.cpp
+++ b/c++/src/objmgr/annot_object.cpp
@@ -1,4 +1,4 @@
-/*  $Id: annot_object.cpp 472371 2015-07-09 14:13:53Z ivanov $
+/*  $Id: annot_object.cpp 470193 2015-06-11 19:51:07Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objmgr/bioseq_base_info.cpp b/c++/src/objmgr/bioseq_base_info.cpp
index 4f6f544..e12771e 100644
--- a/c++/src/objmgr/bioseq_base_info.cpp
+++ b/c++/src/objmgr/bioseq_base_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: bioseq_base_info.cpp 465027 2015-04-16 13:18:40Z vasilche $
+/*  $Id: bioseq_base_info.cpp 489127 2016-01-08 16:52:37Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -203,7 +203,7 @@ void CBioseq_Base_Info::x_DoUpdate(TNeedUpdateFlags flags)
     }
     if ( flags & (fNeedUpdate_annot|fNeedUpdate_children) ) {
         x_LoadChunks(m_AnnotChunks);
-        if ( IsSetAnnot() ) {
+        if ( IsSetAnnot() && !m_Annot.empty() ) {
             _ASSERT(m_ObjAnnot && m_ObjAnnot->size() == m_Annot.size());
             TObjAnnot::iterator it2 = m_ObjAnnot->begin();
             NON_CONST_ITERATE ( TAnnot, it, m_Annot ) {
diff --git a/c++/src/objmgr/bioseq_handle.cpp b/c++/src/objmgr/bioseq_handle.cpp
index 89525a8..d6caeaa 100644
--- a/c++/src/objmgr/bioseq_handle.cpp
+++ b/c++/src/objmgr/bioseq_handle.cpp
@@ -1,4 +1,4 @@
-/*  $Id: bioseq_handle.cpp 474909 2015-08-03 10:48:42Z ivanov $
+/*  $Id: bioseq_handle.cpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1168,6 +1168,13 @@ CBioseq_Handle::GetFeatureFetchPolicy(void) const
 }
 
 
+CBioseq_Handle::ESequenceClass
+CBioseq_Handle::GetSequenceClass(void) const
+{
+    return ESequenceClass(x_GetInfo().GetSequenceClass());
+}
+
+
 // end of Bioseq members
 /////////////////////////////////////////////////////////////////////////////
 
diff --git a/c++/src/objmgr/bioseq_info.cpp b/c++/src/objmgr/bioseq_info.cpp
index 22c3619..e955c2a 100644
--- a/c++/src/objmgr/bioseq_info.cpp
+++ b/c++/src/objmgr/bioseq_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: bioseq_info.cpp 444528 2014-08-25 18:33:18Z vasilche $
+/*  $Id: bioseq_info.cpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -260,6 +260,9 @@ int CBioseq_Info::GetFeatureFetchPolicy(void) const
                     if ( str == "OnlyNearFeatures" ) {
                         policy = CBioseq_Handle::eFeatureFetchPolicy_only_near;
                     }
+                    else if ( str == "AllowFarFeatures" ) {
+                        policy = CBioseq_Handle::eFeatureFetchPolicy_allow_far;
+                    }
                     else {
                         policy = CBioseq_Handle::eFeatureFetchPolicy_default;
                     }
@@ -1253,5 +1256,27 @@ int CBioseq_Info::GetTaxId(void) const
 }
 
 
+int CBioseq_Info::GetSequenceClass(void) const
+{
+    ITERATE ( TId, it, GetId() ) {
+        switch ( it->Which() ) {
+        case CSeq_id::e_Genbank:
+        case CSeq_id::e_Embl:
+        case CSeq_id::e_Ddbj:
+            return CBioseq_Handle::eSequenceClass_INSD;
+        case CSeq_id::e_Other:
+            return CBioseq_Handle::eSequenceClass_REFSEQ;
+        case CSeq_id::e_Tpg:
+        case CSeq_id::e_Tpe:
+        case CSeq_id::e_Tpd:
+            return CBioseq_Handle::eSequenceClass_TPA;
+        default:
+            break;
+        }
+    }
+    return CBioseq_Handle::eSequenceClass_none;
+}
+
+
 END_SCOPE(objects)
 END_NCBI_SCOPE
diff --git a/c++/src/objmgr/data_loader.cpp b/c++/src/objmgr/data_loader.cpp
index 9d66c1f..f8fcd16 100644
--- a/c++/src/objmgr/data_loader.cpp
+++ b/c++/src/objmgr/data_loader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: data_loader.cpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: data_loader.cpp 498421 2016-04-15 18:44:37Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -230,69 +230,183 @@ void CDataLoader::GetIds(const CSeq_id_Handle& idh, TIds& ids)
 }
 
 
+bool CDataLoader::SequenceExists(const CSeq_id_Handle& idh)
+{
+    // check if sequence exists
+    TIds ids;
+    GetIds(idh, ids);
+    return !ids.empty();
+}
+
+
 CSeq_id_Handle CDataLoader::GetAccVer(const CSeq_id_Handle& idh)
 {
+    // default implementation based on GetIds();
     TIds ids;
     GetIds(idh, ids);
-    return CScope::x_GetAccVer(ids);
+    if ( ids.empty() ) {
+        NCBI_THROW(CLoaderException, eNotFound,
+                   "CDataLoader::GetAccVer() sequence not found");
+    }
+    CSeq_id_Handle acc = CScope::x_GetAccVer(ids);
+    if ( !acc ) {
+        NCBI_THROW(CLoaderException, eNoData,
+                   "CDataLoader::GetAccVer() sequence doesn't have accession");
+    }
+    return acc;
+}
+
+
+CDataLoader::SAccVerFound
+CDataLoader::GetAccVerFound(const CSeq_id_Handle& idh)
+{
+    // default implementation based on GetAccVer() and GetIds()
+    SAccVerFound ret;
+    try {
+        ret.acc_ver = GetAccVer(idh);
+        ret.sequence_found = ret.acc_ver || SequenceExists(idh);
+    }
+    catch ( CLoaderException& exc ) {
+        if ( exc.GetErrCode() == exc.eNotFound ) {
+            // no sequence
+        }
+        else if ( exc.GetErrCode() == exc.eNoData ) {
+            // sequence is known, but there is no accession
+            ret.sequence_found = true;
+        }
+        else {
+            // problem
+            throw;
+        }
+    }
+    return ret;
 }
 
 
 TGi CDataLoader::GetGi(const CSeq_id_Handle& idh)
 {
+    // default implementation based on GetIds();
     TIds ids;
     GetIds(idh, ids);
-    return CScope::x_GetGi(ids);
+    if ( ids.empty() ) {
+        NCBI_THROW(CLoaderException, eNotFound,
+                   "CDataLoader::GetGi() sequence not found");
+    }
+    TGi gi = CScope::x_GetGi(ids);
+    if ( gi == ZERO_GI ) {
+        NCBI_THROW(CLoaderException, eNoData,
+                   "CDataLoader::GetGi() sequence doesn't have GI");
+    }
+    return gi;
+}
+
+
+CDataLoader::SGiFound CDataLoader::GetGiFound(const CSeq_id_Handle& idh)
+{
+    // default implementation based on GetGi() and GetIds()
+    SGiFound ret;
+    try {
+        ret.gi = GetGi(idh);
+        ret.sequence_found = ret.gi || SequenceExists(idh);
+    }
+    catch ( CLoaderException& exc ) {
+        if ( exc.GetErrCode() == exc.eNotFound ) {
+            // no sequence
+        }
+        else if ( exc.GetErrCode() == exc.eNoData ) {
+            // sequence is known, but there is no GI
+            ret.sequence_found = true;
+        }
+        else {
+            // problem
+            throw;
+        }
+    }
+    return ret;
 }
 
 
 string CDataLoader::GetLabel(const CSeq_id_Handle& idh)
 {
+    // default implementation based on GetIds();
     TIds ids;
     GetIds(idh, ids);
+    if ( ids.empty() ) {
+        return string();
+    }
     return objects::GetLabel(ids);
 }
 
 
 int CDataLoader::GetTaxId(const CSeq_id_Handle& idh)
 {
-    int ret = -1;
+    // default implementation based on GetRecordsNoBlobState();
     TTSE_LockSet locks = GetRecordsNoBlobState(idh, eBioseqCore);
     ITERATE(TTSE_LockSet, it, locks) {
         CConstRef<CBioseq_Info> bs_info = (*it)->FindMatchingBioseq(idh);
         if ( bs_info ) {
-            ret = bs_info->GetTaxId();
-            break;
+            return bs_info->GetTaxId();
         }
     }
-    return ret;
+    return -1;
 }
 
 
 TSeqPos CDataLoader::GetSequenceLength(const CSeq_id_Handle& idh)
 {
-    TSeqPos ret = kInvalidSeqPos;
+    // default implementation based on GetRecordsNoBlobState()
     TTSE_LockSet locks = GetRecordsNoBlobState(idh, eBioseqCore);
     ITERATE(TTSE_LockSet, it, locks) {
         CConstRef<CBioseq_Info> bs_info = (*it)->FindMatchingBioseq(idh);
         if ( bs_info ) {
-            ret = bs_info->GetBioseqLength();
-            break;
+            return bs_info->GetBioseqLength();
         }
     }
-    return ret;
+    return kInvalidSeqPos;
 }
 
 
 CSeq_inst::TMol CDataLoader::GetSequenceType(const CSeq_id_Handle& idh)
 {
-    CSeq_inst::TMol ret = CSeq_inst::eMol_not_set;
+    // default implementation based on GetRecordsNoBlobState()
     TTSE_LockSet locks = GetRecordsNoBlobState(idh, eBioseqCore);
     ITERATE(TTSE_LockSet, it, locks) {
         CConstRef<CBioseq_Info> bs_info = (*it)->FindMatchingBioseq(idh);
         if ( bs_info ) {
-            ret = bs_info->GetInst_Mol();
-            break;
+            CSeq_inst::TMol type = bs_info->GetInst_Mol();
+            if ( type == CSeq_inst::eMol_not_set ) {
+                NCBI_THROW(CLoaderException, eNoData,
+                           "CDataLoader::GetSequenceType() type not set");
+            }
+            return type;
+        }
+    }
+    NCBI_THROW(CLoaderException, eNotFound,
+               "CDataLoader::GetSequenceType() sequence not found");
+}
+
+
+CDataLoader::STypeFound
+CDataLoader::GetSequenceTypeFound(const CSeq_id_Handle& idh)
+{
+    // default implementation based on GetSequenceType() and GetIds()
+    STypeFound ret;
+    try {
+        ret.type = GetSequenceType(idh);
+        ret.sequence_found =
+            ret.type != CSeq_inst::eMol_not_set || SequenceExists(idh);
+    }
+    catch ( CLoaderException& exc ) {
+        if ( exc.GetErrCode() == exc.eNotFound ) {
+            // no sequence
+        }
+        else if ( exc.GetErrCode() == exc.eNoData ) {
+            // sequence is known, but there is no type
+            ret.sequence_found = true;
+        }
+        else {
+            // problem
+            throw;
         }
     }
     return ret;
@@ -319,7 +433,46 @@ int CDataLoader::GetSequenceState(const CSeq_id_Handle& idh)
 
 int CDataLoader::GetSequenceHash(const CSeq_id_Handle& idh)
 {
-    return 0;
+    if ( SequenceExists(idh) ) {
+        NCBI_THROW(CLoaderException, eNoData,
+                   "CDataLoader::GetSequenceHash() sequence hash not set");
+    }
+    NCBI_THROW(CLoaderException, eNotFound,
+               "CDataLoader::GetSequenceHash() sequence not found");
+}
+
+
+CDataLoader::SHashFound
+CDataLoader::GetSequenceHashFound(const CSeq_id_Handle& idh)
+{
+    // default implementation based on GetSequenceHash() and GetIds()
+    SHashFound ret;
+    try {
+        ret.hash = GetSequenceHash(idh);
+        if ( !ret.hash ) {
+            // hash = 0, we don't know what causes it:
+            // absence of sequence, unknown hash, or the hash happens to be 0.
+            ret.sequence_found = SequenceExists(idh);
+        }
+        else {
+            ret.sequence_found = true;
+            ret.hash_known = true;
+        }
+    }
+    catch ( CLoaderException& exc ) {
+        if ( exc.GetErrCode() == exc.eNotFound ) {
+            // no sequence found
+        }
+        else if ( exc.GetErrCode() == exc.eNoData ) {
+            // sequence exists
+            ret.sequence_found = true;
+        }
+        else {
+            // problem
+            throw;
+        }
+    }
+    return ret;
 }
 
 
@@ -333,10 +486,9 @@ void CDataLoader::GetAccVers(const TIds& ids, TLoaded& loaded, TIds& ret)
         if ( loaded[i] ) {
             continue;
         }
-        seq_ids.clear();
-        GetIds(ids[i], seq_ids);
-        if ( !seq_ids.empty() ) {
-            ret[i] = CScope::x_GetAccVer(seq_ids);
+        SAccVerFound data = GetAccVerFound(ids[i]);
+        if ( data.sequence_found ) {
+            ret[i] = data.acc_ver;
             loaded[i] = true;
         }
     }
@@ -353,10 +505,9 @@ void CDataLoader::GetGis(const TIds& ids, TLoaded& loaded, TGis& ret)
         if ( loaded[i] ) {
             continue;
         }
-        seq_ids.clear();
-        GetIds(ids[i], seq_ids);
-        if ( !seq_ids.empty() ) {
-            ret[i] = CScope::x_GetGi(seq_ids);
+        SGiFound data = GetGiFound(ids[i]);
+        if ( data.sequence_found ) {
+            ret[i] = data.gi;
             loaded[i] = true;
         }
     }
@@ -368,15 +519,13 @@ void CDataLoader::GetLabels(const TIds& ids, TLoaded& loaded, TLabels& ret)
     size_t count = ids.size();
     _ASSERT(ids.size() == loaded.size());
     _ASSERT(ids.size() == ret.size());
-    TIds seq_ids;
     for ( size_t i = 0; i < count; ++i ) {
         if ( loaded[i] ) {
             continue;
         }
-        seq_ids.clear();
-        GetIds(ids[i], seq_ids);
-        if ( !seq_ids.empty() ) {
-            ret[i] = objects::GetLabel(seq_ids);
+        string label = GetLabel(ids[i]);
+        if ( !label.empty() ) {
+            ret[i] = label;
             loaded[i] = true;
         }
     }
@@ -393,15 +542,10 @@ void CDataLoader::GetTaxIds(const TIds& ids, TLoaded& loaded, TTaxIds& ret)
             continue;
         }
         
-        TTSE_LockSet locks = GetRecordsNoBlobState(ids[i], eBioseqCore);
-        ITERATE(TTSE_LockSet, it, locks) {
-            CConstRef<CBioseq_Info> bs_info =
-                (*it)->FindMatchingBioseq(ids[i]);
-            if ( bs_info ) {
-                ret[i] = bs_info->GetTaxId();
-                loaded[i] = true;
-                break;
-            }
+        int taxid = GetTaxId(ids[i]);
+        if ( taxid != -1 ) {
+            ret[i] = taxid;
+            loaded[i] = true;
         }
     }
 }
@@ -417,16 +561,11 @@ void CDataLoader::GetSequenceLengths(const TIds& ids, TLoaded& loaded,
         if ( loaded[i] ) {
             continue;
         }
-        
-        TTSE_LockSet locks = GetRecordsNoBlobState(ids[i], eBioseqCore);
-        ITERATE(TTSE_LockSet, it, locks) {
-            CConstRef<CBioseq_Info> bs_info =
-                (*it)->FindMatchingBioseq(ids[i]);
-            if ( bs_info ) {
-                ret[i] = bs_info->GetBioseqLength();
-                loaded[i] = true;
-                break;
-            }
+
+        TSeqPos len = GetSequenceLength(ids[i]);
+        if ( len != kInvalidSeqPos ) {
+            ret[i] = len;
+            loaded[i] = true;
         }
     }
 }
@@ -442,16 +581,11 @@ void CDataLoader::GetSequenceTypes(const TIds& ids, TLoaded& loaded,
         if ( loaded[i] ) {
             continue;
         }
-        
-        TTSE_LockSet locks = GetRecordsNoBlobState(ids[i], eBioseqCore);
-        ITERATE(TTSE_LockSet, it, locks) {
-            CConstRef<CBioseq_Info> bs_info =
-                (*it)->FindMatchingBioseq(ids[i]);
-            if ( bs_info ) {
-                ret[i] = bs_info->GetInst_Mol();
-                loaded[i] = true;
-                break;
-            }
+
+        STypeFound data = GetSequenceTypeFound(ids[i]);
+        if ( data.sequence_found ) {
+            ret[i] = data.type;
+            loaded[i] = true;
         }
     }
 }
@@ -481,8 +615,23 @@ void CDataLoader::GetSequenceStates(const TIds& ids, TLoaded& loaded,
 
 
 void CDataLoader::GetSequenceHashes(const TIds& ids, TLoaded& loaded,
-                                    TSequenceHashes& ret)
+                                    TSequenceHashes& ret, THashKnown& known)
 {
+    size_t count = ids.size();
+    _ASSERT(ids.size() == loaded.size());
+    _ASSERT(ids.size() == ret.size());
+    for ( size_t i = 0; i < count; ++i ) {
+        if ( loaded[i] ) {
+            continue;
+        }
+
+        SHashFound data = GetSequenceHashFound(ids[i]);
+        if ( data.sequence_found ) {
+            ret[i] = data.hash;
+            loaded[i] = true;
+            known[i] = data.hash_known;
+        }
+    }
 }
 
 
@@ -687,6 +836,13 @@ CDataLoader::TEditSaver CDataLoader::GetEditSaver() const
     return TEditSaver();
 }
 
+
+CObjectManager::TPriority CDataLoader::GetDefaultPriority(void) const
+{
+    return CObjectManager::kPriority_Loader;
+}
+
+
 /////////////////////////////////////////////////////////////////////////////
 // CBlobId
 
diff --git a/c++/src/objmgr/data_source.cpp b/c++/src/objmgr/data_source.cpp
index 46a8510..e24336c 100644
--- a/c++/src/objmgr/data_source.cpp
+++ b/c++/src/objmgr/data_source.cpp
@@ -1,4 +1,4 @@
-/*  $Id: data_source.cpp 467006 2015-05-08 11:59:52Z vasilche $
+/*  $Id: data_source.cpp 498421 2016-04-15 18:44:37Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -88,7 +88,7 @@ NCBI_DEFINE_ERR_SUBCODE_X(3);
 BEGIN_SCOPE(objects)
 
 CDataSource::CDataSource(void)
-    : m_DefaultPriority(9),
+    : m_DefaultPriority(CObjectManager::kPriority_Entry),
       m_Blob_Cache_Size(0)
 {
 }
@@ -96,7 +96,7 @@ CDataSource::CDataSource(void)
 
 CDataSource::CDataSource(CDataLoader& loader)
     : m_Loader(&loader),
-      m_DefaultPriority(99),
+      m_DefaultPriority(loader.GetDefaultPriority()),
       m_Blob_Cache_Size(0)
 {
     m_Loader->SetTargetDataSource(*this);
@@ -105,7 +105,7 @@ CDataSource::CDataSource(CDataLoader& loader)
 
 CDataSource::CDataSource(const CObject& shared_object, const CSeq_entry& entry)
     : m_SharedObject(&shared_object),
-      m_DefaultPriority(9),
+      m_DefaultPriority(CObjectManager::kPriority_Entry),
       m_Blob_Cache_Size(0)
 {
     CTSE_Lock tse_lock = AddTSE(const_cast<CSeq_entry&>(entry));
@@ -1212,31 +1212,33 @@ void CDataSource::GetIds(const CSeq_id_Handle& idh, TIds& ids)
 }
 
 
-CSeq_id_Handle CDataSource::GetAccVer(const CSeq_id_Handle& idh)
+CDataSource::SAccVerFound CDataSource::GetAccVer(const CSeq_id_Handle& idh)
 {
-    CSeq_id_Handle ret;
+    SAccVerFound ret;
     TTSE_LockSet locks;
     SSeqMatch_DS match = x_GetSeqMatch(idh, locks);
     if ( match ) {
-        ret = CScope::x_GetAccVer(match.m_Bioseq->GetId());
+        ret.acc_ver = CScope::x_GetAccVer(match.m_Bioseq->GetId());
+        ret.sequence_found = true;
     }
     else if ( m_Loader ) {
-        ret = m_Loader->GetAccVer(idh);
+        ret = m_Loader->GetAccVerFound(idh);
     }
     return ret;
 }
 
 
-TGi CDataSource::GetGi(const CSeq_id_Handle& idh)
+CDataSource::SGiFound CDataSource::GetGi(const CSeq_id_Handle& idh)
 {
-    TGi ret = ZERO_GI;
+    SGiFound ret;
     TTSE_LockSet locks;
     SSeqMatch_DS match = x_GetSeqMatch(idh, locks);
     if ( match ) {
-        ret = CScope::x_GetGi(match.m_Bioseq->GetId());
+        ret.gi = CScope::x_GetGi(match.m_Bioseq->GetId());
+        ret.sequence_found = true;
     }
     else if ( m_Loader ) {
-        ret = m_Loader->GetGi(idh);
+        ret = m_Loader->GetGiFound(idh);
     }
     return ret;
 }
@@ -1287,16 +1289,18 @@ TSeqPos CDataSource::GetSequenceLength(const CSeq_id_Handle& idh)
 }
 
 
-CSeq_inst::TMol CDataSource::GetSequenceType(const CSeq_id_Handle& idh)
+CDataSource::STypeFound
+CDataSource::GetSequenceType(const CSeq_id_Handle& idh)
 {
-    CSeq_inst::TMol ret = CSeq_inst::eMol_not_set;
+    STypeFound ret;
     TTSE_LockSet locks;
     SSeqMatch_DS match = x_GetSeqMatch(idh, locks);
     if ( match ) {
-        ret = match.m_Bioseq->GetInst_Mol();
+        ret.type = match.m_Bioseq->GetInst_Mol();
+        ret.sequence_found = true;
     }
     else if ( m_Loader ) {
-        ret = m_Loader->GetSequenceType(idh);
+        ret = m_Loader->GetSequenceTypeFound(idh);
     }
     return ret;
 }
@@ -1495,17 +1499,22 @@ void CDataSource::GetSequenceStates(const TIds& ids, TLoaded& loaded,
 }
 
 
-int CDataSource::GetSequenceHash(const CSeq_id_Handle& idh)
+CDataSource::SHashFound
+CDataSource::GetSequenceHash(const CSeq_id_Handle& idh)
 {
-    return m_Loader? m_Loader->GetSequenceHash(idh): 0;
+    SHashFound ret;
+    if ( m_Loader ) {
+        ret = m_Loader->GetSequenceHashFound(idh);
+    }
+    return ret;
 }
 
 
 void CDataSource::GetSequenceHashes(const TIds& ids, TLoaded& loaded,
-                                    TSequenceHashes& ret)
+                                    TSequenceHashes& ret, THashKnown& known)
 {
     if ( m_Loader ) {
-        m_Loader->GetSequenceHashes(ids, loaded, ret);
+        m_Loader->GetSequenceHashes(ids, loaded, ret, known);
     }
 }
 
diff --git a/c++/src/objmgr/gc_assembly_parser.cpp b/c++/src/objmgr/gc_assembly_parser.cpp
index 03138db..1b413af 100644
--- a/c++/src/objmgr/gc_assembly_parser.cpp
+++ b/c++/src/objmgr/gc_assembly_parser.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gc_assembly_parser.cpp 479618 2015-09-22 15:42:58Z ivanov $
+/*  $Id: gc_assembly_parser.cpp 495032 2016-03-14 14:26:36Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -85,6 +85,7 @@ void CGC_Assembly_Parser::x_InitSeq_entry(CRef<CSeq_entry> entry,
 {
     entry->SetSet().SetLevel(parent ? parent->GetSet().GetLevel() + 1 : 1);
     entry->SetSet().SetClass(CBioseq_set::eClass_segset);
+    entry->SetSet().SetSeq_set(); // mandatory member, must be initialized
     if (parent) {
         parent->SetSet().SetSeq_set().push_back(entry);
     }
@@ -200,6 +201,13 @@ void CGC_Assembly_Parser::x_ParseGCSequence(const CGC_Sequence& gc_seq,
             }
         }
     }
+    // Same as above, but structure is missing and sequences contain just one item.
+    else if (gc_seq.IsSetSequences()  &&  gc_seq.GetSequences().size() == 1) {
+        const CGC_TaggedSequences& tagged_seq = *gc_seq.GetSequences().front();
+        if (tagged_seq.GetSeqs().size() == 1) {
+            struct_syn = CSeq_id_Handle::GetHandle(tagged_seq.GetSeqs().front()->GetSeq_id());
+        }
+    }
 
     // Add synonyms if any.
     TSeqIds synonyms;
diff --git a/c++/src/objmgr/handle_range_map.cpp b/c++/src/objmgr/handle_range_map.cpp
index ef9b1b4..17a842e 100644
--- a/c++/src/objmgr/handle_range_map.cpp
+++ b/c++/src/objmgr/handle_range_map.cpp
@@ -1,4 +1,4 @@
-/*  $Id: handle_range_map.cpp 472372 2015-07-09 14:14:09Z ivanov $
+/*  $Id: handle_range_map.cpp 470703 2015-06-18 12:29:55Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objmgr/objmgr_exception.cpp b/c++/src/objmgr/objmgr_exception.cpp
index 98a2e6b..f376c60 100644
--- a/c++/src/objmgr/objmgr_exception.cpp
+++ b/c++/src/objmgr/objmgr_exception.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objmgr_exception.cpp 435595 2014-05-19 12:06:04Z vasilche $
+/*  $Id: objmgr_exception.cpp 494477 2016-03-07 19:25:35Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -51,6 +51,7 @@ const char* CObjMgrException::GetErrCodeString(void) const
     case eInvalidHandle:    return "eInvalidHandle";
     case eLockedData:       return "eLockedData";
     case eTransaction:      return "eTransaction";
+    case eMissingData:      return "eMissingData";
     case eOtherError:       return "eOtherError";
     default:                return CException::GetErrCodeString();
     }
@@ -111,6 +112,7 @@ const char* CLoaderException::GetErrCodeString(void) const
     case eOtherError:       return "eOtherError";
     case eRepeatAgain:      return "eRepeatAgain";
     case eBadConfig:        return "eBadConfig";
+    case eNotFound:         return "eNotFound";
     default:                return CException::GetErrCodeString();
     }
 }
diff --git a/c++/src/objmgr/scope.cpp b/c++/src/objmgr/scope.cpp
index 4567235..c233c51 100644
--- a/c++/src/objmgr/scope.cpp
+++ b/c++/src/objmgr/scope.cpp
@@ -1,4 +1,4 @@
-/*  $Id: scope.cpp 445270 2014-09-03 13:27:28Z vasilche $
+/*  $Id: scope.cpp 491606 2016-02-08 11:59:50Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -365,27 +365,27 @@ void CScope::RemoveSeq_annot(const CSeq_annot_Handle& annot)
 }
 
 
-CScope::TIds CScope::GetIds(const CSeq_id& id)
+CScope::TIds CScope::GetIds(const CSeq_id& id, TGetFlags flags)
 {
-    return GetIds(CSeq_id_Handle::GetHandle(id));
+    return GetIds(CSeq_id_Handle::GetHandle(id), flags);
 }
 
 
-CScope::TIds CScope::GetIds(const CSeq_id_Handle& idh)
+CScope::TIds CScope::GetIds(const CSeq_id_Handle& idh, TGetFlags flags)
 {
-    return m_Impl->GetIds(idh);
+    return m_Impl->GetIds(idh, flags);
 }
 
 
-CSeq_id_Handle CScope::GetAccVer(const CSeq_id_Handle& idh)
+CSeq_id_Handle CScope::GetAccVer(const CSeq_id_Handle& idh, TGetFlags flags)
 {
-    return m_Impl->GetAccVer(idh, false);
+    return m_Impl->GetAccVer(idh, flags);
 }
 
 
-TGi CScope::GetGi(const CSeq_id_Handle& idh)
+TGi CScope::GetGi(const CSeq_id_Handle& idh, TGetFlags flags)
 {
-    return m_Impl->GetGi(idh, false);
+    return m_Impl->GetGi(idh, flags);
 }
 
 
@@ -416,27 +416,27 @@ TGi CScope::x_GetGi(const TIds& ids)
 }
 
 
-string CScope::GetLabel(const CSeq_id& id, EForceLabelLoad force_load)
+string CScope::GetLabel(const CSeq_id& id, TGetFlags flags)
 {
-    return GetLabel(CSeq_id_Handle::GetHandle(id), force_load);
+    return GetLabel(CSeq_id_Handle::GetHandle(id), flags);
 }
 
 
-string CScope::GetLabel(const CSeq_id_Handle& idh, EForceLabelLoad force_load)
+string CScope::GetLabel(const CSeq_id_Handle& idh, TGetFlags flags)
 {
-    return m_Impl->GetLabel(idh, force_load == eForceLabelLoad);
+    return m_Impl->GetLabel(idh, flags);
 }
 
 
-int CScope::GetTaxId(const CSeq_id& id, EForceLoad force_load)
+int CScope::GetTaxId(const CSeq_id& id, TGetFlags flags)
 {
-    return GetTaxId(CSeq_id_Handle::GetHandle(id), force_load);
+    return GetTaxId(CSeq_id_Handle::GetHandle(id), flags);
 }
 
 
-int CScope::GetTaxId(const CSeq_id_Handle& idh, EForceLoad force_load)
+int CScope::GetTaxId(const CSeq_id_Handle& idh, TGetFlags flags)
 {
-    return m_Impl->GetTaxId(idh, force_load == eForceLoad);
+    return m_Impl->GetTaxId(idh, flags);
 }
 
 
@@ -612,223 +612,227 @@ void CScope::UpdateAnnotIndex(void)
 
 /// Bulk retrieval methods
 CScope::TSeq_id_Handles CScope::GetAccVers(const TSeq_id_Handles& idhs,
-                                           EForceLoad force_load)
+                                           TGetFlags flags)
 {
     TSeq_id_Handles results;
-    GetAccVers(&results, idhs, force_load);
+    GetAccVers(&results, idhs, flags);
     return results;
 }
 
 
 void CScope::GetAccVers(TSeq_id_Handles* results,
                         const TSeq_id_Handles& idhs,
-                        EForceLoad force_load)
+                        TGetFlags flags)
 {
     if ( !results ) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "CScope::GetAccVers: null results pointer");
     }
-    return m_Impl->GetAccVers(*results, idhs, force_load == eForceLoad);
+    return m_Impl->GetAccVers(*results, idhs, flags);
 }
 
 
 CScope::TGIs CScope::GetGis(const TSeq_id_Handles& idhs,
-                            EForceLoad force_load)
+                            TGetFlags flags)
 {
     TGIs results;
-    GetGis(&results, idhs, force_load);
+    GetGis(&results, idhs, flags);
     return results;
 }
 
 
 void CScope::GetGis(TGIs* results,
                     const TSeq_id_Handles& idhs,
-                    EForceLoad force_load)
+                    TGetFlags flags)
 {
     if ( !results ) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "CScope::GetGis: null results pointer");
     }
-    return m_Impl->GetGis(*results, idhs, force_load == eForceLoad);
+    return m_Impl->GetGis(*results, idhs, flags);
 }
 
 
 CScope::TLabels CScope::GetLabels(const TSeq_id_Handles& idhs,
-                                  EForceLoad force_load)
+                                  TGetFlags flags)
 {
     TLabels results;
-    GetLabels(&results, idhs, force_load);
+    GetLabels(&results, idhs, flags);
     return results;
 }
 
 
 void CScope::GetLabels(TLabels* results,
                        const TSeq_id_Handles& idhs,
-                       EForceLoad force_load)
+                       TGetFlags flags)
 {
     if ( !results ) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "CScope::GetLabels: null results pointer");
     }
-    return m_Impl->GetLabels(*results, idhs, force_load == eForceLoad);
+    return m_Impl->GetLabels(*results, idhs, flags);
 }
 
 
 CScope::TTaxIds CScope::GetTaxIds(const TSeq_id_Handles& idhs,
-                                  EForceLoad force_load)
+                                  TGetFlags flags)
 {
     TTaxIds results;
-    GetTaxIds(&results, idhs, force_load);
+    GetTaxIds(&results, idhs, flags);
     return results;
 }
 
 
 void CScope::GetTaxIds(TTaxIds* results,
                        const TSeq_id_Handles& idhs,
-                       EForceLoad force_load)
+                       TGetFlags flags)
 {
     if ( !results ) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "CScope::GetTaxIds: null results pointer");
     }
-    return m_Impl->GetTaxIds(*results, idhs, force_load == eForceLoad);
+    return m_Impl->GetTaxIds(*results, idhs, flags);
 }
 
 
 TSeqPos CScope::GetSequenceLength(const CSeq_id& id,
-                                  EForceLoad force_load)
+                                  TGetFlags flags)
 {
-    return GetSequenceLength(CSeq_id_Handle::GetHandle(id), force_load);
+    return GetSequenceLength(CSeq_id_Handle::GetHandle(id), flags);
 }
 
 
 TSeqPos CScope::GetSequenceLength(const CSeq_id_Handle& id,
-                                  EForceLoad force_load)
+                                  TGetFlags flags)
 {
-    return m_Impl->GetSequenceLength(id, force_load == eForceLoad);
+    return m_Impl->GetSequenceLength(id, flags);
 }
 
 
 void CScope::GetSequenceLengths(TSequenceLengths* results,
                                 const TSeq_id_Handles& ids,
-                                EForceLoad force_load)
+                                TGetFlags flags)
 {
     if ( !results ) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "CScope::GetSequenceLengths: null results pointer");
     }
-    return m_Impl->GetSequenceLengths(*results, ids, force_load == eForceLoad);
+    return m_Impl->GetSequenceLengths(*results, ids, flags);
 }
 
 
 CScope::TSequenceLengths CScope::GetSequenceLengths(const TSeq_id_Handles& ids,
-                                                    EForceLoad force_load)
+                                                    TGetFlags flags)
 {
     TSequenceLengths results;
-    GetSequenceLengths(&results, ids, force_load);
+    GetSequenceLengths(&results, ids, flags);
     return results;
 }
 
 
 CSeq_inst::TMol CScope::GetSequenceType(const CSeq_id& id,
-                                        EForceLoad force_load)
+                                        TGetFlags flags)
 {
-    return GetSequenceType(CSeq_id_Handle::GetHandle(id), force_load);
+    return GetSequenceType(CSeq_id_Handle::GetHandle(id), flags);
 }
 
 
 CSeq_inst::TMol CScope::GetSequenceType(const CSeq_id_Handle& id,
-                                        EForceLoad force_load)
+                                        TGetFlags flags)
 {
-    return m_Impl->GetSequenceType(id, force_load == eForceLoad);
+    return m_Impl->GetSequenceType(id, flags);
 }
 
 
 void CScope::GetSequenceTypes(TSequenceTypes* results,
                               const TSeq_id_Handles& ids,
-                              EForceLoad force_load)
+                              TGetFlags flags)
 {
     if ( !results ) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "CScope::GetSequenceTypes: null results pointer");
     }
-    return m_Impl->GetSequenceTypes(*results, ids, force_load == eForceLoad);
+    return m_Impl->GetSequenceTypes(*results, ids, flags);
 }
 
 
 CScope::TSequenceTypes CScope::GetSequenceTypes(const TSeq_id_Handles& ids,
-                                                EForceLoad force_load)
+                                                TGetFlags flags)
 {
     TSequenceTypes results;
-    GetSequenceTypes(&results, ids, force_load);
+    GetSequenceTypes(&results, ids, flags);
     return results;
 }
 
 
 CBioseq_Handle::TBioseqStateFlags
 CScope::GetSequenceState(const CSeq_id& id,
-                         EForceLoad force_load)
+                         TGetFlags flags)
 {
-    return GetSequenceState(CSeq_id_Handle::GetHandle(id), force_load);
+    return GetSequenceState(CSeq_id_Handle::GetHandle(id), flags);
 }
 
 
 CBioseq_Handle::TBioseqStateFlags
 CScope::GetSequenceState(const CSeq_id_Handle& id,
-                         EForceLoad force_load)
+                         TGetFlags flags)
 {
-    return m_Impl->GetSequenceState(id, force_load == eForceLoad);
+    return m_Impl->GetSequenceState(id, flags);
 }
 
 
 void CScope::GetSequenceStates(TSequenceStates* results,
                                const TSeq_id_Handles& ids,
-                               EForceLoad force_load)
+                               TGetFlags flags)
 {
     if ( !results ) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "CScope::GetSequenceStates: null results pointer");
     }
-    return m_Impl->GetSequenceStates(*results, ids, force_load == eForceLoad);
+    return m_Impl->GetSequenceStates(*results, ids, flags);
 }
 
 
 CScope::TSequenceStates CScope::GetSequenceStates(const TSeq_id_Handles& ids,
-                                                  EForceLoad force_load)
+                                                  TGetFlags flags)
 {
     TSequenceStates results;
-    GetSequenceStates(&results, ids, force_load);
+    GetSequenceStates(&results, ids, flags);
     return results;
 }
 
 
-CScope::TSequenceHash CScope::GetSequenceHash(const CSeq_id& id)
+CScope::TSequenceHash CScope::GetSequenceHash(const CSeq_id& id,
+                                              TGetFlags flags)
 {
-    return GetSequenceHash(CSeq_id_Handle::GetHandle(id));
+    return GetSequenceHash(CSeq_id_Handle::GetHandle(id), flags);
 }
 
 
-CScope::TSequenceHash CScope::GetSequenceHash(const CSeq_id_Handle& id)
+CScope::TSequenceHash CScope::GetSequenceHash(const CSeq_id_Handle& id,
+                                              TGetFlags flags)
 {
-    return m_Impl->GetSequenceHash(id);
+    return m_Impl->GetSequenceHash(id, flags);
 }
 
 
 void CScope::GetSequenceHashes(TSequenceHashes* results,
-                               const TSeq_id_Handles& ids)
+                               const TSeq_id_Handles& ids,
+                               TGetFlags flags)
 {
     if ( !results ) {
         NCBI_THROW(CCoreException, eNullPtr,
                    "CScope::GetSequenceHashes: null results pointer");
     }
-    return m_Impl->GetSequenceHashes(*results, ids);
+    return m_Impl->GetSequenceHashes(*results, ids, flags);
 }
 
 
-CScope::TSequenceHashes CScope::GetSequenceHashes(const TSeq_id_Handles& ids)
+CScope::TSequenceHashes CScope::GetSequenceHashes(const TSeq_id_Handles& ids,
+                                                  TGetFlags flags)
 {
     TSequenceHashes results;
-    GetSequenceHashes(&results, ids);
+    GetSequenceHashes(&results, ids, flags);
     return results;
 }
 
diff --git a/c++/src/objmgr/scope_impl.cpp b/c++/src/objmgr/scope_impl.cpp
index c1782b1..942ca4e 100644
--- a/c++/src/objmgr/scope_impl.cpp
+++ b/c++/src/objmgr/scope_impl.cpp
@@ -1,4 +1,4 @@
-/*  $Id: scope_impl.cpp 474909 2015-08-03 10:48:42Z ivanov $
+/*  $Id: scope_impl.cpp 496835 2016-03-31 15:49:15Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -46,6 +46,7 @@
 #include <objmgr/object_manager.hpp>
 #include <objmgr/objmgr_exception.hpp>
 #include <objmgr/prefetch_manager.hpp>
+#include <objmgr/seq_vector.hpp>
 
 #include <objmgr/impl/data_source.hpp>
 #include <objmgr/impl/tse_info.hpp>
@@ -67,9 +68,11 @@
 
 #include <objmgr/impl/scope_impl.hpp>
 #include <objmgr/impl/scope_transaction_impl.hpp>
+#include <objmgr/impl/seq_id_sort.hpp>
 
 #include <objmgr/seq_annot_ci.hpp>
 #include <objmgr/error_codes.hpp>
+#include <util/checksum.hpp>
 #include <math.h>
 #include <algorithm>
 
@@ -2511,140 +2514,201 @@ void CScope_Impl::x_PopulateBioseq_HandleSet(const CSeq_entry_Handle& seh,
 }
 
 
-CScope_Impl::TIds CScope_Impl::GetIds(const CSeq_id_Handle& idh)
+CScope_Impl::TIds CScope_Impl::GetIds(const CSeq_id_Handle& idh,
+                                      TGetFlags flags)
 {
-    TIds ret;
-    if (!idh) return ret;
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetIds(): null Seq-id handle");
+    }
+    
     TConfReadLockGuard rguard(m_ConfLock);
-    SSeqMatch_Scope match;
-    CRef<CBioseq_ScopeInfo> info =
-        x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
-    if ( info ) {
-        if ( info->HasBioseq() ) {
-            ret = info->GetIds();
+
+    if ( !(flags & CScope::fForceLoad) ) {
+        // Look in existing resolution information
+        SSeqMatch_Scope match;
+        CRef<CBioseq_ScopeInfo> info =
+            x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
+        if ( info && info->HasBioseq() ) {
+            // sequence is already loaded
+            return info->GetIds();
         }
     }
-    else {
-        // Unknown bioseq, try to find in data sources
-        for (CPriority_I it(m_setDataSrc); it; ++it) {
-            CPrefetchManager::IsActive();
-            it->GetDataSource().GetIds(idh, ret);
-            if ( !ret.empty() ) {
-                break;
-            }
+
+    for (CPriority_I it(m_setDataSrc); it; ++it) {
+        CPrefetchManager::IsActive();
+        TIds ret;
+        it->GetDataSource().GetIds(idh, ret);
+        if ( !ret.empty() ) {
+            return ret;
         }
     }
-    return ret;
+    
+    // the sequence is not found
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW_FMT(CObjMgrException, eFindFailed,
+                       "CScope::GetIds("<<idh<<"): sequence not found");
+    }
+    return TIds();
 }
 
 
 CSeq_id_Handle CScope_Impl::GetAccVer(const CSeq_id_Handle& idh,
-                                      bool force_load)
+                                      TGetFlags flags)
 {
-    CSeq_id_Handle ret;
-    if ( !force_load ) {
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetAccVer(): null Seq-id handle");
+    }
+    
+    if ( !(flags & CScope::fForceLoad) ) {
         CConstRef<CSeq_id> id = idh.GetSeqId();
         const CTextseq_id* text_id = id->GetTextseq_Id();
         if ( text_id &&
              text_id->IsSetAccession() &&
              text_id->IsSetVersion() ) {
-            ret = idh;
-            return ret;
+            return idh;
         }
     }
+
     TConfReadLockGuard rguard(m_ConfLock);
 
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         SSeqMatch_Scope match;
         CRef<CBioseq_ScopeInfo> info =
             x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
-        if ( info ) {
-            if ( info->HasBioseq() ) {
-                ret = CScope::x_GetAccVer(info->GetIds());
+        if ( info && info->HasBioseq() ) {
+            // sequence is already loaded
+            CSeq_id_Handle ret = CScope::x_GetAccVer(info->GetIds());
+            if ( !ret && (flags & CScope::fThrowOnMissingData) ) {
+                // no accession on the sequence
+                NCBI_THROW_FMT(CObjMgrException, eMissingData,
+                               "CScope::GetAccVer("<<idh<<"): no accession");
             }
             return ret;
         }
     }
     
-    // Unknown bioseq, try to find in data sources
     for (CPriority_I it(m_setDataSrc); it; ++it) {
         CPrefetchManager::IsActive();
-        ret = it->GetDataSource().GetAccVer(idh);
-        if ( ret ) {
-            break;
+        CDataSource::SAccVerFound data = it->GetDataSource().GetAccVer(idh);
+        if ( data.sequence_found ) {
+            // sequence is found
+            if ( !data.acc_ver && (flags & CScope::fThrowOnMissingData) ) {
+                // no accession on the sequence
+                NCBI_THROW_FMT(CObjMgrException, eMissingData,
+                               "CScope::GetAccVer("<<idh<<"): no accession");
+            }
+            return data.acc_ver;
         }
     }
-    return ret;
+
+    // the sequence is not found
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW_FMT(CObjMgrException, eFindFailed,
+                       "CScope::GetAccVer("<<idh<<"): sequence not found");
+    }
+    return null;
 }
 
 
 TGi CScope_Impl::GetGi(const CSeq_id_Handle& idh,
-                       bool force_load)
+                       TGetFlags flags)
 {
-    TGi ret = ZERO_GI;
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetGi(): null Seq-id handle");
+    }
+    
     TConfReadLockGuard rguard(m_ConfLock);
 
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         SSeqMatch_Scope match;
         CRef<CBioseq_ScopeInfo> info =
             x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
-        if ( info ) {
-            if ( info->HasBioseq() ) {
-                ret = CScope::x_GetGi(info->GetIds());
+        if ( info && info->HasBioseq() ) {
+            // sequence is already loaded
+            TGi ret = CScope::x_GetGi(info->GetIds());
+            if ( !ret && (flags & CScope::fThrowOnMissingData) ) {
+                // no GI on the sequence
+                NCBI_THROW_FMT(CObjMgrException, eMissingData,
+                               "CScope::GetGi("<<idh<<"): no GI");
             }
             return ret;
         }
     }
     
-    // Unknown bioseq, try to find in data sources
     for (CPriority_I it(m_setDataSrc); it; ++it) {
         CPrefetchManager::IsActive();
-        ret = it->GetDataSource().GetGi(idh);
-        if (ret != ZERO_GI) {
-            break;
+        CDataSource::SGiFound data = it->GetDataSource().GetGi(idh);
+        if ( data.sequence_found ) {
+            // sequence is found
+            if ( !data.gi && (flags & CScope::fThrowOnMissingData) ) {
+                // no accession on the sequence
+                NCBI_THROW_FMT(CObjMgrException, eMissingData,
+                               "CScope::GetGi("<<idh<<"): no GI");
+            }
+            return data.gi;
         }
     }
-    return ret;
+
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW_FMT(CObjMgrException, eFindFailed,
+                       "CScope::GetGi("<<idh<<"): sequence not found");
+    }
+    return ZERO_GI;
 }
 
 
-string CScope_Impl::GetLabel(const CSeq_id_Handle& idh, bool force_load)
+string CScope_Impl::GetLabel(const CSeq_id_Handle& idh, TGetFlags flags)
 {
-    string ret;
-    if ( !force_load ) {
-        ret = GetDirectLabel(idh);
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetLabel(): null Seq-id handle");
+    }
+    
+    if ( !(flags & CScope::fForceLoad) ) {
+        string ret = GetDirectLabel(idh);
         if ( !ret.empty() ) {
             return ret;
         }
     }
 
     TConfReadLockGuard rguard(m_ConfLock);
-    if ( !force_load ) {
+
+    if ( !(flags & CScope::fForceLoad) ) {
         SSeqMatch_Scope match;
         CRef<CBioseq_ScopeInfo> info =
             x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
-        if ( info ) {
-            if ( info->HasBioseq() ) {
-                ret = objects::GetLabel(info->GetIds());
-            }
-            return ret;
+        if ( info && info->HasBioseq() ) {
+            return objects::GetLabel(info->GetIds());
         }
     }
     
     // Unknown bioseq, try to find in data sources
     for (CPriority_I it(m_setDataSrc); it; ++it) {
-        ret = it->GetDataSource().GetLabel(idh);
+        string ret = it->GetDataSource().GetLabel(idh);
         if ( !ret.empty() ) {
-            break;
+            return ret;
         }
     }
-    return ret;
+
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetLabel(): sequence not found");
+    }
+    return string();
 }
 
 
-int CScope_Impl::GetTaxId(const CSeq_id_Handle& idh, bool force_load)
+int CScope_Impl::GetTaxId(const CSeq_id_Handle& idh, TGetFlags flags)
 {
-    if ( !force_load ) {
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetTaxId(): null Seq-id handle");
+    }
+    
+    if ( !(flags & CScope::fForceLoad) ) {
         if ( idh.Which() == CSeq_id::e_General ) {
             CConstRef<CSeq_id> id = idh.GetSeqId();
             const CDbtag& dbtag = id->GetGeneral();
@@ -2655,30 +2719,218 @@ int CScope_Impl::GetTaxId(const CSeq_id_Handle& idh, bool force_load)
         }
     }
 
-    int ret = -1;
     TConfReadLockGuard rguard(m_ConfLock);
-    if ( !force_load ) {
+
+    if ( !(flags & CScope::fForceLoad) ) {
         SSeqMatch_Scope match;
         CRef<CBioseq_ScopeInfo> info =
             x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
-        if ( info ) {
-            if ( info->HasBioseq() ) {
-                TBioseq_Lock bioseq = info->GetLock(null);
-                ret = info->GetObjectInfo().GetTaxId();
+        if ( info && info->HasBioseq() ) {
+            TBioseq_Lock bioseq = info->GetLock(null);
+            int ret = info->GetObjectInfo().GetTaxId();
+            if ( !ret && (flags & CScope::fThrowOnMissingData) ) {
+                // no TaxID on the sequence
+                NCBI_THROW_FMT(CObjMgrException, eMissingData,
+                               "CScope::GetTaxId("<<idh<<"): no TaxID");
             }
+            return ret;
         }
     }
 
-    if ( ret == -1 ) {
-        // Unknown bioseq, try to find in data sources
-        for (CPriority_I it(m_setDataSrc); it; ++it) {
-            ret = it->GetDataSource().GetTaxId(idh);
-            if ( ret >= 0 ) {
+    for (CPriority_I it(m_setDataSrc); it; ++it) {
+        int ret = it->GetDataSource().GetTaxId(idh);
+        if ( ret != -1 ) {
+            if ( !ret && (flags & CScope::fThrowOnMissingData) ) {
+                // no TaxID on the sequence
+                NCBI_THROW_FMT(CObjMgrException, eMissingData,
+                               "CScope::GetTaxId("<<idh<<"): no TaxID");
+            }
+            return ret;
+        }
+    }
+
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW_FMT(CObjMgrException, eFindFailed,
+                       "CScope::GetTaxId("<<idh<<"): sequence not found");
+    }
+    return -1;
+}
+
+
+TSeqPos CScope_Impl::GetSequenceLength(const CSeq_id_Handle& idh,
+                                       TGetFlags flags)
+{
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetSequenceLength(): null Seq-id handle");
+    }
+    
+    TConfReadLockGuard rguard(m_ConfLock);
+
+    if ( !(flags & CScope::fForceLoad) ) {
+        SSeqMatch_Scope match;
+        CRef<CBioseq_ScopeInfo> info =
+            x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
+        if ( info && info->HasBioseq() ) {
+            TBioseq_Lock bioseq = info->GetLock(null);
+            return info->GetObjectInfo().GetBioseqLength();
+        }
+    }
+    
+    for (CPriority_I it(m_setDataSrc); it; ++it) {
+        CPrefetchManager::IsActive();
+        TSeqPos length = it->GetDataSource().GetSequenceLength(idh);
+        if ( length != kInvalidSeqPos ) {
+            return length;
+        }
+    }
+
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW_FMT(CObjMgrException, eFindFailed,
+                       "CScope::GetSequenceLength("<<idh<<"): "
+                       "sequence not found");
+    }
+    return kInvalidSeqPos;
+}
+                                  
+
+CSeq_inst::TMol CScope_Impl::GetSequenceType(const CSeq_id_Handle& idh,
+                                             TGetFlags flags)
+{
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetSequenceType(): null Seq-id handle");
+    }
+    
+    TConfReadLockGuard rguard(m_ConfLock);
+
+    if ( !(flags & CScope::fForceLoad) ) {
+        SSeqMatch_Scope match;
+        CRef<CBioseq_ScopeInfo> info =
+            x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
+        if ( info && info->HasBioseq() ) {
+            TBioseq_Lock bioseq = info->GetLock(null);
+            return info->GetObjectInfo().GetInst_Mol();
+        }
+    }
+    
+    for (CPriority_I it(m_setDataSrc); it; ++it) {
+        CPrefetchManager::IsActive();
+        CDataSource::STypeFound ret = it->GetDataSource().GetSequenceType(idh);
+        if ( ret.sequence_found ) {
+            return ret.type;
+        }
+    }
+
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW_FMT(CObjMgrException, eFindFailed,
+                       "CScope::GetSequenceType("<<idh<<"): "
+                       "sequence not found");
+    }
+    return CSeq_inst::eMol_not_set;
+}
+
+
+int CScope_Impl::GetSequenceState(const CSeq_id_Handle& idh,
+                                  TGetFlags flags)
+{
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetSequenceState(): null Seq-id handle");
+    }
+    
+    TConfReadLockGuard rguard(m_ConfLock);
+
+    if ( !(flags & CScope::fForceLoad) ) {
+        SSeqMatch_Scope match;
+        CRef<CBioseq_ScopeInfo> info =
+            x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
+        if ( info && info->HasBioseq() ) {
+            return info->GetBlobState();
+        }
+    }
+    
+    for (CPriority_I it(m_setDataSrc); it; ++it) {
+        CPrefetchManager::IsActive();
+        int state = it->GetDataSource().GetSequenceState(idh);
+        if ( !(state & CBioseq_Handle::fState_not_found) ) {
+            return state;
+        }
+    }
+
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW_FMT(CObjMgrException, eFindFailed,
+                       "CScope::GetSequenceState("<<idh<<"): "
+                       "sequence not found");
+    }
+    return CBioseq_Handle::fState_not_found | CBioseq_Handle::fState_no_data;
+}
+
+
+static
+int sx_CalcHash(const CBioseq_Handle& bh)
+{
+    CChecksum sum(CChecksum::eCRC32INSD);
+    CSeqVector sv(bh, bh.eCoding_Iupac);
+    for ( CSeqVector_CI it(sv); it; ) {
+        TSeqPos size = it.GetBufferSize();
+        sum.AddChars(it.GetBufferPtr(), size);
+        it += size;
+    }
+    return sum.GetChecksum();
+}
+
+
+int CScope_Impl::GetSequenceHash(const CSeq_id_Handle& idh, TGetFlags flags)
+{
+    if ( !idh ) {
+        NCBI_THROW(CObjMgrException, eInvalidHandle,
+                   "CScope::GetSequenceState(): null Seq-id handle");
+    }
+    
+    TConfReadLockGuard rguard(m_ConfLock);
+
+    bool found = false;
+    for (CPriority_I it(m_setDataSrc); it; ++it) {
+        CPrefetchManager::IsActive();
+        CDataSource::SHashFound data =
+            it->GetDataSource().GetSequenceHash(idh);
+        if ( data.sequence_found ) {
+            if ( data.hash_known ) {
+                // known by loader
+                return data.hash;
+            }
+            else {
+                // not known but may be recalculated
+                // sequence is found so no more loaders to ask
+                found = true;
                 break;
             }
         }
     }
-    return ret;
+
+    if ( found && !(flags & CScope::fDoNotRecalculate) ) {
+        CBioseq_Handle bh = GetBioseqHandle(idh, CScope::eGetBioseq_All);
+        if ( bh ) {
+            return sx_CalcHash(bh);
+        }
+        // failure to find the sequence again
+        found = false;
+    }
+    if ( found ) {
+        if ( (flags & CScope::fThrowOnMissingData) ) {
+            NCBI_THROW_FMT(CObjMgrException, eMissingData,
+                           "CScope::GetSequenceHash("<<idh<<"): no hash");
+        }
+        return 0;
+    }
+
+    if ( (flags & CScope::fThrowOnMissingSequence) ) {
+        NCBI_THROW_FMT(CObjMgrException, eFindFailed,
+                       "CScope::GetSequenceHash("<<idh<<"): "
+                       "sequence not found");
+    }
+    return 0;
 }
 
 
@@ -2838,42 +3090,29 @@ static size_t sx_CountFalse(const vector<bool>& loaded)
 
 
 /// Bulk retrieval methods
-CScope_Impl::TBioseqHandles CScope_Impl::GetBioseqHandles(const TIds& ids)
+
+void CScope_Impl::x_GetBioseqHandlesSorted(const TIds&     ids,
+                                           size_t          from,
+                                           size_t          count,
+                                           TBioseqHandles& ret)
 {
-    TBioseqHandles ret;
-    size_t count = ids.size();
-    ret.reserve(count);
-    if ( count > 200 ) {
-        // split batch into smaller pieces to avoid problems with GC
-        TIds ids1;
-        for ( size_t pos = 0; pos < count; ) {
-            size_t cnt = count - pos;
-            if ( cnt > 150 ) cnt = 100;
-            ids1.assign(ids.begin()+pos, ids.begin()+pos+cnt);
-            TBioseqHandles ret1 = GetBioseqHandles(ids1);
-            ret.insert(ret.end(), ret1.begin(), ret1.end());
-            pos += cnt;
-        }
-        return ret;
-    }
-    ret.resize(count);
     TConfReadLockGuard rguard(m_ConfLock);
     // Keep locks to prevent cleanup of the loaded TSEs.
     typedef CDataSource_ScopeInfo::TSeqMatchMap TSeqMatchMap;
     TSeqMatchMap match_map;
-    for ( size_t i = 0; i < count; ++i ) {
+    for ( size_t i = from; i < from + count; ++i ) {
         ret[i] = GetBioseqHandle(ids[i], CScope::eGetBioseq_Resolved);
         if ( !ret[i] ) {
             match_map[ids[i]];
         }
     }
     if ( match_map.empty() ) {
-        return ret;
+        return;
     }
     for (CPriority_I it(m_setDataSrc); it; ++it) {
         it->GetBlobs(match_map);
     }
-    for ( size_t i = 0; i < count; ++i ) {
+    for ( size_t i = from; i < from + count; ++i ) {
         if ( ret[i] ) {
             continue;
         }
@@ -2895,18 +3134,47 @@ CScope_Impl::TBioseqHandles CScope_Impl::GetBioseqHandles(const TIds& ids)
             ret[i].m_Info.Reset(info);
         }
     }
+}
+
+
+CScope_Impl::TBioseqHandles CScope_Impl::GetBioseqHandles(const TIds& ids)
+{
+    CSortedSeq_ids sorted_seq_ids(ids);
+    TIds sorted_ids;
+    sorted_seq_ids.GetSortedIds(sorted_ids);
+
+    TBioseqHandles ret;
+    size_t count = sorted_ids.size();
+    ret.resize(count);
+    if ( count > 200 ) {
+        // split batch into smaller pieces to avoid problems with GC
+        for ( size_t pos = 0; pos < count; ) {
+            size_t cnt = count - pos;
+            if ( cnt > 150 ) cnt = 100;
+            x_GetBioseqHandlesSorted(sorted_ids, pos, cnt, ret);
+            pos += cnt;
+        }
+    }
+    else {
+        x_GetBioseqHandlesSorted(sorted_ids, 0, count, ret);
+    }
+    sorted_seq_ids.RestoreOrder(ret);
     return ret;
 }
 
 
 void CScope_Impl::GetAccVers(TIds& ret,
-                             const TIds& ids,
-                             bool force_load)
+                             const TIds& unsorted_ids,
+                             TGetFlags flags)
 {
+    CSortedSeq_ids sorted_seq_ids(unsorted_ids);
+    TIds ids;
+    sorted_seq_ids.GetSortedIds(ids);
+
     size_t count = ids.size(), remaining = count;
     ret.assign(count, CSeq_id_Handle());
     vector<bool> loaded(count);
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         for ( size_t i = 0; i < count; ++i ) {
             CConstRef<CSeq_id> id = ids[i].GetSeqId();
             const CTextseq_id* text_id = id->GetTextseq_Id();
@@ -2922,7 +3190,7 @@ void CScope_Impl::GetAccVers(TIds& ret,
     if ( remaining ) {
         TConfReadLockGuard rguard(m_ConfLock);
         
-        if ( !force_load ) {
+        if ( !(flags & CScope::fForceLoad) ) {
             for ( size_t i = 0; i < count; ++i ) {
                 if ( loaded[i] ) {
                     continue;
@@ -2952,17 +3220,27 @@ void CScope_Impl::GetAccVers(TIds& ret,
             remaining = sx_CountFalse(loaded);
         }
     }
+    if ( remaining && (flags & CScope::fThrowOnMissing) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetAccVers(): some sequences not found");
+    }
+
+    sorted_seq_ids.RestoreOrder(ret);
 }
 
 
 void CScope_Impl::GetGis(TGIs& ret,
-                         const TIds& ids,
-                         bool force_load)
+                         const TIds& unsorted_ids,
+                         TGetFlags flags)
 {
+    CSortedSeq_ids sorted_seq_ids(unsorted_ids);
+    TIds ids;
+    sorted_seq_ids.GetSortedIds(ids);
+
     size_t count = ids.size(), remaining = count;
     ret.assign(count, ZERO_GI);
     vector<bool> loaded(count);
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         for ( size_t i = 0; i < count; ++i ) {
             if ( ids[i].IsGi() ) {
                 ret[i] = ids[i].GetGi();
@@ -2974,7 +3252,7 @@ void CScope_Impl::GetGis(TGIs& ret,
     if ( remaining ) {
         TConfReadLockGuard rguard(m_ConfLock);
         
-        if ( !force_load ) {
+        if ( !(flags & CScope::fForceLoad) ) {
             for ( size_t i = 0; i < count; ++i ) {
                 if ( loaded[i] ) {
                     continue;
@@ -3004,17 +3282,27 @@ void CScope_Impl::GetGis(TGIs& ret,
             remaining = sx_CountFalse(loaded);
         }
     }
+    if ( remaining && (flags & CScope::fThrowOnMissing) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetGis(): some sequences not found");
+    }
+
+    sorted_seq_ids.RestoreOrder(ret);
 }
 
 
 void CScope_Impl::GetLabels(TLabels& ret,
-                            const TIds& ids,
-                            bool force_load)
+                            const TIds& unsorted_ids,
+                            TGetFlags flags)
 {
+    CSortedSeq_ids sorted_seq_ids(unsorted_ids);
+    TIds ids;
+    sorted_seq_ids.GetSortedIds(ids);
+
     size_t count = ids.size(), remaining = count;
     ret.assign(count, string());
     vector<bool> loaded(count);
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         for ( size_t i = 0; i < count; ++i ) {
             ret[i] = GetDirectLabel(ids[i]);
             if ( !ret[i].empty() ) {
@@ -3026,7 +3314,7 @@ void CScope_Impl::GetLabels(TLabels& ret,
     if ( remaining ) {
         TConfReadLockGuard rguard(m_ConfLock);
         
-        if ( !force_load ) {
+        if ( !(flags & CScope::fForceLoad) ) {
             for ( size_t i = 0; i < count; ++i ) {
                 if ( loaded[i] ) {
                     continue;
@@ -3056,17 +3344,27 @@ void CScope_Impl::GetLabels(TLabels& ret,
             remaining = sx_CountFalse(loaded);
         }
     }
+    if ( remaining && (flags & CScope::fThrowOnMissing) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetLabels(): some sequences not found");
+    }
+
+    sorted_seq_ids.RestoreOrder(ret);
 }
 
 
 void CScope_Impl::GetTaxIds(TTaxIds& ret,
-                            const TIds& ids,
-                            bool force_load)
+                            const TIds& unsorted_ids,
+                            TGetFlags flags)
 {
+    CSortedSeq_ids sorted_seq_ids(unsorted_ids);
+    TIds ids;
+    sorted_seq_ids.GetSortedIds(ids);
+
     size_t count = ids.size(), remaining = count;
     ret.assign(count, -1);
     vector<bool> loaded(count);
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         for ( size_t i = 0; i < count; ++i ) {
             if ( ids[i].Which() == CSeq_id::e_General ) {
                 CConstRef<CSeq_id> id = ids[i].GetSeqId();
@@ -3083,7 +3381,7 @@ void CScope_Impl::GetTaxIds(TTaxIds& ret,
     if ( remaining ) {
         TConfReadLockGuard rguard(m_ConfLock);
         
-        if ( !force_load ) {
+        if ( !(flags & CScope::fForceLoad) ) {
             for ( size_t i = 0; i < count; ++i ) {
                 if ( loaded[i] ) {
                     continue;
@@ -3114,113 +3412,30 @@ void CScope_Impl::GetTaxIds(TTaxIds& ret,
             remaining = sx_CountFalse(loaded);
         }
     }
-}
-
-
-TSeqPos CScope_Impl::GetSequenceLength(const CSeq_id_Handle& idh,
-                                       bool force_load)
-{
-    TConfReadLockGuard rguard(m_ConfLock);
-
-    if ( !force_load ) {
-        SSeqMatch_Scope match;
-        CRef<CBioseq_ScopeInfo> info =
-            x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
-        if ( info ) {
-            if ( info->HasBioseq() ) {
-                TBioseq_Lock bioseq = info->GetLock(null);
-                return info->GetObjectInfo().GetBioseqLength();
-            }
-            return kInvalidSeqPos;
-        }
-    }
-    
-    // Unknown bioseq, try to find in data sources
-    for (CPriority_I it(m_setDataSrc); it; ++it) {
-        CPrefetchManager::IsActive();
-        TSeqPos length = it->GetDataSource().GetSequenceLength(idh);
-        if ( length != kInvalidSeqPos ) {
-            return length;
-        }
-    }
-    return kInvalidSeqPos;
-}
-                                  
-
-CSeq_inst::TMol CScope_Impl::GetSequenceType(const CSeq_id_Handle& idh,
-                                             bool force_load)
-{
-    TConfReadLockGuard rguard(m_ConfLock);
-
-    if ( !force_load ) {
-        SSeqMatch_Scope match;
-        CRef<CBioseq_ScopeInfo> info =
-            x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
-        if ( info ) {
-            if ( info->HasBioseq() ) {
-                TBioseq_Lock bioseq = info->GetLock(null);
-                return info->GetObjectInfo().GetInst_Mol();
-            }
-            return CSeq_inst::eMol_not_set;
-        }
-    }
-    
-    // Unknown bioseq, try to find in data sources
-    for (CPriority_I it(m_setDataSrc); it; ++it) {
-        CPrefetchManager::IsActive();
-        CSeq_inst::TMol type = it->GetDataSource().GetSequenceType(idh);
-        if ( type != CSeq_inst::eMol_not_set ) {
-            return type;
-        }
+    if ( remaining && (flags & CScope::fThrowOnMissing) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetTaxIds(): some sequences not found");
     }
-    return CSeq_inst::eMol_not_set;
-}
-
-
-int CScope_Impl::GetSequenceState(const CSeq_id_Handle& idh,
-                                  bool force_load)
-{
-    const int kNotFound = (CBioseq_Handle::fState_not_found |
-                           CBioseq_Handle::fState_no_data);
 
-    TConfReadLockGuard rguard(m_ConfLock);
-
-    if ( !force_load ) {
-        SSeqMatch_Scope match;
-        CRef<CBioseq_ScopeInfo> info =
-            x_FindBioseq_Info(idh, CScope::eGetBioseq_Resolved, match);
-        if ( info ) {
-            if ( info->HasBioseq() ) {
-                TBioseq_Lock bioseq = info->GetLock(null);
-                return info->GetObjectInfo().GetInst_Mol();
-            }
-            return kNotFound;
-        }
-    }
-    
-    // Unknown bioseq, try to find in data sources
-    for (CPriority_I it(m_setDataSrc); it; ++it) {
-        CPrefetchManager::IsActive();
-        int state = it->GetDataSource().GetSequenceState(idh);
-        if ( state != kNotFound ) {
-            return state;
-        }
-    }
-    return kNotFound;
+    sorted_seq_ids.RestoreOrder(ret);
 }
 
 
 void CScope_Impl::GetSequenceLengths(TSequenceLengths& ret,
-                                     const TIds& ids,
-                                     bool force_load)
+                                     const TIds& unsorted_ids,
+                                     TGetFlags flags)
 {
+    CSortedSeq_ids sorted_seq_ids(unsorted_ids);
+    TIds ids;
+    sorted_seq_ids.GetSortedIds(ids);
+
     size_t count = ids.size(), remaining = count;
     ret.assign(count, kInvalidSeqPos);
     vector<bool> loaded(count);
     
     TConfReadLockGuard rguard(m_ConfLock);
     
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         for ( size_t i = 0; i < count; ++i ) {
             if ( loaded[i] ) {
                 continue;
@@ -3250,20 +3465,30 @@ void CScope_Impl::GetSequenceLengths(TSequenceLengths& ret,
         it->GetDataSource().GetSequenceLengths(ids, loaded, ret);
         remaining = sx_CountFalse(loaded);
     }
+    if ( remaining && (flags & CScope::fThrowOnMissing) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetSequenceLengths(): some sequences not found");
+    }
+
+    sorted_seq_ids.RestoreOrder(ret);
 }
 
 
 void CScope_Impl::GetSequenceTypes(TSequenceTypes& ret,
-                                   const TIds& ids,
-                                   bool force_load)
+                                   const TIds& unsorted_ids,
+                                   TGetFlags flags)
 {
+    CSortedSeq_ids sorted_seq_ids(unsorted_ids);
+    TIds ids;
+    sorted_seq_ids.GetSortedIds(ids);
+
     size_t count = ids.size(), remaining = count;
     ret.assign(count, CSeq_inst::eMol_not_set);
     vector<bool> loaded(count);
     
     TConfReadLockGuard rguard(m_ConfLock);
     
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         for ( size_t i = 0; i < count; ++i ) {
             if ( loaded[i] ) {
                 continue;
@@ -3293,13 +3518,23 @@ void CScope_Impl::GetSequenceTypes(TSequenceTypes& ret,
         it->GetDataSource().GetSequenceTypes(ids, loaded, ret);
         remaining = sx_CountFalse(loaded);
     }
+    if ( remaining && (flags & CScope::fThrowOnMissing) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetSequenceTypes(): some sequences not found");
+    }
+
+    sorted_seq_ids.RestoreOrder(ret);
 }
 
 
 void CScope_Impl::GetSequenceStates(TSequenceStates& ret,
-                                    const TIds& ids,
-                                    bool force_load)
+                                    const TIds& unsorted_ids,
+                                    TGetFlags flags)
 {
+    CSortedSeq_ids sorted_seq_ids(unsorted_ids);
+    TIds ids;
+    sorted_seq_ids.GetSortedIds(ids);
+
     const int kNotFound = (CBioseq_Handle::fState_not_found |
                            CBioseq_Handle::fState_no_data);
 
@@ -3309,7 +3544,7 @@ void CScope_Impl::GetSequenceStates(TSequenceStates& ret,
     
     TConfReadLockGuard rguard(m_ConfLock);
     
-    if ( !force_load ) {
+    if ( !(flags & CScope::fForceLoad) ) {
         for ( size_t i = 0; i < count; ++i ) {
             if ( loaded[i] ) {
                 continue;
@@ -3339,30 +3574,27 @@ void CScope_Impl::GetSequenceStates(TSequenceStates& ret,
         it->GetDataSource().GetSequenceStates(ids, loaded, ret);
         remaining = sx_CountFalse(loaded);
     }
-}
-
-
-int CScope_Impl::GetSequenceHash(const CSeq_id_Handle& idh)
-{
-    TConfReadLockGuard rguard(m_ConfLock);
-    // Unknown bioseq, try to find in data sources
-    for (CPriority_I it(m_setDataSrc); it; ++it) {
-        CPrefetchManager::IsActive();
-        int hash = it->GetDataSource().GetSequenceHash(idh);
-        if ( hash != 0 ) {
-            return hash;
-        }
+    if ( remaining && (flags & CScope::fThrowOnMissing) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetSequenceStates(): some sequences not found");
     }
-    return 0;
+
+    sorted_seq_ids.RestoreOrder(ret);
 }
 
 
 void CScope_Impl::GetSequenceHashes(TSequenceStates& ret,
-                                    const TIds& ids)
+                                    const TIds& unsorted_ids,
+                                    TGetFlags flags)
 {
+    CSortedSeq_ids sorted_seq_ids(unsorted_ids);
+    TIds ids;
+    sorted_seq_ids.GetSortedIds(ids);
+
     size_t count = ids.size(), remaining = count;
     ret.assign(count, 0);
     vector<bool> loaded(count);
+    vector<bool> known(count);
     
     TConfReadLockGuard rguard(m_ConfLock);
     // Unknown bioseq, try to find in data sources
@@ -3371,9 +3603,37 @@ void CScope_Impl::GetSequenceHashes(TSequenceStates& ret,
             break;
         }
         CPrefetchManager::IsActive();
-        it->GetDataSource().GetSequenceHashes(ids, loaded, ret);
+        it->GetDataSource().GetSequenceHashes(ids, loaded, ret, known);
         remaining = sx_CountFalse(loaded);
     }
+    if ( !(flags & CScope::fDoNotRecalculate) ) {
+        for ( size_t i = 0; i < count; ++i ) {
+            if ( known[i] ) {
+                // already calculated
+                continue;
+            }
+            if ( !loaded[i] ) {
+                // sequence not found
+                continue;
+            }
+            if ( CBioseq_Handle bh = GetBioseqHandle(ids[i], CScope::eGetBioseq_All) ) {
+                ret[i] = sx_CalcHash(bh);
+            }
+            else {
+                if ( (flags & CScope::fThrowOnMissingData) ) {
+                    NCBI_THROW_FMT(CObjMgrException, eMissingData,
+                                   "CScope::GetSequenceHash("<<ids[i]<<"): "
+                                   "no hash");
+                }
+            }
+        }
+    }
+    if ( remaining && (flags & CScope::fThrowOnMissing) ) {
+        NCBI_THROW(CObjMgrException, eFindFailed,
+                   "CScope::GetSequenceHashes(): some sequences not found");
+    }
+
+    sorted_seq_ids.RestoreOrder(ret);
 }
 
 
diff --git a/c++/src/objmgr/scope_info.cpp b/c++/src/objmgr/scope_info.cpp
index 0efdd71..38f99e9 100644
--- a/c++/src/objmgr/scope_info.cpp
+++ b/c++/src/objmgr/scope_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: scope_info.cpp 474909 2015-08-03 10:48:42Z ivanov $
+/*  $Id: scope_info.cpp 474694 2015-07-30 19:29:47Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objmgr/seq_annot_info.cpp b/c++/src/objmgr/seq_annot_info.cpp
index 762dca8..33ba990 100644
--- a/c++/src/objmgr/seq_annot_info.cpp
+++ b/c++/src/objmgr/seq_annot_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_annot_info.cpp 465027 2015-04-16 13:18:40Z vasilche $
+/*  $Id: seq_annot_info.cpp 496424 2016-03-28 15:16:13Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -58,6 +58,7 @@
 #include <objects/seq/Annot_descr.hpp>
 #include <objects/seqtable/seqtable__.hpp>
 #include <objects/seqfeat/seqfeat__.hpp>
+#include <objects/seqalign/Seq_align_set.hpp>
 #include <objmgr/seq_feat_handle.hpp>
 
 
@@ -827,38 +828,36 @@ void CSeq_annot_Info::x_InitGraphKeys(CTSE_Info& tse)
 }
 
 
-void CSeq_annot_Info::x_InitAlignKeys(CTSE_Info& tse)
+void CSeq_annot_Info::x_AddAlignKeys(CAnnotObject_Info& info,
+                                     const CSeq_align& align,
+                                     const CMasterSeqSegments* master,
+                                     CTSEAnnotObjectMapper& mapper)
 {
-    _ASSERT(m_ObjectIndex.GetInfos().size() >= m_Object->GetData().GetAlign().size());
-    size_t object_count = m_ObjectIndex.GetInfos().size();
-    m_ObjectIndex.ReserveMapSize(object_count);
-
-    SAnnotObject_Key key;
-    SAnnotObject_Index index;
-    CConstRef<CMasterSeqSegments> master = tse.GetMasterSeqSegments();
-    vector<CHandleRangeMap> hrmaps;
-
-    CTSEAnnotObjectMapper mapper(tse, GetName());
-
-    NON_CONST_ITERATE ( SAnnotObjectsIndex::TObjectInfos, it,
-                        m_ObjectIndex.GetInfos() ) {
-        CAnnotObject_Info& info = *it;
-        if ( info.IsRemoved() ) {
-            continue;
+    if ( align.GetSegs().IsDisc() ) {
+        // discontinued alignments should be indexed separately
+        // add keys for each sub-alignment
+        const CSeq_align_set::Tdata& sub_aligns = 
+            align.GetSegs().GetDisc().Get();
+        for ( auto& align_ref : sub_aligns ) {
+            x_AddAlignKeys(info, *align_ref, master, mapper);
         }
-        size_t keys_begin = m_ObjectIndex.GetKeys().size();
-        index.m_AnnotObject_Info = &info;
+    }
+    else {
+        vector<CHandleRangeMap> hrmaps;
+        CAnnotObject_Info::x_ProcessAlign(hrmaps, align, master);
 
-        info.GetMaps(hrmaps, master);
+        SAnnotObject_Index index;
+        index.m_AnnotObject_Info = &info;
         index.m_AnnotLocationIndex = 0;
 
         ITERATE ( vector<CHandleRangeMap>, hrmit, hrmaps ) {
             ITERATE ( CHandleRangeMap, hrit, *hrmit ) {
                 const CHandleRange& hr = hrit->second;
+                SAnnotObject_Key key;
                 key.m_Range = hr.GetOverlappingRange();
                 if ( key.m_Range.Empty() ) {
-                    ERR_POST_X(3, "Empty region in "<<GetDescription()<<" "<<
-                               MSerial_AsnText<<info.GetAlign());
+                    ERR_POST_X(3, "Empty region in "<<GetDescription()<<
+                               " "<<MSerial_AsnText<<info.GetAlign());
                     continue;
                 }
                 key.m_Handle = hrit->first;
@@ -874,6 +873,27 @@ void CSeq_annot_Info::x_InitAlignKeys(CTSE_Info& tse)
             }
             ++index.m_AnnotLocationIndex;
         }
+    }
+}
+
+
+void CSeq_annot_Info::x_InitAlignKeys(CTSE_Info& tse)
+{
+    _ASSERT(m_ObjectIndex.GetInfos().size() >= m_Object->GetData().GetAlign().size());
+    size_t object_count = m_ObjectIndex.GetInfos().size();
+    m_ObjectIndex.ReserveMapSize(object_count);
+
+    CConstRef<CMasterSeqSegments> master = tse.GetMasterSeqSegments();
+    CTSEAnnotObjectMapper mapper(tse, GetName());
+
+    NON_CONST_ITERATE ( SAnnotObjectsIndex::TObjectInfos, it,
+                        m_ObjectIndex.GetInfos() ) {
+        CAnnotObject_Info& info = *it;
+        if ( info.IsRemoved() ) {
+            continue;
+        }
+        size_t keys_begin = m_ObjectIndex.GetKeys().size();
+        x_AddAlignKeys(info, info.GetAlign(), master, mapper);
         x_UpdateObjectKeys(info, keys_begin);
     }
 }
diff --git a/c++/src/objmgr/seq_entry_ci.cpp b/c++/src/objmgr/seq_entry_ci.cpp
index ef29ef7..d8e81dc 100644
--- a/c++/src/objmgr/seq_entry_ci.cpp
+++ b/c++/src/objmgr/seq_entry_ci.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_entry_ci.cpp 485120 2015-11-18 19:39:01Z vasilche $
+/*  $Id: seq_entry_ci.cpp 483569 2015-11-02 17:27:19Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objmgr/seq_feat_handle.cpp b/c++/src/objmgr/seq_feat_handle.cpp
index 3d17e4c..5ad6067 100644
--- a/c++/src/objmgr/seq_feat_handle.cpp
+++ b/c++/src/objmgr/seq_feat_handle.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_feat_handle.cpp 458821 2015-02-10 17:18:44Z gotvyans $
+/*  $Id: seq_feat_handle.cpp 483571 2015-11-02 17:33:20Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -241,7 +241,7 @@ bool CSeq_feat_Handle::IsSetData(void) const
 CSeq_id_Handle CSeq_feat_Handle::GetLocationId(void) const
 {
     if ( IsTableSNP() ) {
-        return CSeq_id_Handle::GetGiHandle(GetSNPGi());
+        return CSeq_id_Handle::GetHandle(GetSNPSeq_id());
     }
     CConstRef<CSeq_loc> loc(&GetLocation());
     const CSeq_id* id = loc->GetId();
@@ -286,9 +286,15 @@ CSeq_feat_Handle::TRange CSeq_feat_Handle::GetProductTotalRange(void) const
 }
 
 
+const CSeq_id& CSeq_feat_Handle::GetSNPSeq_id(void) const
+{
+    return x_GetSNP_annot_Info().GetSeq_id();
+}
+
+
 CSeq_id::TGi CSeq_feat_Handle::GetSNPGi(void) const
 {
-    return x_GetSNP_annot_Info().GetGi();
+    return x_GetSNP_annot_Info().GetSeq_id().GetGi();
 }
 
 
diff --git a/c++/src/objmgr/seq_id_sort.cpp b/c++/src/objmgr/seq_id_sort.cpp
new file mode 100644
index 0000000..7b4009e
--- /dev/null
+++ b/c++/src/objmgr/seq_id_sort.cpp
@@ -0,0 +1,164 @@
+/*  $Id: seq_id_sort.cpp 496835 2016-03-31 15:49:15Z ivanov $
+* ===========================================================================
+*
+*                            PUBLIC DOMAIN NOTICE
+*               National Center for Biotechnology Information
+*
+*  This software/database is a "United States Government Work" under the
+*  terms of the United States Copyright Act.  It was written as part of
+*  the author's official duties as a United States Government employee and
+*  thus cannot be copyrighted.  This software/database is freely available
+*  to the public for use. The National Library of Medicine and the U.S.
+*  Government have not placed any restriction on its use or reproduction.
+*
+*  Although all reasonable efforts have been taken to ensure the accuracy
+*  and reliability of the software and data, the NLM and the U.S.
+*  Government do not and cannot warrant the performance or results that
+*  may be obtained by using this software or data. The NLM and the U.S.
+*  Government disclaim all warranties, express or implied, including
+*  warranties of performance, merchantability or fitness for any particular
+*  purpose.
+*
+*  Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* Author:
+*           Aleksey Grichenko
+*
+* File Description:
+*           API for sorting seq-ids to improve the performance of data loaders.
+*
+*/
+
+#include <ncbi_pch.hpp>
+#include <objmgr/impl/seq_id_sort.hpp>
+#include <objects/seqloc/Textseq_id.hpp>
+#include <objects/general/Dbtag.hpp>
+#include <objects/general/Object_id.hpp>
+
+
+#define NCBI_USE_ERRCODE_X   ObjMgr_Scope
+
+BEGIN_NCBI_SCOPE
+BEGIN_SCOPE(objects)
+
+
+CSortableSeq_id::CSortableSeq_id(const CSeq_id_Handle& idh, size_t idx)
+    : m_Id(idh), m_Index(idx)
+{
+    if ( !m_Id ) return;
+    switch ( m_Id.Which() ) {
+    // Use default comparison for most seq-id types.
+    // Int ids
+    case CSeq_id::e_not_set:
+    case CSeq_id::e_Gibbsq:
+    case CSeq_id::e_Gibbmt:
+    case CSeq_id::e_Gi:
+    // Some non-int ids
+    case CSeq_id::e_Local:
+    case CSeq_id::e_Giim:
+    case CSeq_id::e_Patent:
+    case CSeq_id::e_Pdb:
+    // Textseq-id
+    case CSeq_id::e_Genbank:
+    case CSeq_id::e_Embl:
+    case CSeq_id::e_Pir:
+    case CSeq_id::e_Swissprot:
+    case CSeq_id::e_Other:
+    case CSeq_id::e_Ddbj:
+    case CSeq_id::e_Prf:
+    case CSeq_id::e_Tpg:
+    case CSeq_id::e_Tpe:
+    case CSeq_id::e_Tpd:
+    case CSeq_id::e_Gpipe:
+        break;
+
+    case CSeq_id::e_General:
+    {
+        CConstRef<CSeq_id> id = m_Id.GetSeqIdOrNull();
+        _ASSERT(id);
+        const CDbtag& dbt = id->GetGeneral();
+
+        m_Parts.push_back(SIdPart(dbt.GetDb()));
+        if ( dbt.GetTag().IsId() ) {
+            m_Parts.push_back(SIdPart((Uint8)dbt.GetTag().GetId()));
+        }
+        else {
+            x_ParseParts(dbt.GetTag().GetStr());
+        }
+        break;
+    }
+
+    default:
+        break;
+    }
+}
+
+
+bool CSortableSeq_id::operator<(const CSortableSeq_id& id) const
+{
+    if (m_Id.Which() != id.m_Id.Which()  ||
+        (m_Parts.empty()  &&  id.m_Parts.empty())) {
+        return CSeq_id_Handle::PLessOrdered()(m_Id, id.m_Id);
+    }
+
+    size_t i = 0;
+    for (; i < m_Parts.size(); ++i) {
+        if (i >= id.m_Parts.size()) return false; // shorter first
+        const SIdPart& p1 = m_Parts[i];
+        const SIdPart& p2 = id.m_Parts[i];
+        if (p1.m_IsInt != p2.m_IsInt) {
+            return p1.m_IsInt; // numbers first
+        }
+        if (p1.m_IsInt) {
+            if (p1.m_Int != p2.m_Int) return p1.m_Int < p2.m_Int; // by number
+        }
+        else {
+            int c = p1.m_Str.compare(p2.m_Str); // by string
+            if (c != 0) return c < 0;
+        }
+    }
+    return i < id.m_Parts.size(); // shorter (first) or equal.
+}
+
+
+void CSortableSeq_id::x_ParseParts(const string& s)
+{
+    size_t pos = 0;
+    size_t delim = s.find('.');
+    while (delim != NPOS) {
+        // TODO: How to handle duplicate delimiters?
+        if (delim > pos) {
+            m_Parts.push_back(SIdPart(s.substr(pos, delim - pos)));
+        }
+        pos = delim + 1;
+        delim = s.find('.', pos);
+    }
+    if (pos < s.size()) {
+        m_Parts.push_back(SIdPart(s.substr(pos, NPOS)));
+    }
+}
+
+
+CSortedSeq_ids::CSortedSeq_ids(const TIds& ids)
+{
+    m_SortedIds.reserve(ids.size());
+    for (size_t i = 0; i < ids.size(); ++i) {
+        m_SortedIds.push_back(Ref(new CSortableSeq_id(ids[i], i)));
+    }
+    sort(m_SortedIds.begin(), m_SortedIds.end());
+}
+
+
+void CSortedSeq_ids::GetSortedIds(TIds& ids) const
+{
+    ids.resize(m_SortedIds.size());
+    for (size_t i = 0; i < m_SortedIds.size(); ++i) {
+        ids[i] = m_SortedIds[i]->GetId();
+    }
+}
+
+
+END_SCOPE(objects)
+END_NCBI_SCOPE
diff --git a/c++/src/objmgr/seq_loc_cvt.cpp b/c++/src/objmgr/seq_loc_cvt.cpp
index b65b1a1..b08b06f 100644
--- a/c++/src/objmgr/seq_loc_cvt.cpp
+++ b/c++/src/objmgr/seq_loc_cvt.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_loc_cvt.cpp 444530 2014-08-25 18:34:06Z vasilche $
+/*  $Id: seq_loc_cvt.cpp 493417 2016-02-26 18:49:07Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -536,21 +536,21 @@ CRef<CSeq_loc_mix> CSeq_loc_Conversion::GetDstMix(void)
 }
 
 
-void CSeq_loc_Conversion::SetDstLoc(CRef<CSeq_loc>* dst)
+void CSeq_loc_Conversion::SetDstLoc(CRef<CSeq_loc>& dst)
 {
     CSeq_loc* loc = 0;
-    if ( !(*dst) ) {
+    if ( !dst ) {
         switch ( m_LastType ) {
         case eMappedObjType_Seq_interval:
-            dst->Reset(loc = new CSeq_loc);
+            dst.Reset(loc = new CSeq_loc);
             loc->SetInt(*GetDstInterval());
             break;
         case eMappedObjType_Seq_point:
-            dst->Reset(loc = new CSeq_loc);
+            dst.Reset(loc = new CSeq_loc);
             loc->SetPnt(*GetDstPoint());
             break;
         case eMappedObjType_Seq_loc_mix:
-            dst->Reset(loc = new CSeq_loc);
+            dst.Reset(loc = new CSeq_loc);
             loc->SetMix(*GetDstMix());
             break;
         default:
@@ -565,30 +565,47 @@ void CSeq_loc_Conversion::SetDstLoc(CRef<CSeq_loc>* dst)
 
 
 void CSeq_loc_Conversion::ConvertPacked_int(const CSeq_loc& src,
-                                            CRef<CSeq_loc>* dst)
+                                            CRef<CSeq_loc>& dst)
 {
     _ASSERT(src.Which() == CSeq_loc::e_Packed_int);
     const CPacked_seqint::Tdata& src_ints = src.GetPacked_int().Get();
     CPacked_seqint::Tdata* dst_ints = 0;
+    // If the result contains NULLs, may need to use mix instead.
+    CSeq_loc_mix::Tdata* dst_mix = 0;
     bool last_truncated = false;
     ITERATE ( CPacked_seqint::Tdata, i, src_ints ) {
         if ( ConvertInterval(**i) ) {
-            if ( !dst_ints ) {
-                dst->Reset(new CSeq_loc);
-                dst_ints = &(*dst)->SetPacked_int().Set();
+            if ( !dst_ints  &&  !dst_mix ) {
+                dst.Reset(new CSeq_loc);
+                dst_ints = &dst->SetPacked_int().Set();
             }
             CRef<CSeq_interval> dst_int = GetDstInterval();
             if ( last_truncated  &&
+                !CSeq_loc_Mapper_Base::GetNonMappingAsNull()  &&
                 !dst_int->IsPartialStart(eExtreme_Biological) ) {
                 dst_int->SetPartialStart(true, eExtreme_Biological);
             }
-            dst_ints->push_back(dst_int);
+            if ( dst_mix ) {
+                CRef<CSeq_loc> mix_loc(new CSeq_loc);
+                mix_loc->SetInt(*dst_int);
+                dst_mix->push_back(mix_loc);
+            }
+            else {
+                dst_ints->push_back(dst_int);
+            }
             last_truncated = false;
         }
         else {
-            if ( !last_truncated  &&  *dst  &&
-                !(*dst)->IsPartialStop(eExtreme_Biological) ) {
-                (*dst)->SetPartialStop(true, eExtreme_Biological);
+            if (last_truncated) continue;
+            if (CSeq_loc_Mapper_Base::GetNonMappingAsNull()) {
+                dst_mix = CSeq_loc_Conversion::s_ConvertToMix(dst);
+                _ASSERT(dst_mix);
+                CRef<CSeq_loc> null_loc(new CSeq_loc);
+                null_loc->SetNull();
+                dst_mix->push_back(null_loc);
+            }
+            else if (dst  &&  !dst->IsPartialStop(eExtreme_Biological) ) {
+                dst->SetPartialStop(true, eExtreme_Biological);
             }
             last_truncated = true;
         }
@@ -597,7 +614,7 @@ void CSeq_loc_Conversion::ConvertPacked_int(const CSeq_loc& src,
 
 
 void CSeq_loc_Conversion::ConvertPacked_pnt(const CSeq_loc& src,
-                                            CRef<CSeq_loc>* dst)
+                                            CRef<CSeq_loc>& dst)
 {
     _ASSERT(src.Which() == CSeq_loc::e_Packed_pnt);
     const CPacked_seqpnt& src_pack_pnts = src.GetPacked_pnt();
@@ -609,28 +626,61 @@ void CSeq_loc_Conversion::ConvertPacked_pnt(const CSeq_loc& src,
     }
     const CPacked_seqpnt::TPoints& src_pnts = src_pack_pnts.GetPoints();
     CPacked_seqpnt::TPoints* dst_pnts = 0;
+    CSeq_loc_mix::Tdata* dst_mix = 0;
+    ENa_strand dst_strand = eNa_strand_unknown;
+    CRef<CInt_fuzz> dst_fuzz;
+    if ( src_pack_pnts.IsSetStrand() ) {
+        dst_strand = ConvertStrand(src_pack_pnts.GetStrand());
+    }
+    if ( src_pack_pnts.IsSetFuzz() ) {
+        dst_fuzz.Reset(new CInt_fuzz);
+        if ( m_Reverse ) {
+            dst_fuzz->Assign(*ReverseFuzz(src_pack_pnts.GetFuzz()));
+        }
+        else {
+            dst_fuzz->Assign(src_pack_pnts.GetFuzz());
+        }
+    }
+
     ITERATE ( CPacked_seqpnt::TPoints, i, src_pnts ) {
         TSeqPos dst_pos = ConvertPos(*i);
-        if ( dst_pos != kInvalidSeqPos ) {
+        if ( dst_pos == kInvalidSeqPos ) 
+        {
+            if (CSeq_loc_Mapper::GetNonMappingAsNull()) {
+                dst_mix = s_ConvertToMix(dst);
+                CRef<CSeq_loc> null_loc(new CSeq_loc);
+                null_loc->SetNull();
+                dst_mix->push_back(null_loc);
+            }
+            continue;
+        }
+        if ( dst_mix ) {
+            CRef<CSeq_loc> mix_loc(new CSeq_loc);
+            mix_loc->SetPnt().SetId(GetDstId());
+            mix_loc->SetPnt().SetPoint(dst_pos);
+            if ( src_pack_pnts.IsSetStrand() ) {
+                mix_loc->SetPnt().SetStrand(dst_strand);
+            }
+            if ( dst_fuzz ) {
+                mix_loc->SetPnt().SetFuzz(*dst_fuzz);
+            }
+        }
+        else {
             if ( !dst_pnts ) {
-                dst->Reset(new CSeq_loc);
-                CPacked_seqpnt& pnts = (*dst)->SetPacked_pnt();
+                dst.Reset(new CSeq_loc);
+                CPacked_seqpnt& pnts = dst->SetPacked_pnt();
                 pnts.SetId(GetDstId());
                 dst_pnts = &pnts.SetPoints();
                 if ( src_pack_pnts.IsSetStrand() ) {
-                    pnts.SetStrand(ConvertStrand(src_pack_pnts.GetStrand()));
+                    pnts.SetStrand(dst_strand);
                 }
-                if ( src_pack_pnts.IsSetFuzz() ) {
-                    CConstRef<CInt_fuzz> fuzz(&src_pack_pnts.GetFuzz());
-                    if ( m_Reverse ) {
-                        fuzz = ReverseFuzz(*fuzz);
-                    }
-                    pnts.SetFuzz(const_cast<CInt_fuzz&>(*fuzz));
+                if ( dst_fuzz ) {
+                    pnts.SetFuzz(*dst_fuzz);
                 }
             }
             dst_pnts->push_back(dst_pos);
-            m_TotalRange += TRange(dst_pos, dst_pos);
         }
+        m_TotalRange += TRange(dst_pos, dst_pos);
     }
 }
 
@@ -734,7 +784,7 @@ bool CSeq_loc_Conversion::ConvertSimpleMix(const CSeq_loc& src)
 
 
 void CSeq_loc_Conversion::ConvertMix(const CSeq_loc& src,
-                                     CRef<CSeq_loc>* dst,
+                                     CRef<CSeq_loc>& dst,
                                      EConvertFlag flag)
 {
     _ASSERT(src.Which() == CSeq_loc::e_Mix);
@@ -746,13 +796,11 @@ void CSeq_loc_Conversion::ConvertMix(const CSeq_loc& src,
     CRef<CSeq_loc> dst_loc;
     bool last_truncated = false;
     ITERATE ( CSeq_loc_mix::Tdata, i, src_mix ) {
-        if ( Convert(**i, &dst_loc, eCnvAlways) ) {
-            if ( !dst_mix ) {
-                dst->Reset(new CSeq_loc);
-                dst_mix = &(*dst)->SetMix().Set();
-            }
+        if ( Convert(**i, dst_loc, eCnvAlways) ) {
             _ASSERT(dst_loc);
+            dst_mix = s_ConvertToMix(dst);
             if ( last_truncated  &&
+                !CSeq_loc_Mapper_Base::GetNonMappingAsNull()  &&
                 !dst_loc->IsPartialStart(eExtreme_Biological) ) {
                 dst_loc->SetPartialStart(true, eExtreme_Biological);
             }
@@ -760,9 +808,15 @@ void CSeq_loc_Conversion::ConvertMix(const CSeq_loc& src,
             last_truncated = false;
         }
         else {
-            if ( !last_truncated  &&  *dst  &&
-                !(*dst)->IsPartialStop(eExtreme_Biological) ) {
-                (*dst)->SetPartialStop(true, eExtreme_Biological);
+            if (last_truncated) continue;
+            if (CSeq_loc_Mapper_Base::GetNonMappingAsNull()) {
+                CRef<CSeq_loc> null_loc(new CSeq_loc);
+                null_loc->SetNull();
+                dst_mix = s_ConvertToMix(dst);
+                dst_mix->push_back(null_loc);
+            }
+            else if (dst  &&  !dst->IsPartialStop(eExtreme_Biological)) {
+                dst->SetPartialStop(true, eExtreme_Biological);
             }
             last_truncated = true;
         }
@@ -771,17 +825,22 @@ void CSeq_loc_Conversion::ConvertMix(const CSeq_loc& src,
 
 
 void CSeq_loc_Conversion::ConvertEquiv(const CSeq_loc& src,
-                                       CRef<CSeq_loc>* dst)
+                                       CRef<CSeq_loc>& dst)
 {
     _ASSERT(src.Which() == CSeq_loc::e_Equiv);
     const CSeq_loc_equiv::Tdata& src_equiv = src.GetEquiv().Get();
     CSeq_loc_equiv::Tdata* dst_equiv = 0;
     CRef<CSeq_loc> dst_loc;
     ITERATE ( CSeq_loc_equiv::Tdata, i, src_equiv ) {
-        if ( Convert(**i, &dst_loc, eCnvAlways) ) {
+        if ( Convert(**i, dst_loc, eCnvAlways)  ||
+            CSeq_loc_Mapper::GetNonMappingAsNull()) {
             if ( !dst_equiv ) {
-                dst->Reset(new CSeq_loc);
-                dst_equiv = &(*dst)->SetEquiv().Set();
+                dst.Reset(new CSeq_loc);
+                dst_equiv = &dst->SetEquiv().Set();
+            }
+            if (!dst_loc) {
+                dst_loc.Reset(new CSeq_loc);
+                dst_loc->SetNull();
             }
             dst_equiv->push_back(dst_loc);
         }
@@ -790,14 +849,14 @@ void CSeq_loc_Conversion::ConvertEquiv(const CSeq_loc& src,
 
 
 void CSeq_loc_Conversion::ConvertBond(const CSeq_loc& src,
-                                      CRef<CSeq_loc>* dst)
+                                      CRef<CSeq_loc>& dst)
 {
     _ASSERT(src.Which() == CSeq_loc::e_Bond);
     const CSeq_bond& src_bond = src.GetBond();
     CSeq_bond* dst_bond = 0;
     if ( ConvertPoint(src_bond.GetA()) ) {
-        dst->Reset(new CSeq_loc);
-        dst_bond = &(*dst)->SetBond();
+        dst.Reset(new CSeq_loc);
+        dst_bond = &dst->SetBond();
         dst_bond->SetA(*GetDstPoint());
         if ( src_bond.IsSetB() ) {
             dst_bond->SetB().Assign(src_bond.GetB());
@@ -806,8 +865,8 @@ void CSeq_loc_Conversion::ConvertBond(const CSeq_loc& src,
     if ( src_bond.IsSetB() ) {
         if ( ConvertPoint(src_bond.GetB()) ) {
             if ( !dst_bond ) {
-                dst->Reset(new CSeq_loc);
-                dst_bond = &(*dst)->SetBond();
+                dst.Reset(new CSeq_loc);
+                dst_bond = &dst->SetBond();
                 dst_bond->SetA().Assign(src_bond.GetA());
             }
             dst_bond->SetB(*GetDstPoint());
@@ -817,10 +876,10 @@ void CSeq_loc_Conversion::ConvertBond(const CSeq_loc& src,
 
 
 bool CSeq_loc_Conversion::Convert(const CSeq_loc& src,
-                                  CRef<CSeq_loc>* dst,
+                                  CRef<CSeq_loc>& dst,
                                   EConvertFlag flag)
 {
-    dst->Reset();
+    dst.Reset();
     CSeq_loc* loc = 0;
     _ASSERT(!IsSpecialLoc());
     m_LastType = eMappedObjType_Seq_loc;
@@ -833,14 +892,14 @@ bool CSeq_loc_Conversion::Convert(const CSeq_loc& src,
         break;
     case CSeq_loc::e_Null:
     {
-        dst->Reset(loc = new CSeq_loc);
+        dst.Reset(loc = new CSeq_loc);
         loc->SetNull();
         break;
     }
     case CSeq_loc::e_Empty:
     {
         if ( GoodSrcId(src.GetEmpty()) ) {
-            dst->Reset(loc = new CSeq_loc);
+            dst.Reset(loc = new CSeq_loc);
             loc->SetEmpty(GetDstId());
         }
         break;
@@ -905,7 +964,7 @@ bool CSeq_loc_Conversion::Convert(const CSeq_loc& src,
     if ( flag == eCnvAlways && IsSpecialLoc() ) {
         SetDstLoc(dst);
     }
-    return dst->NotEmpty();
+    return dst.NotEmpty();
 }
 
 
@@ -975,7 +1034,7 @@ void CSeq_loc_Conversion::ConvertCdregion(CAnnotObject_Ref& ref,
     mapped_cbs.clear();
     ITERATE(CCdregion::TCode_break, it, src_cb) {
         CRef<CSeq_loc> cb_loc;
-        Convert((*it)->GetLoc(), &cb_loc, eCnvAlways);
+        Convert((*it)->GetLoc(), cb_loc, eCnvAlways);
         // Preserve partial flag
         ResetKeepPartial();
         if (cb_loc  &&  cb_loc->Which() != CSeq_loc::e_not_set) {
@@ -1042,7 +1101,7 @@ void CSeq_loc_Conversion::ConvertRna(CAnnotObject_Ref& ref,
         mapped_feat->SetData().SetRna().SetExt().SetTRNA().ResetCodon();
     }
     CRef<CSeq_loc> ac_loc;
-    Convert(src_anticodon, &ac_loc, eCnvAlways);
+    Convert(src_anticodon, ac_loc, eCnvAlways);
     // Preserve partial flag
     ResetKeepPartial();
     if (ac_loc  &&  ac_loc->Which() != CSeq_loc::e_not_set) {
@@ -1134,10 +1193,10 @@ void CSeq_loc_Conversion::Convert(CAnnotObject_Ref& ref, ELocationType loctype)
             CRef<CSeq_loc> mapped_loc;
             if ( loctype == eLocation ) {
                 ConvertFeature(ref, *orig_feat, mapped_feat);
-                Convert(orig_feat->GetLocation(), &mapped_loc);
+                Convert(orig_feat->GetLocation(), mapped_loc);
             }
             else {
-                Convert(orig_feat->GetProduct(), &mapped_loc);
+                Convert(orig_feat->GetProduct(), mapped_loc);
             }
             map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
             if ( mapped_feat ) {
@@ -1178,7 +1237,7 @@ void CSeq_loc_Conversion::Convert(CAnnotObject_Ref& ref, ELocationType loctype)
                 orig_loc = created_loc;
             }
             CRef<CSeq_loc> mapped_loc;
-            Convert(*orig_loc, &mapped_loc);
+            Convert(*orig_loc, mapped_loc);
             map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
         }
         break;
@@ -1187,7 +1246,7 @@ void CSeq_loc_Conversion::Convert(CAnnotObject_Ref& ref, ELocationType loctype)
     {
         CRef<CSeq_loc> mapped_loc;
         m_GraphRanges.Reset(new CGraphRanges);
-        Convert(obj.GetGraphFast()->GetLoc(), &mapped_loc);
+        Convert(obj.GetGraphFast()->GetLoc(), mapped_loc);
         map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
         map_info.SetGraphRanges(m_GraphRanges.GetPointerOrNull());
         break;
@@ -1232,10 +1291,10 @@ void CSeq_loc_Conversion::Convert(CAnnotObject_Ref& ref,
             CRef<CSeq_loc> mapped_loc;
             if ( loctype == eLocation ) {
                 ConvertFeature(ref, *orig_feat, mapped_feat);
-                Convert(orig_feat->GetLocation(), &mapped_loc, eCnvAlways);
+                Convert(orig_feat->GetLocation(), mapped_loc, eCnvAlways);
             }
             else {
-                Convert(orig_feat->GetProduct(), &mapped_loc, eCnvAlways);
+                Convert(orig_feat->GetProduct(), mapped_loc, eCnvAlways);
             }
             map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
             if ( mapped_feat ) {
@@ -1281,7 +1340,7 @@ void CSeq_loc_Conversion::Convert(CAnnotObject_Ref& ref,
                 orig_loc = created_loc;
             }
             CRef<CSeq_loc> mapped_loc;
-            Convert(*orig_loc, &mapped_loc);
+            Convert(*orig_loc, mapped_loc);
             map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
         }
         break;
@@ -1290,7 +1349,7 @@ void CSeq_loc_Conversion::Convert(CAnnotObject_Ref& ref,
     {
         CRef<CSeq_loc> mapped_loc;
         m_GraphRanges.Reset(new CGraphRanges);
-        Convert(obj.GetGraphFast()->GetLoc(), &mapped_loc);
+        Convert(obj.GetGraphFast()->GetLoc(), mapped_loc);
         map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
         map_info.SetGraphRanges(m_GraphRanges.GetPointerOrNull());
         break;
@@ -1302,7 +1361,7 @@ void CSeq_loc_Conversion::Convert(CAnnotObject_Ref& ref,
         const CSeqTableInfo& table = annot.GetTableInfo();
         CConstRef<CSeq_loc> loc = table.GetTableLocation();
         if ( loc ) {
-            Convert(*loc, &mapped_loc);
+            Convert(*loc, mapped_loc);
             map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
         }
         break;
@@ -1325,7 +1384,7 @@ void CSeq_loc_Conversion::SetMappedLocation(CAnnotObject_Ref& ref,
     if ( IsSpecialLoc() ) {
         if ( m_DstFuzz_from || m_DstFuzz_to ) {
             CRef<CSeq_loc> mapped_loc;
-            SetDstLoc(&mapped_loc);
+            SetDstLoc(mapped_loc);
             map_info.SetMappedSeq_loc(mapped_loc);
         }
         else if ( m_LastType != eMappedObjType_Seq_loc_mix ) {
@@ -1357,6 +1416,50 @@ void CSeq_loc_Conversion::SetMappedLocation(CAnnotObject_Ref& ref,
 }
 
 
+CSeq_loc_mix::Tdata* CSeq_loc_Conversion::s_ConvertToMix(CRef<CSeq_loc>& loc)
+{
+    if ( !loc ) {
+        loc.Reset(new CSeq_loc);
+        return &loc->SetMix().Set();
+    }
+    if (loc->IsMix()) return &loc->SetMix().Set();
+
+    CRef<CSeq_loc> new_dst(new CSeq_loc);
+    CSeq_loc_mix::Tdata* dst_mix = &new_dst->SetMix().Set();
+    switch (loc->Which()) {
+    case CSeq_loc::e_Packed_int:
+        NON_CONST_ITERATE(CPacked_seqint::Tdata, ii, loc->SetPacked_int().Set()) {
+            CRef<CSeq_loc> mix_loc(new CSeq_loc);
+            mix_loc->SetInt(**ii);
+            dst_mix->push_back(mix_loc);
+        }
+        break;
+    case CSeq_loc::e_Packed_pnt:
+    {
+        CPacked_seqpnt& ppnt = loc->SetPacked_pnt();
+        NON_CONST_ITERATE(CPacked_seqpnt::TPoints, pi, ppnt.SetPoints()) {
+            CRef<CSeq_loc> mix_loc(new CSeq_loc);
+            mix_loc->SetPnt().SetId(ppnt.SetId());
+            if (ppnt.IsSetFuzz()) {
+                mix_loc->SetPnt().SetFuzz(ppnt.SetFuzz());
+            }
+            if (ppnt.IsSetStrand()) {
+                mix_loc->SetPnt().SetStrand(ppnt.SetStrand());
+            }
+            mix_loc->SetPnt().SetPoint(*pi);
+            dst_mix->push_back(mix_loc);
+        }
+        break;
+    }
+    default:
+        dst_mix->push_back(loc);
+        break;
+    }
+    loc.Reset(new_dst);
+    return dst_mix;
+}
+
+
 /////////////////////////////////////////////////////////////////////////////
 // CSeq_loc_Conversion_Set
 /////////////////////////////////////////////////////////////////////////////
@@ -1488,7 +1591,7 @@ void CSeq_loc_Conversion_Set::ConvertCdregion(CAnnotObject_Ref& ref,
     mapped_cbs.clear();
     ITERATE(CCdregion::TCode_break, it, src_cb) {
         CRef<CSeq_loc> cb_loc;
-        Convert((*it)->GetLoc(), &cb_loc, 0);
+        Convert((*it)->GetLoc(), cb_loc, 0);
         m_TotalRange = TRange::GetEmpty();
         if (cb_loc  &&  cb_loc->Which() != CSeq_loc::e_not_set) {
             CRef<CCode_break> cb(new CCode_break);
@@ -1549,7 +1652,7 @@ void CSeq_loc_Conversion_Set::ConvertRna(CAnnotObject_Ref& ref,
         mapped_feat->SetData().SetRna().SetExt().SetTRNA().ResetCodon();
     }
     CRef<CSeq_loc> ac_loc;
-    Convert(src_anticodon, &ac_loc, 0);
+    Convert(src_anticodon, ac_loc, 0);
     // Preserve partial flag
     m_TotalRange = TRange::GetEmpty();
     if (ac_loc  &&  ac_loc->Which() != CSeq_loc::e_not_set) {
@@ -1628,7 +1731,7 @@ void CSeq_loc_Conversion_Set::Convert(CAnnotObject_Ref& ref,
             src_loc = &obj.GetFeatFast()->GetProduct();
             loc_index = 1;
         }
-        Convert(*src_loc, &mapped_loc, loc_index);
+        Convert(*src_loc, mapped_loc, loc_index);
         map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
         break;
     }
@@ -1636,7 +1739,7 @@ void CSeq_loc_Conversion_Set::Convert(CAnnotObject_Ref& ref,
     {
         CRef<CSeq_loc> mapped_loc;
         m_GraphRanges.Reset(new CGraphRanges);
-        Convert(obj.GetGraphFast()->GetLoc(), &mapped_loc, 0);
+        Convert(obj.GetGraphFast()->GetLoc(), mapped_loc, 0);
         map_info.SetMappedSeq_loc(mapped_loc.GetPointerOrNull());
         map_info.SetGraphRanges(m_GraphRanges.GetPointerOrNull());
         break;
@@ -1661,10 +1764,9 @@ void CSeq_loc_Conversion_Set::Convert(CAnnotObject_Ref& ref,
 
 
 bool CSeq_loc_Conversion_Set::ConvertPoint(const CSeq_point& src,
-                                           CRef<CSeq_loc>* dst,
+                                           CRef<CSeq_loc>& dst,
                                            unsigned int loc_index)
 {
-    _ASSERT(*dst);
     bool res = false;
     TRangeIterator mit = BeginRanges(CSeq_id_Handle::GetHandle(src.GetId()),
         src.GetPoint(), src.GetPoint(), loc_index);
@@ -1672,7 +1774,7 @@ bool CSeq_loc_Conversion_Set::ConvertPoint(const CSeq_point& src,
         CSeq_loc_Conversion& cvt = *mit->second;
         cvt.Reset();
         if (cvt.ConvertPoint(src)) {
-            (*dst)->SetPnt(*cvt.GetDstPoint());
+            dst->SetPnt(*cvt.GetDstPoint());
             m_TotalRange += cvt.GetTotalRange();
             res = true;
             break;
@@ -1747,10 +1849,9 @@ namespace {
 
 
 bool CSeq_loc_Conversion_Set::ConvertInterval(const CSeq_interval& src,
-                                              CRef<CSeq_loc>* dst,
+                                              CRef<CSeq_loc>& dst,
                                               unsigned int loc_index)
 {
-    _ASSERT(*dst);
     CRef<CSeq_loc> tmp(new CSeq_loc);
     CPacked_seqint::Tdata& ints = tmp->SetPacked_int().Set();
     TRange total_range(TRange::GetEmpty());
@@ -1816,10 +1917,10 @@ bool CSeq_loc_Conversion_Set::ConvertInterval(const CSeq_interval& src,
         m_GraphRanges->IncOffset(src.GetLength());
     }
     if (ints.size() > 1) {
-        dst->Reset(tmp);
+        dst.Reset(tmp);
     }
     else if (ints.size() == 1) {
-        (*dst)->SetInt(**ints.begin());
+        dst->SetInt(**ints.begin());
     }
     m_TotalRange += total_range;
     // does not guarantee the whole interval is mapped, but should work
@@ -1830,37 +1931,54 @@ bool CSeq_loc_Conversion_Set::ConvertInterval(const CSeq_interval& src,
 
 
 bool CSeq_loc_Conversion_Set::ConvertPacked_int(const CSeq_loc& src,
-                                                CRef<CSeq_loc>* dst,
+                                                CRef<CSeq_loc>& dst,
                                                 unsigned int loc_index)
 {
     bool res = false;
     _ASSERT(src.Which() == CSeq_loc::e_Packed_int);
     const CPacked_seqint::Tdata& src_ints = src.GetPacked_int().Get();
-    CPacked_seqint::Tdata& dst_ints = (*dst)->SetPacked_int().Set();
+    CPacked_seqint::Tdata* dst_ints = &dst->SetPacked_int().Set();
+    // If the result contains NULLs, may need to use mix instead.
+    CSeq_loc_mix::Tdata* dst_mix = 0;
     bool last_truncated = false;
     ITERATE ( CPacked_seqint::Tdata, i, src_ints ) {
         CRef<CSeq_loc> dst_int(new CSeq_loc);
-        bool mapped = ConvertInterval(**i, &dst_int, loc_index);
+        bool mapped = ConvertInterval(**i, dst_int, loc_index);
         if (mapped) {
             if ( last_truncated  &&
+                !CSeq_loc_Mapper_Base::GetNonMappingAsNull()  &&
                 !dst_int->IsPartialStart(eExtreme_Biological) ) {
                 dst_int->SetPartialStart(true, eExtreme_Biological);
             }
-            if ( dst_int->IsInt() ) {
-                dst_ints.push_back(CRef<CSeq_interval>(&dst_int->SetInt()));
-            }
-            else if ( dst_int->IsPacked_int() ) {
-                dst_ints.splice(dst_ints.end(),
-                                dst_int->SetPacked_int().Set());
+            if (dst_mix) {
+                dst_mix->push_back(dst_int);
             }
             else {
-                _ASSERT("this cannot happen" && 0);
+                if ( dst_int->IsInt() ) {
+                    dst_ints->push_back(CRef<CSeq_interval>(&dst_int->SetInt()));
+                }
+                else if ( dst_int->IsPacked_int() ) {
+                    dst_ints->splice(dst_ints->end(),
+                        dst_int->SetPacked_int().Set());
+                }
+                else {
+                    dst_mix = CSeq_loc_Conversion::s_ConvertToMix(dst);
+                    _ASSERT(dst_mix);
+                    dst_mix->push_back(dst_int);
+                }
             }
         }
         else {
-            if ( !last_truncated  &&
-                !(*dst)->IsPartialStop(eExtreme_Biological) ) {
-                (*dst)->SetPartialStop(true, eExtreme_Biological);
+            if (last_truncated) continue;
+            if (CSeq_loc_Mapper_Base::GetNonMappingAsNull()) {
+                dst_mix = CSeq_loc_Conversion::s_ConvertToMix(dst);
+                _ASSERT(dst_mix);
+                CRef<CSeq_loc> null_loc(new CSeq_loc);
+                null_loc->SetNull();
+                dst_mix->push_back(null_loc);
+            }
+            else if (!dst->IsPartialStop(eExtreme_Biological)) {
+                dst->SetPartialStop(true, eExtreme_Biological);
             }
         }
         m_Partial |= !mapped;
@@ -1872,17 +1990,19 @@ bool CSeq_loc_Conversion_Set::ConvertPacked_int(const CSeq_loc& src,
 
 
 bool CSeq_loc_Conversion_Set::ConvertPacked_pnt(const CSeq_loc& src,
-                                                CRef<CSeq_loc>* /* dst */,
+                                                CRef<CSeq_loc>& dst,
                                                 unsigned int loc_index)
 {
     bool res = false;
     _ASSERT(src.Which() == CSeq_loc::e_Packed_pnt);
     const CPacked_seqpnt& src_pack_pnts = src.GetPacked_pnt();
     const CPacked_seqpnt::TPoints& src_pnts = src_pack_pnts.GetPoints();
-    CRef<CSeq_loc> tmp(new CSeq_loc);
     // using mix, not point, since mappings may have
     // different strand, fuzz etc.
-    CSeq_loc_mix::Tdata& locs = tmp->SetMix().Set();
+    if (!dst) {
+        dst.Reset(new CSeq_loc);
+    }
+    CSeq_loc_mix::Tdata& locs = dst->SetMix().Set();
     ITERATE ( CPacked_seqpnt::TPoints, i, src_pnts ) {
         bool mapped = false;
         TSeqPos graph_offset = m_GraphRanges ? m_GraphRanges->GetOffset() : 0;
@@ -1915,6 +2035,11 @@ bool CSeq_loc_Conversion_Set::ConvertPacked_pnt(const CSeq_loc& src,
         if ( m_GraphRanges ) {
             m_GraphRanges->IncOffset(1);
         }
+        if (!mapped && CSeq_loc_Mapper::GetNonMappingAsNull()) {
+            CRef<CSeq_loc> null_loc(new CSeq_loc);
+            null_loc->SetNull();
+            locs.push_back(null_loc);
+        }
         m_Partial |= !mapped;
         res |= mapped;
     }
@@ -1923,20 +2048,21 @@ bool CSeq_loc_Conversion_Set::ConvertPacked_pnt(const CSeq_loc& src,
 
 
 bool CSeq_loc_Conversion_Set::ConvertMix(const CSeq_loc& src,
-                                         CRef<CSeq_loc>* dst,
+                                         CRef<CSeq_loc>& dst,
                                          unsigned int loc_index)
 {
     bool res = false;
     _ASSERT(src.Which() == CSeq_loc::e_Mix);
     const CSeq_loc_mix::Tdata& src_mix = src.GetMix().Get();
     CRef<CSeq_loc> dst_loc;
-    CSeq_loc_mix::Tdata& dst_mix = (*dst)->SetMix().Set();
+    CSeq_loc_mix::Tdata& dst_mix = dst->SetMix().Set();
     bool last_truncated = false;
     ITERATE ( CSeq_loc_mix::Tdata, i, src_mix ) {
         dst_loc.Reset(new CSeq_loc);
-        if ( Convert(**i, &dst_loc, loc_index) ) {
+        if ( Convert(**i, dst_loc, loc_index) ) {
             _ASSERT(dst_loc);
             if ( last_truncated  &&
+                !CSeq_loc_Mapper::GetNonMappingAsNull()  &&
                 !dst_loc->IsPartialStart(eExtreme_Biological) ) {
                 dst_loc->SetPartialStart(true, eExtreme_Biological);
             }
@@ -1945,9 +2071,14 @@ bool CSeq_loc_Conversion_Set::ConvertMix(const CSeq_loc& src,
             last_truncated = false;
         }
         else {
-            if ( !last_truncated  &&
-                !(*dst)->IsPartialStop(eExtreme_Biological) ) {
-                (*dst)->SetPartialStop(true, eExtreme_Biological);
+            if (last_truncated) continue;
+            if (CSeq_loc_Mapper::GetNonMappingAsNull()) {
+                CRef<CSeq_loc> null_loc(new CSeq_loc);
+                null_loc->SetNull();
+                dst_mix.push_back(null_loc);
+            }
+            else if (!dst->IsPartialStop(eExtreme_Biological)) {
+                dst->SetPartialStop(true, eExtreme_Biological);
             }
             last_truncated = true;
         }
@@ -1958,16 +2089,21 @@ bool CSeq_loc_Conversion_Set::ConvertMix(const CSeq_loc& src,
 
 
 bool CSeq_loc_Conversion_Set::ConvertEquiv(const CSeq_loc& src,
-                                           CRef<CSeq_loc>* dst,
+                                           CRef<CSeq_loc>& dst,
                                            unsigned int loc_index)
 {
     bool res = false;
     _ASSERT(src.Which() == CSeq_loc::e_Equiv);
     const CSeq_loc_equiv::Tdata& src_equiv = src.GetEquiv().Get();
     CRef<CSeq_loc> dst_loc;
-    CSeq_loc_equiv::Tdata& dst_equiv = (*dst)->SetEquiv().Set();
+    CSeq_loc_equiv::Tdata& dst_equiv = dst->SetEquiv().Set();
     ITERATE ( CSeq_loc_equiv::Tdata, i, src_equiv ) {
-        if ( Convert(**i, &dst_loc, loc_index) ) {
+        if ( Convert(**i, dst_loc, loc_index)  ||
+            CSeq_loc_Mapper::GetNonMappingAsNull() ) {
+            if (!dst_loc) {
+                dst_loc.Reset(new CSeq_loc);
+                dst_loc->SetNull();
+            }
             dst_equiv.push_back(dst_loc);
             res = true;
         }
@@ -1978,7 +2114,7 @@ bool CSeq_loc_Conversion_Set::ConvertEquiv(const CSeq_loc& src,
 
 
 bool CSeq_loc_Conversion_Set::ConvertBond(const CSeq_loc& src,
-                                          CRef<CSeq_loc>* dst,
+                                          CRef<CSeq_loc>& dst,
                                           unsigned int loc_index)
 {
     bool res = false;
@@ -1986,7 +2122,7 @@ bool CSeq_loc_Conversion_Set::ConvertBond(const CSeq_loc& src,
     const CSeq_bond& src_bond = src.GetBond();
     // using mix, not bond, since mappings may have
     // different strand, fuzz etc.
-    (*dst)->SetBond();
+    dst->SetBond();
     CRef<CSeq_point> pntA;
     CRef<CSeq_point> pntB;
     {{
@@ -2019,7 +2155,7 @@ bool CSeq_loc_Conversion_Set::ConvertBond(const CSeq_loc& src,
             }
         }
     }
-    CSeq_bond& dst_bond = (*dst)->SetBond();
+    CSeq_bond& dst_bond = dst->SetBond();
     if ( pntA  ||  pntB ) {
         if ( pntA ) {
             dst_bond.SetA(*pntA);
@@ -2040,10 +2176,10 @@ bool CSeq_loc_Conversion_Set::ConvertBond(const CSeq_loc& src,
 
 
 bool CSeq_loc_Conversion_Set::Convert(const CSeq_loc& src,
-                                      CRef<CSeq_loc>* dst,
+                                      CRef<CSeq_loc>& dst,
                                       unsigned int loc_index)
 {
-    dst->Reset(new CSeq_loc);
+    dst.Reset(new CSeq_loc);
     bool res = false;
     switch ( src.Which() ) {
     case CSeq_loc::e_not_set:
@@ -2054,7 +2190,7 @@ bool CSeq_loc_Conversion_Set::Convert(const CSeq_loc& src,
         break;
     case CSeq_loc::e_Null:
     {
-        (*dst)->SetNull();
+        dst->SetNull();
         res = true;
         break;
     }
@@ -2068,7 +2204,7 @@ bool CSeq_loc_Conversion_Set::Convert(const CSeq_loc& src,
             CSeq_loc_Conversion& cvt = *mit->second;
             cvt.Reset();
             if ( cvt.GoodSrcId(src.GetEmpty()) ) {
-                (*dst)->SetEmpty(cvt.GetDstId());
+                dst->SetEmpty(cvt.GetDstId());
                 res = true;
                 break;
             }
@@ -2133,12 +2269,12 @@ bool CSeq_loc_Conversion_Set::Convert(const CSeq_loc& src,
 
 
 void CSeq_loc_Conversion_Set::Convert(const CSeq_align& src,
-                                      CRef<CSeq_align>* dst)
+                                      CRef<CSeq_align>& dst)
 {
     CSeq_loc_Mapper loc_mapper(0, NULL);
     CSeq_align_Mapper mapper(src, loc_mapper);
     mapper.Convert(*this);
-    *dst = mapper.GetDstAlign();
+    dst = mapper.GetDstAlign();
 }
 
 
diff --git a/c++/src/objmgr/seq_loc_mapper.cpp b/c++/src/objmgr/seq_loc_mapper.cpp
index 64d4dbc..29d7a5e 100644
--- a/c++/src/objmgr/seq_loc_mapper.cpp
+++ b/c++/src/objmgr/seq_loc_mapper.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_loc_mapper.cpp 479618 2015-09-22 15:42:58Z ivanov $
+/*  $Id: seq_loc_mapper.cpp 479439 2015-09-21 13:04:11Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objmgr/seq_map.cpp b/c++/src/objmgr/seq_map.cpp
index ed4e1d1..7814796 100644
--- a/c++/src/objmgr/seq_map.cpp
+++ b/c++/src/objmgr/seq_map.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_map.cpp 431527 2014-04-04 14:11:48Z vasilche $
+/*  $Id: seq_map.cpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -546,6 +546,15 @@ void CSeqMap::x_SetSeq_data(size_t index, CSeq_data& data)
 }
 
 
+int CSeqMap::x_GetSequenceClass(void) const
+{
+    if ( m_Bioseq ) {
+        return m_Bioseq->GetSequenceClass();
+    }
+    return CBioseq_Handle::eSequenceClass_none;
+}
+
+
 void CSeqMap::x_SetChanged(size_t index)
 {
     while ( m_Resolved > index ) {
diff --git a/c++/src/objmgr/seq_map_ci.cpp b/c++/src/objmgr/seq_map_ci.cpp
index a561fc4..6010198 100644
--- a/c++/src/objmgr/seq_map_ci.cpp
+++ b/c++/src/objmgr/seq_map_ci.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_map_ci.cpp 444531 2014-08-25 18:34:39Z vasilche $
+/*  $Id: seq_map_ci.cpp 499042 2016-04-21 17:39:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -352,6 +352,15 @@ TSeqPos CSeqMap_CI_SegmentInfo::x_GetTopOffset(void) const
 }
 
 
+int CSeqMap_CI_SegmentInfo::x_GetSequenceClass(void) const
+{
+    if ( m_SequenceClass == -1 ) {
+        m_SequenceClass = m_SeqMap->x_GetSequenceClass();
+    }
+    return m_SequenceClass;
+}
+
+
 TSeqPos CSeqMap_CI::x_GetTopOffset(void) const
 {
     return x_GetSegmentInfo().x_GetTopOffset();
@@ -376,6 +385,30 @@ bool CSeqMap_CI::x_CanResolve(const CSeqMap::CSegment& seg) const
 }
 
 
+CBioseq_Handle CSeqMap_CI::x_GetBioseq(const CSeq_id& seq_id) const
+{
+    CBioseq_Handle bh;
+    if ( m_Selector.x_HasLimitTSE() ) {
+        // Check TSE limit
+        bh = m_Selector.x_GetLimitTSE().GetBioseqHandle(seq_id);
+    }
+    else {
+        if ( !GetScope() ) {
+            NCBI_THROW(CSeqMapException, eNullPointer,
+                       "Cannot resolve "+
+                       seq_id.AsFastaString()+": null scope pointer");
+        }
+        bh = GetScope()->GetBioseqHandle(seq_id);
+        if ( !bh && !(GetFlags() & CSeqMap::fIgnoreUnresolved) ) {
+            NCBI_THROW(CSeqMapException, eFail,
+                       "Cannot resolve "+
+                       seq_id.AsFastaString()+": unknown");
+        }
+    }
+    return bh;
+}
+
+
 bool CSeqMap_CI::x_Push(TSeqPos pos, bool resolveExternal)
 {
     const TSegmentInfo& info = x_GetSegmentInfo();
@@ -402,37 +435,20 @@ bool CSeqMap_CI::x_Push(TSeqPos pos, bool resolveExternal)
         if ( !resolveExternal ) {
             return false;
         }
-        const CSeq_id& seq_id =
-            static_cast<const CSeq_id&>(*info.m_SeqMap->x_GetObject(seg));
-        CBioseq_Handle bh;
-        if ( m_Selector.x_HasLimitTSE() ) {
-            // Check TSE limit
-            bh = m_Selector.x_GetLimitTSE().GetBioseqHandle(seq_id);
-            if ( !bh ) {
-                return false;
-            }
+        const CSeq_id& seq_id = info.m_SeqMap->x_GetRefSeqid(seg);
+        CBioseq_Handle bh = x_GetBioseq(seq_id);
+        if ( !bh ) {
+            return false;
         }
-        else {
-            if ( !GetScope() ) {
-                NCBI_THROW(CSeqMapException, eNullPointer,
-                           "Cannot resolve "+
-                           seq_id.AsFastaString()+": null scope pointer");
+        if ( (GetFlags() & CSeqMap::fByFeaturePolicy) ) {
+            CBioseq_Handle::EFeatureFetchPolicy p = bh.GetFeatureFetchPolicy();
+            if ( p != bh.eFeatureFetchPolicy_default ) {
+                m_FeaturePolicyWasApplied = true;
             }
-            bh = GetScope()->GetBioseqHandle(seq_id);
-            if ( !bh ) {
-                if ( GetFlags() & CSeqMap::fIgnoreUnresolved ) {
-                    return false;
-                }
-                NCBI_THROW(CSeqMapException, eFail,
-                           "Cannot resolve "+
-                           seq_id.AsFastaString()+": unknown");
+            if ( p == bh.eFeatureFetchPolicy_only_near ) {
+                return false;
             }
         }
-        if ( (GetFlags() & CSeqMap::fByFeaturePolicy) &&
-            bh.GetFeatureFetchPolicy() == bh.eFeatureFetchPolicy_only_near ) {
-            m_FeaturePolicyWasApplied = true;
-            return false;
-        }
         if ( info.m_TSE ) {
             if ( !info.m_TSE.AddUsedTSE(bh.GetTSE_Handle()) ) {
                 m_Selector.AddUsedTSE(bh.GetTSE_Handle());
@@ -614,28 +630,46 @@ bool CSeqMap_CI::x_Found(void) const
          m_Selector.GetResolveCount() != 0 ) {
         return false;
     }
-    switch ( x_GetSegment().m_SegType ) {
+    const TSegmentInfo& info = x_GetSegmentInfo();
+    const CSeqMap::CSegment& seg = info.x_GetSegment();
+    switch ( seg.m_SegType ) {
     case CSeqMap::eSeqRef:
         if ( (GetFlags() & CSeqMap::fFindLeafRef) != 0 ) {
             if ( (GetFlags() & CSeqMap::fFindInnerRef) != 0 ) {
-                // both
-                return true;
+                // both leaf and inner segments are accepted
             }
             else {
-                // leaf only
-                return !x_CanResolve(x_GetSegment());
+                // leaf only are accepted
+                if ( x_CanResolve(seg) ) {
+                    // this is not a leaf segment
+                    return false;
+                }
             }
         }
         else {
             if ( (GetFlags() & CSeqMap::fFindInnerRef) != 0 ) {
-                // inner only
-                return x_CanResolve(x_GetSegment());
+                // inner only are accepted
+                if ( !x_CanResolve(seg) ) {
+                    // this is a leaf segment
+                    return false;
+                }
             }
             else {
-                // none
+                // none reference segments are accepted
                 return false;
             }
         }
+        if ( (GetFlags() & CSeqMap::fBySequenceClass) ) {
+            int p_class = x_GetSequenceClass();
+            if ( p_class != CBioseq_Handle::eSequenceClass_none ) {
+                const CSeq_id& seq_id = info.m_SeqMap->x_GetRefSeqid(seg);
+                CBioseq_Handle bh = x_GetBioseq(seq_id);
+                if ( bh && p_class != bh.GetSequenceClass() ) {
+                    return false;
+                }
+            }
+        }
+        return true;
     case CSeqMap::eSeqData:
         return (GetFlags() & CSeqMap::fFindData) != 0;
     case CSeqMap::eSeqGap:
@@ -702,6 +736,12 @@ void CSeqMap_CI::x_UpdateLength(void)
 }
 
 
+int CSeqMap_CI::x_GetSequenceClass(void) const
+{
+    return x_GetSegmentInfo().x_GetSequenceClass();
+}
+
+
 ////////////////////////////////////////////////////////////////////
 // CSeqMap_I
 
diff --git a/c++/src/objmgr/seq_table_info.cpp b/c++/src/objmgr/seq_table_info.cpp
index b888006..bd1412d 100644
--- a/c++/src/objmgr/seq_table_info.cpp
+++ b/c++/src/objmgr/seq_table_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_table_info.cpp 469241 2015-06-02 18:43:04Z vasilche $
+/*  $Id: seq_table_info.cpp 484034 2015-11-05 18:59:10Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -236,12 +236,14 @@ bool CSeqTableColumnInfo::UpdateSeq_feat(CSeq_feat& feat,
             return true;
         }
         break;
+    case CSeqTable_multi_data::e_Common_string:
     case CSeqTable_multi_data::e_String:
         if ( const string* ptr = data.GetStringPtr(index) ) {
             setter.SetString(feat, *ptr);
             return true;
         }
         break;
+    case CSeqTable_multi_data::e_Common_bytes:
     case CSeqTable_multi_data::e_Bytes:
         if ( const vector<char>* ptr = data.GetBytesPtr(index) ) {
             setter.SetBytes(feat, *ptr);
diff --git a/c++/src/objmgr/snp_annot_info.cpp b/c++/src/objmgr/snp_annot_info.cpp
index ee21288..2bd6142 100644
--- a/c++/src/objmgr/snp_annot_info.cpp
+++ b/c++/src/objmgr/snp_annot_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: snp_annot_info.cpp 468372 2015-05-22 12:15:20Z vasilche $
+/*  $Id: snp_annot_info.cpp 497230 2016-04-05 13:28:50Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -136,6 +136,20 @@ CUser_field::TData::E_Choice SSNP_Info::GetQualityCodesWhich(void) const
 }
 
 
+inline
+bool CSeq_annot_SNP_Info::x_CheckId(const CSeq_id& id)
+{
+    if ( !m_Seq_id ) {
+        m_Seq_id = SerialClone(id);
+        return true;
+    }
+    if ( m_Seq_id->IsGi() ) {
+        return id.IsGi() && m_Seq_id->GetGi() == id.GetGi();
+    }
+    return m_Seq_id->Equals(id);
+}
+
+
 SSNP_Info::ESNP_Type SSNP_Info::ParseSeq_feat(const CSeq_feat& feat,
                                               CSeq_annot_SNP_Info& annot)
 {
@@ -437,10 +451,7 @@ SSNP_Info::ESNP_Type SSNP_Info::ParseSeq_feat(const CSeq_feat& feat,
         }
     }
 
-    if ( !id->IsGi() ) {
-        return eSNP_Complex_LocationIsNotGi;
-    }
-    if ( !annot.x_CheckGi(id->GetGi()) ) {
+    if ( !annot.x_CheckId(*id) ) {
         return eSNP_Complex_LocationGiIsBad;
     }
 
@@ -481,6 +492,16 @@ CRef<CSeq_feat> SSNP_Info::x_CreateSeq_feat(void) const
 }
 
 
+template<class C>
+C* sx_GetUnreferenced(CRef<C>& ref)
+{
+    if ( !ref || !ref->ReferencedOnlyOnce() ) {
+        ref = new C;
+    }
+    return ref;
+}
+
+
 void SSNP_Info::x_UpdateSeq_featData(CSeq_feat& feat,
                                      const CSeq_annot_SNP_Info& annot) const
 {
@@ -509,9 +530,9 @@ void SSNP_Info::x_UpdateSeq_featData(CSeq_feat& feat,
         size_t qual_index = 0;
         for ( size_t i = 0; i < alleles_count; ++i ) {
             TAlleleIndex allele_index = m_AllelesIndices[i];
-            CGb_qual* gb_qual;
+            CGb_qual* gb_qual = 0;
             if ( qual_index < qual.size() ) {
-                gb_qual = qual[qual_index].GetPointer();
+                gb_qual = sx_GetUnreferenced(qual[qual_index]);
             }
             else {
                 qual.push_back(CRef<CGb_qual>(gb_qual = new CGb_qual));
@@ -525,7 +546,7 @@ void SSNP_Info::x_UpdateSeq_featData(CSeq_feat& feat,
         if ( m_Weight & fwWeightQual ) { // weight in qual
             CGb_qual* gb_qual;
             if ( qual_index < qual.size() ) {
-                gb_qual = qual[qual_index].GetPointer();
+                gb_qual = sx_GetUnreferenced(qual[qual_index]);
             }
             else {
                 qual.push_back(CRef<CGb_qual>(gb_qual = new CGb_qual));
@@ -563,42 +584,45 @@ void SSNP_Info::x_UpdateSeq_featData(CSeq_feat& feat,
     else if ( (m_Flags & fQualityCodesMask) ||
               (m_ExtraIndex != kNo_ExtraIndex) ) {
         // qadata in ext
-        CSeq_feat::TExt& ext = feat.SetExt();
-        CPackString::Assign(ext.SetType().SetStr(), kId_dbSnpQAdata);
-        CSeq_feat::TExt::TData& data = ext.SetData();
+        CUser_object* ext = &feat.SetExt();
+        if ( !ext->ReferencedOnlyOnce() ) {
+            feat.SetExt(*(ext = new CUser_object));
+        }
+        CPackString::Assign(ext->SetType().SetStr(), kId_dbSnpQAdata);
+        CSeq_feat::TExt::TData& data = ext->SetData();
         CSeq_feat::TExt::TData::iterator it = data.begin();
         if ( m_ExtraIndex != kNo_ExtraIndex ) {
+            CUser_field* user_field;
             if ( it == data.end() ) {
-                it = data.insert(it, Ref(new CUser_field));
+                it = data.insert(it, Ref(user_field = new CUser_field));
             }
-            else if ( !*it ) {
-                *it = new CUser_field;
+            else {
+                user_field = sx_GetUnreferenced(*it);
             }
-            CUser_field& user_field = **it;
-            CPackString::Assign(user_field.SetLabel().SetStr(),
+            CPackString::Assign(user_field->SetLabel().SetStr(),
                                 kId_Extra);
             TExtraIndex index = m_ExtraIndex;
-            CPackString::Assign(user_field.SetData().SetStr(),
+            CPackString::Assign(user_field->SetData().SetStr(),
                                 annot.x_GetExtra(index));
             ++it;
         }
         if ( m_Flags & fQualityCodesMask ) {
+            CUser_field* user_field;
             if ( it == data.end() ) {
-                it = data.insert(it, Ref(new CUser_field));
+                it = data.insert(it, Ref(user_field = new CUser_field));
             }
-            else if ( !*it ) {
-                *it = new CUser_field;
+            else {
+                user_field = sx_GetUnreferenced(*it);
             }
-            CUser_field& user_field = **it;
-            CPackString::Assign(user_field.SetLabel().SetStr(),
+            CPackString::Assign(user_field->SetLabel().SetStr(),
                                 kId_QualityCodes);
             TQualityCodesIndex index = m_QualityCodesIndex;
             if ( m_Flags & fQualityCodesStr ) {
-                CPackString::Assign(user_field.SetData().SetStr(),
+                CPackString::Assign(user_field->SetData().SetStr(),
                                     annot.x_GetQualityCodesStr(index));
             }
             else {
-                annot.x_GetQualityCodesOs(index, user_field.SetData().SetOs());
+                annot.x_GetQualityCodesOs(index, user_field->SetData().SetOs());
             }
             ++it;
         }
@@ -611,13 +635,14 @@ void SSNP_Info::x_UpdateSeq_featData(CSeq_feat& feat,
     { // snpid
         CSeq_feat::TDbxref& dbxref = feat.SetDbxref();
         dbxref.resize(1);
-        if ( !dbxref.front() ) {
-            dbxref.front().Reset(new CDbtag);
-        }
-        CDbtag& dbtag = *dbxref[0];
-        CPackString::Assign(dbtag.SetDb(),
+        CDbtag* dbtag = sx_GetUnreferenced(dbxref.front());
+        CPackString::Assign(dbtag->SetDb(),
                             kId_dbSNP);
-        dbtag.SetTag().SetId(m_SNP_Id);
+        CObject_id* id = &dbtag->SetTag();
+        if ( !id->ReferencedOnlyOnce() ) {
+            dbtag->SetTag(*(id = new CObject_id));
+        }
+        id->SetId(m_SNP_Id);
     }
 }
 
@@ -631,14 +656,11 @@ void SSNP_Info::x_UpdateSeq_feat(CSeq_feat& feat,
     { // location
         TSeqPos to_position = m_ToPosition;
         TPositionDelta position_delta = m_PositionDelta;
-        TGi gi = annot.GetGi();
+        const CSeq_id& id = annot.GetSeq_id();
         if ( position_delta == 0 ) {
             // point
             feat.SetLocation().Reset();
-            if ( !seq_point || !seq_point->ReferencedOnlyOnce() ) {
-                seq_point.Reset(new CSeq_point);
-            }
-            CSeq_point& point = *seq_point;
+            CSeq_point& point = *sx_GetUnreferenced(seq_point);
             feat.SetLocation().SetPnt(point);
             point.SetPoint(to_position);
             if ( PlusStrand() ) {
@@ -650,7 +672,7 @@ void SSNP_Info::x_UpdateSeq_feat(CSeq_feat& feat,
             else {
                 point.ResetStrand();
             }
-            point.SetId().SetGi(gi);
+            point.SetId(const_cast<CSeq_id&>(id));
             if ( m_Flags & fFuzzLimTr ) {
                 point.SetFuzz().SetLim(CInt_fuzz::eLim_tr);
             }
@@ -661,10 +683,7 @@ void SSNP_Info::x_UpdateSeq_feat(CSeq_feat& feat,
         else {
             // interval
             feat.SetLocation().Reset();
-            if ( !seq_interval || !seq_interval->ReferencedOnlyOnce() ) {
-                seq_interval.Reset(new CSeq_interval);
-            }
-            CSeq_interval& interval = *seq_interval;
+            CSeq_interval& interval = *sx_GetUnreferenced(seq_interval);
             feat.SetLocation().SetInt(interval);
             interval.SetFrom(to_position-position_delta);
             interval.SetTo(to_position);
@@ -677,7 +696,7 @@ void SSNP_Info::x_UpdateSeq_feat(CSeq_feat& feat,
             else {
                 interval.ResetStrand();
             }
-            interval.SetId().SetGi(gi);
+            interval.SetId(const_cast<CSeq_id&>(id));
         }
     }
 }
@@ -690,7 +709,7 @@ void SSNP_Info::x_UpdateSeq_feat(CSeq_feat& feat,
     { // location
         TSeqPos to_position = m_ToPosition;
         TPositionDelta position_delta = m_PositionDelta;
-        TGi gi = annot.GetGi();
+        const CSeq_id& id = annot.GetSeq_id();
         if ( position_delta == 0 ) {
             // point
             CSeq_point& point = feat.SetLocation().SetPnt();
@@ -704,7 +723,7 @@ void SSNP_Info::x_UpdateSeq_feat(CSeq_feat& feat,
             else {
                 point.ResetStrand();
             }
-            point.SetId().SetGi(gi);
+            point.SetId(const_cast<CSeq_id&>(id));
             if ( m_Flags & fFuzzLimTr ) {
                 point.SetFuzz().SetLim(CInt_fuzz::eLim_tr);
             }
@@ -726,7 +745,7 @@ void SSNP_Info::x_UpdateSeq_feat(CSeq_feat& feat,
             else {
                 interval.ResetStrand();
             }
-            interval.SetId().SetGi(gi);
+            interval.SetId(const_cast<CSeq_id&>(id));
         }
     }
 }
@@ -768,20 +787,18 @@ void SSNP_Info::UpdateSeq_feat(CRef<CSeq_feat>& feat_ref,
 /////////////////////////////////////////////////////////////////////////////
 
 CSeq_annot_SNP_Info::CSeq_annot_SNP_Info(void)
-    : m_Gi(INVALID_GI)
 {
 }
 
 
 CSeq_annot_SNP_Info::CSeq_annot_SNP_Info(CSeq_annot& annot)
-    : m_Gi(INVALID_GI), m_Seq_annot(&annot)
+    : m_Seq_annot(&annot)
 {
 }
 
 
 CSeq_annot_SNP_Info::CSeq_annot_SNP_Info(const CSeq_annot_SNP_Info& info)
-    : m_Gi(info.m_Gi),
-      m_Seq_id(info.m_Seq_id),
+    : m_Seq_id(info.m_Seq_id),
       m_SNP_Set(info.m_SNP_Set),
       m_Comments(info.m_Comments),
       m_Alleles(info.m_Alleles),
@@ -836,7 +853,7 @@ void CSeq_annot_SNP_Info::x_ParentDetach(CSeq_annot_Info& parent)
 
 void CSeq_annot_SNP_Info::x_UpdateAnnotIndexContents(CTSE_Info& tse)
 {
-    CSeq_id_Handle idh = CSeq_id_Handle::GetGiHandle(GetGi());
+    CSeq_id_Handle idh = CSeq_id_Handle::GetHandle(GetSeq_id());
     tse.x_MapSNP_Table(GetParentSeq_annot_Info().GetName(), idh, *this);
     TParent::x_UpdateAnnotIndexContents(tse);
 }
@@ -844,7 +861,7 @@ void CSeq_annot_SNP_Info::x_UpdateAnnotIndexContents(CTSE_Info& tse)
 
 void CSeq_annot_SNP_Info::x_UnmapAnnotObjects(CTSE_Info& tse)
 {
-    CSeq_id_Handle idh = CSeq_id_Handle::GetGiHandle(GetGi());
+    CSeq_id_Handle idh = CSeq_id_Handle::GetHandle(GetSeq_id());
     tse.x_UnmapSNP_Table(GetParentSeq_annot_Info().GetName(), idh, *this);
 }
 
@@ -1018,24 +1035,27 @@ CSeq_annot_SNP_Info::x_GetAlleleIndex(const string& allele)
 }
 
 
-void CSeq_annot_SNP_Info::x_SetGi(TGi gi)
+void CSeq_annot_SNP_Info::SetSeq_id(const CSeq_id& id)
 {
-    _ASSERT(m_Gi == INVALID_GI);
-    m_Gi = gi;
-    _ASSERT(!m_Seq_id);
-    m_Seq_id.Reset(new CSeq_id);
-    m_Seq_id->SetGi(gi);
+    m_Seq_id = SerialClone(id);
 }
 
 
 void CSeq_annot_SNP_Info::SetGi(TGi gi)
 {
-    m_Gi = gi;
-    m_Seq_id.Reset(new CSeq_id);
+    m_Seq_id = new CSeq_id;
     m_Seq_id->SetGi(gi);
 }
 
 
+void CSeq_annot_SNP_Info::OffsetGi(TIntId gi_offset)
+{
+    if ( m_Seq_id->IsGi() ) {
+        m_Seq_id->SetGi(m_Seq_id->GetGi() + gi_offset);
+    }
+}
+
+
 void CSeq_annot_SNP_Info::x_FinishParsing(void)
 {
     // we don't need index maps anymore
@@ -1053,7 +1073,6 @@ void CSeq_annot_SNP_Info::x_FinishParsing(void)
 
 void CSeq_annot_SNP_Info::Reset(void)
 {
-    m_Gi = INVALID_GI;
     m_Seq_id.Reset();
     m_Comments.Clear();
     m_Alleles.Clear();
diff --git a/c++/src/objtools/data_loaders/genbank/split_parser.cpp b/c++/src/objmgr/split_parser.cpp
similarity index 98%
rename from c++/src/objtools/data_loaders/genbank/split_parser.cpp
rename to c++/src/objmgr/split_parser.cpp
index 79de79a..d0fb017 100644
--- a/c++/src/objtools/data_loaders/genbank/split_parser.cpp
+++ b/c++/src/objmgr/split_parser.cpp
@@ -1,4 +1,4 @@
-/*  $Id: split_parser.cpp 440703 2014-07-16 15:38:41Z vasilche $
+/*  $Id: split_parser.cpp 490251 2016-01-22 15:40:54Z vasilche $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -29,25 +29,23 @@
  */
 
 #include <ncbi_pch.hpp>
-#include <objtools/data_loaders/genbank/impl/split_parser.hpp>
-#include <objtools/error_codes.hpp>
-
-#include <objmgr/objmgr_exception.hpp>
-
+#include <objmgr/impl/split_parser.hpp>
 #include <objmgr/impl/tse_info.hpp>
 #include <objmgr/impl/tse_chunk_info.hpp>
 #include <objmgr/impl/tse_split_info.hpp>
 #include <objmgr/impl/seq_annot_info.hpp>
 #include <objmgr/impl/handle_range_map.hpp>
-
+#include <objmgr/objmgr_exception.hpp>
+#include <objmgr/error_codes.hpp>
 #include <objects/seqsplit/seqsplit__.hpp>
 
-
-#define NCBI_USE_ERRCODE_X   Objtools_Rd_Split
+#define NCBI_USE_ERRCODE_X   ObjMgr_Rd_Split
 
 BEGIN_NCBI_SCOPE
-BEGIN_SCOPE(objects)
 
+NCBI_DEFINE_ERR_SUBCODE_X(1);
+
+BEGIN_SCOPE(objects)
 
 void CSplitParser::Attach(CTSE_Info& tse, const CID2S_Split_Info& split)
 {
@@ -93,14 +91,12 @@ CRef<CTSE_Chunk_Info> CSplitParser::Parse(const CID2S_Chunk_Info& info)
         case CID2S_Chunk_Content::e_Seq_assembly:
             x_Attach(*ret, content.GetSeq_assembly());
             break;
-#ifdef OBJECTS_SEQSPLIT_ID2S_SEQ_FEAT_IDS_INFO_HPP
         case CID2S_Chunk_Content::e_Feat_ids:
             ITERATE ( CID2S_Chunk_Content::TFeat_ids, it2,
                       content.GetFeat_ids() ) {
                 x_Attach(*ret, **it2);
             }
             break;
-#endif
         default:
             ERR_POST_X_ONCE(1, "ID2 Split parser: Unexpected split data: "<<content.Which());
         }
@@ -333,7 +329,6 @@ void CSplitParser::x_AddGiInterval(TLocationSet& vec, TGi gi,
 void CSplitParser::x_Attach(CTSE_Chunk_Info& chunk,
                             const CID2S_Seq_feat_Ids_Info& ids)
 {
-#ifdef OBJECTS_SEQSPLIT_ID2S_SEQ_FEAT_IDS_INFO_HPP
     chunk.x_AddFeat_ids();
     ITERATE ( CID2S_Seq_feat_Ids_Info::TFeat_types, it, ids.GetFeat_types() ) {
         const CID2S_Feat_type_Info& type = **it;
@@ -383,7 +378,6 @@ void CSplitParser::x_Attach(CTSE_Chunk_Info& chunk,
             }
         }
     }
-#endif
 }
 
 
diff --git a/c++/src/objmgr/tse_assigner.cpp b/c++/src/objmgr/tse_assigner.cpp
index 3a39846..4f85ad7 100644
--- a/c++/src/objmgr/tse_assigner.cpp
+++ b/c++/src/objmgr/tse_assigner.cpp
@@ -1,4 +1,4 @@
-/*  $Id: tse_assigner.cpp 485121 2015-11-18 19:39:49Z vasilche $
+/*  $Id: tse_assigner.cpp 485106 2015-11-18 18:58:49Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objmgr/tse_info.cpp b/c++/src/objmgr/tse_info.cpp
index 352c824..b1f6e97 100644
--- a/c++/src/objmgr/tse_info.cpp
+++ b/c++/src/objmgr/tse_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: tse_info.cpp 469738 2015-06-08 16:26:44Z ivanov $
+/*  $Id: tse_info.cpp 469582 2015-06-05 18:36:59Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objmgr/tse_split_info.cpp b/c++/src/objmgr/tse_split_info.cpp
index 4e9468f..f86578a 100644
--- a/c++/src/objmgr/tse_split_info.cpp
+++ b/c++/src/objmgr/tse_split_info.cpp
@@ -1,4 +1,4 @@
-/*  $Id: tse_split_info.cpp 472380 2015-07-09 14:16:30Z ivanov $
+/*  $Id: tse_split_info.cpp 471824 2015-07-01 17:23:26Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objmgr/util/Makefile.util.lib b/c++/src/objmgr/util/Makefile.util.lib
index df273ad..39cb3a6 100644
--- a/c++/src/objmgr/util/Makefile.util.lib
+++ b/c++/src/objmgr/util/Makefile.util.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.util.lib 474406 2015-07-28 18:14:17Z ivanov $
+# $Id: Makefile.util.lib 472056 2015-07-06 19:29:12Z gotvyans $
 
 # Build library "xobjutil"
 ###############################
diff --git a/c++/src/objmgr/util/create_defline.cpp b/c++/src/objmgr/util/create_defline.cpp
index de3644c..8aec30e 100644
--- a/c++/src/objmgr/util/create_defline.cpp
+++ b/c++/src/objmgr/util/create_defline.cpp
@@ -365,6 +365,7 @@ void CDeflineGenerator::x_SetFlags (
     m_LocalAnnotsOnly = (flags & fLocalAnnotsOnly) != 0;
     m_GpipeMode = (flags & fGpipeMode) != 0;
     m_OmitTaxonomicName = (flags & fOmitTaxonomicName) != 0;
+    m_DevMode = (flags & fDevMode) != 0;
 
     // reset member variables to cleared state
     m_IsNA = false;
@@ -385,6 +386,7 @@ void CDeflineGenerator::x_SetFlags (
     m_ThirdParty = false;
     m_WGSMaster = false;
     m_TSAMaster = false;
+    m_TLSMaster = false;
 
     m_MainTitle.clear();
     m_GeneralStr.clear();
@@ -401,6 +403,7 @@ void CDeflineGenerator::x_SetFlags (
 
     m_HTGTech = false;
     m_HTGSUnfinished = false;
+    m_IsTLS = false;
     m_IsTSA = false;
     m_IsWGS = false;
     m_IsEST_STS_GSS = false;
@@ -445,6 +448,7 @@ void CDeflineGenerator::x_SetFlags (
     m_Strain.clear();
 
     m_IsUnverified = false;
+    m_TargetedLocus.clear();
 
     m_rEnzyme.clear();
 
@@ -629,6 +633,13 @@ void CDeflineGenerator::x_SetFlags (
                     m_IsTSA = true;
                     m_UseBiosrc = true;
                     break;
+                case NCBI_TECH(targeted):
+                    m_IsTLS = true;
+                    m_UseBiosrc = true;
+                    if (m_IsVirtual) {
+                        m_TLSMaster = true;
+                    }
+                    break;
                 default:
                     break;
             }
@@ -646,10 +657,21 @@ void CDeflineGenerator::x_SetFlags (
             }
 
             const CUser_object& user_obj = desc_it->GetUser();
-            if (FIELD_IS_SET_AND_IS(user_obj, Type, Str)
-                &&  user_obj.GetType().GetStr() == "Unverified" ) {
-                m_IsUnverified = true;
-                needed_desc_choices &= ~fUser;
+            if (FIELD_IS_SET_AND_IS(user_obj, Type, Str)) {
+                if (user_obj.GetType().GetStr() == "Unverified" ) {
+                    m_IsUnverified = true;
+                    needed_desc_choices &= ~fUser;
+                } else if (user_obj.GetType().GetStr() == "AutodefOptions" ) {
+                    FOR_EACH_USERFIELD_ON_USEROBJECT (uitr, user_obj) {
+                        const CUser_field& fld = **uitr;
+                        if (! FIELD_IS_SET_AND_IS(fld, Label, Str)) continue;
+                        const string &label_str = GET_FIELD(fld.GetLabel(), Str);
+                        if (! NStr::EqualNocase(label_str, "Targeted Locus Name")) continue;
+                        if (fld.IsSetData() && fld.GetData().IsStr()) {
+                            m_TargetedLocus = fld.GetData().GetStr();
+                        }
+                    }
+                }
             }
             break;
         }
@@ -1056,10 +1078,6 @@ void CDeflineGenerator::x_SetTitleFromBioSrc (void)
             joiner.Add(" strain ").Add(add);
         }
     }
-    if (! m_Chromosome.empty()) {
-        joiner.Add(" chromosome ").Add(m_Chromosome);
-    }
-    /*
     if (! m_Breed.empty()) {
         joiner.Add(" breed ").Add(m_Breed.substr (0, m_Breed.find(';')));
     }
@@ -1067,9 +1085,14 @@ void CDeflineGenerator::x_SetTitleFromBioSrc (void)
         joiner.Add(" cultivar ").Add(m_Cultivar.substr (0, m_Cultivar.find(';')));
     }
     if (! m_Isolate.empty()) {
-        joiner.Add(" isolate ").Add(m_Isolate);
+        // x_EndsWithStrain just checks for supplied pattern, using here for isolate
+        if (! x_EndsWithStrain (m_Taxname, m_Isolate)) {
+            joiner.Add(" isolate ").Add(m_Isolate);
+        }
+    }
+    if (! m_Chromosome.empty()) {
+        joiner.Add(" chromosome ").Add(m_Chromosome);
     }
-    */
     if (m_has_clone) {
         x_DescribeClones (clnvec, clnbuf);
         ITERATE (vector<CTempString>, it, clnvec) {
@@ -1079,8 +1102,29 @@ void CDeflineGenerator::x_SetTitleFromBioSrc (void)
     if (! m_Map.empty()) {
         joiner.Add(" map ").Add(m_Map);
     }
-    if (m_IsWGS  &&  ! m_Plasmid.empty()) {
-        joiner.Add(" plasmid ").Add(m_Plasmid);
+
+    if (! m_Organelle.empty()) {
+        if (NStr::FindNoCase(m_Organelle, "chromosome") != NPOS) {
+            /*
+            if (m_Chromosome.empty()) {
+                joiner.Add(" ").Add(m_Organelle);
+            }
+            */
+        } else if (NStr::FindNoCase(m_Organelle, "plasmid") != NPOS) {
+            if (m_Plasmid.empty() && m_Chromosome.empty()) {
+                joiner.Add(" ").Add(m_Organelle);
+            }
+        } else {
+            joiner.Add(" ").Add(m_Organelle);
+        }
+    }
+
+    if (! m_Plasmid.empty()) {
+        if (NStr::FindNoCase(m_Organelle, "plasmid") != NPOS) {
+            joiner.Add(" plasmid ").Add(m_Plasmid);
+        } else {
+            joiner.Add(" ").Add(m_Plasmid);
+        }
     }
 
     joiner.Join(&m_MainTitle);
@@ -1989,6 +2033,12 @@ void CDeflineGenerator::x_SetTitleFromWGS (void)
         joiner.Add(" cultivar ");
         joiner.Add(m_Cultivar.substr (0, m_Cultivar.find(';')));
     }
+    if (! m_Isolate.empty()) {
+        // x_EndsWithStrain just checks for supplied pattern, using here for isolate
+        if (! x_EndsWithStrain (m_Taxname, m_Isolate)) {
+            joiner.Add(" isolate ").Add(m_Isolate);
+        }
+    }
     if (! m_Chromosome.empty()) {
         joiner.Add(" chromosome ").Add(m_Chromosome);
     }
@@ -2069,6 +2119,8 @@ void CDeflineGenerator::x_SetPrefix (
         }
     } else if (m_IsTSA) {
         prefix = "TSA: ";
+    } else if (m_IsTLS) {
+        prefix = "TLS: ";
     } else if (m_ThirdParty) {
         if (m_TPAExp) {
             prefix = "TPA_exp: ";
@@ -2087,11 +2139,13 @@ void CDeflineGenerator::x_SetPrefix (
 // generate suffix if not already present
 void CDeflineGenerator::x_SetSuffix (
     string& suffix,
-    const CBioseq_Handle& bsh
+    const CBioseq_Handle& bsh,
+    bool appendComplete
 )
 
 {
     string type;
+    string study;
     string comp;
 
     switch (m_MITech) {
@@ -2201,10 +2255,44 @@ void CDeflineGenerator::x_SetSuffix (
                 }
             }
             break;
+        case NCBI_TECH(targeted):
+            if (m_TLSMaster) {
+                if (m_MainTitle.find ("targeted locus study") == NPOS) {
+                    type = ", targeted locus study";
+                }
+            } else {
+                if (m_MainTitle.find ("sequence") == NPOS) {
+                   type += ", sequence";
+                }
+            }
+            if (! m_TargetedLocus.empty() && m_MainTitle.find (m_TargetedLocus) == NPOS) {
+                study = m_TargetedLocus;
+            }
+            break;
         default:
             break;
     }
 
+    if (appendComplete && m_MainTitle.find ("complete") == NPOS && m_MainTitle.find ("partial") == NPOS) {
+        if (m_MICompleteness == NCBI_COMPLETENESS(complete)) {
+            if (m_IsPlasmid) {
+                comp = ", complete sequence";
+            } else if (m_Genome == NCBI_GENOME(mitochondrion) ||
+                       m_Genome == NCBI_GENOME(chloroplast) ||
+                       m_Genome == NCBI_GENOME(kinetoplast) ||
+                       m_Genome == NCBI_GENOME(plastid) ||
+                       m_Genome == NCBI_GENOME(apicoplast)) {
+                comp = ", complete genome";
+            } else if (m_IsChromosome) {
+                if (! m_Chromosome.empty()) {
+                    comp = ", complete sequence";
+                } else {
+                    comp = ", complete genome";
+                }
+            }
+        }
+    }
+
     if (m_Unordered && m_IsDelta) {
         unsigned int num_gaps = 0;
         for (CSeqMap_CI it (bsh, CSeqMap::fFindGap); it; ++it) {
@@ -2216,7 +2304,11 @@ void CDeflineGenerator::x_SetSuffix (
         }
     }
 
-    suffix = type + comp;
+    if (! study.empty()) {
+        suffix = " " + study + " " + type + comp;
+    } else {
+        suffix = type + comp;
+    }
 }
 
 static inline void s_TrimMainTitle (string& str)
@@ -2452,6 +2544,7 @@ string CDeflineGenerator::GenerateDefline (
 
 {
     bool capitalize = true;
+    bool appendComplete = false;
 
     string prefix; // from a small set of compile-time constants
     string suffix;
@@ -2501,7 +2594,7 @@ string CDeflineGenerator::GenerateDefline (
                 x_SetTitleFromProtein (bsh);
             } else if (m_IsSeg && (! m_IsEST_STS_GSS)) {
                 x_SetTitleFromSegSeq (bsh);
-            } else if (m_IsTSA || (m_IsWGS && (! m_WGSMaster))) {
+            } else if (m_IsTSA || (m_IsWGS && (! m_WGSMaster)) || (m_IsTLS && (! m_TLSMaster))) {
                 x_SetTitleFromWGS ();
             } else if (m_IsMap) {
                 x_SetTitleFromMap ();
@@ -2515,12 +2608,17 @@ string CDeflineGenerator::GenerateDefline (
         if (m_MainTitle.empty()) {
             // default title using source fields
             x_SetTitleFromBioSrc ();
+            if (m_MICompleteness == NCBI_COMPLETENESS(complete) && ! m_MainTitle.empty()) {
+                appendComplete = true;
+            }
         }
 
+        /*
         if (m_MainTitle.empty()) {
             // last resort title created here
-            //m_MainTitle = "No definition line found";
+            m_MainTitle = "No definition line found";
         }
+        */
     }
 
     // remove TPA or TSA prefix, will rely on other data in record to set
@@ -2547,7 +2645,7 @@ string CDeflineGenerator::GenerateDefline (
     x_SetPrefix(prefix);
 
     // calculate suffix
-    x_SetSuffix (suffix, bsh);
+    x_SetSuffix (suffix, bsh, appendComplete);
 
     // produce final result
     string penult = prefix + decoded + suffix;
diff --git a/c++/src/objmgr/util/feature.cpp b/c++/src/objmgr/util/feature.cpp
index 4929bb7..fbc0f0f 100644
--- a/c++/src/objmgr/util/feature.cpp
+++ b/c++/src/objmgr/util/feature.cpp
@@ -1,4 +1,4 @@
-/*  $Id: feature.cpp 480957 2015-10-06 12:01:31Z ivanov $
+/*  $Id: feature.cpp 499447 2016-04-26 14:17:39Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -92,6 +92,12 @@ BEGIN_SCOPE(objects)
 BEGIN_SCOPE(feature)
 USING_SCOPE(sequence);
 
+// internal prototypes
+bool sFeatureGetChildrenOfSubtypeFaster(CMappedFeat, CSeqFeatData::ESubtype, 
+    vector<CMappedFeat>&, feature::CFeatTree&);
+bool sFeatureGetChildrenOfSubtype(CMappedFeat, CSeqFeatData::ESubtype, 
+    vector<CMappedFeat>&);
+bool sGetFeatureGeneBiotypeWrapper(feature::CFeatTree&, CMappedFeat, string&, bool);
 
 // Appends a label onto "label" based on the type of feature       
 void s_GetTypeLabel(const CSeq_feat& feat, string* label, TFeatLabelFlags flags)
@@ -299,8 +305,7 @@ static void s_GetRnaRefLabel
                 }
             }
         }
-        if ((flags & fFGL_Type) == 0  &&  type_label != 0
-            &&  tmp_label.find(*type_label) == string::npos) {
+        if ((flags & fFGL_Type) == 0  &&  type_label != 0 && !tmp_label.empty() && tmp_label.find(*type_label) == string::npos) {
             *label += *type_label + "-" + tmp_label;
         } else if (!tmp_label.empty()) {
             *label += tmp_label;
@@ -3408,20 +3413,20 @@ bool AdjustFeaturePartialFlagForLocation(CSeq_feat& new_feat)
 
 
 // A function to change an existing MolInfo to match a coding region
-bool AdjustProteinFeaturePartialsToMatchCDS(CSeq_feat& new_prot, const CSeq_feat& cds)
+bool CopyFeaturePartials(CSeq_feat& dst, const CSeq_feat& src)
 {
     bool any_change = false;
-    bool partial5 = cds.GetLocation().IsPartialStart(eExtreme_Biological);
-    bool partial3 = cds.GetLocation().IsPartialStop(eExtreme_Biological);
-    bool prot_5 = new_prot.GetLocation().IsPartialStart(eExtreme_Biological);
-    bool prot_3 = new_prot.GetLocation().IsPartialStop(eExtreme_Biological);
+    bool partial5 = src.GetLocation().IsPartialStart(eExtreme_Biological);
+    bool partial3 = src.GetLocation().IsPartialStop(eExtreme_Biological);
+    bool prot_5 = dst.GetLocation().IsPartialStart(eExtreme_Biological);
+    bool prot_3 = dst.GetLocation().IsPartialStop(eExtreme_Biological);
     if ((partial5 && !prot_5) || (!partial5 && prot_5)
         || (partial3 && !prot_3) || (!partial3 && prot_3)) {
-        new_prot.SetLocation().SetPartialStart(partial5, eExtreme_Biological);
-        new_prot.SetLocation().SetPartialStop(partial3, eExtreme_Biological);
+        dst.SetLocation().SetPartialStart(partial5, eExtreme_Biological);
+        dst.SetLocation().SetPartialStop(partial3, eExtreme_Biological);
         any_change = true;
     }
-    any_change |= AdjustFeaturePartialFlagForLocation(new_prot);
+    any_change |= AdjustFeaturePartialFlagForLocation(dst);
     return any_change;
 }
 
@@ -3446,8 +3451,14 @@ bool AdjustProteinMolInfoToMatchCDS(CMolInfo& molinfo, const CSeq_feat& cds)
     else if (partial3) {
         completeness = CMolInfo::eCompleteness_no_right;
     }
-    if (!molinfo.IsSetCompleteness() || molinfo.GetCompleteness() != completeness) {
-        molinfo.SetCompleteness(completeness);
+
+    if (!molinfo.IsSetCompleteness() || molinfo.GetCompleteness() != completeness)
+    {
+        if (completeness == CMolInfo::eCompleteness_complete)
+           molinfo.SetDefaultCompleteness();
+        else
+           molinfo.SetCompleteness(completeness);
+
         rval = true;
     }
     return rval;
@@ -3479,7 +3490,7 @@ bool AdjustForCDSPartials(const CSeq_feat& cds, CSeq_entry_Handle seh)
         CSeq_feat_EditHandle feh(*f);
         CRef<CSeq_feat> new_feat(new CSeq_feat());
         new_feat->Assign(*(f->GetSeq_feat()));
-        if (AdjustProteinFeaturePartialsToMatchCDS(*new_feat, cds)) {
+        if (CopyFeaturePartials(*new_feat, cds)) {
             feh.Replace(*new_feat);
             any_change = true;
         }
@@ -3554,40 +3565,101 @@ bool RetranslateCDS(const CSeq_feat& cds, CScope& scope)
 }
 
 
-bool sFeatureGetChildrenOfSubtype(
+void AddFeatureToBioseq(const CBioseq& seq, const CSeq_feat& f, CScope& scope)
+{
+    bool added = false;
+    if (seq.IsSetAnnot()) {
+        ITERATE(CBioseq::TAnnot, it, seq.GetAnnot()) {
+            if ((*it)->IsFtable()) {
+                CSeq_annot_Handle sah = scope.GetSeq_annotHandle(**it);
+                CSeq_annot_EditHandle eh(sah);
+                eh.AddFeat(f);
+                added = true;
+                break;
+            }
+        }
+    }
+    if (!added) {
+        CRef<CSeq_annot> annot(new CSeq_annot());
+        CRef<CSeq_feat> sf(new CSeq_feat());
+        sf->Assign(f);
+        annot->SetData().SetFtable().push_back(sf);
+        CBioseq_Handle bh = scope.GetBioseqHandle(seq);
+        CBioseq_EditHandle beh(bh);
+        beh.AttachAnnot(*annot);
+    }
+}
+
+
+void AddProteinFeature(const CBioseq& seq, const string& protein_name, const CSeq_feat& cds, CScope& scope)
+{
+    // make new protein feature
+    CRef<CSeq_feat> new_prot(new CSeq_feat());
+    new_prot->SetLocation().SetInt().SetId().Assign(*(cds.GetProduct().GetId()));
+    new_prot->SetLocation().SetInt().SetFrom(0);
+    new_prot->SetLocation().SetInt().SetTo(seq.GetLength() - 1);
+    new_prot->SetData().SetProt().SetName().push_back(protein_name);
+    CopyFeaturePartials(*new_prot, cds);
+
+    AddFeatureToBioseq(seq, *new_prot, scope);
+}
+
+
+//  ----------------------------------------------------------------------------
+bool sFeatureGetChildrenOfSubtypeFaster(
     CMappedFeat mf,
     CSeqFeatData::ESubtype subtype,
     vector<CMappedFeat>& children,
-    feature::CFeatTree* pTree = 0)
+    feature::CFeatTree& featTree)
+//  ----------------------------------------------------------------------------
 {
     const CSeq_feat& ff = mf.GetOriginalFeature();
-    bool bTreeIsMine = false;
-    if (!pTree) {
-        pTree = new feature::CFeatTree;
-        pTree->AddFeaturesFor(mf, subtype, mf.GetFeatSubtype());
-        bTreeIsMine = true;
-    }
 
-    vector<CMappedFeat> c = pTree->GetChildren(mf);
+    vector<CMappedFeat> c = featTree.GetChildren(mf);
     for (vector<CMappedFeat>::iterator it = c.begin(); it != c.end(); it++) {
         CMappedFeat f = *it;
         if (f.GetFeatSubtype() == subtype) {
             children.push_back(f);
         }
         else {
-            sFeatureGetChildrenOfSubtype(f, subtype, children, pTree);
+            sFeatureGetChildrenOfSubtypeFaster(f, subtype, children, featTree);
         }
     }
-    if (bTreeIsMine) {
-        delete pTree;
+    return true;
+}
+
+
+//  ----------------------------------------------------------------------------
+bool sFeatureGetChildrenOfSubtype(
+    CMappedFeat mf,
+    CSeqFeatData::ESubtype subtype,
+    vector<CMappedFeat>& children)
+//  ----------------------------------------------------------------------------
+{
+    const CSeq_feat& ff = mf.GetOriginalFeature();
+    feature::CFeatTree myTree;
+    myTree.AddFeaturesFor(mf, subtype, mf.GetFeatSubtype());
+
+    vector<CMappedFeat> c = myTree.GetChildren(mf);
+    for (vector<CMappedFeat>::iterator it = c.begin(); it != c.end(); it++) {
+        CMappedFeat f = *it;
+        if (f.GetFeatSubtype() == subtype) {
+            children.push_back(f);
+        }
+        else {
+            sFeatureGetChildrenOfSubtypeFaster(f, subtype, children, myTree);
+        }
     }
     return true;
 }
 
-bool GetFeatureGeneBiotype(
-    feature::CFeatTree ft,
+//  ----------------------------------------------------------------------------
+bool sGetFeatureGeneBiotypeWrapper(
+    feature::CFeatTree& ft,
     CMappedFeat mf,
-    string& biotype)
+    string& biotype,
+    bool fast)
+//  ----------------------------------------------------------------------------
 {
 #define SUBTYPE(x) CSeqFeatData::eSubtype_ ## x
 
@@ -3612,7 +3684,12 @@ bool GetFeatureGeneBiotype(
     // }
 
     vector<CMappedFeat> vecCds;
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(cdregion), vecCds);
+    if (fast) {
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(cdregion), vecCds, ft);
+    }
+    else {
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(cdregion), vecCds);
+    }
 
     //1a 
     // If there is at least one non-pseudo CDS child without a 
@@ -3631,19 +3708,34 @@ bool GetFeatureGeneBiotype(
     }
 
     vector<CMappedFeat> vecOthers;
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(V_region), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(C_region), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(V_segment), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(D_segment), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(J_segment), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(tRNA), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(rRNA), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(snRNA), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(snoRNA), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(tmRNA), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(otherRNA), vecOthers);
-    sFeatureGetChildrenOfSubtype(mf, SUBTYPE(ncRNA), vecOthers);
-
+    if (fast) {
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(V_region), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(C_region), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(V_segment), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(D_segment), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(J_segment), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(tRNA), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(rRNA), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(snRNA), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(snoRNA), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(tmRNA), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(otherRNA), vecOthers, ft);
+        sFeatureGetChildrenOfSubtypeFaster(mf, SUBTYPE(ncRNA), vecOthers, ft);
+    }
+    else{
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(V_region), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(C_region), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(V_segment), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(D_segment), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(J_segment), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(tRNA), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(rRNA), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(snRNA), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(snoRNA), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(tmRNA), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(otherRNA), vecOthers);
+        sFeatureGetChildrenOfSubtype(mf, SUBTYPE(ncRNA), vecOthers);
+    }
     CSeqFeatData::ESubtype singleSubtype = SUBTYPE(bad);
     CMappedFeat nonPseudo;
 
@@ -3750,6 +3842,27 @@ bool GetFeatureGeneBiotype(
 }
 
 
+//  ----------------------------------------------------------------------------
+bool GetFeatureGeneBiotypeFaster(
+    feature::CFeatTree& ft,
+    CMappedFeat mf,
+    string& biotype)
+//  ----------------------------------------------------------------------------
+{
+    return sGetFeatureGeneBiotypeWrapper(ft, mf, biotype, true);
+}
+
+//  ----------------------------------------------------------------------------
+bool GetFeatureGeneBiotype(
+    feature::CFeatTree& ft,
+    CMappedFeat mf,
+    string& biotype)
+//  ----------------------------------------------------------------------------
+{
+    return sGetFeatureGeneBiotypeWrapper(ft, mf, biotype, false);
+}
+
+
 END_SCOPE(feature)
 END_SCOPE(objects)
 END_NCBI_SCOPE
diff --git a/c++/src/objmgr/util/objutil.cpp b/c++/src/objmgr/util/objutil.cpp
index 3d7b893..4dd7c34 100644
--- a/c++/src/objmgr/util/objutil.cpp
+++ b/c++/src/objmgr/util/objutil.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objutil.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: objutil.cpp 487384 2015-12-17 13:38:09Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -61,14 +61,14 @@
 BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
 
-bool IsPartOfUrl(
-    const string& sentence,
-    size_t pos )
+
+SAFE_CONST_STATIC_STRING(kLegalPathChars, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-.");
+
+bool IsPartOfUrl(const string& sentence, size_t pos)
 {
     string separators( "( \t\r\n" );
-    const static string legal_path_chars(
-        "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-." );
-    
+    const string& legal_path_chars = kLegalPathChars.Get();
+
     //
     //  Weed out silly input:
     //
@@ -133,6 +133,7 @@ bool IsPartOfUrl(
     return false; /* never found the terminating '/' */
 };
 
+
 static bool s_RunOfStars(string& s, SIZE_TYPE start, SIZE_TYPE length)
 {
     SIZE_TYPE max = start + 66;
@@ -147,9 +148,9 @@ static bool s_RunOfStars(string& s, SIZE_TYPE start, SIZE_TYPE length)
     return true;
 }
 
+
 void ExpandTildes(string& s, ETildeStyle style)
 {
-
     if ( style == eTilde_tilde ) {
         return;
     }
@@ -343,7 +344,7 @@ bool RemovePeriodFromEnd(string& str, bool keep_ellipsis)
     } */
 
     /**
-    static const string kEllipsis = "...";
+    static const char* kEllipsis = "...";
 
     if ( NStr::EndsWith(str, '.') ) {
         if ( !keep_ellipsis  ||  !NStr::EndsWith(str, kEllipsis) ) {
@@ -386,7 +387,7 @@ class CIsGraph
 {
 public:
     bool operator()( const char c ) {
-        return isgraph(c);
+        return isgraph((unsigned char)c) != 0;
     }
 };
 
@@ -529,7 +530,7 @@ bool TrimSpacesAndJunkFromEnds(string& str, bool allow_ellipsis)
     // while we're at it, also check if the junk contains a tilde and/or period
     bool isPeriod = false;
     bool isTilde = false;
-    int start_of_junk_pos = str.length() - 1;
+    int start_of_junk_pos = (int)str.length() - 1;
     for( ; start_of_junk_pos >= 0 ; --start_of_junk_pos ) {
         const char ch = str[start_of_junk_pos];
         if (ch <= ' ' || ch == '.' || ch == ',' || ch == '~' || ch == ';') {
@@ -580,7 +581,7 @@ bool TrimSpacesAndJunkFromEnds(string& str, bool allow_ellipsis)
         // holds the suffix to add after we remove the junk
         const char * suffix = ""; // by default, just remove junk
 
-        const int chars_in_junk = ( str.length() - start_of_junk_pos );
+        const int chars_in_junk = ( (int)str.length() - start_of_junk_pos );
         _ASSERT( chars_in_junk >= 1 );
 
         // allow one period at end
@@ -733,9 +734,9 @@ void TrimSpacesAndJunkFromEnds(string& result, const CTempString& str, bool allo
         static const int kMaxCharsToLookAt = 20;
 
         // go backwards, looking for the ampersand
-        int amp_iter = (start_of_junk_pos - 1);
+        int amp_iter = ((int)start_of_junk_pos - 1);
         for (; amp_iter >= 0 && ((start_of_junk_pos - amp_iter) < kMaxCharsToLookAt); --amp_iter) {
-            const char ch = str[amp_iter];
+            const unsigned char ch = str[amp_iter];
             if (isalnum(ch) || ch == '#') {
                 // just keep going
             }
@@ -757,7 +758,7 @@ void TrimSpacesAndJunkFromEnds(string& result, const CTempString& str, bool allo
     // if there's junk, chop it off (but leave period/tildes/ellipsis as appropriate)
     if (start_of_junk_pos < str.length()) {
 
-        const int chars_in_junk = (str.length() - start_of_junk_pos);
+        const int chars_in_junk = (int)(str.length() - start_of_junk_pos);
         _ASSERT(chars_in_junk >= 1);
 
         // allow one period at end
@@ -1220,21 +1221,21 @@ void DateToString(const CDate& date, string& str, EDateToString format_choice )
 {
     // One day we should make regular format default to JAN, since "JUN" seems
     // kind of arbitrary.
-    static const string regular_format  = "%{%2D%|01%}-%{%3N%|JUN%}-%Y";
-    static const string cit_sub_format = "%{%2D%|??%}-%{%3N%|???%}-%{%4Y%|/???%}";
-    static const string patent_format  = "%{%2D%|01%}-%{%3N%|JAN%}-%Y";
+    static const char* regular_format = "%{%2D%|01%}-%{%3N%|JUN%}-%Y";
+    static const char* cit_sub_format = "%{%2D%|??%}-%{%3N%|???%}-%{%4Y%|/???%}";
+    static const char* patent_format  = "%{%2D%|01%}-%{%3N%|JAN%}-%Y";
 
-    const string& format = ( format_choice == eDateToString_cit_sub ?
+    const char* format = ( format_choice == eDateToString_cit_sub ?
         cit_sub_format :
         ( format_choice == eDateToString_patent ? patent_format : regular_format ) );
 
     string date_str;
     date.GetDate(&date_str, format);
     NStr::ToUpper(date_str);
-
     str.append(date_str);
 }
 
+
 void GetDeltaSeqSummary(const CBioseq_Handle& seq, SDeltaSeqSummary& summary)
 {
     if ( !seq.IsSetInst()                                ||
@@ -1335,33 +1336,34 @@ void GetDeltaSeqSummary(const CBioseq_Handle& seq, SDeltaSeqSummary& summary)
 }
 
 
+SAFE_CONST_STATIC_STRING(kTS_concept_trans,    "conceptual translation");
+SAFE_CONST_STATIC_STRING(kTS_concept_trans_a,  "conceptual translation supplied by author");
+SAFE_CONST_STATIC_STRING(kTS_both,             "conceptual translation with partial peptide sequencing");
+SAFE_CONST_STATIC_STRING(kTS_seq_pept,         "direct peptide sequencing");
+SAFE_CONST_STATIC_STRING(kTS_seq_pept_homol,   "sequenced peptide, ordered by homology");
+SAFE_CONST_STATIC_STRING(kTS_seq_pept_overlap, "sequenced peptide, ordered by overlap");
+
 const string& GetTechString(int tech)
 {
-    static const string concept_trans_str = "conceptual translation";
-    static const string seq_pept_str = "direct peptide sequencing";
-    static const string both_str = "conceptual translation with partial peptide sequencing";
-    static const string seq_pept_overlap_str = "sequenced peptide, ordered by overlap";
-    static const string seq_pept_homol_str = "sequenced peptide, ordered by homology";
-    static const string concept_trans_a_str = "conceptual translation supplied by author";
     
     switch ( tech ) {
     case CMolInfo::eTech_concept_trans:
-        return concept_trans_str;
+        return kTS_concept_trans.Get();
 
     case CMolInfo::eTech_seq_pept :
-        return seq_pept_str;
+        return kTS_seq_pept.Get();
 
     case CMolInfo::eTech_both:
-        return both_str;
+        return kTS_both.Get();
 
     case CMolInfo::eTech_seq_pept_overlap:
-        return seq_pept_overlap_str;
+        return kTS_seq_pept_overlap.Get();
 
     case CMolInfo::eTech_seq_pept_homol:
-        return seq_pept_homol_str;
+        return kTS_seq_pept_homol.Get();
 
     case CMolInfo::eTech_concept_trans_a:
-        return concept_trans_a_str;
+        return kTS_concept_trans_a.Get();
 
     default:
         return kEmptyStr;
@@ -1716,7 +1718,7 @@ namespace {
         const _T &str_iter_end)
         //  ============================================================================
     {
-        static const string possible_tag_starts[] = {
+        static const char* possible_tag_starts[] = {
             "<a href=",
             "<acronym title",
             "</a>",
@@ -1727,7 +1729,7 @@ namespace {
 
         // check every string it might start with
         for (int possible_str_idx = 0; possible_str_idx < num_possible_tag_starts; ++possible_str_idx) {
-            const string &expected_str = possible_tag_starts[possible_str_idx];
+            const string expected_str = possible_tag_starts[possible_str_idx];
 
             string::size_type idx = 0;
             _T check_str_iter = str_iter;
@@ -1856,27 +1858,26 @@ bool
 CommentHasSuspiciousHtml( const string &str )
 {
     // list is not complete, still need to take proper precautions
-    static const string bad_html_strings[] = { 
+    static const char* bad_html_strings[] = { 
         "<script", "<object", "<applet", "<embed", "<form", 
         "javascript:", "vbscript:"
     };
 
     // load matching fsa if not already done
-    static CTextFsa fsa;
-    if( ! fsa.IsPrimed() ) {
-        int ii = 0;
-        for( ; ii < sizeof(bad_html_strings)/sizeof(bad_html_strings[0]) ; ++ii ) {
-            fsa.AddWord( bad_html_strings[ii] );
+    static CSafeStatic<CTextFsa> fsa;
+    if( ! fsa->IsPrimed() ) {
+        for( size_t ii = 0; ii < ArraySize(bad_html_strings); ++ii ) {
+            fsa->AddWord( bad_html_strings[ii] );
         }
-        fsa.Prime();
+        fsa->Prime();
     }
 
     // do the match
     int current_state = 0;
     for ( SIZE_TYPE str_idx = 0 ; str_idx < str.length(); ++str_idx) {
         const char ch = str[str_idx];
-        int next_state = fsa.GetNextState (current_state, ch);
-        if (fsa.IsMatchFound (next_state)) {
+        int next_state = fsa->GetNextState (current_state, ch);
+        if (fsa->IsMatchFound (next_state)) {
             return true;
         }
         current_state = next_state;
diff --git a/c++/src/objmgr/util/seq_loc_util.cpp b/c++/src/objmgr/util/seq_loc_util.cpp
index 3623e56..05b2115 100644
--- a/c++/src/objmgr/util/seq_loc_util.cpp
+++ b/c++/src/objmgr/util/seq_loc_util.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_loc_util.cpp 472370 2015-07-09 14:13:36Z ivanov $
+/*  $Id: seq_loc_util.cpp 497817 2016-04-11 14:48:09Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -829,7 +829,7 @@ int SeqLocPartialCheck(const CSeq_loc& loc, CScope* scope)
     }
 
     CSeq_loc_CI i2(loc, CSeq_loc_CI::eEmpty_Allow);
-    for ( ; i2; ++i2 ) {
+    while ( i2 ) {
         const CSeq_loc* slp = &(i2.GetEmbeddingSeq_loc());
         switch (slp->Which()) {
         case CSeq_loc::e_Null:
@@ -861,7 +861,7 @@ int SeqLocPartialCheck(const CSeq_loc& loc, CScope* scope)
                         *scope);
                     ++i2;
                 }
-                break;
+                continue;
             }
         case CSeq_loc::e_Pnt:
             if (slp->GetPnt().IsSetFuzz()) {
@@ -917,6 +917,7 @@ int SeqLocPartialCheck(const CSeq_loc& loc, CScope* scope)
             // First try to loop through CMolInfo
             const CMolInfo& mi = di->GetMolinfo();
             if (!mi.IsSetCompleteness()) {
+                ++i2;
                 continue;
             }
             switch (mi.GetCompleteness()) {
@@ -949,9 +950,7 @@ int SeqLocPartialCheck(const CSeq_loc& loc, CScope* scope)
         default:
             break;
         }
-        if ( !i2 ) {
-            break;
-        }
+        ++i2;
     }
     return retval;
 }
diff --git a/c++/src/objmgr/util/seqtitle.cpp b/c++/src/objmgr/util/seqtitle.cpp
index d98eb05..27c4ec7 100644
--- a/c++/src/objmgr/util/seqtitle.cpp
+++ b/c++/src/objmgr/util/seqtitle.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqtitle.cpp 444132 2014-08-21 16:49:43Z vasilche $
+/*  $Id: seqtitle.cpp 485361 2015-11-20 17:03:51Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -899,12 +899,12 @@ static bool s_EndsWithStrain(const string& name, const string& strain)
         return false;
     }
     pos = name.find(' ', pos + 1);
-    if (pos == NPOS) {
+    if (pos == NPOS  ||  pos + strain.size() >= name.size()) {
         return false;
     }
-    // XXX - the C Toolkit looks for the first occurrence, which could
+    // XXX - the C Toolkit starts looking unnecessarily early, which could
     // (at least in theory) lead to false negatives.
-    pos = NStr::FindNoCase(name, strain, pos + 1, NPOS, NStr::eLast);
+    pos = NStr::FindNoCase(name, strain, name.size() - strain.size() - 1);
     if (pos == name.size() - strain.size()) {
         return true;
     } else if (pos == name.size() - strain.size() - 1
diff --git a/c++/src/objmgr/util/sequence.cpp b/c++/src/objmgr/util/sequence.cpp
index 45d2df0..3d63fbe 100644
--- a/c++/src/objmgr/util/sequence.cpp
+++ b/c++/src/objmgr/util/sequence.cpp
@@ -1,4 +1,4 @@
-/*  $Id: sequence.cpp 481919 2015-10-19 13:24:11Z ivanov $
+/*  $Id: sequence.cpp 499689 2016-04-27 17:17:49Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -453,6 +453,23 @@ CSeq_id_Handle x_GetId(const CScope::TIds& ids, EGetIdType type)
 }
 
 
+CSeq_id_Handle GetId(const CBioseq& seq, EGetIdType type)
+{
+    return GetId(seq.GetId(), type);
+}
+
+
+CSeq_id_Handle GetId(const CBioseq::TId& ids_in, EGetIdType type)
+{
+    CScope::TIds ids;
+    ITERATE (CBioseq::TId, it, ids_in) {
+        ids.push_back(CSeq_id_Handle::GetHandle(**it));
+    }
+
+    return x_GetId(ids, type);
+}
+
+
 CSeq_id_Handle GetId(const CSeq_id& id, CScope& scope, EGetIdType type)
 {
     return GetId(CSeq_id_Handle::GetHandle(id), scope, type);
@@ -981,6 +998,9 @@ void GetOverlappingFeatures(const CSeq_loc& loc,
                 circular_length, range, loc, sel, scope, strand);
         } else {
             if ( circular_loc ) {
+                if ( !bioseq_handle ) {
+                    sel.SetSearchUnresolved();
+                }
                 feat_it_ptr.reset( new CFeat_CI(scope, *circular_loc, sel) );
             }
             else if ( bioseq_handle ) {
@@ -1030,29 +1050,35 @@ void GetOverlappingFeatures(const CSeq_loc& loc,
                 }
             }
 
-            // treat subset as a special case
-            Int8 cur_diff = ( !revert_locations_this_iteration ) ?
-                TestForOverlap64(*candidate_feat_loc,
-                *cleaned_loc_this_iteration,
-                overlap_type_this_iteration,
-                circular_length,
-                &scope) :
-            TestForOverlap64(*cleaned_loc_this_iteration,
-                *candidate_feat_loc,
-                overlap_type_this_iteration,
-                circular_length,
-                &scope);
-            if( plugin ) {
-                plugin->postProcessDiffAmount( cur_diff, cleaned_loc_this_iteration, 
-                    candidate_feat_loc, scope, sel, circular_length );
+            try {
+                // treat subset as a special case
+                Int8 cur_diff = ( !revert_locations_this_iteration ) ?
+                    TestForOverlap64(*candidate_feat_loc,
+                    *cleaned_loc_this_iteration,
+                    overlap_type_this_iteration,
+                    circular_length,
+                    &scope) :
+                TestForOverlap64(*cleaned_loc_this_iteration,
+                    *candidate_feat_loc,
+                    overlap_type_this_iteration,
+                    circular_length,
+                    &scope);
+                if( plugin ) {
+                    plugin->postProcessDiffAmount( cur_diff, cleaned_loc_this_iteration, 
+                        candidate_feat_loc, scope, sel, circular_length );
+                }
+                if (cur_diff < 0) {
+                    continue;
+                }
+
+                TFeatScore sc(cur_diff,
+                    ConstRef(&feat_it->GetMappedFeature()));
+                feats.push_back(sc);
             }
-            if (cur_diff < 0) {
+            catch (CObjmgrUtilException&) {
+                // On TestForOverlap64 error proceed to the next feature.
                 continue;
             }
-
-            TFeatScore sc(cur_diff,
-                ConstRef(&feat_it->GetMappedFeature()));
-            feats.push_back(sc);
         }
     }
     catch (exception&) {
@@ -1109,6 +1135,45 @@ CConstRef<CSeq_feat> GetBestOverlappingFeat(const CSeq_loc& loc,
 }
 
 
+/// GetmRNAforCDS
+/// A function to find a CSeq_feat representing the
+/// appropriate mRNA for a given CDS. 
+/// @param cds        The feature for which the mRNA to be found
+/// @param scope      The scope 
+///
+/// @return           CConstRef<CSeq_feat> for new mRNA (will be NULL if none is found)
+
+CConstRef<CSeq_feat> GetmRNAforCDS(const CSeq_feat& cds, CScope& scope)
+{
+    CConstRef<CSeq_feat> mrna;
+
+    bool has_xref = false;
+    if (cds.IsSetXref()) {
+        /* using FeatID from feature cross-references:
+        * if CDS refers to an mRNA by feature ID, use that feature
+        */
+        CBioseq_Handle bsh = scope.GetBioseqHandle(cds.GetLocation());
+        CTSE_Handle tse = bsh.GetTSE_Handle();
+        ITERATE(CSeq_feat::TXref, it, cds.GetXref()) {
+            if ((*it)->IsSetId() && (*it)->GetId().IsLocal() && (*it)->GetId().GetLocal().IsId()) {
+                CSeq_feat_Handle mrna_h = tse.GetFeatureWithId(CSeqFeatData::eSubtype_mRNA, (*it)->GetId().GetLocal().GetId());
+                if (mrna_h) {
+                    mrna = mrna_h.GetSeq_feat();
+                }
+                has_xref = true;
+            }
+        }
+    }
+    if (!has_xref) {
+        /* using original location to find mRNA:
+        * mRNA must include the CDS location and the internal interval boundaries need to be identical
+        */
+        mrna = GetBestOverlappingFeat(cds.GetLocation(), CSeqFeatData::eSubtype_mRNA, sequence::eOverlap_CheckIntRev, scope);
+    }
+    return mrna;
+}
+
+
 static
 CConstRef<CSeq_feat> x_GetBestOverlapForSNP(const CSeq_feat& snp_feat,
                                             CSeqFeatData::E_Choice type,
@@ -1176,10 +1241,24 @@ CConstRef<CSeq_feat> GetOverlappingGene(
     const CSeq_loc& loc, CScope& scope,
     ETransSplicing eTransSplicing )
 {
-    return GetBestOverlappingFeat(
-        loc, CSeqFeatData::eSubtype_gene,
-        eOverlap_Contained, scope,
-        ( eTransSplicing == eTransSplicing_Yes ? fBestFeat_IgnoreStrand : 0 ) );
+    int opt = 0;
+    switch ( eTransSplicing ) {
+    case eTransSplicing_Auto:
+        {
+            ENa_strand strand = loc.GetStrand();
+            if (strand == eNa_strand_both  ||  strand == eNa_strand_other) {
+                opt = fBestFeat_IgnoreStrand;
+            }
+        }
+        break;
+    case eTransSplicing_Yes:
+        opt = fBestFeat_IgnoreStrand;
+        break;
+    default:
+        break;
+    }
+    return GetBestOverlappingFeat(loc, CSeqFeatData::eSubtype_gene,
+        eOverlap_Contained, scope, opt);
 }
 
 
@@ -2961,7 +3040,9 @@ void CFastaOstream::x_WriteSequence(const CSeqVector& vec,
 
 
 void CFastaOstream::WriteSequence(const CBioseq_Handle& handle,
-                                  const CSeq_loc* location)
+                                  const CSeq_loc* location,
+                                  const CSeq_loc::EOpFlags merge_flags)
+
 {
     vector<CTSE_Handle> used_tses;
     if ( !(m_Flags & fAssembleParts)  &&  !handle.IsSetInst_Seq_data() ) {
@@ -2984,7 +3065,7 @@ void CFastaOstream::WriteSequence(const CBioseq_Handle& handle,
                        "CFastaOstream: location out of range: " + label);
         }
         CRef<CSeq_loc> merged
-            = sequence::Seq_loc_Merge(*location, CSeq_loc::fMerge_All, &scope);
+            = sequence::Seq_loc_Merge(*location, merge_flags, &scope);
         v = CSeqVector(*merged, scope, CBioseq_Handle::eCoding_Iupac);
     } else {
         v = handle.GetSeqVector(CBioseq_Handle::eCoding_Iupac);
@@ -3450,21 +3531,21 @@ static void AddGapToDeltaSeq (CRef<CBioseq>prot, bool unknown_length, TSeqPos ad
 
 
 CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
-                                                   CScope& scope)
+    CScope& scope)
 {
     const CGenetic_code* code = NULL;
     int frame = 0;
     if (cds.GetData().IsCdregion()) {
         const CCdregion& cdr = cds.GetData().GetCdregion();
-        if (cdr.IsSetFrame ()) {
-            switch (cdr.GetFrame ()) {
-            case CCdregion::eFrame_two :
+        if (cdr.IsSetFrame()) {
+            switch (cdr.GetFrame()) {
+            case CCdregion::eFrame_two:
                 frame = 1;
                 break;
-            case CCdregion::eFrame_three :
+            case CCdregion::eFrame_three:
                 frame = 2;
                 break;
-            default :
+            default:
                 break;
             }
         }
@@ -3483,7 +3564,6 @@ CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
     prot->SetInst().SetRepr(CSeq_inst::eRepr_delta);
     prot->SetInst().SetMol(CSeq_inst::eMol_aa);
     prot->SetInst().SetLength(0);
-    prot->SetInst().SetTopology(CSeq_inst::eTopology_linear);
 
     // reserve our space
     const TSeqPos usable_size = TSeqPos(seq.size()) - frame;
@@ -3492,11 +3572,11 @@ CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
     // get appropriate translation table
     const CTrans_table & tbl =
         (code ? CGen_code_table::GetTransTable(*code) :
-                CGen_code_table::GetTransTable(1));
+        CGen_code_table::GetTransTable(1));
 
     // main loop through bases
     CSeqVector::const_iterator start = seq.begin();
-    for (int i = 0;  i < frame;  ++i) {
+    for (int i = 0; i < frame; ++i) {
         ++start;
     }
 
@@ -3507,19 +3587,19 @@ CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
     bool check_start = (is_5prime_complete && frame == 0);
     bool first_time = true;
 
-    for (i = 0;  i < length;  ++i) {
+    for (i = 0; i < length; ++i) {
         bool is_gap = true;
         bool unknown_length = false;
         TSeqPos pos = (i * 3) + frame;
 
         if (start.HasZeroGapBefore()) {
-            AddGapToDeltaSeq (prot, true, 0);
+            AddGapToDeltaSeq(prot, true, 0);
         }
 
         // loop through one codon at a time
-        for (k = 0;  k < 3;  ++k, ++start) {
+        for (k = 0; k < 3; ++k, ++start) {
             state = tbl.NextCodonState(state, *start);
-            if (seq.IsInGap(pos + k )) {
+            if (seq.IsInGap(pos + k)) {
                 if (is_gap && !unknown_length) {
                     CSeqMap_CI map_iter(map, &scope, SSeqMapSelector(), pos + k);
                     if (map_iter.GetType() == CSeqMap::eSeqGap
@@ -3533,10 +3613,10 @@ CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
         }
 
         if (is_gap) {
-            AddGapToDeltaSeq (prot, unknown_length, 1);
+            AddGapToDeltaSeq(prot, unknown_length, 1);
         } else {
             // save translated amino acid
-            if (first_time  &&  check_start) { 
+            if (first_time  &&  check_start) {
                 AddAAToDeltaSeq(prot, tbl.GetStartResidue(state));
             } else {
                 AddAAToDeltaSeq(prot, tbl.GetCodonResidue(state));
@@ -3551,7 +3631,7 @@ CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
         bool is_gap = true;
         bool unknown_length = false;
         TSeqPos pos = (length * 3) + frame;
-        for (k = 0;  k < mod;  ++k, ++start) {
+        for (k = 0; k < mod; ++k, ++start) {
             state = tbl.NextCodonState(state, *start);
             if (seq.IsInGap(pos + k)) {
                 if (is_gap && !unknown_length) {
@@ -3569,16 +3649,16 @@ CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
 
         CRef<CDelta_seq> last = prot->SetInst().SetExt().SetDelta().Set().back();
         if (is_gap) {
-            AddGapToDeltaSeq (prot, unknown_length, 1);
+            AddGapToDeltaSeq(prot, unknown_length, 1);
         } else {
-            for ( ;  k < 3;  ++k) {
+            for (; k < 3; ++k) {
                 state = tbl.NextCodonState(state, 'N');
             }
 
             // save translated amino acid
             char c = tbl.GetCodonResidue(state);
             if (c != 'X') {
-                if (first_time  &&  check_start) { 
+                if (first_time  &&  check_start) {
                     AddAAToDeltaSeq(prot, tbl.GetStartResidue(state));
                 } else {
                     AddAAToDeltaSeq(prot, tbl.GetCodonResidue(state));
@@ -3588,47 +3668,47 @@ CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
     }
 
     TSeqPos prot_len = 0;
-    ITERATE (CDelta_ext::Tdata, seg_it, prot->SetInst().SetExt().SetDelta().Set()) {
+    ITERATE(CDelta_ext::Tdata, seg_it, prot->SetInst().SetExt().SetDelta().Set()) {
         prot_len += (*seg_it)->GetLiteral().GetLength();
     }
 
     // code break substitution
-    if (cds.GetData().IsCdregion()  &&
+    if (cds.GetData().IsCdregion() &&
         cds.GetData().GetCdregion().IsSetCode_break()) {
         const CCdregion& cdr = cds.GetData().GetCdregion();
-        ITERATE (CCdregion::TCode_break, code_break, cdr.GetCode_break()) {
+        ITERATE(CCdregion::TCode_break, code_break, cdr.GetCode_break()) {
             const CRef <CCode_break> brk = *code_break;
             const CSeq_loc& cbk_loc = brk->GetLoc();
             TSeqPos seq_pos =
                 sequence::LocationOffset(cds.GetLocation(), cbk_loc,
-                                         sequence::eOffset_FromStart,
-                                         &scope);
+                sequence::eOffset_FromStart,
+                &scope);
             seq_pos -= frame;
             string::size_type i = seq_pos / 3;
             if (i < prot_len) {
-                const CCode_break::C_Aa& c_aa = brk->GetAa ();
-                if (c_aa.IsNcbieaa ()) {
+                const CCode_break::C_Aa& c_aa = brk->GetAa();
+                if (c_aa.IsNcbieaa()) {
                     CDelta_ext::Tdata::iterator seg_it = prot->SetInst().SetExt().SetDelta().Set().begin();
                     string::size_type offset = 0;
                     while (seg_it != prot->SetInst().SetExt().SetDelta().Set().end()
-                           && offset + (*seg_it)->GetLiteral().GetLength() < i) {
+                        && offset + (*seg_it)->GetLiteral().GetLength() < i) {
                         offset += (*seg_it)->GetLiteral().GetLength();
                         ++seg_it;
                     }
                     if (seg_it != prot->SetInst().SetExt().SetDelta().Set().end()
                         && !(*seg_it)->GetLiteral().GetSeq_data().IsGap()) {
                         if ((*seg_it)->GetLiteral().GetSeq_data().IsIupacaa()) {
-                            (*seg_it)->SetLiteral().SetSeq_data().SetIupacaa().Set()[i - offset] = c_aa.GetNcbieaa ();
+                            (*seg_it)->SetLiteral().SetSeq_data().SetIupacaa().Set()[i - offset] = c_aa.GetNcbieaa();
                         } else {
-                            (*seg_it)->SetLiteral().SetSeq_data().SetNcbieaa().Set()[i - offset] = c_aa.GetNcbieaa ();
+                            (*seg_it)->SetLiteral().SetSeq_data().SetNcbieaa().Set()[i - offset] = c_aa.GetNcbieaa();
                         }
                     }
                 }
             } else if (i == prot_len) {
                 // add terminal exception
-                const CCode_break::C_Aa& c_aa = brk->GetAa ();
-                if (c_aa.IsNcbieaa () && c_aa.GetNcbieaa () == 42) {
-                    AddAAToDeltaSeq(prot, c_aa.GetNcbieaa ());
+                const CCode_break::C_Aa& c_aa = brk->GetAa();
+                if (c_aa.IsNcbieaa() && c_aa.GetNcbieaa() == 42) {
+                    AddAAToDeltaSeq(prot, c_aa.GetNcbieaa());
                 }
             }
         }
@@ -3654,20 +3734,21 @@ CRef<CBioseq> CSeqTranslator::TranslateToProtein(const CSeq_feat& cds,
 
     // recalculate protein length, check need for ncbieaa - may have been altered by removal of stop codon/transl_except
     prot_len = 0;
-    NON_CONST_ITERATE (CDelta_ext::Tdata, seg_it, prot->SetInst().SetExt().SetDelta().Set()) {
+    NON_CONST_ITERATE(CDelta_ext::Tdata, seg_it, prot->SetInst().SetExt().SetDelta().Set()) {
         prot_len += (*seg_it)->GetLiteral().GetLength();
         if ((*seg_it)->GetLiteral().IsSetSeq_data()
             && (*seg_it)->GetLiteral().GetSeq_data().IsNcbieaa()) {
             string current = (*seg_it)->GetLiteral().GetSeq_data().GetNcbieaa();
-            if (NStr::Find (current, "*") == string::npos && NStr::Find (current, "-") == string::npos) {
+            if (NStr::Find(current, "*") == string::npos && NStr::Find(current, "-") == string::npos) {
                 (*seg_it)->SetLiteral().SetSeq_data().SetIupacaa().Set(current);
             }
-        }            
+        }
     }
     prot->SetInst().SetLength(prot_len);
 
-
-    if (prot->SetInst().SetExt().SetDelta().Set().size() == 1
+    if (prot->GetInst().GetLength() == 0) {
+        prot.Reset(NULL);
+    } else if (prot->SetInst().SetExt().SetDelta().Set().size() == 1
         && prot->SetInst().SetExt().SetDelta().Set().front()->IsLiteral()
         && prot->SetInst().SetExt().SetDelta().Set().front()->GetLiteral().IsSetSeq_data()) {
         // only one segment, should be raw rather than delta
diff --git a/c++/src/objtools/Makefile.in b/c++/src/objtools/Makefile.in
index 71e8c5e..a90bc5d 100644
--- a/c++/src/objtools/Makefile.in
+++ b/c++/src/objtools/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in 485953 2015-11-30 17:53:34Z blastadm $
+# $Id: Makefile.in 458268 2015-02-03 16:20:30Z vakatov $
 
 # Meta-makefile("objtools" project)
 #################################
diff --git a/c++/src/objtools/align_format/Makefile.align_format.lib b/c++/src/objtools/align_format/Makefile.align_format.lib
index deb921a..2a38727 100644
--- a/c++/src/objtools/align_format/Makefile.align_format.lib
+++ b/c++/src/objtools/align_format/Makefile.align_format.lib
@@ -1,13 +1,13 @@
-# $Id: Makefile.align_format.lib 427429 2014-02-20 13:41:40Z gouriano $
+# $Id: Makefile.align_format.lib 485622 2015-11-24 15:18:00Z zaretska $
 
 ASN_DEP = blastdb xnetblast
 DLL_LIB = blast_services gene_info seqdb $(OBJREAD_LIBS) xalnmgr xobjutil \
-          blastdb xnetblastcli xnetblast scoremat xhtml xcgi tables \
+          blastdb xnetblastcli xnetblast scoremat taxon1 xhtml xcgi tables \
           $(OBJMGR_LIBS)
 
 ###  BASIC PROJECT SETTINGS
 LIB = align_format
-SRC = format_flags align_format_util showdefline showalign tabular vectorscreen seqalignfilter \
+SRC = format_flags align_format_util showdefline showalign tabular vectorscreen seqalignfilter taxFormat \
       aln_printer
 # OBJ =
 
diff --git a/c++/src/objtools/align_format/align_format_util.cpp b/c++/src/objtools/align_format/align_format_util.cpp
index 20bfe79..dda7311 100644
--- a/c++/src/objtools/align_format/align_format_util.cpp
+++ b/c++/src/objtools/align_format/align_format_util.cpp
@@ -1,4 +1,4 @@
-/*  $Id: align_format_util.cpp 482732 2015-10-26 16:31:57Z ivanov $
+/*  $Id: align_format_util.cpp 500368 2016-05-04 12:06:21Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: align_format_util.cpp 482732 2015-10-26 16:31:57Z ivanov $";
+static char const rcsid[] = "$Id: align_format_util.cpp 500368 2016-05-04 12:06:21Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -61,7 +61,9 @@ static char const rcsid[] = "$Id: align_format_util.cpp 482732 2015-10-26 16:31:
 #include <objects/seq/Seq_inst.hpp>
 #include <objects/seq/Seq_descr.hpp>
 #include <objects/seq/Seqdesc.hpp> 
+#include <objmgr/seqdesc_ci.hpp>
 #include <objects/blastdb/defline_extra.hpp>
+#include <objects/general/User_object.hpp>
 
 #include <objtools/blast/services/blast_services.hpp>   // for CBlastServices
 #include <objtools/blast/seqdb_reader/seqdb.hpp>   // for CSeqDB
@@ -356,7 +358,8 @@ CAlignFormatUtil::GetBlastDbInfo(vector<CAlignFormatUtil::SDbInfo>& retval,
         CAlignFormatUtil::SDbInfo info;
         info.is_protein = is_protein;
         bool success = false;
-        const string kDbName = NStr::TruncateSpaces(*i);
+	// Unsafe OK as kDbName only used in this loop.
+        const string kDbName = NStr::TruncateSpaces_Unsafe(*i);
         if (kDbName.empty())
             continue;
 
@@ -1574,7 +1577,7 @@ map < string, CRef<CSeq_align_set>  >  CAlignFormatUtil::HspListToHitMap(vector
 void CAlignFormatUtil::ExtractSeqAlignForSeqList(CRef<CSeq_align_set> &all_aln_set, string alignSeqList)
 {
     vector <string> seqIds;
-    NStr::Tokenize(alignSeqList,",",seqIds);       
+    NStr::Split(alignSeqList,",",seqIds);       
 
     //SEQ_ALN_SET from ALIGNDB contains seq_aligns in random order
     //The followimg will create a map that contains seq-aln_set per gi from ALIGN_SEQ_LIST
@@ -1612,7 +1615,7 @@ static bool s_GetSRASeqMetadata(const CBioseq::TId& ids,string &strRun, string &
                 vector<string> vecInfo;
                 try
                 {
-                    NStr::Tokenize(strTag, ".", vecInfo);
+                    NStr::Split(strTag, ".", vecInfo);
                 }
                 catch (...)
                 {
@@ -2027,7 +2030,7 @@ static list<string> s_GetLinkoutUrl(int linkout,
         if(!disableLink) {
             string linkTitle = " title=\"View 3D structure <@label@> aligned to your query\"";
             vector<string> accs;
-            NStr::Tokenize(labelList,",",accs); 
+            NStr::Split(labelList,",",accs); 
             string firstAcc = (accs.size() > 0)? accs[0] : labelList;
             
             url_link = CAlignFormatUtil::MapTemplate(url_link,"blast_rep_gi",
@@ -2391,7 +2394,7 @@ list<string> CAlignFormatUtil::GetFullLinkoutUrl(const list< CRef< CBlast_def_li
     GetBdlLinkoutInfo(bdl,linkout_map, linkoutdb, mv_build_name);
 
     vector<string> linkLetters;
-    NStr::Tokenize(linkoutOrder,",",linkLetters); //linkoutOrder = "G,U,M,E,S,B,R"   
+    NStr::Split(linkoutOrder,",",linkLetters); //linkoutOrder = "G,U,M,E,S,B,R"   
 	for(size_t i = 0; i < linkLetters.size(); i++) {
         TGi first_gi = ZERO_GI;
         vector < CBioseq::TId > idList;
@@ -2975,6 +2978,10 @@ CAlignFormatUtil::GetAsciiProteinMatrix(const char* matrix_name,
         retval((size_t)k_PSymbol[i], '*') = retval('*',(size_t)k_PSymbol[i]) = -4;
     }
     retval('*', '*') = 1; 
+    // this is to count Selenocysteine to Cysteine matches as positive
+    retval('U', 'U') = retval('C', 'C');
+    retval('U', 'C') = retval('C', 'C');
+    retval('C', 'U') = retval('C', 'C');
 }
 
 
@@ -3040,6 +3047,10 @@ bool CAlignFormatUtil::IsWGSPattern(string &wgsAccession)
     const unsigned int kWgsProjIDLengthMax = 10;
     bool isWGS = true;
 
+    if (wgsAccession.size() < 6) {
+        return false;
+    }
+
     if(NStr::Find(wgsAccession, ".") != NPOS) { //Accession has version AUXO013124042.1 
 	    string version;
 		NStr::SplitInTwo(wgsAccession,".",wgsAccession,version);                
@@ -3469,7 +3480,7 @@ string  CAlignFormatUtil::GetFASTALinkURL(SSeqURLInfo *seqUrlInfo,
         linkUrl = seqUrlInfo->seqUrl;    
         vector<string> parts;
         //SNP accession=dbSNP:rs35885954
-        NStr::Tokenize(seqUrlInfo->accession,":rs",parts,NStr::eMergeDelims); 
+        NStr::Split(seqUrlInfo->accession,":rs",parts,NStr::eMergeDelims); 
         string rs;
         if(parts.size() > 1) {
             rs = parts[1];
@@ -3800,6 +3811,46 @@ CRef<CSeq_id> CAlignFormatUtil::GetDisplayIds(const CBioseq_Handle& handle,
     return wid;
 }
 
+TGi CAlignFormatUtil::GetDisplayIds(const list< CRef< CBlast_def_line > > &bdl,
+                                              const CSeq_id& aln_id,
+                                              list<TGi>& use_this_gi)
+                                              
+                                           
+{
+    TGi gi = ZERO_GI;
+    
+    if(!bdl.empty()){    
+        bool found = false;
+        for(list< CRef< CBlast_def_line > >::const_iterator iter = bdl.begin();
+            iter != bdl.end(); iter++){
+            const CBioseq::TId* cur_id = &((*iter)->GetSeqid());
+            TGi cur_gi =  FindGi(*cur_id);                
+            if (!use_this_gi.empty()) {
+                ITERATE(list<TGi>, iter_gi, use_this_gi){
+                    if(cur_gi == *iter_gi){
+                        found = true;
+                        break;
+                    }
+                }
+            } else {
+                ITERATE(CBioseq::TId, iter_id, *cur_id) {
+                    if ((*iter_id)->Match(aln_id) 
+                      || (aln_id.IsGeneral() && aln_id.GetGeneral().CanGetDb() && 
+                         (*iter_id)->IsGeneral() && (*iter_id)->GetGeneral().CanGetDb() &&
+                         aln_id.GetGeneral().GetDb() == (*iter_id)->GetGeneral().GetDb())) {
+                        found = true;
+                    }
+                }
+            }
+            if(found){                
+                gi = cur_gi;                
+                break;
+            }
+        }
+    }    
+    return gi;
+}
+
 static inline CRange<TSeqPos> & s_FixMinusStrandRange(CRange<TSeqPos> & rng)
 {
 	if(rng.GetFrom() > rng.GetTo()){
@@ -3870,7 +3921,50 @@ int CAlignFormatUtil::GetUniqSeqCoverage(CSeq_align_set & alnset)
 	return query_rng_coll.GetCoveredLength();
 }
 
+///return id type specified or null ref
+///@param ids: the input ids
+///@param choice: id of choice
+///@return: the id with specified type
+///
+static CRef<CSeq_id> s_GetSeqIdByType(const list<CRef<CSeq_id> >& ids, 
+                                      CSeq_id::E_Choice choice)
+{
+    CRef<CSeq_id> cid;
+    
+    for (CBioseq::TId::const_iterator iter = ids.begin(); iter != ids.end(); 
+         iter ++){
+        if ((*iter)->Which() == choice){
+            cid = *iter;
+            break;
+        }
+    }
+    
+    return cid;
+}
+
+///return gi from id list
+///@param ids: the input ids
+///@return: the gi if found
+///
+TGi CAlignFormatUtil::GetGiForSeqIdList (const list<CRef<CSeq_id> >& ids)
+{
+    TGi gi = ZERO_GI;
+    CRef<CSeq_id> id = s_GetSeqIdByType(ids, CSeq_id::e_Gi);
+    if (!(id.Empty())){
+        return id->GetGi();
+    }
+    return gi;
+}
 
+string CAlignFormatUtil::GetTitle(const CBioseq_Handle & bh)
+{
+	CSeqdesc_CI desc_t(bh, CSeqdesc::e_Title);
+	string t = kEmptyStr;
+	for (;desc_t; ++desc_t) {
+		t += desc_t->GetTitle() + " ";
+	}
+	return t;
+}
 
 END_SCOPE(align_format)
 END_NCBI_SCOPE
diff --git a/c++/src/objtools/align_format/format_flags.cpp b/c++/src/objtools/align_format/format_flags.cpp
index 115e6de..6006952 100644
--- a/c++/src/objtools/align_format/format_flags.cpp
+++ b/c++/src/objtools/align_format/format_flags.cpp
@@ -1,4 +1,4 @@
-/*  $Id: format_flags.cpp 485058 2015-11-18 16:06:47Z ivanov $
+/*  $Id: format_flags.cpp 495725 2016-03-21 14:24:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -40,7 +40,7 @@ string kDfltArgTabularOutputFmt =
     "evalue bitscore";
 const string kDfltArgTabularOutputFmtTag("std");
 
-const size_t kNumTabularOutputFormatSpecifiers = 45;
+const size_t kNumTabularOutputFormatSpecifiers = 50;
 const SFormatSpec sc_FormatSpecifiers[kNumTabularOutputFormatSpecifiers] = {
     SFormatSpec("qseqid",   
                 "Query Seq-id",
@@ -144,6 +144,21 @@ const SFormatSpec sc_FormatSpecifiers[kNumTabularOutputFormatSpecifiers] = {
     SFormatSpec("btop",   
                 "Blast traceback operations (BTOP)", 
                 eBTOP),
+    SFormatSpec("staxid",
+                "Subject Taxonomy ID",
+                eSubjectTaxId),
+    SFormatSpec("ssciname",
+                "Subject Scientific Name",
+                eSubjectSciName),
+    SFormatSpec("scomname",
+                "Subject Common Name",
+                eSubjectCommonName),
+    SFormatSpec("sblastname",
+                "Subject Blast Name",
+                eSubjectBlastName),
+    SFormatSpec("sskingdom",
+                "Subject Super Kingdom",
+                eSubjectSuperKingdom),
     SFormatSpec("staxids",
                 "unique Subject Taxonomy ID(s), separated by a ';'\n\t\t\t (in numerical order)",
                 eSubjectTaxIds),
diff --git a/c++/src/objtools/align_format/seqalignfilter.cpp b/c++/src/objtools/align_format/seqalignfilter.cpp
index 45f2b32..348b51e 100644
--- a/c++/src/objtools/align_format/seqalignfilter.cpp
+++ b/c++/src/objtools/align_format/seqalignfilter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqalignfilter.cpp 482389 2015-10-22 16:36:32Z ivanov $
+/*  $Id: seqalignfilter.cpp 482214 2015-10-21 16:33:04Z zaretska $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 ///
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqalignfilter.cpp 482389 2015-10-22 16:36:32Z ivanov $";
+static char const rcsid[] = "$Id: seqalignfilter.cpp 482214 2015-10-21 16:33:04Z zaretska $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/objtools/align_format/showalign.cpp b/c++/src/objtools/align_format/showalign.cpp
index 08c7ff1..b947818 100644
--- a/c++/src/objtools/align_format/showalign.cpp
+++ b/c++/src/objtools/align_format/showalign.cpp
@@ -1,4 +1,4 @@
-/*  $Id: showalign.cpp 482385 2015-10-22 16:34:42Z ivanov $
+/*  $Id: showalign.cpp 489117 2016-01-08 16:18:48Z zaretska $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: showalign.cpp 482385 2015-10-22 16:34:42Z ivanov $";
+static char const rcsid[] = "$Id: showalign.cpp 489117 2016-01-08 16:18:48Z zaretska $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -496,41 +496,6 @@ static string s_GetQueryIDFromSeqAlign(const CSeq_align_set& actual_aln_list)
     return queryID;
 }
 
-///return id type specified or null ref
-///@param ids: the input ids
-///@param choice: id of choice
-///@return: the id with specified type
-///
-static CRef<CSeq_id> s_GetSeqIdByType(const list<CRef<CSeq_id> >& ids, 
-                                      CSeq_id::E_Choice choice)
-{
-    CRef<CSeq_id> cid;
-    
-    for (CBioseq::TId::const_iterator iter = ids.begin(); iter != ids.end(); 
-         iter ++){
-        if ((*iter)->Which() == choice){
-            cid = *iter;
-            break;
-        }
-    }
-    
-    return cid;
-}
-
-///return gi from id list
-///@param ids: the input ids
-///@return: the gi if found
-///
-TGi CDisplaySeqalign::x_GetGiForSeqIdList (const list<CRef<CSeq_id> >& ids)
-{
-    TGi gi = ZERO_GI;
-    CRef<CSeq_id> id = s_GetSeqIdByType(ids, CSeq_id::e_Gi);
-    if (!(id.Empty())){
-        return id->GetGi();
-    }
-    return gi;
-}
-
 
 ///return concatenated exon sequence
 ///@param feat: the feature containing this cds
@@ -982,7 +947,6 @@ void CDisplaySeqalign::x_PrintFeatures(SAlnRowInfo *alnRoInfo,
     int line_length = alnRoInfo->currActualLineLen;    
     int start_length = alnRoInfo->maxStartLen;
     int id_length = alnRoInfo->maxIdLen;
-    int max_feature_num = alnRoInfo->max_feature_num;
     if (alnRoInfo->show_align_stats) {
         id_length += alnRoInfo->max_align_stats_len + k_AlignStatsMargin;
     }
@@ -1029,10 +993,9 @@ void CDisplaySeqalign::x_PrintFeatures(SAlnRowInfo *alnRoInfo,
                 (*iter)->feature_start.pop_front();
             }
             bool color_cds_mismatch = false; 
-            if(max_feature_num == 1 && (m_AlignOption & eHtml) && 
+            if((m_AlignOption & eHtml) && 
                (m_AlignOption & eShowCdsFeature) && row > 0){
                 //only for slaves, only for cds feature
-                //only color mismach if only one cds exists
                 color_cds_mismatch = true;
             } else if((m_AlignOption & eHtml) && 
                       !(m_AlignOption & eShowCdsFeature) &&
@@ -1082,7 +1045,7 @@ CAlignFormatUtil::SSeqURLInfo *CDisplaySeqalign::x_InitSeqUrl(TGi giToUse,string
 					CRange<TSeqPos>(0,0);					
     bool flip = (m_AlnLinksParams.count(idString) > 0) ? m_AlnLinksParams[idString].flip : false;	
 	string user_url= (!m_BlastType.empty()) ? m_Reg->Get(m_BlastType, "TOOL_URL") : "";        		
-    giToUse = (giToUse == ZERO_GI) ? x_GetGiForSeqIdList(ids):giToUse;    
+    giToUse = (giToUse == ZERO_GI) ? CAlignFormatUtil::GetGiForSeqIdList(ids):giToUse;    
 	CAlignFormatUtil::SSeqURLInfo *seqUrlInfo = new CAlignFormatUtil::SSeqURLInfo(user_url,m_BlastType,m_IsDbNa,m_DbName,m_Rid,
                                              m_QueryNumber,
                                              giToUse,
@@ -1738,7 +1701,7 @@ void CDisplaySeqalign::x_DisplaySequenceIDForQueryAnchored(SAlnRowInfo *alnRoInf
             gi = m_AV->GetSeqId(row).GetGi();
         }
         if(!(gi > ZERO_GI)){
-            gi = x_GetGiForSeqIdList(m_AV->GetBioseqHandle(row).
+            gi = CAlignFormatUtil::GetGiForSeqIdList(m_AV->GetBioseqHandle(row).
                                      GetBioseqCore()->GetId());
         }
         string anchorTmpl,checkBoxTmpl,id_lbl;        
@@ -2213,7 +2176,7 @@ CDisplaySeqalign::SAlnDispParams *CDisplaySeqalign::x_FillAlnDispParams(const CR
     int seqLength = (int)bsp_handle.GetBioseqLength();    
 
 	const list<CRef<CSeq_id> > ids = bdl->GetSeqid();
-	TGi gi =  x_GetGiForSeqIdList(ids);
+	TGi gi =  CAlignFormatUtil::GetGiForSeqIdList(ids);
     TGi gi_in_use_this_gi = ZERO_GI;
     
     ITERATE(list<TGi>, iter_gi, use_this_gi){
@@ -2551,7 +2514,7 @@ void CDisplaySeqalign::x_OutputSeq(string& sequence, const CSeq_id& id,
                 if(from == i){                 
                     frontTag = true;
                 }
-                if(to == i){
+                if(to == i && to > 0){
                     endTag = true;
                 }                
             }
@@ -2607,7 +2570,10 @@ void CDisplaySeqalign::x_GetFeatureInfo(TSAlnFeatureInfoList& feature,
                 handle.
                 GetRangeSeq_loc(min(seq_start, seq_stop),
                                 max(seq_start, seq_stop));
-            for (CFeat_CI feat(scope, *loc_ref, choice); feat; ++feat) {
+            SAnnotSelector sel(choice);
+            sel.SetAdaptiveDepth().SetResolveAll();
+            
+            for (CFeat_CI feat(scope, *loc_ref, sel); feat; ++feat) {
                 const CSeq_loc& loc = feat->GetLocation();
                 bool has_id = false;
                 list<CSeq_loc_CI::TRange> isolated_range;
@@ -3806,7 +3772,7 @@ CDisplaySeqalign::x_InitDefLinesHeader(const CBioseq_Handle& bsp_handle,SAlnInfo
 				m_CurrAlnAccession.find("lcl|Subject_") != string::npos){ 
 							///Get first token of the title
                             vector <string> parts;
-                            NStr::Tokenize(alnDispParams->title," ",parts);
+                            NStr::Split(alnDispParams->title," ",parts);
                             if(parts.size() > 0) {
                                 m_CurrAlnAccession = parts[0];        
                             }
@@ -4521,7 +4487,7 @@ void CDisplaySeqalign::x_FillSeqid(string& id, int row) const
                         gi = m_AV->GetSeqId(row).GetGi();
                     }
                     if(!(gi > ZERO_GI)){
-                        gi = x_GetGiForSeqIdList(m_AV->GetBioseqHandle(row).\
+                        gi = CAlignFormatUtil::GetGiForSeqIdList(m_AV->GetBioseqHandle(row).\
                                                  GetBioseqCore()->GetId());
                     }
                     if(gi > ZERO_GI){
@@ -4549,7 +4515,7 @@ void CDisplaySeqalign::x_FillSeqid(string& id, int row) const
                 gi = m_AV->GetSeqId(row).GetGi();
             }
             if(!(gi > ZERO_GI)){
-                gi = x_GetGiForSeqIdList(m_AV->GetBioseqHandle(row).\
+                gi = CAlignFormatUtil::GetGiForSeqIdList(m_AV->GetBioseqHandle(row).\
                                          GetBioseqCore()->GetId());
             }
             if(gi > ZERO_GI){
diff --git a/c++/src/objtools/align_format/showdefline.cpp b/c++/src/objtools/align_format/showdefline.cpp
index 246098d..15ce163 100644
--- a/c++/src/objtools/align_format/showdefline.cpp
+++ b/c++/src/objtools/align_format/showdefline.cpp
@@ -1,4 +1,4 @@
-/* $Id: showdefline.cpp 481975 2015-10-19 16:59:30Z ivanov $
+/* $Id: showdefline.cpp 489117 2016-01-08 16:18:48Z zaretska $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: showdefline.cpp 481975 2015-10-19 16:59:30Z ivanov $";
+static char const rcsid[] = "$Id: showdefline.cpp 489117 2016-01-08 16:18:48Z zaretska $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -194,7 +194,7 @@ CShowBlastDefline::GetSeqIdList(const objects::CBioseq_Handle& bh,
 		(*itr)->AsFastaString().find("lcl|Subject_") != string::npos) {
             vector<string> title_tokens;
             id_token = 
-                NStr::Tokenize(sequence::CDeflineGenerator().GenerateDefline(bh), " ", title_tokens)[0];
+                NStr::Split(sequence::CDeflineGenerator().GenerateDefline(bh), " ", title_tokens)[0];
         }
         if (id_token != NcbiEmptyString) {
             // Create a new local id with a label containing the extracted
@@ -273,12 +273,15 @@ CShowBlastDefline::GetBioseqHandleDeflineAndId(const CBioseq_Handle& handle,
 static void s_LimitDescrLength(string &descr)
 {
 	if(descr.length() > kMaxDescrLength) {
-        size_t end = NStr::Find(descr," ",0,kMaxDescrLength,NStr::eLast);
+        descr = descr.substr(0,kMaxDescrLength);        
+        size_t end = NStr::Find(descr," ",NStr::eNocase,NStr::eReverseSearch);
+        
         if(end != NPOS) {            
             descr = descr.substr(0,end);                                        
             descr += "...";
         }                
     }           	
+    
 }
 
 void CShowBlastDefline::x_FillDeflineAndId(const CBioseq_Handle& handle,
diff --git a/c++/src/objtools/align_format/tabular.cpp b/c++/src/objtools/align_format/tabular.cpp
index d910079..4413fa7 100644
--- a/c++/src/objtools/align_format/tabular.cpp
+++ b/c++/src/objtools/align_format/tabular.cpp
@@ -1,4 +1,4 @@
-/* $Id: tabular.cpp 482732 2015-10-26 16:31:57Z ivanov $
+/* $Id: tabular.cpp 499247 2016-04-25 11:33:02Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 /// One line is printed for each alignment with tab-delimited fielalnVec. 
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: tabular.cpp 482732 2015-10-26 16:31:57Z ivanov $";
+static char const rcsid[] = "$Id: tabular.cpp 499247 2016-04-25 11:33:02Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -65,7 +65,7 @@ void
 CBlastTabularInfo::x_AddDefaultFieldsToShow()
 {
     vector<string> format_tokens;
-    NStr::Tokenize(kDfltArgTabularOutputFmt, " ", format_tokens);
+    NStr::Split(kDfltArgTabularOutputFmt, " ", format_tokens);
     ITERATE (vector<string>, iter, format_tokens) {
         _ASSERT(m_FieldMap.count(*iter) > 0);
         x_AddFieldToShow(m_FieldMap[*iter]);
@@ -80,7 +80,7 @@ void CBlastTabularInfo::x_SetFieldsToShow(const string& format)
     }
     
     vector<string> format_tokens;
-    NStr::Tokenize(format, " ", format_tokens);
+    NStr::Split(format, " ", format_tokens);
 
     if (format_tokens.empty())
         x_AddDefaultFieldsToShow();
@@ -268,6 +268,11 @@ void CBlastTabularInfo::x_PrintSubjectAllAccessions(void)
     }
 }
 
+void CBlastTabularInfo::x_PrintSubjectTaxId()
+{
+       m_Ostream << m_SubjectTaxId;
+}
+
 void CBlastTabularInfo::x_PrintSubjectTaxIds()
 {
 	if(m_SubjectTaxIds.empty()) {
@@ -282,6 +287,11 @@ void CBlastTabularInfo::x_PrintSubjectTaxIds()
     }
 }
 
+void CBlastTabularInfo::x_PrintSubjectBlastName()
+{
+	m_Ostream << m_SubjectBlastName;
+}
+
 void CBlastTabularInfo::x_PrintSubjectBlastNames()
 {
 	if(m_SubjectBlastNames.empty()) {
@@ -296,6 +306,11 @@ void CBlastTabularInfo::x_PrintSubjectBlastNames()
 	}
 }
 
+void CBlastTabularInfo::x_PrintSubjectSuperKingdom()
+{
+	m_Ostream << m_SubjectSuperKingdom;
+}
+
 void CBlastTabularInfo::x_PrintSubjectSuperKingdoms()
 {
 	if(m_SubjectSuperKingdoms.empty()) {
@@ -310,6 +325,11 @@ void CBlastTabularInfo::x_PrintSubjectSuperKingdoms()
 	}
 }
 
+void CBlastTabularInfo::x_PrintSubjectSciName()
+{
+	m_Ostream << m_SubjectSciName;
+}
+
 void CBlastTabularInfo::x_PrintSubjectSciNames()
 {
 	if(m_SubjectSciNames.empty()) {
@@ -324,6 +344,11 @@ void CBlastTabularInfo::x_PrintSubjectSciNames()
 	}
 }
 
+void CBlastTabularInfo::x_PrintSubjectCommonName()
+{
+	m_Ostream << m_SubjectCommonName;
+}
+
 void CBlastTabularInfo::x_PrintSubjectCommonNames()
 {
 	if(m_SubjectCommonNames.empty()) {
@@ -437,7 +462,7 @@ CRef<CSeq_id> s_ReplaceLocalId(const CBioseq_Handle& bh, CConstRef<CSeq_id> sid_
             string id_token;
             vector<string> title_tokens;
             title_tokens = 
-                NStr::Tokenize(sequence::CDeflineGenerator().GenerateDefline(bh), " ", title_tokens);
+                NStr::Split(CAlignFormatUtil::GetTitle(bh), " ", title_tokens);
             if(title_tokens.empty()){
                 id_token = NcbiEmptyString;
             } else {
@@ -535,82 +560,132 @@ bool s_IsValidName(const string & name)
 
 void CBlastTabularInfo::x_SetTaxInfo(const CBioseq_Handle & handle, const CRef<CBlast_def_line_set> & bdlRef)
 {
-	m_SubjectTaxIds.clear();
-	m_SubjectSciNames.clear();
-	m_SubjectCommonNames.clear();
-	m_SubjectBlastNames.clear();
-	m_SubjectSuperKingdoms.clear();
+    m_SubjectTaxId = 0;
+    m_SubjectSciName.clear();
+    m_SubjectCommonName.clear();
+    m_SubjectBlastName.clear();
+    m_SubjectSuperKingdom.clear();
 
     if (bdlRef.NotEmpty() && bdlRef->CanGet() && bdlRef->IsSet() && !bdlRef->Get().empty()){
+    	ITERATE(CBlast_def_line_set::Tdata, itr, bdlRef->Get()) {
+            if((*itr)->IsSetTaxid()) {
+                    if((*itr)->GetTaxid()) {
+                    	m_SubjectTaxId = (*itr)->GetTaxid();
+                    	break;
+                    }
+            }
+    	}
+    }
 
-        ITERATE(CBlast_def_line_set::Tdata, itr, bdlRef->Get()) {
-        	if((*itr)->IsSetTaxid())
-        	{
-        		if((*itr)->GetTaxid())
-        			m_SubjectTaxIds.insert((*itr)->GetTaxid());
-        	}
-        }
+    if(m_SubjectTaxId == 0) {
+          m_SubjectTaxId = sequence::GetTaxId(handle);
     }
 
-	if(m_SubjectTaxIds.empty())
-	{
-		CSeqdesc_CI desc_s(handle, CSeqdesc::e_Source);
-		for (;desc_s; ++desc_s)
-		{
-			 int t = desc_s->GetSource().GetOrg().GetTaxId();
-			 if(t)
-				  m_SubjectTaxIds.insert(t);
-		}
+    if(m_SubjectTaxId == 0)
+            return;
 
-		CSeqdesc_CI desc(handle, CSeqdesc::e_Org);
-		for (; desc; ++desc)
-		{
-			int t= desc->GetOrg().GetTaxId();
-			if(t)
-				m_SubjectTaxIds.insert(t);
-		}
-	}
+    if( x_IsFieldRequested(eSubjectSciName) ||
+        x_IsFieldRequested(eSubjectCommonName) ||
+        x_IsFieldRequested(eSubjectBlastName) ||
+        x_IsFieldRequested(eSubjectSuperKingdom)) {
 
-	if(m_SubjectTaxIds.empty())
-		return;
+        try {
+        	SSeqDBTaxInfo taxinfo;
+            CSeqDB::GetTaxInfo(m_SubjectTaxId, taxinfo);
+            m_SubjectSciName = taxinfo.scientific_name;
+            m_SubjectCommonName = taxinfo.common_name;
+            if(s_IsValidName(taxinfo.blast_name)) {
+            	m_SubjectBlastName = taxinfo.blast_name;
+            }
 
-   	if( x_IsFieldRequested(eSubjectSciNames) ||
-    	x_IsFieldRequested(eSubjectCommonNames) ||
-    	x_IsFieldRequested(eSubjectBlastNames) ||
-    	x_IsFieldRequested(eSubjectSuperKingdoms))
-   	{
-   		set<int>::iterator itr = m_SubjectTaxIds.begin();
-
-   		for(; itr !=  m_SubjectTaxIds.end(); ++itr)
-   		{
-    		try
-    		{
-    			SSeqDBTaxInfo taxinfo;
-    			CSeqDB::GetTaxInfo(*itr, taxinfo);
-    			m_SubjectSciNames.push_back(taxinfo.scientific_name);
-    			m_SubjectCommonNames.push_back(taxinfo.common_name);
-    			if(s_IsValidName(taxinfo.blast_name))
-    				m_SubjectBlastNames.insert(taxinfo.blast_name);
-
-    			if(s_IsValidName(taxinfo.s_kingdom))
-    				m_SubjectSuperKingdoms.insert(taxinfo.s_kingdom);
-
-    		} catch (const CException&) {
-    			//only put fillers in if we are going to show tax id
-    			// the fillers are put in so that the name list would
-    			// match the taxid list
-    			if(x_IsFieldRequested(eSubjectTaxIds) )
-    			{
-    				m_SubjectSciNames.push_back(NA);
-    				m_SubjectCommonNames.push_back(NA);
-    			}
-    		}
+            if(s_IsValidName(taxinfo.s_kingdom)) {
+            	m_SubjectSuperKingdom = taxinfo.s_kingdom;
+            }
+
+        } catch (const CException&) {
+        	//only put fillers in if we are going to show tax id
+            // the fillers are put in so that the name list would
+            // match the taxid list
+            if(x_IsFieldRequested(eSubjectTaxIds) ) {
+            	m_SubjectSciName = NA;
+                m_SubjectCommonName = NA;
+            }
+        }
+    }
+    return;
+}
+
+void CBlastTabularInfo::x_SetTaxInfoAll(const CBioseq_Handle & handle, const CRef<CBlast_def_line_set> & bdlRef)
+{
+    m_SubjectTaxIds.clear();
+    m_SubjectSciNames.clear();
+    m_SubjectCommonNames.clear();
+    m_SubjectBlastNames.clear();
+    m_SubjectSuperKingdoms.clear();
+
+    if (bdlRef.NotEmpty() && bdlRef->CanGet() && bdlRef->IsSet() && !bdlRef->Get().empty()){
+    	ITERATE(CBlast_def_line_set::Tdata, itr, bdlRef->Get()) {
+            if((*itr)->IsSetTaxid()) {
+                    if((*itr)->GetTaxid()) {
+                    	m_SubjectTaxIds.insert((*itr)->GetTaxid());
+                    }
+            }
     	}
     }
 
-	return;
+    if(m_SubjectTaxIds.empty()) {
+            CSeqdesc_CI desc_s(handle, CSeqdesc::e_Source);
+            for (;desc_s; ++desc_s) {
+                     int t = desc_s->GetSource().GetOrg().GetTaxId();
+                     if(t) {
+                    	 m_SubjectTaxIds.insert(t);
+                     }
+            }
+
+            CSeqdesc_CI desc(handle, CSeqdesc::e_Org);
+            for (; desc; ++desc) {
+                    int t= desc->GetOrg().GetTaxId();
+                    if(t) {
+                    	m_SubjectTaxIds.insert(t);
+                    }
+            }
+    }
 
+    if(m_SubjectTaxIds.empty())
+            return;
+
+    if( x_IsFieldRequested(eSubjectSciNames) ||
+        x_IsFieldRequested(eSubjectCommonNames) ||
+        x_IsFieldRequested(eSubjectBlastNames) ||
+        x_IsFieldRequested(eSubjectSuperKingdoms)) {
+            set<int>::iterator itr = m_SubjectTaxIds.begin();
+
+            for(; itr !=  m_SubjectTaxIds.end(); ++itr) {
+            	try {
+                    SSeqDBTaxInfo taxinfo;
+                    CSeqDB::GetTaxInfo(*itr, taxinfo);
+                    m_SubjectSciNames.push_back(taxinfo.scientific_name);
+                    m_SubjectCommonNames.push_back(taxinfo.common_name);
+                    if(s_IsValidName(taxinfo.blast_name))
+                            m_SubjectBlastNames.insert(taxinfo.blast_name);
+
+                    if(s_IsValidName(taxinfo.s_kingdom))
+                            m_SubjectSuperKingdoms.insert(taxinfo.s_kingdom);
+
+            	} catch (const CException&) {
+                    //only put fillers in if we are going to show tax id
+                    // the fillers are put in so that the name list would
+                    // match the taxid list
+                    if(x_IsFieldRequested(eSubjectTaxIds) ) {
+                            m_SubjectSciNames.push_back(NA);
+                            m_SubjectCommonNames.push_back(NA);
+                    }
+            	}
+            }
+    }
+    return;
 }
+
 void CBlastTabularInfo::x_SetQueryCovSubject(const CSeq_align & align)
 {
 	int pct = -1;
@@ -719,12 +794,17 @@ int CBlastTabularInfo::SetFields(const CSeq_align& align,
     					  x_IsFieldRequested(eSubjectAllGis) ||
                           x_IsFieldRequested(eSubjectAllAccessions));
 
+    bool setSubjectTaxInfo = (x_IsFieldRequested(eSubjectTaxId) ||
+        					  x_IsFieldRequested(eSubjectSciName) ||
+        					  x_IsFieldRequested(eSubjectCommonName) ||
+        					  x_IsFieldRequested(eSubjectBlastName) ||
+        					  x_IsFieldRequested(eSubjectSuperKingdom));
 
-    bool setSubjectTaxInfo = (x_IsFieldRequested(eSubjectTaxIds) ||
-    						  x_IsFieldRequested(eSubjectSciNames) ||
-    						  x_IsFieldRequested(eSubjectCommonNames) ||
-    						  x_IsFieldRequested(eSubjectBlastNames) ||
-    						  x_IsFieldRequested(eSubjectSuperKingdoms));
+    bool setSubjectTaxInfoAll = (x_IsFieldRequested(eSubjectTaxIds) ||
+    						     x_IsFieldRequested(eSubjectSciNames) ||
+    						     x_IsFieldRequested(eSubjectCommonNames) ||
+    						     x_IsFieldRequested(eSubjectBlastNames) ||
+    						     x_IsFieldRequested(eSubjectSuperKingdoms));
 
     bool setSubjectTitle = (x_IsFieldRequested(eSubjectTitle) ||
 			  	  	  	  	x_IsFieldRequested(eSubjectAllTitles));
@@ -746,12 +826,15 @@ int CBlastTabularInfo::SetFields(const CSeq_align& align,
             subject_is_na = subject_bh.IsNa();
             m_SubjectLength = subject_bh.GetBioseqLength();
 
-            if(setSubjectIds || setSubjectTaxInfo || setSubjectTitle) {
+            if(setSubjectIds || setSubjectTaxInfo || setSubjectTitle || setSubjectTaxInfoAll) {
             	CRef<CBlast_def_line_set> bdlRef =
             			CSeqDB::ExtractBlastDefline(subject_bh);
             	if(setSubjectIds) {
             		x_SetSubjectIds(subject_bh, bdlRef);
             	}
+            	if(setSubjectTaxInfoAll) {
+            		x_SetTaxInfoAll(subject_bh, bdlRef);
+            	}
             	if(setSubjectTaxInfo) {
             		x_SetTaxInfo(subject_bh, bdlRef);
             	}
@@ -1087,6 +1170,16 @@ void CBlastTabularInfo::x_PrintFieldNames()
         	m_Ostream << "subject blast names"; break;
         case eSubjectSuperKingdoms:
         	m_Ostream << "subject super kingdoms"; break;
+        case eSubjectTaxId:
+            m_Ostream << "subject tax id"; break;
+        case eSubjectSciName:
+            m_Ostream << "subject sci name"; break;
+        case eSubjectCommonName:
+            m_Ostream << "subject com names"; break;
+        case eSubjectBlastName:
+           	m_Ostream << "subject blast name"; break;
+        case eSubjectSuperKingdom:
+               	m_Ostream << "subject super kingdom"; break;
         case eSubjectTitle:
         	m_Ostream << "subject title"; break;
         case eSubjectAllTitles:
@@ -1327,14 +1420,24 @@ CBlastTabularInfo::x_PrintField(ETabularField field)
         x_PrintBTOP(); break;        
     case eSubjectTaxIds:
     	x_PrintSubjectTaxIds(); break;
+    case eSubjectTaxId:
+    	x_PrintSubjectTaxId(); break;
     case eSubjectSciNames:
     	x_PrintSubjectSciNames(); break;
+    case eSubjectSciName:
+    	x_PrintSubjectSciName(); break;
     case eSubjectCommonNames:
     	x_PrintSubjectCommonNames(); break;
+    case eSubjectCommonName:
+    	x_PrintSubjectCommonName(); break;
     case eSubjectBlastNames:
     	x_PrintSubjectBlastNames(); break;
+    case eSubjectBlastName:
+    	x_PrintSubjectBlastName(); break;
     case eSubjectSuperKingdoms:
     	x_PrintSubjectSuperKingdoms(); break;
+    case eSubjectSuperKingdom:
+    	x_PrintSubjectSuperKingdom(); break;
     case eSubjectTitle:
     	x_PrintSubjectTitle(); break;
     case eSubjectAllTitles:
@@ -1541,6 +1644,23 @@ void CIgBlastTabularInfo::SetIgAnnotation(const CRef<blast::CIgAnnotation> &anno
                 annot->m_DomainInfo_S[8], annot->m_DomainInfo_S[9]+1);
     AddIgDomain((ig_opts->m_DomainSystem == "kabat")?"CDR3 (V gene only)":"CDR3-IMGT (germline)",
                 annot->m_DomainInfo[10], annot->m_DomainInfo[11]+1);
+    m_Cdr3Start = annot->m_JDomain[0];
+    m_Cdr3End = annot->m_JDomain[1];
+    
+    m_Cdr3Seq = NcbiEmptyString;
+    m_Cdr3SeqTrans = NcbiEmptyString;
+   
+    if (m_Cdr3Start > 0 && m_Cdr3End > m_Cdr3Start) {
+       
+        m_Cdr3Seq = m_Query.substr(m_Cdr3Start, m_Cdr3End - m_Cdr3Start + 1);
+        int coding_frame_offset = (m_Cdr3Start - annot->m_FrameInfo[0])%3; 
+        
+        string cdr3_seq_for_translatioin = m_Cdr3Seq.substr(coding_frame_offset>0?(3-coding_frame_offset):0);
+
+        CSeqTranslator::Translate(cdr3_seq_for_translatioin, 
+                                  m_Cdr3SeqTrans, 
+                                  CSeqTranslator::fIs5PrimePartial, NULL, NULL);
+    }
 };
 
 void CIgBlastTabularInfo::Print(void)
@@ -1705,6 +1825,10 @@ void CIgBlastTabularInfo::x_ResetIgFields()
     m_DGene.Reset();
     m_JGene.Reset();
     m_OtherInfo.clear();
+    m_Cdr3Start = -1;
+    m_Cdr3End =  -1;
+    m_Cdr3Seq = NcbiEmptyString;
+    m_Cdr3SeqTrans = NcbiEmptyString;
 };
 
 void CIgBlastTabularInfo::x_PrintPartialQuery(int start, int end, bool isHtml) const
@@ -1816,6 +1940,33 @@ void CIgBlastTabularInfo::x_PrintIgGenes(bool isHtml, const string& header) cons
                   << " but are not included under the V, D or J gene itself.\n";
     }
     m_Ostream << endl << endl;
+
+    //cdr3 sequence output
+    if (m_Cdr3Seq != NcbiEmptyString){
+        if (isHtml) {
+            m_Ostream << "Sub-region sequence details:\n";
+            m_Ostream << "<table border=1>\n";
+            m_Ostream << "<tr><td> </td><td>Nucleotide sequence</td>";
+            m_Ostream << "<td>Translation</td>";
+        } else {
+            m_Ostream << header << "Sub-region sequence details (nucleotide sequence, translation)" << endl;
+        }
+        if (isHtml) {
+            m_Ostream << "<tr><td>CDR3</td><td>";
+        } else {
+            m_Ostream << "CDR3" << m_FieldDelimiter;
+        }
+        m_Ostream << m_Cdr3Seq << m_FieldDelimiter;
+        if (isHtml) {
+            m_Ostream << "</td><td>";
+        }
+        m_Ostream << m_Cdr3SeqTrans;
+        if (isHtml) {
+            m_Ostream << "</td></tr>\n</table>";
+        }
+        m_Ostream << endl << endl;
+    }
+   
 };
 
 void CIgBlastTabularInfo::x_ComputeIgDomain(SIgDomain &domain)
diff --git a/c++/src/objtools/align_format/taxFormat.cpp b/c++/src/objtools/align_format/taxFormat.cpp
new file mode 100644
index 0000000..be579ec
--- /dev/null
+++ b/c++/src/objtools/align_format/taxFormat.cpp
@@ -0,0 +1,966 @@
+/*  $Id: taxFormat.cpp 490145 2016-01-21 16:35:07Z zaretska $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and thesubset U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Author:  Irena Zaretskaya
+ *
+ * File Description:
+ *   Sequence alignment display
+ *
+ */
+
+#ifndef SKIP_DOXYGEN_PROCESSING
+static char const rcsid[] = "$Id: taxFormat.cpp 490145 2016-01-21 16:35:07Z zaretska $";
+#endif /* SKIP_DOXYGEN_PROCESSING */
+
+#include <ncbi_pch.hpp>
+#include <objects/taxon1/taxon1.hpp>
+#include <objects/taxon1/Taxon2_data.hpp>
+
+#include <objtools/align_format/taxFormat.hpp>
+
+
+#include <objtools/blast/seqdb_reader/seqdb.hpp>    // for CSeqDB::ExtractBlastDefline
+#include <objmgr/scope.hpp>
+#include <objmgr/feat_ci.hpp>
+#include <objtools/data_loaders/genbank/gbloader.hpp>
+#include <objmgr/util/sequence.hpp>
+#include <objects/seq/Seqdesc.hpp>
+#include <objects/seq/Bioseq.hpp>
+#include <objects/seqloc/Seq_id.hpp>
+#include <objects/seqalign/Seq_align_set.hpp>
+
+
+#include <stdio.h>
+#include <cgi/cgictx.hpp>
+
+BEGIN_NCBI_SCOPE
+USING_SCOPE(objects);
+USING_SCOPE(sequence);
+BEGIN_SCOPE(align_format)
+
+
+
+CTaxFormat::CTaxFormat(const CSeq_align_set& seqalign, 
+                       CScope& scope,
+                       bool connectToTaxServer)
+                      
+    : m_SeqalignSetRef(&seqalign),
+      m_Scope(scope),
+      m_ConnectToTaxServer(connectToTaxServer)
+{
+    m_TaxClient = NULL;    
+    m_TaxTreeLoaded = false;    
+    m_Rid = "0";         
+    m_Ctx = NULL;    
+    m_TaxTreeinfo = NULL;
+    m_BlastResTaxInfo = NULL;    
+    m_Debug = false;
+    
+    if(m_ConnectToTaxServer) {        
+        x_InitTaxClient();        
+    }
+    x_InitTaxInfoMap();    //Sets m_BlastResTaxInfo
+    if(m_ConnectToTaxServer) {        
+        x_LoadTaxTree();
+    }
+    
+    //set config file
+    m_ConfigFile = new CNcbiIfstream(".ncbirc");
+    m_Reg = new CNcbiRegistry(*m_ConfigFile);             
+    if(m_Reg) {
+        m_TaxBrowserURL = m_Reg->Get("TAX_BROWSER","BLASTFMTUTIL");
+    }
+    m_TaxBrowserURL = (m_TaxBrowserURL.empty()) ? kTaxBrowserURL : m_TaxBrowserURL;
+
+    
+        
+    m_TaxFormatTemplates = new STaxFormatTemplates;        
+
+    m_TaxFormatTemplates->blastNameLink = kBlastNameLink;
+    m_TaxFormatTemplates->orgReportTable = kOrgReportTable;
+    m_TaxFormatTemplates->orgReportOrganismHeader = kOrgReportOrganismHeader; ///< Template for displaying header
+    m_TaxFormatTemplates->orgReportTableHeader  = kOrgReportTableHeader; ///< Template for displaying header
+    m_TaxFormatTemplates->orgReportTableRow = kOrgReportTableRow;
+
+    m_TaxFormatTemplates->taxIdToSeqsMap = kTaxIdToSeqsMap;
+
+    m_TaxFormatTemplates->lineageReportTable = kLineageReportTable;
+    m_TaxFormatTemplates->lineageReportOrganismHeader = kLineageReportOrganismHeader; ///< Template for displaying header
+    m_TaxFormatTemplates->lineageReportTableHeader  = kLineageReportTableHeader; ///< Template for displaying header
+    m_TaxFormatTemplates->lineageReportTableRow = kLineageReportTableRow;
+
+    m_TaxFormatTemplates->taxonomyReportTable           = kTaxonomyReportTable;
+    m_TaxFormatTemplates->taxonomyReportOrganismHeader  = kTaxonomyReportOrganismHeader;    
+    m_TaxFormatTemplates->taxonomyReportTableHeader     = kTaxonomyReportTableHeader;
+    m_TaxFormatTemplates->taxonomyReportTableRow        = kTaxonomyReportTableRow;
+}
+
+CTaxFormat::~CTaxFormat()
+{   
+    
+    if (m_ConfigFile) {
+        delete m_ConfigFile;
+    } 
+    if (m_Reg) {
+        delete m_Reg;
+    }
+    if(m_BlastResTaxInfo) {        
+        for(TSeqTaxInfoMap::iterator it=m_BlastResTaxInfo->seqTaxInfoMap.begin(); it!=m_BlastResTaxInfo->seqTaxInfoMap.end(); ++it) {
+            for(size_t i = 0; i < it->second.seqInfoList.size(); i++) {
+                SSeqInfo* seqInfo = it->second.seqInfoList[i];
+                if(seqInfo) delete seqInfo;        
+            }                    
+        }
+        delete m_BlastResTaxInfo;
+    }
+    if(m_TaxTreeinfo) {
+        delete m_TaxTreeinfo;
+    }
+    if(m_TaxFormatTemplates) {
+        delete m_TaxFormatTemplates;
+    }
+    if(m_TaxClient) {
+        m_TaxClient->Fini();
+        delete m_TaxClient;
+    } 
+}
+
+
+// Here's a tree A drawing that will be used to explain trversing modes  
+//              /|   
+//             B C  
+//            /|   
+//           D E
+// This function arranges 'upward' traverse mode when lower nodes are  
+// processed first. The sequence of calls to I4Each functions for  
+// iterator at the node A whould be:  
+//   LevelBegin( A )  
+//     LevelBegin( B )  
+//       Execute( D ), Execute( E )  
+//     LevelEnd( B ), Execute( B )  
+//     Execute( C )  
+//   LevelEnd( A ), Execute( A )
+class CUpwardTreeFiller : public ITreeIterator::I4Each
+{
+public:
+
+    virtual ~CUpwardTreeFiller() {} 
+    CUpwardTreeFiller(CTaxFormat::TSeqTaxInfoMap &seqAlignTaxInfoMap)        
+        : m_SeqAlignTaxInfoMap(seqAlignTaxInfoMap),
+          m_Curr(NULL)          
+    {
+        m_TreeTaxInfo = new CTaxFormat::SBlastResTaxInfo;    
+        m_Debug = false;
+    }    
+
+    CTaxFormat::SBlastResTaxInfo* GetTreeTaxInfo(void){ return m_TreeTaxInfo;}
+    void SetDebugMode(bool debug) {m_Debug = debug;}
+
+    ITreeIterator::EAction LevelBegin(const ITaxon1Node* tax_node)
+    {
+        x_InitTaxInfo(tax_node); // sets m_Curr        
+        x_PrintTaxInfo("Begin branch");
+        m_Curr->numChildren = 0;
+        m_Curr->numHits = 0;
+        m_Curr->numOrgs = 0;
+
+        if(m_Nodes.size() > 0) { //there is parent
+            CTaxFormat::STaxInfo* par = m_Nodes.top();
+            par->numChildren++; 
+        }    
+        m_Nodes.push(m_Curr); //Push current taxid node info into stack
+        m_Curr = NULL;
+                
+        return ITreeIterator::eOk;
+    }
+
+    ITreeIterator::EAction Execute(const ITaxon1Node* tax_node)
+    {
+        int taxid = tax_node->GetTaxId();
+               
+        //if m_Curr != NULL there was Level End - we are at branch processing
+        int currTaxid = (m_Curr) ? m_Curr->taxid : 0;
+        bool useTaxid = false;                       
+        if(taxid == currTaxid) {//branch processing            
+            m_Curr->numHits += m_Curr->seqInfoList.size();                                                            
+            useTaxid = (m_Curr->numChildren > 1 || m_Curr->seqInfoList.size() > 0);
+            if(!useTaxid) {                
+                x_PrintTaxInfo("Removed branch");                
+            }            
+            if(m_Curr->seqInfoList.size() > 0) {
+                m_Curr->numOrgs++;
+                if(!m_Curr->taxidList.empty()) m_Curr->taxidList += ",";
+                m_Curr->taxidList += NStr::NumericToString(m_Curr->taxid);
+            }
+        }
+        else { // - terminal node
+            x_InitTaxInfo(tax_node); // sets m_Curr                                    
+            x_PrintTaxInfo("Terminal node");
+            m_Curr->numHits = m_Curr->seqInfoList.size();             
+            m_Curr->numOrgs = 1;
+            m_Curr->numChildren = 0;
+            m_Curr->taxidList = NStr::NumericToString(m_Curr->taxid);
+            useTaxid = true;         
+        }          
+        if(m_Nodes.size() > 0) { //there is a parent            
+            CTaxFormat::STaxInfo* par = m_Nodes.top();
+            par->numHits += m_Curr->numHits;            
+            par->numOrgs += m_Curr->numOrgs;                        
+
+            if(!par->taxidList.empty()) par->taxidList += ",";
+            par->taxidList += m_Curr->taxidList;            
+            if(m_Curr->seqInfoList.size() > 0) par->numChildren++;            
+        }          
+        if(useTaxid) {
+            x_InitTreeTaxInfo();//Adds taxid to the map
+        }
+        if(taxid != currTaxid) {            
+            m_Curr = NULL;
+        }        
+        return ITreeIterator::eOk;
+    }
+
+    ITreeIterator::EAction LevelEnd(const ITaxon1Node* tax_node)
+    {
+        m_Curr = m_Nodes.top();                        
+        x_PrintTaxInfo("End branch");
+        m_Nodes.pop();                
+        return ITreeIterator::eOk;
+    }
+
+    void x_InitTaxInfo(const ITaxon1Node* tax_node);
+    void x_InitTreeTaxInfo(void);
+    void x_PrintTaxInfo(string header) {
+        if(m_Debug) {
+            cerr << header << " for taxid: " << m_Curr->taxid << " " << m_Curr->scientificName << endl;        
+        }
+    }
+       
+    CTaxFormat::TSeqTaxInfoMap       m_SeqAlignTaxInfoMap; ///< Map containing information for taxids and corresponding sequnces in alignment
+    CTaxFormat::SBlastResTaxInfo     *m_TreeTaxInfo;       ///< SBlastResTaxInfo Map containing information for all taxids in common tree, intermidiate nodes with no hits or only 1 child are removed
+    CTaxFormat::STaxInfo*            m_Curr;        
+    stack<CTaxFormat::STaxInfo*>     m_Nodes;        
+    bool                             m_Debug;
+};
+
+
+
+//   Execute( A ), LevelBegin( A )
+//     Execute( B ), LevelBegin( B )  
+//       Execute( D ), Execute( E )  
+//     LevelEnd( B )  
+//     Execute( C )
+//   LevelEnd( A )
+class CDownwardTreeFiller : public ITreeIterator::I4Each
+{
+public:
+    void SetDebugMode(bool debug) {m_Debug = debug;}
+    virtual ~CDownwardTreeFiller() { }
+    CDownwardTreeFiller(CTaxFormat::TSeqTaxInfoMap *treeTaxInfoMap)        
+        : m_TreeTaxInfoMap(treeTaxInfoMap)          
+    {
+        m_Depth = 0;        
+        m_Debug = false;
+    }    
+    
+
+    ITreeIterator::EAction LevelBegin(const ITaxon1Node* tax_node)
+    {
+        int taxid = tax_node->GetTaxId();        
+        if((*m_TreeTaxInfoMap).count(taxid) != 0 ) {//sequence is in alignment            
+            m_Depth++;
+            m_Lineage.push_back(taxid); //Push current taxid info into stack
+        }        
+        x_PrintTaxInfo("Begin branch",tax_node);        
+                
+        return ITreeIterator::eOk;
+    }
+
+    ITreeIterator::EAction Execute(const ITaxon1Node* tax_node)
+    {
+        int taxid = tax_node->GetTaxId();        
+        if((*m_TreeTaxInfoMap).count(taxid) != 0 ) {//sequence is in alignment            
+            (*m_TreeTaxInfoMap)[taxid].depth = m_Depth;
+            for(size_t i = 0; i < m_Lineage.size(); i++) {
+                (*m_TreeTaxInfoMap)[taxid].lineage.assign(m_Lineage.begin(),m_Lineage.end());
+            }
+        }     
+        x_PrintTaxInfo("Execute branch",tax_node);                
+        return ITreeIterator::eOk;
+    }
+
+    ITreeIterator::EAction LevelEnd(const ITaxon1Node* tax_node)
+    {
+        int taxid = tax_node->GetTaxId();        
+        if((*m_TreeTaxInfoMap).count(taxid) != 0 ) {//sequence is in alignment            
+            m_Depth--;
+            m_Lineage.pop_back();
+        }     
+        x_PrintTaxInfo("End branch",tax_node);                
+        return ITreeIterator::eOk;
+    }
+               
+    void x_PrintTaxInfo(string header, const ITaxon1Node* tax_node) {        
+        if(m_Debug) {
+            string lineage;
+            for(size_t j = 0; j < m_Lineage.size(); j++) {
+                if(!lineage.empty()) lineage += ",";
+                lineage += NStr::NumericToString(m_Lineage[j]);
+            }            
+            cerr << header << " for taxid: " << tax_node->GetTaxId() << " " << tax_node->GetName() << " depth: " <<  m_Depth << " lineage: " << lineage << endl;
+        }
+    }
+
+    CTaxFormat::TSeqTaxInfoMap       *m_TreeTaxInfoMap;    
+    int                              m_Depth;
+    vector <int>                     m_Lineage;
+    bool                             m_Debug;
+};
+
+
+
+
+void CTaxFormat::DisplayOrgReport(CNcbiOstream& out) 
+{
+    string orgReportData;  
+    string taxIdToSeqsMap;
+
+    for(size_t i = 0; i < m_BlastResTaxInfo->orderedTaxids.size(); i++) {
+        int taxid = m_BlastResTaxInfo->orderedTaxids[i];
+        STaxInfo seqsForTaxID = m_BlastResTaxInfo->seqTaxInfoMap[taxid];
+        
+        string orgHeader = (m_ConnectToTaxServer) ? m_TaxFormatTemplates->orgReportOrganismHeader : kOrgReportOrganismHeaderNoTaxConnect;
+        orgHeader = x_MapTaxInfoTemplate(orgHeader,seqsForTaxID);
+        string prevTaxid,nextTaxid, hidePrevTaxid, hideNextTaxid, hideTop;
+        const string kDisabled = "disabled=\"disabled\"";
+        if(i == 0) {        
+            hidePrevTaxid = kDisabled;
+            hideTop = kDisabled;            
+        }
+        if (i == m_BlastResTaxInfo->orderedTaxids.size() - 1) {        
+            hideNextTaxid = kDisabled;            
+        }        
+        if(i > 0) {            
+            prevTaxid = NStr::NumericToString(m_BlastResTaxInfo->orderedTaxids[i - 1]);
+        }
+        if(i < m_BlastResTaxInfo->orderedTaxids.size() - 1) {
+            nextTaxid = NStr::NumericToString(m_BlastResTaxInfo->orderedTaxids[i + 1]);            
+        }
+        
+
+        orgHeader = CAlignFormatUtil::MapTemplate(orgHeader,"next_taxid",nextTaxid);
+        orgHeader = CAlignFormatUtil::MapTemplate(orgHeader,"disable_nexttaxid",hideNextTaxid);
+        orgHeader = CAlignFormatUtil::MapTemplate(orgHeader,"prev_taxid",prevTaxid);
+        orgHeader = CAlignFormatUtil::MapTemplate(orgHeader,"disable_prevtaxid",hidePrevTaxid);
+        orgHeader = CAlignFormatUtil::MapTemplate(orgHeader,"disable_top",hideTop);
+        
+        string orgReportSeqInfo;        
+        for(size_t j = 0; j < seqsForTaxID.seqInfoList.size(); j++) {
+            SSeqInfo *seqInfo = seqsForTaxID.seqInfoList[j];            
+            string orgReportTableRow = x_MapSeqTemplate(m_TaxFormatTemplates->orgReportTableRow,seqInfo);            
+            orgReportSeqInfo += orgReportTableRow;
+        }
+
+        string oneOrgInfo = orgHeader + orgReportSeqInfo;
+        orgReportData += oneOrgInfo; 
+
+        string taxIdToSeqsRow = CAlignFormatUtil::MapTemplate(m_TaxFormatTemplates->taxIdToSeqsMap,"giList",seqsForTaxID.giList);
+        taxIdToSeqsRow = CAlignFormatUtil::MapTemplate(taxIdToSeqsRow,"taxid",taxid);
+        taxIdToSeqsMap += taxIdToSeqsRow;
+    }
+    orgReportData = CAlignFormatUtil::MapTemplate(m_TaxFormatTemplates->orgReportTable,"table_rows",orgReportData);
+    orgReportData = CAlignFormatUtil::MapTemplate(orgReportData,"taxidToSeqsMap",taxIdToSeqsMap);    
+    out << orgReportData;
+}
+
+ 
+
+void CTaxFormat::DisplayLineageReport(CNcbiOstream& out) 
+{
+    x_InitLineageReport();    
+    
+    bool header = true;    
+    string lngReportRows = m_TaxFormatTemplates->lineageReportTableHeader;//!!!Do the same for organism report
+    ITERATE(list <STaxInfo>, iter, m_AlnLineageTaxInfo) {             
+            string lngReportTableRow;
+            unsigned int depth = 0;
+            STaxInfo alnSeqTaxInfo = *iter;
+//            taxInfo.lineage.push_back(iter->taxid);            
+            for(size_t i = 0; i< alnSeqTaxInfo.lineage.size();i++) {
+                int taxid = alnSeqTaxInfo.lineage[i];                
+                if(header) {                                        
+                    STaxInfo taxInfo = GetTaxTreeInfo(taxid);                   
+
+                    lngReportTableRow = x_MapTaxInfoTemplate(m_TaxFormatTemplates->lineageReportOrganismHeader,taxInfo,depth);
+                    
+
+                    lngReportTableRow = CAlignFormatUtil::MapTemplate(lngReportTableRow,"taxidList",taxInfo.taxidList);  
+                    lngReportTableRow = CAlignFormatUtil::MapTemplate(lngReportTableRow,"descr",taxInfo.scientificName + " sequences");  
+                    lngReportTableRow = CAlignFormatUtil::MapTemplate(lngReportTableRow,"descr_abbr",taxInfo.scientificName + " sequences");                              
+                    lngReportRows += lngReportTableRow;
+                }
+                depth++;
+            }    
+            
+            lngReportTableRow = x_MapTaxInfoTemplate(m_TaxFormatTemplates->lineageReportTableRow,alnSeqTaxInfo,depth);
+            
+            lngReportTableRow = x_MapSeqTemplate(lngReportTableRow,alnSeqTaxInfo);                                                                                       
+            lngReportRows += lngReportTableRow;
+            header = false;            
+     }
+     string lngReportData = CAlignFormatUtil::MapTemplate(m_TaxFormatTemplates->lineageReportTable,"table_rows",lngReportRows);
+     out << lngReportData;
+}
+
+
+
+void CTaxFormat::DisplayTaxonomyReport(CNcbiOstream& out) 
+{
+    x_InitTaxReport();    
+    vector <int> taxTreeTaxids = GetTaxTreeTaxIDs();        
+    string taxReportRows;
+    taxReportRows = m_TaxFormatTemplates->taxonomyReportTableHeader;//!!!Do the same for organism report
+
+    for(size_t i = 0; i < taxTreeTaxids.size(); i++) {
+        int taxid = taxTreeTaxids[i];
+        STaxInfo taxInfo = GetTaxTreeInfo(taxid);     
+        string taxReportTableRow;             
+        if(isTaxidInAlign(taxid)) {                                                     
+            taxReportTableRow = x_MapSeqTemplate(m_TaxFormatTemplates->taxonomyReportTableRow,taxInfo);                                                        
+        }                       
+        else {
+            taxReportTableRow = CAlignFormatUtil::MapTemplate(m_TaxFormatTemplates->taxonomyReportOrganismHeader,"taxidList",taxInfo.taxidList);  
+            taxReportTableRow = CAlignFormatUtil::MapTemplate(taxReportTableRow,"descr",taxInfo.scientificName + " sequences");  
+            taxReportTableRow = CAlignFormatUtil::MapTemplate(taxReportTableRow,"descr_abbr",taxInfo.scientificName + " sequences");              
+        }
+        taxReportTableRow = x_MapTaxInfoTemplate(taxReportTableRow,taxInfo,taxInfo.depth);               
+        taxReportTableRow = CAlignFormatUtil::MapTemplate(taxReportTableRow,"numhits",taxInfo.numHits);                    
+        taxReportTableRow = CAlignFormatUtil::MapTemplate(taxReportTableRow,"numOrgs",taxInfo.numOrgs);        
+        string lineage,parentTaxid;
+        for(size_t i = 0; i < taxInfo.lineage.size(); i++) {
+            if(!lineage.empty()) lineage += " ";
+            lineage += "partx_" + NStr::NumericToString(taxInfo.lineage[i]);
+            if(i == taxInfo.lineage.size() - 1) {
+                parentTaxid = NStr::NumericToString(taxInfo.lineage[i]);
+            }
+        }        
+        taxReportTableRow = CAlignFormatUtil::MapTemplate(taxReportTableRow,"lineage",lineage);
+        taxReportTableRow = CAlignFormatUtil::MapTemplate(taxReportTableRow,"parTaxid",parentTaxid);
+        if(taxInfo.numChildren > 0) {
+            taxReportTableRow = CAlignFormatUtil::MapTemplate(taxReportTableRow,"showChildren","showing");
+        }
+        else {
+            taxReportTableRow = CAlignFormatUtil::MapTemplate(taxReportTableRow,"showChildren","hidden");
+        }
+
+        taxReportRows += taxReportTableRow;            
+     }
+     string taxReportData = CAlignFormatUtil::MapTemplate(m_TaxFormatTemplates->taxonomyReportTable,"table_rows",taxReportRows);
+     out << taxReportData;
+}
+
+
+void CTaxFormat::x_InitTaxClient(void)
+{
+    if(!m_TaxClient) {
+        m_TaxClient = new CTaxon1();
+        m_TaxClient->Init();  
+
+        if(!m_TaxClient->IsAlive()) {
+            const string& err = m_TaxClient->GetLastError();
+            NCBI_THROW(CException, eUnknown,"Cannot connect to tax server. " + err);
+        }
+    }        
+}
+
+
+void CTaxFormat::x_InitTaxReport(void)
+{
+    if(!m_TaxTreeLoaded) {
+        x_LoadTaxTree();    
+    }
+    if(!m_TaxTreeinfo) {
+        x_InitOrgTaxMetaData();    
+    }
+}
+
+void CTaxFormat::x_InitLineageReport(void)
+{
+    if(!m_TaxTreeLoaded) {
+        x_LoadTaxTree(); 
+    }
+    if(!m_TaxTreeinfo) {
+        x_InitOrgTaxMetaData();
+    }
+    x_InitLineageMetaData();
+}
+
+
+void CTaxFormat::x_LoadTaxTree(void)
+{
+    x_InitTaxClient();                
+    if(!m_TaxTreeLoaded) {
+        vector <int> taxidsToRoot;    
+        vector <int> alignTaxids = GetAlignTaxIDs();
+
+        bool tax_load_ok = false;
+        if(m_TaxClient->IsAlive()) {          
+            m_TaxClient->GetPopsetJoin(alignTaxids,taxidsToRoot);
+            //taxidsToRoot contain all taxids excluding alignTaxids        
+
+            //Adding alignTaxids
+            for(size_t i = 0; i < alignTaxids.size(); i++) {
+                int tax_id = alignTaxids[i];                                    
+
+                if(!m_TaxClient->IsAlive()) break;
+                const ITaxon1Node* tax_node = NULL;
+                tax_load_ok |= m_TaxClient->LoadNode(tax_id,&tax_node);                                                        
+                if(!tax_load_ok) break;                
+
+                if(tax_node && tax_node->GetTaxId() != tax_id) {
+                    int newTaxid = tax_node->GetTaxId();
+                    if(m_Debug) {
+                        cerr << "*******TAXID MISMATCH: changing " << tax_id << " to " << tax_node->GetTaxId() << "-" << endl;
+                    }
+                    STaxInfo &taxInfo = GetAlignTaxInfo(tax_id);
+                    taxInfo.taxid = newTaxid;
+                    for(size_t j = 0; i < taxInfo.seqInfoList.size(); j++) {
+                        SSeqInfo* seqInfo = taxInfo.seqInfoList[j];                        
+                        seqInfo->taxid = newTaxid;
+                    }        
+                    m_BlastResTaxInfo->seqTaxInfoMap.insert(CTaxFormat::TSeqTaxInfoMap::value_type(newTaxid,taxInfo));  
+                    m_BlastResTaxInfo->orderedTaxids[i] = newTaxid;                    
+                    m_BlastResTaxInfo->seqTaxInfoMap.erase(tax_id);
+                }
+            }
+        }
+        if(m_TaxClient->IsAlive() && tax_load_ok) {          
+            ITERATE(vector<int>, it, taxidsToRoot) {
+                int tax_id = *it;                 
+
+                if(!m_TaxClient->IsAlive()) break;
+                tax_load_ok |= m_TaxClient->LoadNode(tax_id);
+
+                if(!tax_load_ok) break;
+            }            
+        }
+        if (!tax_load_ok) {
+            NCBI_THROW(CException, eUnknown,"Taxonomic load was not successfull.");
+        }
+        m_TaxTreeLoaded = true;
+            
+        if(m_TaxClient->IsAlive()) {
+            m_TreeIterator = m_TaxClient->GetTreeIterator();
+        }
+        else {
+            const string& err = m_TaxClient->GetLastError();
+            NCBI_THROW(CException, eUnknown,"Cannot connect to tax server. " + err);
+        }
+    }
+}
+
+
+void CTaxFormat::x_PrintTaxInfo(vector <int> taxids, string title)
+{
+    if(m_Debug) {
+        cerr << "******" << title << "**********" << endl;
+        for(size_t i = 0; i < taxids.size(); i++) {
+            int taxid = taxids[i];                            
+            STaxInfo taxInfo = GetTaxTreeInfo(taxid);                         
+            string lineage;
+            for(size_t j = 0; j < taxInfo.lineage.size(); j++) {
+                if(!lineage.empty()) lineage += ",";
+                lineage += NStr::NumericToString(taxInfo.lineage[j]);
+            }
+            cerr << "taxid=" << taxid << " " << taxInfo.scientificName << " " << taxInfo.blastName << " " << "depth: " <<  taxInfo.depth << " numHits: " << taxInfo.numHits << " numOrgs: " << taxInfo.numOrgs << " numChildren: " << taxInfo.numChildren << " lineage: " << lineage << endl;                        
+        }
+    }
+}
+
+
+
+void CTaxFormat::x_InitOrgTaxMetaData(void)
+{
+    if(!m_TreeIterator.Empty()) {        
+        CUpwardTreeFiller upwFiller(m_BlastResTaxInfo->seqTaxInfoMap);
+        upwFiller.SetDebugMode(m_Debug);
+        //Create m_TaxTreeinfo with all taxids participating in common tree
+        m_TreeIterator->TraverseUpward(upwFiller);            
+        m_TaxTreeinfo = upwFiller.GetTreeTaxInfo();
+        std::reverse(m_TaxTreeinfo->orderedTaxids.begin(),m_TaxTreeinfo->orderedTaxids.end());                            
+        
+        //Add depth and linage infor to m_TaxTreeinfo
+        CDownwardTreeFiller dwnwFiller(&m_TaxTreeinfo->seqTaxInfoMap);
+        dwnwFiller.SetDebugMode(m_Debug);
+        m_TreeIterator->TraverseDownward(dwnwFiller);
+        vector <int> taxTreeTaxids = GetTaxTreeTaxIDs();
+
+        x_PrintTaxInfo(taxTreeTaxids,"Taxonomy tree");                     
+    }
+}
+
+void CTaxFormat::x_InitBlastNameTaxInfo(STaxInfo &taxInfo)
+{
+    
+    if(m_TaxClient && m_TaxClient->IsAlive()) {
+        m_TaxClient->GetBlastName(taxInfo.taxid,taxInfo.blastName);
+        taxInfo.blNameTaxid = m_TaxClient->SearchTaxIdByName(taxInfo.blastName,CTaxon1::eSearch_Exact);        
+    }
+}
+
+static string s_TaxidLinageToString(CTaxFormat::STaxInfo const& info)
+{
+    vector <int> lineage = info.lineage;            
+    string strTaxidLineage;
+    for(size_t j = 0; j < lineage.size(); j++) {
+        if(!strTaxidLineage.empty()) strTaxidLineage += " ";
+        strTaxidLineage += NStr::NumericToString(lineage[j]);
+    }            
+    return strTaxidLineage;
+}
+
+
+static bool s_SortByLinageToBestHit(CTaxFormat::STaxInfo const& info1,
+                                    CTaxFormat::STaxInfo const& info2)
+{
+    string lineage1 = s_TaxidLinageToString(info1);
+    string lineage2 = s_TaxidLinageToString(info2);
+    return lineage1 > lineage2;
+}
+
+
+static vector <int> s_InitAlignHitLineage(vector <int> bestHitLinage, struct CTaxFormat::STaxInfo &taxTreeInfo)
+{
+    vector <int> alignHitLineage;
+    for(size_t i = 0; i < bestHitLinage.size(); i++) {
+        if(taxTreeInfo.lineage.size() - 1 >= i) {
+          int taxid = bestHitLinage[i];
+          if(taxTreeInfo.lineage[i] == taxid) {
+              alignHitLineage.push_back(taxid);
+          }          
+        }
+    }        
+    return alignHitLineage;
+}
+
+
+
+void CTaxFormat::x_PrintLineage(void)
+{
+    if(m_Debug) {
+        cerr << "*********Lineage*********" << endl;
+        ITERATE(list <STaxInfo>, iter, m_AlnLineageTaxInfo) {             
+            int taxid = iter->taxid;    
+            string name = iter->scientificName;            
+            cerr << "taxid" << taxid << " " << name << ": "; 
+            for(size_t i = 0; i< iter->lineage.size();i++) {                
+                int lnTaxid = iter->lineage[i];            
+                cerr << " " << lnTaxid << " " << GetTaxTreeInfo(lnTaxid).scientificName + "," ;
+            }
+            cerr << endl;
+        }
+    }
+}
+
+void CTaxFormat::x_InitLineageMetaData(void)
+{
+        int betsHitTaxid = m_BlastResTaxInfo->orderedTaxids[0];
+        m_BestHitLineage = GetTaxTreeInfo(betsHitTaxid).lineage; 
+        vector <int> alignTaxids = GetAlignTaxIDs();
+        
+        list <STaxInfo> alnTaxInfo;
+        for(size_t i = 0; i < alignTaxids.size(); i++) {                    
+            STaxInfo taxInfo = GetTaxTreeInfo(alignTaxids[i]);
+            vector <int> alignHitLineage = s_InitAlignHitLineage(m_BestHitLineage,taxInfo);
+            taxInfo.lineage = alignHitLineage;
+            x_InitBlastNameTaxInfo(taxInfo);                                    
+            m_AlnLineageTaxInfo.push_back(taxInfo);            
+        }        
+        m_AlnLineageTaxInfo.sort(s_SortByLinageToBestHit);                
+        ITERATE(list <STaxInfo>, iter, m_AlnLineageTaxInfo) {            
+            for(size_t i = 0; i< iter->lineage.size();i++) {                
+                int lnTaxid = iter->lineage[i];  
+                STaxInfo &taxInfo = GetTaxTreeInfo(lnTaxid);
+                x_InitBlastNameTaxInfo(taxInfo);                                                    
+            }            
+        }
+        x_PrintLineage();                
+}
+
+void CUpwardTreeFiller::x_InitTaxInfo(const ITaxon1Node* tax_node)
+{
+    
+    CTaxFormat::STaxInfo *info = new CTaxFormat::STaxInfo;        
+
+    
+    int taxid = tax_node->GetTaxId();    
+    if(m_SeqAlignTaxInfoMap.count(taxid) != 0 ) {//sequence is in alignment
+        info->seqInfoList = m_SeqAlignTaxInfoMap[taxid].seqInfoList;        
+    }   
+
+    info->taxid = taxid;
+    info->scientificName = tax_node->GetName();
+    info->blastName = tax_node->GetBlastName();            
+    m_Curr = info;
+}
+
+void CUpwardTreeFiller::x_InitTreeTaxInfo(void)
+{
+    int taxid = m_Curr->taxid;
+    if(m_TreeTaxInfo->seqTaxInfoMap.count(taxid) == 0) {              
+        CTaxFormat::STaxInfo seqsForTaxID;
+        seqsForTaxID.taxid = m_Curr->taxid;
+        seqsForTaxID.commonName = m_Curr->commonName;
+        seqsForTaxID.scientificName = m_Curr->scientificName;                
+        seqsForTaxID.blastName = m_Curr->blastName;
+        seqsForTaxID.seqInfoList = m_Curr->seqInfoList;
+        seqsForTaxID.taxidList  = m_Curr->taxidList;        
+        seqsForTaxID.numHits = m_Curr->numHits;
+        seqsForTaxID.numOrgs = m_Curr->numOrgs;
+        seqsForTaxID.numChildren = m_Curr->numChildren;
+        m_TreeTaxInfo->seqTaxInfoMap.insert(CTaxFormat::TSeqTaxInfoMap::value_type(taxid,seqsForTaxID));  
+        m_TreeTaxInfo->orderedTaxids.push_back(taxid);
+	}    
+}
+
+
+bool CTaxFormat::isTaxidInAlign(int taxid)
+{
+    bool ret = false;
+    if(m_BlastResTaxInfo->seqTaxInfoMap.count(taxid) != 0 && m_BlastResTaxInfo->seqTaxInfoMap[taxid].seqInfoList.size() > 0) {
+        ret = true;
+    }
+    return ret;    
+}
+
+
+CTaxFormat::SSeqInfo *CTaxFormat::x_FillTaxDispParams(const CBioseq_Handle& bsp_handle,
+                                    double bits, 
+                                    double evalue) 
+{
+    SSeqInfo *seqInfo = new SSeqInfo;
+	seqInfo->gi = FindGi(bsp_handle.GetBioseqCore()->GetId());
+	seqInfo->seqID = FindBestChoice(bsp_handle.GetBioseqCore()->GetId(),CSeq_id::WorstRank);
+	seqInfo->label =  CAlignFormatUtil::GetLabel(seqInfo->seqID);//Just accession without db part like ref| or pdbd|		
+    seqInfo->bit_score = bits;
+    seqInfo->evalue = evalue;        
+    seqInfo->displGi = seqInfo->gi;
+    seqInfo->taxid = 0;	
+	seqInfo->title = CDeflineGenerator().GenerateDefline(bsp_handle);			    
+    return seqInfo;
+}
+
+
+
+
+
+CTaxFormat::SSeqInfo *CTaxFormat::x_FillTaxDispParams(const CRef< CBlast_def_line > &bdl,
+                                     const CBioseq_Handle& bsp_handle,
+                                     double bits, 
+                                     double evalue,                                    
+		                             list<TGi>& use_this_gi)
+                                                                        
+{
+    SSeqInfo *seqInfo = NULL;
+
+	const list<CRef<CSeq_id> > ids = bdl->GetSeqid();
+	TGi gi =  CAlignFormatUtil::GetGiForSeqIdList(ids);
+    TGi gi_in_use_this_gi = ZERO_GI;
+    
+    ITERATE(list<TGi>, iter_gi, use_this_gi){
+        if(gi == *iter_gi){
+            gi_in_use_this_gi = *iter_gi;
+            break;
+        }
+    }
+	if(use_this_gi.empty() || gi_in_use_this_gi > ZERO_GI) {
+        
+		seqInfo = new SSeqInfo();
+		seqInfo->gi =  gi;
+		seqInfo->seqID = FindBestChoice(ids, CSeq_id::WorstRank);		
+		seqInfo->label =  CAlignFormatUtil::GetLabel(seqInfo->seqID);//Just accession without db part like ref| or pdbd|		
+        seqInfo->bit_score = bits;
+        seqInfo->evalue = evalue;         
+	    int taxid = 0;
+		
+		if(bdl->IsSetTaxid() &&  bdl->CanGetTaxid()){
+		    taxid = bdl->GetTaxid();
+		}
+        seqInfo->taxid = taxid;
+        		
+		
+		if(bdl->IsSetTitle()){
+			seqInfo->title = bdl->GetTitle();
+		}
+        if(seqInfo->title.empty()) {
+            seqInfo->title = CDeflineGenerator().GenerateDefline(bsp_handle);            
+        }        
+	}    	
+    return seqInfo;
+}
+
+
+void CTaxFormat::x_InitTaxInfoMap(void)
+{
+    int score, sum_n, num_ident;
+    double bits, evalue;
+    list<TGi> use_this_gi;
+    
+    m_BlastResTaxInfo = new SBlastResTaxInfo;
+    CConstRef<CSeq_id> previousId,subid;    
+    ITERATE(CSeq_align_set::Tdata, iter, m_SeqalignSetRef->Get()){ 
+
+        subid = &((*iter)->GetSeq_id(1));
+
+        if(!previousId.Empty() && subid->Match(*previousId)) continue;        
+
+        CAlignFormatUtil::GetAlnScores(**iter, score, bits, evalue,
+                                       sum_n, num_ident, use_this_gi);        
+        try {
+            const CBioseq_Handle& handle = m_Scope.GetBioseqHandle(*subid);            
+            if( !handle ) continue;
+
+            const CRef<CBlast_def_line_set> bdlRef =  CSeqDB::ExtractBlastDefline(handle);    
+            const list< CRef< CBlast_def_line > > &bdl = (bdlRef.Empty()) ? list< CRef< CBlast_def_line > >() : bdlRef->Get();
+            		    
+            if(!bdl.empty()){ //no blast defline struct, should be no such case now
+                                
+                TGi dispGI = ZERO_GI;
+                for(list< CRef< CBlast_def_line > >::const_iterator iter = bdl.begin(); iter != bdl.end(); iter++){                                                        
+                    SSeqInfo *seqInfo = x_FillTaxDispParams(*iter,handle,bits,evalue,use_this_gi);
+                    if(seqInfo) {
+                        if(dispGI == ZERO_GI){
+                            dispGI = CAlignFormatUtil::GetDisplayIds(bdl,*seqInfo->seqID,use_this_gi);                            
+                        }                                        
+                        seqInfo->displGi = dispGI;
+                        x_InitBlastDBTaxInfo(seqInfo);
+                    }
+                    
+                }
+            }                                    
+            else 
+            {      
+                SSeqInfo *seqInfo = x_FillTaxDispParams(handle,bits,evalue);                
+                if(seqInfo) {
+                    x_InitBlastDBTaxInfo(seqInfo);
+                }
+            }              
+            previousId = subid;
+        } 
+        catch (const CException&){
+            continue;
+        }                
+    }        
+}
+
+void CTaxFormat::x_InitBlastDBTaxInfo(CTaxFormat::SSeqInfo *seqInfo)    
+{
+    int taxid = seqInfo->taxid;
+    if(m_BlastResTaxInfo->seqTaxInfoMap.count(taxid) == 0){		                            
+        SSeqDBTaxInfo taxInfo;
+        CSeqDB::GetTaxInfo(taxid, taxInfo);                
+
+        STaxInfo seqsForTaxID;
+        seqsForTaxID.taxid = taxid;
+        seqsForTaxID.commonName = taxInfo.common_name;
+        seqsForTaxID.scientificName = taxInfo.scientific_name;
+        seqsForTaxID.blastName = taxInfo.blast_name;                    
+        seqsForTaxID.giList = NStr::NumericToString(seqInfo->gi);        
+        seqsForTaxID.accList = seqInfo->label;
+        x_InitBlastNameTaxInfo(seqsForTaxID);
+        seqsForTaxID.seqInfoList.push_back(seqInfo);
+		m_BlastResTaxInfo->seqTaxInfoMap.insert(CTaxFormat::TSeqTaxInfoMap::value_type(taxid,seqsForTaxID));  
+        m_BlastResTaxInfo->orderedTaxids.push_back(taxid);
+	}
+    else {
+        m_BlastResTaxInfo->seqTaxInfoMap[taxid].giList += ",";
+        m_BlastResTaxInfo->seqTaxInfoMap[taxid].giList += NStr::NumericToString(seqInfo->gi);
+
+        m_BlastResTaxInfo->seqTaxInfoMap[taxid].accList += ", ";
+        m_BlastResTaxInfo->seqTaxInfoMap[taxid].accList += seqInfo->label;
+
+        m_BlastResTaxInfo->seqTaxInfoMap[taxid].seqInfoList.push_back(seqInfo);
+    }    
+}
+
+
+string CTaxFormat::x_MapSeqTemplate(string seqTemplate, STaxInfo &taxInfo)
+{
+    SSeqInfo *seqInfo = taxInfo.seqInfoList[0];
+    int taxid = taxInfo.taxid;
+    
+    string reportTableRow = CAlignFormatUtil::MapTemplate(seqTemplate,"acc",m_BlastResTaxInfo->seqTaxInfoMap[taxid].accList);        
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"descr",seqInfo->title);    
+    reportTableRow = x_MapSeqTemplate(reportTableRow,seqInfo);    
+    
+    return reportTableRow;
+}
+
+
+string CTaxFormat::x_MapSeqTemplate(string seqTemplate, SSeqInfo *seqInfo)
+{
+    string evalue_buf, bit_score_buf, total_bit_score_buf, raw_score_buf;
+    CAlignFormatUtil::GetScoreString(seqInfo->evalue, seqInfo->bit_score, 0, 0,
+                                             evalue_buf, bit_score_buf, total_bit_score_buf,raw_score_buf);
+
+    string reportTableRow = CAlignFormatUtil::MapTemplate(seqTemplate,"acc",seqInfo->label);    
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"gi",NStr::NumericToString(seqInfo->gi));
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"disp_gi",NStr::NumericToString(seqInfo->displGi));    
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"descr",seqInfo->title);
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"descr_abbr",seqInfo->title.substr(0,60));//for standalone output    
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"score",bit_score_buf);
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"evalue",evalue_buf);           
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"rid",m_Rid);
+    return reportTableRow;
+}
+
+string CTaxFormat::x_MapTaxInfoTemplate(string tableRowTemplate,STaxInfo &taxInfo,unsigned int depth)
+{
+    string reportTableRow = CAlignFormatUtil::MapTemplate(tableRowTemplate,"blast_name_link",m_TaxFormatTemplates->blastNameLink);
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"scientific_name",taxInfo.scientificName);
+    string commonName = (taxInfo.commonName != taxInfo.scientificName) ? "(" + taxInfo.commonName + ")" : "";    
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"common_name",commonName);        
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"blast_name",taxInfo.blastName);                    
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"bl_taxid",taxInfo.blNameTaxid);
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"taxid",taxInfo.taxid);
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"taxBrowserURL",m_TaxBrowserURL);    
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"rid",m_Rid);
+    int numHits = taxInfo.seqInfoList.size();
+    numHits = (numHits > 0) ? numHits : taxInfo.numHits;
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"numhits",numHits);                        
+
+    string shift;    
+    for(size_t i = 0; i < depth; i++) {
+        shift += ".";
+    }
+    reportTableRow = CAlignFormatUtil::MapTemplate(reportTableRow,"depth",shift);                                             
+    
+    return reportTableRow;
+}
+
+
+
+END_SCOPE(align_format)
+END_NCBI_SCOPE
diff --git a/c++/src/objtools/align_format/unit_test/Makefile.align_format_unit_test.app b/c++/src/objtools/align_format/unit_test/Makefile.align_format_unit_test.app
index 5c5a934..f80cadf 100644
--- a/c++/src/objtools/align_format/unit_test/Makefile.align_format_unit_test.app
+++ b/c++/src/objtools/align_format/unit_test/Makefile.align_format_unit_test.app
@@ -1,4 +1,4 @@
-# $Id: Makefile.align_format_unit_test.app 451547 2014-11-07 14:32:47Z boratyng $
+# $Id: Makefile.align_format_unit_test.app 482779 2015-10-26 18:46:34Z boratyng $
 
 APP = align_format_unit_test
 SRC = showdefline_unit_test showalign_unit_test blast_test_util \
@@ -21,5 +21,5 @@ CHECK_REQUIRES = in-house-resources
 
 REQUIRES = Boost.Test.Included
 
-WATCHERS = zaretska jianye madden camacho
+WATCHERS = zaretska jianye madden camacho boratyng
 CHECK_TIMEOUT = 900
diff --git a/c++/src/objtools/align_format/unit_test/aln_printer_unit_test.cpp b/c++/src/objtools/align_format/unit_test/aln_printer_unit_test.cpp
index 47c0f8d..be79491 100644
--- a/c++/src/objtools/align_format/unit_test/aln_printer_unit_test.cpp
+++ b/c++/src/objtools/align_format/unit_test/aln_printer_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: aln_printer_unit_test.cpp 482959 2015-10-27 18:45:46Z ivanov $
+/*  $Id: aln_printer_unit_test.cpp 482778 2015-10-26 18:45:59Z boratyng $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/align_format/unit_test/data/in_showalign_use_this_gi.asn b/c++/src/objtools/align_format/unit_test/data/in_showalign_use_this_gi.asn
old mode 100755
new mode 100644
diff --git a/c++/src/objtools/align_format/unit_test/data/protein.fa b/c++/src/objtools/align_format/unit_test/data/protein.fa
old mode 100755
new mode 100644
diff --git a/c++/src/objtools/align_format/unit_test/showalign_unit_test.cpp b/c++/src/objtools/align_format/unit_test/showalign_unit_test.cpp
index 6142845..09faa1a 100644
--- a/c++/src/objtools/align_format/unit_test/showalign_unit_test.cpp
+++ b/c++/src/objtools/align_format/unit_test/showalign_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: showalign_unit_test.cpp 482386 2015-10-22 16:35:09Z ivanov $
+/*  $Id: showalign_unit_test.cpp 482204 2015-10-21 15:34:36Z zaretska $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -107,10 +107,10 @@ BOOST_AUTO_TEST_CASE(TestTGIConversion)
     ds.SetSeqLocChar(CDisplaySeqalign::eLowerCase);
     CNcbiOstrstream output_stream;
     ds.DisplaySeqalign(output_stream);
-    string output = CNcbiOstrstreamToString(output_stream);
-    BOOST_REQUIRE(output.find("gi|212900|gb|AAA68886.1| ") != NPOS);
-    BOOST_REQUIRE(output.find("gi|385145537|dbj|BAM13277.1|") != NPOS);
-    BOOST_REQUIRE(output.find("gi|385145539|dbj|BAM13278.1|") != NPOS);        
+    string output = CNcbiOstrstreamToString(output_stream);    
+    BOOST_REQUIRE(output.find("gi|212900") != NPOS);
+    BOOST_REQUIRE(output.find("gi|385145537") != NPOS);
+    BOOST_REQUIRE(output.find("gi|385145539") != NPOS);        
 }
 
 bool TestSimpleAlignment(CBlastOM::ELocation location)
diff --git a/c++/src/objtools/align_format/unit_test/showdefline_unit_test.cpp b/c++/src/objtools/align_format/unit_test/showdefline_unit_test.cpp
index 1030240..5a3b9e1 100644
--- a/c++/src/objtools/align_format/unit_test/showdefline_unit_test.cpp
+++ b/c++/src/objtools/align_format/unit_test/showdefline_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: showdefline_unit_test.cpp 482729 2015-10-26 16:30:38Z ivanov $
+/*  $Id: showdefline_unit_test.cpp 478164 2015-09-04 14:48:17Z fongah2 $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/align_format/unit_test/tabularinof_unit_test.cpp b/c++/src/objtools/align_format/unit_test/tabularinof_unit_test.cpp
index 92b04fc..38a1b49 100644
--- a/c++/src/objtools/align_format/unit_test/tabularinof_unit_test.cpp
+++ b/c++/src/objtools/align_format/unit_test/tabularinof_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: tabularinof_unit_test.cpp 482737 2015-10-26 16:33:40Z ivanov $
+/*  $Id: tabularinof_unit_test.cpp 495725 2016-03-21 14:24:26Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -218,12 +218,16 @@ BOOST_AUTO_TEST_CASE(TaxonomyOutput) {
     CRef<CScope> scope = tmp_data_loader.NewScope();
 
     CNcbiOstrstream output_stream;
+    CNcbiOstrstream output_stream2;
     CBlastTabularInfo ctab(output_stream, "qacc sacc staxids sscinames scomnames sblastnames sskingdoms");
+    CBlastTabularInfo ctab2(output_stream2, "qacc sacc staxid ssciname scomname sblastname sskingdom");
 
     ITERATE(list<CRef<CSeq_align> >, iter, seqalign_list)
     {
        ctab.SetFields(**iter, *scope);
+       ctab2.SetFields(**iter, *scope);
        ctab.Print();
+       ctab2.Print();
     }
     const string ref[8] = {
 	"9940	Ovis aries	sheep	even-toed ungulates	Eukaryota",
@@ -236,12 +240,29 @@ BOOST_AUTO_TEST_CASE(TaxonomyOutput) {
 	"89462	Bubalus bubalis	water buffalo	even-toed ungulates	Eukaryota"
  };
 
-    string output = CNcbiOstrstreamToString(output_stream);
-    vector<string> results;
-    NStr::Tokenize(output, "\n", results);
+    {
+    	string output = CNcbiOstrstreamToString(output_stream);
+    	vector<string> results;
+    	NStr::Split(output, "\n", results);
+
+    	for(unsigned int i=0; i < 8; i++) {
+    		BOOST_REQUIRE(results[i].find(ref[i]) != NPOS);
+    	}
+    }
+    {
+    	string output = CNcbiOstrstreamToString(output_stream2);
+    	vector<string> results;
+    	NStr::Split(output, "\n", results);
+    	const string single_tax = "89462	Bubalus bubalis	water buffalo	even-toed ungulates	Eukaryota";
 
-    for(unsigned int i=0; i < 8; i++) {
-    	BOOST_REQUIRE(results[i].find(ref[i]) != NPOS);
+    	for(unsigned int i=0; i < 8; i++) {
+    		if(i != 6) {
+    			BOOST_REQUIRE(results[i].find(ref[i]) != NPOS);
+    		}
+    		else {
+    			BOOST_REQUIRE(results[i].find(single_tax) != NPOS);
+    		}
+    	}
     }
 }
 
@@ -283,7 +304,7 @@ BOOST_AUTO_TEST_CASE(SubjectTitlesOutput) {
 
     	string output = CNcbiOstrstreamToString(output_stream);
     	vector<string> results;
-    	NStr::Tokenize(output, "\n", results);
+    	NStr::Split(output, "\n", results);
     	for(unsigned int i=0; i < 8; i++) {
     	    BOOST_REQUIRE(results[i].find(ref[i]) != NPOS);
     	}
@@ -310,7 +331,7 @@ BOOST_AUTO_TEST_CASE(SubjectTitlesOutput) {
             "PREDICTED: interleukin-1 alpha [Bubalus bubalis]<>interleukin-1 alpha [Bubalus bubalis]<>Interleukin-1 alpha [Bubalus bubalis x Bubalus carabanensis]",
             "interleukin 1, alpha [Bubalus bubalis]<>Interleukin-1 alpha [Bubalus bubalis]"}; 
     	vector<string> results;
-    	NStr::Tokenize(output, "\n", results);
+    	NStr::Split(output, "\n", results);
     	for(unsigned int i=0; i < 8; i++) {
     	    BOOST_REQUIRE(results[i].find(ref[i]) != NPOS);
     	}
diff --git a/c++/src/objtools/alnmgr/aln_builders.cpp b/c++/src/objtools/alnmgr/aln_builders.cpp
index fc12934..414113e 100644
--- a/c++/src/objtools/alnmgr/aln_builders.cpp
+++ b/c++/src/objtools/alnmgr/aln_builders.cpp
@@ -1,4 +1,4 @@
-/*  $Id: aln_builders.cpp 464814 2015-04-14 16:29:46Z vakatov $
+/*  $Id: aln_builders.cpp 498721 2016-04-19 13:29:11Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -337,12 +337,16 @@ SortAnchoredAlnVecByScore(TAnchoredAlnVec& anchored_aln_vec)
 
 
 void
-s_TranslateAnchorToAlnCoords(CPairwiseAln& out_anchor_pw, ///< output must be empty
+s_TranslateAnchorToAlnCoords(CPairwiseAln& out_anchor_pw, // output must be empty
                              const CPairwiseAln& anchor_pw)
 {
     if ( anchor_pw.empty() ) return;
-    CPairwiseAln::TPos aln_pos = 0; /// Start at 0
-    CPairwiseAln::TPos aln_len = anchor_pw.GetFirstLength();
+    CPairwiseAln::TPos aln_pos = 0; // Start at 0
+    CPairwiseAln::TPos aln_len = 0;
+    ITERATE (CPairwiseAln::TAlnRngColl, it, anchor_pw) {
+        aln_len += it->GetLength();
+    }
+
     bool direct = anchor_pw.begin()->IsFirstDirect();
 
     // There should be no gaps on anchor
@@ -692,7 +696,8 @@ BuildAln(TAnchoredAlnVec& in_alns,
     out_aln.SetAnchorRow(anchor_first ? 0 : out_aln.GetPairwiseAlns().size() - 1);
     if ( !(options.m_MergeFlags & CAlnUserOptions::fUseAnchorAsAlnSeq) ) {
         if ( !pseudo_seqid ) {
-            CRef<CSeq_id> seq_id (new CSeq_id("lcl|pseudo [timestamp: " + CTime(CTime::eCurrent).AsString() + "]"));
+            CRef<CSeq_id> seq_id (new CSeq_id("lcl|pseudo [timestamp " +
+                CTime(CTime::eCurrent).AsString("YMDhms") + "]"));
             CRef<CAlnSeqId> aln_seq_id(new CAlnSeqId(*seq_id));
             pseudo_seqid.Reset(aln_seq_id);
         }
diff --git a/c++/src/objtools/alnmgr/alnsegments.cpp b/c++/src/objtools/alnmgr/alnsegments.cpp
index ba2b332..f5a3812 100644
--- a/c++/src/objtools/alnmgr/alnsegments.cpp
+++ b/c++/src/objtools/alnmgr/alnsegments.cpp
@@ -1,4 +1,4 @@
-/*  $Id: alnsegments.cpp 355293 2012-03-05 15:17:16Z vasilche $
+/*  $Id: alnsegments.cpp 488694 2016-01-04 20:27:43Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -109,7 +109,10 @@ CAlnMixSegments::Build(bool gap_join,
         // for each refseq segment
         while (refseq->GetStarts().current != refseq->GetStarts().end()) {
             stack< CRef<CAlnMixSegment> > seg_stack;
+            // To prevent infinite loop, remember all segments already on the stack.
+            set< CRef<CAlnMixSegment> > seg_set;
             seg_stack.push(refseq->GetStarts().current->second);
+            seg_set.insert(refseq->GetStarts().current->second);
 #if _DEBUG
             const TSeqPos& refseq_start = refseq->GetStarts().current->first;
 #if _DEBUG && _ALNMGR_TRACE
@@ -156,6 +159,14 @@ CAlnMixSegments::Build(bool gap_join,
                         }
 #endif
                         seg_stack.push(row->GetStarts().current->second);
+                        // If the segment is already in the set, we have infinite loop
+                        // and must terminate it.
+                        if (!seg_set.insert(row->GetStarts().current->second).second) {
+                            string errstr =
+                                string("CAlnMixSegments::Build():")
+                                + " Internal error: Infinite loop detected.";
+                            NCBI_THROW(CAlnException, eMergeFailure, errstr);
+                        }
 #if _DEBUG && _ALNMGR_TRACE
                         cerr << "  [row " << row->m_RowIdx
                              << " seq " << row->m_SeqIdx
@@ -163,14 +174,6 @@ CAlnMixSegments::Build(bool gap_join,
                              << " (left of start " << row_start << ") "
                              << "was pushed into stack\n";
 #endif
-#if _DEBUG
-                        if (row == refseq) {
-                            string errstr =
-                                string("CAlnMixSegments::Build():")
-                                + " Internal error: Infinite loop detected.";
-                            NCBI_THROW(CAlnException, eMergeFailure, errstr);
-                        }                            
-#endif
                         pop_seg = false;
                         break;
                     }
diff --git a/c++/src/objtools/alnmgr/pairwise_aln.cpp b/c++/src/objtools/alnmgr/pairwise_aln.cpp
index f6a4bab..900d1e7 100644
--- a/c++/src/objtools/alnmgr/pairwise_aln.cpp
+++ b/c++/src/objtools/alnmgr/pairwise_aln.cpp
@@ -1,4 +1,4 @@
-/*  $Id: pairwise_aln.cpp 377671 2012-10-15 15:57:48Z grichenk $
+/*  $Id: pairwise_aln.cpp 489594 2016-01-14 14:58:22Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -77,10 +77,10 @@ CPairwise_CI& CPairwise_CI::operator++(void)
 }
 
 
-void CPairwise_CI::x_Init(void)
+void CPairwise_CI::x_Init(bool force_direct)
 {
     // Mixed direction and empty alignments are iterated in direct order.
-    m_Direct =
+    m_Direct = force_direct ||
         ((m_Aln->GetFlags() & CPairwiseAln::fMixedDir) == CPairwiseAln::fMixedDir)  ||
         m_Aln->empty()  ||
         m_Aln->begin()->IsFirstDirect();
@@ -132,17 +132,29 @@ void CPairwise_CI::x_InitSegment(void)
     }
     else {
         // Gap
-        _ASSERT(m_It->IsDirect() == m_GapIt->IsDirect());
+        TSignedSeqPos it_second_from = m_It->GetSecondFrom();
+        TSignedSeqPos it_second_to = m_It->GetSecondToOpen();
+        TSignedSeqPos gap_second_from = m_GapIt->GetSecondFrom();
+        TSignedSeqPos gap_second_to = m_GapIt->GetSecondToOpen();
         if ( m_Direct ) {
-            m_FirstRg.SetOpen(m_GapIt->GetFirstToOpen(),
-                m_It->GetFirstFrom());
+            m_FirstRg.SetOpen(m_GapIt->GetFirstToOpen(), m_It->GetFirstFrom());
             if ( m_It->IsDirect() ) {
-                m_SecondRg.SetOpen(m_GapIt->GetSecondToOpen(),
-                    m_It->GetSecondFrom());
+                if ( m_GapIt->IsDirect() ) {
+                    m_SecondRg.SetOpen(gap_second_to, it_second_from);
+                }
+                else {
+                    m_SecondRg.SetOpen(min(gap_second_from, it_second_from),
+                        max(gap_second_from, it_second_from));
+                }
             }
             else {
-                m_SecondRg.SetOpen(m_It->GetSecondToOpen(),
-                    m_GapIt->GetSecondFrom());
+                if ( !m_GapIt->IsDirect() ) {
+                    m_SecondRg.SetOpen(it_second_to, gap_second_from);
+                }
+                else {
+                    m_SecondRg.SetOpen(min(gap_second_to, it_second_to),
+                        max(gap_second_to, it_second_to));
+                }
             }
             if ( !m_Unaligned ) {
                 if (!m_FirstRg.Empty()  &&  !m_SecondRg.Empty()) {
@@ -162,12 +174,22 @@ void CPairwise_CI::x_InitSegment(void)
         else {
             m_FirstRg.SetOpen(m_It->GetFirstToOpen(), m_GapIt->GetFirstFrom());
             if ( m_It->IsDirect() ) {
-                m_SecondRg.SetOpen(m_It->GetSecondToOpen(),
-                    m_GapIt->GetSecondFrom());
+                if ( m_GapIt->IsDirect() ) {
+                    m_SecondRg.SetOpen(it_second_to, gap_second_from);
+                }
+                else {
+                    m_SecondRg.SetOpen(min(it_second_to, gap_second_to),
+                        max(it_second_to, gap_second_to));
+                }
             }
             else {
-                m_SecondRg.SetOpen(m_GapIt->GetSecondToOpen(),
-                    m_It->GetSecondFrom());
+                if ( !m_GapIt->IsDirect() ) {
+                    m_SecondRg.SetOpen(gap_second_to, it_second_from);
+                }
+                else {
+                    m_SecondRg.SetOpen(min(it_second_from, gap_second_from),
+                        max(it_second_from, gap_second_from));
+                }
             }
             if ( !m_Unaligned ) {
                 if ( !m_FirstRg.Empty()  &&  !m_SecondRg.Empty()) {
diff --git a/c++/src/objtools/alnmgr/score_builder_base.cpp b/c++/src/objtools/alnmgr/score_builder_base.cpp
index bdf1226..4a2b488 100644
--- a/c++/src/objtools/alnmgr/score_builder_base.cpp
+++ b/c++/src/objtools/alnmgr/score_builder_base.cpp
@@ -1,4 +1,4 @@
-/*  $Id: score_builder_base.cpp 474108 2015-07-24 21:16:50Z vasilche $
+/*  $Id: score_builder_base.cpp 474106 2015-07-24 21:06:03Z vasilche $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/alnmgr/sparse_aln.cpp b/c++/src/objtools/alnmgr/sparse_aln.cpp
index f4011d8..d06df79 100644
--- a/c++/src/objtools/alnmgr/sparse_aln.cpp
+++ b/c++/src/objtools/alnmgr/sparse_aln.cpp
@@ -1,4 +1,4 @@
-/*  $Id: sparse_aln.cpp 377671 2012-10-15 15:57:48Z grichenk $
+/*  $Id: sparse_aln.cpp 498721 2016-04-19 13:29:11Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -35,9 +35,12 @@
 #include <objtools/alnmgr/sparse_ci.hpp>
 #include <objtools/alnmgr/alnexception.hpp>
 #include <objtools/error_codes.hpp>
+#include <objmgr/util/sequence.hpp>
 
 #include <objects/seqalign/Sparse_align.hpp>
 #include <objects/seqfeat/Genetic_code_table.hpp>
+#include <objects/seqfeat/Org_ref.hpp>
+
 
 #define NCBI_USE_ERRCODE_X   Objtools_Aln_Sparse
 
@@ -213,7 +216,6 @@ void CSparseAln::x_Build(const CAnchoredAln& src_align)
         _ASSERT( !m_Aln->GetPairwiseAlns()[row]->IsSet(TAlnRngColl::fInvalid) );
         _ASSERT( !m_Aln->GetPairwiseAlns()[row]->IsSet(TAlnRngColl::fUnsorted) );
         _ASSERT( !m_Aln->GetPairwiseAlns()[row]->IsSet(TAlnRngColl::fOverlap) );
-        _ASSERT( !m_Aln->GetPairwiseAlns()[row]->IsSet(TAlnRngColl::fMixedDir) );
 
         /// Determine m_FirstRange
         if (row == 0) {
@@ -441,6 +443,20 @@ CSeqVector& CSparseAln::x_GetSeqVector(TNumrow row) const
 }
 
 
+int CSparseAln::x_GetGenCode(TNumrow row) const
+{
+    int gencode = kDefaultGenCode;
+    try {
+        CBioseq_Handle h = GetBioseqHandle(row);
+        if ( h ) {
+            gencode = sequence::GetOrg_ref(h).GetGcode();
+        }
+    }
+    catch (...) {}
+    return gencode;
+}
+
+
 void CSparseAln::TranslateNAToAA(const string& na,
                                  string& aa,
                                  int gencode)
@@ -479,55 +495,57 @@ string& CSparseAln::GetSeqString(TNumrow row,
                                  TSeqPos seq_from, TSeqPos seq_to,
                                  bool force_translation) const
 {
+    return GetSeqString(row, buffer, TRange(seq_from, seq_to), force_translation);
+}
+
+
+string& CSparseAln::GetSeqString(TNumrow row,
+                                 string &buffer,
+                                 const TRange &rq_seq_range,
+                                 bool force_translation) const
+{
     _ASSERT(row >= 0  &&  row < GetDim());
 
+    TRange seq_range = rq_seq_range;
+    if ( seq_range.IsWhole() ) {
+        seq_range = GetSeqRange(row);
+    }
+
     buffer.erase();
     int width = m_Aln->GetPairwiseAlns()[row]->GetSecondBaseWidth();
+    TSeqPos tr_from = seq_range.GetFrom();
+    TSeqPos tr_to = seq_range.GetToOpen();
     if (width > 1) {
-        seq_from /= 3;
-        seq_to /= 3;
+        // It's a protein sequence. Protein coordinates were multiplied by 3,
+        // any fractions (incomplete AAs) must be discarded.
+        tr_from /= 3;
+        if (seq_range.GetFrom() % 3 > 0) {
+            tr_from++; // skip incomplete AA
+        }
+        tr_to /= 3;
         force_translation = false; // do not translate AAs.
     }
-    if (seq_to >= seq_from) {
+    if (tr_to > tr_from) {
         CSeqVector& seq_vector = x_GetSeqVector(row);
 
-        size_t size = seq_to - seq_from + 1;
+        TSeqPos size = tr_to - tr_from;
         buffer.resize(size, m_GapChar);
 
         if (IsPositiveStrand(row)) {
-            seq_vector.GetSeqData(seq_from, seq_to + 1, buffer);
+            seq_vector.GetSeqData(tr_from, tr_to, buffer);
         } else {
             TSeqPos vec_size = seq_vector.size();
-            seq_vector.GetSeqData(vec_size - seq_to - 1, vec_size - seq_from, buffer);
+            seq_vector.GetSeqData(vec_size - tr_to, vec_size - tr_from, buffer);
         }
 
         if ( force_translation ) {
-            TranslateNAToAA(buffer, buffer);
+            TranslateNAToAA(buffer, buffer, x_GetGenCode(row));
         }
     }
     return buffer;
 }
 
 
-string& CSparseAln::GetSeqString(TNumrow row,
-                                 string &buffer,
-                                 const TRange &rq_seq_range,
-                                 bool force_translation) const
-{
-    _ASSERT(row >= 0  &&  row < GetDim());
-
-    TRange seq_range = rq_seq_range;
-    if ( seq_range.IsWhole() ) {
-        seq_range = GetSeqRange(row);
-    }
-
-    return GetSeqString(row,
-                        buffer,
-                        seq_range.GetFrom(), seq_range.GetTo(),
-                        force_translation);
-}
-
-
 string& CSparseAln::GetAlnSeqString(TNumrow row,
                                     string &buffer,
                                     const TSignedRange &rq_aln_range,
@@ -556,71 +574,130 @@ string& CSparseAln::GetAlnSeqString(TNumrow row,
     TSeqPos vec_size = seq_vector.size();
 
     const int base_width = pairwise_aln.GetSecondBaseWidth();
+    int gencode = 0;
     bool translate = force_translation  ||  pairwise_aln.GetSecondId()->IsProtein();
 
     // buffer holds sequence for "aln_range", 0 index corresonds to aln_range.GetFrom()
-    size_t size = aln_range.GetLength();
+    size_t buf_size = aln_range.GetLength();
     if (translate) {
-        size /= 3;
+        gencode = x_GetGenCode(row);
+        buf_size /= 3;
     }
-    buffer.resize(size, m_GapChar);
+    buffer.resize(buf_size, m_GapChar);
 
     string s; // current segment sequence
     CSparse_CI it(*this, row, IAlnSegmentIterator::eSkipInserts, aln_range);
 
+    // Store last incomplete codon's position and length. If the next
+    // segment includes the rest of the same codon, it should be included
+    // in the results. Otherwise incomplete codons are removed from protein
+    // sequences.
+    TSeqPos split_codon_pos = kInvalidSeqPos;
+    // When trimming one or more codons, future offsets must be adjusted.
+    bool direct = IsPositiveStrand(row);
+    bool is_first_seg = true;
+    size_t trim_from = 0;
+    size_t trim_to = 0;
     while ( it )   {
+        trim_to = 0;
         const IAlnSegment::TSignedRange& aln_r = it->GetAlnRange(); // in alignment
         const IAlnSegment::TSignedRange& row_r = it->GetRange(); // on sequence
         if ( row_r.Empty() ) {
             ++it;
+            is_first_seg = false;
             continue;
         }
 
-        size_t off;
+        size_t off = aln_r.GetFrom() - aln_range.GetFrom();
         if (base_width == 1) {
             // TODO performance issue - waiting for better API
-            if (IsPositiveStrand(row)) {
+            if ( direct ) {
                 seq_vector.GetSeqData(row_r.GetFrom(), row_r.GetToOpen(), s);
             } else {
                 seq_vector.GetSeqData(vec_size - row_r.GetToOpen(),
-                                        vec_size - row_r.GetFrom(), s);
-            }
-            if (translate) {
-                TranslateNAToAA(s, s);
+                    vec_size - row_r.GetFrom(), s);
             }
-            off = aln_r.GetFrom() - aln_range.GetFrom();
-            if (translate) {
+            if ( translate ) {
+                TranslateNAToAA(s, s, gencode);
                 off /= 3;
             }
         }
         else {
             _ASSERT(base_width == 3);
-            IAlnSegment::TSignedRange prot_r = row_r;
-            if (prot_r.GetLength() > 0) {
-                prot_r.SetFrom(row_r.GetFrom() / 3);
-                prot_r.SetLength(row_r.GetLength() < 3 ? 1 : row_r.GetLength() / 3);
-                if (IsPositiveStrand(row)) {
-                    seq_vector.GetSeqData(prot_r.GetFrom(),
-                                            prot_r.GetToOpen(), s);
+            TSeqPos tr_from = row_r.GetFrom();
+            TSeqPos tr_to = row_r.GetToOpen();
+            if ( direct ) {
+                if (tr_from % 3 > 0) {
+                    if (tr_from == split_codon_pos) {
+                        // Include incomplete codon from the last range.
+                        _ASSERT(off > 0);
+                        if ( is_first_seg ) trim_from = tr_from % 3;
+                        off -= tr_from % 3;
+                        tr_from -= tr_from % 3;
+                    }
+                    else {
+                        // Trim incomplete codon at range start.
+                        off += 3 - (tr_from % 3);
+                        tr_from += 3 - (tr_from % 3);
+                    }
                 }
-                else {
-                    seq_vector.GetSeqData(vec_size - prot_r.GetToOpen(),
-                                          vec_size - prot_r.GetFrom(), s);
+                if (tr_to % 3 > 0) {
+                    split_codon_pos = tr_to;
+                    trim_to = tr_to % 3;
+                    tr_to -= tr_to % 3;
                 }
             }
-            off = (aln_r.GetFrom() - aln_range.GetFrom()) / 3;
+            else /* reverse */ {
+                if (tr_to % 3 > 0) {
+                    if (tr_to == split_codon_pos) {
+                        // Include incomplete codon from the last range.
+                        _ASSERT(off > 0);
+                        if ( is_first_seg ) trim_from = 3 - (tr_to % 3);
+                        off -= 3 - (tr_to % 3);
+                        tr_to += 3 - (tr_to % 3);
+                    }
+                    else {
+                        off += tr_to % 3;
+                        tr_to -= tr_to % 3;
+                    }
+                }
+                if (tr_from % 3 > 0) {
+                    split_codon_pos = tr_from;
+                    trim_to = 3 - (tr_from % 3);
+                    tr_from += 3 - (tr_from % 3);
+                }
+            }
+            off /= 3;
+            _ASSERT(tr_from % 3 == 0);
+            _ASSERT(tr_to % 3 == 0);
+            IAlnSegment::TSignedRange prot_r;
+            prot_r.SetOpen(tr_from / 3, tr_to / 3);
+            if ( direct ) {
+                seq_vector.GetSeqData(prot_r.GetFrom(),
+                                        prot_r.GetToOpen(), s);
+            }
+            else {
+                seq_vector.GetSeqData(vec_size - prot_r.GetToOpen(),
+                                        vec_size - prot_r.GetFrom(), s);
+            }
         }
 
-        size_t len = min(size - off, s.size());
-        _ASSERT(off + len <= size);
+        size_t len = min(buf_size - off, s.size());
+        _ASSERT(off + len <= buf_size);
 
-        if ( m_AnchorDirect ) {
-            buffer.replace(off, len, s, 0, len);
-        }
-        else {
-            buffer.replace(size - off - len, len, s, 0, len);
+        if (len > 0) {
+            if ( m_AnchorDirect ) {
+                buffer.replace(off, len, s, 0, len);
+            }
+            else {
+                buffer.replace(buf_size - off - len, len, s, 0, len);
+            }
         }
         ++it;
+        is_first_seg = false;
+    }
+    if ( translate ) {
+        buffer.resize((aln_range.GetLength() - trim_from - trim_to) / 3);
     }
     return buffer;
 }
diff --git a/c++/src/objtools/alnmgr/sparse_ci.cpp b/c++/src/objtools/alnmgr/sparse_ci.cpp
index 29cc3ad..849a5c9 100644
--- a/c++/src/objtools/alnmgr/sparse_ci.cpp
+++ b/c++/src/objtools/alnmgr/sparse_ci.cpp
@@ -1,4 +1,4 @@
-/*  $Id: sparse_ci.cpp 367827 2012-06-28 16:50:47Z grichenk $
+/*  $Id: sparse_ci.cpp 490380 2016-01-25 16:11:22Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -76,6 +76,15 @@ const CSparseSegment::TSignedRange& CSparseSegment::GetRange(void) const
 
 void CSparse_CI::x_InitSegment(void)
 {
+    // Update anchor and row directions - mixed strand alignments are now allowed.
+    // If an iterator is not valid, use the last known direction.
+    if ( m_AnchorIt ) {
+        m_AnchorDirect = m_AnchorIt.IsFirstDirect();
+    }
+    if ( m_RowIt ) {
+        m_RowDirect = m_RowIt.IsDirect();
+    }
+
     bool anchor_gap = !m_AnchorIt  ||
         m_AnchorIt.GetSegType() == CPairwise_CI::eGap;
     bool row_gap = !m_RowIt  ||
@@ -245,12 +254,12 @@ void CSparse_CI::x_InitIterator(void)
     const CPairwiseAln& anchor_pw =
         *m_Aln->GetPairwiseAlns()[m_Aln->GetAnchorRow()];
     const CPairwiseAln& pw = *m_Aln->GetPairwiseAlns()[m_Row];
-    m_AnchorIt = CPairwise_CI(anchor_pw, m_TotalRange);
-    m_RowIt = CPairwise_CI(pw, m_TotalRange);
-    // Pairwise alignments in CSparseAln can not have mixed directions.
-    // Remember the first one and use for all segments.
-    m_AnchorDirect = m_AnchorIt ? m_AnchorIt.IsFirstDirect() : true;
-    m_RowDirect = m_RowIt ? m_RowIt.IsDirect() : true;
+    // If at least one of the rows has mixed strand, force all iterators to be direct.
+    bool mixed_strand =
+        (anchor_pw.GetFlags() & CPairwiseAln::fMixedDir) == CPairwiseAln::fMixedDir ||
+        (pw.GetFlags() & CPairwiseAln::fMixedDir) == CPairwiseAln::fMixedDir;
+    m_AnchorIt = CPairwise_CI(anchor_pw, m_TotalRange, mixed_strand);
+    m_RowIt = CPairwise_CI(pw, m_TotalRange, mixed_strand);
     if ( m_AnchorIt ) {
         m_NextAnchorRg = m_AnchorIt.GetFirstRange();
     }
@@ -350,7 +359,9 @@ CSparse_CI::CSparse_CI(const CSparseAln&   aln,
     : m_Flags(flags),
       m_Aln(aln.m_Aln),
       m_Row(row),
-      m_TotalRange(TSignedRange::GetWhole())
+      m_TotalRange(TSignedRange::GetWhole()),
+      m_AnchorDirect(true),
+      m_RowDirect(true)
 {
     x_InitIterator();
 }
@@ -363,7 +374,9 @@ CSparse_CI::CSparse_CI(const CSparseAln&   aln,
     : m_Flags(flags),
       m_Aln(aln.m_Aln),
       m_Row(row),
-      m_TotalRange(range)
+      m_TotalRange(range),
+      m_AnchorDirect(true),
+      m_RowDirect(true)
 {
     x_InitIterator();
 }
diff --git a/c++/src/objtools/blast/blastdb_format/blastdb_dataextract.cpp b/c++/src/objtools/blast/blastdb_format/blastdb_dataextract.cpp
index 36fea28..92cb928 100644
--- a/c++/src/objtools/blast/blastdb_format/blastdb_dataextract.cpp
+++ b/c++/src/objtools/blast/blastdb_format/blastdb_dataextract.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blastdb_dataextract.cpp 479602 2015-09-22 14:27:21Z ivanov $
+/*  $Id: blastdb_dataextract.cpp 479437 2015-09-21 12:40:14Z madden $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
  */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: blastdb_dataextract.cpp 479602 2015-09-22 14:27:21Z ivanov $";
+static char const rcsid[] = "$Id: blastdb_dataextract.cpp 479437 2015-09-21 12:40:14Z madden $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/objtools/blast/blastdb_format/unit_test/seq_writer_unit_test.cpp b/c++/src/objtools/blast/blastdb_format/unit_test/seq_writer_unit_test.cpp
index 5037410..f7b13ea 100644
--- a/c++/src/objtools/blast/blastdb_format/unit_test/seq_writer_unit_test.cpp
+++ b/c++/src/objtools/blast/blastdb_format/unit_test/seq_writer_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_writer_unit_test.cpp 411269 2013-08-27 16:31:51Z madden $
+/*  $Id: seq_writer_unit_test.cpp 488259 2015-12-29 14:32:15Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(TestRequestGiOidLength)
     in.getline(buffer, sizeof(buffer));
 
     vector<string> tokens;
-    NStr::Tokenize(string(buffer), " ", tokens);
+    NStr::Split(string(buffer), " ", tokens, NStr::fSplit_NoMergeDelims);
 
     int gi = NStr::StringToInt(tokens[2], kConvFlags);
     int oid = NStr::StringToInt(tokens[5], kConvFlags);
@@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE(TestRequestAccessionPIGTaxidTitle)
     in.getline(buffer, sizeof(buffer));
 
     vector<string> tokens;
-    NStr::Tokenize(string(buffer), " ", tokens);
+    NStr::Split(string(buffer), " ", tokens, NStr::fSplit_NoMergeDelims);
 
     int gi = NStr::StringToInt(tokens[1], kConvFlags);
     string accession = tokens[4];
@@ -228,7 +228,7 @@ BOOST_AUTO_TEST_CASE(TestRequestSequenceDataLength)
     in.getline(buffer, sizeof(buffer));
 
     vector<string> tokens;
-    NStr::Tokenize(string(buffer), "|", tokens);
+    NStr::Split(string(buffer), "|", tokens, NStr::fSplit_NoMergeDelims);
 
     int gi = NStr::StringToInt(tokens[0], kConvFlags);
     int len = NStr::StringToInt(tokens[1], kConvFlags);
diff --git a/c++/src/objtools/blast/gene_info_reader/demo/gene_info_reader_app.cpp b/c++/src/objtools/blast/gene_info_reader/demo/gene_info_reader_app.cpp
index 3597964..02043c4 100644
--- a/c++/src/objtools/blast/gene_info_reader/demo/gene_info_reader_app.cpp
+++ b/c++/src/objtools/blast/gene_info_reader/demo/gene_info_reader_app.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gene_info_reader_app.cpp 140909 2008-09-22 18:25:56Z ucko $
+/*  $Id: gene_info_reader_app.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -254,6 +254,6 @@ void CReadFilesApp::Exit(void)
 int main(int argc, const char* argv[])
 {
     // Execute main application function
-    return CReadFilesApp().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CReadFilesApp().AppMain(argc, argv, 0, eDS_Default, "");
 }
 
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdb.cpp b/c++/src/objtools/blast/seqdb_reader/seqdb.cpp
index 3d32d46..e7a14ac 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdb.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdb.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdb.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdb.cpp 488259 2015-12-29 14:32:15Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
 /// Implementation for the CSeqDB class, the top level class for SeqDB.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdb.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: seqdb.cpp 488259 2015-12-29 14:32:15Z camacho $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -1344,7 +1344,7 @@ static void s_RemoveAliasComponents(CBlastDbFinder& finder)
         while (getline(in, line)) {
             if (NStr::StartsWith(line, "DBLIST")) {
                 vector<string> tokens;
-                NStr::Tokenize(line, " ", tokens, NStr::eMergeDelims);
+                NStr::Split(line, " ", tokens, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
                 for (size_t j = 1; j < tokens.size(); j++) {
                     dbs2remove.insert(tokens[j]);
                 }
@@ -1483,7 +1483,7 @@ set<string>
 CWgsDbTrimmer::x_ExtractOriginalWgsDbs()
 {
     vector<string> orig_wgs_dbs;
-    NStr::Tokenize(m_OrigWgsList, " ", orig_wgs_dbs);
+    NStr::Split(m_OrigWgsList, " ", orig_wgs_dbs, NStr::fSplit_NoMergeDelims);
     set<string> retval;
     copy(orig_wgs_dbs.begin(), orig_wgs_dbs.end(), inserter(retval,
                                                             retval.begin()));
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbalias.cpp b/c++/src/objtools/blast/seqdb_reader/seqdbalias.cpp
index 4228dea..175339b 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbalias.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbalias.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdbalias.cpp 364151 2012-05-23 12:54:23Z maning $
+/*  $Id: seqdbalias.cpp 500118 2016-05-02 16:12:05Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -43,7 +43,7 @@
 /// Implemented for: UNIX, MS-Windows
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdbalias.cpp 364151 2012-05-23 12:54:23Z maning $";
+static char const rcsid[] = "$Id: seqdbalias.cpp 500118 2016-05-02 16:12:05Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -371,17 +371,17 @@ void CSeqDBAliasNode::x_ResolveNames(char prot_nucl, CSeqDBLockHold & locked)
     }
     
     // Adjust back to whole path component.
-    while(common && (first[common] != CFile::GetPathSeparator())) {
+    while(common && (first[common-1] != CFile::GetPathSeparator())) {
         --common;
     }
     
-    if (common) {
+    if (common > 1) {
         // Factor out common path components.
         m_DBPath.Assign( CSeqDB_Substring(first.data(), first.data() + common) );
         
         for(i = 0; i < m_DBList.size(); i++) {
             CSeqDB_Substring sub(m_DBList[i].GetBasePathS());
-            sub.EraseFront((int) common + 1);
+            sub.EraseFront((int) common);
             
             m_DBList[i].Assign(sub);
         }
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbcommon.cpp b/c++/src/objtools/blast/seqdb_reader/seqdbcommon.cpp
index ffbddc3..ea382bd 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbcommon.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbcommon.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdbcommon.cpp 484800 2015-11-16 15:18:00Z ivanov $
+/*  $Id: seqdbcommon.cpp 484109 2015-11-06 16:30:06Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
 /// Definitions of various helper functions for SeqDB.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdbcommon.cpp 484800 2015-11-16 15:18:00Z ivanov $";
+static char const rcsid[] = "$Id: seqdbcommon.cpp 484109 2015-11-06 16:30:06Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -789,16 +789,16 @@ void SeqDB_ReadBinaryGiList(const string & fname, vector<TGi> & gis)
 {
     CMemoryFile mfile(SeqDB_MakeOSPath(fname));
 
-    Int4 * beginp = (Int4*) mfile.GetPtr();
-    Int4 * endp   = (Int4*) (((char*)mfile.GetPtr()) + mfile.GetSize());
+    Uint4 * beginp = (Uint4*) mfile.GetPtr();
+    Uint4 * endp   = (Uint4*) (((char*)mfile.GetPtr()) + mfile.GetSize());
 
-    Int4 num_gis = (int)(endp-beginp-2);
+    Int4 num_gis = (Int4) (endp - beginp) - 2;
 
     gis.clear();
 
-    if (((endp - beginp) < 2) ||
-        (beginp[0] != -1) ||
-        (SeqDB_GetStdOrd(beginp + 1) != num_gis)) {
+    if (((endp - beginp) < 2U)
+            ||  (beginp[0] != 0xFFFFFFFFU)
+            ||  (SeqDB_GetStdOrd(beginp + 1) != (Uint4) num_gis)) {
         NCBI_THROW(CSeqDBException,
                    eFileErr,
                    "Specified file is not a valid binary GI file.");
@@ -806,8 +806,8 @@ void SeqDB_ReadBinaryGiList(const string & fname, vector<TGi> & gis)
 
     gis.reserve(num_gis);
 
-    for(Int4 * elem = beginp + 2; elem < endp; elem ++) {
-        gis.push_back(GI_FROM(Int4, SeqDB_GetStdOrd(elem)));
+    for(Uint4 * elem = (beginp + 2); elem < endp; ++elem) {
+        gis.push_back(GI_FROM(Uint4, SeqDB_GetStdOrd(elem)));
     }
 }
 
@@ -866,16 +866,16 @@ void SeqDB_ReadMemoryGiList(const char * fbeginp,
 
     if (s_SeqDB_IsBinaryNumericList(fbeginp, fendp, long_ids)) {
         _ASSERT(long_ids == false);
-        Int4 * bbeginp = (Int4*) fbeginp;
-        Int4 * bendp = (Int4*) fendp;
+        Uint4* bbeginp = (Uint4*) fbeginp;
+        Uint4* bendp = (Uint4*) fendp;
 
-        Int4 num_gis = (int)(bendp-bbeginp-2);
+        Int4 num_gis = (Int4) (bendp - bbeginp) - 2;
 
         gis.clear();
 
-        if (((bendp - bbeginp) < 2) ||
-            (bbeginp[0] != -1) ||
-            (SeqDB_GetStdOrd(bbeginp + 1) != num_gis)) {
+        if (((bendp - bbeginp) < 2U)
+                ||  (bbeginp[0] != 0xFFFFFFFFU)
+                ||  (SeqDB_GetStdOrd(bbeginp + 1) != (Uint4) num_gis)) {
             NCBI_THROW(CSeqDBException,
                        eFileErr,
                        "Specified file is not a valid binary GI file.");
@@ -887,9 +887,9 @@ void SeqDB_ReadMemoryGiList(const char * fbeginp,
             TGi prev_gi = ZERO_GI;
             bool in_gi_order = true;
 
-            Int4 * elem = bbeginp + 2;
+            Uint4* elem = bbeginp + 2;
             while(elem < bendp) {
-                TGi this_gi = GI_FROM(Int4, SeqDB_GetStdOrd(elem));
+                TGi this_gi = GI_FROM(Uint4, SeqDB_GetStdOrd(elem));
                 gis.push_back(this_gi);
 
                 if (prev_gi > this_gi) {
@@ -897,17 +897,17 @@ void SeqDB_ReadMemoryGiList(const char * fbeginp,
                     break;
                 }
                 prev_gi = this_gi;
-                elem ++;
+                elem++;
             }
 
             while(elem < bendp) {
-                gis.push_back(GI_FROM(Int4, SeqDB_GetStdOrd(elem++)));
+                gis.push_back(GI_FROM(Uint4, SeqDB_GetStdOrd(elem++)));
             }
 
             *in_order = in_gi_order;
         } else {
-            for(Int4 * elem = bbeginp + 2; elem < bendp; elem ++) {
-                gis.push_back(GI_FROM(Int4, SeqDB_GetStdOrd(elem)));
+            for(Uint4 * elem = (bbeginp + 2); elem < bendp; ++elem) {
+                gis.push_back(GI_FROM(Uint4, SeqDB_GetStdOrd(elem)));
             }
         }
     } else {
@@ -917,7 +917,7 @@ void SeqDB_ReadMemoryGiList(const char * fbeginp,
         // allocated, but this is preferable to letting the vector
         // double itself (which it still will do if needed).
 
-        gis.reserve(int(file_size / 7));
+        gis.reserve((int) (file_size / 7));
 
         Uint4 elem(0);
 
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbexpert.cpp b/c++/src/objtools/blast/seqdb_reader/seqdbexpert.cpp
index 11bc02c..c588c22 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbexpert.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbexpert.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdbexpert.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbexpert.cpp 481389 2015-10-09 14:40:20Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
 /// Implementation for the CSeqDBExpert class.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdbexpert.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: seqdbexpert.cpp 481389 2015-10-09 14:40:20Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbgilistset.cpp b/c++/src/objtools/blast/seqdb_reader/seqdbgilistset.cpp
index eb857a9..8579ab1 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbgilistset.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbgilistset.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdbgilistset.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbgilistset.cpp 484410 2015-11-10 19:12:26Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 /// interface for all functionality of one database volume.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdbgilistset.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: seqdbgilistset.cpp 484410 2015-11-10 19:12:26Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -351,8 +351,8 @@ void CSeqDBGiListSet::x_TranslateTisFromUserList(CSeqDBGiList & gilist)
     int target_index = 0;
 
     while(source_index < source_num && target_index < target_num) {
-        Int8 source_ti = source.GetTiOid(source_index).ti;
-        Int8 target_ti = target.GetTiOid(target_index).ti;
+        TTi source_ti = source.GetTiOid(source_index).ti;
+        TTi target_ti = target.GetTiOid(target_index).ti;
 
         // Match; translate if needed
 
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbgimask.cpp b/c++/src/objtools/blast/seqdb_reader/seqdbgimask.cpp
index e4cc75a..688ac2d 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbgimask.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbgimask.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdbgimask.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbgimask.cpp 481389 2015-10-09 14:40:20Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 /// which support read operations on Gi based BlastDB masks.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdbgimask.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: seqdbgimask.cpp 481389 2015-10-09 14:40:20Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbgimask.hpp b/c++/src/objtools/blast/seqdb_reader/seqdbgimask.hpp
index aa054ec..98f5eb6 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbgimask.hpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbgimask.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_READERS_SEQDB__SEQDBGIMASK_HPP
 #define OBJTOOLS_READERS_SEQDB__SEQDBGIMASK_HPP
 
-/*  $Id: seqdbgimask.hpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbgimask.hpp 481389 2015-10-09 14:40:20Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbimpl.cpp b/c++/src/objtools/blast/seqdb_reader/seqdbimpl.cpp
index 9f7a80c..0e49871 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbimpl.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbimpl.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdbimpl.cpp 484800 2015-11-16 15:18:00Z ivanov $
+/*  $Id: seqdbimpl.cpp 483686 2015-11-03 16:05:45Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 /// layer for SeqDB.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdbimpl.cpp 484800 2015-11-16 15:18:00Z ivanov $";
+static char const rcsid[] = "$Id: seqdbimpl.cpp 483686 2015-11-03 16:05:45Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbimpl.hpp b/c++/src/objtools/blast/seqdb_reader/seqdbimpl.hpp
index 3c9dc77..c316ebb 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbimpl.hpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbimpl.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_READERS_SEQDB__SEQDBIMPL_HPP
 #define OBJTOOLS_READERS_SEQDB__SEQDBIMPL_HPP
 
-/*  $Id: seqdbimpl.hpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbimpl.hpp 481389 2015-10-09 14:40:20Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbisam.cpp b/c++/src/objtools/blast/seqdb_reader/seqdbisam.cpp
index 1c1fc69..b9c6898 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbisam.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbisam.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdbisam.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbisam.cpp 484099 2015-11-06 15:23:03Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 /// index of some particular kind of identifiers.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdbisam.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: seqdbisam.cpp 484099 2015-11-06 15:23:03Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -1373,7 +1373,7 @@ void CSeqDBIsam::IdsToOids(int              vol_start,
         break;
 
     case eTiId:
-        x_TranslateGiList<Int8>(vol_start, ids, locked);
+        x_TranslateGiList<TTi>(vol_start, ids, locked);
         break;
 
     case eStringId:
diff --git a/c++/src/objtools/blast/seqdb_reader/seqdbvol.cpp b/c++/src/objtools/blast/seqdb_reader/seqdbvol.cpp
index c21bff1..bedbe60 100644
--- a/c++/src/objtools/blast/seqdb_reader/seqdbvol.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/seqdbvol.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdbvol.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: seqdbvol.cpp 484414 2015-11-10 19:24:28Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 /// interface for all functionality of one database volume.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: seqdbvol.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: seqdbvol.cpp 484414 2015-11-10 19:24:28Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -1002,9 +1002,10 @@ CSeqDBVol::x_GetTaxDefline(int                    oid,
                            const CSeq_id        * preferred_seqid,
                            CSeqDBLockHold       & locked)
 {
-    typedef list< CRef<CBlast_def_line> > TBDLL;
-    typedef TBDLL::iterator               TBDLLIter;
-    typedef TBDLL::const_iterator         TBDLLConstIter;
+    // Commented out, not used at this time.
+//    typedef list< CRef<CBlast_def_line> > TBDLL;
+//    typedef TBDLL::iterator               TBDLLIter;
+//    typedef TBDLL::const_iterator         TBDLLConstIter;
 
     // 1. read a defline set w/ gethdr, filtering by membership bit.
 
@@ -1062,7 +1063,7 @@ CSeqDBVol::x_GetTaxonomy(int                    oid,
     }
 
     typedef list< CRef<CBlast_def_line> > TBDLL;
-    typedef TBDLL::iterator               TBDLLIter;
+//    typedef TBDLL::iterator               TBDLLIter;  // not used at this time
     typedef TBDLL::const_iterator         TBDLLConstIter;
 
     const TBDLL & dl = bdls->Get();
@@ -2675,10 +2676,11 @@ CSeqDBVol::GetRawSeqAndAmbig(int              oid,
     }
 }
 
+template<class T>
 static void
-s_SeqDBFitsInFour(Int8 id)
+s_SeqDBFitsInFour(T id)
 {
-    if (id > (Int8(1) << 31)) {
+    if (id >= (static_cast<T>(1) << 32)) {
         NCBI_THROW(CSeqDBException,
                    eArgErr,
                    "ID overflows range of specified type.");
diff --git a/c++/src/objtools/blast/seqdb_reader/test/seqdb_perf.cpp b/c++/src/objtools/blast/seqdb_reader/test/seqdb_perf.cpp
index 30faa7a..9b36492 100644
--- a/c++/src/objtools/blast/seqdb_reader/test/seqdb_perf.cpp
+++ b/c++/src/objtools/blast/seqdb_reader/test/seqdb_perf.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqdb_perf.cpp 463291 2015-03-26 14:57:38Z rackerst $
+/*  $Id: seqdb_perf.cpp 473030 2015-07-15 19:29:59Z camacho $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -33,7 +33,7 @@
 
 #ifndef SKIP_DOXYGEN_PROCESSING
 static char const rcsid[] =
-    "$Id: seqdb_perf.cpp 463291 2015-03-26 14:57:38Z rackerst $";
+    "$Id: seqdb_perf.cpp 473030 2015-07-15 19:29:59Z camacho $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -342,6 +342,6 @@ int CSeqDBPerfApp::Run(void)
 #ifndef SKIP_DOXYGEN_PROCESSING
 int main(int argc, const char* argv[] /*, const char* envp[]*/)
 {
-    return CSeqDBPerfApp().AppMain(argc, argv, 0, eDS_Default, 0);
+    return CSeqDBPerfApp().AppMain(argc, argv, 0, eDS_Default, "");
 }
 #endif /* SKIP_DOXYGEN_PROCESSING */
diff --git a/c++/src/objtools/blast/seqdb_writer/build-alias-index b/c++/src/objtools/blast/seqdb_writer/build-alias-index
index c02f683..72a3643 100755
--- a/c++/src/objtools/blast/seqdb_writer/build-alias-index
+++ b/c++/src/objtools/blast/seqdb_writer/build-alias-index
@@ -3,7 +3,7 @@
 # subdirectory
 # Author: Kevin Bealer
 # Original date: 10/21/2005
-# $URL: https://svn.ncbi.nlm.nih.gov/repos/toolkit/release/blast/2.3.0/c++/src/objtools/blast/seqdb_writer/build-alias-index $
+# $URL: https://svn.ncbi.nlm.nih.gov/repos/toolkit/release/blast/2.4.0/c++/src/objtools/blast/seqdb_writer/build-alias-index $
 
 INDEX_NAME=index.alx
 OUTNAME=index.alx.new
diff --git a/c++/src/objtools/blast/seqdb_writer/build_db.cpp b/c++/src/objtools/blast/seqdb_writer/build_db.cpp
index 66a4b75..99ef4a3 100644
--- a/c++/src/objtools/blast/seqdb_writer/build_db.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/build_db.cpp
@@ -1,4 +1,4 @@
-/*  $Id: build_db.cpp 483266 2015-10-29 15:45:01Z ivanov $
+/*  $Id: build_db.cpp 485504 2015-11-23 14:41:02Z rackerst $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
   Code to build a database given various sources of sequence data.
 */
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: build_db.cpp 483266 2015-10-29 15:45:01Z ivanov $";
+static char const rcsid[] = "$Id: build_db.cpp 485504 2015-11-23 14:41:02Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -1011,6 +1011,7 @@ CBuildDatabase::CBuildDatabase(const string         & dbname,
     : m_IsProtein    (is_protein),
       m_KeepLinks    (false),
       m_KeepMbits    (false),
+      m_KeepLeafs    (false),
       m_Taxids       (new CTaxIdSet()),
       m_LogFile      (*logfile),
       m_UseRemote    (true),
@@ -1059,6 +1060,7 @@ CBuildDatabase::CBuildDatabase(const string & dbname,
     : m_IsProtein    (is_protein),
       m_KeepLinks    (false),
       m_KeepMbits    (false),
+      m_KeepLeafs    (false),
       m_Taxids       (new CTaxIdSet()),
       m_LogFile      (*logfile),
       m_UseRemote    (true),
@@ -1158,6 +1160,7 @@ void CBuildDatabase::SetSourceDb(const string & src_db_name)
     SetSourceDb(src_db);
 }
 
+// NCBI_DEPRECATED
 void CBuildDatabase::SetLinkouts(const TLinkoutMap & linkouts,
                                  bool                keep_links)
 {
@@ -1174,6 +1177,16 @@ void CBuildDatabase::SetMembBits(const TLinkoutMap & membbits,
     m_KeepMbits = keep_mbits;
 }
 
+void CBuildDatabase::SetLeafTaxIds(
+        const TIdToLeafs& taxids,
+        bool              keep_taxids
+)
+{
+    m_LogFile << "Keep Leaf Taxids: " << (keep_taxids ? "T" : "F") << endl;
+    m_Id2Leafs = taxids;
+    m_KeepLeafs = keep_taxids;
+}
+
 bool
 CBuildDatabase::Build(const vector<string> & ids,
                       CNcbiIstream         * fasta_file)
@@ -1298,7 +1311,7 @@ bool CBuildDatabase::AddFasta(CNcbiIstream & fasta_file)
             success = AddSequences(fbs);
 	    if (success == false)
             	NCBI_THROW(CWriteDBException, eFileErr, "No sequences added");
-		
+
         }
         catch (...) {
             EndBuild(true);
@@ -1370,6 +1383,43 @@ bool CBuildDatabase::x_EndBuild(bool erase, const CException * close_exception)
 
 
 static void
+s_SetDeflineLeafs(
+        objects::CBlast_def_line& defline,
+        TIdToLeafs&               leafs,
+        bool                      keep_old,
+        vector<string>&           keys
+)
+{
+    bool found = false;
+    CBlast_def_line::TTaxIds taxids;
+
+    ITERATE(vector<string>, key, keys) {
+        if (!key->empty()) {
+            TIdToLeafs::iterator item = leafs.find(*key);
+            if (item != leafs.end()) {
+                found = true;
+                taxids.insert(item->second.begin(), item->second.end());
+            }
+        }
+    }
+
+    CBlast_def_line::TTaxIds tv;
+    if (found) {
+        if (keep_old) {
+            const CBlast_def_line::TTaxIds& tx = defline.GetLeafTaxIds();
+            tv.insert(tx.begin(), tx.end());
+        }
+        tv.insert(taxids.begin(), taxids.end());
+        defline.SetLeafTaxIds(tv);
+    } else {
+        if (!keep_old) {
+            defline.SetLeafTaxIds(tv);
+        }
+    }
+}
+
+
+static void
 s_SetDeflineBits(objects::CBlast_def_line & defline,
                  TIdToBits       & bitmap,
                  bool              keep_old,
@@ -1425,8 +1475,10 @@ CBuildDatabase::x_SetLinkAndMbit(CRef<objects::CBlast_def_line_set> headers)
         CBlast_def_line & defline = **iter;
         GetDeflineKeys(defline, keys);
 
-        s_SetDeflineBits(defline, m_Id2Links, m_KeepLinks, false, keys);
+        // m_Id2Links is DEPRECATED
+//        s_SetDeflineBits(defline, m_Id2Links, m_KeepLinks, false, keys);
         s_SetDeflineBits(defline, m_Id2Mbits, m_KeepMbits, true, keys);
+        s_SetDeflineLeafs(defline, m_Id2Leafs, m_KeepLeafs, keys);
     }
 }
 
diff --git a/c++/src/objtools/blast/seqdb_writer/multisource_util.cpp b/c++/src/objtools/blast/seqdb_writer/multisource_util.cpp
index c5bf046..1ac2451 100644
--- a/c++/src/objtools/blast/seqdb_writer/multisource_util.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/multisource_util.cpp
@@ -1,4 +1,4 @@
-/*  $Id: multisource_util.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: multisource_util.cpp 495728 2016-03-21 14:25:14Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: multisource_util.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: multisource_util.cpp 495728 2016-03-21 14:25:14Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -95,8 +95,7 @@ string AccessionToKey(const string & acc)
     if (CheckAccession(acc, gi, seqid, specific)) {
         if (seqid.Empty()) {
             if (gi != ZERO_GI) {
-                str = "gi|";
-                str += NStr::IntToString(GI_TO(int, gi));
+                str = NStr::IntToString(GI_TO(int, gi));
             }
         } else {
             GetSeqIdKey(*seqid, str);
@@ -157,7 +156,7 @@ bool CheckAccession(const string  & acc,
 
 void GetSeqIdKey(const objects::CSeq_id & id, string & key)
 {
-    id.GetLabel(& key, CSeq_id::eBoth, CSeq_id::fLabel_GeneralDbIsContent);
+    id.GetLabel(& key, CSeq_id::eContent, CSeq_id::fLabel_GeneralDbIsContent);
 }
 
 void GetDeflineKeys(const objects::CBlast_def_line & defline,
diff --git a/c++/src/objtools/blast/seqdb_writer/taxid_set.cpp b/c++/src/objtools/blast/seqdb_writer/taxid_set.cpp
index 158c8cc..3bacb5d 100644
--- a/c++/src/objtools/blast/seqdb_writer/taxid_set.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/taxid_set.cpp
@@ -1,4 +1,4 @@
-/*  $Id: taxid_set.cpp 368296 2012-07-05 19:25:56Z camacho $
+/*  $Id: taxid_set.cpp 495728 2016-03-21 14:25:14Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 */
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: taxid_set.cpp 368296 2012-07-05 19:25:56Z camacho $";
+static char const rcsid[] = "$Id: taxid_set.cpp 495728 2016-03-21 14:25:14Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -58,7 +58,7 @@ void CTaxIdSet::SetMappingFromFile(CNcbiIstream & f)
         s = NStr::TruncateSpaces(s);
         
         vector<string> tokens;
-        NStr::Tokenize(s, " \t", tokens);
+        NStr::Split(s, " \t", tokens, NStr::fSplit_NoMergeDelims);
 
         string gi_str = tokens.front();
         string tx_str;
@@ -99,6 +99,21 @@ int CTaxIdSet::x_SelectBestTaxid(const objects::CBlast_def_line & defline)
                 m_Matched = true;
                 break;
             }
+	
+	    // try removing version to see if strings match.
+	    // this is most likely to help if the Query ID was parsed as local ID but is really accession.
+	    string keyNoVersion;
+	    string version;
+	    if (NStr::SplitInTwo(*key, ".", keyNoVersion, version) == true)
+	    {
+            	item = m_TaxIdMap.find(keyNoVersion);
+            
+            	if (item != m_TaxIdMap.end()) {
+               	 retval = item->second;
+               	 m_Matched = true;
+               	 break;
+		}
+            }
         }
     } else if (defline.IsSetTaxid()) {
         retval = defline.GetTaxid();
diff --git a/c++/src/objtools/blast/seqdb_writer/unit_test/criteria_unit_test.cpp b/c++/src/objtools/blast/seqdb_writer/unit_test/criteria_unit_test.cpp
index a651677..8742eab 100644
--- a/c++/src/objtools/blast/seqdb_writer/unit_test/criteria_unit_test.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/unit_test/criteria_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: criteria_unit_test.cpp 469956 2015-06-10 13:34:56Z ivanov $
+/*  $Id: criteria_unit_test.cpp 469487 2015-06-04 17:54:26Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/blast/seqdb_writer/unit_test/data/rabbit_mrna.fsa b/c++/src/objtools/blast/seqdb_writer/unit_test/data/rabbit_mrna.fsa
index 23156e0..6d99d1b 100644
--- a/c++/src/objtools/blast/seqdb_writer/unit_test/data/rabbit_mrna.fsa
+++ b/c++/src/objtools/blast/seqdb_writer/unit_test/data/rabbit_mrna.fsa
@@ -8,7 +8,7 @@ AAACGACTCGATTTACCAGAACATTTGAAACTCAAAGAAGATAATTTCTTCCAGGTTCCTAAAAACAAAA
 TAATGAATGGCCACTGATGAAAAAAAATTAACCTTATTTATTCATTCACTGTTTTCTAGCATTTCACTGT
 TCATAACTATGCAGTGTCATCTTGGTTAATTTTTCAGAAATCAAACATTTTCCTACAGCTGTGGATTAAA
 CAG
->gi|399120216|gb|JK749948.1| Cuplus_191 SSH libraries from oviduct at 62h post-mating of two lines of rabbits divergently selected for uterine capacity (H and L) Oryctolagus cuniculus cDNA, mRNA sequence
+>gi|399120216|gb|JK749948.1| Cuplus_191 SSH libraries from	oviduct at 62h post-mating of two lines of rabbits divergently selected for uterine capacity (H and L) Oryctolagus cuniculus cDNA, mRNA sequence
 ATTCACAGTGTCTGCCTACACGTCCCTCGTTGCACCTGCAAGCCCCACACTCAAACGTGCCATTCCCATC
 GTGGCACTGGGGACTTCTTGGGATGCCTGTGTCCTGGCACTCACACTTGCAGATGAACTCAAGGACCACC
 TCCACCTCCTCGGTGAAGCCCAGAGGCTTGATTTTAATGGTTTCAGAATGCTTAACTGGACACTGATTTG
@@ -23,3 +23,8 @@ CAAAACTTCATTTAAAAGGTTTTTCTACTGAATCCAGGGTATTCTGAAGATCGAAGCCTGTGTGTAAAAT
 GTTACCAAATGGCAAAAAGCAACAATAAACAGTTTGGTTTTTACTTTTCTTTCTAACATATCAATGCTTA
 GCAGAAAGTTCAGATTAAGTTGTCAGTAGTGAATTTAAAGACAAAAATGCCCGTTATTTCTCCAGTCCAT
 GAAACATACCATACTTATTATACCTGCAAGTAAGTGTTAAAAATTACGCTCTGTAACTCTG
+>JK749945.1
+CAAAACTTCATTTAAAAGGTTTTTCTACTGAATCCAGGGTATTCTGAAGATCGAAGCCTGTGTGTAAAAT
+GTTACCAAATGGCAAAAAGCAACAATAAACAGTTTGGTTTTTACTTTTCTTTCTAACATATCAATGCTTA
+GCAGAAAGTTCAGATTAAGTTGTCAGTAGTGAATTTAAAGACAAAAATGCCCGTTATTTCTCCAGTCCAT
+GAAACATACCATACTTATTATACCTGCAAGTAAGTGTTAAAAATTACGCTCTGTAACTCTG
diff --git a/c++/src/objtools/blast/seqdb_writer/unit_test/data/rabbit_taxidmap.txt b/c++/src/objtools/blast/seqdb_writer/unit_test/data/rabbit_taxidmap.txt
new file mode 100644
index 0000000..0a10600
--- /dev/null
+++ b/c++/src/objtools/blast/seqdb_writer/unit_test/data/rabbit_taxidmap.txt
@@ -0,0 +1,4 @@
+JK749946.1 9986
+JK749948 9986
+399120218 9986
+JK749945 9986
diff --git a/c++/src/objtools/blast/seqdb_writer/unit_test/writedb_unit_test.cpp b/c++/src/objtools/blast/seqdb_writer/unit_test/writedb_unit_test.cpp
index a5829f4..ab167a5 100644
--- a/c++/src/objtools/blast/seqdb_writer/unit_test/writedb_unit_test.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/unit_test/writedb_unit_test.cpp
@@ -1,4 +1,4 @@
-/*  $Id: writedb_unit_test.cpp 480969 2015-10-06 12:05:12Z ivanov $
+/*  $Id: writedb_unit_test.cpp 495728 2016-03-21 14:25:14Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -47,6 +47,7 @@
 #include <boost/current_function.hpp>
 #include <objtools/blast/seqdb_writer/build_db.hpp>
 #include <objtools/blast/seqdb_writer/writedb_isam.hpp>
+#include <objtools/blast/seqdb_reader/impl/seqdbisam.hpp>
 #include <objects/seqset/Seq_entry.hpp>
 
 #ifndef SKIP_DOXYGEN_PROCESSING
@@ -80,7 +81,7 @@ s_FetchRawData(CSeqDBExpert & seqdb,
 
 CRef<CSeq_id> s_GiToSeqId(TGi gi)
 {
-    CRef<CSeq_id> seqid(new CSeq_id(CSeq_id::e_Gi, gi));
+    CRef<CSeq_id> seqid(new CSeq_id(CSeq_id::e_Gi, GI_TO(TIntId, gi)));
 
     return seqid;
 }
@@ -2534,6 +2535,7 @@ BOOST_AUTO_TEST_CASE(CWriteDB_SetTaxonomy)
     CWriteDB blastdb(kDbName, CWriteDB::eNucleotide, kDbName);
     const CFastaReader::TFlags flags =
         CFastaReader::fAssumeNuc | CFastaReader::fAllSeqIds;
+    // This file contains TAB characters, which shouldn't create any warnings
     CFastaReader reader("data/rabbit_mrna.fsa", flags);
     set<TGi> gis;
     while (!reader.AtEOF()) {
@@ -2550,14 +2552,51 @@ BOOST_AUTO_TEST_CASE(CWriteDB_SetTaxonomy)
     blastdb.Close();
 
     CSeqDB db(kDbName, CSeqDB::eNucleotide);
-    ITERATE(set<TGi>, gi, gis) {
-        int oid = -1;
-        if (db.GiToOid(*gi, oid)) {
+    int total=db.GetNumSeqs();
+    for (int oid=0; oid<total; oid++)
+    {
             vector<int> taxids;
             db.GetTaxIDs(oid, taxids);
             BOOST_REQUIRE(taxids.size() == 1);
             BOOST_REQUIRE_EQUAL(kTaxId, taxids.front());
-        }
+    }
+    DeleteBlastDb(kDbName, CSeqDB::eNucleotide);
+}
+
+BOOST_AUTO_TEST_CASE(CWriteDB_SetTaxonomyFromMap)
+{
+    const int kTaxId(9986);
+    CRef<CTaxIdSet> tis(new CTaxIdSet());
+    const string kDbName("foo");
+    CWriteDB blastdb(kDbName, CWriteDB::eNucleotide, kDbName);
+    const CFastaReader::TFlags flags =
+        CFastaReader::fAssumeNuc | CFastaReader::fAllSeqIds;
+    // This file contains TAB characters, which shouldn't create any warnings
+    CFastaReader reader("data/rabbit_mrna.fsa", flags);
+    CNcbiIfstream taxidmap("data/rabbit_taxidmap.txt");
+    tis->SetMappingFromFile(taxidmap);
+    set<TGi> gis;
+    while (!reader.AtEOF()) {
+        CRef<CSeq_entry> se = reader.ReadOneSeq();
+        BOOST_REQUIRE(se.NotEmpty());
+        BOOST_REQUIRE(se->IsSeq());
+        CRef<CBioseq> bs(&se->SetSeq());
+        CRef<CBlast_def_line_set> bds(CWriteDB::ExtractBioseqDeflines(*bs));
+        tis->FixTaxId(bds);
+        blastdb.AddSequence(*bs);
+        blastdb.SetDeflines(*bds);
+        gis.insert(FindGi(bs->GetId()));
+    }
+    blastdb.Close();
+
+    CSeqDB db(kDbName, CSeqDB::eNucleotide);
+    int total=db.GetNumSeqs();
+    for (int oid=0; oid<total; oid++)
+    {
+          vector<int> taxids;
+          db.GetTaxIDs(oid, taxids);
+          BOOST_REQUIRE(taxids.size() == 1);
+          BOOST_REQUIRE_EQUAL(kTaxId, taxids.front());
     }
     DeleteBlastDb(kDbName, CSeqDB::eNucleotide);
 }
@@ -2661,29 +2700,123 @@ private:
 BOOST_AUTO_TEST_CASE(CBuildDatabase_WGS_gap)
 {
 
-	CTmpFile tmpfile;
-	CNcbiOstream& log = tmpfile.AsOutputFile(CTmpFile::eIfExists_Reset);
-	const string kOutput("x");
-	CFileDeleteAtExit::Add("x.nin");
-	CFileDeleteAtExit::Add("x.nhr");
-	CFileDeleteAtExit::Add("x.nsq");
-
-	CRef<CBuildDatabase> bd;
-	bd.Reset(new CBuildDatabase(kOutput, "foo", false,
-                            CWriteDB::eNoIndex, false, &log));
-	bd->StartBuild();
-
-    	auto_ptr<CObjectIStream> ois
-       	 (CObjectIStream::Open(eSerial_AsnText, "data/AXBT01000003.asn"));
-    	CRef<CSeq_entry> entry(new CSeq_entry);
-    	*ois >> *entry;
-	CSeqEntryGetSource seqentry_source(entry);
-
-	bool status = bd->AddSequences(seqentry_source);
-	BOOST_REQUIRE(status == true);
-	bd->EndBuild();
-    	CFile f1(kOutput + ".nin");
-    	BOOST_REQUIRE(f1.Exists() == true);
+    CTmpFile tmpfile;
+    CNcbiOstream& log = tmpfile.AsOutputFile(CTmpFile::eIfExists_Reset);
+    const string kOutput("x");
+    CFileDeleteAtExit::Add("x.nin");
+    CFileDeleteAtExit::Add("x.nhr");
+    CFileDeleteAtExit::Add("x.nsq");
+
+    CRef<CBuildDatabase> bd;
+    bd.Reset(new CBuildDatabase(kOutput, "foo", false,
+            CWriteDB::eNoIndex, false, &log));
+    bd->StartBuild();
+
+    auto_ptr<CObjectIStream> ois
+    (CObjectIStream::Open(eSerial_AsnText, "data/AXBT01000003.asn"));
+    CRef<CSeq_entry> entry(new CSeq_entry);
+    *ois >> *entry;
+    CSeqEntryGetSource seqentry_source(entry);
+
+    bool status = bd->AddSequences(seqentry_source);
+    BOOST_REQUIRE(status == true);
+    bd->EndBuild();
+    CFile f1(kOutput + ".nin");
+    BOOST_REQUIRE(f1.Exists() == true);
+}
+
+BOOST_AUTO_TEST_CASE(CSeqDBIsam_32bit_GI)
+{
+    // When process exits, clean up these files if they still exist.
+    CFileDeleteAtExit::Add("big_gi.00.pni");
+    CFileDeleteAtExit::Add("big_gi.00.pnd");
+
+    // Define a value that's too large to fit in a signed int without rollover.
+    const Uint4 big_gi = 3L * 1024L * 1024L * 1024L;    // 3 "billion"
+
+    // Write a numeric ISAM DB containing GI/OID records using GIs starting
+    // with big_gi above.
+
+    CWriteDB_Isam wdb(
+            eGi,
+            "big_gi",
+            true,       // is protein?
+            0,          // volume index
+            1024L,      // 1 kiB
+            false       // use sparse mode?
+    );
+
+    // Seed for random number generator (RNG).
+    const int seed = 1776;
+
+    // Set number of records to be written/read
+    const Uint4 nrecs = 10;
+
+    // Seed RNG.
+    srand(seed);
+
+    // Write some records, all with too-large-for-31-bits GIs.
+    // If NCBI_INT8_GI is NOT defined, this should throw immediately.
+    // Otherwise, this should succeed without exception.
+    for (Uint4 i = 0; i < nrecs; ++i) {
+        TGi gi = GI_FROM(Uint4, (big_gi + i));
+#ifndef NCBI_INT8_GI
+        BOOST_REQUIRE_THROW(
+                CSeq_id(CSeq_id::e_Gi, GI_TO(TIntId, gi)),
+                CException
+        );
+        return;
+#else
+        // (Try to) create seqid reference from GI.
+        // If we succeed, add seqid and random OID value to DB.
+        CWriteDB_Isam::TIdList tidlist;
+        try {
+            CRef<CSeq_id> seqid(
+                    new CSeq_id(CSeq_id::e_Gi, GI_TO(TIntId, gi))
+            );
+            tidlist.push_back(seqid);
+            wdb.AddIds(rand(), tidlist);
+        } catch (...) {
+            BOOST_FAIL("CSeq_id constructor threw exception");
+            return;
+        }
+#endif
+    }
+
+    // Close database.
+    wdb.Close();
+
+    // Reopen DB for reading.
+    CSeqDBAtlas atlas(true);
+    CSeqDBLockHold lock(atlas);
+    CRef<CSeqDBIsam> rdb(
+            new CSeqDBIsam(
+                    atlas,
+                    "big_gi.00",
+                    'p',
+                    'n',
+                    eGiId
+            )
+    );
+
+    // Reseed RNG to original seed.
+    srand(seed);
+
+    // Read back records and verify.
+    for (Uint4 i = 0; i < nrecs; ++i) {
+        TGi gi = GI_FROM(Uint4, (big_gi + i));
+        try {
+            CRef<CSeq_id> seqid(
+                    new CSeq_id(CSeq_id::e_Gi, GI_TO(TIntId, gi))
+            );
+            int oid;
+            rdb->IdToOid(GI_TO(long, seqid->GetGi()), oid, lock);
+            BOOST_REQUIRE(oid == rand());
+        } catch (...) {
+            BOOST_FAIL("CSeq_id constructor threw exception");
+            return;
+        }
+    }
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb.cpp b/c++/src/objtools/blast/seqdb_writer/writedb.cpp
index 6db3497..d60399f 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb.cpp
@@ -1,4 +1,4 @@
-/*  $Id: writedb.cpp 480972 2015-10-06 12:06:22Z ivanov $
+/*  $Id: writedb.cpp 480531 2015-10-01 15:03:55Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
 /// Implementation for the CWriteDB class, the top level class for WriteDB.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: writedb.cpp 480972 2015-10-06 12:06:22Z ivanov $";
+static char const rcsid[] = "$Id: writedb.cpp 480531 2015-10-01 15:03:55Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb_convert.cpp b/c++/src/objtools/blast/seqdb_writer/writedb_convert.cpp
index c7357cb..9d6b039 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb_convert.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb_convert.cpp
@@ -1,4 +1,4 @@
-/*  $Id: writedb_convert.cpp 386124 2013-01-16 14:19:52Z fongah2 $
+/*  $Id: writedb_convert.cpp 495293 2016-03-16 14:53:07Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 /// class for WriteDB.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: writedb_convert.cpp 386124 2013-01-16 14:19:52Z fongah2 $";
+static char const rcsid[] = "$Id: writedb_convert.cpp 495293 2016-03-16 14:53:07Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -161,7 +161,7 @@ public:
     /// Constructor.
     /// @param sz Size of the sequence in letters. [in]
     CAmbigDataBuilder(int sz)
-        : m_Size(sz)
+        : m_Size(sz), m_Random(sz)
     {
         for(int i = 0; i < 16; i++) {
             m_Log2[i] = -1;
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb_gimask.cpp b/c++/src/objtools/blast/seqdb_writer/writedb_gimask.cpp
index b265bcd..db0204d 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb_gimask.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb_gimask.cpp
@@ -1,4 +1,4 @@
-/*  $Id: writedb_gimask.cpp 480969 2015-10-06 12:05:12Z ivanov $
+/*  $Id: writedb_gimask.cpp 480398 2015-09-30 12:57:29Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
 /// Implementation for the CWriteDB_GiMask and related classes.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: writedb_gimask.cpp 480969 2015-10-06 12:05:12Z ivanov $";
+static char const rcsid[] = "$Id: writedb_gimask.cpp 480398 2015-09-30 12:57:29Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb_gimask.hpp b/c++/src/objtools/blast/seqdb_writer/writedb_gimask.hpp
index 3ae9d13..8a0bf01 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb_gimask.hpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb_gimask.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_WRITERS_WRITEDB__WRITEDB_GIMASK_HPP
 #define OBJTOOLS_WRITERS_WRITEDB__WRITEDB_GIMASK_HPP
 
-/*  $Id: writedb_gimask.hpp 480969 2015-10-06 12:05:12Z ivanov $
+/*  $Id: writedb_gimask.hpp 480398 2015-09-30 12:57:29Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb_impl.cpp b/c++/src/objtools/blast/seqdb_writer/writedb_impl.cpp
index 82d6750..9ddce4b 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb_impl.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb_impl.cpp
@@ -1,4 +1,4 @@
-/*  $Id: writedb_impl.cpp 480972 2015-10-06 12:06:22Z ivanov $
+/*  $Id: writedb_impl.cpp 495464 2016-03-17 16:30:45Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 /// class for WriteDB.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: writedb_impl.cpp 480972 2015-10-06 12:06:22Z ivanov $";
+static char const rcsid[] = "$Id: writedb_impl.cpp 495464 2016-03-17 16:30:45Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -774,9 +774,9 @@ CWriteDB_Impl::x_ExtractDeflines(CConstRef<CBioseq>             & bioseq,
     if (bin_hdr.empty() || OID>=0) {
         // Compress the deflines to binary.
 
-        ostringstream oss;
+        CNcbiOstrstream oss;
         oss << MSerial_AsnBinary << *deflines;
-        bin_hdr = oss.str();
+        bin_hdr = CNcbiOstrstreamToString(oss);
     }
 
     if (deflines.Empty() && (! bin_hdr.empty())) {
@@ -1547,6 +1547,8 @@ void CWriteDB_Impl::x_ComputeHash(const CBioseq & sequence)
     m_Hash = SeqDB_SequenceHash(sequence);
 }
 
+#define TAB_REPLACEMENT "   "
+
 void CWriteDB_Impl::
 x_GetFastaReaderDeflines(const CBioseq                  & bioseq,
                          CConstRef<CBlast_def_line_set> & deflines,
@@ -1583,8 +1585,8 @@ x_GetFastaReaderDeflines(const CBioseq                  & bioseq,
                     f.GetLabel().GetStr() == "DefLine" &&
                     f.CanGetData() &&
                     f.GetData().IsStr()) {
-
-                    fasta = NStr::ParseEscapes(f.GetData().GetStr());
+                    fasta = NStr::Replace(f.GetData().GetStr(), "\\t", TAB_REPLACEMENT);
+                    fasta = NStr::ParseEscapes(fasta);
                     break;
                 }
             }
@@ -1622,7 +1624,7 @@ x_GetFastaReaderDeflines(const CBioseq                  & bioseq,
         // Replace ^A with space
         NStr::ReplaceInPlace(title, "\001", " ");
         // Replace tabs with three spaces
-        NStr::ReplaceInPlace(title, "\t", "   ");
+        NStr::ReplaceInPlace(title, "\t", TAB_REPLACEMENT);
         defline->SetTitle(title);
 
         if (mship_i < membits.size()) {
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb_impl.hpp b/c++/src/objtools/blast/seqdb_writer/writedb_impl.hpp
index 10f3581..72743a7 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb_impl.hpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb_impl.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_WRITERS_WRITEDB__WRITEDB_IMPL_HPP
 #define OBJTOOLS_WRITERS_WRITEDB__WRITEDB_IMPL_HPP
 
-/*  $Id: writedb_impl.hpp 480972 2015-10-06 12:06:22Z ivanov $
+/*  $Id: writedb_impl.hpp 480531 2015-10-01 15:03:55Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb_isam.cpp b/c++/src/objtools/blast/seqdb_writer/writedb_isam.cpp
index 15933d3..f1c6f16 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb_isam.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb_isam.cpp
@@ -1,4 +1,4 @@
-/*  $Id: writedb_isam.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: writedb_isam.cpp 481389 2015-10-09 14:40:20Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -31,7 +31,7 @@
 /// Implementation for the CWriteDB_Isam and related classes.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: writedb_isam.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: writedb_isam.cpp 481389 2015-10-09 14:40:20Z rackerst $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb_volume.cpp b/c++/src/objtools/blast/seqdb_writer/writedb_volume.cpp
index 4b219a2..f11c538 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb_volume.cpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb_volume.cpp
@@ -1,4 +1,4 @@
-/*  $Id: writedb_volume.cpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: writedb_volume.cpp 500116 2016-05-02 16:11:10Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 /// class for WriteDB.
 
 #ifndef SKIP_DOXYGEN_PROCESSING
-static char const rcsid[] = "$Id: writedb_volume.cpp 481616 2015-10-14 14:41:28Z ivanov $";
+static char const rcsid[] = "$Id: writedb_volume.cpp 500116 2016-05-02 16:11:10Z ivanov $";
 #endif /* SKIP_DOXYGEN_PROCESSING */
 
 #include <ncbi_pch.hpp>
@@ -220,13 +220,16 @@ bool CWriteDB_Volume::WriteSequence(const string      & seq,
     if (m_Indices != CWriteDB::eNoIndex) {
     	set<string>::size_type orig_size = m_IdSet.size();
     	string id_u;
+    	pair<set<string>::iterator, bool > rv;
         ITERATE(TIdList, iter, idlist) {
-            string id = (*iter)->AsFastaString();
+            string id = (*iter)->GetSeqIdString(true);
             id_u = NStr::ToUpper(id);
-            if (m_IdSet.find(id_u) != m_IdSet.end() ) {
-            	continue;
+            rv = m_IdSet.insert(id_u);
+            if((rv.second == false) && (!(*iter)->IsLocal())) {
+            	CNcbiOstrstream msg;
+            	msg << "Error: Duplicate seq_ids are found: " << endl << id_u << endl;
+            	NCBI_THROW(CWriteDBException, eArgErr, CNcbiOstrstreamToString(msg));
             }
-            m_IdSet.insert(id_u);
         }
 
         if(m_IdSet.size() == orig_size) {
diff --git a/c++/src/objtools/blast/seqdb_writer/writedb_volume.hpp b/c++/src/objtools/blast/seqdb_writer/writedb_volume.hpp
index f6137ca..17e30db 100644
--- a/c++/src/objtools/blast/seqdb_writer/writedb_volume.hpp
+++ b/c++/src/objtools/blast/seqdb_writer/writedb_volume.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJTOOLS_WRITERS_WRITEDB__WRITEDB_VOLUME_HPP
 #define OBJTOOLS_WRITERS_WRITEDB__WRITEDB_VOLUME_HPP
 
-/*  $Id: writedb_volume.hpp 481616 2015-10-14 14:41:28Z ivanov $
+/*  $Id: writedb_volume.hpp 481389 2015-10-09 14:40:20Z rackerst $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/cleanup/Makefile.cleanup.lib b/c++/src/objtools/cleanup/Makefile.cleanup.lib
index 57a9555..bcb2975 100644
--- a/c++/src/objtools/cleanup/Makefile.cleanup.lib
+++ b/c++/src/objtools/cleanup/Makefile.cleanup.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.cleanup.lib 427429 2014-02-20 13:41:40Z gouriano $
+# $Id: Makefile.cleanup.lib 485437 2015-11-20 20:47:45Z bollin $
 
 # Build library "xcleanup"
 ###############################
diff --git a/c++/src/objtools/cleanup/autogenerated_cleanup.cpp b/c++/src/objtools/cleanup/autogenerated_cleanup.cpp
index 0bd65e6..7d6b030 100644
--- a/c++/src/objtools/cleanup/autogenerated_cleanup.cpp
+++ b/c++/src/objtools/cleanup/autogenerated_cleanup.cpp
@@ -1,4 +1,4 @@
-/* $Id: autogenerated_cleanup.cpp 477586 2015-08-31 17:42:50Z fukanchi $
+/* $Id: autogenerated_cleanup.cpp 499507 2016-04-26 17:32:39Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1452,7 +1452,6 @@ void CAutogeneratedCleanup::x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_v
 { // type Choice
   m_NewCleanup.SeqLocBC( arg0 );
   m_NewCleanup.x_BothStrandBC( arg0 );
-  m_NewCleanup.ConvertSeqLocWholeToInt( arg0 );
   switch( arg0.Which() ) {
   case CSeq_loc::e_Bond:
     x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_ext_locs_E_E_location_location_bond_ETC( arg0.SetBond() );
@@ -2550,51 +2549,6 @@ void CAutogeneratedCleanup::x_BasicCleanupSeqFeat_location_ETC( CSeq_loc & arg0
     x_BasicCleanupSeqFeat_location_location1767_ETC( arg0 );
 } // end of x_BasicCleanupSeqFeat_location_ETC
 
-void CAutogeneratedCleanup::x_BasicCleanupSeqFeat_product_product1765_ETC( CSeq_loc & arg0 )
-{ // type Choice
-  m_NewCleanup.SeqLocBC( arg0 );
-  m_NewCleanup.x_BothStrandBC( arg0 );
-  switch( arg0.Which() ) {
-  case CSeq_loc::e_Bond:
-    x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_ext_locs_E_E_location_location_bond_ETC( arg0.SetBond() );
-    break;
-  case CSeq_loc::e_Empty:
-    x_BasicCleanupSeqFeat_support_support_model_evidence_E_E_identification_ETC( arg0.SetEmpty() );
-    break;
-  case CSeq_loc::e_Equiv:
-    x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_location_location_equiv_ETC( arg0.SetEquiv() );
-    break;
-  case CSeq_loc::e_Feat:
-    x_BasicCleanupSeqFeat_ids_E_ETC( arg0.SetFeat() );
-    break;
-  case CSeq_loc::e_Int:
-    x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_ext_locs_E_E_location_location_packed_int_packed_int_E_ETC( arg0.SetInt() );
-    break;
-  case CSeq_loc::e_Mix:
-    x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_ext_locs_E_E_location_location_mix_ETC( arg0.SetMix() );
-    break;
-  case CSeq_loc::e_Packed_int:
-    x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_ext_locs_E_E_location_location_packed_int_ETC( arg0.SetPacked_int() );
-    break;
-  case CSeq_loc::e_Packed_pnt:
-    x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_ext_locs_E_E_location_location_packed_pnt_ETC( arg0.SetPacked_pnt() );
-    break;
-  case CSeq_loc::e_Pnt:
-    x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_ext_locs_E_E_location_location_bond_bond_b_ETC( arg0.SetPnt() );
-    break;
-  case CSeq_loc::e_Whole:
-    x_BasicCleanupSeqFeat_support_support_model_evidence_E_E_identification_ETC( arg0.SetWhole() );
-    break;
-  default:
-    break;
-  }
-} // end of x_BasicCleanupSeqFeat_product_product1765_ETC
-
-void CAutogeneratedCleanup::x_BasicCleanupSeqFeat_product_ETC( CSeq_loc & arg0 )
-{ // type Reference
-    x_BasicCleanupSeqFeat_product_product1765_ETC( arg0 );
-} // end of x_BasicCleanupSeqFeat_product_ETC
-
 template< typename Tcontainer_ncbi_cref_cgb_qual_ >
 void CAutogeneratedCleanup::x_BasicCleanupSeqFeat_qual_ETC( Tcontainer_ncbi_cref_cgb_qual_ & arg0 )
 { // type UniSequence
@@ -2961,7 +2915,7 @@ void CAutogeneratedCleanup::BasicCleanupSeqFeat( CSeq_feat & arg0_raw )
     x_BasicCleanupSeqFeat_location_ETC( arg0.SetLocation() );
   }
   if( arg0.IsSetProduct() ) {
-    x_BasicCleanupSeqFeat_product_ETC( arg0.SetProduct() );
+    x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_ext_locs_E_E_location_ETC( arg0.SetProduct() );
   }
   if( arg0.IsSetQual() ) {
     x_BasicCleanupSeqFeat_qual_ETC( arg0.SetQual() );
diff --git a/c++/src/objtools/cleanup/autogenerated_cleanup.hpp b/c++/src/objtools/cleanup/autogenerated_cleanup.hpp
index 49e17c1..7a8e7a9 100644
--- a/c++/src/objtools/cleanup/autogenerated_cleanup.hpp
+++ b/c++/src/objtools/cleanup/autogenerated_cleanup.hpp
@@ -1,7 +1,7 @@
 #ifndef AUTOGENERATEDCLEANUP__HPP
 #define AUTOGENERATEDCLEANUP__HPP
 
-/* $Id: autogenerated_cleanup.hpp 477586 2015-08-31 17:42:50Z fukanchi $
+/* $Id: autogenerated_cleanup.hpp 499507 2016-04-26 17:32:39Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -521,8 +521,6 @@ void x_BasicCleanupSeqFeat_ids_ETC( Tcontainer_ncbi_cref_cfeat_id_ & arg0 );
   void x_BasicCleanupSeqFeat_xref_E_E_data_data_variation_variation_location_location_equiv_ETC( CSeq_loc_equiv & arg0 );
   void x_BasicCleanupSeqFeat_location_location1767_ETC( CSeq_loc & arg0 );
   void x_BasicCleanupSeqFeat_location_ETC( CSeq_loc & arg0 );
-  void x_BasicCleanupSeqFeat_product_product1765_ETC( CSeq_loc & arg0 );
-  void x_BasicCleanupSeqFeat_product_ETC( CSeq_loc & arg0 );
   template< typename Tcontainer_ncbi_cref_cgb_qual_ >
 void x_BasicCleanupSeqFeat_qual_ETC( Tcontainer_ncbi_cref_cgb_qual_ & arg0 );
   void x_BasicCleanupSeqFeat_support_support_inference_E_E_basis_basis_ETC( CEvidenceBasis & arg0 );
diff --git a/c++/src/objtools/cleanup/autogenerated_cleanup.txt b/c++/src/objtools/cleanup/autogenerated_cleanup.txt
index 9941551..cd33d4e 100644
--- a/c++/src/objtools/cleanup/autogenerated_cleanup.txt
+++ b/c++/src/objtools/cleanup/autogenerated_cleanup.txt
@@ -215,11 +215,7 @@ use m_NewCleanup.x_BothStrandBC {
     }
 }
 use m_NewCleanup.ConvertSeqLocWholeToInt {
-    Seq-loc EXCEPT {
-        product ,
-        Seq-inst.ext.seg.E ,
-        Seq-loc.mix.E
-    }
+    Seq-feat.location 
 }
 use m_NewCleanup.SeqLocMixBC { Seq-loc.mix }
 
diff --git a/c++/src/objtools/cleanup/autogenerated_extended_cleanup.cpp b/c++/src/objtools/cleanup/autogenerated_extended_cleanup.cpp
index 5489bd1..2e378b9 100644
--- a/c++/src/objtools/cleanup/autogenerated_extended_cleanup.cpp
+++ b/c++/src/objtools/cleanup/autogenerated_extended_cleanup.cpp
@@ -1,4 +1,4 @@
-/* $Id: autogenerated_extended_cleanup.cpp 485531 2015-11-23 16:16:33Z ivanov $
+/* $Id: autogenerated_extended_cleanup.cpp 499601 2016-04-26 18:10:02Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -173,6 +173,18 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_xref_E_E_data_data_
     x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_protein_E_E_ETC( arg0 );
 } // end of x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_protein_E_ETC
 
+void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_pub_ETC( CPubdesc & arg0 )
+{ // type Sequence
+  if( arg0.IsSetComment() ) {
+    x_ExtendedCleanupSeqFeat_xref_E_E_data_data_biosrc_biosrc_org_org_orgname_orgname_lineage_ETC( arg0.SetComment() );
+  }
+} // end of x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_pub_ETC
+
+void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_ETC( CPubdesc & arg0 )
+{ // type Reference
+    x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_pub_ETC( arg0 );
+} // end of x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_ETC
+
 void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_gene_E_E_ETC( CGene_ref & arg0 )
 { // type Sequence
   if( arg0.IsSetLocus_tag() ) {
@@ -240,6 +252,9 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_data_data( CSeqFeat
   case CSeqFeatData::e_Prot:
     x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_protein_E_ETC( arg0.SetProt() );
     break;
+  case CSeqFeatData::e_Pub:
+    x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_ETC( arg0.SetPub() );
+    break;
   case CSeqFeatData::e_Txinit:
     x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_ETC( arg0.SetTxinit() );
     break;
@@ -253,6 +268,11 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_data( CSeqFeatData
     x_ExtendedCleanupSeqFeat_data_data( arg0 );
 } // end of x_ExtendedCleanupSeqFeat_data
 
+void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_except_text_ETC( std::string & arg0 )
+{ // type Primitive
+  m_NewCleanup.x_ExceptTextEC( arg0 );
+} // end of x_ExtendedCleanupSeqFeat_except_text_ETC
+
 void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_xref_E_E_data_data_ETC( CSeqFeatData & arg0 )
 { // type Choice
   switch( arg0.Which() ) {
@@ -271,6 +291,9 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqFeat_xref_E_E_data_data_
   case CSeqFeatData::e_Prot:
     x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_protein_E_ETC( arg0.SetProt() );
     break;
+  case CSeqFeatData::e_Pub:
+    x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_ETC( arg0.SetPub() );
+    break;
   case CSeqFeatData::e_Txinit:
     x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_ETC( arg0.SetTxinit() );
     break;
@@ -324,12 +347,21 @@ void CAutogeneratedExtendedCleanup::ExtendedCleanupSeqFeat( CSeq_feat & arg0_raw
 
   m_LastArg_ExtendedCleanupSeqFeat = &arg0;
 
+  m_NewCleanup.x_BondEC( arg0 );
+  m_NewCleanup.x_tRNAEC( arg0 );
   m_NewCleanup.CdRegionEC( arg0 );
+  m_NewCleanup.MoveDbxrefs( arg0 );
+  m_NewCleanup.MoveStandardName( arg0 );
+  m_NewCleanup.CreatePubFromFeat( arg0 );
   m_NewCleanup.ResynchProteinPartials( arg0 );
+  m_NewCleanup.x_RemoveUnnecessaryGeneXrefs( arg0 );
   m_NewCleanup.x_MoveSeqfeatOrgToSourceOrg( arg0 );
   if( arg0.IsSetData() ) {
     x_ExtendedCleanupSeqFeat_data( arg0.SetData() );
   }
+  if( arg0.IsSetExcept_text() ) {
+    x_ExtendedCleanupSeqFeat_except_text_ETC( arg0.SetExcept_text() );
+  }
   if( arg0.IsSetTitle() ) {
     x_ExtendedCleanupSeqFeat_xref_E_E_data_data_biosrc_biosrc_org_org_orgname_orgname_lineage_ETC( arg0.SetTitle() );
   }
@@ -370,12 +402,46 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqAnnot_data( CSeq_annot::
   }
 } // end of x_ExtendedCleanupSeqAnnot_data
 
+void CAutogeneratedExtendedCleanup::x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_E_E_ETC( CAnnotdesc & arg0 )
+{ // type Choice
+  switch( arg0.Which() ) {
+  case CAnnotdesc::e_Pub:
+    x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_ETC( arg0.SetPub() );
+    break;
+  default:
+    break;
+  }
+} // end of x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_E_E_ETC
+
+void CAutogeneratedExtendedCleanup::x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_E_ETC( CAnnotdesc & arg0 )
+{ // type Reference
+    x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_E_E_ETC( arg0 );
+} // end of x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_E_ETC
+
+template< typename Tcontainer_ncbi_cref_cannotdesc_ >
+void CAutogeneratedExtendedCleanup::x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_ETC( Tcontainer_ncbi_cref_cannotdesc_ & arg0 )
+{ // type UniSequence
+  NON_CONST_ITERATE( typename Tcontainer_ncbi_cref_cannotdesc_, iter, arg0 ) { 
+    x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_E_ETC( **iter );
+  }
+} // end of x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_ETC
+
+void CAutogeneratedExtendedCleanup::x_ExtendedCleanupBioseqSet_annot_E_E_desc_ETC( CAnnot_descr & arg0 )
+{ // type Reference
+  if( arg0.IsSet() ) {
+    x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_ETC( arg0.Set() );
+  }
+} // end of x_ExtendedCleanupBioseqSet_annot_E_E_desc_ETC
+
 void CAutogeneratedExtendedCleanup::ExtendedCleanupSeqAnnot( CSeq_annot & arg0 )
 { // type Sequence
   m_NewCleanup.x_RemoveEmptyFeatures( arg0 );
   if( arg0.IsSetData() ) {
     x_ExtendedCleanupSeqAnnot_data( arg0.SetData() );
   }
+  if( arg0.IsSetDesc() ) {
+    x_ExtendedCleanupBioseqSet_annot_E_E_desc_ETC( arg0.SetDesc() );
+  }
 } // end of ExtendedCleanupSeqAnnot
 
 void CAutogeneratedExtendedCleanup::x_ExtendedCleanupBioseq_annot_E( CSeq_annot & arg0 )
@@ -413,6 +479,9 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupBioseqSet_seq_set_E_E_seq_s
   case CSeqdesc::e_Org:
     x_ExtendedCleanupSeqFeat_xref_E_E_data_data_biosrc_biosrc_org_ETC( arg0.SetOrg() );
     break;
+  case CSeqdesc::e_Pub:
+    x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_ETC( arg0.SetPub() );
+    break;
   case CSeqdesc::e_Source:
     x_ExtendedCleanupSeqFeat_xref_E_E_data_data_biosrc_ETC( arg0.SetSource() );
     break;
@@ -436,9 +505,13 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupBioseqSet_seq_set_E_E_seq_s
 
 void CAutogeneratedExtendedCleanup::x_ExtendedCleanupBioseqSet_seq_set_E_E_seq_seq_descr_ETC( CSeq_descr & arg0 )
 { // type Reference
+  m_NewCleanup.x_MergeDupBioSources( arg0 );
   m_NewCleanup.x_RemoveEmptyUserObject( arg0 );
   m_NewCleanup.KeepLatestDateDesc( arg0 );
   m_NewCleanup.x_CleanupGenbankBlock( arg0 );
+  m_NewCleanup.x_RemoveOldDescriptors( arg0 );
+  m_NewCleanup.x_RemoveDupPubs( arg0 );
+  m_NewCleanup.x_RemoveEmptyDescriptors( arg0 );
   if( arg0.IsSet() ) {
     x_ExtendedCleanupBioseqSet_seq_set_E_E_seq_seq_descr_descr_ETC( arg0.Set() );
   }
@@ -496,9 +569,16 @@ void CAutogeneratedExtendedCleanup::ExtendedCleanupBioseq( CBioseq & arg0 )
 { // type Sequence
   m_NewCleanup.x_RemoveDupBioSource( arg0 );
   m_NewCleanup.x_FixStructuredCommentKeywords( arg0 );
+  m_NewCleanup.x_CleanupGenbankBlock( arg0 );
+  m_NewCleanup.x_ExtendProteinFeatureOnProteinSeq( arg0 );
+  m_NewCleanup.MoveCitationQuals( arg0 );
   m_NewCleanup.CreateMissingMolInfo( arg0 );
-  m_NewCleanup.AddProteinTitles( arg0 );
+  m_NewCleanup.x_ExtendSingleGeneOnMrna( arg0 );
+  m_NewCleanup.x_RemoveUnseenTitles( arg0 );
+  m_NewCleanup.x_RescueMolInfo( arg0 );
+  m_NewCleanup.x_RemoveOldFeatures( arg0 );
   m_NewCleanup.x_RemoveEmptyFeatureTables( arg0 );
+  m_NewCleanup.x_MergeAdjacentFeatureTables( arg0 );
   if( arg0.IsSetAnnot() ) {
     x_ExtendedCleanupBioseq_annot( arg0.SetAnnot() );
   }
@@ -509,6 +589,8 @@ void CAutogeneratedExtendedCleanup::ExtendedCleanupBioseq( CBioseq & arg0 )
     x_ExtendedCleanupBioseq_inst( arg0.SetInst() );
   }
   m_NewCleanup.ResynchPeptidePartials( arg0 );
+  m_NewCleanup.RemoveBadProteinTitle( arg0 );
+  m_NewCleanup.AddProteinTitles( arg0 );
   m_NewCleanup.x_ClearEmptyDescr( arg0 );
 } // end of ExtendedCleanupBioseq
 
@@ -547,8 +629,12 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqEntry_set_set_ETC( CBios
 { // type Sequence
   m_NewCleanup.x_BioseqSetEC( arg0 );
   m_NewCleanup.x_RemoveDupBioSource( arg0 );
+  m_NewCleanup.x_CleanupGenbankBlock( arg0 );
+  m_NewCleanup.x_RemoveUnseenTitles( arg0 );
   m_NewCleanup.x_MoveCDSFromNucAnnotToSetAnnot( arg0 );
   m_NewCleanup.x_RemoveEmptyFeatureTables( arg0 );
+  m_NewCleanup.x_MergeAdjacentFeatureTables( arg0 );
+  m_NewCleanup.x_MovePopPhyMutPub( arg0 );
   if( arg0.IsSetAnnot() ) {
     x_ExtendedCleanupSeqEntry_set_set_annot( arg0.SetAnnot() );
   }
@@ -559,6 +645,7 @@ void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqEntry_set_set_ETC( CBios
     x_ExtendedCleanupSeqEntry_set_set_seq_set( arg0.SetSeq_set() );
   }
   m_NewCleanup.x_ClearEmptyDescr( arg0 );
+  m_NewCleanup.x_SingleSeqSetToSeq( arg0 );
 } // end of x_ExtendedCleanupSeqEntry_set_set_ETC
 
 void CAutogeneratedExtendedCleanup::x_ExtendedCleanupSeqEntry_set( CBioseq_set & arg0 )
@@ -683,8 +770,12 @@ void CAutogeneratedExtendedCleanup::ExtendedCleanupBioseqSet( CBioseq_set & arg0
 { // type Sequence
   m_NewCleanup.x_BioseqSetEC( arg0 );
   m_NewCleanup.x_RemoveDupBioSource( arg0 );
+  m_NewCleanup.x_CleanupGenbankBlock( arg0 );
+  m_NewCleanup.x_RemoveUnseenTitles( arg0 );
   m_NewCleanup.x_MoveCDSFromNucAnnotToSetAnnot( arg0 );
   m_NewCleanup.x_RemoveEmptyFeatureTables( arg0 );
+  m_NewCleanup.x_MergeAdjacentFeatureTables( arg0 );
+  m_NewCleanup.x_MovePopPhyMutPub( arg0 );
   if( arg0.IsSetAnnot() ) {
     x_ExtendedCleanupBioseqSet_annot( arg0.SetAnnot() );
   }
@@ -695,6 +786,7 @@ void CAutogeneratedExtendedCleanup::ExtendedCleanupBioseqSet( CBioseq_set & arg0
     x_ExtendedCleanupBioseqSet_seq_set( arg0.SetSeq_set() );
   }
   m_NewCleanup.x_ClearEmptyDescr( arg0 );
+  m_NewCleanup.x_SingleSeqSetToSeq( arg0 );
 } // end of ExtendedCleanupBioseqSet
 
 
diff --git a/c++/src/objtools/cleanup/autogenerated_extended_cleanup.hpp b/c++/src/objtools/cleanup/autogenerated_extended_cleanup.hpp
index 715ffad..f1bb41c 100644
--- a/c++/src/objtools/cleanup/autogenerated_extended_cleanup.hpp
+++ b/c++/src/objtools/cleanup/autogenerated_extended_cleanup.hpp
@@ -1,7 +1,7 @@
 #ifndef AUTOGENERATEDEXTENDEDCLEANUP__HPP
 #define AUTOGENERATEDEXTENDEDCLEANUP__HPP
 
-/* $Id: autogenerated_extended_cleanup.hpp 468920 2015-05-29 14:02:03Z bollin $
+/* $Id: autogenerated_extended_cleanup.hpp 499555 2016-04-26 17:51:03Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -45,8 +45,11 @@
 #include <objects/seqfeat/Gene_ref.hpp>
 #include <objects/seqfeat/Imp_feat.hpp>
 #include <objects/seqfeat/Prot_ref.hpp>
+#include <objects/seq/Pubdesc.hpp>
 #include <objects/seqfeat/Txinit.hpp>
 #include <objects/seqfeat/SeqFeatXref.hpp>
+#include <objects/seq/Annot_descr.hpp>
+#include <objects/seq/Annotdesc.hpp>
 #include <objects/seq/Seq_descr.hpp>
 #include <objects/seq/Seqdesc.hpp>
 #include <objects/seqblock/GB_block.hpp>
@@ -100,6 +103,8 @@ void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_biosrc_biosrc_org_org_orgname_o
   void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_imp_ETC( CImp_feat & arg0 );
   void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_protein_E_E_ETC( CProt_ref & arg0 );
   void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_protein_E_ETC( CProt_ref & arg0 );
+  void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_pub_ETC( CPubdesc & arg0 );
+  void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_ETC( CPubdesc & arg0 );
   void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_gene_E_E_ETC( CGene_ref & arg0 );
   void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_gene_E_ETC( CGene_ref & arg0 );
   template< typename Tcontainer_ncbi_cref_cgene_ref_ >
@@ -110,6 +115,7 @@ void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_txinit_protein_ETC( Tcon
   void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_txinit_ETC( CTxinit & arg0 );
   void x_ExtendedCleanupSeqFeat_data_data( CSeqFeatData & arg0 );
   void x_ExtendedCleanupSeqFeat_data( CSeqFeatData & arg0 );
+  void x_ExtendedCleanupSeqFeat_except_text_ETC( std::string & arg0 );
   void x_ExtendedCleanupSeqFeat_xref_E_E_data_data_ETC( CSeqFeatData & arg0 );
   void x_ExtendedCleanupSeqFeat_xref_E_E_data_ETC( CSeqFeatData & arg0 );
   void x_ExtendedCleanupSeqFeat_xref_E_E_ETC( CSeqFeatXref & arg0 );
@@ -120,6 +126,11 @@ void x_ExtendedCleanupSeqFeat_xref_ETC( Tcontainer_ncbi_cref_cseqfeatxref_ & arg
   template< typename Tcontainer_ncbi_cref_cseq_feat_ >
 void x_ExtendedCleanupSeqAnnot_data_ftable( Tcontainer_ncbi_cref_cseq_feat_ & arg0 );
   void x_ExtendedCleanupSeqAnnot_data( CSeq_annot::C_Data & arg0 );
+  void x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_E_E_ETC( CAnnotdesc & arg0 );
+  void x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_E_ETC( CAnnotdesc & arg0 );
+  template< typename Tcontainer_ncbi_cref_cannotdesc_ >
+void x_ExtendedCleanupBioseqSet_annot_E_E_desc_desc_ETC( Tcontainer_ncbi_cref_cannotdesc_ & arg0 );
+  void x_ExtendedCleanupBioseqSet_annot_E_E_desc_ETC( CAnnot_descr & arg0 );
   void x_ExtendedCleanupBioseq_annot_E( CSeq_annot & arg0 );
   template< typename Tcontainer_ncbi_cref_cseq_annot_ >
 void x_ExtendedCleanupBioseq_annot( Tcontainer_ncbi_cref_cseq_annot_ & arg0 );
diff --git a/c++/src/objtools/cleanup/autogenerated_extended_cleanup.txt b/c++/src/objtools/cleanup/autogenerated_extended_cleanup.txt
index 61b7788..5fe11e1 100644
--- a/c++/src/objtools/cleanup/autogenerated_extended_cleanup.txt
+++ b/c++/src/objtools/cleanup/autogenerated_extended_cleanup.txt
@@ -59,6 +59,7 @@ use m_NewCleanup.x_TrimInternalSemicolonsMarkChanged {
     Seq-feat.title ,
     Imp-feat.key ,
     Imp-feat.loc ,
+    Pubdesc.comment ,
 }
 
 use m_NewCleanup.x_BioseqSetEC
@@ -70,10 +71,13 @@ use m_NewCleanup.x_SortSeqDescs {
     POST Seq-entry
 }
 
-use m_NewCleanup.x_RemoveDupBioSource {
-    Bioseq
+use m_NewCleanup.x_MergeDupBioSources {
+    Bioseq.descr ,
+    Bioseq-set.descr
 }
+
 use m_NewCleanup.x_RemoveDupBioSource {
+    Bioseq ,
     Bioseq-set
 }
 
@@ -91,11 +95,17 @@ use m_NewCleanup.ProtRefEC
     Prot-ref
 }
 
+use m_NewCleanup.x_BondEC { Seq-feat }
+ 
+use m_NewCleanup.x_tRNAEC { Seq-feat }
+
 use m_NewCleanup.x_RemoveRedundantComment
 {
     Seq-feat.data.gene AND Seq-feat
 }
 
+use m_NewCleanup.x_ExceptTextEC { Seq-feat.except-text }
+
 use m_NewCleanup.x_RemoveEmptyUserObject
 {
     Bioseq.descr,
@@ -108,20 +118,53 @@ use m_NewCleanup.KeepLatestDateDesc
     Bioseq-set.descr
 }
 
+use m_NewCleanup.x_CleanupGenbankBlock { Bioseq, Bioseq-set }
+
 use m_NewCleanup.x_CleanupGenbankBlock
 {
     Bioseq.descr,
     Bioseq-set.descr
 }
 
+use m_NewCleanup.x_RemoveOldDescriptors
+{
+    Bioseq.descr,
+    Bioseq-set.descr
+}
+
+use m_NewCleanup.x_RemoveDupPubs
+{
+    Bioseq.descr,
+    Bioseq-set.descr
+}
+
+use m_NewCleanup.x_RemoveEmptyDescriptors
+{
+    Bioseq.descr,
+    Bioseq-set.descr
+}
+
 use m_NewCleanup.CdRegionEC { Seq-feat }
+use m_NewCleanup.x_ExtendProteinFeatureOnProteinSeq { Bioseq }
+use m_NewCleanup.MoveDbxrefs { Seq-feat }
+use m_NewCleanup.MoveStandardName { Seq-feat }
 
+use m_NewCleanup.CreatePubFromFeat { Seq-feat }
+
+use m_NewCleanup.MoveCitationQuals { Bioseq }
 use m_NewCleanup.CreateMissingMolInfo { Bioseq }
 
+use m_NewCleanup.x_ExtendSingleGeneOnMrna { Bioseq }
+
 use m_NewCleanup.ResynchProteinPartials { Seq-feat }
 use m_NewCleanup.ResynchPeptidePartials { POST Bioseq }
+use m_NewCleanup.RemoveBadProteinTitle { POST Bioseq }
 
-use m_NewCleanup.AddProteinTitles { Bioseq }
+use m_NewCleanup.AddProteinTitles { POST Bioseq }
+
+use m_NewCleanup.x_RemoveUnseenTitles { Bioseq, Bioseq-set }
+
+use m_NewCleanup.x_RemoveUnnecessaryGeneXrefs { Seq-feat }
 
 use m_NewCleanup.x_MoveSeqdescOrgToSourceOrg { Seqdesc }
 use m_NewCleanup.x_MoveSeqfeatOrgToSourceOrg { Seq-feat }
@@ -135,15 +178,33 @@ use m_NewCleanup.x_RemoveEmptyFeatures
 
 use m_NewCleanup.x_MoveCDSFromNucAnnotToSetAnnot { Bioseq-set }
 
+use m_NewCleanup.x_RescueMolInfo { Bioseq }
+
+use m_NewCleanup.x_RemoveOldFeatures { Bioseq }
+
 use m_NewCleanup.x_RemoveEmptyFeatureTables
 {
     Bioseq,
     Bioseq-set
 }
 
+use m_NewCleanup.x_MergeAdjacentFeatureTables
+{
+    Bioseq,
+    Bioseq-set
+}
+
+use  m_NewCleanup.x_MovePopPhyMutPub
+{
+    Bioseq-set
+}
+
 #remove empty descr set after other cleaning steps are done
 use m_NewCleanup.x_ClearEmptyDescr {
     POST Bioseq-set,
     POST Bioseq
 }
 
+#convert seq-entry set that contains only one sequence to a sequence seq-entry
+use m_NewCleanup.x_SingleSeqSetToSeq { POST Bioseq-set }
+
diff --git a/c++/src/objtools/cleanup/cleanup.cpp b/c++/src/objtools/cleanup/cleanup.cpp
index e51ac9d..9f2be4c 100644
--- a/c++/src/objtools/cleanup/cleanup.cpp
+++ b/c++/src/objtools/cleanup/cleanup.cpp
@@ -1,4 +1,4 @@
-/* $Id: cleanup.cpp 480959 2015-10-06 12:01:57Z ivanov $
+/* $Id: cleanup.cpp 500231 2016-05-03 14:59:56Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -34,6 +34,16 @@
 #include <serial/serialbase.hpp>
 #include <objects/seq/Bioseq.hpp>
 #include <objects/seq/Seq_annot.hpp>
+// included for GetPubdescLabels and GetCitationList
+#include <objects/pub/Pub.hpp>
+#include <objects/pub/Pub_equiv.hpp>
+#include <objects/seq/Pubdesc.hpp>
+#include <objects/biblio/Author.hpp>
+#include <objects/biblio/Auth_list.hpp>
+#include <objects/general/Person_id.hpp>
+#include <objects/general/Name_std.hpp>
+#include <objects/misc/sequence_macros.hpp>
+
 #include <objects/seqset/Seq_entry.hpp>
 #include <objects/seqset/Bioseq_set.hpp>
 #include <objects/seqset/seqset_macros.hpp>
@@ -45,12 +55,15 @@
 #include <objects/submit/Seq_submit.hpp>
 #include <objects/taxon3/taxon3.hpp>
 
-
+#include <objmgr/object_manager.hpp>
 #include <objmgr/util/sequence.hpp>
 #include <objmgr/util/feature.hpp>
 #include <objmgr/seq_annot_ci.hpp>
 #include <objmgr/seqdesc_ci.hpp>
+#include <objmgr/seq_vector.hpp>
+#include <objmgr/seq_vector_ci.hpp>
 #include <objtools/cleanup/cleanup.hpp>
+#include "cleanup_utils.hpp"
 #include <objtools/edit/cds_fix.hpp>
 
 #include "newcleanupp.hpp"
@@ -65,8 +78,12 @@ enum EChangeType {
 // *********************** CCleanup implementation **********************
 
 
-CCleanup::CCleanup(CScope* scope) : m_Scope( scope )
+CCleanup::CCleanup(CScope* scope) 
 {
+    m_Scope = new CScope(*(CObjectManager::GetInstance()));
+    if (scope) {
+        m_Scope->AddScope(*scope);
+    }
 }
 
 
@@ -77,7 +94,10 @@ CCleanup::~CCleanup(void)
 
 void CCleanup::SetScope(CScope* scope)
 {
-    m_Scope = scope;
+    m_Scope.Reset(new CScope(*(CObjectManager::GetInstance())));
+    if (scope) {
+        m_Scope->AddScope(*scope);
+    }
 }
 
 
@@ -91,10 +111,14 @@ CRef<CCleanupChange> makeCleanupChange(Uint4 options)
     return changes;
 }
 
+#define CLEANUP_SETUP \
+    CRef<CCleanupChange> changes(makeCleanupChange(options)); \
+    CNewCleanup_imp clean_i(changes, options); \
+    clean_i.SetScope(*m_Scope);
+
 CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_entry& se, Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.BasicCleanupSeqEntry(se);
     return changes;
 }
@@ -102,8 +126,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_entry& se, Uint4 options)
 
 CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_submit& ss, Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.BasicCleanupSeqSubmit(ss);
     return changes;
 }
@@ -112,8 +135,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_submit& ss, Uint4 options)
 /// Cleanup a Bioseq. 
 CConstRef<CCleanupChange> CCleanup::BasicCleanup(CBioseq& bs, Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.BasicCleanupBioseq(bs);
     return changes;
 }
@@ -121,8 +143,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CBioseq& bs, Uint4 options)
 
 CConstRef<CCleanupChange> CCleanup::BasicCleanup(CBioseq_set& bss, Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.BasicCleanupBioseqSet(bss);
     return changes;
 }
@@ -130,8 +151,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CBioseq_set& bss, Uint4 options
 
 CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_annot& sa, Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.BasicCleanupSeqAnnot(sa);
     return changes;
 }
@@ -139,8 +159,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_annot& sa, Uint4 options)
 
 CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_feat& sf, Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.BasicCleanupSeqFeat(sf);
     return changes;
 }
@@ -148,8 +167,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_feat& sf, Uint4 options)
 
 CConstRef<CCleanupChange> CCleanup::BasicCleanup(CBioSource& src, Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.BasicCleanupBioSource(src);
     return changes;
 }
@@ -159,6 +177,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_entry_Handle& seh, Uint4 o
 {
     CRef<CCleanupChange> changes(makeCleanupChange(options));
     CNewCleanup_imp clean_i(changes, options);
+    clean_i.SetScope(seh.GetScope());
     clean_i.BasicCleanupSeqEntryHandle(seh);
     return changes;
 }
@@ -168,6 +187,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CBioseq_Handle& bsh,    Uint4 o
 {
     CRef<CCleanupChange> changes(makeCleanupChange(options));
     CNewCleanup_imp clean_i(changes, options);
+    clean_i.SetScope(bsh.GetScope());
     clean_i.BasicCleanupBioseqHandle(bsh);
     return changes;
 }
@@ -177,6 +197,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CBioseq_set_Handle& bssh, Uint4
 {
     CRef<CCleanupChange> changes(makeCleanupChange(options));
     CNewCleanup_imp clean_i(changes, options);
+    clean_i.SetScope(bssh.GetScope());
     clean_i.BasicCleanupBioseqSetHandle(bssh);
     return changes;
 }
@@ -186,6 +207,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_annot_Handle& sah, Uint4 o
 {
     CRef<CCleanupChange> changes(makeCleanupChange(options));
     CNewCleanup_imp clean_i(changes, options);
+    clean_i.SetScope(sah.GetScope());
     clean_i.BasicCleanupSeqAnnotHandle(sah);
     return changes;
 }
@@ -195,6 +217,7 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_feat_Handle& sfh,  Uint4 o
 {
     CRef<CCleanupChange> changes(makeCleanupChange(options));
     CNewCleanup_imp clean_i(changes, options);
+    clean_i.SetScope(sfh.GetScope());
     clean_i.BasicCleanupSeqFeatHandle(sfh);
     return changes;
 }
@@ -202,12 +225,10 @@ CConstRef<CCleanupChange> CCleanup::BasicCleanup(CSeq_feat_Handle& sfh,  Uint4 o
 
 
 
-
 // *********************** Extended Cleanup implementation ********************
 CConstRef<CCleanupChange> CCleanup::ExtendedCleanup(CSeq_entry& se,  Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.ExtendedCleanupSeqEntry(se);
     
     return changes;
@@ -216,8 +237,7 @@ CConstRef<CCleanupChange> CCleanup::ExtendedCleanup(CSeq_entry& se,  Uint4 optio
 
 CConstRef<CCleanupChange> CCleanup::ExtendedCleanup(CSeq_submit& ss,  Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.ExtendedCleanupSeqSubmit(ss);
     return changes;
 }
@@ -225,8 +245,7 @@ CConstRef<CCleanupChange> CCleanup::ExtendedCleanup(CSeq_submit& ss,  Uint4 opti
 
 CConstRef<CCleanupChange> CCleanup::ExtendedCleanup(CSeq_annot& sa,  Uint4 options)
 {
-    CRef<CCleanupChange> changes(makeCleanupChange(options));
-    CNewCleanup_imp clean_i(changes, options);
+    CLEANUP_SETUP
     clean_i.ExtendedCleanupSeqAnnot(sa); // (m_Scope->GetSeq_annotHandle(sa));
     return changes;
 }
@@ -235,6 +254,7 @@ CConstRef<CCleanupChange> CCleanup::ExtendedCleanup(CSeq_entry_Handle& seh,  Uin
 {
     CRef<CCleanupChange> changes(makeCleanupChange(options));
     CNewCleanup_imp clean_i(changes, options);
+    clean_i.SetScope(seh.GetScope());
     clean_i.ExtendedCleanupSeqEntryHandle(seh); // (m_Scope->GetSeq_annotHandle(sa));
     return changes;
 }
@@ -416,86 +436,221 @@ const char* const CCleanupChange::sm_ChangeDesc[eNumberofChangeTypes + 1] = {
 };
 
 
-bool CCleanup::MoveProteinSpecificFeats(CSeq_entry_Handle seh)
+CProt_ref::EProcessed s_ProcessedFromKey(const string& key)
 {
-    bool any_change = false;
-    SAnnotSelector sel(CSeqFeatData::e_Prot);
-    sel.IncludeFeatType(CSeqFeatData::e_Psec_str);
-    for (CFeat_CI prot_it(seh, sel); prot_it; ++prot_it) {
-        CBioseq_Handle parent_bsh = seh.GetScope().GetBioseqHandle(prot_it->GetLocation());
-
-        if (!parent_bsh) {
-            // protein feature is mispackaged
-            continue;
-        }
-        if (parent_bsh.IsAa()) {
-            // protein feature is already on protein sequence
-            continue;
-        }
-
-        CConstRef<CSeq_feat> cds = sequence::GetOverlappingCDS(prot_it->GetLocation(), seh.GetScope());
-        if (!cds || !cds->IsSetProduct()) {
-            // there is no overlapping coding region feature, so there is no appropriate
-            // protein sequence to move to
-            continue;
-        }
-
-        CSeq_feat_Handle cds_h = seh.GetScope().GetSeq_featHandle(*cds);
-        if (!cds_h) {
-            // can't get handle
-            continue;
-        }
-
-        if (feature::IsLocationInFrame(cds_h, prot_it->GetLocation()) != feature::eLocationInFrame_InFrame) {
-            // not in frame, can't convert
-            continue;
-        }
-
-        CConstRef<CSeq_feat> orig_feat = prot_it->GetSeq_feat();
-        CRef<CSeq_feat> new_feat(new CSeq_feat());
-        new_feat->Assign(*orig_feat);
-        CRef<CSeq_loc> new_loc;
-        CRef<CSeq_loc_Mapper> nuc2prot_mapper(
-            new CSeq_loc_Mapper(*cds, CSeq_loc_Mapper::eLocationToProduct, &seh.GetScope()) );
-        new_loc = nuc2prot_mapper->Map(orig_feat->GetLocation());
-        if (!new_loc || new_loc->GetId()->Equals(*(orig_feat->GetLocation().GetId()))) {
-            // unable to map to protein location
-            continue;
-        }
-        new_loc->GetStart(eExtreme_Biological);
-        new_loc->GetStop(eExtreme_Biological);
-
-        // change location to protein
-        new_feat->ResetLocation();
-        new_feat->SetLocation(*new_loc);
-
-        // remove the feature from the nuc bioseq
-        CSeq_feat_Handle fh = seh.GetScope().GetSeq_featHandle(*orig_feat);
-        CSeq_feat_EditHandle edh(fh);
-        edh.Remove();
-
-        CBioseq_Handle target_bsh = seh.GetScope().GetBioseqHandle(new_feat->GetLocation());
-        CBioseq_EditHandle eh = target_bsh.GetEditHandle();
-
-        // Find a feature table on the protein sequence to add the feature to.       
-        CSeq_annot_Handle ftable;
-        CSeq_annot_CI annot_ci(target_bsh);
-        for (; annot_ci; ++annot_ci) {
-            if ((*annot_ci).IsFtable()) {
-                ftable = *annot_ci;
-                break;
+    if (NStr::Equal(key, "sig_peptide")) {
+        return CProt_ref::eProcessed_signal_peptide;
+    } else if (NStr::Equal(key, "mat_peptide")) {
+        return CProt_ref::eProcessed_mature;
+    } else if (NStr::Equal(key, "transit_peptide")) {
+        return CProt_ref::eProcessed_transit_peptide;
+    } else if (NStr::Equal(key, "preprotein") || NStr::Equal(key, "proprotein")) {
+        return CProt_ref::eProcessed_preprotein;
+    } else {
+        return CProt_ref::eProcessed_not_set;
+    }
+}
+
+string s_KeyFromProcessed(CProt_ref::EProcessed processed)
+{
+    switch (processed) {
+    case CProt_ref::eProcessed_mature:
+        return "mat_peptide";
+        break;
+    case CProt_ref::eProcessed_preprotein:
+        return "preprotein";
+        break;
+    case CProt_ref::eProcessed_signal_peptide:
+        return "sig_peptide";
+        break;
+    case CProt_ref::eProcessed_transit_peptide:
+        return "transit_peptide";
+        break;
+    case CProt_ref::eProcessed_not_set:
+        return kEmptyStr;
+        break;
+    }
+    return kEmptyStr;
+}
+
+
+bool ConvertProteinToImp(CSeq_feat_Handle fh)
+{
+    if (fh.GetData().IsProt() && fh.GetData().GetProt().IsSetProcessed()) {
+        string key = s_KeyFromProcessed(fh.GetData().GetProt().GetProcessed());
+        if (!NStr::IsBlank(key)) {
+            CRef<CSeq_feat> new_feat(new CSeq_feat());
+            new_feat->Assign(*(fh.GetSeq_feat()));
+            if (fh.GetData().GetProt().IsSetName() && !fh.GetData().GetProt().GetName().empty()) {
+                CRef<CGb_qual> q(new CGb_qual());
+                q->SetQual("product");
+                q->SetVal(fh.GetData().GetProt().GetName().front());
+                new_feat->SetQual().push_back(q);
             }
+            new_feat->SetData().SetImp().SetKey(key);
+            CSeq_feat_EditHandle efh(fh);
+            efh.Replace(*new_feat);
+            return true;
+        }
+    }
+    return false;
+}
+
+
+bool s_IsPreprotein(CSeq_feat_Handle fh)
+{
+    if (!fh.IsSetData()) {
+        return false;
+    } else if (fh.GetData().IsProt() &&
+        fh.GetData().GetProt().IsSetProcessed() &&
+        fh.GetData().GetProt().GetProcessed() == CProt_ref::eProcessed_preprotein) {
+        return true;
+    } else if (fh.GetData().IsImp() &&
+        fh.GetData().GetImp().IsSetKey() &&
+        s_ProcessedFromKey(fh.GetData().GetImp().GetKey()) == CProt_ref::eProcessed_preprotein) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+bool CCleanup::MoveFeatToProtein(CSeq_feat_Handle fh)
+{
+    CProt_ref::EProcessed processed = CProt_ref::eProcessed_not_set;
+    if (fh.GetData().IsImp()) {
+        if (!fh.GetData().GetImp().IsSetKey()) {
+            return false;
         }
-        // If there is no feature table present, make one
-        if (!ftable) {
-            CRef<CSeq_annot> new_annot(new CSeq_annot());
-            ftable = eh.AttachAnnot(*new_annot);
+        processed = s_ProcessedFromKey(fh.GetData().GetImp().GetKey());
+        if (processed == CProt_ref::eProcessed_not_set || processed == CProt_ref::eProcessed_preprotein) {
+            return false;
         }
+    } else if (s_IsPreprotein(fh)) {
+        return ConvertProteinToImp(fh);
+    }
 
-        // add feature to the protein bioseq
-        CSeq_annot_EditHandle aeh(ftable);
-        aeh.AddFeat(*new_feat);
-        any_change = true;
+    CBioseq_Handle parent_bsh = fh.GetScope().GetBioseqHandle(fh.GetLocation());
+
+    if (!parent_bsh) {
+        // feature is mispackaged
+        return false;
+    }
+    if (parent_bsh.IsAa()) {
+        // feature is already on protein sequence
+        return false;
+    }
+
+    CConstRef<CSeq_feat> cds = sequence::GetOverlappingCDS(fh.GetLocation(), fh.GetScope());
+    if (!cds || !cds->IsSetProduct()) {
+        // there is no overlapping coding region feature, so there is no appropriate
+        // protein sequence to move to
+        return ConvertProteinToImp(fh);
+    }
+
+    CSeq_feat_Handle cds_h = fh.GetScope().GetSeq_featHandle(*cds);
+    if (!cds_h) {
+        // can't get handle
+        return false;
+    }
+
+    CConstRef<CSeq_feat> orig_feat = fh.GetSeq_feat();
+    CRef<CSeq_feat> new_feat(new CSeq_feat());
+    new_feat->Assign(*orig_feat);
+    if (new_feat->GetData().Which() == CSeqFeatData::e_Imp) {
+        new_feat->SetData().SetProt().SetProcessed(processed);
+        if (processed == CProt_ref::eProcessed_mature) {
+            new_feat->SetData().SetProt().SetName().push_back("unnamed");
+        }
+    }
+
+    CRef<CSeq_loc> new_loc;
+    CRef<CSeq_loc_Mapper> nuc2prot_mapper(
+        new CSeq_loc_Mapper(*cds, CSeq_loc_Mapper::eLocationToProduct, &fh.GetScope()));
+    new_loc = nuc2prot_mapper->Map(orig_feat->GetLocation());
+    if (!new_loc) {
+        return false;
+    }
+    const CSeq_id* sid = new_loc->GetId();
+    const CSeq_id* orig_id = orig_feat->GetLocation().GetId();
+    if (!sid || (orig_id && sid->Equals(*orig_id))) {
+        // unable to map to protein location
+        return false;
+    }
+    if (!cds_h.GetLocation().IsPartialStart(eExtreme_Biological)) {
+        if (new_loc->IsPartialStart(eExtreme_Biological)) {
+            new_loc->SetPartialStart(false, eExtreme_Biological);
+        }
+    }
+    if (!cds_h.GetLocation().IsPartialStop(eExtreme_Biological)) {
+        if (new_loc->IsPartialStop(eExtreme_Biological)) {
+            new_loc->SetPartialStop(false, eExtreme_Biological);
+        }
+    }
+
+    new_loc->ResetStrand();
+    // change location to protein
+    new_feat->ResetLocation();
+    new_feat->SetLocation(*new_loc);
+
+
+    CSeq_feat_EditHandle edh(fh);
+    edh.Replace(*new_feat);
+    CRef<CCleanupChange> changes(makeCleanupChange(0));
+    CNewCleanup_imp clean_i(changes, 0);
+    clean_i.SetScope(fh.GetScope());
+    clean_i.BasicCleanupSeqFeat(*new_feat);
+
+    CSeq_annot_Handle ah = fh.GetAnnot();
+
+    CBioseq_Handle target_bsh = fh.GetScope().GetBioseqHandle(new_feat->GetLocation());
+    CBioseq_EditHandle eh = target_bsh.GetEditHandle();
+
+    // Find a feature table on the protein sequence to add the feature to.    
+    CSeq_annot_Handle ftable;
+    if (target_bsh.GetCompleteBioseq()->IsSetAnnot()) {
+        ITERATE(CBioseq::TAnnot, annot_it, target_bsh.GetCompleteBioseq()->GetAnnot()) {
+            if ((*annot_it)->IsFtable()) {
+                ftable = fh.GetScope().GetSeq_annotHandle(**annot_it);
+            }
+        }
+    }
+    
+    // If there is no feature table present, make one
+    if (!ftable) {
+        CRef<CSeq_annot> new_annot(new CSeq_annot());
+        ftable = eh.AttachAnnot(*new_annot);
+    }
+
+    // add feature to the protein bioseq
+    CSeq_annot_EditHandle aeh(ftable);
+    aeh.TakeFeat(edh);
+
+    // remove old annot if now empty
+    if (CNewCleanup_imp::ShouldRemoveAnnot(*(ah.GetCompleteSeq_annot()))) {
+        CSeq_annot_EditHandle orig(ah);
+        orig.Remove();
+    }
+
+    return true;
+}
+
+
+bool CCleanup::MoveProteinSpecificFeats(CSeq_entry_Handle seh)
+{
+    bool any_change = false;
+    CBioseq_CI bi(seh, CSeq_inst::eMol_na);
+    while (bi) {
+        SAnnotSelector sel(CSeqFeatData::e_Prot);
+        sel.IncludeFeatType(CSeqFeatData::e_Psec_str);
+        sel.IncludeFeatType(CSeqFeatData::e_Bond);
+        for (CFeat_CI prot_it(*bi, sel); prot_it; ++prot_it) {
+            any_change |= MoveFeatToProtein(*prot_it);
+        }
+        for (CFeat_CI imp_it(*bi, CSeqFeatData::e_Imp); imp_it; ++imp_it) {
+            any_change |= MoveFeatToProtein(*imp_it);
+        }
+        ++bi;
     }
     return any_change;
 }
@@ -506,12 +661,33 @@ bool CCleanup::IsGeneXrefUnnecessary(const CSeq_feat& sf, CScope& scope, const C
     if (gene_xref.IsSuppressed()) {
         return false;
     }
-    CConstRef<CSeq_feat> gene = sequence::GetOverlappingGene(sf.GetLocation(), scope);
+
+    CConstRef<CSeq_feat> gene = sequence::GetOverlappingGene(sf.GetLocation(), scope);    
     if (!gene || !gene->IsSetData() || !gene->GetData().IsGene()) {
         return false;
     }
 
-    return gene->GetData().GetGene().RefersToSameGene(gene_xref);    
+    if (!gene->GetData().GetGene().RefersToSameGene(gene_xref)) {
+        return false;
+    }
+
+    // see if other gene might also match
+    sequence::TFeatScores scores;
+    sequence::GetOverlappingFeatures(sf.GetLocation(), CSeqFeatData::e_Gene, CSeqFeatData::eSubtype_gene,
+        sequence::eOverlap_Contained, scores, scope);
+    if (scores.size() == 1) {
+        return true;
+    } else if (scores.size() == 0) {
+        return false;
+    }
+
+    ITERATE(sequence::TFeatScores, g, scores) {
+        if (g->second.GetPointer() != gene.GetPointer() && 
+            sequence::Compare(g->second->GetLocation(), gene->GetLocation(), &scope) == sequence::eSame) {
+            return false;
+        }
+    }
+    return true;
 }
 
 
@@ -680,145 +856,672 @@ bool CCleanup::RemoveOrphanLocus_tagGeneXrefs(CSeq_feat& f, CBioseq_Handle bsh)
 }
 
 
-bool CCleanup::SetMolinfoTech(CBioseq_Handle bsh, CMolInfo::ETech tech)
+bool SeqLocExtend(CSeq_loc& loc, size_t pos, CScope& scope)
 {
-    CSeqdesc_CI di(bsh, CSeqdesc::e_Molinfo);
-    if (di) {
-        if (di->GetMolinfo().IsSetTech() && di->GetMolinfo().GetTech() == tech) {
-            // no change necessary
-            return false;
-        } else {
-            CSeqdesc* d = const_cast<CSeqdesc*>(&(*di));
-            d->SetMolinfo().SetTech(tech);
-            return true;
-        }
+    size_t loc_start = loc.GetStart(eExtreme_Positional);
+    size_t loc_stop = loc.GetStop(eExtreme_Positional);
+    bool partial_start = loc.IsPartialStart(eExtreme_Positional);
+    bool partial_stop = loc.IsPartialStop(eExtreme_Positional);
+    ENa_strand strand = loc.GetStrand();
+    CRef<CSeq_loc> new_loc(NULL);
+    bool changed = false;
+
+    if (pos < loc_start) {
+        CRef<CSeq_id> id(new CSeq_id());
+        id->Assign(*(loc.GetId()));
+        CRef<CSeq_loc> add(new CSeq_loc(*id, pos, loc_start - 1, strand));
+        add->SetPartialStart(partial_start, eExtreme_Positional);
+        new_loc = sequence::Seq_loc_Add(loc, *add, CSeq_loc::fSort | CSeq_loc::fMerge_AbuttingOnly, &scope);
+        changed = true;
+    } else if (pos > loc_stop) {
+        CRef<CSeq_id> id(new CSeq_id());
+        id->Assign(*(loc.GetId()));
+        CRef<CSeq_loc> add(new CSeq_loc(*id, loc_stop + 1, pos, strand));
+        add->SetPartialStop(partial_stop, eExtreme_Positional);
+        new_loc = sequence::Seq_loc_Add(loc, *add, CSeq_loc::fSort | CSeq_loc::fMerge_AbuttingOnly, &scope);
+        changed = true;
     }
-    CRef<CSeqdesc> m(new CSeqdesc());
-    m->SetMolinfo().SetTech(tech);
-    if (bsh.IsSetInst() && bsh.GetInst().IsSetMol() && bsh.IsAa()) {
-        m->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
+    if (changed) {
+        loc.Assign(*new_loc);
     }
-    CBioseq_EditHandle eh = bsh.GetEditHandle();
-    eh.AddSeqdesc(*m);
-    return true;
+    return changed;
 }
 
 
-bool CCleanup::SetMolinfoBiomol(CBioseq_Handle bsh, CMolInfo::EBiomol biomol)
+bool CCleanup::ExtendToStopCodon(CSeq_feat& f, CBioseq_Handle bsh, size_t limit, CCdregion::TFrame frame)
 {
-    CSeqdesc_CI di(bsh, CSeqdesc::e_Molinfo);
-    if (di) {
-        if (di->GetMolinfo().IsSetTech() && di->GetMolinfo().GetBiomol() == biomol) {
-            // no change necessary
-            return false;
-        } else {
-            CSeqdesc* d = const_cast<CSeqdesc*>(&(*di));
-            d->SetMolinfo().SetBiomol(biomol);
-            return true;
-        }
+    const CSeq_loc& loc = f.GetLocation();
+    CRef<CSeq_loc> new_loc;
+
+    const CGenetic_code* code = NULL;
+    if (f.IsSetData() && f.GetData().IsCdregion() && f.GetData().GetCdregion().IsSetCode()) {
+        code = &(f.GetData().GetCdregion().GetCode());
+    }
+
+    size_t stop = loc.GetStop(eExtreme_Biological);
+    // figure out if we have a partial codon at the end
+    size_t orig_len = sequence::GetLength(loc, &(bsh.GetScope()));
+    size_t len = orig_len;
+    if (frame == CCdregion::eFrame_not_set &&
+        f.IsSetData() && f.GetData().IsCdregion() &&
+        f.GetData().GetCdregion().IsSetFrame()) {
+        frame = f.GetData().GetCdregion().GetFrame();
+    }
+    if (frame == CCdregion::eFrame_two) {
+        len -= 1;
+    } else if (frame == CCdregion::eFrame_three) {
+        len -= 2;
+    }
+    
+    size_t mod = len % 3;
+    CRef<CSeq_loc> vector_loc(new CSeq_loc());
+    vector_loc->SetInt().SetId().Assign(*(loc.GetId()));
+
+    if (loc.IsSetStrand() && loc.GetStrand() == eNa_strand_minus) {
+        vector_loc->SetInt().SetFrom(0);
+        vector_loc->SetInt().SetTo(stop + mod - 1);
+        vector_loc->SetStrand(eNa_strand_minus);
+    } else {
+        vector_loc->SetInt().SetFrom(stop - mod + 1);
+        vector_loc->SetInt().SetTo(bsh.GetInst_Length() - 1);
     }
-    CRef<CSeqdesc> m(new CSeqdesc());
-    m->SetMolinfo().SetBiomol(biomol);
-    CBioseq_EditHandle eh = bsh.GetEditHandle();
-    eh.AddSeqdesc(*m);
-    return true;
-}
 
+    CSeqVector seq(*vector_loc, bsh.GetScope(), CBioseq_Handle::eCoding_Iupac);
+    // reserve our space
+    size_t usable_size = seq.size();
 
-bool CCleanup::AddMissingMolInfo(CBioseq& seq, bool is_product)
-{
-    if (!seq.IsSetInst() || !seq.GetInst().IsSetMol()) {
-        return false;
+    if (limit > 0 && usable_size > limit) {
+        usable_size = limit;
     }
-    bool needs_molinfo = true;
 
-    if (seq.IsSetDescr()) {
-        NON_CONST_ITERATE(CBioseq::TDescr::Tdata, it, seq.SetDescr().Set()) {
-            if ((*it)->IsMolinfo()) {
-                needs_molinfo = false;
-                if (seq.IsAa() && 
-                    (!(*it)->GetMolinfo().IsSetBiomol() || 
-                     (*it)->GetMolinfo().GetBiomol() == CMolInfo::eBiomol_unknown)) {
-                    (*it)->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
+    // get appropriate translation table
+    const CTrans_table & tbl =
+        (code ? CGen_code_table::GetTransTable(*code) :
+        CGen_code_table::GetTransTable(1));
+
+    // main loop through bases
+    CSeqVector::const_iterator start = seq.begin();
+
+    size_t i;
+    size_t k;
+    size_t state = 0;
+    size_t length = usable_size / 3;
+
+    for (i = 0; i < length; ++i) {
+        // loop through one codon at a time
+        for (k = 0; k < 3; ++k, ++start) {
+            state = tbl.NextCodonState(state, *start);
+        }
+
+        if (tbl.GetCodonResidue(state) == '*') {
+            CSeq_loc_CI it(loc);
+            CSeq_loc_CI it_next = it;
+            ++it_next;
+            while (it_next) {
+                CConstRef<CSeq_loc> this_loc = it.GetRangeAsSeq_loc();
+                if (new_loc) {
+                    new_loc->Add(*this_loc);
+                } else {
+                    new_loc.Reset(new CSeq_loc());
+                    new_loc->Assign(*this_loc);
                 }
+                it = it_next;
+                ++it_next;
+            }
+            CRef<CSeq_loc> last_interval(new CSeq_loc());
+            CConstRef<CSeq_loc> this_loc = it.GetRangeAsSeq_loc();
+            size_t this_start = this_loc->GetStart(eExtreme_Positional);
+            size_t this_stop = this_loc->GetStop(eExtreme_Positional);
+            size_t extension = ((i + 1) * 3) - mod;
+            last_interval->SetInt().SetId().Assign(*(this_loc->GetId()));
+            if (this_loc->IsSetStrand() && this_loc->GetStrand() == eNa_strand_minus) {
+                last_interval->SetStrand(eNa_strand_minus);
+                last_interval->SetInt().SetFrom(this_start - extension);
+                last_interval->SetInt().SetTo(this_stop);
+            } else {
+                last_interval->SetInt().SetFrom(this_start);
+                last_interval->SetInt().SetTo(this_stop + extension);
+            }
+
+            if (new_loc) {
+                new_loc->Add(*last_interval);
+            } else {
+                new_loc.Reset(new CSeq_loc());
+                new_loc->Assign(*last_interval);
             }
+            new_loc->SetPartialStart(loc.IsPartialStart(eExtreme_Biological), eExtreme_Biological);
+            new_loc->SetPartialStop(false, eExtreme_Biological);
+            f.SetLocation().Assign(*new_loc);
+            return true;
         }
     }
-    if (needs_molinfo) {
-        if (seq.IsAa()) {
-            CRef<CSeqdesc> m(new CSeqdesc());
-            m->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
-            if (is_product) {
-                m->SetMolinfo().SetTech(CMolInfo::eTech_concept_trans);
-            }
-            seq.SetDescr().Set().push_back(m);
-        } else if (seq.GetInst().GetMol() == CSeq_inst::eMol_rna && is_product) {
-            CRef<CSeqdesc> m(new CSeqdesc());
-            m->SetMolinfo().SetBiomol(CMolInfo::eBiomol_mRNA);
-            m->SetMolinfo().SetTech(CMolInfo::eTech_standard);
-            seq.SetDescr().Set().push_back(m);
+
+    bool rval = false;
+    if (usable_size < 3 && limit == 0) {
+        if (loc.GetStrand() == eNa_strand_minus) {
+            rval = SeqLocExtend(f.SetLocation(), 0, bsh.GetScope());
+        } else {
+            rval = SeqLocExtend(f.SetLocation(), bsh.GetInst_Length() - 1, bsh.GetScope());
         }
+        f.SetLocation().SetPartialStop(true, eExtreme_Biological);
     }
 
-    return needs_molinfo;
+    return rval;
 }
 
 
-bool CCleanup::AddProteinTitle(CBioseq_Handle bsh)
+bool CCleanup::SetBestFrame(CSeq_feat& cds, CScope& scope)
 {
-    if (!bsh.IsSetInst() || !bsh.GetInst().IsSetMol() || !bsh.IsAa()) {
-        return false;
+    bool changed = false;
+    CCdregion::TFrame frame = CCdregion::eFrame_not_set;
+    if (cds.GetData().GetCdregion().IsSetFrame()) {
+        frame = cds.GetData().GetCdregion().GetFrame();
     }
-    if (bsh.IsSetId()) {
-        ITERATE(CBioseq_Handle::TId, it, bsh.GetId()) {
-            // do not add titles for sequences with certain IDs
-            switch (it->Which()) {
-                case CSeq_id::e_Pir:
-                case CSeq_id::e_Swissprot:
-                case CSeq_id::e_Patent:
-                case CSeq_id::e_Prf:
-                case CSeq_id::e_Pdb:
-                    return false;
-                    break;
-                default:
-                    break;
-            }
-        }
+
+    CCdregion::TFrame new_frame = CSeqTranslator::FindBestFrame(cds, scope);
+    if (frame != new_frame) {
+        cds.SetData().SetCdregion().SetFrame(new_frame);
+        changed = true;
     }
+    return changed;
+}
 
-    string new_defline = sequence::CDeflineGenerator().GenerateDefline(bsh, sequence::CDeflineGenerator::fIgnoreExisting);
-    CSeqdesc_CI di(bsh, CSeqdesc::e_Title);
-    if (di) {
-        if (sequence::GetCDSForProduct(*(bsh.GetCompleteBioseq()), &(bsh.GetScope())) != NULL
-            && !NStr::Equal(di->GetTitle(), new_defline)) {
-            CSeqdesc* d = const_cast<CSeqdesc*>(&(*di));
-            d->SetTitle(new_defline);
+// like C's function GetFrameFromLoc, but better
+bool CCleanup::SetFrameFromLoc(CCdregion::EFrame &frame, const CSeq_loc& loc, CScope& scope)
+{
+    if (!loc.IsPartialStart(eExtreme_Biological)) {
+        if (frame != CCdregion::eFrame_one) {
+            frame = CCdregion::eFrame_one;
             return true;
-        } else {
-            return false;
         }
+        return false;
+    }
+    if (loc.IsPartialStop(eExtreme_Biological)) {
+        // cannot make a determination if both ends are partial
+        return false;
     }
 
-    CRef<CSeqdesc> t(new CSeqdesc());
-    t->SetTitle(sequence::CDeflineGenerator().GenerateDefline(bsh));
-    CBioseq_EditHandle eh = bsh.GetEditHandle();
-    eh.AddSeqdesc(*t);
-    return true;
+    const TSeqPos seq_len = sequence::GetLength(loc, &scope);
+
+    CCdregion::EFrame desired_frame = CCdregion::eFrame_not_set;
+
+    // have complete last codon, get frame from length
+    switch( (seq_len % 3) + 1 ) {
+        case 1:
+            desired_frame = CCdregion::eFrame_one;
+            break;
+        case 2:
+            desired_frame = CCdregion::eFrame_two;
+            break;
+        case 3:
+            desired_frame = CCdregion::eFrame_three;
+            break;
+        default:
+            // mathematically impossible
+            _ASSERT(false);
+            return false;
+    }
+    if (frame != desired_frame) {
+        frame = desired_frame;
+        return true;
+    }
+    return false;
 }
 
 
-bool CCleanup::RemoveNcbiCleanupObject(CSeq_entry &seq_entry)
+bool CCleanup::SetFrameFromLoc(CCdregion &cdregion, const CSeq_loc& loc, CScope& scope)
 {
-    bool rval = false;
-    if (seq_entry.IsSetDescr()) {
-        CBioseq::TDescr::Tdata::iterator it = seq_entry.SetDescr().Set().begin();
-        while (it != seq_entry.SetDescr().Set().end()) {
-            if ((*it)->IsUser() && (*it)->GetUser().GetObjectType() == CUser_object::eObjectType_Cleanup){
-                it = seq_entry.SetDescr().Set().erase(it);
-                rval = true;
+    CCdregion::EFrame frame = CCdregion::eFrame_not_set;
+    if (cdregion.IsSetFrame()) {
+        frame = cdregion.GetFrame();
+    }
+    if (SetFrameFromLoc(frame, loc, scope)) {
+        cdregion.SetFrame(frame);
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+CConstRef <CSeq_feat> CCleanup::GetGeneForFeature(const CSeq_feat& feat, CScope& scope)
+{
+    const CGene_ref* gene = feat.GetGeneXref();
+    if (gene && gene->IsSuppressed()) {
+        return (CConstRef <CSeq_feat>());
+    }
+
+    if (gene) {
+        CBioseq_Handle
+            bioseq_hl = sequence::GetBioseqFromSeqLoc(feat.GetLocation(), scope);
+        if (!bioseq_hl) {
+            return (CConstRef <CSeq_feat>());
+        }
+        CTSE_Handle tse_hl = bioseq_hl.GetTSE_Handle();
+        if (gene->CanGetLocus_tag() && !(gene->GetLocus_tag().empty())) {
+            CSeq_feat_Handle
+                seq_feat_hl = tse_hl.GetGeneWithLocus(gene->GetLocus_tag(), true);
+            if (seq_feat_hl) {
+                return (seq_feat_hl.GetOriginalSeq_feat());
             }
-            else {
-                ++it;
+        } else if (gene->CanGetLocus() && !(gene->GetLocus().empty())) {
+            CSeq_feat_Handle
+                seq_feat_hl = tse_hl.GetGeneWithLocus(gene->GetLocus(), false);
+            if (seq_feat_hl) {
+                return (seq_feat_hl.GetOriginalSeq_feat());
+            }
+        } else return (CConstRef <CSeq_feat>());
+    } else {
+        return(
+            CConstRef <CSeq_feat>(sequence::GetBestOverlappingFeat(feat.GetLocation(),
+            CSeqFeatData::e_Gene,
+            sequence::eOverlap_Contained,
+            scope)));
+    }
+
+    return (CConstRef <CSeq_feat>());
+};
+
+
+bool CCleanup::IsPseudo(const CSeq_feat& feat, CScope& scope)
+{
+    if (feat.IsSetPseudo() && feat.GetPseudo()) {
+        return true;
+    }
+    if (feat.IsSetQual()) {
+        ITERATE(CSeq_feat::TQual, it, feat.GetQual()) {
+            if ((*it)->IsSetQual() && NStr::EqualNocase((*it)->GetQual(), "pseudogene")) {
+                return true;
+            }
+        }
+    }
+    if (feat.GetData().IsGene()) {
+        if (feat.GetData().GetGene().IsSetPseudo() && feat.GetData().GetGene().GetPseudo()) {
+            return true;
+        }
+    } else {
+        if (feat.IsSetXref()) {
+            ITERATE(CSeq_feat::TXref, it, feat.GetXref()) {
+                if ((*it)->IsSetData() && (*it)->GetData().IsGene() &&
+                    (*it)->GetData().GetGene().IsSetPseudo() &&
+                    (*it)->GetData().GetGene().GetPseudo()) {
+                    return true;
+                }
+            }
+        }
+        CConstRef<CSeq_feat> gene = GetGeneForFeature(feat, scope);
+        if (gene && IsPseudo(*gene, scope)) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
+bool CCleanup::ExtendToStopIfShortAndNotPartial(CSeq_feat& f, CBioseq_Handle bsh, bool check_for_stop)
+{
+    if (!f.GetData().IsCdregion()) {
+        // not coding region
+        return false;
+    }
+    if (IsPseudo(f, bsh.GetScope())) {
+        return false;
+    }
+    if (f.GetLocation().IsPartialStop(eExtreme_Biological)) {
+        return false;
+    }
+
+    if (check_for_stop) {
+        string translation;
+        try {
+            CSeqTranslator::Translate(f, bsh.GetScope(), translation, true);
+        } catch (CSeqMapException& e) {
+            //unable to translate
+            return false;
+        } catch (CSeqVectorException& e) {
+            //unable to translate
+            return false;
+        }
+        if (NStr::EndsWith(translation, "*")) {
+            //already has stop codon
+            return false;
+        }
+    }
+
+    return ExtendToStopCodon(f, bsh, 3);
+}
+
+
+void CCleanup::SetProteinName(CProt_ref& prot_ref, const string& protein_name, bool append)
+{
+    if (append && prot_ref.IsSetName() &&
+        prot_ref.GetName().size() > 0 &&
+        !NStr::IsBlank(prot_ref.GetName().front())) {
+        prot_ref.SetName().front() += "; " + protein_name;
+    } else {
+        prot_ref.ResetName();
+        prot_ref.SetName().push_back(protein_name);
+    }
+
+}
+
+
+void CCleanup::SetProteinName(CSeq_feat& cds, const string& protein_name, bool append, CScope& scope)
+{
+    bool added = false;
+    if (cds.IsSetProduct()) {
+        CBioseq_Handle prot = scope.GetBioseqHandle(cds.GetProduct());
+        if (prot) {
+            // find main protein feature
+            CFeat_CI feat_ci(prot, CSeqFeatData::eSubtype_prot);
+            if (feat_ci) {
+                CRef<CSeq_feat> new_prot(new CSeq_feat());
+                new_prot->Assign(feat_ci->GetOriginalFeature());
+                SetProteinName(new_prot->SetData().SetProt(), protein_name, append);
+                CSeq_feat_EditHandle feh(feat_ci->GetSeq_feat_Handle());
+                feh.Replace(*new_prot);
+            } else {
+                // make new protein feature
+                feature::AddProteinFeature(*(prot.GetCompleteBioseq()), protein_name, cds, scope);
+            }
+            added = true;
+        }
+    }
+    if (!added) {
+        if (cds.IsSetXref()) {
+            // see if this seq-feat already has a prot xref
+            NON_CONST_ITERATE(CSeq_feat::TXref, it, cds.SetXref()) {
+                if ((*it)->IsSetData() && (*it)->GetData().IsProt()) {
+                    SetProteinName((*it)->SetData().SetProt(), protein_name, append);
+                    added = true;
+                    break;
+                }
+            }
+        }
+        if (!added) {
+            CRef<CSeqFeatXref> xref(new CSeqFeatXref());
+            xref->SetData().SetProt().SetName().push_back(protein_name);
+            cds.SetXref().push_back(xref);
+        }
+    }
+}
+
+
+const string& CCleanup::GetProteinName(const CProt_ref& prot)
+{
+    if (prot.IsSetName() && !prot.GetName().empty()) {
+        return prot.GetName().front();
+    } else {
+        return kEmptyStr;
+    }
+}
+
+
+const string& CCleanup::GetProteinName(const CSeq_feat& cds, CScope& scope)
+{
+    if (cds.IsSetProduct()) {
+        CBioseq_Handle prot = scope.GetBioseqHandle(cds.GetProduct());
+        if (prot) {
+            CFeat_CI f(prot, CSeqFeatData::eSubtype_prot);
+            if (f) {
+                return GetProteinName(f->GetData().GetProt());
+            }
+        }
+    }
+    if (cds.IsSetXref()) {
+        ITERATE(CSeq_feat::TXref, it, cds.GetXref()) {
+            if ((*it)->IsSetData() && (*it)->GetData().IsProt()) {
+                return GetProteinName((*it)->GetData().GetProt());
+            }
+        }
+    }
+    return kEmptyStr;
+}
+
+
+bool CCleanup::SetCDSPartialsByFrameAndTranslation(CSeq_feat& cds, CScope& scope)
+{
+    bool any_change = false;
+
+    if (!cds.GetLocation().IsPartialStart(eExtreme_Biological) &&
+        cds.GetData().GetCdregion().IsSetFrame() &&
+        cds.GetData().GetCdregion().GetFrame() != CCdregion::eFrame_not_set &&
+        cds.GetData().GetCdregion().GetFrame() != CCdregion::eFrame_one) {
+        cds.SetLocation().SetPartialStart(true, eExtreme_Biological);
+        any_change = true;
+    }
+
+    if (!cds.GetLocation().IsPartialStart(eExtreme_Biological) || !cds.GetLocation().IsPartialStop(eExtreme_Biological)) {
+        // look for start and stop codon
+        string transl_prot;
+        try {
+            CSeqTranslator::Translate(cds, scope, transl_prot,
+                true,   // include stop codons
+                false);  // do not remove trailing X/B/Z
+
+        } catch (const runtime_error&) {
+        }
+        if (!NStr::IsBlank(transl_prot)) {
+            if (!cds.GetLocation().IsPartialStart(eExtreme_Biological) && !NStr::StartsWith(transl_prot, "M")) {
+                cds.SetLocation().SetPartialStart(true, eExtreme_Biological);
+                any_change = true;
+            }
+            if (!cds.GetLocation().IsPartialStop(eExtreme_Biological) && !NStr::EndsWith(transl_prot, "*")) {
+                cds.SetLocation().SetPartialStop(true, eExtreme_Biological);
+                any_change = true;
+            }
+        }
+    }
+
+    any_change |= feature::AdjustFeaturePartialFlagForLocation(cds);
+
+    return any_change;
+}
+
+
+bool CCleanup::UpdateECNumbers(CProt_ref::TEc & ec_num_list)
+{
+    bool changed = false;
+    // CProt_ref::TEc is a list, so the iterator stays valid even if we 
+    // add new entries after the current one
+    NON_CONST_ITERATE(CProt_ref::TEc, ec_num_iter, ec_num_list) {
+        string & ec_num = *ec_num_iter;
+        size_t tlen = ec_num.length();
+        CleanVisStringJunk(ec_num);
+        if (tlen != ec_num.length()) {
+            changed = true;
+        }
+        if (CProt_ref::GetECNumberStatus(ec_num) == CProt_ref::eEC_replaced &&
+            !CProt_ref::IsECNumberSplit(ec_num)) {
+            string new_val = CProt_ref::GetECNumberReplacement(ec_num);
+            if (!NStr::IsBlank(new_val)) {
+                ec_num = new_val;
+                changed = true;
+            }
+        }
+
+    }
+    return changed;
+}
+
+bool CCleanup::SetGenePartialByLongestContainedFeature(CSeq_feat& gene, CScope& scope)
+{
+    CBioseq_Handle bh = scope.GetBioseqHandle(gene.GetLocation());
+    if (!bh) {
+        return false;
+    }
+    CFeat_CI under(scope, gene.GetLocation());
+    size_t longest = 0;
+    CConstRef<CSeq_feat> longest_feat(NULL);
+    
+    while (under) {
+        // ignore genes
+        if (under->GetData().IsGene()) {
+
+        } else {
+            // must be contained in gene location
+            sequence::ECompare loc_cmp = sequence::Compare(gene.GetLocation(), under->GetLocation(), &scope, sequence::fCompareOverlapping);
+            
+            if (loc_cmp == sequence::eSame || loc_cmp == sequence::eContains) {
+                size_t len = sequence::GetLength(under->GetLocation(), &scope);
+                // if longer than longest, record new length and feature
+                if (len > longest) {
+                    longest_feat.Reset(under->GetSeq_feat());
+                }
+            }
+        }
+
+        ++under;
+    }
+    bool changed = false;
+    if (longest_feat) {
+        changed = feature::CopyFeaturePartials(gene, *longest_feat);
+    }
+    return changed;
+}
+
+
+bool CCleanup::SetMolinfoTech(CBioseq_Handle bsh, CMolInfo::ETech tech)
+{
+    CSeqdesc_CI di(bsh, CSeqdesc::e_Molinfo);
+    if (di) {
+        if (di->GetMolinfo().IsSetTech() && di->GetMolinfo().GetTech() == tech) {
+            // no change necessary
+            return false;
+        } else {
+            CSeqdesc* d = const_cast<CSeqdesc*>(&(*di));
+            d->SetMolinfo().SetTech(tech);
+            return true;
+        }
+    }
+    CRef<CSeqdesc> m(new CSeqdesc());
+    m->SetMolinfo().SetTech(tech);
+    if (bsh.IsSetInst() && bsh.GetInst().IsSetMol() && bsh.IsAa()) {
+        m->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
+    }
+    CBioseq_EditHandle eh = bsh.GetEditHandle();
+    eh.AddSeqdesc(*m);
+    return true;
+}
+
+
+bool CCleanup::SetMolinfoBiomol(CBioseq_Handle bsh, CMolInfo::EBiomol biomol)
+{
+    CSeqdesc_CI di(bsh, CSeqdesc::e_Molinfo);
+    if (di) {
+        if (di->GetMolinfo().IsSetTech() && di->GetMolinfo().GetBiomol() == biomol) {
+            // no change necessary
+            return false;
+        } else {
+            CSeqdesc* d = const_cast<CSeqdesc*>(&(*di));
+            d->SetMolinfo().SetBiomol(biomol);
+            return true;
+        }
+    }
+    CRef<CSeqdesc> m(new CSeqdesc());
+    m->SetMolinfo().SetBiomol(biomol);
+    CBioseq_EditHandle eh = bsh.GetEditHandle();
+    eh.AddSeqdesc(*m);
+    return true;
+}
+
+
+bool CCleanup::AddMissingMolInfo(CBioseq& seq, bool is_product)
+{
+    if (!seq.IsSetInst() || !seq.GetInst().IsSetMol()) {
+        return false;
+    }
+    bool needs_molinfo = true;
+
+    if (seq.IsSetDescr()) {
+        NON_CONST_ITERATE(CBioseq::TDescr::Tdata, it, seq.SetDescr().Set()) {
+            if ((*it)->IsMolinfo()) {
+                needs_molinfo = false;
+                if (seq.IsAa() && 
+                    (!(*it)->GetMolinfo().IsSetBiomol() || 
+                     (*it)->GetMolinfo().GetBiomol() == CMolInfo::eBiomol_unknown)) {
+                    (*it)->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
+                }
+            }
+        }
+    }
+    if (needs_molinfo) {
+        if (seq.IsAa()) {
+            CRef<CSeqdesc> m(new CSeqdesc());
+            m->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
+            if (is_product) {
+                m->SetMolinfo().SetTech(CMolInfo::eTech_concept_trans);
+            }
+            seq.SetDescr().Set().push_back(m);
+        } else if (seq.GetInst().GetMol() == CSeq_inst::eMol_rna && is_product) {
+            CRef<CSeqdesc> m(new CSeqdesc());
+            m->SetMolinfo().SetBiomol(CMolInfo::eBiomol_mRNA);
+            m->SetMolinfo().SetTech(CMolInfo::eTech_standard);
+            seq.SetDescr().Set().push_back(m);
+        }
+    }
+
+    return needs_molinfo;
+}
+
+
+bool CCleanup::AddProteinTitle(CBioseq_Handle bsh)
+{
+    if (!bsh.IsSetInst() || !bsh.GetInst().IsSetMol() || !bsh.IsAa()) {
+        return false;
+    }
+    if (bsh.IsSetId()) {
+        ITERATE(CBioseq_Handle::TId, it, bsh.GetId()) {
+            // do not add titles for sequences with certain IDs
+            switch (it->Which()) {
+                case CSeq_id::e_Pir:
+                case CSeq_id::e_Swissprot:
+                case CSeq_id::e_Patent:
+                case CSeq_id::e_Prf:
+                case CSeq_id::e_Pdb:
+                    return false;
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+
+    string new_defline = sequence::CDeflineGenerator().GenerateDefline(bsh, sequence::CDeflineGenerator::fIgnoreExisting);
+    if (bsh.IsSetDescr()) {
+        ITERATE(CBioseq_set::TDescr::Tdata, title_d, bsh.GetDescr().Get()) {
+            if ((*title_d)->IsTitle()) {
+                if (!NStr::Equal((*title_d)->GetTitle(), new_defline)) {
+                    CSeqdesc* d = const_cast<CSeqdesc*>(title_d->GetPointer());
+                    d->SetTitle(new_defline);
+                    return true;
+                } else {
+                    return false;
+                }
+            }
+        }
+    }
+
+    CRef<CSeqdesc> t(new CSeqdesc());
+    t->SetTitle(new_defline);
+    CBioseq_EditHandle eh = bsh.GetEditHandle();
+    eh.AddSeqdesc(*t);
+    return true;
+}
+
+
+bool CCleanup::RemoveNcbiCleanupObject(CSeq_entry &seq_entry)
+{
+    bool rval = false;
+    if (seq_entry.IsSetDescr()) {
+        CBioseq::TDescr::Tdata::iterator it = seq_entry.SetDescr().Set().begin();
+        while (it != seq_entry.SetDescr().Set().end()) {
+            if ((*it)->IsUser() && (*it)->GetUser().GetObjectType() == CUser_object::eObjectType_Cleanup){
+                it = seq_entry.SetDescr().Set().erase(it);
+                rval = true;
+            }
+            else {
+                ++it;
             }
         }
         if (seq_entry.SetDescr().Set().empty()) {
@@ -906,6 +1609,7 @@ bool CCleanup::TaxonomyLookup(CSeq_entry_Handle seh)
                     any_changes = true;
                     CSeqdesc* desc = const_cast<CSeqdesc*>(*desc_it);
                     desc->SetSource().SetOrg().Assign((*reply_it)->GetData().GetOrg());
+                    desc->SetSource().SetOrg().ResetSyn();
                 }
                 ++reply_it;
                 ++desc_it;
@@ -946,6 +1650,11 @@ CRef<CSeq_entry> AddProtein(const CSeq_feat& cds, CScope& scope)
     }
 
     CRef<CBioseq> new_product = CSeqTranslator::TranslateToProtein(cds, scope);
+    CRef<CSeqdesc> molinfo(new CSeqdesc());
+    molinfo->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
+    molinfo->SetMolinfo().SetTech(CMolInfo::eTech_concept_trans_a);
+    new_product->SetDescr().Set().push_back(molinfo);
+
     if (cds.IsSetProduct()) {
         CRef<CSeq_id> prot_id(new CSeq_id());
         prot_id->Assign(*(cds.GetProduct().GetId()));
@@ -963,7 +1672,7 @@ CRef<CSeq_entry> AddProtein(const CSeq_feat& cds, CScope& scope)
     }
     if (!eh.IsSet()) {
         eh.ConvertSeqToSet();
-        // move all descriptors on nucleotide sequence except molinfo and title to set
+        // move all descriptors on nucleotide sequence except molinfo, title, and create-date to set
         eh.SetSet().SetClass(CBioseq_set::eClass_nuc_prot);
         CConstRef<CBioseq_set> set = eh.GetSet().GetCompleteBioseq_set();
         if (set && set->IsSetSeq_set()) {
@@ -971,7 +1680,7 @@ CRef<CSeq_entry> AddProtein(const CSeq_feat& cds, CScope& scope)
             CSeq_entry_EditHandle neh = eh.GetScope().GetSeq_entryEditHandle(*nuc);
             CBioseq_set::TDescr::Tdata::const_iterator it = nuc->GetDescr().Get().begin();
             while (it != nuc->GetDescr().Get().end()) {
-                if (!(*it)->IsMolinfo() && !(*it)->IsTitle()) {
+                if (!(*it)->IsMolinfo() && !(*it)->IsTitle() && !(*it)->IsCreate_date()) {
                     CRef<CSeqdesc> copy(new CSeqdesc());
                     copy->Assign(**it);
                     eh.AddSeqdesc(*copy);
@@ -1023,50 +1732,440 @@ CRef<objects::CSeq_id> GetNewProteinId(objects::CSeq_entry_Handle seh, objects::
 }
 
 
-bool CCleanup::WGSCleanup(CSeq_entry_Handle entry)
+bool CCleanup::SetGeneticCodes(CBioseq_Handle bsh)
 {
-    bool any_changes = false;
-
+    if (!bsh) {
+        return false;
+    }
+    if (!bsh.IsNa()) {
+        return false;
+    }
+
+    int bioseqGenCode = 0;
+    CSeqdesc_CI src(bsh, CSeqdesc::e_Source);
+    if (src) {
+        bioseqGenCode = src->GetSource().GetGenCode();
+    }    
+
+    bool any_changed = false;
+    // set Cdregion's gcode from BioSource (unless except-text)
     SAnnotSelector sel(CSeqFeatData::e_Cdregion);
-    for (CFeat_CI cds_it(entry, sel); cds_it; ++cds_it) {
-        bool change_this_cds;
-        CRef<CSeq_feat> new_cds(new CSeq_feat());
-        new_cds->Assign(*(cds_it->GetSeq_feat()));
+    CFeat_CI feat_ci(bsh, sel);
+    for (; feat_ci; ++feat_ci) {
+        const CSeq_feat& feat = feat_ci->GetOriginalFeature();
+        const CCdregion& cds = feat.GetData().GetCdregion();
+        int cdregionGenCode = (cds.IsSetCode() ?
+            cds.GetCode().GetId() :
+            0);
+        if (cdregionGenCode != bioseqGenCode)
+        {
+            // make cdregion's gencode match bioseq's gencode,
+            // if allowed
+            if (!feat.HasExceptionText("genetic code exception"))
+            {
+                CRef<CSeq_feat> new_feat(new CSeq_feat);
+                new_feat->Assign(feat);
+                CCdregion& new_cds = new_feat->SetData().SetCdregion();
+                new_cds.ResetCode();
+                new_cds.SetCode().SetId(bioseqGenCode);
+                CSeq_feat_EditHandle edit_handle(*feat_ci);
+                edit_handle.Replace(*new_feat);
+                any_changed = true;
+            }
+        }
+    }
+    return any_changed;
+}
+
+
+// return position of " [" + sOrganism + "]", but only if it's
+// at the end and there are characters before it.
+// Also, returns the position of the organelle prefix in the title.
+static SIZE_TYPE s_TitleEndsInOrganism(
+    const string & sTitle,
+    const string & sOrganism,
+    SIZE_TYPE * out_piOrganellePos)
+{
+    if (out_piOrganellePos) {
+        *out_piOrganellePos = NPOS;
+    }
+
+    SIZE_TYPE answer = NPOS;
+
+    const string sPattern = " [" + sOrganism + "]";
+    if (NStr::EndsWith(sTitle, sPattern, NStr::eNocase)) {
+        answer = sTitle.length() - sPattern.length();
+        if (answer < 1) {
+            // title must have something before the pattern
+            answer = NPOS;
+        }
+    } else {
+        answer = NStr::FindNoCase(sTitle, sPattern, 0, NPOS, NStr::eLast);
+        if (answer < 1 || answer == NPOS) {
+            // pattern not found
+            answer = NPOS;
+        }
+    }
+
+    // find organelle prefix
+    if (out_piOrganellePos) {
+        for (unsigned int genome = CBioSource::eGenome_chloroplast;
+            genome <= CBioSource::eGenome_chromatophore;
+            genome++) {
+            if (genome != CBioSource::eGenome_extrachrom &&
+                genome != CBioSource::eGenome_transposon &&
+                genome != CBioSource::eGenome_insertion_seq &&
+                genome != CBioSource::eGenome_proviral &&
+                genome != CBioSource::eGenome_virion &&
+                genome != CBioSource::eGenome_chromosome)
+            {
+                string organelle = " (" + CBioSource::GetOrganelleByGenome(genome) + ")";
+                SIZE_TYPE possible_organelle_start_pos = NStr::Find(sTitle, organelle);
+                if (possible_organelle_start_pos != NPOS &&
+                    NStr::EndsWith(CTempString(sTitle, 0, answer), organelle)) {
+                    *out_piOrganellePos = possible_organelle_start_pos;
+                    break;
+                }
+
+            }
+        }
+    }
 
-        // set best frame
-        CCdregion::TFrame frame = CCdregion::eFrame_not_set;
-        if (new_cds->GetData().GetCdregion().IsSetFrame()) {
-            frame = new_cds->GetData().GetCdregion().GetFrame();
+    return answer;
+}
+
+static void s_RemoveOrgFromEndOfProtein(CBioseq& seq, string taxname)
+
+{
+    if (taxname.empty()) return;
+    SIZE_TYPE taxlen = taxname.length();
+
+    EDIT_EACH_SEQANNOT_ON_BIOSEQ(annot_it, seq) {
+        CSeq_annot& annot = **annot_it;
+        if (!annot.IsFtable()) continue;
+        EDIT_EACH_FEATURE_ON_ANNOT(feat_it, annot) {
+            CSeq_feat& feat = **feat_it;
+            CSeqFeatData& data = feat.SetData();
+            if (!data.IsProt()) continue;
+            CProt_ref& prot_ref = data.SetProt();
+            EDIT_EACH_NAME_ON_PROTREF(it, prot_ref) {
+                string str = *it;
+                if (str.empty()) continue;
+                int len = str.length();
+                if (len < 5) continue;
+                if (str[len - 1] != ']') continue;
+                SIZE_TYPE cp = NStr::Find(str, "[", 0, NPOS, NStr::eLast);
+                if (cp == NPOS) continue;
+                string suffix = str.substr(cp + 1);
+                if (NStr::StartsWith(suffix, "NAD")) continue;
+                if (suffix.length() != taxlen + 1) continue;
+                if (NStr::StartsWith(suffix, taxname)) {
+                    str.erase(cp);
+                    Asn2gnbkCompressSpaces(str);
+                    *it = str;
+                }
+            }
+        }
+    }
+}
+
+bool CCleanup::AddPartialToProteinTitle(CBioseq &bioseq)
+{
+    // Bail if not protein
+    if (!FIELD_CHAIN_OF_2_IS_SET(bioseq, Inst, Mol) ||
+        bioseq.GetInst().GetMol() != NCBI_SEQMOL(aa))
+    {
+        return false;
+    }
+
+    // Bail if record is swissprot
+    FOR_EACH_SEQID_ON_BIOSEQ(seqid_itr, bioseq) {
+        const CSeq_id& seqid = **seqid_itr;
+        if (FIELD_IS(seqid, Swissprot)) {
+            return false;
         }
-        CCdregion::TFrame new_frame = CSeqTranslator::FindBestFrame(*new_cds, entry.GetScope());
-        if (frame != new_frame) {
-            new_cds->SetData().SetCdregion().SetFrame(new_frame);
-            change_this_cds = true;
-            frame = new_frame;
+    }
+
+    // gather some info from the Seqdesc's on the bioseq, into
+    // the following variables
+    bool bPartial = false;
+    string sTaxname;
+    string sOldName;
+    string *psTitle = NULL;
+    string organelle = kEmptyStr;
+
+    // iterate for title
+    EDIT_EACH_SEQDESC_ON_BIOSEQ(descr_iter, bioseq) {
+        CSeqdesc &descr = **descr_iter;
+        if (descr.IsTitle()) {
+            psTitle = &GET_MUTABLE(descr, Title);
         }
+    }
 
-        // set partials for frames
-        if (frame != CCdregion::eFrame_not_set && frame != CCdregion::eFrame_one &&
-            !new_cds->GetLocation().IsPartialStart(eExtreme_Biological)) {
-            new_cds->SetLocation().SetPartialStart(true, eExtreme_Biological);
-            change_this_cds = true;
+    // iterate Seqdescs from bottom to top
+    // accumulate seqdescs into here
+    typedef vector< CConstRef<CSeqdesc> > TSeqdescVec;
+    TSeqdescVec vecSeqdesc;
+    {
+        FOR_EACH_SEQDESC_ON_BIOSEQ(descr_iter, bioseq) {
+            vecSeqdesc.push_back(CConstRef<CSeqdesc>(&**descr_iter));
+        }
+        // climb up to get parent Seqdescs
+        CConstRef<CBioseq_set> bioseq_set(bioseq.GetParentSet());
+        for (; bioseq_set; bioseq_set = bioseq_set->GetParentSet()) {
+            FOR_EACH_SEQDESC_ON_SEQSET(descr_iter, *bioseq_set) {
+                vecSeqdesc.push_back(CConstRef<CSeqdesc>(&**descr_iter));
+            }
         }
+    }
+
+    ITERATE(TSeqdescVec, descr_iter, vecSeqdesc) {
+        const CSeqdesc &descr = **descr_iter;
+        if (descr.IsMolinfo() && FIELD_IS_SET(descr.GetMolinfo(), Completeness)) {
+            switch (GET_FIELD(descr.GetMolinfo(), Completeness)) {
+            case NCBI_COMPLETENESS(partial):
+            case NCBI_COMPLETENESS(no_left):
+            case NCBI_COMPLETENESS(no_right):
+            case NCBI_COMPLETENESS(no_ends):
+                bPartial = true;
+                break;
+            default:
+                break;
+            }
+            // stop at first molinfo
+            break;
+        }
+    }
 
-        // retranslate
-        if (new_cds->IsSetProduct() && entry.GetScope().GetBioseqHandle(new_cds->GetProduct())) {
-            any_changes |= feature::RetranslateCDS(*new_cds, entry.GetScope());
+    ITERATE(TSeqdescVec, descr_iter, vecSeqdesc) {
+        const CSeqdesc &descr = **descr_iter;
+        if (descr.IsSource()) {
+            const TBIOSOURCE_GENOME genome = (descr.GetSource().CanGetGenome() ?
+                descr.GetSource().GetGenome() :
+                CBioSource::eGenome_unknown);
+            if (genome >= CBioSource::eGenome_chloroplast &&
+                genome <= CBioSource::eGenome_chromatophore &&
+                genome != CBioSource::eGenome_extrachrom &&
+                genome != CBioSource::eGenome_transposon &&
+                genome != CBioSource::eGenome_insertion_seq &&
+                genome != CBioSource::eGenome_proviral &&
+                genome != CBioSource::eGenome_virion &&
+                genome != CBioSource::eGenome_chromosome)
+            {
+                organelle = CBioSource::GetOrganelleByGenome(genome);
+            }
+
+            if (FIELD_IS_SET(descr.GetSource(), Org)) {
+                const COrg_ref & org = GET_FIELD(descr.GetSource(), Org);
+                if (!RAW_FIELD_IS_EMPTY_OR_UNSET(org, Taxname)) {
+                    sTaxname = GET_FIELD(org, Taxname);
+                }
+                if (NStr::StartsWith(sTaxname, organelle, NStr::eNocase)) {
+                    organelle = kEmptyStr;
+                }
+                FOR_EACH_ORGMOD_ON_ORGREF(mod_iter, org) {
+                    const COrgMod & orgmod = **mod_iter;
+                    if (FIELD_EQUALS(orgmod, Subtype, NCBI_ORGMOD(old_name))) {
+                        sOldName = GET_FIELD(orgmod, Subname);
+                    }
+                }
+            }
+            // stop at first source
+            break;
+        }
+    }
+
+    s_RemoveOrgFromEndOfProtein(bioseq, sTaxname);
+
+    // bail if no title
+    if ((NULL == psTitle) || psTitle->empty()) {
+        return false;
+    }
+
+    // put title into a reference,
+    // just because it's more convenient than a pointer
+    string & sTitle = *psTitle;
+    // remember original so we can see if we changed it
+    const string sOriginalTitle = sTitle;
+
+    // search for partial, must be just before bracketed organism
+    SIZE_TYPE partialPos = NStr::Find(sTitle, ", partial [");
+    if (partialPos == NPOS) {
+        partialPos = NStr::Find(sTitle, ", partial (");
+    }
+
+    // find oldname or taxname in brackets at end of protein title
+    SIZE_TYPE penult = NPOS;
+    SIZE_TYPE suffixPos = NPOS; // will point to " [${organism name}]" at end
+    if (!sOldName.empty() && !sTaxname.empty()) {
+        suffixPos = s_TitleEndsInOrganism(sTitle, sOldName, &penult);
+    }
+    if (suffixPos == NPOS && !sTaxname.empty()) {
+        suffixPos = s_TitleEndsInOrganism(sTitle, sTaxname, &penult);
+        if (suffixPos != NPOS) {
+            if (NStr::IsBlank(organelle) && penult != NPOS) {
+            } else if (!NStr::IsBlank(organelle) && penult == NPOS) {
+            } else if (penult != NPOS && sTitle.substr(penult) == organelle) {
+            } else {
+                // bail if no need to change partial text or [organism name]
+                if (bPartial && partialPos != NPOS) {
+                    return false;
+                } else if (!bPartial && partialPos == NPOS){
+                    return false;
+                }
+            }
+        }
+    }
+    // do not change unless [genus species] was at the end
+    if (suffixPos == NPOS) {
+        return false;
+    }
+
+    // truncate bracketed info from end of title, will replace with current taxname
+    sTitle.resize(suffixPos);
+    if (penult != NPOS) {
+        sTitle.resize(penult);
+    }
+
+    // if ", partial [" was indeed just before the [genus species], it will now be ", partial"
+    // Note: 9 is length of ", partial"
+    if (!bPartial  &&
+        partialPos != string::npos &&
+        (partialPos == (sTitle.length() - 9)))
+    {
+        sTitle.resize(partialPos);
+    }
+    NStr::TruncateSpacesInPlace(sTitle);
+
+    //
+    if (bPartial && partialPos == NPOS) {
+        sTitle += ", partial";
+    }
+    if (!NStr::IsBlank(organelle)) {
+        sTitle += " (" + string(organelle) + ")";
+    }
+    if (!sTaxname.empty()) {
+        sTitle += " [" + sTaxname + "]";
+    }
+
+    if (sTitle != sOriginalTitle) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+bool CCleanup::RemovePseudoProduct(CSeq_feat& cds, CScope& scope)
+{
+    if (!IsPseudo(cds, scope) ||
+        !cds.IsSetData() || !cds.GetData().IsCdregion() ||
+        !cds.IsSetProduct()) {
+        return false;
+    }
+    CBioseq_Handle pseq = scope.GetBioseqHandle(cds.GetProduct());
+    if (pseq) {
+        CFeat_CI prot(pseq, CSeqFeatData::eSubtype_prot);
+        if (prot) {
+            string label;
+            if (prot->GetData().GetProt().IsSetName() &&
+                !prot->GetData().GetProt().GetName().empty()) {
+                label = prot->GetData().GetProt().GetName().front();
+            } else if (prot->GetData().GetProt().IsSetDesc()) {
+                label = prot->GetData().GetProt().GetDesc();
+            }
+            if (!NStr::IsBlank(label)) {
+                if (cds.IsSetComment() && !NStr::IsBlank(cds.GetComment())) {
+                    cds.SetComment(cds.GetComment() + "; " + label);
+                } else {
+                    cds.SetComment(label);
+                }
+            }
+        }
+        CBioseq_EditHandle pseq_e(pseq);
+        pseq_e.Remove();
+    }
+    cds.ResetProduct();
+    return true;
+}
+
+
+bool CCleanup::WGSCleanup(CSeq_entry_Handle entry)
+{
+    bool any_changes = false;
+
+    SAnnotSelector sel(CSeqFeatData::e_Cdregion);
+    for (CFeat_CI cds_it(entry, sel); cds_it; ++cds_it) {
+        bool change_this_cds = false;
+        CRef<CSeq_feat> new_cds(new CSeq_feat());
+        new_cds->Assign(*(cds_it->GetSeq_feat()));
+        if (IsPseudo(*(cds_it->GetSeq_feat()), entry.GetScope())) {
+            change_this_cds = RemovePseudoProduct(*new_cds, entry.GetScope());
         } else {
-            // need to set product if not set
-            if (!new_cds->IsSetProduct()) {
-                CRef<CSeq_id> new_id = GetNewProteinId(entry, entry.GetScope().GetBioseqHandle(new_cds->GetLocation()));
-                if (new_id) {
-                    new_cds->SetProduct().SetWhole().Assign(*new_id);
-                    change_this_cds = true;
+            change_this_cds |= SetBestFrame(*new_cds, entry.GetScope());
+
+            change_this_cds |= SetCDSPartialsByFrameAndTranslation(*new_cds, entry.GetScope());
+
+            // retranslate
+            if (new_cds->IsSetProduct() && entry.GetScope().GetBioseqHandle(new_cds->GetProduct())) {
+                any_changes |= feature::RetranslateCDS(*new_cds, entry.GetScope());
+            } else {
+                // need to set product if not set
+                if (!new_cds->IsSetProduct() && !IsPseudo(*new_cds, entry.GetScope())) {
+                    CRef<CSeq_id> new_id = GetNewProteinId(entry, entry.GetScope().GetBioseqHandle(new_cds->GetLocation()));
+                    if (new_id) {
+                        new_cds->SetProduct().SetWhole().Assign(*new_id);
+                        change_this_cds = true;
+                    }
+                }
+                if (new_cds->IsSetProduct()) {
+                    CRef<CSeq_entry> prot = AddProtein(*new_cds, entry.GetScope());
+                    if (prot) {
+                        any_changes = true;
+                    }
                 }
+                any_changes |= feature::AdjustForCDSPartials(*new_cds, entry);
             }
+            //prefer ncbieaa
             if (new_cds->IsSetProduct()) {
-                CRef<CSeq_entry> prot = AddProtein(*new_cds, entry.GetScope());
-                if (prot) {
+                CBioseq_Handle p = entry.GetScope().GetBioseqHandle(new_cds->GetProduct());
+                if (p.GetInst().IsSetSeq_data() && p.GetInst().GetSeq_data().IsIupacaa()) {
+                    CBioseq_EditHandle peh(p);
+                    string current = p.GetInst().GetSeq_data().GetIupacaa().Get();
+                    CRef<CSeq_inst> new_inst(new CSeq_inst());
+                    new_inst->Assign(p.GetInst());
+                    new_inst->SetSeq_data().SetNcbieaa().Set(current);
+                    peh.SetInst(*new_inst);
+                    any_changes = true;
+                }
+            }
+
+            string current_name = GetProteinName(*new_cds, entry.GetScope());
+            if (NStr::IsBlank(current_name)) {
+                SetProteinName(*new_cds, "hypothetical protein", false, entry.GetScope());
+                current_name = "hypothetical protein";
+                change_this_cds = true;
+            }
+
+            CConstRef<CSeq_feat> mrna = sequence::GetmRNAforCDS(*(cds_it->GetSeq_feat()), entry.GetScope());
+            if (mrna) {
+                bool change_mrna = false;
+                CRef<CSeq_feat> new_mrna(new CSeq_feat());
+                new_mrna->Assign(*mrna);
+                // Make mRNA name match coding region protein
+                string mrna_name = new_mrna->GetData().GetRna().GetRnaProductName();
+                if (NStr::IsBlank(mrna_name)
+                    || (!NStr::Equal(current_name, "hypothetical protein") &&
+                    !NStr::Equal(current_name, mrna_name))) {
+                    string remainder;
+                    new_mrna->SetData().SetRna().SetRnaProductName(current_name, remainder);
+                    change_mrna = true;
+                }
+                // Adjust mRNA partials to match coding region
+                change_mrna |= feature::CopyFeaturePartials(*new_mrna, *new_cds);
+                if (change_mrna) {
+                    CSeq_feat_Handle fh = entry.GetScope().GetSeq_featHandle(*mrna);
+                    CSeq_feat_EditHandle feh(fh);
+                    feh.Replace(*new_mrna);
                     any_changes = true;
                 }
             }
@@ -1074,27 +2173,39 @@ bool CCleanup::WGSCleanup(CSeq_entry_Handle entry)
 
         if (change_this_cds) {
             CSeq_feat_EditHandle cds_h(*cds_it);
-            CRef<CSeq_feat> new_cds(new CSeq_feat());
-            new_cds->Assign(*(cds_it->GetSeq_feat()));
             
             cds_h.Replace(*new_cds);
             any_changes = true;
+
+            //also need to redo protein title
         }
 
     }
 
-    // SSEC
-    // remove protein titles
-    // add missing prot-refs
-    // CopyCDSproductToMrna
-    // instantiate protein titles
-    // ImposeCodingRegionPartials
-    // ResynchCodingRegionPartials
-    // ResynchMessengerRNAPartials
-    // ResynchProteinPartials
-    // InstantiateProteinTitles
+    for (CFeat_CI gene_it(entry, SAnnotSelector(CSeqFeatData::e_Gene)); gene_it; ++gene_it) {
+        bool change_this_gene;
+        CRef<CSeq_feat> new_gene(new CSeq_feat());
+        new_gene->Assign(*(gene_it->GetSeq_feat()));
+
+        change_this_gene = SetGenePartialByLongestContainedFeature(*new_gene, entry.GetScope());
+
+        if (change_this_gene) {
+            CSeq_feat_EditHandle gene_h(*gene_it);
+            gene_h.Replace(*new_gene);
+            any_changes = true;
+        }
+    }
+
     NormalizeDescriptorOrder(entry);
 
+    for (CBioseq_CI bi(entry, CSeq_inst::eMol_na); bi; ++bi) {
+        any_changes |= SetGeneticCodes(*bi);
+    }
+
+    CRef<CCleanupChange> changes(makeCleanupChange(0));
+    CNewCleanup_imp exclean(changes, 0);
+    exclean.ExtendedCleanup(entry);
+
     return any_changes;
 }
 
@@ -1178,5 +2289,923 @@ bool CCleanup::NormalizeDescriptorOrder(CSeq_entry_Handle seh)
     return rval;
 }
 
+
+bool CCleanup::RemoveUnseenTitles(CSeq_entry_EditHandle::TSeq seq)
+{
+    bool removed = false;
+    if (seq.IsSetDescr()) {
+        CConstRef<CSeqdesc> last_title(NULL);
+        ITERATE(CBioseq::TDescr::Tdata, d, seq.GetDescr().Get()) {
+            if ((*d)->IsTitle()) {
+                if (last_title) {
+                    seq.RemoveSeqdesc(*last_title);
+                    removed = true;
+                }
+                last_title.Reset(d->GetPointer());
+            }
+        }
+    }
+    return removed;
+}
+
+
+bool CCleanup::RemoveUnseenTitles(CSeq_entry_EditHandle::TSet set)
+{
+    bool removed = false;
+    if (set.IsSetDescr()) {
+        CConstRef<CSeqdesc> last_title(NULL);
+        ITERATE(CBioseq::TDescr::Tdata, d, set.GetDescr().Get()) {
+            if ((*d)->IsTitle()) {
+                if (last_title) {
+                    set.RemoveSeqdesc(*last_title);
+                    removed = true;
+                }
+                last_title.Reset(d->GetPointer());
+            }
+        }
+    }
+    return removed;
+}
+
+
+bool CCleanup::AddGenBankWrapper(CSeq_entry_Handle seh)
+{
+    if (seh.IsSet() && seh.GetSet().IsSetClass() &&
+        seh.GetSet().GetClass() == CBioseq_set::eClass_genbank) {
+        return false;
+    }
+    CSeq_entry_EditHandle eh(seh);
+    eh.ConvertSeqToSet(CBioseq_set::eClass_genbank);
+    return true;
+}
+
+
+void s_GetAuthorsString(string *out_authors, const CAuth_list& auth_list)
+{
+    string & auth_str = *out_authors;
+    auth_str.clear();
+
+    if (!auth_list.IsSetNames()) {
+        return;
+    }
+
+    vector<string> name_list;
+
+    if (auth_list.GetNames().IsStd()) {
+        ITERATE(CAuth_list::TNames::TStd, auth_it, auth_list.GetNames().GetStd()) {
+            if ((*auth_it)->IsSetName()) {
+                string label = "";
+                (*auth_it)->GetName().GetLabel(&label);
+                name_list.push_back(label);
+            }
+        }
+    } else if (auth_list.GetNames().IsMl()) {
+        copy(BEGIN_COMMA_END(auth_list.GetNames().GetMl()),
+            back_inserter(name_list));
+    } else if (auth_list.GetNames().IsStr()) {
+        copy(BEGIN_COMMA_END(auth_list.GetNames().GetStr()),
+            back_inserter(name_list));
+    }
+
+    if (name_list.size() == 0) {
+        return;
+    } else if (name_list.size() == 1) {
+        auth_str = name_list.back();
+        return;
+    }
+
+    // join most of them by commas, but the last one gets an "and"
+    string last_author;
+    last_author.swap(name_list.back());
+    name_list.pop_back();
+    // swap is faster than assignment
+    NStr::Join(name_list, ", ").swap(auth_str);
+    auth_str += "and ";
+    auth_str += last_author;
+
+    return;
+}
+
+
+void s_GetAuthorsString(
+    string *out_authors_string, const CPubdesc& pd)
+{
+    string & authors_string = *out_authors_string;
+    authors_string.clear();
+
+    FOR_EACH_PUB_ON_PUBDESC(pub, pd) {
+        if ((*pub)->IsSetAuthors()) {
+            s_GetAuthorsString(&authors_string, (*pub)->GetAuthors());
+            break;
+        }
+    }
+}
+
+
+void CCleanup::GetPubdescLabels
+(const CPubdesc& pd,
+vector<int>& pmids, vector<int>& muids, vector<int>& serials,
+vector<string>& published_labels,
+vector<string>& unpublished_labels)
+{
+    string label = "";
+    bool   is_published = false;
+    bool   need_label = false;
+
+    if (!pd.IsSetPub()) {
+        return;
+    }
+    ITERATE(CPubdesc::TPub::Tdata, it, pd.GetPub().Get()) {
+        if ((*it)->IsPmid()) {
+            pmids.push_back((*it)->GetPmid());
+            is_published = true;
+        } else if ((*it)->IsMuid()) {
+            muids.push_back((*it)->GetMuid());
+            is_published = true;
+        } else if ((*it)->IsGen()) {
+            if ((*it)->GetGen().IsSetCit()
+                && NStr::StartsWith((*it)->GetGen().GetCit(), "BackBone id_pub", NStr::eNocase)) {
+                need_label = true;
+            }
+            if ((*it)->GetGen().IsSetSerial_number()) {
+                serials.push_back((*it)->GetGen().GetSerial_number());
+                if ((*it)->GetGen().IsSetCit()
+                    || (*it)->GetGen().IsSetJournal()
+                    || (*it)->GetGen().IsSetDate()) {
+                    need_label = true;
+                }
+            } else {
+                need_label = true;
+            }
+        } else if ((*it)->IsArticle() && (*it)->GetArticle().IsSetIds()) {
+            is_published = true;
+            ITERATE(CArticleIdSet::Tdata, id, (*it)->GetArticle().GetIds().Get()) {
+                if ((*id)->IsPubmed()) {
+                    pmids.push_back((*id)->GetPubmed());
+                    is_published = true;
+                } else if ((*id)->IsMedline()) {
+                    muids.push_back((*id)->GetMedline());
+                }
+            }
+            need_label = true;
+        } else {
+            need_label = true;
+        }
+        if (need_label && NStr::IsBlank(label)) {
+            // create unique label
+            (*it)->GetLabel(&label, CPub::eContent, true);
+            string auth_str;
+            s_GetAuthorsString(&auth_str, pd);
+            label += "; ";
+            label += auth_str;
+        }
+    }
+    if (!NStr::IsBlank(label)) {
+        if (is_published) {
+            published_labels.push_back(label);
+        } else {
+            unpublished_labels.push_back(label);
+        }
+    }
+}
+
+
+vector<CConstRef<CPub> > CCleanup::GetCitationList(CBioseq_Handle bsh)
+{
+    vector<CConstRef<CPub> > pub_list;
+
+    // first get descriptor pubs
+    CSeqdesc_CI di(bsh, CSeqdesc::e_Pub);
+    while (di) {
+        vector<int> pmids;
+        vector<int> muids;
+        vector<int> serials;
+        vector<string> published_labels;
+        vector<string> unpublished_labels;
+        GetPubdescLabels(di->GetPub(), pmids, muids, serials, published_labels, unpublished_labels);
+        if (pmids.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetPmid().Set(pmids[0]);
+            pub_list.push_back(pub);
+        } else if (muids.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetMuid(muids[0]);
+            pub_list.push_back(pub);
+        } else if (serials.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetGen().SetSerial_number(serials[0]);
+            pub_list.push_back(pub);
+        } else if (published_labels.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetGen().SetCit(published_labels[0]);
+            pub_list.push_back(pub);
+        } else if (unpublished_labels.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetGen().SetCit(unpublished_labels[0]);
+            pub_list.push_back(pub);
+        }
+
+        ++di;
+    }
+    // now get pub features
+    CFeat_CI fi(bsh, SAnnotSelector(CSeqFeatData::e_Pub));
+    while (fi) {
+        vector<int> pmids;
+        vector<int> muids;
+        vector<int> serials;
+        vector<string> published_labels;
+        vector<string> unpublished_labels;
+        GetPubdescLabels(fi->GetData().GetPub(), pmids, muids, serials, published_labels, unpublished_labels);
+        if (pmids.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetPmid().Set(pmids[0]);
+            pub_list.push_back(pub);
+        } else if (muids.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetMuid(muids[0]);
+            pub_list.push_back(pub);
+        } else if (serials.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetGen().SetSerial_number(serials[0]);
+            pub_list.push_back(pub);
+        } else if (published_labels.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetGen().SetCit(published_labels[0]);
+            pub_list.push_back(pub);
+        } else if (unpublished_labels.size() > 0) {
+            CRef<CPub> pub(new CPub());
+            pub->SetGen().SetCit(unpublished_labels[0]);
+            pub_list.push_back(pub);
+        }
+
+        ++fi;
+    }
+    return pub_list;
+}
+
+
+bool CCleanup::RemoveDuplicatePubs(CSeq_descr& descr)
+{
+    bool any_change = false;
+    CSeq_descr::Tdata::iterator it1 = descr.Set().begin();
+    while (it1 != descr.Set().end()) {
+        if ((*it1)->IsPub()) {
+            CSeq_descr::Tdata::iterator it2 = it1;
+            ++it2;
+            while (it2 != descr.Set().end()) {
+                if ((*it2)->IsPub() && (*it1)->GetPub().Equals((*it2)->GetPub())) {
+                    it2 = descr.Set().erase(it2);
+                    any_change = true;
+                } else {
+                    ++it2;
+                }
+            }
+        }
+        ++it1;
+    }
+    return any_change;
+}
+
+
+bool s_FirstPubMatchesSecond(const CPubdesc& pd1, const CPubdesc& pd2)
+{
+    if (pd1.Equals(pd2)) {
+        return true;
+    } else if (pd1.IsSetPub() && pd2.IsSetPub() && pd1.GetPub().Get().size() == 1) {
+        ITERATE(CPubdesc::TPub::Tdata, it, pd2.GetPub().Get()) {
+            if (pd1.GetPub().Get().front()->Equals(**it)) {
+                return true;
+            }
+        }
+    }
+    return false;
+}
+
+
+bool CCleanup::PubAlreadyInSet(const CPubdesc& pd, const CSeq_descr& descr)
+{
+    ITERATE(CSeq_descr::Tdata, d, descr.Get()) {
+        if ((*d)->IsPub() && s_FirstPubMatchesSecond(pd, (*d)->GetPub())) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
+bool CCleanup::OkToPromoteNpPub(const CBioseq& b)
+{
+    bool is_embl_or_ddbj = false;
+    ITERATE(CBioseq::TId, id, b.GetId()) {
+        if ((*id)->IsEmbl() || (*id)->IsDdbj()) {
+            is_embl_or_ddbj = true;
+            break;
+        }
+    }
+    return !is_embl_or_ddbj;
+}
+
+
+bool CCleanup::OkToPromoteNpPub(const CPubdesc& pd)
+{
+    if (pd.IsSetNum() || pd.IsSetName() || pd.IsSetFig() || pd.IsSetComment()) {
+        return false;
+    } else {
+        return true;
+    }
+}
+
+
+void CCleanup::MoveOneFeatToPubdesc(CSeq_feat_Handle feat, CRef<CSeqdesc> d, CBioseq_Handle b, bool remove_feat)
+{
+    // add descriptor to nuc-prot parent or sequence itself
+    CBioseq_set_Handle parent = b.GetParentBioseq_set();
+    if (!CCleanup::OkToPromoteNpPub(*(b.GetCompleteBioseq()))) {
+        // add to sequence
+        CBioseq_EditHandle eh(b);
+        eh.AddSeqdesc(*d);
+        RemoveDuplicatePubs(eh.SetDescr());
+        NormalizeDescriptorOrder(eh.SetDescr());
+    } else if (parent && parent.IsSetClass() &&
+        parent.GetClass() == CBioseq_set::eClass_nuc_prot &&
+        parent.IsSetDescr() && PubAlreadyInSet(d->GetPub(), parent.GetDescr())) {
+        // don't add descriptor, just delete feature 
+    } else if (OkToPromoteNpPub((d)->GetPub()) &&
+        parent && parent.IsSetClass() &&
+        parent.GetClass() == CBioseq_set::eClass_nuc_prot) {
+        CBioseq_set_EditHandle eh(parent);
+        eh.AddSeqdesc(*d);
+        RemoveDuplicatePubs(eh.SetDescr());
+        NormalizeDescriptorOrder(eh.SetDescr());
+    } else {
+        CBioseq_EditHandle eh(b);
+        eh.AddSeqdesc(*d);
+        RemoveDuplicatePubs(eh.SetDescr());
+        NormalizeDescriptorOrder(eh.SetDescr());
+    }
+    if (remove_feat) {
+        // remove feature
+        CSeq_feat_EditHandle feh(feat);
+        feh.Remove();
+    }
+}
+
+
+bool CCleanup::ConvertPubFeatsToPubDescs(CSeq_entry_Handle seh)
+{
+    bool any_change = false;
+    for (CBioseq_CI b(seh); b; ++b) {
+        for (CFeat_CI p(*b, CSeqFeatData::e_Pub); p; ++p) {
+            if (p->GetLocation().IsInt() &&
+                p->GetLocation().GetStart(eExtreme_Biological) == 0 &&
+                p->GetLocation().GetStop(eExtreme_Biological) == b->GetBioseqLength() - 1) {
+                CRef<CSeqdesc> d(new CSeqdesc());
+                d->SetPub().Assign(p->GetData().GetPub());
+                if (p->IsSetComment()) {
+                    if (d->GetPub().IsSetComment() && !NStr::IsBlank(d->GetPub().GetComment())) {
+                        d->SetPub().SetComment(d->GetPub().GetComment() + "; " + p->GetComment());
+                    } else {
+                        d->SetPub().SetComment();
+                    }
+                }
+                MoveOneFeatToPubdesc(*p, d, *b);
+                any_change = true;
+            }
+        }
+    }
+    return any_change;
+}
+
+
+bool IsSiteRef(const CSeq_feat& sf)
+{
+    if (sf.GetData().IsImp() &&
+        sf.GetData().GetImp().IsSetKey() &&
+        NStr::Equal(sf.GetData().GetImp().GetKey(), "Site-ref")) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+bool CCleanup::RescueSiteRefPubs(CSeq_entry_Handle seh)
+{
+    bool found_site_ref = false;
+    CFeat_CI f(seh, CSeqFeatData::e_Imp);
+    while (f && !found_site_ref) {
+        if (f->GetData().GetImp().IsSetKey() && 
+            NStr::Equal(f->GetData().GetImp().GetKey(), "Site-ref")) {
+            found_site_ref = true;
+        }
+        ++f;
+    }
+    if (!found_site_ref) {
+        return false;
+    }
+
+    bool any_change = false;
+    for (CBioseq_CI b(seh); b; ++b) {
+        for (CFeat_CI p(*b); p; ++p) {
+            if (!p->IsSetCit() || p->GetCit().Which() != CPub_set::e_Pub) {
+                continue;
+            }            
+
+            bool is_site_ref = IsSiteRef(*(p->GetSeq_feat()));
+            ITERATE(CSeq_feat::TCit::TPub, c, p->GetCit().GetPub()) { 
+                CRef<CSeqdesc> d(new CSeqdesc());
+                if ((*c)->IsEquiv()) {
+                    ITERATE(CPub_equiv::Tdata, t, (*c)->GetEquiv().Get()) {
+                        CRef<CPub> pub_copy(new CPub());
+                        pub_copy->Assign(**t);
+                        d->SetPub().SetPub().Set().push_back(pub_copy);
+                    }
+
+                } else {
+                    CRef<CPub> pub_copy(new CPub());
+                    pub_copy->Assign(**c);
+                    d->SetPub().SetPub().Set().push_back(pub_copy);
+                }
+                if (is_site_ref) {
+                    d->SetPub().SetReftype(CPubdesc::eReftype_sites);
+                } else {
+                    d->SetPub().SetReftype(CPubdesc::eReftype_feats);
+                }
+                CRef<CCleanupChange> changes(makeCleanupChange(0));
+                CNewCleanup_imp pubclean(changes, 0);
+                pubclean.BasicCleanup(d->SetPub(), ShouldStripPubSerial(*(b->GetCompleteBioseq())));
+                MoveOneFeatToPubdesc(*p, d, *b, false);
+            }
+            if (is_site_ref) {
+                CSeq_feat_EditHandle feh(*p);
+                feh.Remove();
+            }
+            any_change = true;
+        }
+    }
+    return any_change;
+}
+
+
+bool CCleanup::AreBioSourcesMergeable(const CBioSource& src1, const CBioSource& src2)
+{
+    if (src1.IsSetOrg() && src1.GetOrg().IsSetTaxname() &&
+        src2.IsSetOrg() && src2.GetOrg().IsSetTaxname() &&
+        NStr::Equal(src1.GetOrg().GetTaxname(), src2.GetOrg().GetTaxname())) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+bool CCleanup::MergeDupBioSources(CBioSource& src1, const CBioSource& add)
+{
+    bool any_change = false;
+    // genome
+    if ((!src1.IsSetGenome() || src1.GetGenome() == CBioSource::eGenome_unknown) &&
+        add.IsSetGenome() && add.GetGenome() != CBioSource::eGenome_unknown) {
+        src1.SetGenome(add.GetGenome());
+        any_change = true;
+    }
+    // origin
+    if ((!src1.IsSetOrigin() || src1.GetOrigin() == CBioSource::eOrigin_unknown) &&
+        add.IsSetOrigin() && add.GetOrigin() != CBioSource::eOrigin_unknown) {
+        src1.SetOrigin(add.GetOrigin());
+        any_change = true;
+    }
+    // focus
+    if (!src1.IsSetIs_focus() && add.IsSetIs_focus()) {
+        src1.SetIs_focus();
+        any_change = true;
+    }
+
+    // merge subtypes
+    if (add.IsSetSubtype()) {
+        ITERATE(CBioSource::TSubtype, it, add.GetSubtype()) {
+            CRef<CSubSource> a(new CSubSource());
+            a->Assign(**it);
+            src1.SetSubtype().push_back(a);
+        }
+        any_change = true;
+    }
+
+    x_MergeDupOrgRefs(src1.SetOrg(), add.GetOrg());
+
+    return any_change;
+}
+
+
+bool CCleanup::x_MergeDupOrgNames(COrgName& on1, const COrgName& add)
+{
+    bool any_change = false;
+
+    // OrgMods
+    if (add.IsSetMod()) {
+        ITERATE(COrgName::TMod, it, add.GetMod()) {
+            CRef<COrgMod> a(new COrgMod());
+            a->Assign(**it);
+            on1.SetMod().push_back(a);
+        }
+        any_change = true;
+    }
+
+    // gcode
+    if ((!on1.IsSetGcode() || on1.GetGcode() == 0) && add.IsSetGcode() && add.GetGcode() != 0) {
+        on1.SetGcode(add.GetGcode());
+        any_change = true;
+    }
+
+    // mgcode
+    if ((!on1.IsSetMgcode() || on1.GetMgcode() == 0) && add.IsSetMgcode() && add.GetMgcode() != 0) {
+        on1.SetMgcode(add.GetMgcode());
+        any_change = true;
+    }
+
+    // lineage
+    if (!on1.IsSetLineage() && add.IsSetLineage()) {
+        on1.SetLineage(add.GetLineage());
+        any_change = true;
+    }
+
+    // div
+    if (!on1.IsSetDiv() && add.IsSetDiv()) {
+        on1.SetDiv(add.GetDiv());
+        any_change = true;
+    }
+
+    return any_change;
+}
+
+
+bool HasMod(const COrg_ref& org, const string& mod)
+{
+    if (!org.IsSetMod()) {
+        return false;
+    }
+    ITERATE(COrg_ref::TMod, it, org.GetMod()) {
+        if (NStr::Equal(*it, mod)) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
+bool CCleanup::x_MergeDupOrgRefs(COrg_ref& org1, const COrg_ref& add)
+{
+    bool any_change = false;
+    // mods
+    if (add.IsSetMod()) {
+        ITERATE(COrg_ref::TMod, it, add.GetMod()) {
+            if (!HasMod(org1, *it)) {
+                org1.SetMod().push_back(*it);
+                any_change = true;
+            }
+        }
+    }
+
+    // dbxrefs
+    if (add.IsSetDb()) {
+        ITERATE(COrg_ref::TDb, it, add.GetDb()) {
+            CRef<CDbtag> a(new CDbtag());
+            a->Assign(**it);
+            org1.SetDb().push_back(a);
+        }
+        any_change = true;
+    }
+
+    // synonyms
+    if (add.IsSetSyn()) {
+        ITERATE(COrg_ref::TSyn, it, add.GetSyn()) {
+            org1.SetSyn().push_back(*it);
+        }
+        any_change = true;
+    }
+
+    if (add.IsSetOrgname()) {
+        any_change |= x_MergeDupOrgNames(org1.SetOrgname(), add.GetOrgname());
+    }
+
+    return any_change;
+}
+
+
+bool CCleanup::MergeDupBioSources(CSeq_descr & seq_descr)
+{
+    bool any_change = false;
+    CSeq_descr::Tdata::iterator src1 = seq_descr.Set().begin();
+    while (src1 != seq_descr.Set().end()) {
+        if ((*src1)->IsSource() && (*src1)->GetSource().IsSetOrg() && (*src1)->GetSource().GetOrg().IsSetTaxname()) {
+            CSeq_descr::Tdata::iterator src2 = src1;
+            ++src2;
+            while (src2 != seq_descr.Set().end()) {
+                if ((*src2)->IsSource() &&
+                    AreBioSourcesMergeable((*src1)->GetSource(), (*src2)->GetSource())) {
+                    MergeDupBioSources((*src1)->SetSource(), (*src2)->GetSource());
+
+                    CRef<CCleanupChange> changes(makeCleanupChange(0));
+                    CNewCleanup_imp srcclean(changes, 0);
+                    srcclean.ExtendedCleanup((*src1)->SetSource());
+                    src2 = seq_descr.Set().erase(src2);
+                    any_change = true;
+                } else {
+                    ++src2;
+                }
+            }
+        }
+        ++src1;
+    }
+    return any_change;
+}
+
+/// Remove duplicate biosource descriptors
+bool CCleanup::RemoveDupBioSource(CSeq_descr& descr)
+{
+    bool any_change = false;
+    vector<CConstRef<CBioSource> > src_list;
+    CSeq_descr::Tdata::iterator d = descr.Set().begin();
+    while (d != descr.Set().end()) {
+        if ((*d)->IsSource()) {
+            bool found = false;
+            ITERATE(vector<CConstRef<CBioSource> >, s, src_list) {
+                if ((*d)->GetSource().Equals(**s)) {
+                    found = true;
+                    break;
+                }
+            }
+            if (found) {
+                d = descr.Set().erase(d);
+                any_change = true;
+            } else {
+                CConstRef<CBioSource> src(&((*d)->GetSource()));
+                src_list.push_back(src);
+                ++d;
+            }
+        } else {
+            ++d;
+        }
+    }
+    return any_change;
+}
+
+
+CRef<CBioSource> CCleanup::BioSrcFromFeat(const CSeq_feat& f)
+{
+    if (!f.IsSetData() || !f.GetData().IsBiosrc()) {
+        return CRef<CBioSource>(NULL);
+    }
+    CRef<CBioSource> src(new CBioSource());
+    src->Assign(f.GetData().GetBiosrc());
+
+    // move comment to subsource note
+    if (f.IsSetComment()) {
+        CRef<CSubSource> s(new CSubSource());
+        s->SetSubtype(CSubSource::eSubtype_other);
+        s->SetName(f.GetComment());
+        src->SetSubtype().push_back(s);
+
+    }
+
+    // move dbxrefs on feature to source
+    if (f.IsSetDbxref()) {
+        ITERATE(CSeq_feat::TDbxref, it, f.GetDbxref()) {
+            CRef<CDbtag> a(new CDbtag());
+            a->Assign(**it);
+            src->SetOrg().SetDb().push_back(a);
+        }
+    }
+    CRef<CCleanupChange> changes(makeCleanupChange(0));
+    CNewCleanup_imp srcclean(changes, 0);
+    srcclean.ExtendedCleanup(*src);
+
+    return src;
+}
+
+
+bool CCleanup::ConvertSrcFeatsToSrcDescs(CSeq_entry_Handle seh)
+{
+    bool any_change = false;
+    for (CBioseq_CI b(seh); b; ++b) {
+        for (CFeat_CI p(*b, CSeqFeatData::e_Biosrc); p; ++p) {
+            if (p->GetLocation().IsInt() &&
+                p->GetLocation().GetStart(eExtreme_Biological) == 0 &&
+                p->GetLocation().GetStop(eExtreme_Biological) == b->GetBioseqLength() - 1) {
+                CRef<CSeqdesc> d(new CSeqdesc());
+                d->SetSource().Assign(*(BioSrcFromFeat(*(p->GetSeq_feat()))));
+
+                // add descriptor to nuc-prot parent or sequence itself
+                CBioseq_set_Handle parent = b->GetParentBioseq_set();
+                if (parent && parent.IsSetClass() &&
+                    parent.GetClass() == CBioseq_set::eClass_nuc_prot) {
+                    CBioseq_set_EditHandle eh(parent);
+                    eh.AddSeqdesc(*d);
+                    MergeDupBioSources(eh.SetDescr());
+                    RemoveDupBioSource(eh.SetDescr());
+                    NormalizeDescriptorOrder(eh.SetDescr());
+                } else {
+                    CBioseq_EditHandle eh(*b);
+                    eh.AddSeqdesc(*d);
+                    MergeDupBioSources(eh.SetDescr());
+                    RemoveDupBioSource(eh.SetDescr());
+                    NormalizeDescriptorOrder(eh.SetDescr());
+                }
+
+                // remove feature
+                CSeq_feat_EditHandle feh(*p);
+                feh.Remove();
+
+                any_change = true;
+            }
+        }
+    }
+    return any_change;
+}
+
+
+
+bool CCleanup::FixGeneXrefSkew(CSeq_entry_Handle seh)
+{
+    CFeat_CI fi(seh);
+    size_t num_gene_locus = 0;
+    size_t num_gene_locus_tag = 0;
+    size_t num_gene_xref_locus = 0;
+    size_t num_gene_xref_locus_tag = 0;
+
+    while (fi) {
+        if (fi->GetData().IsGene()) {
+            if (fi->GetData().GetGene().IsSetLocus()) {
+                num_gene_locus++;
+            }
+            if (fi->GetData().GetGene().IsSetLocus_tag()) {
+                num_gene_locus_tag++;
+            }
+        } else if (fi->IsSetXref()) {
+            const CGene_ref* g = fi->GetGeneXref();
+            if (g) {
+                if (g->IsSetLocus()) {
+                    num_gene_xref_locus++;
+                }
+                if (g->IsSetLocus_tag()) {
+                    num_gene_xref_locus_tag++;
+                }
+            }
+        }
+        if (num_gene_locus > 0) {
+            if (num_gene_locus_tag > 0) {
+                return false;
+            }
+            if (num_gene_xref_locus > 0) {
+                return false;
+            }
+        }
+        if (num_gene_locus_tag > 0) {
+            if (num_gene_locus > 0) {
+                return false;
+            }
+            if (num_gene_xref_locus_tag > 0) {
+                return false;
+            }
+        }
+        ++fi;
+    }
+
+    bool any_change = false;
+    if (num_gene_locus == 0 && num_gene_locus_tag > 0) {
+        if (num_gene_xref_locus > 0 && num_gene_xref_locus_tag == 0) {
+            fi.Rewind();
+            while (fi) {
+                if (!fi->GetData().IsGene() && fi->GetGeneXref() != NULL) {
+                    bool this_change = false;
+                    CRef<CSeq_feat> new_f(new CSeq_feat());
+                    new_f->Assign(*(fi->GetSeq_feat()));
+                    NON_CONST_ITERATE(CSeq_feat::TXref, it, new_f->SetXref()) {
+                        if ((*it)->IsSetData() && (*it)->GetData().IsGene()
+                            && (*it)->GetData().GetGene().IsSetLocus()) {
+                            (*it)->SetData().SetGene().SetLocus_tag((*it)->GetData().GetGene().GetLocus());
+                            (*it)->SetData().SetGene().ResetLocus();
+                            this_change = true;
+                        }
+                    }
+                    if (this_change) {
+                        CSeq_feat_EditHandle eh(*fi);
+                        eh.Replace(*new_f);
+                    }
+                }
+                ++fi;
+            }
+        }
+    } else if (num_gene_locus > 0 && num_gene_locus_tag == 0) {
+        if (num_gene_xref_locus == 0 && num_gene_xref_locus_tag > 0) {
+            fi.Rewind();
+            while (fi) {
+                if (!fi->GetData().IsGene() && fi->GetGeneXref() != NULL) {
+                    bool this_change = false;
+                    CRef<CSeq_feat> new_f(new CSeq_feat());
+                    new_f->Assign(*(fi->GetSeq_feat()));
+                    NON_CONST_ITERATE(CSeq_feat::TXref, it, new_f->SetXref()) {
+                        if ((*it)->IsSetData() && (*it)->GetData().IsGene()
+                            && (*it)->GetData().GetGene().IsSetLocus_tag()) {
+                            (*it)->SetData().SetGene().SetLocus((*it)->GetData().GetGene().GetLocus_tag());
+                            (*it)->SetData().SetGene().ResetLocus_tag();
+                            this_change = true;
+                        }
+                    }
+                    if (this_change) {
+                        CSeq_feat_EditHandle eh(*fi);
+                        eh.Replace(*new_f);
+                        any_change = true;
+                    }
+                }
+                ++fi;
+            }
+        }
+    }
+    return any_change;
+}
+
+
+bool CCleanup::ShouldStripPubSerial(const CBioseq& bs)
+{
+    bool strip_serial = true;
+    ITERATE(CBioseq::TId, id, bs.GetId()) {
+        const CSeq_id& sid = **id;
+        switch (sid.Which()) {
+        case NCBI_SEQID(Genbank):
+        case NCBI_SEQID(Tpg):
+        {
+            const CTextseq_id& tsid = *GET_FIELD(sid, Textseq_Id);
+            if (FIELD_IS_SET(tsid, Accession)) {
+                const string& acc = GET_FIELD(tsid, Accession);
+                if (acc.length() == 6) {
+                    strip_serial = false;
+                }
+            }
+        }
+        break;
+        case NCBI_SEQID(Embl):
+        case NCBI_SEQID(Ddbj):
+            strip_serial = false;
+            break;
+        case NCBI_SEQID(not_set):
+        case NCBI_SEQID(Local):
+        case NCBI_SEQID(Other):
+        case NCBI_SEQID(General):
+            break;
+        case NCBI_SEQID(Gibbsq):
+        case NCBI_SEQID(Gibbmt):
+        case NCBI_SEQID(Pir):
+        case NCBI_SEQID(Swissprot):
+        case NCBI_SEQID(Patent):
+        case NCBI_SEQID(Prf):
+        case NCBI_SEQID(Pdb):
+        case NCBI_SEQID(Gpipe):
+        case NCBI_SEQID(Tpe):
+        case NCBI_SEQID(Tpd):
+            strip_serial = false;
+            break;
+        default:
+            break;
+        }
+    }
+    return strip_serial;
+}
+
+
+bool CCleanup::RenormalizeNucProtSets(CSeq_entry_Handle seh)
+{
+    bool change_made = false;
+    CConstRef<CSeq_entry> entry = seh.GetCompleteSeq_entry();
+    if (seh.IsSet() && seh.GetSet().IsSetClass() &&
+        entry->GetSet().IsSetSeq_set()) {
+        CBioseq_set::TClass set_class = seh.GetSet().GetClass();        
+        if (set_class == CBioseq_set::eClass_nuc_prot) {
+            if (entry->GetSet().GetSeq_set().size() == 1 &&
+                entry->GetSet().GetSeq_set().front()->IsSeq()) {
+                CSeq_entry_EditHandle eh = seh.GetEditHandle();
+                eh.ConvertSetToSeq();
+                if (eh.GetSeq().IsSetDescr()) {
+                    RemoveUnseenTitles(eh.SetSeq());
+                    NormalizeDescriptorOrder(eh.SetSeq().SetDescr());
+                }
+                change_made = true;
+            }
+        } else if (set_class == CBioseq_set::eClass_genbank ||
+            set_class == CBioseq_set::eClass_mut_set ||
+            set_class == CBioseq_set::eClass_pop_set ||
+            set_class == CBioseq_set::eClass_phy_set ||
+            set_class == CBioseq_set::eClass_eco_set ||
+            set_class == CBioseq_set::eClass_wgs_set ||
+            set_class == CBioseq_set::eClass_gen_prod_set ||
+            set_class == CBioseq_set::eClass_small_genome_set) {
+            ITERATE(CBioseq_set::TSeq_set, s, entry->GetSet().GetSeq_set()) {
+                CSeq_entry_Handle ch = seh.GetScope().GetSeq_entryHandle(**s);
+                change_made |= RenormalizeNucProtSets(ch);
+            }
+        }
+    }
+    return change_made;
+}
+
 END_SCOPE(objects)
 END_NCBI_SCOPE
diff --git a/c++/src/objtools/cleanup/cleanup_utils.cpp b/c++/src/objtools/cleanup/cleanup_utils.cpp
index 13703d8..68a1648 100644
--- a/c++/src/objtools/cleanup/cleanup_utils.cpp
+++ b/c++/src/objtools/cleanup/cleanup_utils.cpp
@@ -1,4 +1,4 @@
-/* $Id: cleanup_utils.cpp 480957 2015-10-06 12:01:31Z ivanov $
+/* $Id: cleanup_utils.cpp 493625 2016-03-01 13:42:44Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -125,7 +125,7 @@ void s_SplitMLAuthorName(string name, string& last, string& initials, string& su
     }
 
     vector<string> parts;
-    NStr::Tokenize( name, " ", parts, NStr::eMergeDelims );
+    NStr::Split( name, " ", parts, NStr::eMergeDelims );
     if ( parts.empty() ) {
         return;
     }
diff --git a/c++/src/objtools/cleanup/cleanup_utils.hpp b/c++/src/objtools/cleanup/cleanup_utils.hpp
index e8edb9e..14b665d 100644
--- a/c++/src/objtools/cleanup/cleanup_utils.hpp
+++ b/c++/src/objtools/cleanup/cleanup_utils.hpp
@@ -1,7 +1,7 @@
 #ifndef OBJECTS_GENERAL___CLEANUP_UTILS__HPP
 #define OBJECTS_GENERAL___CLEANUP_UTILS__HPP
 
-/* $Id: cleanup_utils.hpp 480957 2015-10-06 12:01:31Z ivanov $
+/* $Id: cleanup_utils.hpp 479180 2015-09-17 12:07:11Z bollin $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/cleanup/newcleanupp.cpp b/c++/src/objtools/cleanup/newcleanupp.cpp
index 30c531b..e8880fc 100644
--- a/c++/src/objtools/cleanup/newcleanupp.cpp
+++ b/c++/src/objtools/cleanup/newcleanupp.cpp
@@ -61,6 +61,7 @@
 #include <objects/medline/Medline_entry.hpp>
 #include <objtools/edit/struc_comm_field.hpp>
 #include <objtools/edit/gb_block_field.hpp>
+#include <objtools/edit/seq_entry_edit.hpp>
 #include <objects/valid/Comment_rule.hpp>
 
 #include <util/ncbi_cache.hpp>
@@ -170,7 +171,9 @@ CNewCleanup_imp::CNewCleanup_imp (CRef<CCleanupChange> changes, Uint4 options)
       m_Objmgr(NULL),
       m_Scope(NULL),
       m_IsGpipe(false),
-      m_SyncGenCodes(false)
+      m_SyncGenCodes(false),
+      m_StripSerial(true),
+      m_IsEmblOrDdbj(false)
 {
     if (options & CCleanup::eClean_GpipeMode) {
         m_IsGpipe = true;
@@ -183,8 +186,6 @@ CNewCleanup_imp::CNewCleanup_imp (CRef<CCleanupChange> changes, Uint4 options)
     m_Objmgr = CObjectManager::GetInstance ();
     m_Scope.Reset (new CScope (*m_Objmgr));
 
-    // make sure stack is never empty, so "top()" always works
-    m_SeqEntryInfoStack.push( SSeqEntryInfo() );
 }
 
 // Destructor
@@ -206,6 +207,7 @@ void CNewCleanup_imp::BasicCleanupSeqEntry (
     // calls our functions here.
     // The idea is that we don't have to hand-write the
     // error-prone traversal code.
+    SetGlobalFlags(se);
     CAutogeneratedCleanup auto_cleanup( *m_Scope, *this );
     auto_cleanup.BasicCleanupSeqEntry( se );
     x_PostProcessing();
@@ -221,6 +223,7 @@ void CNewCleanup_imp::BasicCleanupSeqSubmit (
 )
 
 {
+    SetGlobalFlags(ss);
     CAutogeneratedCleanup auto_cleanup( *m_Scope, *this );
     auto_cleanup.BasicCleanupSeqSubmit( ss );
     x_PostProcessing();
@@ -240,7 +243,7 @@ void CNewCleanup_imp::BasicCleanupSeqAnnot (
 
 {
     // no Seq-entry context, so skip setup function
-    
+    ResetGlobalFlags();
     CAutogeneratedCleanup auto_cleanup( *m_Scope, *this );
     auto_cleanup.BasicCleanupSeqAnnot( sa );
     x_PostProcessing();
@@ -252,6 +255,7 @@ void CNewCleanup_imp::BasicCleanupBioseq (
 
 {
     // no Seq-entry context, so skip setup function
+    SetGlobalFlags(bs);
     CAutogeneratedCleanup auto_cleanup( *m_Scope, *this );
     auto_cleanup.BasicCleanupBioseq( bs );
 
@@ -266,7 +270,7 @@ void CNewCleanup_imp::BasicCleanupBioseqSet (
 
 {
     // no Seq-entry context, so skip setup function
-    
+    SetGlobalFlags(bss);
     CAutogeneratedCleanup auto_cleanup( *m_Scope, *this );
     auto_cleanup.BasicCleanupBioseqSet( bss );
     x_PostProcessing();
@@ -283,7 +287,7 @@ void CNewCleanup_imp::BasicCleanupSeqFeat (
 
 {
     // no Seq-entry context, so skip setup function
-    
+    ResetGlobalFlags();
     CAutogeneratedCleanup auto_cleanup( *m_Scope, *this );
     auto_cleanup.BasicCleanupSeqFeat( sf );
     x_PostProcessing();
@@ -296,6 +300,7 @@ void CNewCleanup_imp::BasicCleanupBioSource (
 
 {
     // no Seq-entry context, so skip setup function
+    ResetGlobalFlags();
     CAutogeneratedCleanup auto_cleanup( *m_Scope, *this );
     CRef<CSeq_feat> f(new CSeq_feat());
     f->SetData().SetBiosrc().Assign(src);
@@ -305,25 +310,20 @@ void CNewCleanup_imp::BasicCleanupBioSource (
 }
 
 
-void CNewCleanup_imp::BasicCleanupSeqEntryHandle (
-    CSeq_entry_Handle& seh
-)
+void CNewCleanup_imp::ExtendedCleanup(CBioSource& src)
 {
-    // clean a copy, and then update via the edit handle
-
-    CRef<CSeq_entry> new_seq_entry( new CSeq_entry );
-    new_seq_entry->Assign( *seh.GetCompleteSeq_entry() );
-
-    CSeq_entry_EditHandle edit_handle = seh.GetEditHandle();
+    BiosourceBC(src);
+    BioSourceEC(src);
+}
 
-    BasicCleanupSeqEntry( *new_seq_entry );
 
-    edit_handle.SelectNone();
-    if( new_seq_entry->IsSeq() ) {
-        edit_handle.SelectSeq( new_seq_entry->SetSeq() );
-    } else if( new_seq_entry->IsSet() ) {
-        edit_handle.SelectSet( new_seq_entry->SetSet() );
-    }
+void CNewCleanup_imp::BasicCleanupSeqEntryHandle (
+    CSeq_entry_Handle& seh
+)
+{    
+    CConstRef<CSeq_entry> seq_entry = seh.GetCompleteSeq_entry();
+    CSeq_entry* se = const_cast<CSeq_entry*>(seq_entry.GetPointer());
+    BasicCleanupSeqEntry(*se);
 }
 
 void CNewCleanup_imp::BasicCleanupBioseqHandle (
@@ -455,6 +455,16 @@ void CNewCleanup_imp::BasicCleanupSeqFeatHandle (
     edit_handle.Replace( *new_seq_feat );
 }
 
+
+void CNewCleanup_imp::BasicCleanup(CPubdesc& pd, bool strip_serial)
+{
+    bool was_strip_serial = m_StripSerial;
+    m_StripSerial = strip_serial;
+    PubdescBC(pd);
+    m_StripSerial = was_strip_serial;
+}
+
+
 // Implementation methods
 
 void CNewCleanup_imp::SetGeneticCode (
@@ -464,82 +474,11 @@ void CNewCleanup_imp::SetGeneticCode (
 {
     if ( ! m_SyncGenCodes ) return;
 
-    if ( ! bs.IsNa() ) return;
-
-    int bioseqGenCode = 0;
-
-    CConstRef<CSeqdesc> closest_biosource = bs.GetClosestDescriptor(CSeqdesc::e_Source);
-    if (! closest_biosource) return;
-
-    const CBioSource & bsrc = closest_biosource->GetSource();
-    
-    // use "genome" to determine if we're a plastid or what
-    CBioSource::EGenome eGenome = ( bsrc.IsSetGenome() ?
-        static_cast<CBioSource::EGenome>(bsrc.GetGenome()) : 
-        CBioSource::eGenome_unknown );
-
-    switch( eGenome )
-    {
-    case CBioSource::eGenome_chloroplast:
-    case CBioSource::eGenome_chromoplast:
-    case CBioSource::eGenome_plastid:
-    case CBioSource::eGenome_cyanelle:
-    case CBioSource::eGenome_apicoplast:
-    case CBioSource::eGenome_leucoplast:
-    case CBioSource::eGenome_proplastid:
-    case CBioSource::eGenome_chromatophore: {
-        // plastid
-        const int iPlastidCode = (
-            FIELD_CHAIN_OF_2_IS_SET(bsrc, Org, Pgcode) ?
-            bsrc.GetOrg().GetPgcode() : 0 );
-        bioseqGenCode = ( iPlastidCode > 0 ? iPlastidCode : 11 );
-        break;
-    }
-    case CBioSource::eGenome_kinetoplast:
-    case CBioSource::eGenome_mitochondrion:
-    case CBioSource::eGenome_hydrogenosome:
-        bioseqGenCode = ( 
-                FIELD_CHAIN_OF_2_IS_SET(bsrc, Org, Mgcode) ?
-                bsrc.GetOrg().GetMgcode() : 0 );
-        break;
-    default:
-        // usually we want the nuc code
-        bioseqGenCode = ( 
-                FIELD_CHAIN_OF_2_IS_SET(bsrc, Org, Gcode) ?
-                bsrc.GetOrg().GetGcode() : 0 );
-        break;
-    }
-
-    if ( bioseqGenCode == 0 ) return;
-
-    // set Cdregion's gcode from BioSource (unless except-text)
-
     CBioseq_Handle bsh = m_Scope->GetBioseqHandle(bs);
-    if ( ! bsh ) return;
-    SAnnotSelector sel( CSeqFeatData::e_Cdregion );
-    CFeat_CI feat_ci( bsh, sel );
-    for( ; feat_ci ; ++feat_ci ) {
-        const CSeq_feat& feat = feat_ci->GetOriginalFeature();
-        const CCdregion& cds = feat.GetData().GetCdregion();
-        int cdregionGenCode = ( cds.IsSetCode() ?
-            cds.GetCode().GetId() :
-            0 );
-        if( cdregionGenCode != bioseqGenCode )
-        {
-            // make cdregion's gencode match bioseq's gencode,
-            // if allowed
-            if( ! feat.HasExceptionText("genetic code exception") )
-            {
-                CRef<CSeq_feat> new_feat(new CSeq_feat);
-                new_feat->Assign(feat);
-                CCdregion& new_cds = new_feat->SetData().SetCdregion();
-                new_cds.ResetCode();
-                new_cds.SetCode().SetId(bioseqGenCode);
-                CSeq_feat_EditHandle edit_handle(*feat_ci);
-                edit_handle.Replace(*new_feat);
-                ChangeMade(CCleanupChange::eChangeGeneticCode);
-            }
-        }
+    if (!bsh) return;
+
+    if (CCleanup::SetGeneticCodes(bsh)) {
+        ChangeMade(CCleanupChange::eChangeGeneticCode);
     }
 }
 
@@ -555,13 +494,16 @@ void CNewCleanup_imp::EnteringEntry (
 )
 
 {
+#if 0
     SSeqEntryInfo seqEntryInfo;
     if( ! m_SeqEntryInfoStack.empty() ) {
         // inherit from parent by default
         seqEntryInfo = m_SeqEntryInfoStack.top();
+    } else {
+        seqEntryInfo.m_IsEmblOrDdbj = false;
+        seqEntryInfo.m_StripSerial = true;
     }
-    seqEntryInfo.m_IsEmblOrDdbj = false;
-    seqEntryInfo.m_StripSerial = true;
+#endif
 
     // for cleanup Seq-entry and Seq-submit, set scope and parentize.
     // We use exceptions for AddTopLevelSeqEntry because we need to detect
@@ -570,9 +512,11 @@ void CNewCleanup_imp::EnteringEntry (
          CSeq_entry_Handle seh =
              m_Scope->GetSeq_entryHandle(se, CScope::eMissing_Null);
          if (seh) {
+#if 0
              // all code paths in this function must result
              // in m_SeqEntryInfoStack getting a "push"
              m_SeqEntryInfoStack.push( m_SeqEntryInfoStack.top() );
+#endif
              return;
          }
 
@@ -580,6 +524,7 @@ void CNewCleanup_imp::EnteringEntry (
          se.Parentize();
      }}
 
+#if 0
     // a few differences based on sequence identifier type
     // (some values are reset here because they shouldn't inherit
     // from higher seq-entry's)
@@ -629,6 +574,7 @@ void CNewCleanup_imp::EnteringEntry (
     }
 
     m_SeqEntryInfoStack.push(seqEntryInfo);
+#endif
 }
 
 void CNewCleanup_imp::LeavingEntry (
@@ -636,7 +582,9 @@ void CNewCleanup_imp::LeavingEntry (
 )
 
 {
+#if 0
     m_SeqEntryInfoStack.pop();
+#endif
 }
 
 // Strips all spaces in string in following manner. If the function
@@ -783,7 +731,7 @@ void CNewCleanup_imp::SeqsetBC (
 
 static CMolInfo::TCompleteness GetCompletenessFromFlags(bool partial5, bool partial3, bool partial)
 {
-    CMolInfo::TCompleteness comp = CMolInfo::eCompleteness_unknown;
+    CMolInfo::TCompleteness comp = CMolInfo::eCompleteness_complete;
     if (partial5 && partial3) {
         comp = CMolInfo::eCompleteness_no_ends;
     } else if (partial5) {
@@ -805,6 +753,11 @@ void CNewCleanup_imp::ProtSeqBC (CBioseq& bs)
         return;
     }
 
+    if (bs.GetInst().IsSetTopology() && bs.GetInst().GetTopology() == CSeq_inst::eTopology_linear) {
+        bs.SetInst().ResetTopology();
+        ChangeMade(CCleanupChange::eChangeBioseqInst);
+    }
+
     // Bail if no GIBBSQ ID
     if (!bs.IsSetId()) {
         return;
@@ -860,7 +813,7 @@ void CNewCleanup_imp::ProtSeqBC (CBioseq& bs)
             edit_feature_handle.Replace(*replace);
             ChangeMade(CCleanupChange::eChangeSeqloc);
 
-            if (bs.IsSetDescr()) {
+            if (bs.IsSetDescr() && (make_partial5 || make_partial3)) {
                 CMolInfo::TCompleteness wanted = GetCompletenessFromFlags(make_partial5, make_partial3, true);
                 NON_CONST_ITERATE(CBioseq::TDescr::Tdata, ds, bs.SetDescr().Set()) {
                     if ((*ds)->IsMolinfo() &&
@@ -1166,7 +1119,7 @@ void CNewCleanup_imp::GBblockBC (
         }
     }
 
-    if( m_SeqEntryInfoStack.top().m_IsEmblOrDdbj ) {
+    if( m_IsEmblOrDdbj ) {
         UNIQUE_WITHOUT_SORT_KEYWORD_ON_GENBANKBLOCK( gbk, PCase );
     } else {
         UNIQUE_WITHOUT_SORT_KEYWORD_ON_GENBANKBLOCK( gbk, PNocase );
@@ -1271,7 +1224,7 @@ bool s_StringHasOrgModPrefix(const string &str, string::size_type &out_val_start
         &&  (pos2 = str.find_first_not_of(": =", pos)) != NPOS) {
         try {
             string val = str.substr(0, pos);
-            COrgMod::TSubtype subtype = COrgMod::GetSubtypeValue(val);
+            COrgMod::TSubtype subtype = COrgMod::GetSubtypeValue(val, COrgMod::eVocabulary_insdc);
             if ( !COrgMod::IsDiscouraged(subtype) ) {
                 out_subtype       = subtype;
                 out_val_start_pos = pos2;
@@ -1296,7 +1249,7 @@ bool s_StringHasSubSourcePrefix(const string &str, string::size_type &out_val_st
             if (NStr::EqualNocase(val, "Lat-long") || NStr::EqualNocase(val, "Latitude-Longitude")) {
                 subtype = CSubSource::eSubtype_lat_lon;
             } else {
-                subtype = CSubSource::GetSubtypeValue(val);
+                subtype = CSubSource::GetSubtypeValue(val, CSubSource::eVocabulary_insdc);
             }
             if ( subtype == CSubSource::eSubtype_fwd_primer_name ||
                  subtype == CSubSource::eSubtype_fwd_primer_seq ||
@@ -1544,6 +1497,67 @@ static void s_CorrectTildes (
 #endif //NCBI_OS_MSWIN
 }
 
+
+bool s_SameSubtype(const CSubSource& s1, const CSubSource& s2)
+{
+    if (!s1.IsSetSubtype() && !s2.IsSetSubtype()) {
+        return true;
+    } else if (!s1.IsSetSubtype() || !s2.IsSetSubtype()) {
+        return false;
+    } else {
+        return s1.GetSubtype() == s2.GetSubtype();
+    }
+}
+
+
+// close enough if second name contains the first
+bool s_NameCloseEnough(const CSubSource& s1, const CSubSource& s2)
+{
+    if (!s1.IsSetName() && !s2.IsSetName()) {
+        return true;
+    } else if (!s1.IsSetName() || !s2.IsSetName()) {
+        return false;
+    }
+    const string& n1 = s1.GetName();
+    const string& n2 = s2.GetName();
+
+    if (NStr::Equal(n1, n2)) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+void CNewCleanup_imp::SubSourceListBC(CBioSource& biosrc)
+{
+    if (!biosrc.IsSetSubtype()) {
+        return;
+    }
+
+    // sort and remove duplicates.
+    if (biosrc.IsSetSubtype() && biosrc.GetSubtype().size() > 1) {
+        if (!SUBSOURCE_ON_BIOSOURCE_IS_SORTED(biosrc, s_SubsourceCompare)) {
+            SORT_SUBSOURCE_ON_BIOSOURCE(biosrc, s_SubsourceCompare);
+            ChangeMade(CCleanupChange::eCleanSubsource);
+        }
+
+        // remove duplicates and subsources that contain previous values
+        CBioSource::TSubtype::iterator s = biosrc.SetSubtype().begin();
+        CBioSource::TSubtype::iterator s_next = s;
+        ++s_next;
+        while (s_next != biosrc.SetSubtype().end()) {
+            if (s_SameSubtype(**s, **s_next) && s_NameCloseEnough(**s, **s_next)) {
+                s = biosrc.SetSubtype().erase(s);
+                ChangeMade(CCleanupChange::eCleanSubsource);
+            } else {
+                ++s;
+            }
+            ++s_next;
+        }
+    }
+}
+
 void CNewCleanup_imp::BiosourceBC (
     CBioSource& biosrc
 )
@@ -1693,15 +1707,7 @@ void CNewCleanup_imp::BiosourceBC (
     }
 
     // sort and remove duplicates.
-    if (! SUBSOURCE_ON_BIOSOURCE_IS_SORTED (biosrc, s_SubsourceCompare)) {
-        SORT_SUBSOURCE_ON_BIOSOURCE (biosrc, s_SubsourceCompare);
-        ChangeMade (CCleanupChange::eCleanSubsource);
-    }
-
-    if (! SUBSOURCE_ON_BIOSOURCE_IS_UNIQUE (biosrc, s_SubsourceEqual)) {
-        UNIQUE_SUBSOURCE_ON_BIOSOURCE (biosrc, s_SubsourceEqual);
-        ChangeMade (CCleanupChange::eCleanSubsource);
-    }
+    SubSourceListBC(biosrc);
 
     // PCR Primers
     if( FIELD_IS_SET(biosrc, Pcr_primers) ) {
@@ -1740,6 +1746,17 @@ void CNewCleanup_imp::BiosourceBC (
         string &name = GET_MUTABLE(subsrc, Name);
         s_CorrectTildes(name);
     }
+
+    if (biosrc.IsSetOrg()) {
+        if (biosrc.GetOrg().IsSetOrgname()) {
+            OrgnameBC(biosrc.SetOrg().SetOrgname(), biosrc.SetOrg());
+        }
+    }
+
+    x_PostBiosource(biosrc);
+    if (biosrc.IsSetOrg()) {
+        x_PostOrgRef(biosrc.SetOrg());
+    }
 }
 
 void CNewCleanup_imp::x_PostBiosource( CBioSource& biosrc )
@@ -1974,6 +1991,7 @@ void CNewCleanup_imp::x_PostOrgRef( COrg_ref& org )
         UNIQUE_SYN_ON_ORGREF (org, s_OrgrefSynEqual);
         ChangeMade (CCleanupChange::eCleanOrgref);
     }
+
 }
 
 // is om1 < om2
@@ -2008,7 +2026,12 @@ static bool s_OrgModCompare (
     const string& attrib1 = ( FIELD_IS_SET(omd1, Attrib) ? GET_FIELD (omd1, Attrib) : kEmptyStr );
     const string& attrib2 = ( FIELD_IS_SET(omd2, Attrib) ? GET_FIELD (omd2, Attrib) : kEmptyStr );
 
-    return NStr::CompareNocase( attrib1, attrib2 ) < 0;
+    const int attrib_comparison = NStr::CompareNocase( attrib1, attrib2 );
+    if (attrib_comparison < 0) {
+        return true;
+    } else {
+        return false;
+    }
 }
 
 // Two OrgMod's are equal and duplicates if:
@@ -2429,13 +2452,19 @@ void CNewCleanup_imp::PubEquivBC (CPub_equiv& pub_equiv)
         }
         if( pub.IsArticle() ) {
             last_article.Reset( &pub.SetArticle());
-            if( FIELD_IS_SET_AND_IS(*last_article, From, Journal) && 
-                FIELD_IS_SET(*last_article, Ids) ) 
-            {
-                FOR_EACH_ARTICLEID_ON_CITART( id_iter, *last_article ) {
-                    const CArticleId &article_id = **id_iter;
-                    if( article_id.IsPubmed() ) {
-                        last_article_pubmed_id = article_id.GetPubmed().Get();
+            if (last_article->IsSetIds()) {
+                CArticleIdSet::Tdata::iterator id_it = last_article->SetIds().Set().begin();
+                while (id_it != last_article->SetIds().Set().end()) {
+                    if ((*id_it)->IsPubmed() && last_article_pubmed_id != 0 &&
+                        last_article_pubmed_id == (*id_it)->GetPubmed()) {
+                        // erase duplicate
+                        id_it = last_article->SetIds().Set().erase(id_it);
+                        ChangeMade(CCleanupChange::eChangePublication);
+                    } else {
+                        if ((*id_it)->IsPubmed()) {
+                            last_article_pubmed_id = (*id_it)->GetPubmed();
+                        }
+                        ++id_it;
                     }
                 }
             }
@@ -2449,26 +2478,12 @@ void CNewCleanup_imp::PubEquivBC (CPub_equiv& pub_equiv)
         pub_equiv.Set().push_back( new_pub );
         ChangeMade(CCleanupChange::eChangePublication);
     } else if (last_pmid > 0 && last_article_pubmed_id == 0 && last_article ) {
-        CRef<CArticleId> new_article_id( new CArticleId );
-        new_article_id->SetPubmed().Set( last_pmid );
-        last_article->SetIds().Set().push_back( new_article_id );
+        CRef<CArticleId> new_article_id(new CArticleId);
+        new_article_id->SetPubmed().Set(last_pmid);
+        last_article->SetIds().Set().push_back(new_article_id);
         ChangeMade(CCleanupChange::eChangePublication);
     }
 
-    /*
-    last_article_pubmed_id = 0;
-    int article_pubmed_id = 0;
-    EDIT_EACH_ARTICLEID_ON_CITART( id_iter, *last_article ) {
-        const CArticleId &article_id = **id_iter;
-        if( article_id.IsPubmed() ) {
-            article_pubmed_id = article_id.GetPubmed().Get();
-            if (last_article_pubmed_id > 0 && last_article_pubmed_id == article_pubmed_id) {
-                ERASE_ARTICLEID_ON_CITART( id_iter, *last_article );
-            }
-            last_article_pubmed_id = article_pubmed_id;
-        }
-    }
-    */
 }
 
 CNewCleanup_imp::EAction CNewCleanup_imp::PubBC(CPub& pub, bool fix_initials)
@@ -2566,7 +2581,7 @@ CNewCleanup_imp::EAction CNewCleanup_imp::CitGenBC(CCit_gen& cg, bool fix_initia
         x_StripSpacesMarkChanged( GET_MUTABLE(cg, Title) );
     }
 
-    if( m_SeqEntryInfoStack.top().m_StripSerial ) {
+    if( m_StripSerial && cg.IsSetSerial_number() ) {
         RESET_FIELD( cg, Serial_number );
         ChangeMade(CCleanupChange::eStripSerial);
     }
@@ -3032,7 +3047,7 @@ void CNewCleanup_imp::ImpFeatBC( CSeq_feat& feat )
         } else if ( key == "misc_bind" ) {
             SET_FIELD(imf, Key, "misc_binding");
             ChangeMade(CCleanupChange::eChangeKeywords);
-        } else if ( key == "satellite" && ! m_SeqEntryInfoStack.top().m_IsEmblOrDdbj ) {
+        } else if ( key == "satellite" && ! m_IsEmblOrDdbj ) {
             SET_FIELD(imf, Key, "repeat_region");
             ChangeMade(CCleanupChange::eChangeKeywords);
 
@@ -3048,6 +3063,15 @@ void CNewCleanup_imp::ImpFeatBC( CSeq_feat& feat )
             satellite_qual->SetVal( val );
 
             feat.SetQual().push_back( satellite_qual );
+        } else if ( key == "LTR" ) {
+            SET_FIELD(imf, Key, "repeat_region");
+            ChangeMade(CCleanupChange::eChangeKeywords);
+
+            CRef<CGb_qual> rpt_type_qual( new CGb_qual );
+            rpt_type_qual->SetQual( "rpt_type" );
+            rpt_type_qual->SetVal( "long_terminal_repeat" );
+
+            feat.SetQual().push_back( rpt_type_qual );
         }
 
         CSeqFeatData::ESubtype subtype = feat.GetData().GetSubtype();
@@ -3065,7 +3089,7 @@ void CNewCleanup_imp::ImpFeatBC( CSeq_feat& feat )
             feat.SetQual().push_back( regulatory_class_qual );
         }
 
-        if( key == "repeat_region" && ! m_SeqEntryInfoStack.top().m_IsEmblOrDdbj ) {
+        if( key == "repeat_region" && ! m_IsEmblOrDdbj ) {
             string val;
             if( FIELD_IS_SET(feat, Comment) ) {
                 val = x_ExtractSatelliteFromComment( GET_MUTABLE(feat, Comment) );
@@ -3081,16 +3105,18 @@ void CNewCleanup_imp::ImpFeatBC( CSeq_feat& feat )
         }
 
         if( key == "CDS" ) {
-            if( ! m_SeqEntryInfoStack.top().m_IsEmblOrDdbj ) {
+            if( ! m_IsEmblOrDdbj ) {
                 CRef<CCdregion> new_cdregion( new CCdregion );
                 // get frame from location
-                if( ! FIELD_EQUALS( feat, Pseudo, true ) && FIELD_IS_SET(feat, Location) ) {
-                    x_SetFrameFromLoc( *new_cdregion, GET_FIELD(feat, Location) );
+                if( ! FIELD_EQUALS( feat, Pseudo, true ) &&
+                    feat.IsSetLocation() &&
+                    CCleanup::SetFrameFromLoc(*new_cdregion, feat.GetLocation(), *m_Scope)) {
+                    ChangeMade(CCleanupChange::eChangeCdregion);
                 }
-                feat.SetData().SetCdregion( *new_cdregion );
                 ChangeMade(CCleanupChange::eChangeKeywords);
 
                 CdregionFeatBC( *new_cdregion, feat );
+                feat.SetData().SetCdregion(*new_cdregion);
                 return;
             }
         }
@@ -3494,12 +3520,20 @@ void CNewCleanup_imp::GBQualBC (
     _ASSERT (FIELD_IS_SET (gbq, Qual) && FIELD_IS_SET (gbq, Val));
 
     if (NStr::EqualNocase(gbq.GetQual(), "rpt_unit_seq")) {
-        if (CGb_qual::CleanupRptUnitSeq(gbq.SetVal())) {
+        if (x_IsBaseRange(gbq.GetVal())) {
+            gbq.SetQual("rpt_unit_range");
+            CGb_qual::CleanupRptUnitRange(gbq.SetVal());
+            ChangeMade(CCleanupChange::eChangeQualifiers);
+        } else if (CGb_qual::CleanupRptUnitSeq(gbq.SetVal())) {
             ChangeMade(CCleanupChange::eChangeQualifiers);
         }
         x_CleanupRptUnit(gbq);
     } else if (NStr::EqualNocase(gbq.GetQual(), "rpt_unit_range")) {
-        if (CGb_qual::CleanupRptUnitRange(gbq.SetVal())) {
+        if (! x_IsBaseRange(gbq.GetVal())) {
+            gbq.SetQual("rpt_unit_seq");
+            CGb_qual::CleanupRptUnitSeq(gbq.SetVal());
+            ChangeMade(CCleanupChange::eChangeQualifiers);
+        } else if (CGb_qual::CleanupRptUnitRange(gbq.SetVal())) {
             ChangeMade(CCleanupChange::eChangeQualifiers);
         }
     } else if (NStr::EqualNocase(gbq.GetQual(), "rpt_unit")) {
@@ -3929,18 +3963,34 @@ void CNewCleanup_imp::x_CleanupConsSplice(CGb_qual& gbq)
 }
 
 
-bool CNewCleanup_imp::x_IsBaseRange(const string& val)
+bool CNewCleanup_imp::x_IsDotBaseRange(const string& val)
 {
-    if (val.length() > 25) {
+    size_t pos = NStr::Find(val, "..");
+    if (string::npos == pos) {
+        return false;
+    }
+    try {
+        long start = NStr::StringToLong(val.substr(0, pos));
+        long stop = NStr::StringToLong(val.substr(pos + 2));
+        if (start < 1 || stop < 1) {
+            return false;
+        }
+    } catch (...) {
         return false;
     }
-    size_t pos = NStr::Find (val, "..");
+    return true;
+}
+
+
+bool CNewCleanup_imp::x_IsHyphenBaseRange(const string& val)
+{
+    size_t pos = NStr::Find(val, "-");
     if (string::npos == pos) {
         return false;
     }
     try {
         long start = NStr::StringToLong(val.substr(0, pos));
-        long stop = NStr::StringToLong(val.substr(pos + 2));
+        long stop = NStr::StringToLong(val.substr(pos + 1));
         if (start < 1 || stop < 1) {
             return false;
         }
@@ -3951,11 +4001,29 @@ bool CNewCleanup_imp::x_IsBaseRange(const string& val)
 }
 
 
+bool CNewCleanup_imp::x_IsBaseRange(const string& val)
+{
+    if (val.length() > 25) {
+        return false;
+    }
+    if (x_IsDotBaseRange(val)) {
+        return true;
+    } else if (x_IsHyphenBaseRange(val)) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
 bool CNewCleanup_imp::x_CleanupRptUnit(CGb_qual& gbq)
 {
     CGb_qual::CleanupRptUnitRange(gbq.SetVal());
     if (x_IsBaseRange(gbq.GetVal())) {
         gbq.SetQual("rpt_unit_range");
+        if (x_IsHyphenBaseRange(gbq.GetVal())) {
+            NStr::ReplaceInPlace(gbq.SetVal(), "-", "..");
+        }
     } else {
         gbq.SetQual("rpt_unit_seq");
         CGb_qual::CleanupRptUnitSeq(gbq.SetVal());
@@ -4552,51 +4620,6 @@ void s_TokenizeTRnaString (const string &tRNA_string, list<string> &out_string_l
     }
 }
 
-static const char *codonLetterExpand [] =
-{
-  "?", "A", "C", "AC",
-  "G", "AG", "CG", "ACG",
-  "T", "AT", "CT", "ACT",
-  "GT", "AGT", "CGT", "ACGT",
-  NULL
-};
-
-static
-bool s_ParseDegenerateCodon( CTrna_ext & tRNA, string & codon )
-{
-  const static string intToChr = "?ACMGRSVTWYHKDBN";
-
-  if( codon.length() < 3 ) {
-      return false;
-  }
-
-  // the first two have to be real nucleotides
-  const string::size_type first_bad_char = codon.find_first_not_of("ACGT");
-  if( first_bad_char != string::npos && first_bad_char < 2 ) {
-      return false;
-  }
-
-  int idx = intToChr.find( codon [2] );
-  if (idx == (int)string::npos ) return false;
-
-  const char *expanded_codon_letter = codonLetterExpand [idx];
-  const char *iter = expanded_codon_letter;
-  char ch = *iter;
-  int tRNA_codon_idx = 0;
-  codon.erase(3);
-  tRNA.SetCodon().clear();
-  while ( *iter != '\0' && tRNA_codon_idx < 6 ) {
-    codon [2] = ch;
-    tRNA.SetCodon().push_back( CGen_code_table::CodonToIndex(codon) ); // TODO: make sure Seq_code_iupacna
-
-    // prepare for next iteration
-    iter++;
-    ch = *iter;
-    tRNA_codon_idx++;
-  }
-
-  return true;
-}
 
 // based on C's ParseTRnaString
 static 
@@ -4616,7 +4639,6 @@ char s_ParseSeqFeatTRnaString( const string &comment, bool *out_justTrnaText, st
     s_TokenizeTRnaString (comment, head);
     bool justt = true;
     list<string>::const_iterator head_iter = head.begin();
-    bool is_A = false;
     bool is_ambig = false;
     for( ; head_iter != head.end(); ++head_iter ) {
         const string &str = *head_iter;
@@ -4627,9 +4649,7 @@ char s_ParseSeqFeatTRnaString( const string &comment, bool *out_justTrnaText, st
         } else {
             curraa = s_FindTrnaAA (str);
         }
-        if( curraa == 'A' && str.length() == 1 ) {
-            is_A = true;
-        } else if (curraa != '\0') {
+        if(curraa != '\0') {
             if (aa == '\0') {
                 aa = curraa;
             } else if( curraa != aa) {
@@ -4640,24 +4660,9 @@ char s_ParseSeqFeatTRnaString( const string &comment, bool *out_justTrnaText, st
             ! NStr::EqualNocase ("RNA", str) &&
             ! NStr::EqualNocase ("product", str) ) 
         {
-            if ( str.length() == 3) {
-                tRNA_codon = str;
-                NStr::ReplaceInPlace( tRNA_codon, "U", "T" );
-                if (s_ParseDegenerateCodon ( *tr, tRNA_codon)) {
-                    tRNA_codon.clear();
-                    copy( tr->GetCodon().begin(), tr->GetCodon().end(), back_inserter(tRNA_codon) );
-                    justt = false;
-                } else {
-                    justt = false;
-                }
-            } else {
-                justt = false;
-            }
+            justt = false;
         }
     }
-    if( is_A && aa == 0 ) {
-        aa = 'A';
-    }
     if( is_ambig ) {
         aa = 0;
     }
@@ -4735,7 +4740,8 @@ CNewCleanup_imp::x_HandleTrnaProductGBQual(CSeq_feat& feat, CRNA_ref& rna, const
             }
 
             if (aa == 'M') {
-                if (NStr::Find(product, "fMet") != NPOS) {
+                if (NStr::Find(product, "fMet") != NPOS &&
+                    (!feat.IsSetComment() || NStr::Find(feat.GetComment(), "fMet") == NPOS)) {
                     x_AddToComment(feat, "fMet");
                 }
             }
@@ -4750,12 +4756,15 @@ CNewCleanup_imp::x_HandleTrnaProductGBQual(CSeq_feat& feat, CRNA_ref& rna, const
     if (rna_type == NCBI_RNAREF(tRNA) && rna.IsSetExt() && rna.GetExt().IsTRNA()) {
         CRNA_ref_Base::C_Ext::TTRNA& trp = rna.SetExt().SetTRNA();
         if (trp.IsSetAa() && trp.GetAa().IsNcbieaa()) {
-            string ignored;
+            string ignored = kEmptyStr;
             if (trp.GetAa().GetNcbieaa() == s_ParseSeqFeatTRnaString(product, NULL, ignored, false) &&
                 NStr::IsBlank(ignored)) {
             } else {
                 x_AddToComment(feat, product);
             }
+            if (NStr::CompareNocase (product, "tRNA-fMet") == 0 || NStr::CompareNocase (product, "iRNA-fMet") == 0) {
+                return eAction_Nothing;
+            }
             return eAction_Erase;
         }
     }
@@ -4865,7 +4874,18 @@ CNewCleanup_imp::x_SeqFeatRnaGBQualBC(CSeq_feat& feat, CRNA_ref& rna, CGb_qual&
             return eAction_Erase;
         }
 
-        if( FIELD_IS_SET_AND_IS(rna, Ext, Gen) ) {
+        if (!rna.IsSetExt()) {
+            string remainder;
+            rna.SetRnaProductName(gb_qual_val, remainder);
+            ChangeMade(CCleanupChange::eChangeRNAref);
+            if (NStr::IsBlank(remainder)) {
+                return eAction_Erase;
+            } else {
+                gb_qual.SetQual(remainder);
+                return eAction_Nothing;
+            }
+        }
+        if( rna.GetExt().IsGen() ) {
             CRNA_gen & rna_gen = rna.SetExt().SetGen();
             if( RAW_FIELD_IS_EMPTY_OR_UNSET(rna_gen, Product) ) {
                 rna_gen.SetProduct(gb_qual_val);
@@ -4874,6 +4894,9 @@ CNewCleanup_imp::x_SeqFeatRnaGBQualBC(CSeq_feat& feat, CRNA_ref& rna, CGb_qual&
             }
             return eAction_Nothing;
         }
+        if (rna.GetExt().IsName() && NStr::Equal(rna.GetExt().GetName(), gb_qual_val)) {
+            return eAction_Erase;
+        }
         if ( rna.IsSetExt() && ! rna.GetExt().IsName() ) return eAction_Nothing;
         const string &name = ( rna.IsSetExt() ? rna.GetExt().GetName() : kEmptyStr );
         if (! name.empty() ) {
@@ -5048,7 +5071,7 @@ CNewCleanup_imp::EAction CNewCleanup_imp::x_ParseCodeBreak(const CSeq_feat& feat
     }
 
     break_loc = ReadLocFromText (pos, feat_loc_seq_id, m_Scope);
-    if( FIELD_IS_SET(feat.GetLocation(), Strand) && GET_FIELD(feat.GetLocation(), Strand) != eNa_strand_unknown ) {
+    if( FIELD_IS_SET(feat.GetLocation(), Strand) && GET_FIELD(feat.GetLocation(), Strand) == eNa_strand_minus ) {
         break_loc->SetStrand( GET_FIELD( feat.GetLocation(), Strand) );
     } else {
         RESET_FIELD( *break_loc, Strand );
@@ -5102,7 +5125,8 @@ CNewCleanup_imp::x_ProtGBQualBC(CProt_ref& prot, const CGb_qual& gb_qual, EGBQua
 
     // labels to leave alone
     static const char * const ignored_quals[] = 
-        { "label", "allele", "experiment", "inference", "UniProtKB_evidence" };
+        { "label", "allele", "experiment", "inference", "UniProtKB_evidence",
+          "dbxref", "replace", "rpt_unit_seq", "rpt_unit_range"};
     static set<string, PNocase> ignored_quals_raw; 
 
     // the mutex is just there in the unlikely event that two separate
@@ -5129,12 +5153,17 @@ CNewCleanup_imp::x_ProtGBQualBC(CProt_ref& prot, const CGb_qual& gb_qual, EGBQua
 void CNewCleanup_imp::BioSourceEC(CBioSource& biosrc)
 {
     x_AddEnvSamplOrMetagenomic(biosrc);
+    if (biosrc.IsSetOrg()) {
+        x_CleanupOldName(biosrc.SetOrg());
+        x_CleanupOrgModNoteEC(biosrc.SetOrg());
+    }
 }
 
 
 void CNewCleanup_imp::x_AddEnvSamplOrMetagenomic(CBioSource& biosrc)
 {
     // add environmental_sample or metagenomic based on lineage or div
+
     if ( biosrc.IsSetOrg() && biosrc.GetOrg().IsSetOrgname()) {
         bool needs_env_sample = false;
         bool needs_metagenomic = false;
@@ -5182,6 +5211,74 @@ void CNewCleanup_imp::x_AddEnvSamplOrMetagenomic(CBioSource& biosrc)
 }
 
 
+void CNewCleanup_imp::x_CleanupOldName(COrg_ref& org)
+{
+    if (org.IsSetTaxname() && org.IsSetOrgname() && org.GetOrgname().IsSetMod()) {
+        COrgName::TMod::iterator it = org.SetOrgname().SetMod().begin();
+        while (it != org.SetOrgname().SetMod().end()) {
+            if ((*it)->IsSetSubtype() &&
+                (*it)->GetSubtype() == COrgMod::eSubtype_old_name &&
+                (*it)->IsSetSubname() &&
+                NStr::Equal((*it)->GetSubname(), org.GetTaxname()) &&
+                (!(*it)->IsSetAttrib() || NStr::IsBlank((*it)->GetAttrib()))) {
+                it = org.SetOrgname().SetMod().erase(it);
+                ChangeMade(CCleanupChange::eRemoveOrgmod);
+            } else {
+                ++it;
+            }            
+        }
+        if (org.GetOrgname().GetMod().empty()) {
+            org.SetOrgname().ResetMod();
+
+        }
+    }
+}
+
+
+bool s_HasMatchingGBMod(const COrgName& org, const string& val)
+{
+    if (!org.IsSetMod()) {
+        return false;
+    }
+    ITERATE(COrgName::TMod, it, org.GetMod()) {
+        if ((*it)->IsSetSubtype() &&
+            ((*it)->GetSubtype() == COrgMod::eSubtype_gb_acronym ||
+            (*it)->GetSubtype() == COrgMod::eSubtype_gb_anamorph ||
+            (*it)->GetSubtype() == COrgMod::eSubtype_gb_synonym) &&
+            (*it)->IsSetSubname() &&
+            NStr::Equal((*it)->GetSubname(), val)) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
+void CNewCleanup_imp::x_CleanupOrgModNoteEC(COrg_ref& org)
+{
+    if (!org.IsSetOrgname() || !org.GetOrgname().IsSetMod()) {
+        return;
+    }
+    COrgName::TMod::iterator it = org.SetOrgname().SetMod().begin();
+    while (it != org.SetOrgname().SetMod().end()) {
+        if ((*it)->IsSetSubtype() && 
+            (*it)->GetSubtype() == COrgMod::eSubtype_other &&
+            (*it)->IsSetSubname() &&
+            (s_HasMatchingGBMod(org.GetOrgname(), (*it)->GetSubname()) ||
+             org.IsSetTaxname() && NStr::Equal(org.GetTaxname(), (*it)->GetSubname()))) {
+            ChangeMade(CCleanupChange::eRemoveOrgmod);
+            it = org.SetOrgname().SetMod().erase(it);
+        } else {
+            ++it;
+        }
+    }
+    if (org.GetOrgname().GetMod().empty()) {
+        org.SetOrgname().ResetMod();
+        ChangeMade(CCleanupChange::eRemoveOrgmod);
+    }
+}
+
+
 void CNewCleanup_imp::x_FlattenPubEquiv(CPub_equiv& pub_equiv)
 {
     CPub_equiv::Tdata& data = pub_equiv.Set();
@@ -5477,6 +5574,10 @@ void CNewCleanup_imp::x_NameStdBC ( CName_std& name, bool fix_initials )
     CLEAN_STRING_MEMBER(name, Middle);
     CLEAN_STRING_MEMBER(name, Full);
     CLEAN_STRING_MEMBER(name, Initials);
+    if (name.IsSetSuffix() && CleanVisString(name.SetSuffix())) {
+            ChangeMade(CCleanupChange::eTrimSpaces);
+    }
+
     CLEAN_STRING_MEMBER(name, Suffix);
     CLEAN_STRING_MEMBER(name, Title);
     x_FixEtAl( name );
@@ -5678,7 +5779,7 @@ void CNewCleanup_imp::x_SplitDbtag( CDbtag &dbt, vector< CRef< CDbtag > > & out_
         }
     }
 
-    if ( m_SeqEntryInfoStack.top().m_IsEmblOrDdbj) {
+    if ( m_IsEmblOrDdbj) {
         return;
     }
 
@@ -5759,54 +5860,6 @@ void CNewCleanup_imp::x_SeqFeatTRNABC( CSeq_feat& feat, CTrna_ext & tRNA )
         ChangeMade(CCleanupChange::eChange_tRna);
     }
 
-    if ( FIELD_IS_SET(feat, Comment) ) {
-        char aa = '\0';
-        char new_aa = '\0';
-        if( tRNA.IsSetAa() ) {
-            aa = s_ConvertTrnaAaToLetter( tRNA.GetAa(), CSeqUtil::e_Ncbieaa );
-        }
-        bool justTrnaText = false;
-        string tRNA_codon;
-        if (aa != 'X') {
-            new_aa = s_ParseSeqFeatTRnaString ( comment, &justTrnaText, tRNA_codon, true);
-            if (aa == '\0' && new_aa != '\0') {
-                aa = new_aa;
-                tRNA.SetAa().SetNcbieaa( new_aa );
-                ChangeMade(CCleanupChange::eChange_tRna);
-            }
-            if (aa != '\0' && aa == new_aa) {
-                if (justTrnaText) {
-                    CTrna_ext::TCodon & arg_codon = GET_MUTABLE( tRNA, Codon );
-                    if( arg_codon.size() < tRNA_codon.length() ) {
-                        copy( tRNA_codon.begin() + arg_codon.size(), tRNA_codon.end(), back_inserter(arg_codon) );
-                        ChangeMade(CCleanupChange::eChange_tRna);
-                    }
-                    if ( FIELD_IS_SET(feat, Comment) && comment != "fMet" ) {
-                        RESET_FIELD(feat, Comment);
-                        ChangeMade(CCleanupChange::eChangeComment);
-                    }
-                }
-            }
-        } else {
-            aa = s_ParseSeqFeatTRnaString ( comment, &justTrnaText, tRNA_codon, true);
-            if (aa != '\0') {
-                tRNA.SetAa().SetNcbieaa( aa );
-                ChangeMade(CCleanupChange::eChange_tRna);
-                if (justTrnaText) {
-                    CTrna_ext::TCodon & arg_codon = tRNA.SetCodon();
-                    if( arg_codon.size() < tRNA_codon.length() ) {
-                        copy( tRNA_codon.begin() + arg_codon.size(), tRNA_codon.end(), back_inserter(arg_codon) );
-                        ChangeMade(CCleanupChange::eChange_tRna);
-                    }
-                    if ( FIELD_IS_SET(feat, Comment) && comment != "fMet" ) {
-                        RESET_FIELD(feat, Comment);
-                        ChangeMade(CCleanupChange::eChangeComment);
-                    }
-                }
-            }
-        }
-    }
-
     if (! CODON_ON_TRNAEXT_IS_SORTED(tRNA, s_CodonCompare)) {
         SORT_CODON_ON_TRNAEXT(tRNA, s_CodonCompare);
         ChangeMade(CCleanupChange::eChange_tRna);
@@ -6333,13 +6386,6 @@ CNewCleanup_imp::x_OrgnameModBC( COrgName &orgname, const string &org_ref_common
 
             if( subname.empty() ) {
                 unlink = true;
-            } else if ( (prev_subtype == subtype &&
-                NStr::EqualNocase(prev_subname, subname)) ||
-                (prev_subtype == subtype &&
-                prev_subtype ==  NCBI_ORGMOD(other) &&
-                NStr::Find(prev_subname, subname) != NPOS )) 
-            {
-                unlink = true;
             } else if (prev_subtype == subtype &&
                 prev_subtype == NCBI_ORGMOD(other) &&
                 NStr::Find (subname, prev_subname) != NPOS ) 
@@ -6504,303 +6550,19 @@ void CNewCleanup_imp::x_FixUnsetMolFromBiomol( CMolInfo& molinfo, CBioseq &biose
     }
 }
 
-// return position of " [" + sOrganism + "]", but only if it's
-// at the end and there are characters before it.
-// Also, returns the position of the organelle prefix in the title.
-static SIZE_TYPE s_TitleEndsInOrganism ( 
-    const string & sTitle, 
-    const string & sOrganism,
-    SIZE_TYPE * out_piOrganellePos )
-{
-    if( out_piOrganellePos ) {
-        *out_piOrganellePos = NPOS;
-    }
-
-    SIZE_TYPE answer = NPOS;
-
-    const string sPattern = " [" + sOrganism + "]";
-    if( NStr::EndsWith(sTitle, sPattern, NStr::eNocase) ) {
-        answer = sTitle.length() - sPattern.length();
-        if( answer < 1 ) {
-            // title must have something before the pattern
-            answer = NPOS;
-        }
-    } else {
-        answer = NStr::FindNoCase(sTitle, sPattern, 0, NPOS, NStr::eLast);
-        if (answer < 1 || answer == NPOS) {
-            // pattern not found
-            answer = NPOS;
-        }
-    }
-
-    // find organelle prefix
-    static const string kOrganellePrefixes[] = {
-        " (chloroplast)",
-        " (mitochondrion)"
-    };
-    if( out_piOrganellePos ) {
-
-        static const unsigned int kOrganellePrefixes_len = 
-            (sizeof(kOrganellePrefixes)/sizeof(kOrganellePrefixes[0]));
-        for( unsigned int ii = 0; ii < kOrganellePrefixes_len; ++ii ) {
-            const string & organelle_prefix = kOrganellePrefixes[ii];
 
-            SIZE_TYPE possible_organelle_start_pos = NStr::Find (sTitle, organelle_prefix);
-            if ( possible_organelle_start_pos != NPOS &&
-                 NStr::EndsWith(CTempString(sTitle, 0, answer), organelle_prefix) ) {
-                *out_piOrganellePos = possible_organelle_start_pos;
-                break;
-            }
-        }
+void CNewCleanup_imp::x_AddPartialToProteinTitle( CBioseq &bioseq )
+{
+    if (CCleanup::AddPartialToProteinTitle(bioseq)) {
+        ChangeMade(CCleanupChange::eCleanBioseqTitle);
     }
-
-    return answer;
 }
 
-static void s_RemoveOrgFromEndOfProtein (CBioseq& seq, string taxname)
-
+// returns empty string if there's a problem
+string CNewCleanup_imp::x_ExtractSatelliteFromComment( string &comment )
 {
-    if (taxname.empty()) return;
-    SIZE_TYPE taxlen = taxname.length();
-
-    EDIT_EACH_SEQANNOT_ON_BIOSEQ (annot_it, seq) {
-        CSeq_annot& annot = **annot_it;
-        if (! annot.IsFtable()) continue;
-        EDIT_EACH_FEATURE_ON_ANNOT (feat_it, annot) {
-            CSeq_feat& feat = **feat_it;
-            CSeqFeatData& data = feat.SetData();
-            if (! data.IsProt()) continue;
-            CProt_ref& prot_ref = data.SetProt();
-            EDIT_EACH_NAME_ON_PROTREF (it, prot_ref) {
-                string str = *it;
-                if (str.empty()) continue;
-                int len = str.length();
-                if (len < 5) continue;
-                if (str [len - 1] != ']') continue;
-                SIZE_TYPE cp = NStr::Find(str, "[", 0, NPOS, NStr::eLast);
-                if (cp == NPOS) continue;
-                string suffix = str.substr(cp+1);
-                if (NStr::StartsWith(suffix, "NAD")) continue;
-                if (suffix.length() != taxlen + 1) continue;
-                if (NStr::StartsWith(suffix, taxname)) {
-                    str.erase (cp);
-                    Asn2gnbkCompressSpaces(str);
-                    *it = str;
-                }
-            }
-        }
-    }
-}
-
-void CNewCleanup_imp::x_AddPartialToProteinTitle( CBioseq &bioseq )
-{
-    // Bail if not protein
-    if( ! FIELD_CHAIN_OF_2_IS_SET(bioseq, Inst, Mol) || 
-        bioseq.GetInst().GetMol() != NCBI_SEQMOL(aa) ) 
-    {
-        return;
-    }
- 
-    // Bail if record is swissprot
-    FOR_EACH_SEQID_ON_BIOSEQ (seqid_itr, bioseq) {
-        const CSeq_id& seqid = **seqid_itr;
-        if( FIELD_IS(seqid, Swissprot) ) {
-            return;
-        }
-    }
-
-    static const char *kProteinOrganellePrefixes[] = {
-        NULL, // unknown
-        NULL, // genomic
-        "chloroplast", // chloroplast
-        NULL, // chromoplast
-        NULL, // kinetoplast
-        "mitochondrion", // mitochondrion
-        NULL, // plastid
-        NULL, // macronuclear
-        NULL, // extrachrom
-        NULL, // plasmid
-        NULL, // transposon
-        NULL, // insertion-seq
-        NULL, // cyanelle
-        NULL, // proviral
-        NULL, // virion
-        NULL, // nucleomorph
-        NULL, // apicoplast
-        NULL, // leucoplast
-        NULL, // proplastid
-        NULL, // endogenous-virus
-        NULL, // hydrogenosome
-        NULL, // chromosome
-        NULL // chromatophore
-    };
-
-    // gather some info from the Seqdesc's on the bioseq, into
-    // the following variables
-    bool bPartial = false;
-    string sTaxname;
-    string sOldName;
-    string *psTitle = NULL;
-    const char *organelle = NULL;
-
-    // iterate for title
-    EDIT_EACH_SEQDESC_ON_BIOSEQ(descr_iter, bioseq) {
-        CSeqdesc &descr = **descr_iter;
-        if( descr.IsTitle() ) {
-            psTitle = & GET_MUTABLE(descr, Title);
-        }
-    }
-
-    // iterate Seqdescs from bottom to top
-    // accumulate seqdescs into here
-    typedef vector< CConstRef<CSeqdesc> > TSeqdescVec;
-    TSeqdescVec vecSeqdesc;
-    {
-        FOR_EACH_SEQDESC_ON_BIOSEQ(descr_iter, bioseq) {
-            vecSeqdesc.push_back( CConstRef<CSeqdesc>( &**descr_iter ) );
-        }
-        // climb up to get parent Seqdescs
-        CConstRef<CBioseq_set> bioseq_set( bioseq.GetParentSet() );
-        for( ; bioseq_set; bioseq_set = bioseq_set->GetParentSet() ) {
-            FOR_EACH_SEQDESC_ON_SEQSET(descr_iter, *bioseq_set) {
-                vecSeqdesc.push_back( CConstRef<CSeqdesc>( &**descr_iter ) );
-            }
-        }
-    }
-
-    ITERATE(TSeqdescVec, descr_iter, vecSeqdesc) {
-        const CSeqdesc &descr = **descr_iter;
-        if( descr.IsMolinfo() && FIELD_IS_SET(descr.GetMolinfo(), Completeness) ) {
-            switch( GET_FIELD(descr.GetMolinfo(), Completeness) ) {
-                case NCBI_COMPLETENESS(partial):
-                case NCBI_COMPLETENESS(no_left):
-                case NCBI_COMPLETENESS(no_right):
-                case NCBI_COMPLETENESS(no_ends):
-                    bPartial = true;
-                    break;
-                default:
-                    break;
-            }
-            // stop at first molinfo
-            break; 
-        }
-    }
-
-    ITERATE(TSeqdescVec, descr_iter, vecSeqdesc) {
-        const CSeqdesc &descr = **descr_iter;
-        if( descr.IsSource() ) {
-            const TBIOSOURCE_GENOME genome = ( descr.GetSource().CanGetGenome() ?
-                descr.GetSource().GetGenome() :
-                NCBI_GENOME(unknown) );
-            if (genome >= NCBI_GENOME(chloroplast) &&
-                genome <= NCBI_GENOME(chromatophore) ) 
-            {
-                organelle = kProteinOrganellePrefixes[genome];
-            }
-
-            if( FIELD_IS_SET(descr.GetSource(), Org) ) {
-                const COrg_ref & org = GET_FIELD(descr.GetSource(), Org);
-                if( ! RAW_FIELD_IS_EMPTY_OR_UNSET(org, Taxname) ) {
-                    sTaxname = GET_FIELD(org, Taxname);
-                }
-                if ( NStr::StartsWith(sTaxname, organelle, NStr::eNocase) ) {
-                    organelle = NULL;
-                }
-                FOR_EACH_ORGMOD_ON_ORGREF(mod_iter, org) {
-                    const COrgMod & orgmod = **mod_iter;
-                    if( FIELD_EQUALS(orgmod, Subtype, NCBI_ORGMOD(old_name) ) ) {
-                        sOldName = GET_FIELD(orgmod, Subname);
-                    }
-                }
-            }
-            // stop at first source
-            break;
-        }
-    }
-
-    s_RemoveOrgFromEndOfProtein(bioseq, sTaxname);
-
-    // bail if no title
-    if( (NULL == psTitle) || psTitle->empty() ) {
-        return;
-    }
-
-    // put title into a reference,
-    // just because it's more convenient than a pointer
-    string & sTitle = *psTitle;
-    // remember original so we can see if we changed it
-    const string sOriginalTitle = sTitle;
-
-    // search for partial, must be just before bracketed organism
-    SIZE_TYPE partialPos = NStr::Find(sTitle, ", partial [");
-    if( partialPos == NPOS ) {
-        partialPos = NStr::Find(sTitle, ", partial (");
-    }
-
-    // find oldname or taxname in brackets at end of protein title
-    SIZE_TYPE penult = NPOS;
-    SIZE_TYPE suffixPos = NPOS; // will point to " [${organism name}]" at end
-    if ( ! sOldName.empty() && ! sTaxname.empty() ) {
-        suffixPos = s_TitleEndsInOrganism (sTitle, sOldName, &penult);
-    }
-    if ( suffixPos == NPOS && ! sTaxname.empty() ) {
-        suffixPos = s_TitleEndsInOrganism (sTitle, sTaxname, &penult);
-        if (suffixPos != NPOS) {
-            if (organelle == NULL && penult != NPOS) {
-            } else if (organelle != NULL && penult == NPOS) {
-            } else if ( penult != NPOS && sTitle.substr(penult) == organelle ) {
-            } else {
-                // bail if no need to change partial text or [organism name]
-                if ( bPartial && partialPos != NPOS) {
-                    return;
-                } else if( ! bPartial && partialPos == NPOS ){
-                    return;
-                }
-            }
-        }
-    }
-    // do not change unless [genus species] was at the end
-    if (suffixPos == NPOS) {
-        return;
-    }
-
-    // truncate bracketed info from end of title, will replace with current taxname
-    sTitle.resize( suffixPos );
-    if (penult != NPOS) {
-        sTitle.resize(penult);
-    }
-
-    // if ", partial [" was indeed just before the [genus species], it will now be ", partial"
-    // Note: 9 is length of ", partial"
-    if ( !bPartial  &&
-         partialPos != string::npos  &&
-         (partialPos == (sTitle.length() - 9)) ) 
-    {
-        sTitle.resize( partialPos );
-    }
-    NStr::TruncateSpacesInPlace( sTitle );
-
-    //
-    if( bPartial && partialPos == NPOS ) {
-        sTitle += ", partial";
-    }
-    if (organelle != NULL) {
-        sTitle += " (" + string(organelle) + ")";
-    }
-    if ( ! sTaxname.empty() ) {
-        sTitle += " [" + sTaxname + "]";
-    }
-
-    if( sTitle != sOriginalTitle ) {
-        ChangeMade(CCleanupChange::eCleanBioseqTitle);
-    }
-}
-
-// returns empty string if there's a problem
-string CNewCleanup_imp::x_ExtractSatelliteFromComment( string &comment )
-{
-    if( comment.empty() ) {
-        return kEmptyStr;
+    if( comment.empty() ) {
+        return kEmptyStr;
     }
 
     string satellite_type;
@@ -6834,164 +6596,50 @@ string CNewCleanup_imp::x_ExtractSatelliteFromComment( string &comment )
     return satellite_qual;
 }
 
-// like C's function GetFrameFromLoc
-static
-int s_SetFrameFromLoc_Helper( const CSeq_loc &location, CRef<CScope> scope )
+
+void CNewCleanup_imp::x_CleanupECNumber( string &ec_num )
 {
-    const static int kCantFindFrame = 0;
-    const static int kFrameOne      = 1;
+    const string::size_type original_ec_num_length = ec_num.length();
+    NStr::TruncateSpacesInPlace( ec_num );
 
-    CSeq_loc_CI loc_ci( location, CSeq_loc_CI::eEmpty_Allow, CSeq_loc_CI::eOrder_Biological );
+    // remove any unnecessary "EC " prefix
+    s_RemoveInitial( ec_num, "EC ", NStr::eNocase );
+    s_RemoveInitial( ec_num, "EC:", NStr::eNocase );
 
-    // look at first part of the location
-    CConstRef<CSeq_loc> first_loc = loc_ci.GetRangeAsSeq_loc();
-    _ASSERT(first_loc);
-    switch ( first_loc->Which() )
-    {
-    case NCBI_SEQLOC(Int):
-        {
-            const CSeq_interval & interval = first_loc->GetInt();
-            if ( FIELD_EQUALS(interval, Strand, eNa_strand_minus) )
-            {
-                if( ! interval.IsSetFuzz_to() ) {
-                    return kFrameOne;
+    // remove trailing punctuation: 
+    // 1. periods unless they are preceded by a digit, an 'n', or a '-'
+    // 2. dashes unless they are preceded by a period
+    // 3. all other trailing punctuation always
+
+    string::reverse_iterator s1 = ec_num.rbegin();
+    if (s1 != ec_num.rend() && (ispunct(*s1) || isspace(*s1))) {
+        string::reverse_iterator s2 = s1;
+        ++s2;
+        while (s2 != ec_num.rend() && (ispunct(*s1) || isspace(*s1))) {
+            bool do_erase = false;
+            if (isspace(*s1)) {
+                do_erase = true;
+            } else if (*s1 == '-') {
+                if (*s2 != '.') {
+                    do_erase = true;
                 }
+            } else {
+                do_erase = true;
             }
-            else if ( ! interval.IsSetFuzz_from() ) {
-                return kFrameOne;
-            }
-        }
-        break;
-    case NCBI_SEQLOC(Pnt):
-        {
-            const CSeq_point & pnt = first_loc->GetPnt();
-            if ( ! pnt.IsSetFuzz() ) {
-                return kFrameOne;
-            }
-        }
-        break;
-    default:
-        return kCantFindFrame;
-    }
-
-    // check the last part of the location
-    CSeq_loc_CI last_ci = loc_ci;
-    for( ; loc_ci ; ++loc_ci ) {
-        last_ci = loc_ci;
-    }
-
-    CConstRef<CSeq_loc> last_loc = last_ci.GetRangeAsSeq_loc();
-    _ASSERT(last_loc);
-    switch ( last_loc->Which() )
-    {
-    case NCBI_SEQLOC(Int):
-        {
-            const CSeq_interval & interval = last_loc->GetInt();
-            if ( FIELD_EQUALS(interval, Strand, eNa_strand_minus) )
-            {
-                if( interval.IsSetFuzz_from() ) {
-                    return kCantFindFrame;
+            if (do_erase) {
+                ec_num = ec_num.substr(0, ec_num.length() - 1);
+                s1 = ec_num.rbegin();
+                if (s1 == ec_num.rend()) {
+                    break;
                 }
+                s2 = s1;
+                ++s2;
+            } else {
+                break;
             }
-            else if ( interval.IsSetFuzz_to() )
-                return kCantFindFrame;
-        }
-        break;
-    case NCBI_SEQLOC(Pnt):
-        {
-            const CSeq_point & pnt = last_loc->GetPnt();
-            if ( pnt.IsSetFuzz() )
-                return kCantFindFrame;
-        }
-        break;
-    default:
-        return kCantFindFrame;
-    }
-
-    // have complete last codon, get frame 
-    // from length
-    return (1 + (sequence::GetLength(location, &*scope) % 3) );
-}
-
-void CNewCleanup_imp::x_SetFrameFromLoc( CCdregion &cdregion, const CSeq_loc &location )
-{
-    // TODO: Farther below is a simpler way to do this if we want to use
-    // C++ functions, but since we want to match C for now, we use
-    // somewhat more complex code that does what C does.
-
-    TCDSFRAME_TYPE suggested_frame = NCBI_CDSFRAME(not_set);
-    switch( s_SetFrameFromLoc_Helper(location, m_Scope) ) {
-    case 0:
-        suggested_frame = NCBI_CDSFRAME(not_set);
-        break;
-    case 1:
-        suggested_frame = NCBI_CDSFRAME(one);
-        break;
-    case 2:
-        suggested_frame = NCBI_CDSFRAME(two);
-        break;
-    case 3:
-        suggested_frame = NCBI_CDSFRAME(three);
-        break;
-    default:
-        // s_SetFrameFromLoc_Helper should only return 0, 1, 2 or 3
-        _ASSERT(false);
-        return;
-    }
-
-    if( suggested_frame == NCBI_CDSFRAME(not_set) ) {
-        if( FIELD_IS_SET(cdregion, Frame) ) {
-            RESET_FIELD(cdregion, Frame);
-            ChangeMade(CCleanupChange::eChangeCdregion);
         }
-    } else if( ! FIELD_EQUALS(cdregion, Frame, suggested_frame) ) {
-        SET_FIELD(cdregion, Frame, suggested_frame);
-        ChangeMade(CCleanupChange::eChangeCdregion);
     }
 
-    //
-    // potential future C++ code:
-    //
-
-    //if (! location.IsTruncatedStart(eExtreme_Biological) ) {
-    //    cdregion.SetFrame( NCBI_CDSFRAME(one) );    // complete 5' end, it's frame 1
-    //    return;
-    //}
-
-    // if( location.IsTruncatedStop(eExtreme_Biological) ) { 
-    //    cdregion.ResetFrame();
-    //    return;
-    //}
-
-    //const TSeqPos seq_len = sequence::GetLength(location, m_Scope);
-
-    //// have complete last codon, get frame 
-    //// from length
-    //switch( (seq_len % 3) + 1 ) {
-    //    case 1:
-    //        cdregion.SetFrame( NCBI_CDSFRAME(one) );
-    //        break;
-    //    case 2:
-    //        cdregion.SetFrame( NCBI_CDSFRAME(two) );
-    //        break;
-    //    case 3:
-    //        cdregion.SetFrame( NCBI_CDSFRAME(three) );
-    //        break;
-    //    default:
-    //        // mathematically impossible
-    //        _ASSERT(false);
-    //        return;
-    //}
-}
-
-void CNewCleanup_imp::x_CleanupECNumber( string &ec_num )
-{
-    const string::size_type original_ec_num_length = ec_num.length();
-    NStr::TruncateSpacesInPlace( ec_num );
-
-    // remove any unnecessary "EC " prefix
-    s_RemoveInitial( ec_num, "EC ", NStr::eNocase );
-    s_RemoveInitial( ec_num, "EC:", NStr::eNocase );
 
     if( ec_num.length() != original_ec_num_length ) {
         ChangeMade(CCleanupChange::eCleanECNumber);
@@ -7031,15 +6679,8 @@ void CNewCleanup_imp::x_CleanupECNumberList( CProt_ref::TEc & ec_num_list )
 
 void CNewCleanup_imp::x_CleanupECNumberListEC( CProt_ref::TEc & ec_num_list )
 {
-    // CProt_ref::TEc is a list, so the iterator stays valid even if we 
-    // add new entries after the current one
-    NON_CONST_ITERATE( CProt_ref::TEc, ec_num_iter, ec_num_list ) {
-        string & ec_num = *ec_num_iter;
-        size_t tlen = ec_num.length();
-        CleanVisStringJunk (ec_num);
-        if(tlen != ec_num.length()) {
-            ChangeMade(CCleanupChange::eCleanECNumber);
-        }
+    if (CCleanup::UpdateECNumbers(ec_num_list)) {
+        ChangeMade(CCleanupChange::eCleanECNumber);
     }
 }
 
@@ -7050,20 +6691,7 @@ void CNewCleanup_imp::x_CleanupAndRepairInference( string &inference )
     }
 
     const string original_inference = inference;
-
-    CRegexpUtil colonFixer( inference );
-    colonFixer.Replace( "[ ]+:", ":" );
-    colonFixer.Replace( ":*:[ ]+", ": ");
-    colonFixer.GetResult().swap( inference ); // swap is faster than assignment
-
-    // check if missing space after a prefix
-    // e.g. "COORDINATES:foo" should become "COORDINATES: foo"
-    CCachedRegexp spaceInserter = regexpCache.Get(
-        "(COORDINATES|DESCRIPTION|EXISTENCE):[^ ]" );
-    if( spaceInserter->IsMatch( inference ) ) {
-        int location_just_beyond_match = spaceInserter->GetResults(0)[1];
-        inference.insert( inference.begin() + location_just_beyond_match - 1, ' ' );
-    }
+    inference = CGb_qual::CleanupAndRepairInference( original_inference );
 
     if( inference != original_inference ) {
         ChangeMade(CCleanupChange::eCleanQualifiers);
@@ -7307,8 +6935,11 @@ void CNewCleanup_imp::x_MendSatelliteQualifier( string &val )
         }
 
         // remove spaces after first colon
-        if( s_RegexpReplace( val, ":[ ]+", ":", 1 ) ) {
-            ChangeMade(CCleanupChange::eChangeQualifiers);
+        size_t pos = NStr::Find(val, ":");
+        if (pos != string::npos && isspace(val.c_str()[pos + 1])) {
+            if (s_RegexpReplace(val, ":[ ]+", ":", 1)) {
+                ChangeMade(CCleanupChange::eChangeQualifiers);
+            }
         }
     } else {
         NStr::TruncateSpacesInPlace( val, NStr::eTrunc_Begin );
@@ -7658,7 +7289,7 @@ void CNewCleanup_imp::x_PostSeqFeat( CSeq_feat& sf )
         sequence::SeqLocPartialCheck( GET_FIELD( sf, Location ), m_Scope );
     if ( FIELD_EQUALS(sf, Partial, true) ) {
         // do nothing, will not change partial if already set
-    } else if ( (partial_loc & partial_loc_mask) || ( s_SeqLocAnyNull( GET_FIELD( sf, Location ) ) && ! m_SeqEntryInfoStack.top().m_IsEmblOrDdbj) ) {
+    } else if ( (partial_loc & partial_loc_mask) || ( s_SeqLocAnyNull( GET_FIELD( sf, Location ) ) && ! m_IsEmblOrDdbj) ) {
         SET_FIELD( sf, Partial, true );
         ChangeMade (CCleanupChange::eChangePartial);
     }
@@ -8062,6 +7693,13 @@ void CNewCleanup_imp::ProtrefBC (
     }
 
     CLEAN_STRING_MEMBER (prot_ref, Desc);
+    if (prot_ref.IsSetDesc() &&
+        NStr::StartsWith(prot_ref.GetDesc(), "'") &&
+        NStr::EndsWith(prot_ref.GetDesc(), "'")) {
+        string desc = prot_ref.GetDesc();
+        desc = desc.substr(1, desc.length() - 2);
+        prot_ref.SetDesc(desc);
+    }
     REMOVE_IF_EMPTY_NAME_ON_PROTREF(prot_ref);
 
     CLEAN_STRING_LIST (prot_ref, Ec);
@@ -8071,7 +7709,7 @@ void CNewCleanup_imp::ProtrefBC (
     REMOVE_IF_EMPTY_ACTIVITY_ON_PROTREF(prot_ref);
 
     // rubisco cleanup
-    if( m_SeqEntryInfoStack.top().m_IsEmblOrDdbj ) {
+    if( m_IsEmblOrDdbj ) {
         EDIT_EACH_NAME_ON_PROTREF (it, prot_ref) {
             if (NStr::EqualNocase (*it, "RbcL") || NStr::EqualNocase(*it, "rubisco large subunit")) {
                 *it = "ribulose-1,5-bisphosphate carboxylase/oxygenase large subunit";
@@ -8274,9 +7912,9 @@ void CNewCleanup_imp::PostProtFeatfBC (
         ChangeMade (CCleanupChange::eCleanDbxrefs);
     }
 
-    if( RAW_FIELD_IS_EMPTY_OR_UNSET(prot_ref, Desc) ) {
-        RESET_FIELD(prot_ref, Desc);
-        ChangeMade (CCleanupChange::eCleanDbxrefs);
+    if( prot_ref.IsSetDesc() && NStr::IsBlank(prot_ref.GetDesc()) ) {
+        prot_ref.ResetDesc();
+        ChangeMade (CCleanupChange::eChangeProtNames);
     }
 }
 
@@ -8443,6 +8081,10 @@ CNewCleanup_imp::x_RRNANameBC( string &name )
            s_RegexpReplace( name, "RNA +rRNA", "RNA ") );
 
     NStr::TruncateSpacesInPlace(name);
+    if (NStr::EndsWith(name, ".")) {
+        name = name.substr(0, name.length() - 1);
+        NStr::TruncateSpacesInPlace(name);
+    }
 
     if( original_name != name ) {
         ChangeMade(CCleanupChange::eChangeRNAref);
@@ -8746,6 +8388,7 @@ void CNewCleanup_imp::x_MoveSeqdescOrgToSourceOrg( CSeqdesc &seqdesc )
     }
 }
 
+
 void CNewCleanup_imp::x_MoveSeqfeatOrgToSourceOrg( CSeq_feat &seqfeat )
 {
     if( FIELD_IS_SET_AND_IS(seqfeat, Data, Org) ) {
@@ -9072,12 +8715,16 @@ bool CNewCleanup_imp::x_FixMiscRNA(CSeq_feat& feat)
             rna_name != "tmRNA" &&
             rna_name != "misc_RNA")
         {
-            rna.SetExt().SetGen().SetProduct(rna_name);
+            string remainder;
+            rna.SetRnaProductName(rna_name, remainder);
+            if (!NStr::IsBlank(remainder)) {
+                x_AddToComment(feat, remainder);
+            }
             any_change = true;
         }
     }
-
-    if (feat.IsSetQual())
+    string product_name = rna.GetRnaProductName();
+    if (NStr::IsBlank(product_name) && feat.IsSetQual())
     {
         CSeq_feat::TQual::iterator qual_iter = feat.SetQual().begin();
         while (qual_iter != feat.SetQual().end()) {
@@ -9328,7 +8975,7 @@ void CNewCleanup_imp::RnaFeatBC (
 
     // if not tRNA and ext is tRNA and tRNA is empty, remove ext.tRNA
     if (rna.IsSetType() && 
-        (rna.GetType() == CRNA_ref::eType_mRNA || rna.GetType() == CRNA_ref::eType_rRNA) &&
+        (rna.GetType() == CRNA_ref::eType_mRNA || rna.GetType() == CRNA_ref::eType_rRNA || CRNA_ref::eType_tRNA) &&
         rna.IsSetExt() && rna.GetExt().IsTRNA() &&
         s_IsEmpty(rna.GetExt().GetTRNA())) {
         rna.ResetExt();
@@ -9453,6 +9100,10 @@ void CNewCleanup_imp::CdregionFeatBC (CCdregion& cds, CSeq_feat& seqfeat)
         UNIQUE_CODEBREAK_ON_CDREGION(cds, code_break_equal);
         ChangeMade(CCleanupChange::eChangeCodeBreak);
     }
+    if (cds.IsSetCode_break() && cds.GetCode_break().empty()) {
+        cds.ResetCode_break();
+        ChangeMade(CCleanupChange::eChangeCodeBreak);
+    }
 
     // check if comment is redundant due to selenocysteine or pyrrolysine
     if( GET_STRING_FLD_OR_BLANK(seqfeat, Comment) == "selenocysteine" || 
@@ -9639,6 +9290,8 @@ void CNewCleanup_imp::x_MoveCdregionXrefsToProt (CCdregion& cds, CSeq_feat& seqf
         if( ! feat_ci ) {
             return;
         }
+        const CSeq_annot_Handle sah = feat_ci->GetAnnot();
+        CSeq_entry_EditHandle eh = sah.GetParentEntry().GetEditHandle();
         feat_with_prot_ref_handle = CSeq_feat_EditHandle( feat_ci->GetSeq_feat_Handle() );
 
         new_feat_with_prot_ref.Reset( new CSeq_feat );
@@ -10352,34 +10005,51 @@ void CNewCleanup_imp::x_RemoveDupBioSource( CBioseq_set & bioseq_set )
     }
 }
 
+void CNewCleanup_imp::x_RemoveDupPubs(CSeq_descr & descr)
+{
+    if (CCleanup::RemoveDuplicatePubs(descr)) {
+        ChangeMade(CCleanupChange::eRemoveDescriptor);
+    }
+}
+
 void CNewCleanup_imp::x_FixStructuredCommentKeywords( CBioseq & bioseq )
 {
+    CBioseq_Handle bsh = m_Scope->GetBioseqHandle(bioseq);
+    CBioseq_EditHandle beh(bsh);
     vector<string> controlled_keywords = CComment_rule::GetKeywordList();
     vector<string> original_keywords;
 
-    EDIT_EACH_SEQDESC_ON_BIOSEQ ( itr, bioseq ) {
-        CSeqdesc& desc = **itr;
-        if ( desc.Which() != CSeqdesc::e_Genbank ) continue;
-        CGB_block& gb_block = desc.SetGenbank();
-        EDIT_EACH_KEYWORD_ON_GENBANKBLOCK (k_itr, gb_block) {
-            original_keywords.push_back(*k_itr);
-            FOR_EACH_STRING_IN_VECTOR ( s_itr, controlled_keywords ) {
-                if (NStr::EqualNocase (*k_itr, *s_itr)) {
-                    ERASE_KEYWORD_ON_GENBANKBLOCK (k_itr, gb_block);
-                    break;
+    if (beh.IsSetDescr()) {
+        CBioseq::TDescr::Tdata::iterator it = beh.SetDescr().Set().begin();
+        while (it != beh.SetDescr().Set().end()) {
+            CSeqdesc& desc = **it;
+            if (desc.Which() != CSeqdesc::e_Genbank) {
+                ++it;
+                continue;
+            }
+            CGB_block& gb_block = desc.SetGenbank();
+            EDIT_EACH_KEYWORD_ON_GENBANKBLOCK(k_itr, gb_block) {
+                original_keywords.push_back(*k_itr);
+                FOR_EACH_STRING_IN_VECTOR(s_itr, controlled_keywords) {
+                    if (NStr::EqualNocase(*k_itr, *s_itr)) {
+                        ERASE_KEYWORD_ON_GENBANKBLOCK(k_itr, gb_block);
+                        break;
+                    }
                 }
             }
-        }
-        if (gb_block.IsSetKeywords() && gb_block.GetKeywords().size() == 0) {
-            gb_block.ResetKeywords();
-        }
-        if (gb_block.IsEmpty()) {
-            ERASE_SEQDESC_ON_BIOSEQ ( itr, bioseq );
+            if (gb_block.IsSetKeywords() && gb_block.GetKeywords().size() == 0) {
+                gb_block.ResetKeywords();
+            }
+            if (gb_block.IsEmpty()) {
+                it = beh.SetDescr().Set().erase(it);
+            } else {
+                ++it;
+            }
         }
     }
 
     vector<string> new_keywords;
-    CBioseq_Handle bsh = m_Scope->GetBioseqHandle(bioseq);
+
     for (CSeqdesc_CI di(bsh, CSeqdesc::e_User); di; ++di) {
         const CUser_object& usr = di->GetUser();
         if ( ! CComment_rule::IsStructuredComment (usr) ) continue;
@@ -10460,293 +10130,1983 @@ void CNewCleanup_imp::x_RemoveRedundantComment( CGene_ref& gene, CSeq_feat & seq
 {
     if( FIELD_IS_SET(seq_feat, Comment) ) {
         const string & comm = GET_FIELD(seq_feat, Comment);
-        if ( STRING_FIELD_MATCH (gene, Desc, comm) ) {
-            RESET_FIELD(gene, Desc);
-            ChangeMade(CCleanupChange::eChangeQualifiers);
+        if ( STRING_FIELD_MATCH (gene, Desc, comm)) { 
+            // only reset desc if there are other fields present
+            if (gene.IsSetLocus() ||
+                gene.IsSetAllele() ||
+                gene.IsSetMaploc() ||
+                gene.IsSetLocus_tag() ||
+                gene.IsSetDb() ||
+                gene.IsSetSyn()) {
+                gene.ResetDesc();
+                ChangeMade(CCleanupChange::eChangeQualifiers);
+            } else {
+                seq_feat.ResetComment();
+                ChangeMade(CCleanupChange::eChangeComment);
+            }
+        }
+        if ( STRING_FIELD_MATCH (gene, Locus, comm) ) {
+           seq_feat.ResetComment();
+           ChangeMade(CCleanupChange::eChangeComment);
         }
     }
 }
 
-void CNewCleanup_imp::x_RemoveEmptyUserObject( CSeq_descr & seq_descr )
+void CNewCleanup_imp::x_ExceptTextEC(string& except_text)
 {
-    EDIT_EACH_SEQDESC_ON_SEQDESCR( descr_iter, seq_descr ) {
-        CSeqdesc &desc = **descr_iter;
-        if( ! FIELD_IS(desc, User) ) {
-            continue;
-        }
+    if (NStr::EqualNocase(except_text, "reasons cited in publication")) {
+        except_text = "reasons given in citation";
+        ChangeMade(CCleanupChange::eChangeException);
+    }
+}
 
-        bool needs_removal = false;
 
-        // remove user-objects with no type
-        CUser_object & user_obj = GET_MUTABLE(desc, User);
-        if( ! FIELD_IS_SET(user_obj, Type) || 
-            ( FIELD_IS(user_obj.GetType(), Str) && user_obj.GetType().GetStr().empty() ) ) 
-        {
-            needs_removal = true;
-        }
+bool CNewCleanup_imp::x_IsCodonCorrect(int codon_index, int gcode, unsigned char aa)
+{
+    if (codon_index > 63) {
+        return false;
+    }
+    const string& ncbieaa = CGen_code_table::GetNcbieaa(gcode);
+    if (ncbieaa.length() != 64) {
+        return false;
+    }
+    unsigned char taa = ncbieaa[codon_index];
 
-        // get type string, if any
-        const string *pTypeStr = &kEmptyStr;
-        if( FIELD_IS_SET_AND_IS(user_obj, Type, Str) ) {
-            pTypeStr = &(user_obj.GetType().GetStr());
-        }
+    if (taa == aa) {
+        return true;
+    } else if ((aa == 'U') && (taa == '*') && (codon_index == 14)) {
+        // selenocysteine normally uses TGA (14), so ignore without requiring exception in record
+        // TAG (11) is used for pyrrolysine in archaebacteria
+        // TAA (10) is not yet known to be used for an exceptional amino acid
+        return true;
+    } else {
+        return false;
+    }
+}
 
-        // remove user-objects with no data (except certain types)
-        if( RAW_FIELD_IS_EMPTY_OR_UNSET(user_obj, Data) && 
-            ! NStr::EqualNocase(*pTypeStr, "NcbiAutofix") &&
-            ! NStr::EqualNocase(*pTypeStr, "Unverified") )
-        {
-            needs_removal = true;
-        }
 
-        if( needs_removal ) {
-            ERASE_SEQDESC_ON_SEQDESCR(descr_iter, seq_descr);
-            ChangeMade(CCleanupChange::eRemoveDescriptor);
+int s_LegalNcbieaaValues[] = { 42, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+    74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+    84, 85, 86, 87, 88, 89, 90 };
+
+unsigned char s_GetAaAsChar(const CTrna_ext& trna)
+{
+    unsigned char aa = 0;
+    vector<char> seqData;
+    string str = "";
+
+    switch (trna.GetAa().Which()) {
+    case CTrna_ext::C_Aa::e_Iupacaa:
+        str = trna.GetAa().GetIupacaa();
+        CSeqConvert::Convert(str, CSeqUtil::e_Iupacaa, 0, str.size(), seqData, CSeqUtil::e_Ncbieaa);
+        aa = seqData[0];
+        break;
+    case CTrna_ext::C_Aa::e_Ncbi8aa:
+        str = trna.GetAa().GetNcbi8aa();
+        CSeqConvert::Convert(str, CSeqUtil::e_Ncbi8aa, 0, str.size(), seqData, CSeqUtil::e_Ncbieaa);
+        aa = seqData[0];
+        break;
+    case CTrna_ext::C_Aa::e_Ncbistdaa:
+        str = trna.GetAa().GetNcbi8aa();
+        CSeqConvert::Convert(str, CSeqUtil::e_Ncbistdaa, 0, str.size(), seqData, CSeqUtil::e_Ncbieaa);
+        aa = seqData[0];
+        break;
+    case CTrna_ext::C_Aa::e_Ncbieaa:
+        seqData.push_back(trna.GetAa().GetNcbieaa());
+        aa = seqData[0];
+        break;
+    default:
+        return ' ';
+        break;
+    }
+
+    // make sure the amino acid is valid
+    bool found = false;
+    for (unsigned int i = 0; i < sizeof(s_LegalNcbieaaValues) / sizeof(int); ++i) {
+        if (aa == s_LegalNcbieaaValues[i]) {
+            found = true;
+            break;
         }
     }
+    if (!found) {
+        aa = ' ';
+    }
+    return aa;
 }
 
-void CNewCleanup_imp::x_CleanupGenbankBlock( CSeq_descr & seq_descr )
+
+char s_Complement(char s)
 {
-    EDIT_EACH_SEQDESC_ON_SEQDESCR( descr_iter, seq_descr ) {
-        CSeqdesc &desc = **descr_iter;
-        if( ! FIELD_IS(desc, Genbank) ) {
+    char c = s;
+    if (s == 'A') {
+        c = 'T';
+    } else if (s == 'C') {
+        c = 'G';
+    } else if (s == 'G') {
+        c = 'C';
+    } else if (s == 'T') {
+        c = 'A';
+    }
+    return c;
+}
+
+static string s_Complement(const string& str)
+{
+    string complement = "";
+    ITERATE(string, s, str) {
+        complement += s_Complement(*s);
+    }
+    return complement;
+}
+
+static string s_ReverseComplement(const string& str)
+{
+    string revcomp = "";
+    ITERATE(string, s, str) {
+        revcomp = s_Complement(*s) + revcomp;
+    }
+    return revcomp;
+}
+
+static string s_Reverse(const string& str)
+{
+    string reverse = "";
+    ITERATE(string, s, str) {
+        reverse = *s + reverse;
+    }
+    return reverse;
+}
+
+
+void CNewCleanup_imp::x_tRNACodonEC(CSeq_feat& seq_feat)
+{
+    if (!seq_feat.IsSetData() ||
+        seq_feat.GetData().GetSubtype() != CSeqFeatData::eSubtype_tRNA ||
+        !seq_feat.GetData().GetRna().IsSetExt() ||
+        !seq_feat.GetData().GetRna().GetExt().IsTRNA()) {
+        return;
+    }
+    CTrna_ext& trna = seq_feat.SetData().SetRna().SetExt().SetTRNA();
+    if (!trna.IsSetAa() || !trna.IsSetCodon()) {
+        return;
+    }
+    // Retrive the Genetic code id for the tRNA
+    int gcode = 1;
+    CBioseq_Handle bsh = m_Scope->GetBioseqHandle(seq_feat.GetLocation());
+    if (bsh) {
+        // need only the closest biosoure.
+        CSeqdesc_CI diter(bsh, CSeqdesc::e_Source);
+        if (diter) {
+            gcode = diter->GetSource().GetGenCode();
+        }
+    }
+
+    unsigned char aa = s_GetAaAsChar(trna);
+    if (aa == ' ') {
+        return;
+    }
+
+    NON_CONST_ITERATE(CTrna_ext::TCodon, c, trna.SetCodon()) {
+        if (*c == 255) continue; //universal
+        if (*c > 63) continue; //invalid, cannot correct
+
+        if (x_IsCodonCorrect(*c, gcode, aa)) continue; //already correct
+        string codon = CGen_code_table::IndexToCodon(*c);
+
+        // try reverse complement
+        string revcomp = s_ReverseComplement(codon);
+        int new_codon = CGen_code_table::CodonToIndex(revcomp);
+        if (x_IsCodonCorrect(new_codon, gcode, aa)) {
+            *c = new_codon;
+            ChangeMade(CCleanupChange::eChange_tRna);
             continue;
         }
 
-        CGB_block& gb = desc.SetGenbank();
+        // try complement
+        string comp = s_Complement(codon);
+        new_codon = CGen_code_table::CodonToIndex(comp);
+        if (x_IsCodonCorrect(new_codon, gcode, aa)) {
+            *c = new_codon;
+            ChangeMade(CCleanupChange::eChange_tRna);
+            continue;
+        }
 
-        if (gb.IsSetTaxonomy()) {
-            gb.ResetTaxonomy();
-            ChangeMade(CCleanupChange::eChangeOther);
+        // try reverse
+        string reverse = s_Reverse(codon);
+        new_codon = CGen_code_table::CodonToIndex(reverse);
+        if (x_IsCodonCorrect(new_codon, gcode, aa)) {
+            *c = new_codon;
+            ChangeMade(CCleanupChange::eChange_tRna);
+            continue;
+        }
+    }
+
+    if (!CODON_ON_TRNAEXT_IS_SORTED(trna, s_CodonCompare)) {
+        SORT_CODON_ON_TRNAEXT(trna, s_CodonCompare);
+        ChangeMade(CCleanupChange::eChange_tRna);
+    }
+
+    if (!CODON_ON_TRNAEXT_IS_UNIQUE(trna, s_CodonEqual)) {
+        UNIQUE_CODON_ON_TRNAEXT(trna, s_CodonEqual);
+        ChangeMade(CCleanupChange::eChange_tRna);
+    }
+
+    REMOVE_IF_EMPTY_CODON_ON_TRNAEXT(trna);
+}
+
+
+void CNewCleanup_imp::x_tRNAEC(CSeq_feat& seq_feat)
+{
+    if (!seq_feat.IsSetData() || 
+        seq_feat.GetData().GetSubtype() != CSeqFeatData::eSubtype_tRNA ||
+        !seq_feat.GetData().GetRna().IsSetExt() ||
+        !seq_feat.GetData().GetRna().GetExt().IsTRNA()) {
+        return;
+    }
+
+    x_tRNACodonEC(seq_feat);
+
+}
+
+void CNewCleanup_imp::x_RemoveEmptyUserObject( CSeq_descr & seq_descr )
+{
+    EDIT_EACH_SEQDESC_ON_SEQDESCR( descr_iter, seq_descr ) {
+        CSeqdesc &desc = **descr_iter;
+        if( ! FIELD_IS(desc, User) ) {
+            continue;
+        }
+
+        bool needs_removal = false;
+
+        CUser_object & user_obj = GET_MUTABLE(desc, User);
+
+        // get type string, if any
+        const string *pTypeStr = &kEmptyStr;
+        if( FIELD_IS_SET_AND_IS(user_obj, Type, Str) ) {
+            pTypeStr = &(user_obj.GetType().GetStr());
+        }
+
+        // remove user-objects with no data (except certain types)
+        if( RAW_FIELD_IS_EMPTY_OR_UNSET(user_obj, Data) && 
+            ! NStr::EqualNocase(*pTypeStr, "NcbiAutofix") &&
+            ! NStr::EqualNocase(*pTypeStr, "Unverified") )
+        {
+            needs_removal = true;
         }
 
-        // remove empty GenBank blocks
-        if (!gb.IsSetExtra_accessions() &&
-            !gb.IsSetSource() &&
-            !gb.IsSetKeywords() &&
-            !gb.IsSetOrigin() &&
-            !gb.IsSetDate() &&
-            !gb.IsSetEntry_date() &&
-            !gb.IsSetDiv()) {
-           
+        if( needs_removal ) {
             ERASE_SEQDESC_ON_SEQDESCR(descr_iter, seq_descr);
             ChangeMade(CCleanupChange::eRemoveDescriptor);
         }
     }
-  
 }
 
-bool CNewCleanup_imp::x_ShouldRemoveEmptyGene(CGene_ref& gene)
+
+bool CNewCleanup_imp::s_ShouldRemoveKeyword(const string& keyword, CMolInfo::TTech tech)
 {
-    bool should_remove = false;
-    if (gene.IsSetLocus() &&
-        NStr::IsBlank(gene.GetLocus())) {
-        gene.ResetLocus();
-        ChangeMade(CCleanupChange::eChangeOther);
+    if (NStr::Equal(keyword, "HTG")) {
+        return true;
+    } else if (tech == CMolInfo::eTech_htgs_0 && NStr::Equal(keyword, "HTGS_PHASE0")) {
+        return true;
+    } else if (tech == CMolInfo::eTech_htgs_1 && NStr::Equal(keyword, "HTGS_PHASE1")) {
+        return true;
+    } else if (tech == CMolInfo::eTech_htgs_2 && NStr::Equal(keyword, "HTGS_PHASE2")) {
+        return true;
+    } else if (tech == CMolInfo::eTech_htgs_3 && NStr::Equal(keyword, "HTGS_PHASE3")) {
+        return true;
+    } else if (tech == CMolInfo::eTech_est && NStr::Equal(keyword, "EST")) {
+        return true;
+    } else if (tech == CMolInfo::eTech_sts && NStr::Equal(keyword, "STS")) {
+        return true;
+    } else if (tech == CMolInfo::eTech_survey && NStr::Equal(keyword, "GSS")) {
+        return true;
+    } else {
+        return false;
     }
-    if (gene.IsSetAllele() &&
-        NStr::IsBlank(gene.GetAllele())) {
-        gene.ResetAllele();
-        ChangeMade(CCleanupChange::eChangeOther);
+}
+
+
+bool CNewCleanup_imp::x_CleanGenbankKeywords(CGB_block& blk, CMolInfo::TTech tech)
+{
+    if (!blk.IsSetKeywords()) {
+        return false;
     }
-    if (gene.IsSetDesc() &&
-        NStr::IsBlank(gene.GetDesc())) {
-        gene.ResetDesc();
-        ChangeMade(CCleanupChange::eChangeOther);
+    bool any_change = false;
+    CGB_block::TKeywords::iterator it = blk.SetKeywords().begin();
+    while (it != blk.SetKeywords().end()) {
+        if (s_ShouldRemoveKeyword(*it, tech)) {
+            it = blk.SetKeywords().erase(it);
+            any_change = true;
+        } else {
+            ++it;
+        }
     }
-    if (gene.IsSetMaploc() &&
-        NStr::IsBlank(gene.GetMaploc())) {
-        gene.ResetMaploc();
-        ChangeMade(CCleanupChange::eChangeOther);
+    if (blk.GetKeywords().empty()) {
+        blk.ResetKeywords();
+        any_change = true;
     }
-    if (gene.IsSetLocus_tag() &&
-        NStr::IsBlank(gene.GetLocus_tag())) {
-        gene.ResetLocus_tag();
-        ChangeMade(CCleanupChange::eChangeOther);
+    return any_change;
+}
+
+
+bool s_SetMolinfoTechFromString(CMolInfo& molinfo, const string& keyword)
+{
+    if (NStr::Equal(keyword, "HTGS_PHASE0")) {
+        molinfo.SetTech(CMolInfo::eTech_htgs_0);
+        return true;
+    } else if (NStr::Equal(keyword, "HTGS_PHASE1")) {
+        molinfo.SetTech(CMolInfo::eTech_htgs_1);
+        return true;
+    } else if (NStr::Equal(keyword, "HTGS_PHASE2")) {
+        molinfo.SetTech(CMolInfo::eTech_htgs_2);
+        return true;
+    } else if (NStr::Equal(keyword, "HTGS_PHASE3")) {
+        molinfo.SetTech(CMolInfo::eTech_htgs_3);
+        return true;
+    } else if (NStr::Equal(keyword, "EST")) {
+        molinfo.SetTech(CMolInfo::eTech_est);
+        return true;
+    } else if (NStr::Equal(keyword, "STS")) {
+        molinfo.SetTech(CMolInfo::eTech_sts);
+        return true;
+    } else if (NStr::Equal(keyword, "GSS")) {
+        molinfo.SetTech(CMolInfo::eTech_survey);
+        return true;
+    } else {
+        return false;
     }
-    if (gene.IsSetDb() && gene.GetDb().empty()) {
-        gene.ResetDb();
-        ChangeMade(CCleanupChange::eChangeOther);
+}
+
+
+// if molinfo is missing tech, try to set it using GB_block.div
+// note - may want to also do this with keywords later
+void CNewCleanup_imp::x_SetMolInfoTechFromGenBankBlock(CSeq_descr& seq_descr, CGB_block& block)
+{
+    if (!block.IsSetDiv())
+    {
+        return;
     }
-    if (gene.IsSetSyn() && gene.GetSyn().empty()) {
-        gene.ResetSyn();
-        ChangeMade(CCleanupChange::eChangeOther);
+    NON_CONST_ITERATE(CSeq_descr::Tdata, it, seq_descr.Set()) {
+        if ((*it)->IsMolinfo() &&
+            !(*it)->GetMolinfo().IsSetTech()) {
+            if (block.IsSetDiv() && s_SetMolinfoTechFromString((*it)->SetMolinfo(), block.GetDiv())) {
+                block.ResetDiv();
+                ChangeMade(CCleanupChange::eChangeMolInfo);
+            }            
+        }
     }
-    if (!gene.IsSetLocus() &&
-        !gene.IsSetAllele() &&
-        !gene.IsSetDesc() &&
-        !gene.IsSetMaploc() &&
-        !gene.IsSetLocus_tag() &&
-        !gene.IsSetDb() &&
-        !gene.IsSetSyn()) {
-        should_remove = true;
+}
+
+
+void CNewCleanup_imp::x_SetMolInfoTechFromGenBankBlock(CSeq_descr& seq_descr)
+{
+    NON_CONST_ITERATE(CSeq_descr::Tdata, it, seq_descr.Set()) {
+        if ((*it)->IsGenbank()) {
+            x_SetMolInfoTechFromGenBankBlock(seq_descr, (*it)->SetGenbank());
+        }
     }
-    return should_remove;
 }
 
-            
-bool CNewCleanup_imp::x_ShouldRemoveEmptyProt( CProt_ref& prot )
+
+void CNewCleanup_imp::x_CleanupGenbankBlock(CBioseq_set& set)
 {
-    if (prot.IsSetProcessed() &&
-        (prot.GetProcessed() == CProt_ref::eProcessed_signal_peptide ||
-         prot.GetProcessed() == CProt_ref::eProcessed_transit_peptide)) {
-        return false;
+    if (!set.IsSetDescr()) {
+        return;
     }
 
-    bool should_remove = false;
-    if (prot.IsSetName() && 
-        (prot.GetName().empty() || 
-         NStr::IsBlank(prot.GetName().front()))) {
-        prot.ResetName();
-        ChangeMade(CCleanupChange::eChangeOther);
+    CConstRef<CBioSource> biosrc(NULL);
+    CMolInfo::TTech tech = CMolInfo::eTech_unknown;
+
+    ITERATE(CBioseq_set::TDescr::Tdata, it, set.GetDescr().Get()) {
+        if ((*it)->IsSource()) {
+            biosrc.Reset(&((*it)->GetSource()));
+        } else if ((*it)->IsMolinfo() &&
+                   (*it)->GetMolinfo().IsSetTech()) {
+            tech = (*it)->GetMolinfo().GetTech();
+        }
     }
-    if (prot.IsSetEc() && prot.GetEc().empty()) {
-        prot.ResetEc();
-        ChangeMade(CCleanupChange::eChangeOther);
+
+    EDIT_EACH_SEQDESC_ON_SEQDESCR(descr_iter, set.SetDescr()) {
+        CSeqdesc &desc = **descr_iter;
+        if (!FIELD_IS(desc, Genbank)) {
+            continue;
+        }
+
+        CGB_block& gb = desc.SetGenbank();
+        x_CleanupGenbankBlock(gb, false, biosrc, tech);
     }
-    if (prot.IsSetDb() && prot.GetDb().empty()) {
-        prot.ResetDb();
-        ChangeMade(CCleanupChange::eChangeOther);
+
+}
+
+
+string s_GetDiv(const CBioSource& src)
+{
+    if (src.IsSetOrg() && src.GetOrg().IsSetOrgname() &&
+        src.GetOrg().GetOrgname().IsSetDiv()) {
+        return src.GetOrg().GetOrgname().GetDiv();
+    } else {
+        return kEmptyCStr;
     }
-    if (prot.IsSetActivity() && prot.GetActivity().empty()) {
-        prot.ResetActivity();
-        ChangeMade(CCleanupChange::eChangeOther);
+}
+
+
+bool CNewCleanup_imp::x_CanRemoveGenbankBlockSource(const string& src, const CBioSource& biosrc)
+{
+    string compare = src;
+    if (NStr::EndsWith(compare, " DNA.")) {
+        compare = compare.substr(0, compare.length() - 5);
+    } else if (NStr::EndsWith(compare, " rRNA.")) {
+        compare = compare.substr(0, compare.length() - 6);
     }
-    if (prot.IsSetDesc() && NStr::IsBlank(prot.GetDesc())) {
-        prot.ResetDesc();
-        ChangeMade(CCleanupChange::eChangeOther);
+    if (NStr::EndsWith(compare, ".")) {
+        compare = compare.substr(0, compare.length() - 1);
+        NStr::TruncateSpacesInPlace(compare);
     }
-    if (!prot.IsSetName() &&
-        !prot.IsSetDesc() &&
-        !prot.IsSetEc() &&
-        !prot.IsSetActivity() &&
-        !prot.IsSetDb()) {
-        should_remove = true;
+
+    if (biosrc.IsSetOrg()) {
+        if (biosrc.GetOrg().IsSetTaxname() &&
+            NStr::Equal(compare, biosrc.GetOrg().GetTaxname())) {
+            return true;
+        }
+        if (biosrc.GetOrg().IsSetCommon() &&
+            NStr::Equal(compare, biosrc.GetOrg().GetCommon())) {
+            return true;
+        }
+        if (biosrc.GetOrg().IsSetOrgname() &&
+            biosrc.GetOrg().GetOrgname().IsSetMod()) {
+            ITERATE(COrgName::TMod, m, biosrc.GetOrg().GetOrgname().GetMod()) {
+                if ((*m)->IsSetSubtype() &&
+                    (*m)->GetSubtype() == COrgMod::eSubtype_old_name &&
+                    (*m)->IsSetSubname() &&
+                    NStr::Equal((*m)->GetSubname(), compare)) {
+                    return true;
+                }
+            }
+        }
     }
-    return should_remove;
+    return false;
 }
-           
-bool CNewCleanup_imp::x_ShouldRemoveEmptyPub(CPubdesc& pub)
+
+
+void CNewCleanup_imp::x_CleanupGenbankBlock(CGB_block& gb, bool is_patent, CConstRef<CBioSource> biosrc, CMolInfo::TTech tech)
 {
-    return false;
+    if (gb.IsSetDiv()) {
+        if (biosrc && NStr::Equal(gb.GetDiv(), s_GetDiv(*biosrc))) {
+            gb.ResetDiv();
+            ChangeMade(CCleanupChange::eChangeOther);
+        } else if (is_patent && NStr::Equal(gb.GetDiv(), "PAT")) {
+            gb.ResetDiv();
+            ChangeMade(CCleanupChange::eChangeOther);
+        } else if (NStr::Equal(gb.GetDiv(), "HTG")) {
+            if (tech == CMolInfo::eTech_htgs_0 ||
+                tech == CMolInfo::eTech_htgs_1 ||
+                tech == CMolInfo::eTech_htgs_2 ||
+                tech == CMolInfo::eTech_htgs_3) {
+                gb.ResetDiv();
+                ChangeMade(CCleanupChange::eChangeOther);
+            }
+        } else if (s_ShouldRemoveKeyword(gb.GetDiv(), tech)) {
+            gb.ResetDiv();
+            ChangeMade(CCleanupChange::eChangeOther);
+        }
+    }
+    if (gb.IsSetSource() && biosrc && x_CanRemoveGenbankBlockSource(gb.GetSource(), *biosrc)) {
+        gb.ResetSource();
+        ChangeMade(CCleanupChange::eChangeOther);
+    }
+    if (x_CleanGenbankKeywords(gb, tech)) {
+        ChangeMade(CCleanupChange::eChangeKeywords);
+    }
 }
 
-bool CNewCleanup_imp::x_ShouldRemoveEmptyFeature( CSeq_feat& feat)
+
+void CNewCleanup_imp::x_CleanupGenbankBlock(CBioseq& seq)
 {
-    bool is_empty = false;
+    if (!seq.IsSetDescr()) {
+        return;
+    }
+    x_SetMolInfoTechFromGenBankBlock(seq.SetDescr());
+    bool is_patent = false;
+    ITERATE(CBioseq::TId, id, seq.GetId()) {
+        if ((*id)->IsPatent()) {
+            is_patent = true;
+        }
+    }
+    CBioseq_Handle b = m_Scope->GetBioseqHandle(seq);
+    CConstRef<CBioSource> biosrc(NULL);
+    CSeqdesc_CI src(b, CSeqdesc::e_Source);
+    if (src) {
+        biosrc.Reset(&(src->GetSource()));
+    }
+    CMolInfo::TTech tech = CMolInfo::eTech_unknown;
+    CSeqdesc_CI molinfo(b, CSeqdesc::e_Molinfo);
+    if (molinfo && molinfo->GetMolinfo().IsSetTech()) {
+        tech = molinfo->GetMolinfo().GetTech();
+    }
 
-    if (!feat.IsSetData()) {
-        return false;
+    EDIT_EACH_SEQDESC_ON_SEQDESCR(descr_iter, seq.SetDescr()) {
+        CSeqdesc &desc = **descr_iter;
+        if (!FIELD_IS(desc, Genbank)) {
+            continue;
+        }
+
+        CGB_block& gb = desc.SetGenbank();
+        x_CleanupGenbankBlock(gb, is_patent, biosrc, tech);
     }
-    switch (feat.GetData().Which()) {
-        case CSeqFeatData::e_Gene:
-            is_empty = x_ShouldRemoveEmptyGene(feat.SetData().SetGene());
+}
+
+
+void CNewCleanup_imp::x_CleanupGenbankBlock( CSeq_descr & seq_descr )
+{
+    EDIT_EACH_SEQDESC_ON_SEQDESCR( descr_iter, seq_descr ) {
+        CSeqdesc &desc = **descr_iter;
+        if( ! FIELD_IS(desc, Genbank) ) {
+            continue;
+        }
+
+        CGB_block& gb = desc.SetGenbank();
+
+        if (gb.IsSetTaxonomy()) {
+            gb.ResetTaxonomy();
+            ChangeMade(CCleanupChange::eChangeOther);
+        }
+
+        if (gb.IsSetDiv()) {
+            if (NStr::Equal(gb.GetDiv(), "UNA") ||
+                NStr::Equal(gb.GetDiv(), "UNC") ||
+                NStr::IsBlank(gb.GetDiv())) {
+                gb.ResetDiv();
+                ChangeMade(CCleanupChange::eChangeOther);
+            }
+        }
+
+    }
+  
+}
+
+
+CMolInfo::TBiomol s_BiomolFromGIBBMolType(EGIBB_mol mol)
+{
+    switch (mol) {
+        case eGIBB_mol_genomic:
+            return CMolInfo::eBiomol_genomic;
             break;
-        case CSeqFeatData::e_Prot:
-            is_empty = x_ShouldRemoveEmptyProt(feat.SetData().SetProt());
+        case eGIBB_mol_genomic_mRNA:
+            return CMolInfo::eBiomol_genomic_mRNA;
             break;
-        case CSeqFeatData::e_Pub:
-            is_empty = x_ShouldRemoveEmptyPub(feat.SetData().SetPub());
+        case eGIBB_mol_mRNA:
+            return CMolInfo::eBiomol_mRNA;
             break;
-        case CSeqFeatData::e_Comment:
-            if (!feat.IsSetComment() || NStr::IsBlank(feat.GetComment())) {
-                is_empty = true;
-            }
+        case eGIBB_mol_other:
+            return CMolInfo::eBiomol_other;
+            break;
+        case eGIBB_mol_other_genetic:
+            return CMolInfo::eBiomol_other_genetic;
+            break;
+        case eGIBB_mol_peptide:
+            return CMolInfo::eBiomol_peptide;
+            break;
+        case eGIBB_mol_pre_mRNA:
+            return CMolInfo::eBiomol_pre_RNA;
+            break;
+        case eGIBB_mol_rRNA:
+            return CMolInfo::eBiomol_rRNA;
+            break;
+        case eGIBB_mol_scRNA:
+            return CMolInfo::eBiomol_scRNA;
+            break;
+        case eGIBB_mol_snRNA:
+            return CMolInfo::eBiomol_snRNA;
+            break;
+        case eGIBB_mol_tRNA:
+            return CMolInfo::eBiomol_tmRNA;
+            break;
+        case eGIBB_mol_unknown:
+            return CMolInfo::eBiomol_unknown;
+            break;
+    }
+    return CMolInfo::eBiomol_unknown;
+}
+
+
+CMolInfo::TTech s_TechFromGIBBMethod(EGIBB_method method)
+{
+    switch (method)
+    {
+        case eGIBB_method_concept_trans:
+            return CMolInfo::eTech_concept_trans;
+            break;
+        case eGIBB_method_seq_pept:
+            return CMolInfo::eTech_seq_pept;
+            break;
+        case eGIBB_method_both:
+            return CMolInfo::eTech_both;
+            break;
+        case eGIBB_method_seq_pept_overlap:
+            return CMolInfo::eTech_seq_pept_overlap;
+            break;
+        case eGIBB_method_seq_pept_homol:
+            return CMolInfo::eTech_seq_pept;
+            break;
+        case eGIBB_method_concept_trans_a:
+            return CMolInfo::eTech_concept_trans_a;
+            break;
+        case eGIBB_method_other:
+            return CMolInfo::eTech_other;
+            break;
+
+    }
+    return CMolInfo::eTech_other;
+}
+
+
+bool SetMolinfoFromGIBBMod(CMolInfo& mi, EGIBB_mod mod)
+{
+    bool changed = false;
+    switch (mod) {
+        case eGIBB_mod_partial:
+            mi.SetCompleteness(CMolInfo::eCompleteness_partial);
+            changed = true;
+            break;
+        case eGIBB_mod_complete:
+            mi.SetCompleteness(CMolInfo::eCompleteness_complete);
+            changed = true;
+            break;
+        case eGIBB_mod_no_left:
+            mi.SetCompleteness(CMolInfo::eCompleteness_no_left);
+            changed = true;
+            break;
+        case eGIBB_mod_no_right:
+            mi.SetCompleteness(CMolInfo::eCompleteness_no_right);
+            changed = true;
+            break;
+        case eGIBB_mod_est:
+            mi.SetTech(CMolInfo::eTech_est);
+            changed = true;
+            break;
+        case eGIBB_mod_sts:
+            mi.SetCompleteness(CMolInfo::eTech_sts);
+            changed = true;
+            break;
+        case eGIBB_mod_survey:
+            mi.SetCompleteness(CMolInfo::eTech_survey);
+            changed = true;
             break;
         default:
             break;
     }
-    return is_empty;
+    return changed;
+}
+
+
+void CNewCleanup_imp::x_RescueMolInfo(CBioseq& seq)
+{
+    if (!seq.IsSetDescr()) {
+        return;
+    }
+
+    CRef<CSeqdesc> d(NULL);
+    CRef<CMolInfo> mi(new CMolInfo());
+    CSeq_descr::Tdata::iterator it = seq.SetDescr().Set().begin();
+    while (it != seq.SetDescr().Set().end()) {
+        if ((*it)->IsMolinfo()) {
+            d = *it;
+            mi->Assign((*it)->GetMolinfo());
+        }
+        ++it;
+    }
+    bool any_change = false;
+    it = seq.SetDescr().Set().begin();
+    while (it != seq.SetDescr().Set().end()) {
+        bool erase = false;
+        if ((*it)->IsMol_type()) {
+            CMolInfo::TBiomol biomol = s_BiomolFromGIBBMolType((*it)->GetMol_type());
+            if (!mi->IsSetBiomol()) {
+                mi->SetBiomol(biomol);
+                any_change = true;
+                erase = true;
+            } else if (mi->GetBiomol() == biomol) {
+                erase = true;
+            }
+        } else if ((*it)->IsMethod()) {
+            CMolInfo::TTech tech = s_TechFromGIBBMethod((*it)->GetMethod());
+            if (!mi->IsSetTech()) {
+                mi->SetTech(tech);
+                any_change = true;
+                erase = true;
+            } else if (mi->GetTech() == tech) {
+                erase = true;
+            }
+        } else if ((*it)->IsModif()) {
+            ITERATE(CSeqdesc::TModif, m, (*it)->GetModif()) {
+                any_change |= SetMolinfoFromGIBBMod(*mi, *m);
+            }
+        }
+        if (erase) {
+            it = seq.SetDescr().Set().erase(it);
+            ChangeMade(CCleanupChange::eRemoveDescriptor);
+        } else {
+            ++it;
+        }
+    }
+    if (any_change) {
+        if (d) {
+            d->SetMolinfo().Assign(*mi);
+            ChangeMade(CCleanupChange::eChangeMolInfo);
+        } else {
+            d.Reset(new CSeqdesc());
+            d->SetMolinfo().Assign(*mi);
+            seq.SetDescr().Set().push_back(d);
+            ChangeMade(CCleanupChange::eAddDescriptor);
+        }
+    }
+}
+
+
+void CNewCleanup_imp::x_RemoveOldDescriptors( CSeq_descr & seq_descr )
+{
+    EDIT_EACH_SEQDESC_ON_SEQDESCR( d, seq_descr ) {
+        switch ((*d)->Which()) {
+            case CSeqdesc::e_Mol_type:
+            case CSeqdesc::e_Method:
+            case CSeqdesc::e_Org:
+                ERASE_SEQDESC_ON_SEQDESCR(d, seq_descr);
+ChangeMade(CCleanupChange::eRemoveDescriptor);
+break;
+            default:
+                break;
+        }
+    }
+}
+
+
+bool CNewCleanup_imp::x_IsGenbankBlockEmpty(const CGB_block& gbk)
+{
+    if ((gbk.IsSetExtra_accessions() && !gbk.GetExtra_accessions().empty()) ||
+        (gbk.IsSetSource() && !NStr::IsBlank(gbk.GetSource())) ||
+        (gbk.IsSetKeywords() && !gbk.GetKeywords().empty()) ||
+        (gbk.IsSetOrigin() && !NStr::IsBlank(gbk.GetOrigin())) ||
+        (gbk.IsSetDate() && !NStr::IsBlank(gbk.GetDate())) ||
+        (gbk.IsSetDiv() && !NStr::IsBlank(gbk.GetDiv()))) {
+        return false;
+    } else {
+        return true;
+    }
+}
+
+
+void CNewCleanup_imp::x_RemoveEmptyDescriptors(CSeq_descr& seq_descr)
+{
+    EDIT_EACH_SEQDESC_ON_SEQDESCR(d, seq_descr) {
+        if ((*d)->IsPub() && x_IsPubContentBad((*d)->GetPub(), false)) {
+            ERASE_SEQDESC_ON_SEQDESCR(d, seq_descr);
+            ChangeMade(CCleanupChange::eRemoveDescriptor);
+        } else if ((*d)->IsGenbank()) {
+            CGB_block& blk = (*d)->SetGenbank();
+            if (blk.IsSetTaxonomy()) {
+                blk.ResetTaxonomy();
+                ChangeMade(CCleanupChange::eChangeOther);
+            }
+            if (x_IsGenbankBlockEmpty(blk)) {
+                ERASE_SEQDESC_ON_SEQDESCR(d, seq_descr);
+                ChangeMade(CCleanupChange::eRemoveDescriptor);
+            }
+        }
+    }
+}
+
+
+bool CNewCleanup_imp::x_CleanEmptyGene(CGene_ref& gene)
+{
+    bool any_change = false;
+    if (gene.IsSetLocus() &&
+        NStr::IsBlank(gene.GetLocus())) {
+        gene.ResetLocus();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (gene.IsSetAllele() &&
+        NStr::IsBlank(gene.GetAllele())) {
+        gene.ResetAllele();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (gene.IsSetDesc() &&
+        NStr::IsBlank(gene.GetDesc())) {
+        gene.ResetDesc();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (gene.IsSetMaploc() &&
+        NStr::IsBlank(gene.GetMaploc())) {
+        gene.ResetMaploc();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (gene.IsSetLocus_tag() &&
+        NStr::IsBlank(gene.GetLocus_tag())) {
+        gene.ResetLocus_tag();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (gene.IsSetDb() && gene.GetDb().empty()) {
+        gene.ResetDb();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (gene.IsSetSyn() && gene.GetSyn().empty()) {
+        gene.ResetSyn();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    return any_change;
+}
+
+
+bool s_FeatureHasEvidenceOrInferenceQuals(const CSeq_feat& feat)
+{
+    if (!feat.IsSetQual()) {
+        return false;
+    }
+    ITERATE(CSeq_feat::TQual, it, feat.GetQual()) {
+        if ((*it)->IsSetQual() &&
+            (NStr::Equal((*it)->GetQual(), "evidence") ||
+            (NStr::Equal((*it)->GetQual(), "inference")))) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
+bool CNewCleanup_imp::x_ShouldRemoveEmptyGene(const CGene_ref& gene, const CSeq_feat& feat)
+{
+    bool should_remove = false;
+    if (!gene.IsSetLocus() &&
+        !gene.IsSetAllele() &&
+        !gene.IsSetDesc() &&
+        !gene.IsSetMaploc() &&
+        !gene.IsSetLocus_tag() &&
+        !gene.IsSetDb() &&
+        !gene.IsSetSyn() &&
+        !gene.IsSetPseudo() &&
+        !feat.IsSetPseudo() &&
+        !feat.IsSetExp_ev() &&
+        !s_FeatureHasEvidenceOrInferenceQuals(feat)) {
+        should_remove = true;
+    }
+    return should_remove;
+}
+
+
+bool CNewCleanup_imp::x_CleanEmptyProt(CProt_ref& prot)
+{
+    bool any_change = false;
+    if (prot.IsSetName() &&
+        (prot.GetName().empty() ||
+        NStr::IsBlank(prot.GetName().front()))) {
+        prot.ResetName();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (prot.IsSetEc() && prot.GetEc().empty()) {
+        prot.ResetEc();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (prot.IsSetDb() && prot.GetDb().empty()) {
+        prot.ResetDb();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (prot.IsSetActivity() && prot.GetActivity().empty()) {
+        prot.ResetActivity();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    if (prot.IsSetDesc() && NStr::IsBlank(prot.GetDesc())) {
+        prot.ResetDesc();
+        ChangeMade(CCleanupChange::eChangeOther);
+        any_change = true;
+    }
+    return any_change;
+}
+
+
+bool CNewCleanup_imp::x_ShouldRemoveEmptyProt(const CProt_ref& prot)
+{
+    if (prot.IsSetProcessed() &&
+        (prot.GetProcessed() == CProt_ref::eProcessed_signal_peptide ||
+        prot.GetProcessed() == CProt_ref::eProcessed_transit_peptide)) {
+        return false;
+    }
+
+    bool should_remove = false;
+    if (!prot.IsSetName() &&
+        !prot.IsSetDesc() &&
+        !prot.IsSetEc() &&
+        !prot.IsSetActivity() &&
+        !prot.IsSetDb()) {
+        should_remove = true;
+    }
+    return should_remove;
+}
+
+
+// if bond is other and comment can be used to set bond type, do so.
+void CNewCleanup_imp::x_BondEC(CSeq_feat& feat)
+{
+    if (feat.GetData().IsImp() && 
+        feat.GetData().GetImp().IsSetKey() &&
+        NStr::Equal(feat.GetData().GetImp().GetKey(), "misc_feature") &&
+        feat.IsSetComment() &&
+        NStr::EndsWith(feat.GetComment(), " bond")) {
+        string bond_type = feat.GetComment().substr(0, feat.GetComment().length() - 5);
+        CBondList bl;
+        if (bl.IsBondName(bond_type)) {
+            feat.SetData().SetBond(CSeqFeatData::eBond_other);
+            ChangeMade(CCleanupChange::eChangeOther);
+        }        
+    }
+}
+
+
+bool HasAuthor(const CAuthor& author)
+{
+    if (!author.IsSetName()) {
+        return false;
+    }
+    if (author.GetName().IsName()) {
+        if (!author.GetName().GetName().IsSetLast() || NStr::IsBlank(author.GetName().GetName().GetLast())) {
+            return false;
+        } else {
+            return true;
+        }
+    } else if (author.GetName().IsConsortium()) {
+        return !NStr::IsBlank(author.GetName().GetConsortium());
+    } else if (author.GetName().IsStr()) {
+        return !NStr::IsBlank(author.GetName().GetStr());
+    } else {
+        return false;
+    }
+}
+
+
+bool HasAuthor(const CAuth_list& auth_list)
+{
+    bool has_name = false;
+    if (!auth_list.IsSetNames()) {
+        return false;
+    }
+    if (auth_list.GetNames().IsStd()) {
+        ITERATE (CAuth_list::TNames::TStd, it, auth_list.GetNames().GetStd()) {
+            if (!(*it)->CanGetName()) {
+                continue;
+            }
+            const CPerson_id& pid = (*it)->GetName();
+            if (pid.IsName()  ||  pid.IsMl()  ||  pid.IsStr() || pid.IsConsortium()) {
+                has_name = true;
+                break;
+            }
+        }
+    } else if (auth_list.GetNames().IsMl()) {
+        if (!auth_list.GetNames().GetMl().empty() &&
+            !NStr::IsBlank(auth_list.GetNames().GetMl().front())) {
+            has_name = true;
+        }
+    } else if (auth_list.GetNames().IsStr()) {
+        if (!auth_list.GetNames().GetStr().empty() &&
+            !NStr::IsBlank(auth_list.GetNames().GetStr().front())) {
+            has_name = true;
+        }
+    }
+    return has_name;
+}
+
+
+bool HasAuthor(const CPubdesc& pub, bool strict)
+{
+    if (!pub.IsSetPub()) {
+        return false;
+    }
+    
+    bool is_patent = false;
+    bool any_authors = false;
+    ITERATE(CPubdesc::TPub::Tdata, it, pub.GetPub().Get()) {
+        if ((*it)->IsPatent()) {
+            if (!strict) {
+                // if patent and not strict, just patent is ok
+                return true;
+            }
+        }
+        if ((*it)->IsSetAuthors()) {
+            any_authors = true;
+            if (HasAuthor((*it)->GetAuthors())) {
+                return true;
+            }
+        }
+    }
+    if (strict) {
+        return false;
+    } else if (any_authors) {
+        return false;
+    } else {
+        return true;
+    }
+}
+
+
+bool IsMinimal(const CCit_gen& gen)
+{
+    // note: Yes, a gen pub is minimal if it DOES have a citation
+    // but not journal, authors, volume, and pages
+    // copied logic from C Toolkit
+    if (gen.IsSetCit() &&
+        !gen.IsSetJournal() &&
+        !gen.IsSetAuthors() &&
+        !gen.IsSetVolume() &&
+        !gen.IsSetPages()) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+#define CHECK_TITLE(Title_type) \
+    case CTitle::C_E::e_##Title_type: \
+        if (!NStr::IsBlank((*title)->Get##Title_type())) { \
+            has_title = true; \
+        } \
+        break;
+
+
+bool CNewCleanup_imp::x_IsPubContentBad(const CId_pat& pat)
+{
+    if (pat.IsSetCountry() && !NStr::IsBlank(pat.GetCountry())) {
+        return false;
+    }
+    if (pat.IsSetDoc_type() && !NStr::IsBlank(pat.GetDoc_type())) {
+        return false;
+    }
+    if (!pat.IsSetId()) {
+        return false;
+    } else if (pat.GetId().IsApp_number() && !NStr::IsBlank(pat.GetId().GetApp_number())) {
+        return false;
+    } else if (pat.GetId().IsNumber() && !NStr::IsBlank(pat.GetId().GetNumber())) {
+        return false;
+    }
+
+    return true;
+}
+
+
+bool CNewCleanup_imp::x_IsPubContentBad(const CPub& pub)
+{
+    if (pub.IsGen() && IsMinimal(pub.GetGen())) {
+        return true;
+    } else if (pub.IsMuid() && pub.GetMuid() == 0) {
+        return true;
+    } else if (pub.IsPmid() && pub.GetPmid() == 0) {
+        return true;
+    } else if (pub.IsPat_id() && x_IsPubContentBad(pub.GetPat_id())) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+bool CNewCleanup_imp::x_IsPubContentBad(const CPubdesc& pub, bool strict)
+{
+    // remove if no pubs at all
+    if (!pub.IsSetPub() || pub.GetPub().Get().empty()) {
+        return true;
+    }
+
+    // keep anything with a figure - backbone entry
+    if (pub.IsSetFig() && !NStr::IsBlank(pub.GetFig())) {
+        return false;
+    }
+
+    // if strict, must have at least one author name
+    if (!HasAuthor(pub, strict)) {
+        return true;
+    }
+
+    // remove if only one pub and that pub is bad
+    if (pub.IsSetPub() && pub.GetPub().Get().size() == 1 &&
+        x_IsPubContentBad(*(pub.GetPub().Get().front()))) {
+        return true;
+    }
+
+    ITERATE(CPubdesc::TPub::Tdata, it, pub.GetPub().Get()) {
+        if ((*it)->IsArticle()) {
+            // all CitArt from journal must have journal title and imprint
+            const CCit_art& art = (*it)->GetArticle();
+            if (art.IsSetFrom() && art.GetFrom().IsJournal()) {
+                const CCit_jour& jour = art.GetFrom().GetJournal(); 
+                if (!jour.IsSetImp()) {
+                    return true;
+                }
+                bool has_title = false;
+                if (jour.IsSetTitle() && !jour.GetTitle().Get().empty()) {
+                    ITERATE(CCit_jour::TTitle::Tdata, title, jour.GetTitle().Get()) {
+                        switch ((*title)->Which()) {
+                            CHECK_TITLE(Name)
+                            CHECK_TITLE(Tsub)
+                            CHECK_TITLE(Trans)
+                            CHECK_TITLE(Jta)
+                            CHECK_TITLE(Iso_jta)
+                            CHECK_TITLE(Ml_jta)
+                            CHECK_TITLE(Coden)
+                            CHECK_TITLE(Issn)
+                            CHECK_TITLE(Abr)
+                            CHECK_TITLE(Isbn)
+                            default:
+                                break;
+                        }
+                    }                    
+                }
+                if (!has_title) {
+                    return true;
+                }
+            }
+        }
+    }
+    return false;
+}
+
+
+bool CNewCleanup_imp::x_ShouldRemoveEmptyPub(const CPubdesc& pub)
+{
+    return x_IsPubContentBad(pub, false);
+}
+
+
+bool CNewCleanup_imp::x_CleanEmptyFeature(CSeq_feat& feat)
+{
+    bool any_change = false;
+    if (!feat.IsSetData()) {
+        return false;
+    }
+    switch (feat.GetData().Which()) {
+    case CSeqFeatData::e_Gene:
+        any_change = x_CleanEmptyGene(feat.SetData().SetGene());
+        if (x_ShouldRemoveEmptyGene(feat.GetData().GetGene(), feat) &&
+            feat.IsSetComment() && !NStr::IsBlank(feat.GetComment())) {
+            feat.SetData().SetImp().SetKey("misc_feature");
+            any_change = true;
+        }
+        break;
+    case CSeqFeatData::e_Prot:
+        any_change = x_CleanEmptyProt(feat.SetData().SetProt());
+        if (x_ShouldRemoveEmptyProt(feat.GetData().GetProt()) &&
+            feat.IsSetComment() && !NStr::IsBlank(feat.GetComment())) {
+            if (!NStr::EqualNocase(feat.GetComment(), "putative")) {
+                feat.SetData().SetProt().SetName().push_back(feat.GetComment());
+                feat.ResetComment();
+            }
+            any_change = true;
+        }
+        break;
+    default:
+        break;
+    }
+
+    return any_change;
+}
+
+
+bool CNewCleanup_imp::x_ShouldRemoveEmptyFeature(const CSeq_feat& feat)
+{
+    bool is_empty = false;
+
+    if (!feat.IsSetData()) {
+        return false;
+    }
+    switch (feat.GetData().Which()) {
+        case CSeqFeatData::e_Gene:
+            is_empty = x_ShouldRemoveEmptyGene(feat.GetData().GetGene(), feat);
+            break;
+        case CSeqFeatData::e_Prot:
+            is_empty = x_ShouldRemoveEmptyProt(feat.GetData().GetProt());
+            break;
+        case CSeqFeatData::e_Pub:
+            is_empty = x_ShouldRemoveEmptyPub(feat.GetData().GetPub());
+            break;
+        case CSeqFeatData::e_Comment:
+            if (!feat.IsSetComment() || NStr::IsBlank(feat.GetComment())) {
+                is_empty = true;
+            }
+            break;
+        default:
+            break;
+    }
+    return is_empty;
+}
+
+void CNewCleanup_imp::x_RemoveEmptyFeatures( CSeq_annot & seq_annot )
+{
+    if (seq_annot.IsFtable()) {
+        bool any_erasures = true;
+        while (any_erasures) {
+            any_erasures = false;
+            CSeq_annot::C_Data::TFtable::iterator it = seq_annot.SetData().SetFtable().begin();
+            while (it != seq_annot.SetData().SetFtable().end()) {
+                CRef<CSeq_feat> editable(new CSeq_feat());
+                editable->Assign(**it);
+                bool changed = x_CleanEmptyFeature(*editable);
+                bool should_remove = x_ShouldRemoveEmptyFeature(*editable);
+                if (should_remove) {
+                    CSeq_feat_Handle fh = m_Scope->GetSeq_featHandle(**it);
+                    CSeq_feat_EditHandle eh(fh);
+                    eh.Remove();
+                    any_erasures = true;
+                    break;
+                } else if (changed) {
+                    CSeq_feat_Handle fh = m_Scope->GetSeq_featHandle(**it);
+                    CSeq_feat_EditHandle eh(fh);
+                    eh.Replace(*editable);
+                }
+                ++it;
+            }
+        }
+    }
+}
+
+
+bool s_IsGenomeAnnotationStart(const CUser_object& user)
+{
+    if (user.GetObjectType() == CUser_object::eObjectType_StructuredComment &&
+        user.IsSetData()) {
+        try {
+            const CUser_field& prefix = user.GetField("StructuredCommentPrefix");
+            if (prefix.IsSetData() && prefix.GetData().IsStr() &&
+                NStr::Equal(prefix.GetData().GetStr(), "##Genome-Annotation-Data-START##")) {
+                return true;
+            }
+        } catch (CException& e) {
+
+        }
+    }
+    return false;                
+}
+
+
+bool s_RetainEmptyAnnot(const CSeq_annot& annot)
+{
+    if (!annot.IsSetDesc()) {
+        return false;
+    }
+    ITERATE(CSeq_annot::TDesc::Tdata, it, annot.GetDesc().Get()) {
+        if ((*it)->IsUser() && s_IsGenomeAnnotationStart((*it)->GetUser())) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
+bool CNewCleanup_imp::ShouldRemoveAnnot(const CSeq_annot& annot)
+{
+    if (!s_RetainEmptyAnnot(annot) &&
+        (annot.IsFtable() && annot.GetData().GetFtable().empty()) ||
+        !annot.IsSetData()) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+void CNewCleanup_imp::x_RemoveEmptyFeatureTables( CBioseq & bioseq )
+{
+    if (bioseq.IsSetAnnot()) {
+        bool any_erasures = true;
+        while (any_erasures) {
+            any_erasures = false;
+            CBioseq::TAnnot::iterator it = bioseq.SetAnnot().begin();
+            while (it != bioseq.SetAnnot().end()) {
+                if ((*it)->IsFtable()) {
+                    x_RemoveEmptyFeatures(**it);
+                }
+                if (ShouldRemoveAnnot(**it)) {
+                    CSeq_annot_Handle ah = m_Scope->GetSeq_annotHandle(**it);
+                    CSeq_annot_EditHandle eh(ah);
+                    eh.Remove();
+                    any_erasures = true;
+                    ChangeMade(CCleanupChange::eChangeOther);
+                    break;
+                } else {
+                    ++it;
+                }
+            }
+        }
+        if (bioseq.GetAnnot().empty()) {
+            bioseq.ResetAnnot();
+            ChangeMade(CCleanupChange::eChangeOther);
+        }
+    }
+}
+
+void CNewCleanup_imp::x_RemoveEmptyFeatureTables( CBioseq_set & bioseq_set )
+{
+    if (bioseq_set.IsSetAnnot()) {
+        bool any_erasures = true;
+        while (any_erasures) {
+            any_erasures = false;
+            CBioseq::TAnnot::iterator it = bioseq_set.SetAnnot().begin();
+            while (it != bioseq_set.SetAnnot().end()) {
+                if ((*it)->IsFtable()) {
+                    x_RemoveEmptyFeatures(**it);
+                } 
+                if (ShouldRemoveAnnot(**it)) {
+                    CSeq_annot_Handle ah = m_Scope->GetSeq_annotHandle(**it);
+                    CSeq_annot_EditHandle eh(ah);
+                    eh.Remove();
+                    any_erasures = true;
+                    ChangeMade(CCleanupChange::eChangeOther);
+                    break;
+                } else {
+                    ++it;
+                }
+            }
+        }
+    }
+    if (bioseq_set.GetAnnot().empty()) {
+        bioseq_set.ResetAnnot();
+        ChangeMade(CCleanupChange::eChangeOther);
+    }
+}
+
+
+bool s_IsMergeableFeatureTable(const CSeq_annot& annot)
+{
+    if (!annot.IsFtable() ||
+        annot.IsSetId() ||
+        annot.IsSetName() ||
+        annot.IsSetDb() ||
+        annot.IsSetDesc()) {
+        return false;
+    } else {
+        return true;
+    }
+
+}
+
+
+void CNewCleanup_imp::x_MergeAdjacentFeatureTables(list< CRef< CSeq_annot > > & annot_list)
+{
+    if (annot_list.size() < 2) {
+        return;
+    }
+    bool any_erased = true;
+    while (any_erased) {
+        any_erased = false;
+        CBioseq::TAnnot::iterator it = annot_list.begin();
+        CBioseq::TAnnot::iterator it_next = it;
+        ++it_next;
+        while (it_next != annot_list.end())
+        {
+            if (s_IsMergeableFeatureTable(**it) &&
+                s_IsMergeableFeatureTable(**it_next)) {
+                CSeq_annot_EditHandle eh1 = m_Scope->GetSeq_annotEditHandle(**it);
+                CSeq_annot_EditHandle eh2 = m_Scope->GetSeq_annotEditHandle(**it_next);
+                while ((*it_next)->IsSetData() && !(*it_next)->GetData().GetFtable().empty()) {
+                    CSeq_feat_Handle fh = m_Scope->GetSeq_featHandle(*((*it_next)->GetData().GetFtable().front()));
+                    CSeq_feat_EditHandle efh(fh);
+                    eh1.TakeFeat(efh);
+                }
+                eh2.Remove();
+                ChangeMade(CCleanupChange::eRemoveAnnot);
+                any_erased = true;
+                break;
+            }
+            ++it_next;
+            ++it;
+        }
+    }
+}
+
+
+void CNewCleanup_imp::x_MergeAdjacentFeatureTables( CBioseq & bioseq )
+{
+    if (bioseq.IsSetAnnot()) {
+        x_MergeAdjacentFeatureTables(bioseq.SetAnnot());
+    }
+}
+
+
+void CNewCleanup_imp::x_MergeAdjacentFeatureTables( CBioseq_set & bioseq_set )
+{
+    if (bioseq_set.IsSetAnnot()) {
+        x_MergeAdjacentFeatureTables(bioseq_set.SetAnnot());
+    }
+}
+
+
+CRef<CBioSource> BioSourceFromImpFeat(const CSeq_feat& sf)
+{
+    CRef<CBioSource> src(NULL);
+    if (!sf.IsSetQual()) {
+        return src;
+    }
+
+    ITERATE(CSeq_feat::TQual, it, sf.GetQual()) {
+        if ((*it)->IsSetQual() && NStr::Equal((*it)->GetQual(), "organism") && (*it)->IsSetVal()) {
+            src.Reset(new CBioSource());
+            src->SetOrg().SetTaxname((*it)->GetVal());
+        }
+    }
+    if (!src) {
+        return src;
+    }
+    
+    ITERATE(CSeq_feat::TQual, it, sf.GetQual()) {
+        if ((*it)->IsSetQual() && (*it)->IsSetVal()) {
+            const string qual = NStr::Replace(GET_FIELD(**it, Qual), "_", "-");
+            const string &val = GET_FIELD(**it, Val);
+
+            // determine whether we should convert this gbqual into an orgmod
+            string mod_val = qual + "=" + val;
+            size_t val_pos;
+            COrgMod::TSubtype ost;
+            CSubSource::TSubtype sst;
+            bool do_gbqual_to_orgmod =
+                s_StringHasOrgModPrefix(mod_val, val_pos, ost) ||
+                s_StringHasSubSourcePrefix(mod_val, val_pos, sst);
+
+            // if required, do the conversion
+            if (do_gbqual_to_orgmod) {
+                src->SetOrg().SetMod().push_back(mod_val);
+            }
+            CBioSource::EGenome genome = CBioSource::GetGenomeByOrganelle(qual);
+
+            if (genome != CBioSource::eGenome_unknown && 
+                (!src->IsSetGenome() || 
+                (src->GetGenome() == CBioSource::eGenome_mitochondrion && genome == CBioSource::eGenome_kinetoplast))) {
+                src->SetGenome(genome);
+            }
+        }
+    }
+    if (sf.IsSetComment() && !NStr::IsBlank(sf.GetComment())) {
+        CRef<COrgMod> note(new COrgMod());
+        note->SetSubtype(COrgMod::eSubtype_other);
+        note->SetSubname(sf.GetComment());
+        src->SetOrg().SetOrgname().SetMod().push_back(note);
+    }
+    return src;
+}
+
+
+void CNewCleanup_imp::x_RemoveOldFeatures(CBioseq & bioseq)
+{
+    CBioseq_Handle bh = m_Scope->GetBioseqHandle(bioseq);
+
+    CSeqdesc_CI src(bh, CSeqdesc::e_Source);
+    bool any_erasures = true;
+    while (any_erasures) {
+        any_erasures = false;
+        CFeat_CI f(bh);
+        while (f) {
+            if (f->IsSetData() &&
+                (f->GetData().IsOrg() ||
+                (f->GetData().IsImp() && f->GetData().GetImp().IsSetKey() &&
+                NStr::Equal(f->GetData().GetImp().GetKey(), "source")))) {
+                if (src) {
+                    // remove import source features if source descriptor already present
+                    CSeq_feat_Handle fh(*f);
+                    CSeq_feat_EditHandle eh(fh);
+                    eh.Remove();
+                    any_erasures = true;
+                    ChangeMade(CCleanupChange::eRemoveFeat);
+                    break;
+                } else {
+                    // convert imp-source feature to biosource
+                    CRef<CBioSource> bsrc = BioSourceFromImpFeat(*(f->GetSeq_feat()));
+                    if (bsrc) {
+                        x_ConvertOrgref_modToSubSource(*bsrc);
+                        x_ConvertOrgref_modToOrgMod(bsrc->SetOrg());
+                        BiosourceBC(*bsrc);
+                        CRef<CSeqdesc> d(new CSeqdesc());
+                        d->SetSource().Assign(*bsrc);
+                        CBioseq_EditHandle eh(bh);
+                        eh.SetDescr().Set().push_back(d);
+                        ChangeMade(CCleanupChange::eAddDescriptor);
+#if 0
+                        // and remove feature if whole location
+                        if (f->GetLocation().IsInt() &&
+                            f->GetLocation().GetStart(eExtreme_Positional) == 0 &&
+                            f->GetLocation().GetStop(eExtreme_Positional) == bh.GetBioseqLength() - 1) {
+                            CSeq_feat_Handle fh(*f);
+                            CSeq_feat_EditHandle eh(fh);
+                            eh.Remove();
+                            ChangeMade(CCleanupChange::eRemoveFeat);
+                            any_erasures = true;
+                        }
+#endif
+                    }
+                }
+            }
+            ++f;
+        }
+    }
+
+}
+
+
+void CNewCleanup_imp::x_BioseqSetEC( CBioseq_set & bioseq_set )
+{
+    // put general Bioseq-set cleanup here:
+    // ...
+
+    // special logic for various bioseq_set types:
+    switch( GET_FIELD_OR_DEFAULT(
+        bioseq_set, Class, NCBI_BIOSEQSETCLASS(not_set)) )
+    {
+        case CBioseq_set::eClass_nuc_prot:
+            x_BioseqSetNucProtEC( bioseq_set );
+            break;
+        case CBioseq_set::eClass_genbank:
+            x_BioseqSetGenBankEC(bioseq_set);
+            x_RemovePopPhyBioSource(bioseq_set);
+            x_RemovePopPhyMolInfo(bioseq_set);
+            break;
+        case CBioseq_set::eClass_mut_set:
+        case CBioseq_set::eClass_pop_set:
+        case CBioseq_set::eClass_phy_set:
+        case CBioseq_set::eClass_eco_set:
+        case CBioseq_set::eClass_wgs_set:
+        case CBioseq_set::eClass_small_genome_set:
+            x_RemovePopPhyBioSource(bioseq_set);
+            x_RemovePopPhyMolInfo(bioseq_set);
+            break;
+        default:
+            // no special logic for other bioseq-set classes
+            break;
+    }
+}
+
+
+bool IsPubInSet(const CSeq_descr& descr, const CPubdesc& pub)
+{
+    bool found_a_match = false;
+    ITERATE(CBioseq::TDescr::Tdata, d, descr.Get()) {
+        if ((*d)->IsPub() && (*d)->GetPub().Equals(pub)) {
+            found_a_match = true;
+            break;
+        }
+    }
+    return found_a_match;
+}
+
+
+void CNewCleanup_imp::x_RemovePub(CSeq_entry& se, const CPubdesc& pub)
+{
+    if (se.IsSeq()) {
+        x_RemovePub(se.SetSeq(), pub);
+    } else if (se.IsSet()) {
+        x_RemovePub(se.SetSet(), pub);
+    }
+}
+
+
+void CNewCleanup_imp::x_RemovePub(CBioseq& seq, const CPubdesc& pub)
+{
+    if (seq.IsSetDescr()) {
+        x_RemovePub(seq.SetDescr(), pub);
+    }
+}
+
+
+void CNewCleanup_imp::x_RemovePub(CBioseq_set& set, const CPubdesc& pub)
+{
+    if (set.IsSetDescr()) {
+        x_RemovePub(set.SetDescr(), pub);
+    }
+}
+
+
+void CNewCleanup_imp::x_RemovePub(CSeq_descr& descr, const CPubdesc& pub)
+{
+    CSeq_descr::Tdata::iterator it = descr.Set().begin();
+    while (it != descr.Set().end()) {
+        if ((*it)->IsPub() && (*it)->GetPub().Equals(pub)) {
+            it = descr.Set().erase(it);
+            ChangeMade(CCleanupChange::eRemoveDescriptor);
+        } else {
+            ++it;
+        }
+    }
+}
+
+
+void CNewCleanup_imp::x_MovePopPhyMutPub(CBioseq_set& bioseq_set)
+{
+    if (!bioseq_set.IsSetSeq_set() || bioseq_set.GetSeq_set().empty() || !bioseq_set.IsSetClass()) {
+        return;
+    }
+    bool can_consolidate_pubs = false;
+    switch (bioseq_set.GetClass()) {
+    case CBioseq_set::eClass_mut_set:
+    case CBioseq_set::eClass_pop_set:
+    case CBioseq_set::eClass_phy_set:
+    case CBioseq_set::eClass_eco_set:
+    case CBioseq_set::eClass_wgs_set:
+    case CBioseq_set::eClass_small_genome_set:
+        can_consolidate_pubs = true;
+        break;
+    default:
+        break;
+    }
+    if (!can_consolidate_pubs) {
+        // wrong kind of set
+        return;
+    }
+
+    CBioseq_set::TSeq_set::const_iterator first = bioseq_set.GetSeq_set().begin();
+    if (!(*first)->IsSetDescr()) {
+        // no common pubs
+        return;
+    }
+
+    vector<CRef<CPubdesc> > pubs_to_remove;
+
+    ITERATE(CBioseq::TDescr::Tdata, d, (*first)->GetDescr().Get()) {
+        if ((*d)->IsPub()) {
+            bool found_every_match = true;
+            CBioseq_set::TSeq_set::const_iterator other = first;
+            ++other;
+            while (other != bioseq_set.GetSeq_set().end()) {
+                if (!(*other)->IsSetDescr()) {
+                    found_every_match = false;
+                    break;
+                }
+                
+                if (!IsPubInSet((*other)->GetDescr(), (*d)->GetPub())) {
+                    found_every_match = false;
+                    break;
+                }
+                ++other;
+            }
+            if (found_every_match) {
+                if (!bioseq_set.IsSetDescr() || !IsPubInSet(bioseq_set.GetDescr(), (*d)->GetPub())) {
+                    // copy pub to parent
+                    CRef<CSeqdesc> new_pub(new CSeqdesc());
+                    new_pub->Assign(**d);
+                    bioseq_set.SetDescr().Set().push_back(new_pub);
+                    ChangeMade(CCleanupChange::eAddDescriptor);
+                }
+                // remove from children
+                CRef<CPubdesc> pub_cpy(new CPubdesc());
+                pub_cpy->Assign((*d)->GetPub());
+                pubs_to_remove.push_back(pub_cpy);
+            }
+        }
+    }
+    NON_CONST_ITERATE(CBioseq_set::TSeq_set, s, bioseq_set.SetSeq_set()) {
+        ITERATE(vector<CRef<CPubdesc> >, d, pubs_to_remove) {
+            x_RemovePub(**s, **d);
+        }
+    }
+
+}
+
+
+// this is for CNewCleanup_imp::x_BioseqSetNucProtEC.
+// It's out here because C++ doesn't like templates on
+// local types.
+namespace {
+    // this holds info about the dblinks we've found
+    struct SDblinkDeleteInfo
+    {
+        CSeq_descr_Base::Tdata::iterator  pDBLinkDesc_iter;
+        CRef<CBioseq>                     pDBLinkDescBioseq;
+    };
+}
+
+
+void CNewCleanup_imp::x_CollapseSet(CBioseq_set& bioseq_set)
+{
+    if (bioseq_set.IsSetSeq_set() && bioseq_set.GetSeq_set().size() == 1) {
+        CBioseq_set_EditHandle p = m_Scope->GetBioseq_setEditHandle(bioseq_set);
+        CSeq_entry_Handle ch = m_Scope->GetSeq_entryHandle(*(bioseq_set.GetSeq_set().front()));
+        if (bioseq_set.GetSeq_set().front()->IsSet()) {
+            const CBioseq_set& child = bioseq_set.GetSeq_set().front()->GetSet();
+            if (child.IsSetAnnot()) {
+                while (!child.GetAnnot().empty()) {
+                    CSeq_annot_Handle ah = m_Scope->GetSeq_annotHandle(*(child.GetAnnot().front()));
+                    CSeq_annot_EditHandle eh = ah.GetEditHandle();
+                    p.TakeAnnot(eh);
+                }
+            }
+            if (child.IsSetDescr()) {
+                ITERATE(CBioseq_set::TDescr::Tdata, it, child.GetDescr().Get()) {
+                    CRef<CSeqdesc> cpy(new CSeqdesc());
+                    cpy->Assign(**it);
+                    p.AddSeqdesc(*cpy);
+                }
+            }
+            if (child.IsSetSeq_set()) {
+                while (!child.GetSeq_set().empty()) {
+                    CSeq_entry_Handle h = m_Scope->GetSeq_entryHandle(*(child.GetSeq_set().front()));
+                    CSeq_entry_EditHandle eh = h.GetEditHandle();
+                    p.TakeEntry(eh);
+                }
+            }
+            CSeq_entry_EditHandle ech = ch.GetEditHandle();
+            ech.Remove();
+            ChangeMade(CCleanupChange::eCollapseSet);
+        }
+    }
+}
+
+
+void CNewCleanup_imp::x_RemovePopPhyBioSource(CBioseq_set& set)
+{
+    if (!set.IsSetDescr()) {
+        return;
+    }
+    CBioseq_set::TDescr::Tdata::iterator d = set.SetDescr().Set().begin();
+    while (d != set.SetDescr().Set().end()) {
+        if ((*d)->IsSource()) {
+            //propagate down
+            if ((*d)->GetSource().IsSetOrg() && 
+                ((*d)->GetSource().GetOrg().IsSetTaxname() || (*d)->GetSource().GetOrg().IsSetCommon()) &&
+                set.IsSetSeq_set()) {
+                NON_CONST_ITERATE(CBioseq_set::TSeq_set, s, set.SetSeq_set()) {
+                    if ((*s)->IsSet()) {
+                        x_RemovePopPhyBioSource((*s)->SetSet(), (*d)->GetSource().GetOrg());
+                    } else if ((*s)->IsSeq()) {
+                        x_RemovePopPhyBioSource((*s)->SetSeq(), (*d)->GetSource().GetOrg());
+                    }
+                }
+            }
+            d = set.SetDescr().Set().erase(d);
+            ChangeMade(CCleanupChange::eRemoveDescriptor);
+        } else {
+            ++d;
+        }
+    }
+
+}
+
+
+void CNewCleanup_imp::x_RemovePopPhyBioSource(CBioseq_set& set, const COrg_ref& org)
+{
+    // bail if already have source descriptor
+    if (set.IsSetDescr()) {
+        ITERATE(CBioseq_set::TDescr::Tdata, d, set.GetDescr().Get()) {
+            if ((*d)->IsSource()) {
+                return;
+            }
+        }
+    }
+    CRef<CSeqdesc> src(new CSeqdesc());
+    if (org.IsSetTaxname()) {
+        src->SetSource().SetOrg().SetTaxname(org.GetTaxname());
+    }
+    if (org.IsSetCommon()) {
+        src->SetSource().SetOrg().SetCommon(org.GetCommon());
+    }
+    set.SetDescr().Set().push_back(src);
+    ChangeMade(CCleanupChange::eAddDescriptor);
+}
+
+
+void CNewCleanup_imp::x_RemovePopPhyBioSource(CBioseq& seq, const COrg_ref& org)
+{
+    // bail if already have source descriptor
+    if (seq.IsSetDescr()) {
+        ITERATE(CBioseq_set::TDescr::Tdata, d, seq.GetDescr().Get()) {
+            if ((*d)->IsSource()) {
+                return;
+            }
+        }
+    }
+    CRef<CSeqdesc> src(new CSeqdesc());
+    if (org.IsSetTaxname()) {
+        src->SetSource().SetOrg().SetTaxname(org.GetTaxname());
+    }
+    if (org.IsSetCommon()) {
+        src->SetSource().SetOrg().SetCommon(org.GetCommon());
+    }
+    seq.SetDescr().Set().push_back(src);
+    ChangeMade(CCleanupChange::eAddDescriptor);
 }
 
-void CNewCleanup_imp::x_RemoveEmptyFeatures( CSeq_annot & seq_annot )
+
+void CNewCleanup_imp::x_RemovePopPhyMolInfo(CBioseq_set& set)
 {
-    if (seq_annot.IsFtable()) {
-        CSeq_annot::C_Data::TFtable::iterator it = seq_annot.SetData().SetFtable().begin();
-        while (it != seq_annot.SetData().SetFtable().end()) {
-            if (x_ShouldRemoveEmptyFeature(**it)) {
-                it = seq_annot.SetData().SetFtable().erase(it);
-                ChangeMade(CCleanupChange::eRemoveFeat);
-            } else {
-                it++;
+    if (!set.IsSetDescr()) {
+        return;
+    }
+    CBioseq_set::TDescr::Tdata::iterator d = set.SetDescr().Set().begin();
+    while (d != set.SetDescr().Set().end()) {
+        if ((*d)->IsMolinfo()) {
+            //propagate down
+            NON_CONST_ITERATE(CBioseq_set::TSeq_set, s, set.SetSeq_set()) {
+                if ((*s)->IsSet()) {
+                    x_RemovePopPhyMolInfo((*s)->SetSet(), (*d)->GetMolinfo());
+                } else if ((*s)->IsSeq()) {
+                    x_RemovePopPhyMolInfo((*s)->SetSeq(), (*d)->GetMolinfo());
+                }
             }
+            d = set.SetDescr().Set().erase(d);
+            ChangeMade(CCleanupChange::eRemoveDescriptor);
+        } else {
+            ++d;
         }
     }
+
 }
 
-void CNewCleanup_imp::x_RemoveEmptyFeatureTables( list< CRef< CSeq_annot > >& annot_list)
+
+void CNewCleanup_imp::x_RemovePopPhyMolInfo(CBioseq_set& set, const CMolInfo& mol)
 {
-    list< CRef< CSeq_annot > >::iterator it = annot_list.begin();
-    while (it != annot_list.end()) {
-        if ((*it)->IsFtable()) {
-            x_RemoveEmptyFeatures(**it);
-            if ((*it)->GetData().GetFtable().empty()) {
-                it = annot_list.erase(it);
-                ChangeMade(CCleanupChange::eRemoveAnnot);
-            } else {
-                it++;
+    // bail if already have source descriptor
+    if (set.IsSetDescr()) {
+        ITERATE(CBioseq_set::TDescr::Tdata, d, set.GetDescr().Get()) {
+            if ((*d)->IsMolinfo()) {
+                return;
             }
-        } else {
-            it++;
         }
     }
+    CRef<CSeqdesc> mi(new CSeqdesc());
+    mi->SetMolinfo().Assign(mol);
+    set.SetDescr().Set().push_back(mi);
+    ChangeMade(CCleanupChange::eAddDescriptor);
 }
 
 
-void CNewCleanup_imp::x_RemoveEmptyFeatureTables( CBioseq & bioseq )
+void CNewCleanup_imp::x_RemovePopPhyMolInfo(CBioseq& seq, const CMolInfo& mol)
 {
-    if (bioseq.IsSetAnnot()) {
-        x_RemoveEmptyFeatureTables(bioseq.SetAnnot());
-        if (bioseq.GetAnnot().empty()) {
-            bioseq.ResetAnnot();
+    // bail if already have MolInfo descriptor
+    if (seq.IsSetDescr()) {
+        ITERATE(CBioseq_set::TDescr::Tdata, d, seq.GetDescr().Get()) {
+            if ((*d)->IsMolinfo()) {
+                return;
+            }
         }
     }
+    CRef<CSeqdesc> mi(new CSeqdesc());
+    mi->SetMolinfo().Assign(mol);
+    seq.SetDescr().Set().push_back(mi);
+    ChangeMade(CCleanupChange::eAddDescriptor);
 }
 
-void CNewCleanup_imp::x_RemoveEmptyFeatureTables( CBioseq_set & bioseq_set )
+
+void CNewCleanup_imp::x_MoveNPTitle(CBioseq_set& set)
 {
-    if (bioseq_set.IsSetAnnot()) {
-        x_RemoveEmptyFeatureTables(bioseq_set.SetAnnot());
-        if (bioseq_set.GetAnnot().empty()) {
-            bioseq_set.ResetAnnot();
+    if (!set.IsSetDescr() || !set.IsSetSeq_set()) {
+        return;
+    }
+    CConstRef<CSeqdesc> set_title(NULL);
+    ITERATE(CSeq_descr::Tdata, d, set.GetDescr().Get()) {
+        if ((*d)->IsTitle()) {
+            set_title = *d;
+        }
+    }
+    if (!set_title) {
+        return;
+    }
+    bool have_nuc_title = false;
+    ITERATE(CBioseq_set::TSeq_set, it, set.GetSeq_set()) {
+        if ((*it)->IsSeq() && (*it)->GetSeq().IsNa()) {
+            ITERATE(CSeq_descr::Tdata, d, (*it)->GetSeq().GetDescr().Get()) {
+                if ((*d)->IsTitle()) {
+                    have_nuc_title = true;
+                    break;
+                }
+            }
+            if (!have_nuc_title) {
+                CRef<CSeqdesc> new_title(new CSeqdesc());
+                new_title->Assign(*set_title);
+                CBioseq_Handle b = m_Scope->GetBioseqHandle((*it)->GetSeq());
+                CBioseq_EditHandle eh = b.GetEditHandle();
+                eh.AddSeqdesc(*new_title);
+                ChangeMade(CCleanupChange::eAddDescriptor);
+                have_nuc_title = true;
+            }
+        }
+    }
+    if (have_nuc_title) {
+        //either we already had a nuc title or we copied the one from the set
+        //now remove set title
+        CBioseq_set_Handle b = m_Scope->GetBioseq_setHandle(set);
+        CBioseq_set_EditHandle eh = b.GetEditHandle();
+        CSeq_descr::Tdata::iterator d = eh.SetDescr().Set().begin();
+        while (d != eh.SetDescr().Set().end()) {
+            if ((*d)->IsTitle()) {
+                d = eh.SetDescr().Set().erase(d);
+                ChangeMade(CCleanupChange::eRemoveDescriptor);
+            } else {
+                ++d;
+            }
+        }
+        if (eh.SetDescr().Set().empty()) {
+            eh.ResetDescr();
         }
     }
 }
 
 
-void CNewCleanup_imp::x_BioseqSetEC( CBioseq_set & bioseq_set )
+void CNewCleanup_imp::x_BioseqSetNucProtEC(CBioseq_set & bioseq_set)
 {
-    // put general Bioseq-set cleanup here:
-    // ...
+    x_MoveNpSrc(bioseq_set);
+    x_MoveNpPub(bioseq_set);
+    x_MoveNpDBlinks(bioseq_set);
+    x_MoveNPTitle(bioseq_set);
+}
 
-    // special logic for various bioseq_set types:
-    switch( GET_FIELD_OR_DEFAULT(
-        bioseq_set, Class, NCBI_BIOSEQSETCLASS(not_set)) )
-    {
-    case NCBI_BIOSEQSETCLASS(nuc_prot):
-        x_BioseqSetNucProtEC( bioseq_set );
-        break;
-    default:
-        // no special logic for other bioseq-set classes
-        break;
+
+void CNewCleanup_imp::x_RemoveNestedGenBankSet(CBioseq_set & bioseq_set)
+{
+    if (bioseq_set.IsSetSeq_set() && bioseq_set.GetSeq_set().size() == 1 &&
+        bioseq_set.GetSeq_set().front()->IsSet() &&
+        bioseq_set.GetSeq_set().front()->GetSet().IsSetClass() &&
+        bioseq_set.GetSeq_set().front()->GetSet().GetClass() == CBioseq_set::eClass_genbank) {
+        x_CollapseSet(bioseq_set);
     }
+    
 }
 
-// this is for CNewCleanup_imp::x_BioseqSetNucProtEC.
-// It's out here because C++ doesn't like templates on
-// local types.
-namespace {
-    // this holds info about the dblinks we've found
-    struct SDblinkDeleteInfo
-    {
-        CSeq_descr_Base::Tdata::iterator  pDBLinkDesc_iter;
-        CRef<CBioseq>                     pDBLinkDescBioseq;
-    };
+
+void CNewCleanup_imp::x_BioseqSetGenBankEC(CBioseq_set & bioseq_set)
+{
+    // clean up nested GenBank sets
+    x_RemoveNestedGenBankSet(bioseq_set);
+    //propagate source descriptors to set components
+    if (bioseq_set.IsSetDescr() && bioseq_set.IsSetSeq_set() && !bioseq_set.GetSeq_set().empty()) {  
+        CBioseq_set::TDescr::Tdata::iterator it = bioseq_set.SetDescr().Set().begin();
+        while (it != bioseq_set.SetDescr().Set().end()) {
+            if ((*it)->IsSource()) {
+                NON_CONST_ITERATE(CBioseq_set::TSeq_set, s, bioseq_set.SetSeq_set()) {
+                    CRef<CSeqdesc> cpy(new CSeqdesc());
+                    cpy->Assign(**it);
+                    if ((*s)->IsSeq()) {
+                        (*s)->SetSeq().SetDescr().Set().push_back(cpy);
+                    } else if ((*s)->IsSet()) {
+                        (*s)->SetSet().SetDescr().Set().push_back(cpy);
+                    }
+                }
+                it = bioseq_set.SetDescr().Set().erase(it);
+                ChangeMade(CCleanupChange::eAddDescriptor);
+                ChangeMade(CCleanupChange::eRemoveDescriptor);
+            } else {
+                ++it;
+            }
+        }
+        if (bioseq_set.SetDescr().Set().empty()) {
+            bioseq_set.ResetDescr();
+        }
+    }
 }
 
-void CNewCleanup_imp::x_BioseqSetNucProtEC( CBioseq_set & bioseq_set )
+
+void CNewCleanup_imp::x_MoveNpDBlinks(CBioseq_set& bioseq_set)
 {
+
     // if nuc-prot set has exactly one DBLink user-object on its
     // descendent bioseqs, move it to the nuc-prot set.
     // (identical DBLinks count as one)
@@ -10816,6 +12176,112 @@ void CNewCleanup_imp::x_BioseqSetNucProtEC( CBioseq_set & bioseq_set )
     }
 }
 
+
+void CNewCleanup_imp::x_MoveNpSrc(CRef<CSeqdesc>& srcdesc, CSeq_descr& descr)
+{
+    CBioseq::TDescr::Tdata::iterator d = descr.Set().begin();
+    while (d != descr.Set().end()) {
+        bool do_remove = false;
+        if ((*d)->IsSource()) {
+            if (srcdesc && CCleanup::AreBioSourcesMergeable(srcdesc->GetSource(), (*d)->GetSource())) {
+                CCleanup::MergeDupBioSources(srcdesc->SetSource(), (*d)->GetSource());
+                do_remove = true;
+            } else if (!srcdesc) {
+                srcdesc.Reset(new CSeqdesc());
+                srcdesc->Assign(**d);
+                do_remove = true;
+            }
+        } 
+        if (do_remove) {
+            d = descr.Set().erase(d);
+        } else {
+            ++d;
+        }
+    }
+
+}
+
+
+void CNewCleanup_imp::x_MoveNpSrc(CBioseq_set& set)
+{
+    if (!set.IsSetClass() || set.GetClass() != CBioseq_set::eClass_nuc_prot ||
+        !set.IsSetSeq_set()) {
+        return;
+    }
+    
+    bool add_desc = true;
+    CRef<CSeqdesc> srcdesc(NULL);
+    if (set.IsSetDescr()) {
+        NON_CONST_ITERATE(CBioseq_set::TDescr::Tdata, it, set.SetDescr().Set()) {
+            if ((*it)->IsSource()) {
+                srcdesc = *it;
+                add_desc = false;
+            }
+        }
+    }
+    
+
+    NON_CONST_ITERATE(CBioseq_set::TSeq_set, it, set.SetSeq_set()) {
+        if ((*it)->IsSetDescr()) {
+            if ((*it)->IsSeq()) {
+                x_MoveNpSrc(srcdesc, (*it)->SetSeq().SetDescr());
+            } else if ((*it)->IsSet()) {
+                x_MoveNpSrc(srcdesc, (*it)->SetSet().SetDescr());
+            }
+        }
+    }
+    if (add_desc && srcdesc) {
+        set.SetDescr().Set().push_back(srcdesc);
+    }
+}
+
+
+void CNewCleanup_imp::x_MoveNpPub(CBioseq_set& np_set, CSeq_descr& descr)
+{
+    CSeq_descr::Tdata::iterator d = descr.Set().begin();
+    while (d != descr.Set().end()) {
+        if ((*d)->IsPub() && np_set.IsSetDescr() && CCleanup::PubAlreadyInSet((*d)->GetPub(), np_set.GetDescr())) {
+            d = descr.Set().erase(d);
+            ChangeMade(CCleanupChange::eRemoveDescriptor);
+        } else if ((*d)->IsPub() && CCleanup::OkToPromoteNpPub((*d)->GetPub())) {
+            CRef<CSeqdesc> new_desc(new CSeqdesc());
+            new_desc->Assign(**d);
+            np_set.SetDescr().Set().push_back(new_desc);
+            d = descr.Set().erase(d);
+            ChangeMade(CCleanupChange::eMoveDescriptor);
+        } else {
+            ++d;
+        }
+    }
+
+}
+
+
+void CNewCleanup_imp::x_MoveNpPub(CBioseq_set& set)
+{
+    if (!set.IsSetClass() || set.GetClass() != CBioseq_set::eClass_nuc_prot ||
+        !set.IsSetSeq_set()) {
+        return;
+    }
+
+    NON_CONST_ITERATE(CBioseq_set::TSeq_set, it, set.SetSeq_set()) {
+        if ((*it)->IsSetDescr()) {
+            if ((*it)->IsSeq() && (*it)->GetSeq().IsSetDescr() && CCleanup::OkToPromoteNpPub((*it)->GetSeq())) {
+                x_MoveNpPub(set, (*it)->SetSeq().SetDescr());
+                if ((*it)->SetSeq().SetDescr().Set().empty()) {
+                    (*it)->SetSeq().ResetDescr();
+                }
+            } else if ((*it)->IsSet() && (*it)->GetSet().IsSetDescr()) {
+                x_MoveNpPub(set, (*it)->SetSet().SetDescr());
+                if ((*it)->SetSet().SetDescr().Set().empty()) {
+                    (*it)->SetSet().ResetDescr();
+                }
+            }
+        }
+    }
+}
+
+
 bool CNewCleanup_imp::x_IsDBLinkUserObj( const CSeqdesc & desc )
 {
         if( ! desc.IsUser() ) {
@@ -10942,6 +12408,7 @@ void CNewCleanup_imp::CreateMissingMolInfo( CBioseq& seq )
     if (seq.IsSetInst() && seq.GetInst().IsSetMol()) {
         bool is_product = false;
         CBioseq_Handle bsh = m_Scope->GetBioseqHandle(seq);
+        CFeat_CI f(bsh);
         CBioseq_set_Handle p = bsh.GetParentBioseq_set();
         if (p && p.IsSetClass() && p.GetClass() == CBioseq_set::eClass_nuc_prot) {
             p = p.GetParentBioseq_set();
@@ -10954,70 +12421,387 @@ void CNewCleanup_imp::CreateMissingMolInfo( CBioseq& seq )
                 is_product = true;
             }
         }
-        if (CCleanup::AddMissingMolInfo(seq, is_product)) {
-            ChangeMade(CCleanupChange::eChangeMolInfo);
-        }
+        if (CCleanup::AddMissingMolInfo(seq, is_product)) {
+            ChangeMade(CCleanupChange::eChangeMolInfo);
+        }
+    }
+}
+
+
+void CNewCleanup_imp::x_RemoveUnnecessaryGeneXrefs(CSeq_feat& f)
+{
+    if ( ! m_IsGpipe && !m_IsEmblOrDdbj) {
+        if (CCleanup::RemoveUnnecessaryGeneXrefs(f, *m_Scope)) {
+            ChangeMade(CCleanupChange::eRemoveGeneXref);
+        }
+    }
+}
+
+
+void CNewCleanup_imp::AddProteinTitles(CBioseq& seq)
+{
+    if (!(m_Options & CCleanup::eClean_NoProteinTitles)) {
+        // don't add if there is already a title directly on the sequence
+        if (seq.IsSetDescr()) {
+            ITERATE(CBioseq::TDescr::Tdata, it, seq.GetDescr().Get()){
+                if ((*it)->IsTitle()) {
+                    return;
+                }
+            }
+        }
+
+
+        CBioseq_Handle bsh = m_Scope->GetBioseqHandle(seq);
+        if (CCleanup::AddProteinTitle(bsh)) {
+            ChangeMade(CCleanupChange::eAddDescriptor);
+        }
+    }
+}
+
+
+void CNewCleanup_imp::ProtRefEC(CProt_ref& pr)
+{
+    if (pr.IsSetDesc()) {
+        string desc = pr.GetDesc();
+        TrimInternalSemicolons(desc);
+        if (!NStr::Equal(desc, pr.GetDesc())) {
+            pr.SetDesc(desc);
+            ChangeMade(CCleanupChange::eChangeOther);
+        }
+    }
+    if (pr.IsSetEc()) {
+        x_CleanupECNumberListEC(pr.SetEc());
+    }
+}
+
+
+bool s_LocationShouldBeExtendedToMatch(const CSeq_loc& orig, const CSeq_loc& improved)
+{
+    if ((orig.GetStrand() == eNa_strand_minus &&
+        orig.GetStop(eExtreme_Biological) > improved.GetStop(eExtreme_Biological)) ||
+        (orig.GetStrand() != eNa_strand_minus &&
+        orig.GetStop(eExtreme_Biological) < improved.GetStop(eExtreme_Biological))) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+void CNewCleanup_imp::CdRegionEC(CSeq_feat& sf)
+{
+    if (!sf.IsSetData() || !sf.GetData().IsCdregion()) {
+        return;
+    }
+
+    CCdregion& cdr = sf.SetData().SetCdregion();
+
+    if (cdr.IsSetConflict() && 
+        cdr.GetConflict() &&
+        sf.IsSetProduct()) {
+        CBioseq_Handle nuc = m_Scope->GetBioseqHandle(sf.GetLocation());
+        if (nuc) {
+            CSeqdesc_CI src(nuc, CSeqdesc::e_Source);
+            if (src && src->GetSource().IsSetGcode()) {
+                CBioseq_Handle prot = m_Scope->GetBioseqHandle(sf.GetProduct());
+                string expected;
+                CSeqTranslator::Translate(sf, *m_Scope, expected, false);
+                CSeqVector vec(prot, CBioseq_Handle::eCoding_Iupac);
+                CSeqVector_CI vi = vec.begin();
+                string::iterator si = expected.begin();
+                while (vi != vec.end() && si != expected.end() && *vi == *si) {
+                    ++vi;
+                    ++si;
+                }
+                if (vi != vec.end() || si != expected.end()) {
+                    if (CCleanup::SetMolinfoTech(prot, CMolInfo::eTech_concept_trans_a)) {
+                        ChangeMade(CCleanupChange::eChangeMolInfo);
+                    }
+                } else {
+                    cdr.ResetConflict();
+                    ChangeMade(CCleanupChange::eChangeOther);
+                }
+            }
+        }
+    }
+
+    CConstRef<CSeq_feat> mrna = sequence::GetmRNAforCDS(sf, *m_Scope);
+    CConstRef<CSeq_feat> gene = CCleanup::GetGeneForFeature(sf, *m_Scope);
+
+    CBioseq_Handle bsh = m_Scope->GetBioseqHandle(sf.GetLocation());
+    if (bsh && CCleanup::ExtendToStopIfShortAndNotPartial(sf, bsh)) {
+        CCdregion::TFrame frame = cdr.IsSetFrame() ? cdr.GetFrame() : CCdregion::eFrame_not_set;
+        if (gene && s_LocationShouldBeExtendedToMatch(gene->GetLocation(), sf.GetLocation())) {
+            CRef<CSeq_feat> new_gene(new CSeq_feat());
+            new_gene->Assign(*gene);
+            if (CCleanup::ExtendToStopCodon(*new_gene, bsh, 3, frame)) {
+                CSeq_feat_EditHandle efh = CSeq_feat_EditHandle(m_Scope->GetSeq_featHandle(*gene));
+                efh.Replace(*new_gene);
+            }
+        }
+        if (mrna && s_LocationShouldBeExtendedToMatch(mrna->GetLocation(), sf.GetLocation())) {
+            CRef<CSeq_feat> new_mrna(new CSeq_feat());
+            new_mrna->Assign(*mrna);
+            if (CCleanup::ExtendToStopCodon(*new_mrna, bsh, 3, frame)) {
+                CSeq_feat_EditHandle efh = CSeq_feat_EditHandle(m_Scope->GetSeq_featHandle(*mrna));
+                efh.Replace(*new_mrna);
+            }
+        }
+        ChangeMade(CCleanupChange::eChangeFeatureLocation);
+    }
+
+    if (sf.IsSetPseudo() && sf.GetPseudo() && sf.IsSetProduct()) {
+        if (CCleanup::RemovePseudoProduct(sf, *m_Scope)) {
+            ChangeMade(CCleanupChange::eChangeCdregion);
+        }
+    } else if (sf.IsSetProduct()) {
+        //resynch protein molinfo
+        CBioseq_Handle prot = m_Scope->GetBioseqHandle(sf.GetProduct());
+        if (prot) {
+            bool partial5 = sf.GetLocation().IsPartialStart(eExtreme_Biological);
+            bool partial3 = sf.GetLocation().IsPartialStop(eExtreme_Biological);     
+            bool feat_partial = sf.IsSetPartial() ? sf.GetPartial() : false;
+            x_SetPartialsForProtein(*(const_cast<CBioseq *>(prot.GetCompleteBioseq().GetPointer())), partial5, partial3, feat_partial);
+        }
+    }
+}
+
+
+bool CNewCleanup_imp::IsSyntheticConstruct(const CBioSource& src)
+{
+    if (!src.IsSetOrigin() || src.GetOrigin() != CBioSource::eOrigin_artificial) {
+        return false;
+    }
+    if (!src.IsSetOrg() || !src.GetOrg().IsSetTaxname() || !NStr::EqualNocase(src.GetOrg().GetTaxname(), "synthetic construct")) {
+        return false;
+    }
+    return true;
+}
+
+
+void CNewCleanup_imp::x_ExtendFeatureToCoverSequence(CSeq_feat_Handle fh, const CBioseq& seq)
+{
+    if (fh.GetLocation().IsInt() &&
+        fh.GetLocation().GetStart(eExtreme_Biological) == 0 &&
+        fh.GetLocation().GetStop(eExtreme_Biological) == seq.GetLength() - 1) {
+        // already full length, no need to change
+        return;
+    }
+
+    bool partial_start = fh.GetLocation().IsPartialStart(eExtreme_Biological);
+    bool partial_stop = fh.GetLocation().IsPartialStop(eExtreme_Biological);
+
+    CRef<CSeq_feat> new_feat(new CSeq_feat());
+    new_feat->Assign(*(fh.GetSeq_feat()));
+    new_feat->SetLocation().SetInt().SetId().Assign(*(fh.GetLocation().GetId()));
+    new_feat->SetLocation().SetInt().SetFrom(0);
+    new_feat->SetLocation().SetInt().SetTo(seq.GetLength() - 1);
+    new_feat->SetLocation().SetPartialStart(partial_start, eExtreme_Biological);
+    new_feat->SetLocation().SetPartialStop(partial_stop, eExtreme_Biological);
+
+    CSeq_feat_EditHandle eh(fh);
+    eh.Replace(*new_feat);
+    ChangeMade(CCleanupChange::eChangeFeatureLocation);
+
+}
+
+
+void CNewCleanup_imp::x_ExtendProteinFeatureOnProteinSeq(CBioseq& seq)
+{
+    // don't bother unless length greater than zero and protein
+    if (!seq.IsSetInst() ||
+        !seq.GetInst().IsSetLength() ||
+        seq.GetInst().GetLength() == 0 ||
+        !seq.GetInst().IsSetMol() ||
+        !seq.GetInst().IsAa()) {
+        return;
+    }
+    CBioseq_Handle bsh = m_Scope->GetBioseqHandle(seq);
+    if (!bsh) {
+        return;
+    }
+
+    CFeat_CI f(bsh, CSeqFeatData::eSubtype_prot);
+    if (!f) {
+        // no feature to adjust
+        return;
+    }
+
+    if (f->GetLocation().IsInt() &&
+        f->GetLocation().GetStart(eExtreme_Biological) == 0 &&
+        f->GetLocation().GetStop(eExtreme_Biological) == seq.GetLength() - 1) {
+        // already full length, no need to change
+        return;
+    }
+
+    x_ExtendFeatureToCoverSequence(*f, seq);
+}
+
+
+void CNewCleanup_imp::x_ExtendSingleGeneOnMrna(CBioseq& seq)
+{
+    // don't bother unless length greater than zero and mRNA
+    if (!seq.IsSetInst() ||
+        !seq.GetInst().IsSetLength() ||
+        seq.GetInst().GetLength() == 0 ||
+        !seq.GetInst().IsSetMol() ||
+        !seq.GetInst().IsNa()) {
+        return;
+    }
+    CBioseq_Handle bsh = m_Scope->GetBioseqHandle(seq);
+    if (!bsh) {
+        return;
+    }
+
+    CSeqdesc_CI m(bsh, CSeqdesc::e_Molinfo);
+    if (!m || !m->GetMolinfo().IsSetBiomol() || m->GetMolinfo().GetBiomol() != CMolInfo::eBiomol_mRNA) {
+        return;
+    }
+
+    // skip if synthetic construct
+    CSeqdesc_CI s(bsh, CSeqdesc::e_Source);
+    if (s && IsSyntheticConstruct(s->GetSource())) { 
+        return;
+    }
+
+    CFeat_CI f(bsh);
+    size_t num_gene = 0;
+    size_t num_mrna = 0;
+    size_t num_cds = 0;
+    CConstRef<CSeq_feat> gene(NULL);
+    while (f) {
+        if (f->IsSetData()) {
+            if (f->GetData().IsGene()) {
+                num_gene++;
+                if (num_gene > 1) {
+                    // bail if more than one gene
+                    break;
+                }
+                gene.Reset(f->GetSeq_feat());
+            } else if (f->GetData().IsCdregion()) {
+                num_cds++;
+                if (num_cds > 1) {
+                    // bail if more than one CDS
+                    break;
+                }
+            } else if (f->GetData().GetSubtype() == CSeqFeatData::eSubtype_mRNA) {
+                num_mrna++;
+                if (num_mrna > 1) {
+                    // bail if more than one mRNA
+                    break;
+                }
+            }
+        }
+        ++f;
     }
-}
 
+    if (num_gene != 1 || num_cds > 1 || num_mrna > 1) {
+        return;
+    }
 
-void CNewCleanup_imp::AddProteinTitles(CBioseq& seq)
-{
-    if (!(m_Options & CCleanup::eClean_NoProteinTitles)) {
-        CBioseq_Handle bsh = m_Scope->GetBioseqHandle(seq);
-        if (CCleanup::AddProteinTitle(bsh)) {
-            ChangeMade(CCleanupChange::eAddDescriptor);
+    if (!gene->GetLocation().IsInt()) {
+        // bail if location is multi-interval and sequence is EMBL or DDBJ
+        ITERATE(CBioseq::TId, id, seq.GetId()) {
+            if ((*id)->IsDdbj() || (*id)->IsEmbl()) {
+                return;
+            }
         }
     }
+
+    CSeq_feat_Handle fh = m_Scope->GetSeq_featHandle(*gene);
+    x_ExtendFeatureToCoverSequence(fh, seq);
 }
 
 
-void CNewCleanup_imp::ProtRefEC(CProt_ref& pr)
+void CNewCleanup_imp::MoveDbxrefs(CSeq_feat& sf)
 {
-    if (pr.IsSetDesc()) {
-        string desc = pr.GetDesc();
-        TrimInternalSemicolons(desc);
-        if (!NStr::Equal(desc, pr.GetDesc())) {
-            pr.SetDesc(desc);
-            ChangeMade(CCleanupChange::eChangeOther);
+    if (!sf.IsSetQual()) {
+        return;
+    }
+    CSeq_feat::TQual::iterator it = sf.SetQual().begin();
+    while (it != sf.SetQual().end()) {
+        if ((*it)->IsSetQual() && (*it)->IsSetVal() && NStr::Equal((*it)->GetQual(), "db_xref")) {
+            string val = (*it)->GetVal();
+            string tag, db;
+            CRef<CDbtag> dbp(new CDbtag);
+
+            if (NStr::SplitInTwo(val, ":", db, tag)) {
+                dbp->SetDb(db);
+                dbp->SetTag().SetStr(tag);
+            } else {
+                dbp->SetDb("?");
+                dbp->SetTag().SetStr(val);
+            }
+            sf.SetDbxref().push_back(dbp);
+            ChangeMade(CCleanupChange::eChangeDbxrefs);
+            ChangeMade(CCleanupChange::eRemoveQualifier);
+            it = sf.SetQual().erase(it);
+        } else {
+            ++it;
         }
     }
-    if (pr.IsSetEc()) {
-        x_CleanupECNumberListEC(pr.SetEc());
+    if (sf.GetQual().empty()) {
+        sf.ResetQual();
+    } 
+
+    if (sf.IsSetDbxref()) {
+        // sort/unique db_xrefs
+        if (!DBXREF_ON_SEQFEAT_IS_SORTED(sf, s_DbtagCompare)) {
+            SORT_DBXREF_ON_SEQFEAT(sf, s_DbtagCompare);
+            ChangeMade(CCleanupChange::eCleanDbxrefs);
+        }
     }
 }
 
 
-void CNewCleanup_imp::CdRegionEC(CSeq_feat& sf)
+void CNewCleanup_imp::MoveStandardName(CSeq_feat& sf)
 {
-    if (!sf.IsSetData() || !sf.GetData().IsCdregion()) {
+    // only for rRNAs
+    if (!sf.IsSetData() || !sf.GetData().IsRna()) {
+        return;
+    }
+    if (!sf.GetData().GetRna().IsSetType() || sf.GetData().GetRna().GetType() == CRNA_ref::eType_tmRNA) {
+        return;
+    }
+    // not for EMBL or DDBJ
+    if (m_IsEmblOrDdbj) {
         return;
     }
 
-    CCdregion& cdr = sf.SetData().SetCdregion();
-
-    if (cdr.IsSetConflict() && 
-        cdr.GetConflict() &&
-        sf.IsSetProduct()) {
-        CBioseq_Handle prot = m_Scope->GetBioseqHandle(sf.GetProduct());
-        string expected;
-        CSeqTranslator::Translate(sf, *m_Scope, expected, false);
-        CSeqVector vec(prot, CBioseq_Handle::eCoding_Iupac);
-        CSeqVector_CI vi = vec.begin();
-        string::iterator si = expected.begin();
-        while (vi != vec.end() && si != expected.end() && *vi == *si) {
-            ++vi; 
-            ++si;
-        }
-        if (vi != vec.end() || si != expected.end()) {
-            if (CCleanup::SetMolinfoTech(prot, CMolInfo::eTech_concept_trans_a)) {
-                ChangeMade(CCleanupChange::eChangeMolInfo);
+    if (!sf.IsSetQual()) {
+        return;
+    }
+    CSeq_feat::TQual::iterator it = sf.SetQual().begin();
+    while (it != sf.SetQual().end()) {
+        if ((*it)->IsSetQual() && (*it)->IsSetVal() && NStr::Equal((*it)->GetQual(), "standard_name")) {
+            string val = (*it)->GetVal();
+            const string product = sf.GetData().GetRna().GetRnaProductName();
+            if (NStr::IsBlank(product)) {
+                string remainder = "";
+                sf.SetData().SetRna().SetRnaProductName(val, remainder);
+                val = remainder;
+                ChangeMade(CCleanupChange::eChangeRNAref);
+            }
+            if (!NStr::IsBlank(val)) {
+                if (sf.IsSetComment()) {
+                    val = sf.GetComment() + "; " + val;
+                }
+                sf.SetComment(val);
+                ChangeMade(CCleanupChange::eRemoveQualifier);
             }
+            it = sf.SetQual().erase(it);
         } else {
-            cdr.ResetConflict();
-            ChangeMade(CCleanupChange::eChangeOther);
+            ++it;
         }
     }
+    if (sf.GetQual().empty()) {
+        sf.ResetQual();
+    }
+}
+
+
+void CNewCleanup_imp::CreatePubFromFeat(CSeq_feat& feat)
+{
 }
 
 
@@ -11046,8 +12830,9 @@ void CNewCleanup_imp::ResynchProteinPartials ( CSeq_feat& feat )
 
     bool cds_partial5 = cds->GetLocation().IsPartialStart(eExtreme_Biological);
     bool cds_partial3 = cds->GetLocation().IsPartialStop(eExtreme_Biological);
+    bool cds_partial_feat = cds->IsSetPartial() ? cds->GetPartial() : false;
     bool prot_partial = feat.IsSetPartial() && feat.GetPartial();
-    bool new_prot_partial = cds_partial5 || cds_partial3;
+    bool new_prot_partial = cds_partial5 || cds_partial3 || cds_partial_feat;
 
     if (cds_partial5 != feat.GetLocation().IsPartialStart(eExtreme_Biological)) {
         feat.SetLocation().SetPartialStart(cds_partial5, eExtreme_Biological);
@@ -11064,6 +12849,48 @@ void CNewCleanup_imp::ResynchProteinPartials ( CSeq_feat& feat )
 }
 
 
+void CNewCleanup_imp::x_SetPartialsForProtein(CBioseq& seq, bool partial5, bool partial3, bool feat_partial)
+{
+    CMolInfo::TCompleteness desired = GetCompletenessFromFlags(partial5, partial3, partial5 || partial3 || feat_partial);
+
+    bool found = false;
+    bool changed = false;
+    if (seq.IsSetDescr()) {
+        NON_CONST_ITERATE(CBioseq::TDescr::Tdata, it, seq.SetDescr().Set()) {
+            if ((*it)->IsMolinfo()) {
+                if ((*it)->GetMolinfo().IsSetCompleteness()) {
+                    if ((*it)->GetMolinfo().GetCompleteness() != desired) {
+                        (*it)->SetMolinfo().SetCompleteness(desired);
+                        ChangeMade(CCleanupChange::eChangeMolInfo);
+                        changed = true;
+                    }
+                } else if (desired != CMolInfo::eCompleteness_unknown && desired != CMolInfo::eCompleteness_complete) {
+                    (*it)->SetMolinfo().SetCompleteness(desired);
+                    ChangeMade(CCleanupChange::eChangeMolInfo);
+                    changed = true;
+                }
+                found = true;
+            }
+        }
+    }
+    if (!found) {
+        // no molinfo descriptor found, need to make new one
+        CRef<CSeqdesc> new_desc(new CSeqdesc());
+        new_desc->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
+        if (partial5 || partial3) {
+            new_desc->SetMolinfo().SetCompleteness(desired);
+        }
+        seq.SetDescr().Set().push_back(new_desc);
+        ChangeMade(CCleanupChange::eAddDescriptor);
+        changed = true;
+    }
+
+    if (changed) {
+        x_AddPartialToProteinTitle(seq);
+    }
+}
+
+
 void CNewCleanup_imp::ResynchPeptidePartials (
     CBioseq& seq
 )
@@ -11089,42 +12916,121 @@ void CNewCleanup_imp::ResynchPeptidePartials (
 
     bool partial5 = feat_ci->GetLocation().IsPartialStart(eExtreme_Biological);
     bool partial3 = feat_ci->GetLocation().IsPartialStop(eExtreme_Biological);
+    bool feat_partial = feat_ci->IsSetPartial() ? feat_ci->GetPartial() : false;
+    x_SetPartialsForProtein(seq, partial5, partial3, feat_partial);
+}
 
-    CMolInfo::TCompleteness desired = GetCompletenessFromFlags(partial5, partial3, partial5 || partial3);
 
-    bool found = false;
-    bool changed = false;
-    if (seq.IsSetDescr()) {
-        NON_CONST_ITERATE(CBioseq::TDescr::Tdata, it, seq.SetDescr().Set()) {
-            if ((*it)->IsMolinfo()) {
-                if ((*it)->GetMolinfo().IsSetCompleteness()) {
-                    if ((*it)->GetMolinfo().GetCompleteness() != desired) {
-                        (*it)->SetMolinfo().SetCompleteness(desired);
-                        ChangeMade(CCleanupChange::eChangeMolInfo);
-                        changed = true;
+void CNewCleanup_imp::RemoveBadProteinTitle(CBioseq& seq)
+{
+    if (!seq.IsSetInst() || !seq.GetInst().IsSetMol() || !seq.IsAa()) {
+        return;
+    }
+
+    // determine if sequence has title - if not, nothing to do here
+    if (!seq.IsSetDescr()) {
+        return;
+    }
+
+    CBioseq_Handle bsh = m_Scope->GetBioseqHandle(seq);
+    // only remove if seq is in nuc-prot set
+    // and coding region for product sequence is available
+    CBioseq_set_Handle parent = bsh.GetParentBioseq_set();
+    if (!parent || !parent.IsSetClass() || parent.GetClass() != CBioseq_set::eClass_nuc_prot) {
+        return;
+    }
+
+    string new_defline = sequence::CDeflineGenerator().GenerateDefline(bsh, sequence::CDeflineGenerator::fIgnoreExisting);
+    CBioseq::TDescr::Tdata::iterator title_it = seq.SetDescr().Set().begin();
+    while (title_it != seq.SetDescr().Set().end()) {
+        if ((*title_it)->IsTitle() && !NStr::Equal(new_defline, (*title_it)->GetTitle())) {
+            title_it = seq.SetDescr().Set().erase(title_it);
+            ChangeMade(CCleanupChange::eRemoveDescriptor);
+        } else {
+            ++title_it;
+        }
+    } 
+}
+
+
+void CNewCleanup_imp::MoveCitationQuals(CBioseq& seq)
+{
+    vector<CConstRef<CPub> > pub_list;
+    bool listed_pubs = false;
+
+    CBioseq_Handle bsh = m_Scope->GetBioseqHandle(seq);
+    CFeat_CI f(bsh);
+    while (f) {
+        if (f->IsSetQual()) {
+            bool has_citation = false;
+            ITERATE(CSeq_feat::TQual, it, f->GetQual()) {
+                if ((*it)->IsSetQual() && NStr::Equal((*it)->GetQual(), "citation")) {
+                    has_citation = true;
+                    break;
+                }
+            }
+            if (has_citation) {
+                CRef<CSeq_feat> new_feat(new CSeq_feat());
+                new_feat->Assign(*(f->GetSeq_feat()));
+                CSeq_feat::TQual::iterator it = new_feat->SetQual().begin();
+                while (it != new_feat->SetQual().end()) {
+                    bool do_remove = false;
+                    if ((*it)->IsSetQual() && NStr::Equal((*it)->GetQual(), "citation")) {
+                        if (!(*it)->IsSetVal() || !s_IsAllDigits((*it)->GetVal())) {
+                            // just delete
+                            do_remove = true;
+                        } else {
+                            // list pubs if we haven't already
+                            if (!listed_pubs) {
+                                pub_list = CCleanup::GetCitationList(bsh);
+                                listed_pubs = true;
+                            }
+                            // create appropriate Cit
+                            size_t num = NStr::StringToNonNegativeInt((*it)->GetVal());
+                            if (num <= pub_list.size()) {
+                                CRef<CPub> cp(new CPub());
+                                cp->Assign(*(pub_list[num]));
+                                new_feat->SetCit().SetPub().push_back(cp);
+                            }
+                            do_remove = true;
+                        }
+                    }
+                    if (do_remove) {
+                        it = new_feat->SetQual().erase(it);
+                    } else {
+                        ++it;
                     }
-                } else if (desired != CMolInfo::eCompleteness_unknown) {
-                    (*it)->SetMolinfo().SetCompleteness(desired);
-                    ChangeMade(CCleanupChange::eChangeMolInfo);
-                    changed = true;
                 }
-                found = true;
+                if (new_feat->GetQual().empty()) {
+                    new_feat->ResetQual();
+                }
+
+                CSeq_feat_EditHandle eh(f->GetSeq_feat_Handle());
+                eh.Replace(*new_feat);
             }
         }
+        ++f;
     }
-    if (!found) {
-        // no molinfo descriptor found, need to make new one
-        CRef<CSeqdesc> new_desc(new CSeqdesc());
-        new_desc->SetMolinfo().SetBiomol(CMolInfo::eBiomol_peptide);
-        new_desc->SetMolinfo().SetCompleteness(desired);
-        new_desc->SetMolinfo().SetTech(CMolInfo::eTech_concept_trans_a);
-        seq.SetDescr().Set().push_back(new_desc);
-        ChangeMade(CCleanupChange::eAddDescriptor);
-        changed = true;
+
+}
+
+
+void CNewCleanup_imp::x_RemoveUnseenTitles(CBioseq& seq)
+{
+    CBioseq_Handle b = m_Scope->GetBioseqHandle(seq);
+    CBioseq_EditHandle beh(b);
+    if (CCleanup::RemoveUnseenTitles(beh)) {
+        ChangeMade(CCleanupChange::eRemoveDescriptor);
     }
+}
 
-    if (changed) {
-        x_AddPartialToProteinTitle(seq);
+
+void CNewCleanup_imp::x_RemoveUnseenTitles(CBioseq_set& set)
+{
+    CBioseq_set_Handle bh = m_Scope->GetBioseq_setHandle(set);
+    CBioseq_set_EditHandle beh(bh);
+    if (CCleanup::RemoveUnseenTitles(beh)) {
+        ChangeMade(CCleanupChange::eRemoveDescriptor);
     }
 }
 
@@ -11200,6 +13106,85 @@ void CNewCleanup_imp::KeepLatestDateDesc(CSeq_descr & seq_descr)
 }
 
 
+void CNewCleanup_imp::x_RemoveOrphanedProteins(CBioseq_set& set)
+{
+    CBioseq_set_Handle bh;
+    objects::CBioseq_CI b_iter(bh, objects::CSeq_inst::eMol_aa);
+    for (; b_iter; ++b_iter)
+    {
+        CBioseq_Handle bsh = *b_iter;
+        if (sequence::GetCDSForProduct(bsh) == NULL && sequence::GetPROTForProduct(bsh) == NULL)
+        {
+            CBioseq_EditHandle eh(*b_iter);
+            eh.Remove();
+        }
+    }
+}
+
+
+void CNewCleanup_imp::x_SingleSeqSetToSeq(CBioseq_set& set)
+{
+    if (set.IsSetSeq_set() && set.GetSeq_set().size() == 1 &&
+        set.GetSeq_set().front()->IsSeq() &&
+        set.IsSetClass() && set.GetClass() == CBioseq_set::eClass_genbank) {
+        CBioseq_set_Handle bh = m_Scope->GetBioseq_setHandle(set);
+        CSeq_entry_Handle seh = bh.GetParentEntry();
+        CSeq_entry_EditHandle eh(seh);
+        // This call will remove annots/descrs from the 
+        // set and attach them to the seq.
+        eh.ConvertSetToSeq();
+    }
+}
+
+
+void CNewCleanup_imp::x_MergeDupBioSources(CSeq_descr & seq_descr)
+{
+    if (CCleanup::MergeDupBioSources(seq_descr)) {
+        ChangeMade(CCleanupChange::eRemoveDupBioSource);
+    }
+}
+
+
+bool IsTransgenic(const CBioSource& src)
+{
+    if (src.IsSetSubtype()) {
+        ITERATE(CBioSource::TSubtype, it, src.GetSubtype()) {
+            if ((*it)->IsSetSubtype() && (*it)->GetSubtype() == CSubSource::eSubtype_transgenic) {
+                return true;
+            }
+        }
+    }
+    return false;
+}
+
+
+void CNewCleanup_imp::x_ExtendedCleanupExtra(CSeq_entry_Handle seh)
+{
+    // This is for global changes
+    if (CCleanup::FixGeneXrefSkew(seh)) {
+        ChangeMade(CCleanupChange::eChangeGeneRef);
+    }
+    if (CCleanup::MoveProteinSpecificFeats(seh)) {
+        ChangeMade(CCleanupChange::eMoveFeat);
+    }
+    if (CCleanup::ConvertPubFeatsToPubDescs(seh)) {
+        ChangeMade(CCleanupChange::eAddDescriptor);
+        ChangeMade(CCleanupChange::eRemoveFeat);
+    }
+    if (CCleanup::RescueSiteRefPubs(seh)) {
+        ChangeMade(CCleanupChange::eAddDescriptor);
+        ChangeMade(CCleanupChange::eRemoveFeat);
+    }
+    if (CCleanup::ConvertSrcFeatsToSrcDescs(seh)) {
+        ChangeMade(CCleanupChange::eAddDescriptor);
+        ChangeMade(CCleanupChange::eRemoveFeat);
+    }
+    if (CCleanup::RenormalizeNucProtSets(seh)) {
+        ChangeMade(CCleanupChange::eCollapseSet);
+    }
+}
+
+
 void CNewCleanup_imp::ExtendedCleanupSeqEntry (
     CSeq_entry& seq_entry
 )
@@ -11207,7 +13192,6 @@ void CNewCleanup_imp::ExtendedCleanupSeqEntry (
 {
     // extended cleanup includes basic cleanup
     BasicCleanupSeqEntry( seq_entry );
-
     if( ! (m_Options & CCleanup::eClean_NoNcbiUserObjects) ) {
         x_AddNcbiCleanupObject(seq_entry);
     }
@@ -11215,6 +13199,8 @@ void CNewCleanup_imp::ExtendedCleanupSeqEntry (
     CAutogeneratedExtendedCleanup auto_ext_cleanup( *m_Scope, *this );
     auto_ext_cleanup.ExtendedCleanupSeqEntry( seq_entry );
     
+    CSeq_entry_Handle seh = m_Scope->GetSeq_entryHandle(seq_entry);
+    x_ExtendedCleanupExtra(seh);
     // TODO: implement more of ExtendedCleanup
 }
 
@@ -11233,6 +13219,12 @@ void CNewCleanup_imp::ExtendedCleanupSeqSubmit (
 
     CAutogeneratedExtendedCleanup auto_ext_cleanup( *m_Scope, *this );
     auto_ext_cleanup.ExtendedCleanupSeqSubmit( ss );
+    if (ss.IsSetData() && ss.GetData().IsEntrys()) {
+        NON_CONST_ITERATE(CSeq_submit::TData::TEntrys, it, ss.SetData().SetEntrys()) {
+            CSeq_entry_Handle seh = m_Scope->GetSeq_entryHandle(**it);
+            x_ExtendedCleanupExtra(seh);
+        }
+    }
 
     // TODO: implement more of ExtendedCleanup
 }
@@ -11254,20 +13246,75 @@ void CNewCleanup_imp::ExtendedCleanupSeqAnnot (
 void CNewCleanup_imp::ExtendedCleanupSeqEntryHandle (
         CSeq_entry_Handle& seh )
 {
-    // clean a copy, and then update via the edit handle
+    CSeq_entry_EditHandle edit_handle = seh.GetEditHandle();
+    CConstRef<CSeq_entry> e = seh.GetCompleteSeq_entry();
+    CSeq_entry * en = const_cast<CSeq_entry *>(e.GetPointer());
 
-    CRef<CSeq_entry> new_seq_entry( new CSeq_entry );
-    new_seq_entry->Assign( *seh.GetCompleteSeq_entry() );
+    ExtendedCleanupSeqEntry(*en);
+}
 
-    CSeq_entry_EditHandle edit_handle = seh.GetEditHandle();
 
-    ExtendedCleanupSeqEntry( *new_seq_entry );
+void CNewCleanup_imp::SetGlobalFlags(const CSeq_submit& ss)
+{
+    ResetGlobalFlags();
+    if (ss.IsEntrys()) {
+        ITERATE(CSeq_submit::TData::TEntrys, it, ss.GetData().GetEntrys()) {
+            SetGlobalFlags((**it), false);
+        }
+    }
+}
+
+
+
+
+
+void CNewCleanup_imp::SetGlobalFlags(const CSeq_entry& se, bool reset)
+{
+    if (reset) {
+        ResetGlobalFlags();
+    }
+
+    if (se.IsSeq()) {
+        SetGlobalFlags(se.GetSeq(), false);
+    } else if (se.IsSet()) {
+        SetGlobalFlags(se.GetSet(), false);
+    }
+}
+
+
+void CNewCleanup_imp::SetGlobalFlags(const CBioseq_set& set, bool reset)
+{
+    if (reset) {
+        ResetGlobalFlags();
+    }
+    if (set.IsSetSeq_set()) {
+        ITERATE(CBioseq_set::TSeq_set, it, set.GetSeq_set()) {
+            SetGlobalFlags(**it, false);
+        }
+    }
+}
+
+
+void CNewCleanup_imp::SetGlobalFlags(const CBioseq& bs, bool reset)
+{
+    if (reset) {
+        ResetGlobalFlags();
+    }
+
+    if (!CCleanup::ShouldStripPubSerial(bs)) {
+        m_StripSerial = false;
+    }
 
-    edit_handle.SelectNone();
-    if( new_seq_entry->IsSeq() ) {
-        edit_handle.SelectSeq( new_seq_entry->SetSeq() );
-    } else if( new_seq_entry->IsSet() ) {
-        edit_handle.SelectSet( new_seq_entry->SetSet() );
+    ITERATE(CBioseq::TId, id, bs.GetId()) {
+        const CSeq_id& sid = **id;
+        switch (sid.Which()) {
+            case NCBI_SEQID(Embl):
+            case NCBI_SEQID(Ddbj):
+                m_IsEmblOrDdbj = true;
+                break;
+            default:
+                break;
+        }
     }
 }
 
diff --git a/c++/src/objtools/cleanup/newcleanupp.hpp b/c++/src/objtools/cleanup/newcleanupp.hpp
index f216e19..c859651 100644
--- a/c++/src/objtools/cleanup/newcleanupp.hpp
+++ b/c++/src/objtools/cleanup/newcleanupp.hpp
@@ -38,6 +38,8 @@
 
 #include <objects/seqfeat/SeqFeatData.hpp>
 #include <objects/seqfeat/Seq_feat.hpp>
+#include <objects/seq/MolInfo.hpp>
+#include <objects/seqblock/GB_block.hpp>
 
 #include <objtools/cleanup/cleanup_change.hpp>
 
@@ -65,6 +67,7 @@ class CUser_field;
 class CUser_object;
 class CObject_id;
 class CGB_block;
+class CMolInfo;
 class CEMBL_block;
 class CPubdesc;
 class CPub_equiv;
@@ -75,6 +78,7 @@ class CCit_art;
 class CCit_book;
 class CCit_pat;
 class CCit_let;
+class CId_pat;
 class CCit_proc;
 class CCit_jour;
 class CPubMedId;
@@ -134,6 +138,9 @@ public:
     virtual ~CNewCleanup_imp ();
 
     /// Main methods
+    
+    void SetScope(CScope& scope) { m_Scope.Reset(&scope); }
+
 
     /// Basic Cleanup methods
 
@@ -185,6 +192,8 @@ public:
         CSeq_feat_Handle& sfh
     );
 
+    void BasicCleanup(CPubdesc& pd, bool strip_serial);
+
     /// Extended Cleanup methods
 
     void ExtendedCleanupSeqEntry (
@@ -203,6 +212,12 @@ public:
         CSeq_entry_Handle& seh
     );
 
+    void ExtendedCleanup(CSeq_entry_Handle& seh) { ExtendedCleanupSeqEntryHandle(seh);  }
+
+    void ExtendedCleanup(CBioSource& biosrc);
+
+    static bool ShouldRemoveAnnot(const CSeq_annot& annot);
+
 private:
 
     // many more methods and variables ...
@@ -290,6 +305,7 @@ private:
     void UserObjectBC( CUser_object &user_object );
 
     void PCRReactionSetBC( CPCRReactionSet &pcr_reaction_set );
+    void SubSourceListBC(CBioSource& biosrc);
 
     void MolInfoBC( CMolInfo &molinfo );
     void CreateMissingMolInfo( CBioseq& seq );
@@ -300,12 +316,29 @@ private:
 
     // Extended Cleanup functions
     void BioSourceEC ( CBioSource& biosrc );
+    void x_RemoveUnnecessaryGeneXrefs ( CSeq_feat& feat );
     void AddProteinTitles (CBioseq& seq);
     void ProtRefEC( CProt_ref& pr);
     void CdRegionEC( CSeq_feat& sf);
+    void x_ExtendFeatureToCoverSequence(CSeq_feat_Handle fh, const CBioseq& seq);
+    void x_ExtendProteinFeatureOnProteinSeq(CBioseq& seq);
+    void x_ExtendSingleGeneOnMrna(CBioseq& seq);
+    static bool IsSyntheticConstruct(const CBioSource& src);
+
+    void MoveDbxrefs(CSeq_feat& sf);
+    void MoveStandardName(CSeq_feat& sf);
+    void CreatePubFromFeat(CSeq_feat& sf);
     void ResynchProteinPartials ( CSeq_feat& feat );
     void ResynchPeptidePartials( CBioseq& seq );
+    void x_SetPartialsForProtein(CBioseq& prot, bool partial5, bool partial3, bool feat_partial);
+    void RemoveBadProteinTitle(CBioseq& seq);
+    void MoveCitationQuals(CBioseq& seq);
+    void x_RemoveUnseenTitles(CBioseq& seq);
+    void x_RemoveUnseenTitles(CBioseq_set& set);
     void KeepLatestDateDesc(CSeq_descr & seq_descr);
+    void x_RemoveOrphanedProteins(CBioseq_set& set);
+    void x_SingleSeqSetToSeq(CBioseq_set& set);
+    void x_MergeDupBioSources(CSeq_descr & seq_descr);
 
     // void XxxxxxBC (Cxxxxx& xxx);
 
@@ -356,7 +389,9 @@ private:
     // for rpt_unit and replace GenBank qualifiers 
     bool x_CleanupRptUnit(CGb_qual& gbq);
     bool x_CleanupRptUnitRange(string& val);
-    bool x_IsBaseRange(const string& val);
+    static bool x_IsBaseRange(const string& val);
+    static bool x_IsDotBaseRange(const string& val);
+    static bool x_IsHyphenBaseRange(const string& val);
 
 
     void x_ChangeTransposonToMobileElement(CGb_qual& gbq);
@@ -370,6 +405,8 @@ private:
     EAction x_ParseCodeBreak(const CSeq_feat& feat, CCdregion& cds, const string& str);
     EAction x_ProtGBQualBC(CProt_ref& prot, const CGb_qual& gb_qual, EGBQualOpt opt );
     void x_AddEnvSamplOrMetagenomic(CBioSource& biosrc);
+    void x_CleanupOldName(COrg_ref& org);
+    void x_CleanupOrgModNoteEC(COrg_ref& org);
     void x_AddToComment(CSeq_feat& feat, const string& comment);
 
     // publication-related cleanup
@@ -415,8 +452,6 @@ private:
 
     void x_RRNANameBC( string &name );
 
-    void x_SetFrameFromLoc( CCdregion &cdregion, const CSeq_loc &location );
-
     void x_CleanupECNumber( string &ec_num );
     void x_CleanupECNumberList( CProt_ref::TEc & ec_num_list );
     void x_CleanupECNumberListEC( CProt_ref::TEc & ec_num_list );
@@ -496,6 +531,7 @@ private:
 
     void x_DecodeXMLMarkChanged( std::string & str );
 
+
 private:
     void x_SortSeqDescs( CSeq_entry & seq_entry );
 
@@ -504,28 +540,80 @@ private:
 
     void x_RemoveDupBioSource( CBioseq_set & bioseq_set );
 
+    void x_RemoveDupPubs(CSeq_descr & descr);
+
     void x_RemoveProtDescThatDupsProtName( CProt_ref & prot );
     void x_RemoveRedundantComment( CGene_ref& gene, CSeq_feat& seq_feat );
+    void x_ExceptTextEC(string& except_text);
+
+    void x_tRNAEC(CSeq_feat& seq_feat);
+    void x_tRNACodonEC(CSeq_feat& seq_feat);
+    static bool x_IsCodonCorrect(int codon_index, int gcode, unsigned char aa);
 
     void x_RemoveEmptyUserObject( CSeq_descr & seq_descr );
+    void x_SetMolInfoTechFromGenBankBlock(CSeq_descr& seq_descr, CGB_block& block);
+    void x_SetMolInfoTechFromGenBankBlock(CSeq_descr& seq_descr);
+    static bool s_ShouldRemoveKeyword(const string& keyword, CMolInfo::TTech tech);
+    static bool x_CleanGenbankKeywords(CGB_block& blk, CMolInfo::TTech tech);
+    void x_CleanupGenbankBlock(CBioseq& seq);
+    void x_CleanupGenbankBlock(CBioseq_set& set);
     void x_CleanupGenbankBlock( CSeq_descr & seq_descr );
+    void x_CleanupGenbankBlock(CGB_block& block, bool is_patent, CConstRef<CBioSource> biosrc, CMolInfo::TTech tech);
+    static bool x_CanRemoveGenbankBlockSource(const string& src, const CBioSource& biosrc);
+    void x_RescueMolInfo(CBioseq& seq);
+    void x_RemoveOldDescriptors( CSeq_descr & seq_descr );
+    void x_RemoveEmptyDescriptors(CSeq_descr& seq_descr);
     void x_RemoveEmptyFeatures( CSeq_annot & seq_annot );
-    void x_RemoveEmptyFeatureTables( list< CRef< CSeq_annot > > & annot_list);
     void x_RemoveEmptyFeatureTables( CBioseq & bioseq );
     void x_RemoveEmptyFeatureTables( CBioseq_set & bioseq_set );
-    bool x_ShouldRemoveEmptyFeature( CSeq_feat& feat );
-    bool x_ShouldRemoveEmptyGene( CGene_ref& gene );
-    bool x_ShouldRemoveEmptyProt( CProt_ref& prot );
-    bool x_ShouldRemoveEmptyPub( CPubdesc& pubdesc );
+    void x_MergeAdjacentFeatureTables( CBioseq & bioseq );
+    void x_MergeAdjacentFeatureTables(list< CRef< CSeq_annot > > & annot_list);
+    void x_MergeAdjacentFeatureTables(CBioseq_set & bioseq_set);
+    bool x_CleanEmptyFeature(CSeq_feat& feat);
+    bool x_ShouldRemoveEmptyFeature(const CSeq_feat& feat );
+    bool x_CleanEmptyGene(CGene_ref& gene);
+    bool x_ShouldRemoveEmptyGene(const CGene_ref& gene, const CSeq_feat& feat);
+    bool x_CleanEmptyProt(CProt_ref& prot);
+    bool x_ShouldRemoveEmptyProt(const CProt_ref& prot );
+    void x_BondEC(CSeq_feat& feat);
+    static bool x_IsPubContentBad(const CPubdesc& pub, bool strict);
+    static bool x_IsPubContentBad(const CPub& pub);
+    static bool x_IsPubContentBad(const CId_pat& pat);
+    bool x_ShouldRemoveEmptyPub(const CPubdesc& pubdesc );
+    static bool x_IsGenbankBlockEmpty(const CGB_block& gbk);
+    void x_RemoveOldFeatures(CBioseq & bioseq);
 
     void x_BioseqSetEC( CBioseq_set & bioseq_set );
+    void x_CollapseSet(CBioseq_set& set);
+    void x_RemovePopPhyBioSource(CBioseq_set& set);
+    void x_RemovePopPhyBioSource(CBioseq_set& set, const COrg_ref& org);
+    void x_RemovePopPhyBioSource(CBioseq& seq, const COrg_ref& org);
+    void x_RemovePopPhyMolInfo(CBioseq_set& set);
+    void x_RemovePopPhyMolInfo(CBioseq_set& set, const CMolInfo& mol);
+    void x_RemovePopPhyMolInfo(CBioseq& seq, const CMolInfo& mol);
     void x_BioseqSetNucProtEC( CBioseq_set & bioseq_set );
+    void x_BioseqSetGenBankEC(CBioseq_set & bioseq_set);
+    void x_RemoveNestedGenBankSet(CBioseq_set & bioseq_set);
+    void x_MoveNpDBlinks(CBioseq_set& bioseq_set);
+    void x_MoveNpSrc(CBioseq_set& bioseq_set);
+    void x_MoveNpSrc(CRef<CSeqdesc>& srcdesc, CSeq_descr& descr);
+    void x_MoveNPTitle(CBioseq_set& set);
+
+    void x_MoveNpPub(CBioseq_set& bioseq_set);
+    void x_MoveNpPub(CBioseq_set& np_set, CSeq_descr& descr);
+    void x_MovePopPhyMutPub(CBioseq_set& bioseq_set);
+    void x_RemovePub(CSeq_entry& se, const CPubdesc& pub);
+    void x_RemovePub(CBioseq& seq, const CPubdesc& pub);
+    void x_RemovePub(CBioseq_set& set, const CPubdesc& pub);
+    void x_RemovePub(CSeq_descr& descr, const CPubdesc& pub);
 
     bool x_IsDBLinkUserObj( const CSeqdesc & desc );
 
     bool x_FixMiscRNA(CSeq_feat& feat);
     void x_ModernizeRNAFeat(CSeq_feat& feat);
 
+    void x_ExtendedCleanupExtra(CSeq_entry_Handle seh);
+
 protected:
 
     // variables used for the whole cleaning process
@@ -543,23 +631,16 @@ protected:
     /// Set via m_Options to synchronize Cdregion genetic codes with BioSource
     bool                  m_SyncGenCodes;
 
-    // Seq-entry variables.  We keep a stack of these and push when
-    // we enter a Seq-entry and pop when we leave.
-
-    struct SSeqEntryInfo {
-        
-        SSeqEntryInfo(void) : 
-            m_IsEmblOrDdbj(false), 
-            m_StripSerial(true) { }
-
-        /// tells if any Seq-id on any Bioseq below entry is embl or ddbj.
-        bool                  m_IsEmblOrDdbj;
-        /// set if references should NOT have serial numbers
-        /// under this entry.
-        bool                  m_StripSerial;
-    };
-    typedef std::stack<SSeqEntryInfo> TSSeqEntryInfoStack;
-    TSSeqEntryInfoStack m_SeqEntryInfoStack;
+    void SetGlobalFlags(const CSeq_entry& se, bool reset = true);
+    void SetGlobalFlags(const CSeq_submit& ss);
+    void SetGlobalFlags(const CBioseq& bs, bool reset = true);
+    void SetGlobalFlags(const CBioseq_set& set, bool reset = true);
+    void ResetGlobalFlags() { m_StripSerial = true; m_IsEmblOrDdbj = false; }
+    /// set if references should NOT have serial numbers
+    /// under this entry.
+    bool m_StripSerial;
+    /// tells if any Seq-id on any Bioseq in the blob being cleaned is embl or ddbj.
+    bool m_IsEmblOrDdbj;
 
     friend class CAutogeneratedCleanup;
     friend class CAutogeneratedExtendedCleanup;
diff --git a/c++/src/objtools/data_loaders/Makefile.in b/c++/src/objtools/data_loaders/Makefile.in
index 0c02e0a..9bc6107 100644
--- a/c++/src/objtools/data_loaders/Makefile.in
+++ b/c++/src/objtools/data_loaders/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in 485953 2015-11-30 17:53:34Z blastadm $
+# $Id: Makefile.in 481220 2015-10-07 18:23:37Z grichenk $
 
-SUB_PROJ = genbank lds2 blastdb cdd trace patcher
+SUB_PROJ = genbank lds2 blastdb patcher
 
 srcdir = @srcdir@
 include @builddir@/Makefile.meta
diff --git a/c++/src/objtools/data_loaders/genbank/Makefile.ncbi_xreader.lib b/c++/src/objtools/data_loaders/genbank/Makefile.ncbi_xreader.lib
index a14a005..29cf9f0 100644
--- a/c++/src/objtools/data_loaders/genbank/Makefile.ncbi_xreader.lib
+++ b/c++/src/objtools/data_loaders/genbank/Makefile.ncbi_xreader.lib
@@ -1,7 +1,7 @@
-# $Id: Makefile.ncbi_xreader.lib 468607 2015-05-26 18:31:30Z ucko $
+# $Id: Makefile.ncbi_xreader.lib 490251 2016-01-22 15:40:54Z vasilche $
 
 SRC = dispatcher reader writer processors \
-    reader_snp seqref blob_id split_parser request_result \
+    reader_snp seqref blob_id request_result \
     reader_id1_base reader_id2_base reader_service incr_time info_cache
 
 ASN_DEP = id1 id2 seqsplit seqset seq general
diff --git a/c++/src/objtools/data_loaders/genbank/cache/reader_cache.cpp b/c++/src/objtools/data_loaders/genbank/cache/reader_cache.cpp
index 6cc9f3d..e09c24f 100644
--- a/c++/src/objtools/data_loaders/genbank/cache/reader_cache.cpp
+++ b/c++/src/objtools/data_loaders/genbank/cache/reader_cache.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reader_cache.cpp 475255 2015-08-05 19:25:27Z vasilche $
+/*  $Id: reader_cache.cpp 494478 2016-03-07 19:26:06Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -69,7 +69,7 @@ int SCacheInfo::GetDebugLevel(void)
 }
 
 const int    SCacheInfo::BLOB_IDS_MAGIC = 0x32fd0108;
-const char* const SCacheInfo::BLOB_IDS_SUBKEY = "blobs8";
+const char* const SCacheInfo::BLOB_IDS_SUBKEY = "Blobs8";
 
 string SCacheInfo::GetBlobKey(const CBlob_id& blob_id)
 {
@@ -153,49 +153,61 @@ void SCacheInfo::GetBlob_idsSubkey(const SAnnotSelector* sel,
 
 const char* SCacheInfo::GetGiSubkey(void)
 {
-    return "gi8";
+    return "Gi";
 }
 
 
 const char* SCacheInfo::GetAccVerSubkey(void)
 {
-    return "accver";
+    return "Accver";
 }
 
 
 const char* SCacheInfo::GetLabelSubkey(void)
 {
-    return "label";
+    return "Label";
 }
 
 
 const char* SCacheInfo::GetTaxIdSubkey(void)
 {
-    return "taxid";
+    return "Taxid";
 }
 
 
 const char* SCacheInfo::GetHashSubkey(void)
 {
-    return "hash";
+    return "Hash";
+}
+
+
+const char* SCacheInfo::GetLengthSubkey(void)
+{
+    return "Length";
+}
+
+
+const char* SCacheInfo::GetTypeSubkey(void)
+{
+    return "Type";
 }
 
 
 const char* SCacheInfo::GetSeq_idsSubkey(void)
 {
-    return "ids4";
+    return "Ids";
 }
 
 
 const char* SCacheInfo::GetBlobStateSubkey(void)
 {
-    return "state4";
+    return "State";
 }
 
 
 const char* SCacheInfo::GetBlobVersionSubkey(void)
 {
-    return "ver4";
+    return "Ver";
 }
 
 
@@ -368,6 +380,14 @@ namespace {
                 }
             }
 
+        Uint1 ParseUint1(void)
+            {
+                return *x_NextBytes(1);
+            }
+        bool ParseBool(void)
+            {
+                return ParseUint1();
+            }
         Uint4 ParseUint4(void)
             {
                 const char* ptr = x_NextBytes(4);
@@ -445,7 +465,7 @@ namespace {
                               bool set_expiration_time)
     {
         if ( set_expiration_time ) {
-            m_Descr.maximum_age = result.GetIdExpirationTimeout();
+            m_Descr.maximum_age = result.GetIdExpirationTimeout(GBL::eExpire_normal);
         }
         if ( get_current_version ) {
             // Decrease blob version timeout for easier debugging
@@ -478,7 +498,7 @@ namespace {
             }
             s << ", age="<<int(m_Descr.actual_age);
         }
-        m_ExpirationTime = result.GetNewIdExpirationTime();
+        m_ExpirationTime = result.GetNewIdExpirationTime(GBL::eExpire_normal);
         if ( FoundSome() ) {
             if ( m_Descr.actual_age > m_ExpirationTime ) {
                 m_ExpirationTime = TExpirationTime(-1);
@@ -663,18 +683,6 @@ bool CCacheReader::LoadSeq_idSeq_ids(CReaderRequestResult& result,
 }
 
 
-bool CCacheReader::LoadStringSeq_ids(CReaderRequestResult& result,
-                                     const string& seq_id)
-{
-    if ( !m_IdCache ) {
-        return false;
-    }
-
-    CLoadLockSeqIds lock(result, seq_id);
-    return lock.IsLoaded() || ReadSeq_ids(result, seq_id, lock);
-}
-
-
 bool CCacheReader::LoadSeq_idGi(CReaderRequestResult& result,
                                 const CSeq_id_Handle& seq_id)
 {
@@ -702,7 +710,10 @@ bool CCacheReader::LoadSeq_idGi(CReaderRequestResult& result,
 #endif
         if ( str.Done() ) {
             conn.Release();
-            lock.SetLoadedGi(gi, str.GetExpirationTime());
+            TSequenceGi data;
+            data.gi = gi;
+            data.sequence_found = true;
+            lock.SetLoadedGi(data, str.GetExpirationTime());
             return true;
         }
     }
@@ -736,11 +747,12 @@ bool CCacheReader::LoadSeq_idAccVer(CReaderRequestResult& result,
     if ( str.Found() ) {
         string data = str.FullString();
         conn.Release();
-        CSeq_id_Handle acch;
+        TSequenceAcc acc;
         if ( !data.empty() ) {
-            acch = CSeq_id_Handle::GetHandle(data);
+            acc.acc_ver = CSeq_id_Handle::GetHandle(data);
         }
-        lock.SetLoadedAccVer(acch, str.GetExpirationTime());
+        acc.sequence_found = true;
+        lock.SetLoadedAccVer(acc, str.GetExpirationTime());
         return true;
     }
     conn.Release();
@@ -751,6 +763,26 @@ bool CCacheReader::LoadSeq_idAccVer(CReaderRequestResult& result,
         result.SetLoadedAccFromSeqIds(seq_id, ids_lock);
         return true;
     }
+    /*
+    if ( !seq_id.IsGi() ) {
+        CLoadLockGi gi_lock(result, seq_id);
+        LoadSeq_idGi(result, seq_id);
+        if ( gi_lock.IsLoadedGi() ) {
+            TSequenceGi gi = gi_lock.GetGi();
+            if ( gi.second && gi.first ) {
+                CSeq_id_Handle gi_id =
+                    CSeq_id_Handle::GetGiHandle(gi.first);
+                CLoadLockAcc gi_acc(result, gi_id);
+                LoadSeq_idAccVer(result, gi_id);
+                if ( gi_acc.IsLoadedAccVer() ) {
+                    lock.SetLoadedAccVer(gi_acc.GetAccVer(),
+                                         gi_acc.GetExpirationTime());
+                    return true;
+                }
+            }
+        }
+    }
+    */
     return false;
 }
 
@@ -832,10 +864,31 @@ bool CCacheReader::LoadSequenceHash(CReaderRequestResult& result,
     CConn conn(result, this);
     CParseBuffer str(result, m_IdCache, GetIdKey(seq_id), GetHashSubkey());
     if ( !str.Found() ) {
+        if ( !seq_id.IsGi() ) {
+            CLoadLockGi gi_lock(result, seq_id);
+            LoadSeq_idGi(result, seq_id);
+            if ( gi_lock.IsLoadedGi() ) {
+                TSequenceGi gi = gi_lock.GetGi();
+                if ( gi_lock.GetGi(gi) ) {
+                    CSeq_id_Handle gi_id =
+                        CSeq_id_Handle::GetGiHandle(gi_lock.GetGi(gi));
+                    CLoadLockHash gi_hash(result, gi_id);
+                    LoadSequenceHash(result, gi_id);
+                    if ( gi_hash.IsLoadedHash() ) {
+                        lock.SetLoadedHash(gi_hash.GetHash(),
+                                           gi_hash.GetExpirationTime());
+                        return true;
+                    }
+                }
+            }
+        }
         conn.Release();
         return false;
     }
-    int hash = str.ParseInt4();
+    TSequenceHash hash;
+    hash.hash = str.ParseInt4();
+    hash.sequence_found = str.ParseBool();
+    hash.hash_known = str.ParseBool();
     if ( !str.Done() ) {
         conn.Release();
         return false;
@@ -846,6 +899,67 @@ bool CCacheReader::LoadSequenceHash(CReaderRequestResult& result,
 }
 
 
+bool CCacheReader::LoadSequenceLength(CReaderRequestResult& result,
+                                      const CSeq_id_Handle& seq_id)
+{
+    if ( !m_IdCache ) {
+        return false;
+    }
+
+    CLoadLockLength lock(result, seq_id);
+    if ( lock.IsLoadedLength() ) {
+        return true;
+    }
+    
+    CConn conn(result, this);
+    CParseBuffer str(result, m_IdCache, GetIdKey(seq_id), GetLengthSubkey());
+    if ( !str.Found() ) {
+        conn.Release();
+        return false;
+    }
+    TSeqPos length = str.ParseUint4();
+    if ( !str.Done() ) {
+        conn.Release();
+        return false;
+    }
+    conn.Release();
+    lock.SetLoadedLength(length, str.GetExpirationTime());
+    return true;
+}
+
+
+bool CCacheReader::LoadSequenceType(CReaderRequestResult& result,
+                                    const CSeq_id_Handle& seq_id)
+{
+    if ( !m_IdCache ) {
+        return false;
+    }
+
+    CLoadLockType lock(result, seq_id);
+    if ( lock.IsLoadedType() ) {
+        return true;
+    }
+    
+    CConn conn(result, this);
+    CParseBuffer str(result, m_IdCache, GetIdKey(seq_id), GetTypeSubkey());
+    if ( !str.Found() ) {
+        conn.Release();
+        return false;
+    }
+    int type = str.ParseInt4();
+    if ( !str.Done() ) {
+        conn.Release();
+        return false;
+    }
+    conn.Release();
+    TSequenceType data;
+    data.type = CSeq_inst::EMol(type);
+    data.sequence_found = true;
+    lock.SetLoadedType(data, str.GetExpirationTime());
+    return true;
+}
+
+
 bool CCacheReader::LoadAccVers(CReaderRequestResult& result,
                                const TIds& ids, TLoaded& loaded, TIds& ret)
 {
@@ -862,9 +976,11 @@ bool CCacheReader::LoadAccVers(CReaderRequestResult& result,
             LoadSeq_idAccVer(result, ids[i]);
         }
         if ( lock.IsLoadedAccVer() ) {
-            ret[i] = lock.GetAccVer();
-            loaded[i] = true;
-            continue;
+            TSequenceAcc data = lock.GetAccVer();
+            if ( lock.IsFound(data) ) {
+                ret[i] = lock.GetAcc(data);
+                loaded[i] = true;
+            }
         }
     }
     return false;
@@ -887,9 +1003,11 @@ bool CCacheReader::LoadGis(CReaderRequestResult& result,
             LoadSeq_idGi(result, ids[i]);
         }
         if ( lock.IsLoadedGi() ) {
-            ret[i] = lock.GetGi();
-            loaded[i] = true;
-            continue;
+            TSequenceGi data = lock.GetGi();
+            if ( lock.IsFound(data) ) {
+                ret[i] = lock.GetGi(data);
+                loaded[i] = true;
+            }
         }
     }
     return false;
diff --git a/c++/src/objtools/data_loaders/genbank/cache/writer_cache.cpp b/c++/src/objtools/data_loaders/genbank/cache/writer_cache.cpp
index c6c29b5..ffe2430 100644
--- a/c++/src/objtools/data_loaders/genbank/cache/writer_cache.cpp
+++ b/c++/src/objtools/data_loaders/genbank/cache/writer_cache.cpp
@@ -1,4 +1,4 @@
-/*  $Id: writer_cache.cpp 468561 2015-05-26 15:57:12Z vasilche $
+/*  $Id: writer_cache.cpp 494478 2016-03-07 19:26:06Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -122,18 +122,6 @@ void CCacheWriter::ResetCache(void)
 }
 
 
-void CCacheWriter::SaveStringSeq_ids(CReaderRequestResult& result,
-                                     const string& seq_id)
-{
-    if ( !m_IdCache) {
-        return;
-    }
-
-    CLoadLockSeqIds ids(result, seq_id);
-    WriteSeq_ids(seq_id, ids);
-}
-
-
 void CCacheWriter::CStoreBuffer::CheckSpace(size_t add)
 {
     if ( m_Ptr + add > m_End ) {
@@ -186,22 +174,6 @@ void CCacheWriter::x_WriteId(const string& key,
 }
 
 
-void CCacheWriter::SaveStringGi(CReaderRequestResult& result,
-                                const string& seq_id)
-{
-    if( !m_IdCache) {
-        return;
-    }
-
-    CLoadLockGi lock(result, seq_id);
-    if ( lock.IsLoadedGi() ) {
-        CStoreBuffer str;
-        str.StoreInt8(lock.GetGi());
-        x_WriteId(seq_id, GetGiSubkey(), str);
-    }
-}
-
-
 void CCacheWriter::SaveSeq_idSeq_ids(CReaderRequestResult& result,
                                      const CSeq_id_Handle& seq_id)
 {
@@ -222,9 +194,11 @@ void CCacheWriter::SaveSeq_idGi(CReaderRequestResult& result,
     }
 
     CLoadLockGi lock(result, seq_id);
-    if ( lock.IsLoadedGi() ) {
+    if ( lock.IsLoadedGi() && lock.GetExpType() == GBL::eExpire_normal ) {
         CStoreBuffer str;
-        str.StoreInt8(lock.GetGi());
+        CReader::TSequenceGi data = lock.GetGi();
+        _ASSERT(lock.IsFound(data));
+        str.StoreInt8(lock.GetGi(data));
         x_WriteId(GetIdKey(seq_id), GetGiSubkey(), str);
     }
 }
@@ -238,10 +212,12 @@ void CCacheWriter::SaveSeq_idAccVer(CReaderRequestResult& result,
     }
 
     CLoadLockAcc lock(result, seq_id);
-    if ( lock.IsLoadedAccVer() ) {
+    if ( lock.IsLoadedAccVer() && lock.GetExpType() == GBL::eExpire_normal ) {
         string str;
-        if ( CSeq_id_Handle acc = lock.GetAccVer() ) {
-            str = acc.AsString();
+        CReader::TSequenceAcc acc = lock.GetAccVer();
+        _ASSERT(lock.IsFound(acc));
+        if ( lock.GetAcc(acc) ) {
+            str = lock.GetAcc(acc).AsString();
         }
         x_WriteId(GetIdKey(seq_id), GetAccVerSubkey(), str);
     }
@@ -256,8 +232,9 @@ void CCacheWriter::SaveSeq_idLabel(CReaderRequestResult& result,
     }
 
     CLoadLockLabel lock(result, seq_id);
-    if ( lock.IsLoadedLabel() ) {
+    if ( lock.IsLoadedLabel() && lock.GetExpType() == GBL::eExpire_normal ) {
         const string& str = lock.GetLabel();
+        _ASSERT(!str.empty());
         x_WriteId(GetIdKey(seq_id), GetLabelSubkey(), str);
     }
 }
@@ -271,8 +248,9 @@ void CCacheWriter::SaveSeq_idTaxId(CReaderRequestResult& result,
     }
 
     CLoadLockTaxId lock(result, seq_id);
-    if ( lock.IsLoadedTaxId() ) {
+    if ( lock.IsLoadedTaxId() && lock.GetExpType() == GBL::eExpire_normal ) {
         CStoreBuffer str;
+        _ASSERT(lock.GetTaxId() != -1);
         str.StoreInt4(lock.GetTaxId());
         x_WriteId(GetIdKey(seq_id), GetTaxIdSubkey(), str);
     }
@@ -287,14 +265,50 @@ void CCacheWriter::SaveSequenceHash(CReaderRequestResult& result,
     }
 
     CLoadLockHash lock(result, seq_id);
-    if ( lock.IsLoadedHash() ) {
+    if ( lock.IsLoadedHash() && lock.GetExpType() == GBL::eExpire_normal ) {
         CStoreBuffer str;
-        str.StoreInt4(lock.GetHash());
+        CReader::TSequenceHash data = lock.GetHash();
+        str.StoreInt4(data.hash);
+        str.StoreBool(data.sequence_found);
+        str.StoreBool(data.hash_known);
         x_WriteId(GetIdKey(seq_id), GetHashSubkey(), str);
     }
 }
 
 
+void CCacheWriter::SaveSequenceLength(CReaderRequestResult& result,
+                                      const CSeq_id_Handle& seq_id)
+{
+    if( !m_IdCache) {
+        return;
+    }
+
+    CLoadLockLength lock(result, seq_id);
+    if ( lock.IsLoadedLength() && lock.GetExpType() == GBL::eExpire_normal ) {
+        CStoreBuffer str;
+        _ASSERT(lock.GetLength() != kInvalidSeqPos);
+        str.StoreUint4(lock.GetLength());
+        x_WriteId(GetIdKey(seq_id), GetLengthSubkey(), str);
+    }
+}
+
+
+void CCacheWriter::SaveSequenceType(CReaderRequestResult& result,
+                                    const CSeq_id_Handle& seq_id)
+{
+    if( !m_IdCache) {
+        return;
+    }
+
+    CLoadLockType lock(result, seq_id);
+    if ( lock.IsLoadedType() && lock.GetExpType() == GBL::eExpire_normal ) {
+        CStoreBuffer str;
+        str.StoreInt4(lock.GetType().type);
+        x_WriteId(GetIdKey(seq_id), GetTypeSubkey(), str);
+    }
+}
+
+
 void CCacheWriter::WriteSeq_ids(const string& key,
                                 const CLoadLockSeqIds& lock)
 {
@@ -302,7 +316,7 @@ void CCacheWriter::WriteSeq_ids(const string& key,
         return;
     }
 
-    if ( !lock.IsLoaded() ) {
+    if ( !lock.IsLoaded() || lock.GetExpType() != GBL::eExpire_normal ) {
         return;
     }
 
@@ -311,6 +325,7 @@ void CCacheWriter::WriteSeq_ids(const string& key,
             CReader::CDebugPrinter s("CCacheWriter");
             s<<key<<","<<GetSeq_idsSubkey();
         }
+        _ASSERT(!lock.GetSeq_ids().empty());
         auto_ptr<IWriter> writer
             (m_IdCache->GetWriteStream(key, 0, GetSeq_idsSubkey()));
         if ( !writer.get() ) {
@@ -348,7 +363,7 @@ void CCacheWriter::SaveSeq_idBlob_ids(CReaderRequestResult& result,
     }
 
     CLoadLockBlobIds ids(result, seq_id, sel);
-    if ( !ids.IsLoaded() ) {
+    if ( !ids.IsLoaded() || ids.GetExpType() != GBL::eExpire_normal ) {
         return;
     }
 
diff --git a/c++/src/objtools/data_loaders/genbank/dispatcher.cpp b/c++/src/objtools/data_loaders/genbank/dispatcher.cpp
index 9a06567..7000a40 100644
--- a/c++/src/objtools/data_loaders/genbank/dispatcher.cpp
+++ b/c++/src/objtools/data_loaders/genbank/dispatcher.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dispatcher.cpp 452490 2014-11-20 15:50:53Z vasilche $
+/*  $Id: dispatcher.cpp 494478 2016-03-07 19:26:06Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -48,6 +48,18 @@ NCBI_DEFINE_ERR_SUBCODE_X(10);
 
 BEGIN_SCOPE(objects)
 
+NCBI_PARAM_DECL(bool, GENBANK, ALLOW_INCOMPLETE_COMMANDS);
+NCBI_PARAM_DEF_EX(bool, GENBANK, ALLOW_INCOMPLETE_COMMANDS, false,
+                  eParam_NoThread, GENBANK_ALLOW_INCOMPLETE_COMMANDS);
+
+static 
+bool s_AllowIncompleteCommands(void)
+{
+    static CSafeStatic<NCBI_PARAM_TYPE(GENBANK, ALLOW_INCOMPLETE_COMMANDS)> s_Value;
+    return s_Value->Get();
+}
+
+
 /////////////////////////////////////////////////////////////////////////////
 // CReadDispatcher
 /////////////////////////////////////////////////////////////////////////////
@@ -72,7 +84,9 @@ static CGBRequestStatistics sx_Statistics[CGBRequestStatistics::eStats_Count] =
     CGBRequestStatistics("parsed", "SNP data"),
     CGBRequestStatistics("parsed", "split data"),
     CGBRequestStatistics("parsed", "chunk data"),
-    CGBRequestStatistics("loaded", "sequence hash")
+    CGBRequestStatistics("loaded", "sequence hash"),
+    CGBRequestStatistics("loaded", "sequence length"),
+    CGBRequestStatistics("loaded", "sequence type")
 };
 
 CGBRequestStatistics::CGBRequestStatistics(const char* action,
@@ -246,45 +260,6 @@ bool CReadDispatcherCommand::MayBeSkipped(void) const
 
 
 namespace {
-    class CCommandLoadStringSeq_ids : public CReadDispatcherCommand
-    {
-    public:
-        typedef string TKey;
-        typedef CLoadLockSeqIds TLock;
-        CCommandLoadStringSeq_ids(CReaderRequestResult& result,
-                                  const TKey& key)
-            : CReadDispatcherCommand(result),
-              m_Key(key), m_Lock(result, key)
-            {
-            }
-
-        bool IsDone(void)
-            {
-                return m_Lock.IsLoaded();
-            }
-        bool Execute(CReader& reader)
-            {
-                return reader.LoadStringSeq_ids(GetResult(), m_Key);
-            }
-        string GetErrMsg(void) const
-            {
-                return "LoadStringSeq_ids("+m_Key+"): "
-                    "data not found";
-            }
-        CGBRequestStatistics::EStatType GetStatistics(void) const
-            {
-                return CGBRequestStatistics::eStat_StringSeq_ids;
-            }
-        string GetStatisticsDescription(void) const
-            {
-                return "Seq-ids(string "+m_Key+")";
-            }
-        
-    private:
-        TKey m_Key;
-        TLock m_Lock;
-    };
-
     class CCommandLoadSeq_idSeq_ids : public CReadDispatcherCommand
     {
     public:
@@ -527,6 +502,92 @@ namespace {
         TLock m_Lock;
     };
 
+    class CCommandLoadSequenceLength : public CReadDispatcherCommand
+    {
+    public:
+        typedef CSeq_id_Handle TKey;
+        typedef CLoadLockLength TLock;
+        CCommandLoadSequenceLength(CReaderRequestResult& result,
+                                 const TKey& key)
+            : CReadDispatcherCommand(result),
+              m_Key(key), m_Lock(result, key)
+            {
+            }
+
+        bool IsDone(void)
+            {
+                return m_Lock.IsLoadedLength();
+            }
+        bool Execute(CReader& reader)
+            {
+                return reader.LoadSequenceLength(GetResult(), m_Key);
+            }
+        bool MayBeSkipped(void) const
+            {
+                return true;
+            }
+        string GetErrMsg(void) const
+            {
+                return "LoadSequenceLength("+m_Key.AsString()+"): "
+                    "data not found";
+            }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_Length;
+            }
+        string GetStatisticsDescription(void) const
+            {
+                return "length("+m_Key.AsString()+")";
+            }
+        
+    private:
+        TKey m_Key;
+        TLock m_Lock;
+    };
+
+    class CCommandLoadSequenceType : public CReadDispatcherCommand
+    {
+    public:
+        typedef CSeq_id_Handle TKey;
+        typedef CLoadLockType TLock;
+        CCommandLoadSequenceType(CReaderRequestResult& result,
+                                 const TKey& key)
+            : CReadDispatcherCommand(result),
+              m_Key(key), m_Lock(result, key)
+            {
+            }
+
+        bool IsDone(void)
+            {
+                return m_Lock.IsLoadedType();
+            }
+        bool Execute(CReader& reader)
+            {
+                return reader.LoadSequenceType(GetResult(), m_Key);
+            }
+        bool MayBeSkipped(void) const
+            {
+                return true;
+            }
+        string GetErrMsg(void) const
+            {
+                return "LoadSequenceType("+m_Key.AsString()+"): "
+                    "data not found";
+            }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_Type;
+            }
+        string GetStatisticsDescription(void) const
+            {
+                return "type("+m_Key.AsString()+")";
+            }
+        
+    private:
+        TKey m_Key;
+        TLock m_Lock;
+    };
+
     bool s_Blob_idsLoaded(CLoadLockBlobIds& ids,
                           CReaderRequestResult& result,
                           const CSeq_id_Handle& seq_id)
@@ -536,13 +597,10 @@ namespace {
         }
         // check if seq-id is known as absent
         CLoadLockSeqIds seq_ids(result, seq_id, eAlreadyLoaded);
-        if ( seq_ids ) {
-            CFixedSeq_ids::TState state = seq_ids.GetState();
-            if ( state & CBioseq_Handle::fState_no_data ) {
-                // mark blob-ids as absent too
-                ids.SetNoBlob_ids(state);
-                return true;
-            }
+        if ( seq_ids && !seq_ids.GetData().IsFound() ) {
+            // mark blob-ids as absent too
+            ids.SetNoBlob_ids(seq_ids.GetState());
+            return true;
         }
         return false;
     }
@@ -590,28 +648,44 @@ namespace {
         TLock m_Lock;
     };
 
-    static
-    bool sx_BulkIsDone(const vector<CSeq_id_Handle>& ids,
+    template<class CLoadLock>
+    bool sx_IsLoaded(size_t i,
+                     CReaderRequestResult& result,
+                     const vector<CSeq_id_Handle>& ids,
+                     const vector<bool>& loaded)
+    {
+        if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+            return true;
+        }
+        CLoadLock lock(result, ids[i]);
+        if ( lock.IsLoaded() && !lock.IsFound() ) {
+            return true;
+        }
+        return false;
+    }
+
+    template<class CLoadLock>
+    bool sx_BulkIsDone(CReaderRequestResult& result,
+                       const vector<CSeq_id_Handle>& ids,
                        const vector<bool>& loaded)
     {
         for ( size_t i = 0; i < ids.size(); ++i ) {
-            if ( CReadDispatcher::CannotProcess(ids[i]) ) {
+            if ( sx_IsLoaded<CLoadLock>(i, result, ids, loaded) ) {
                 continue;
             }
-            if ( !loaded[i] ) {
-                return false;
-            }
+            return false;
         }
         return true;
     }
 
-    static
-    string sx_DescribeUnloaded(const vector<CSeq_id_Handle>& ids,
-                               const vector<bool>& loaded)
+    template<class CLoadLock>
+    string sx_DescribeError(CReaderRequestResult& result,
+                            const vector<CSeq_id_Handle>& ids,
+                            const vector<bool>& loaded)
     {
         string ret;
         for ( size_t i = 0; i < ids.size(); ++i ) {
-            if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+            if ( sx_IsLoaded<CLoadLock>(i, result, ids, loaded) ) {
                 continue;
             }
             if ( !ret.empty() ) {
@@ -629,6 +703,7 @@ namespace {
         typedef vector<CSeq_id_Handle> TKey;
         typedef vector<bool> TLoaded;
         typedef vector<CSeq_id_Handle> TRet;
+        typedef CLoadLockAcc CLoadLock;
         CCommandLoadAccVers(CReaderRequestResult& result,
                             const TKey& key, TLoaded& loaded, TRet& ret)
             : CReadDispatcherCommand(result),
@@ -636,26 +711,29 @@ namespace {
             {
             }
 
-        bool IsDone(void)
-            {
-                return sx_BulkIsDone(m_Key, m_Loaded);
-            }
         bool Execute(CReader& reader)
             {
                 return reader.LoadAccVers(GetResult(), m_Key, m_Loaded, m_Ret);
             }
-        string GetErrMsg(void) const
+        bool IsDone(void)
             {
-                return "LoadAccVers("+sx_DescribeUnloaded(m_Key, m_Loaded)+"): "
-                    "data not found";
+                return sx_BulkIsDone<CLoadLock>(GetResult(), m_Key, m_Loaded);
             }
-        CGBRequestStatistics::EStatType GetStatistics(void) const
+        string GetErrMsg(void) const
             {
-                return CGBRequestStatistics::eStat_Seq_idAcc;
+                return "LoadAccVers("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    "): data not found";
             }
         string GetStatisticsDescription(void) const
             {
-                return "accs("+sx_DescribeUnloaded(m_Key, m_Loaded)+")";
+                return "accs("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    ")";
+            }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_Seq_idAcc;
             }
         
     private:
@@ -670,6 +748,7 @@ namespace {
         typedef vector<CSeq_id_Handle> TKey;
         typedef vector<bool> TLoaded;
         typedef vector<TGi> TRet;
+        typedef CLoadLockGi CLoadLock;
         CCommandLoadGis(CReaderRequestResult& result,
                         const TKey& key, TLoaded& loaded, TRet& ret)
             : CReadDispatcherCommand(result),
@@ -677,26 +756,29 @@ namespace {
             {
             }
 
-        bool IsDone(void)
-            {
-                return sx_BulkIsDone(m_Key, m_Loaded);
-            }
         bool Execute(CReader& reader)
             {
                 return reader.LoadGis(GetResult(), m_Key, m_Loaded, m_Ret);
             }
-        string GetErrMsg(void) const
+        bool IsDone(void)
             {
-                return "LoadGis("+sx_DescribeUnloaded(m_Key, m_Loaded)+"): "
-                    "data not found";
+                return sx_BulkIsDone<CLoadLock>(GetResult(), m_Key, m_Loaded);
             }
-        CGBRequestStatistics::EStatType GetStatistics(void) const
+        string GetErrMsg(void) const
             {
-                return CGBRequestStatistics::eStat_Seq_idGi;
+                return "LoadGis("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    "): data not found";
             }
         string GetStatisticsDescription(void) const
             {
-                return "gis("+sx_DescribeUnloaded(m_Key, m_Loaded)+")";
+                return "gis("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    ")";
+            }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_Seq_idGi;
             }
         
     private:
@@ -711,6 +793,7 @@ namespace {
         typedef vector<CSeq_id_Handle> TKey;
         typedef vector<bool> TLoaded;
         typedef vector<string> TRet;
+        typedef CLoadLockLabel CLoadLock;
         CCommandLoadLabels(CReaderRequestResult& result,
                            const TKey& key, TLoaded& loaded, TRet& ret)
             : CReadDispatcherCommand(result),
@@ -718,26 +801,29 @@ namespace {
             {
             }
 
-        bool IsDone(void)
-            {
-                return sx_BulkIsDone(m_Key, m_Loaded);
-            }
         bool Execute(CReader& reader)
             {
                 return reader.LoadLabels(GetResult(), m_Key, m_Loaded, m_Ret);
             }
-        string GetErrMsg(void) const
+        bool IsDone(void)
             {
-                return "LoadLabels("+sx_DescribeUnloaded(m_Key, m_Loaded)+"): "
-                    "data not found";
+                return sx_BulkIsDone<CLoadLock>(GetResult(), m_Key, m_Loaded);
             }
-        CGBRequestStatistics::EStatType GetStatistics(void) const
+        string GetErrMsg(void) const
             {
-                return CGBRequestStatistics::eStat_Seq_idLabel;
+                return "LoadLabels("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    "): data not found";
             }
         string GetStatisticsDescription(void) const
             {
-                return "labels("+sx_DescribeUnloaded(m_Key, m_Loaded)+")";
+                return "labels("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    ")";
+            }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_Seq_idLabel;
             }
         
     private:
@@ -752,6 +838,7 @@ namespace {
         typedef vector<CSeq_id_Handle> TKey;
         typedef vector<bool> TLoaded;
         typedef vector<int> TRet;
+        typedef CLoadLockTaxId CLoadLock;
         CCommandLoadTaxIds(CReaderRequestResult& result,
                            const TKey& key, TLoaded& loaded, TRet& ret)
             : CReadDispatcherCommand(result),
@@ -759,10 +846,6 @@ namespace {
             {
             }
 
-        bool IsDone(void)
-            {
-                return sx_BulkIsDone(m_Key, m_Loaded);
-            }
         bool Execute(CReader& reader)
             {
                 return reader.LoadTaxIds(GetResult(), m_Key, m_Loaded, m_Ret);
@@ -771,18 +854,25 @@ namespace {
             {
                 return true;
             }
-        string GetErrMsg(void) const
+        bool IsDone(void)
             {
-                return "LoadTaxIds("+sx_DescribeUnloaded(m_Key, m_Loaded)+"): "
-                    "data not found";
+                return sx_BulkIsDone<CLoadLock>(GetResult(), m_Key, m_Loaded);
             }
-        CGBRequestStatistics::EStatType GetStatistics(void) const
+        string GetErrMsg(void) const
             {
-                return CGBRequestStatistics::eStat_Seq_idTaxId;
+                return "LoadTaxIds("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    "): data not found";
             }
         string GetStatisticsDescription(void) const
             {
-                return "taxids("+sx_DescribeUnloaded(m_Key, m_Loaded)+")";
+                return "taxids("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    ")";
+            }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_Seq_idTaxId;
             }
         
     private:
@@ -796,38 +886,144 @@ namespace {
     public:
         typedef vector<CSeq_id_Handle> TKey;
         typedef vector<bool> TLoaded;
+        typedef vector<bool> TKnown;
         typedef vector<int> TRet;
+        typedef CLoadLockHash CLoadLock;
         CCommandLoadHashes(CReaderRequestResult& result,
-                           const TKey& key, TLoaded& loaded, TRet& ret)
+                           const TKey& key, TLoaded& loaded,
+                           TRet& ret, TKnown& known)
             : CReadDispatcherCommand(result),
-              m_Key(key), m_Loaded(loaded), m_Ret(ret)
+              m_Key(key), m_Loaded(loaded), m_Ret(ret), m_Known(known)
             {
             }
 
+        bool Execute(CReader& reader)
+            {
+                return reader.LoadHashes(GetResult(), m_Key, m_Loaded,
+                                         m_Ret, m_Known);
+            }
+        bool MayBeSkipped(void) const
+            {
+                return true;
+            }
         bool IsDone(void)
             {
-                return sx_BulkIsDone(m_Key, m_Loaded);
+                return sx_BulkIsDone<CLoadLock>(GetResult(), m_Key, m_Loaded);
+            }
+        string GetErrMsg(void) const
+            {
+                return "LoadHashes("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    "): data not found";
+            }
+        string GetStatisticsDescription(void) const
+            {
+                return "hashes("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    ")";
             }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_Hash;
+            }
+        
+    private:
+        const TKey& m_Key;
+        TLoaded& m_Loaded;
+        TRet& m_Ret;
+        TKnown& m_Known;
+    };
+
+    class CCommandLoadLengths : public CReadDispatcherCommand
+    {
+    public:
+        typedef vector<CSeq_id_Handle> TKey;
+        typedef vector<bool> TLoaded;
+        typedef vector<TSeqPos> TRet;
+        typedef CLoadLockLength CLoadLock;
+        CCommandLoadLengths(CReaderRequestResult& result,
+                           const TKey& key, TLoaded& loaded, TRet& ret)
+            : CReadDispatcherCommand(result),
+              m_Key(key), m_Loaded(loaded), m_Ret(ret)
+            {
+            }
+
         bool Execute(CReader& reader)
             {
-                return reader.LoadHashes(GetResult(), m_Key, m_Loaded, m_Ret);
+                return reader.LoadLengths(GetResult(), m_Key, m_Loaded, m_Ret);
             }
         bool MayBeSkipped(void) const
             {
                 return true;
             }
+        bool IsDone(void)
+            {
+                return sx_BulkIsDone<CLoadLock>(GetResult(), m_Key, m_Loaded);
+            }
         string GetErrMsg(void) const
             {
-                return "LoadHashes("+sx_DescribeUnloaded(m_Key, m_Loaded)+"): "
-                    "data not found";
+                return "LoadLengths("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    "): data not found";
+            }
+        string GetStatisticsDescription(void) const
+            {
+                return "lengths("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    ")";
             }
         CGBRequestStatistics::EStatType GetStatistics(void) const
             {
-                return CGBRequestStatistics::eStat_Hash;
+                return CGBRequestStatistics::eStat_Length;
+            }
+        
+    private:
+        const TKey& m_Key;
+        TLoaded& m_Loaded;
+        TRet& m_Ret;
+    };
+
+    class CCommandLoadTypes : public CReadDispatcherCommand
+    {
+    public:
+        typedef vector<CSeq_id_Handle> TKey;
+        typedef vector<bool> TLoaded;
+        typedef vector<CSeq_inst::EMol> TRet;
+        typedef CLoadLockType CLoadLock;
+        CCommandLoadTypes(CReaderRequestResult& result,
+                           const TKey& key, TLoaded& loaded, TRet& ret)
+            : CReadDispatcherCommand(result),
+              m_Key(key), m_Loaded(loaded), m_Ret(ret)
+            {
+            }
+
+        bool Execute(CReader& reader)
+            {
+                return reader.LoadTypes(GetResult(), m_Key, m_Loaded, m_Ret);
+            }
+        bool MayBeSkipped(void) const
+            {
+                return true;
+            }
+        bool IsDone(void)
+            {
+                return sx_BulkIsDone<CLoadLock>(GetResult(), m_Key, m_Loaded);
+            }
+        string GetErrMsg(void) const
+            {
+                return "LoadTypes("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    "): data not found";
             }
         string GetStatisticsDescription(void) const
             {
-                return "hashes("+sx_DescribeUnloaded(m_Key, m_Loaded)+")";
+                return "types("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    ")";
+            }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_Type;
             }
         
     private:
@@ -842,6 +1038,7 @@ namespace {
         typedef vector<CSeq_id_Handle> TKey;
         typedef vector<bool> TLoaded;
         typedef vector<int> TRet;
+        typedef CLoadLockBlobIds CLoadLock;
         CCommandLoadStates(CReaderRequestResult& result,
                            const TKey& key, TLoaded& loaded, TRet& ret)
             : CReadDispatcherCommand(result),
@@ -849,26 +1046,29 @@ namespace {
             {
             }
 
-        bool IsDone(void)
-            {
-                return sx_BulkIsDone(m_Key, m_Loaded);
-            }
         bool Execute(CReader& reader)
             {
                 return reader.LoadStates(GetResult(), m_Key, m_Loaded, m_Ret);
             }
-        string GetErrMsg(void) const
+        bool IsDone(void)
             {
-                return "LoadStates("+sx_DescribeUnloaded(m_Key, m_Loaded)+"): "
-                    "data not found";
+                return sx_BulkIsDone<CLoadLock>(GetResult(), m_Key, m_Loaded);
             }
-        CGBRequestStatistics::EStatType GetStatistics(void) const
+        string GetErrMsg(void) const
             {
-                return CGBRequestStatistics::eStat_BlobState;
+                return "LoadStates("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    "): data not found";
             }
         string GetStatisticsDescription(void) const
             {
-                return "states("+sx_DescribeUnloaded(m_Key, m_Loaded)+")";
+                return "states("+
+                    sx_DescribeError<CLoadLock>(GetResult(), m_Key, m_Loaded)+
+                    ")";
+            }
+        CGBRequestStatistics::EStatType GetStatistics(void) const
+            {
+                return CGBRequestStatistics::eStat_BlobState;
             }
         
     private:
@@ -1398,24 +1598,16 @@ void CReadDispatcher::Process(CReadDispatcherCommand& command,
             }
         } while ( retry_count < max_retry_count );
         if ( !command.MayBeSkipped() &&
-             !reader.MayBeSkippedOnErrors() ) {
+             !reader.MayBeSkippedOnErrors() &&
+             !s_AllowIncompleteCommands() ) {
             NCBI_THROW(CLoaderException, eLoaderFailed, command.GetErrMsg());
         }
     }
 
-    if ( command.MayBeSkipped() ) {
-        return;
+    if ( !command.MayBeSkipped() &&
+         !s_AllowIncompleteCommands() ) {
+        NCBI_THROW(CLoaderException, eLoaderFailed, command.GetErrMsg());
     }
-
-    NCBI_THROW(CLoaderException, eLoaderFailed, command.GetErrMsg());
-}
-
-
-void CReadDispatcher::LoadStringSeq_ids(CReaderRequestResult& result,
-                                        const string& seq_id)
-{
-    CCommandLoadStringSeq_ids command(result, seq_id);
-    Process(command);
 }
 
 
@@ -1467,8 +1659,24 @@ void CReadDispatcher::LoadSequenceHash(CReaderRequestResult& result,
 }
 
 
+void CReadDispatcher::LoadSequenceLength(CReaderRequestResult& result,
+                                         const CSeq_id_Handle& seq_id)
+{
+    CCommandLoadSequenceLength command(result, seq_id);
+    Process(command);
+}
+
+
+void CReadDispatcher::LoadSequenceType(CReaderRequestResult& result,
+                                       const CSeq_id_Handle& seq_id)
+{
+    CCommandLoadSequenceType command(result, seq_id);
+    Process(command);
+}
+
+
 void CReadDispatcher::LoadAccVers(CReaderRequestResult& result,
-                                  const TIds ids, TLoaded& loaded, TIds& ret)
+                                  const TIds& ids, TLoaded& loaded, TIds& ret)
 {
     CCommandLoadAccVers command(result, ids, loaded, ret);
     Process(command);
@@ -1476,7 +1684,7 @@ void CReadDispatcher::LoadAccVers(CReaderRequestResult& result,
 
 
 void CReadDispatcher::LoadGis(CReaderRequestResult& result,
-                              const TIds ids, TLoaded& loaded, TGis& ret)
+                              const TIds& ids, TLoaded& loaded, TGis& ret)
 {
     CCommandLoadGis command(result, ids, loaded, ret);
     Process(command);
@@ -1484,7 +1692,7 @@ void CReadDispatcher::LoadGis(CReaderRequestResult& result,
 
 
 void CReadDispatcher::LoadLabels(CReaderRequestResult& result,
-                                 const TIds ids, TLoaded& loaded, TLabels& ret)
+                                 const TIds& ids, TLoaded& loaded, TLabels& ret)
 {
     CCommandLoadLabels command(result, ids, loaded, ret);
     Process(command);
@@ -1492,7 +1700,7 @@ void CReadDispatcher::LoadLabels(CReaderRequestResult& result,
 
 
 void CReadDispatcher::LoadTaxIds(CReaderRequestResult& result,
-                                 const TIds ids, TLoaded& loaded, TTaxIds& ret)
+                                 const TIds& ids, TLoaded& loaded, TTaxIds& ret)
 {
     CCommandLoadTaxIds command(result, ids, loaded, ret);
     Process(command);
@@ -1500,15 +1708,32 @@ void CReadDispatcher::LoadTaxIds(CReaderRequestResult& result,
 
 
 void CReadDispatcher::LoadHashes(CReaderRequestResult& result,
-                                 const TIds ids, TLoaded& loaded, THashes& ret)
+                                 const TIds& ids, TLoaded& loaded,
+                                 THashes& ret, TKnown& known)
 {
-    CCommandLoadHashes command(result, ids, loaded, ret);
+    CCommandLoadHashes command(result, ids, loaded, ret, known);
+    Process(command);
+}
+
+
+void CReadDispatcher::LoadLengths(CReaderRequestResult& result,
+                                  const TIds& ids, TLoaded& loaded, TLengths& ret)
+{
+    CCommandLoadLengths command(result, ids, loaded, ret);
+    Process(command);
+}
+
+
+void CReadDispatcher::LoadTypes(CReaderRequestResult& result,
+                                const TIds& ids, TLoaded& loaded, TTypes& ret)
+{
+    CCommandLoadTypes command(result, ids, loaded, ret);
     Process(command);
 }
 
 
 void CReadDispatcher::LoadStates(CReaderRequestResult& result,
-                                 const TIds ids, TLoaded& loaded, TStates& ret)
+                                 const TIds& ids, TLoaded& loaded, TStates& ret)
 {
     CCommandLoadStates command(result, ids, loaded, ret);
     Process(command);
@@ -1611,28 +1836,32 @@ bool CReadDispatcher::SetBlobState(size_t i,
     CLoadLockBlobIds lock(result, ids[i]);
     if ( lock.IsLoaded() ) {
         CFixedBlob_ids blob_ids = lock.GetBlob_ids();
+        if ( !blob_ids.IsFound() ) {
+            ret[i] = lock.GetState();
+            return true;
+        }
         ITERATE ( CFixedBlob_ids, it, blob_ids ) {
             if ( it->Matches(fBlobHasCore, 0) ) {
                 CFixedBlob_ids::TState state = lock.GetState();
+                if ( state == CFixedBlob_ids::kUnknownState ) {
+                    CLoadLockBlobState state_lock(result, *it->GetBlob_id());
+                    if ( state_lock.IsLoadedBlobState() ) {
+                        state = state_lock.GetBlobState();
+                    }
+                }
                 if ( state != CFixedBlob_ids::kUnknownState ) {
-                    ret[i] = lock.GetState();
+                    ret[i] = state;
                     loaded[i] = true;
                     return true;
                 }
+                return false;
             }
         }
-        if ( lock.GetState() & CBioseq_Handle::fState_no_data ) {
-            ret[i] = lock.GetState();
-            loaded[i] = true;
-            return true;
-        }
     }
     else {
         CLoadLockSeqIds ids_lock(result, ids[i], eAlreadyLoaded);
-        if ( ids_lock &&
-             (ids_lock.GetState() & CBioseq_Handle::fState_no_data) ) {
+        if ( ids_lock && !ids_lock.GetData().IsFound() ) {
             ret[i] = ids_lock.GetState();
-            loaded[i] = true;
             return true;
         }
     }
diff --git a/c++/src/objtools/data_loaders/genbank/gbloader.cpp b/c++/src/objtools/data_loaders/genbank/gbloader.cpp
index d0bc280..2d77d9d 100644
--- a/c++/src/objtools/data_loaders/genbank/gbloader.cpp
+++ b/c++/src/objtools/data_loaders/genbank/gbloader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gbloader.cpp 475892 2015-08-12 18:52:12Z vasilche $
+/*  $Id: gbloader.cpp 499792 2016-04-28 14:15:13Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -818,31 +818,42 @@ void CGBDataLoader::GetIds(const CSeq_id_Handle& idh, TIds& ids)
 }
 
 
-CSeq_id_Handle CGBDataLoader::GetAccVer(const CSeq_id_Handle& idh)
+CDataLoader::SAccVerFound
+CGBDataLoader::GetAccVerFound(const CSeq_id_Handle& idh)
 {
+    SAccVerFound ret;
     if ( CReadDispatcher::CannotProcess(idh) ) {
-        return null;
+        // no such sequence
+        return ret;
     }
     CGBReaderRequestResult result(this, idh);
     CLoadLockAcc lock(result, idh);
     if ( !lock.IsLoadedAccVer() ) {
         m_Dispatcher->LoadSeq_idAccVer(result, idh);
     }
-    return lock.GetAccVer();
+    if ( lock.IsLoadedAccVer() ) {
+        ret = lock.GetAccVer();
+    }
+    return ret;
 }
 
 
-TGi CGBDataLoader::GetGi(const CSeq_id_Handle& idh)
+CDataLoader::SGiFound
+CGBDataLoader::GetGiFound(const CSeq_id_Handle& idh)
 {
+    SGiFound ret;
     if ( CReadDispatcher::CannotProcess(idh) ) {
-        return ZERO_GI;
+        return ret;
     }
     CGBReaderRequestResult result(this, idh);
     CLoadLockGi lock(result, idh);
     if ( !lock.IsLoadedGi() ) {
         m_Dispatcher->LoadSeq_idGi(result, idh);
     }
-    return lock.GetGi();
+    if ( lock.IsLoadedGi() ) {
+        ret = lock.GetGi();
+    }
+    return ret;
 }
 
 
@@ -886,23 +897,11 @@ int CGBDataLoader::GetSequenceState(const CSeq_id_Handle& sih)
     if ( CReadDispatcher::CannotProcess(sih) ) {
         return kNotFound;
     }
-    CGBReaderRequestResult result(this, sih);
-    CLoadLockBlobIds blobs(result, sih, 0);
-    m_Dispatcher->LoadSeq_idBlob_ids(result, sih, 0);
-    if ( blobs.GetState() & CBioseq_Handle::fState_no_data ) {
-        return blobs.GetState();
-    }
-
-    CFixedBlob_ids blob_ids = blobs.GetBlob_ids();
-    ITERATE ( CFixedBlob_ids, it, blob_ids ) {
-        if ( it->Matches(fBlobHasCore, 0) ) {
-            CFixedBlob_ids::TState state = blob_ids.GetState();
-            if ( state != CFixedBlob_ids::kUnknownState ) {
-                return blob_ids.GetState();
-            }
-        }
-    }
-    return kNotFound;
+    TIds ids(1, sih);
+    TLoaded loaded(1);
+    TSequenceStates states(1);
+    GetSequenceStates(ids, loaded, states);
+    return loaded[0]? states[0]: kNotFound;
 }
 
 
@@ -976,101 +975,64 @@ void CGBDataLoader::GetTaxIds(const TIds& ids, TLoaded& loaded, TTaxIds& ret)
 static const bool s_LoadBulkBlobs = true;
 
 
-void CGBDataLoader::GetSequenceLengths(const TIds& ids, TLoaded& loaded,
-                                       TSequenceLengths& ret)
+TSeqPos CGBDataLoader::GetSequenceLength(const CSeq_id_Handle& sih)
 {
-    if ( !s_LoadBulkBlobs ) {
-        CDataLoader::GetSequenceLengths(ids, loaded, ret);
-        return;
+    if ( CReadDispatcher::CannotProcess(sih) ) {
+        return kInvalidSeqPos;
     }
-    if ( ids.empty() ) {
-        return;
+    CGBReaderRequestResult result(this, sih);
+    CLoadLockLength lock(result, sih);
+    if ( !lock.IsLoadedLength() ) {
+        m_Dispatcher->LoadSequenceLength(result, sih);
     }
-    CGBReaderRequestResult result(this, ids[0]);
-    vector<CSeq_id_Handle> load_ids;
-    size_t count = ids.size();
-    _ASSERT(ids.size() == loaded.size());
-    _ASSERT(ids.size() == ret.size());
-    for ( size_t i = 0; i < count; ++i ) {
+    return lock.IsLoaded()? lock.GetLength(): 0;
+}
+
+
+void CGBDataLoader::GetSequenceLengths(const TIds& ids, TLoaded& loaded,
+                                       TSequenceLengths& ret)
+{
+    for ( size_t i = 0; i < ids.size(); ++i ) {
         if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
             continue;
         }
-        // add into loading set
-        load_ids.push_back(ids[i]);
-    }
-    if ( load_ids.empty() ) {
-        // nothing to load
+        CGBReaderRequestResult result(this, ids[i]);
+        m_Dispatcher->LoadLengths(result, ids, loaded, ret);
         return;
     }
-    sort(load_ids.begin(), load_ids.end());
-    m_Dispatcher->LoadBlobSet(result, load_ids);
-    // update sequence types
-    for ( size_t i = 0; i < count; ++i ) {
-        const CSeq_id_Handle& id = ids[i];
-        if ( loaded[i] || CReadDispatcher::CannotProcess(id) ) {
-            continue;
-        }
-        CLoadLockBlobIds blob_ids_lock(result, id, 0);
-        CFixedBlob_ids blob_ids = blob_ids_lock.GetBlob_ids();
-        ITERATE ( CFixedBlob_ids, it, blob_ids ) {
-            const CBlob_Info& info = *it;
-            const CBlob_id& blob_id = *info.GetBlob_id();
-            if ( !info.Matches(fBlobHasCore, 0) ) {
-                continue;
-            }
-            CLoadLockBlob blob(result, blob_id);
-            _ASSERT(blob.IsLoadedBlob());
-            CTSE_LoadLock& lock = blob.GetTSE_LoadLock();
-            _ASSERT(lock);
-            if ( CConstRef<CBioseq_Info> seq = lock->FindMatchingBioseq(id) ) {
-                ret[i] = seq->GetBioseqLength();
-                loaded[i] = true;
-                break;
-            }
-        }
+}
+
+
+CDataLoader::STypeFound
+CGBDataLoader::GetSequenceTypeFound(const CSeq_id_Handle& sih)
+{
+    STypeFound ret;
+    if ( CReadDispatcher::CannotProcess(sih) ) {
+        return ret;
+    }
+    CGBReaderRequestResult result(this, sih);
+    CLoadLockType lock(result, sih);
+    if ( !lock.IsLoadedType() ) {
+        m_Dispatcher->LoadSequenceType(result, sih);
+    }
+    if ( lock.IsLoadedType() ) {
+        ret = lock.GetType();
     }
+    return ret;
 }
 
 
 void CGBDataLoader::GetSequenceTypes(const TIds& ids, TLoaded& loaded,
                                      TSequenceTypes& ret)
 {
-    if ( !s_LoadBulkBlobs ) {
-        CDataLoader::GetSequenceTypes(ids, loaded, ret);
-        return;
-    }
-    TTSE_LockSets lock_sets;
-    size_t count = ids.size();
-    _ASSERT(ids.size() == loaded.size());
-    _ASSERT(ids.size() == ret.size());
-    for ( size_t i = 0; i < count; ++i ) {
+    for ( size_t i = 0; i < ids.size(); ++i ) {
         if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
             continue;
         }
-        // add into loading set
-        lock_sets[ids[i]];
-    }
-    if ( lock_sets.empty() ) {
-        // nothing to load
+        CGBReaderRequestResult result(this, ids[i]);
+        m_Dispatcher->LoadTypes(result, ids, loaded, ret);
         return;
     }
-    GetBlobs(lock_sets);
-    // update sequence types
-    for ( size_t i = 0; i < count; ++i ) {
-        if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
-            continue;
-        }
-        TTSE_LockSet& locks = lock_sets[ids[i]];
-        ITERATE(TTSE_LockSet, it, locks) {
-            CConstRef<CBioseq_Info> bs_info =
-                (*it)->FindMatchingBioseq(ids[i]);
-            if ( bs_info ) {
-                ret[i] = bs_info->GetInst_Mol();
-                loaded[i] = true;
-                break;
-            }
-        }
-    }
 }
 
 
@@ -1118,29 +1080,34 @@ void CGBDataLoader::GetSequenceStates(const TIds& ids, TLoaded& loaded,
 }
 
 
-int CGBDataLoader::GetSequenceHash(const CSeq_id_Handle& sih)
+CDataLoader::SHashFound
+CGBDataLoader::GetSequenceHashFound(const CSeq_id_Handle& sih)
 {
+    SHashFound ret;
     if ( CReadDispatcher::CannotProcess(sih) ) {
-        return 0;
+        return ret;
     }
     CGBReaderRequestResult result(this, sih);
     CLoadLockHash lock(result, sih);
     if ( !lock.IsLoadedHash() ) {
         m_Dispatcher->LoadSequenceHash(result, sih);
     }
-    return lock.IsLoaded()? lock.GetHash(): 0;
+    if ( lock.IsLoadedHash() ) {
+        ret = lock.GetHash();
+    }
+    return ret;
 }
 
 
 void CGBDataLoader::GetSequenceHashes(const TIds& ids, TLoaded& loaded,
-                                      TSequenceHashes& ret)
+                                      TSequenceHashes& ret, THashKnown& known)
 {
     for ( size_t i = 0; i < ids.size(); ++i ) {
         if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
             continue;
         }
         CGBReaderRequestResult result(this, ids[i]);
-        m_Dispatcher->LoadHashes(result, ids, loaded, ret);
+        m_Dispatcher->LoadHashes(result, ids, loaded, ret, known);
         return;
     }
 }
@@ -1548,12 +1515,17 @@ CGBDataLoader::x_GetRecords(const CSeq_id_Handle& sih,
     CGBReaderRequestResult result(this, sih);
     m_Dispatcher->LoadBlobs(result, sih, mask, sel);
     CLoadLockBlobIds blobs(result, sih, sel);
+    if ( !blobs.IsLoaded() ) {
+        return locks;
+    }
     _ASSERT(blobs.IsLoaded());
 
     CFixedBlob_ids blob_ids = blobs.GetBlob_ids();
     if ( (blob_ids.GetState() & CBioseq_Handle::fState_no_data) != 0 ) {
-        if ( blob_ids.GetState() == CBioseq_Handle::fState_no_data ) {
-            // default state - return empty lock set
+        if ( (mask & fBlobHasAllLocal) == 0 ||
+             blob_ids.GetState() == CBioseq_Handle::fState_no_data ) {
+            // only external annotatsions are requested,
+            // or default state - return empty lock set
             return locks;
         }
         NCBI_THROW2(CBlobStateException, eBlobStateError,
@@ -1566,7 +1538,9 @@ CGBDataLoader::x_GetRecords(const CSeq_id_Handle& sih,
         const CBlob_id& blob_id = *info.GetBlob_id();
         if ( info.Matches(mask, sel) ) {
             CLoadLockBlob blob(result, blob_id);
-            _ASSERT(blob.IsLoadedBlob());
+            if ( !blob.IsLoadedBlob() ) {
+                continue;
+            }
             CTSE_LoadLock& lock = blob.GetTSE_LoadLock();
             _ASSERT(lock);
             if ( lock->GetBlobState() & CBioseq_Handle::fState_no_data ) {
diff --git a/c++/src/objtools/data_loaders/genbank/gicache/Makefile.ncbi_xreader_gicache.lib b/c++/src/objtools/data_loaders/genbank/gicache/Makefile.ncbi_xreader_gicache.lib
index f71101c..c16a177 100644
--- a/c++/src/objtools/data_loaders/genbank/gicache/Makefile.ncbi_xreader_gicache.lib
+++ b/c++/src/objtools/data_loaders/genbank/gicache/Makefile.ncbi_xreader_gicache.lib
@@ -1,8 +1,8 @@
-# $Id: Makefile.ncbi_xreader_gicache.lib 427429 2014-02-20 13:41:40Z gouriano $
+# $Id: Makefile.ncbi_xreader_gicache.lib 484420 2015-11-10 19:50:38Z ucko $
 
 REQUIRES = unix
 
-SRC = reader_gicache gicache
+SRC = reader_gicache gicache_cxx
 
 LIB = ncbi_xreader_gicache
 
diff --git a/c++/src/objtools/data_loaders/genbank/gicache/gicache.c b/c++/src/objtools/data_loaders/genbank/gicache/gicache.c
index e07c976..f06e178 100644
--- a/c++/src/objtools/data_loaders/genbank/gicache/gicache.c
+++ b/c++/src/objtools/data_loaders/genbank/gicache/gicache.c
@@ -1,5 +1,5 @@
 /*****************************************************************************
-* $Id: gicache.c 431099 2014-04-01 16:57:07Z syncbot $
+* $Id: gicache.c 487414 2015-12-17 16:42:03Z syncbot $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -29,15 +29,23 @@
 *
 *****************************************************************************/
 
-#include "gicache.h"
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <assert.h>
 #include <poll.h>
+#include <errno.h>
+#include "gicache.h"
 #include "ncbi_toolkit.h"
+#ifdef NCBI_CXX_TOOLKIT
+#include "connect/ncbi_core_cxx.hpp"
+#else
+#include "connect/ncbi_core_c.h"
+#endif
+#include "connect/ncbi_core.h"
 
 /****************************************************************************
  *
@@ -107,7 +115,7 @@ typedef struct {
     char*   m_DataCache;
     Uint1   m_SequentialData;
     Uint1   m_FreeOnDrop;
-    volatile int m_Remapping; /* Count of threads currently trying to remap */
+    MT_LOCK m_RemapLock; /* Remapper is WRITER, others are READERs */
     volatile Uint1 m_NeedRemap; /* Is remap needed? */
     Uint1   m_RemapOnRead; /* Is remap allowed when reading data? */
     Uint4   m_OffsetHeaderSize; /* 0 for 32-bit version, 256 for 64-bit */
@@ -137,6 +145,11 @@ static void x_DumpIndexCache(SGiDataIndex* data_index)
         bytes_written =
             write(data_index->m_GiIndexFile, data_index->m_IndexCache,
                   data_index->m_IndexCacheLen*sizeof(int));
+		if (bytes_written != data_index->m_IndexCacheLen*sizeof(int) && LogFunc) {
+			char logmsg[256];
+			sprintf(logmsg, "GI_CACHE: Possible index corruption: failed to write: tried to write %lu, written: %d, err: %d\n", data_index->m_IndexCacheLen*sizeof(int), bytes_written, errno);
+			LogFunc(logmsg);
+		}
         assert(bytes_written == data_index->m_IndexCacheLen*sizeof(int));
         data_index->m_GiIndexLen += data_index->m_IndexCacheLen;
         assert(data_index->m_GiIndexLen*sizeof(Uint4) ==
@@ -159,6 +172,11 @@ static void x_DumpDataCache(SGiDataIndex* data_index)
         bytes_written = 
             write(data_index->m_DataFile, data_index->m_DataCache,
                   data_index->m_DataCacheLen);
+		if (bytes_written != data_index->m_DataCacheLen && LogFunc) {
+			char logmsg[256];
+			sprintf(logmsg, "GI_CACHE: Possible data corruption: failed to write: tried to write %u, written: %d, err: %d\n", data_index->m_DataCacheLen, bytes_written, errno);
+			LogFunc(logmsg);
+		}
         assert(bytes_written == data_index->m_DataCacheLen);
         data_index->m_DataLen += data_index->m_DataCacheLen;
         assert(data_index->m_DataLen == 
@@ -202,7 +220,7 @@ static void x_UnMapIndex(SGiDataIndex* data_index)
         if (LogFunc) {
             char logmsg[256];
             sprintf(logmsg,
-                    "GI_CACHE: Unmapping index file, filedes %d, map length %ld, path %s\n",
+                    "GI_CACHE: Unmapping index file, filedes %d, map length %u, path %s\n",
                     data_index->m_GiIndexFile, data_index->m_MappedIndexLen,
                     data_index->m_FileNamePrefix);
             LogFunc(logmsg);
@@ -220,7 +238,7 @@ static void x_UnMapData(SGiDataIndex* data_index)
         if (LogFunc) {
             char logmsg[256];
             sprintf(logmsg,
-                    "GI_CACHE: Unmapping data file, filedes %d, map length %ld, path %s\n",
+                    "GI_CACHE: Unmapping data file, filedes %d, map length %lld, path %s\n",
                     data_index->m_DataFile, data_index->m_MappedDataLen,
                     data_index->m_FileNamePrefix);
             LogFunc(logmsg);
@@ -244,6 +262,7 @@ static Uint1 x_OpenIndexFile(SGiDataIndex* data_index)
 {
     char buf[256];
     int flags;
+	int open_err;
 
     if (data_index->m_GiIndexFile >= 0)
         return 1;
@@ -256,21 +275,25 @@ static Uint1 x_OpenIndexFile(SGiDataIndex* data_index)
 
     strcat(buf, "idx");
     data_index->m_GiIndexFile = open(buf,flags,0644);
+	open_err = data_index->m_GiIndexFile < 0 ? errno : 0;
     data_index->m_GiIndexLen = 
         (data_index->m_GiIndexFile >= 0 ? 
          lseek(data_index->m_GiIndexFile, 0, SEEK_END)/sizeof(Uint4) : 0);
 
     /* Save inode number */
     struct stat stat_buf;
-    fstat(data_index->m_GiIndexFile, &stat_buf);
+    memset(&stat_buf, 0, sizeof(stat_buf));
+    if (data_index->m_GiIndexFile >= 0) {
+        fstat(data_index->m_GiIndexFile, &stat_buf);
+	}
     data_index->m_IndexInode = stat_buf.st_ino;
 
     if (LogFunc) {
         char logmsg[256];
         sprintf(logmsg,
-                "GI_CACHE: Opened index file %s; filedes %d, inode %d, length %ld, path %s\n",
-                buf, data_index->m_GiIndexFile, data_index->m_IndexInode,
-                data_index->m_GiIndexLen, data_index->m_FileNamePrefix);
+                "GI_CACHE: Opened index file %s; filedes %d, inode %lx, length %u, path %s, err: %d\n",
+                buf, data_index->m_GiIndexFile, (unsigned long)data_index->m_IndexInode,
+                data_index->m_GiIndexLen, data_index->m_FileNamePrefix, open_err);
         LogFunc(logmsg);
     }
 
@@ -290,6 +313,11 @@ static Uint1 x_OpenIndexFile(SGiDataIndex* data_index)
         assert(0 == lseek(data_index->m_GiIndexFile, 0, SEEK_END));
         bytes_written = write(data_index->m_GiIndexFile, b,
                               data_index->m_GiIndexLen*sizeof(Uint4));
+		if (bytes_written != data_index->m_GiIndexLen*sizeof(Uint4) && LogFunc) {
+			char logmsg[256];
+			sprintf(logmsg, "GI_CACHE: Possible index corruption: failed to write: tried to write %lu, written: %d, err: %d\n", data_index->m_GiIndexLen*sizeof(Uint4), bytes_written, errno);
+			LogFunc(logmsg);
+		}
         assert(bytes_written == data_index->m_GiIndexLen*sizeof(Uint4));
         free(b);
         assert(data_index->m_GiIndexLen*sizeof(Uint4) ==
@@ -306,6 +334,7 @@ static Uint1 x_OpenDataFile(SGiDataIndex* data_index)
 {
     char buf[256];
     int flags;
+	int open_err;
 
     if (data_index->m_DataFile >= 0)
         return 1;
@@ -315,19 +344,23 @@ static Uint1 x_OpenDataFile(SGiDataIndex* data_index)
     strcpy(buf, data_index->m_FileNamePrefix);
     strcat(buf, "dat");
     data_index->m_DataFile = open(buf,flags,0644);
+	open_err = data_index->m_GiIndexFile < 0 ? errno : 0;
     data_index->m_DataLen = (data_index->m_DataFile >= 0 ? 
                              lseek(data_index->m_DataFile, 0, SEEK_END) : 0);
     /* Save inode number */
     struct stat stat_buf;
-    fstat(data_index->m_DataFile, &stat_buf);
+    memset(&stat_buf, 0, sizeof(stat_buf));
+    if (data_index->m_DataFile >= 0) {
+        fstat(data_index->m_DataFile, &stat_buf);
+    }
     data_index->m_DataInode = stat_buf.st_ino;
 
     if (LogFunc) {
         char logmsg[256];
         sprintf(logmsg,
-                "GI_CACHE: Opened data file %s; filedes %d, inode %d, length %ld, path %s\n",
-                buf, data_index->m_DataFile, data_index->m_DataInode,
-                data_index->m_DataLen, data_index->m_FileNamePrefix);
+                "GI_CACHE: Opened data file %s; filedes %d, inode %lx, length %lld, path %s, err: %d\n",
+                buf, data_index->m_DataFile, (unsigned long)data_index->m_DataInode,
+                data_index->m_DataLen, data_index->m_FileNamePrefix, open_err);
         LogFunc(logmsg);
     }
 
@@ -343,6 +376,11 @@ static Uint1 x_OpenDataFile(SGiDataIndex* data_index)
         memset(b, 0, sizeof(b));
         assert(0 == lseek(data_index->m_DataFile, 0, SEEK_END));
         bytes_written = write(data_index->m_DataFile, b, sizeof(b));
+		if (bytes_written != sizeof(b) && LogFunc) {
+			char logmsg[256];
+			sprintf(logmsg, "GI_CACHE: Possible file corruption: failed to write: tried to write %lu, written: %d, err: %d\n", sizeof(b), bytes_written, errno);
+			LogFunc(logmsg);
+		}
         assert(bytes_written == sizeof(b));
         data_index->m_DataLen = sizeof(b);
         assert(data_index->m_DataLen ==
@@ -388,7 +426,7 @@ static Uint1 x_MapIndex(SGiDataIndex* data_index)
     if (LogFunc) {
         char logmsg[256];
         sprintf(logmsg,
-                "GI_CACHE: Memory mapped index file, filedes %d, map length %ld, path %s\n",
+                "GI_CACHE: Memory mapped index file, filedes %d, map length %u, path %s\n",
                 data_index->m_GiIndexFile, data_index->m_MappedIndexLen,
                 data_index->m_FileNamePrefix);
         LogFunc(logmsg);
@@ -431,8 +469,8 @@ static Uint1 x_MapData(SGiDataIndex* data_index)
         if (LogFunc) {
             char logmsg[256];
             sprintf(logmsg,
-                    "GI_CACHE: Memory mapped data file, filedes %d, map length %ld, path %s\n",
-                    data_index->m_DataFile, data_index->m_MappedDataLen,
+                    "GI_CACHE: Memory mapped data file, filedes %d, map length %lld, path %s\n",
+                    data_index->m_DataFile, (long long)data_index->m_MappedDataLen,
                     data_index->m_FileNamePrefix);
             LogFunc(logmsg);
         }
@@ -488,23 +526,25 @@ static Uint1 x_ReMapData(SGiDataIndex* data_index)
 
 static Uint1 GiDataIndex_ReMap(SGiDataIndex* data_index, int delay)
 {
+	int err;
     /* If some other thread has already done the remapping or is in the process
        of doing it, there is nothing to do here. */
-    if (!data_index->m_NeedRemap || data_index->m_Remapping)
+    if (!data_index->m_NeedRemap)
         return 1;
 
-    ++data_index->m_Remapping;
-
-    /* Wait a little bit and check if some other thread has started doing the
-       remapping. In that case let the other thread do it. */
-    poll(NULL, 0, delay);
-
-    if (data_index->m_Remapping > 1) {
-        data_index->m_Remapping--;
-        return 0;
-    }
-
-    assert(data_index->m_Remapping == 1);
+	/* MT_LOCK_Do return -1 - compiled with no locks, 0 -- failed, >0 -- aquired */
+	if ((err = MT_LOCK_Do(data_index->m_RemapLock, eMT_Lock)) == 0) {
+		if (LogFunc) {
+			char logmsg[256];
+			sprintf(logmsg, "GI_CACHE: failed to aquire WR lock, err: %d\n", err);
+			LogFunc(logmsg);
+		}
+		return 0;
+	}
+
+	/* remapping might have been done by somebody else while we were waiting for wr lock */
+	if (!data_index->m_NeedRemap)
+        return 1;
 
     /* In read-only mode, check if inode numbers for underlying files have
      * changed. If so, close and reopen the file descriptors.
@@ -531,15 +571,19 @@ static Uint1 GiDataIndex_ReMap(SGiDataIndex* data_index, int delay)
             x_CloseFiles(data_index);
     }
 
-    if (!x_ReMapIndex(data_index))
+    if (!x_ReMapIndex(data_index)) {
+		MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
         return 0;
-    if (!x_ReMapData(data_index))
+	}
+    if (!x_ReMapData(data_index)) {
+		MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
         return 0;
+	}
 
     /* Inform any other threads that may want remapped data that remapping has
        already finished. */
-    data_index->m_Remapping = 0;
     data_index->m_NeedRemap = 0;
+	MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
 
     return 1;
 }
@@ -724,26 +768,55 @@ x_SetIndexOffset(SGiDataIndex* data_index, int gi, Uint4 page, int level,
     return 0;
 }
 
-static char* x_GetGiData(SGiDataIndex* data_index, int gi)
+static int x_GetGiData(SGiDataIndex* data_index, int gi, const char **buf)
 {
     Uint4 page = 0;
     int base = data_index->m_OffsetHeaderSize;
     int shift = (data_index->m_SequentialData ? 1 : 0);
     int level;
+	int err;
     Uint1 is_64bit = (data_index->m_OffsetHeaderSize > 0);
+	*buf = NULL;
 
     /* If some thread is currently remapping, the data is in an inconsistent
        state, therefore return NULL. */
-    if (data_index->m_Remapping)
-        return NULL;
-
-    if ((data_index->m_GiIndex == MAP_FAILED ||
-         data_index->m_Data == MAP_FAILED)) {
-        data_index->m_NeedRemap = 1;
 
-        if (!data_index->m_RemapOnRead || !GiDataIndex_ReMap(data_index, 0))
-            return NULL;
-    }
+	if ((err = MT_LOCK_Do(data_index->m_RemapLock, eMT_LockRead)) == 0) {
+		if (LogFunc) {
+			char logmsg[256];
+			sprintf(logmsg, "GI_CACHE: failed to aquire RD lock, err: %d\n", err);
+			LogFunc(logmsg);
+		}
+		return 0;
+	}
+
+	if ((data_index->m_GiIndex == MAP_FAILED ||
+		 data_index->m_Data == MAP_FAILED)) {
+		data_index->m_NeedRemap = 1;
+		/* we can't remap while RD lock is aquired, so drop it first */
+		MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
+
+		if (!data_index->m_RemapOnRead || !GiDataIndex_ReMap(data_index, 0)) {
+			return 0;
+		}
+		/* re-aquire RD lock */
+		if ((err = MT_LOCK_Do(data_index->m_RemapLock, eMT_LockRead)) == 0) {
+			if (LogFunc) {
+				char logmsg[256];
+				sprintf(logmsg, "GI_CACHE: failed to aquire RD lock, err: %d\n", err);
+				LogFunc(logmsg);
+			}
+			return 0;
+		}
+
+	}
+	/* we've tried to remap and if still we have MAP_FAILED there, bailout */
+	if ((data_index->m_GiIndex == MAP_FAILED ||
+         data_index->m_Data == MAP_FAILED)) 
+	{
+		MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
+		return 0;
+	}
 
     assert((data_index->m_GiIndex != MAP_FAILED) && 
            (data_index->m_Data != MAP_FAILED));
@@ -767,7 +840,8 @@ static char* x_GetGiData(SGiDataIndex* data_index, int gi)
         */
         if (base == -1) {
             data_index->m_NeedRemap = 1;
-            return NULL;
+			MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
+			return 0;
         }
     }
     
@@ -777,8 +851,10 @@ static char* x_GetGiData(SGiDataIndex* data_index, int gi)
         gi_offset = GET_TOP_PAGE_OFFSET(gi);
         /* If top page offset is not set, it means no gis from this whole top page
            have been saved in cache so far. */
-        if (gi_offset == 0)
-            return NULL;
+        if (gi_offset == 0) {
+			MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
+			return 0;
+		}
     }
     
     gi_offset += base;
@@ -789,23 +865,49 @@ static char* x_GetGiData(SGiDataIndex* data_index, int gi)
         data_index->m_NeedRemap = 1;
         if (!data_index->m_RemapOnRead || !x_ReMapData(data_index) ||
             gi_offset >= data_index->m_DataLen + data_index->m_DataCacheLen) 
-            return NULL;
+		{
+			MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
+            return 0;
+		}
     }
 
     /* If offset is beyond the mapped data, get the data from cache, otherwise
        from the memory mapped location. */
     if (gi_offset >= data_index->m_DataLen) {
-        return data_index->m_DataCache + (gi_offset - data_index->m_DataLen);
-    } else {
+		*buf = data_index->m_DataCache + (gi_offset - data_index->m_DataLen);		
+        return 1;
+    } 
+	else {
         /* If offset points to data that has been written to disk but not yet
            mapped, remap now. */
         if (gi_offset >= data_index->m_MappedDataLen) {
             data_index->m_NeedRemap = 1;
+			MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
             if (!data_index->m_RemapOnRead || !x_ReMapData(data_index))
-                return NULL;
-        }
+                return 0;
 
-        return data_index->m_Data + gi_offset;
+			/* re-aquire RD lock */
+			if ((err = MT_LOCK_Do(data_index->m_RemapLock, eMT_LockRead)) == 0) {
+				if (LogFunc) {
+					char logmsg[256];
+					sprintf(logmsg, "GI_CACHE: failed to aquire RD lock, err: %d\n", err);
+					LogFunc(logmsg);
+				}
+				return 0;
+			}
+			/* still problem with offset? -> log it */
+			if (gi_offset >= data_index->m_MappedDataLen) {
+				MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock);
+				if (LogFunc) {
+					char logmsg[256];
+					sprintf(logmsg, "GI_CACHE: Possible corruption: gi_offset: %lld, gi: %d\n", gi_offset, gi);
+					LogFunc(logmsg);
+				}
+				return 0;
+			}
+        }
+		*buf = data_index->m_Data + gi_offset;
+		return 1;
     }
 }
 
@@ -842,7 +944,11 @@ GiDataIndex_New(SGiDataIndex* data_index, int unit_size, const char* name,
     data_index->m_DataCacheLen = 0;
     data_index->m_DataCacheSize = unit_size*DATA_CACHE_SIZE;
     data_index->m_DataCache = (char*) malloc(data_index->m_DataCacheSize);
-    data_index->m_Remapping = 0;
+#ifdef NCBI_CXX_TOOLKIT
+    data_index->m_RemapLock = MT_LOCK_cxx2c(NULL, true);
+#else
+    data_index->m_RemapLock = MT_LOCK_c2c(0, 1);
+#endif
     data_index->m_NeedRemap = 1;
     data_index->m_RemapOnRead = 1;
     data_index->m_OffsetHeaderSize = (is_64bit ? kOffsetHeaderSize : 0);
@@ -863,6 +969,8 @@ static SGiDataIndex* GiDataIndex_Free(SGiDataIndex* data_index)
     x_CloseFiles(data_index);
     free(data_index->m_IndexCache);
     free(data_index->m_DataCache);
+	MT_LOCK_Delete(data_index->m_RemapLock);
+	memset(&data_index->m_RemapLock, 0, sizeof(data_index->m_RemapLock));
     if (data_index->m_FreeOnDrop) {
       free(data_index);
       data_index=NULL;
@@ -871,9 +979,9 @@ static SGiDataIndex* GiDataIndex_Free(SGiDataIndex* data_index)
 }
 
 /* Returns data corresponding to a given gi for reading only. */
-static const char* GiDataIndex_GetData(SGiDataIndex* data_index, int gi)
+static const int GiDataIndex_GetData(SGiDataIndex* data_index, int gi, const char **buf)
 {
-    return x_GetGiData(data_index, gi);
+    return x_GetGiData(data_index, gi, buf);
 }
 
 /* Writes data for a gi. */
@@ -1019,12 +1127,16 @@ GiDataIndex_PutData(SGiDataIndex* data_index, int gi, const char* data,
 
 #ifdef ALLOW_IN_PLACE_MODIFICATION
 /* Returns data corresponding to a given gi, for possible modification. */
+/* !WARNING: it's caller responsibility to unlock buffer by calling MT_LOCK_Do(data_index->m_RemapLock, eMT_Unlock); in case if returned value is NOT null */
 static char* GiDataIndex_SetData(SGiDataIndex* data_index, int gi)
 {
+	const char *buf = NULL;
+	int rv;
     if (data_index->m_ReadOnlyMode)
         return NULL;
 
-    return x_GetGiData(data_index, gi);
+	rv = x_GetGiData(data_index, gi, &buf);
+    return rv ? buf : NULL;
 }
 
 /* Deletes data for a gi. */
@@ -1144,7 +1256,6 @@ static int GiDataIndex_GetMaxGi(SGiDataIndex* data_index)
     int shift = (data_index->m_SequentialData ? 1 : 0);
     int remainder = 0;
     Uint4* gi_index;
-    Int8 base_offset;
 
     x_Flush(data_index);
 
@@ -1723,15 +1834,18 @@ void GICache_ReMap(int delay_in_sec) {
 int GICache_GetAccession(int gi, char* acc, int acc_len)
 {
     int retval = 0;
+	int rv;
+	const char* gi_data = NULL;
     if(!gi_cache) return 0;
-    const char* gi_data = GiDataIndex_GetData(gi_cache, gi);
-    if (gi_data) {
+    rv = GiDataIndex_GetData(gi_cache, gi, &gi_data);
+    if (rv) {
         if ((retval = s_DecodeGiAccession(gi_data, acc, acc_len)) < 0) {
             /* If returned "accession" is invalid, force a remap and return empty
                string */
             acc[0] = NULLB;
             gi_cache->m_NeedRemap = 1;
         }
+		MT_LOCK_Do(gi_cache->m_RemapLock, eMT_Unlock);
     } else {
         acc[0] = NULLB;
     }
@@ -1740,14 +1854,17 @@ int GICache_GetAccession(int gi, char* acc, int acc_len)
 
 int GICache_GetLength(int gi)
 {
+	const char *x = NULL;
     int length = 0;
+	int rv;
     if(!gi_cache) return 0;
-    const char *x = GiDataIndex_GetData(gi_cache, gi);
+    rv = GiDataIndex_GetData(gi_cache, gi, &x);
 
-    if(!x) return 0;
+    if(!rv) return 0;
 
     x++; /* Skip control byte */
     x += s_DecodeInt4(x, &length);
+	MT_LOCK_Do(gi_cache->m_RemapLock, eMT_Unlock);
     return length;
 }
 
diff --git a/c++/include/objtools/format/genbank_gather.hpp b/c++/src/objtools/data_loaders/genbank/gicache/gicache_cxx.cpp
similarity index 64%
copy from c++/include/objtools/format/genbank_gather.hpp
copy to c++/src/objtools/data_loaders/genbank/gicache/gicache_cxx.cpp
index f14c9b2..e62e0b8 100644
--- a/c++/include/objtools/format/genbank_gather.hpp
+++ b/c++/src/objtools/data_loaders/genbank/gicache/gicache_cxx.cpp
@@ -1,7 +1,4 @@
-#ifndef OBJTOOLS_FORMAT___GENBANK_GATHER__HPP
-#define OBJTOOLS_FORMAT___GENBANK_GATHER__HPP
-
-/*  $Id: genbank_gather.hpp 379519 2012-11-01 17:25:07Z kornbluh $
+/*  $Id: gicache_cxx.cpp 484420 2015-11-10 19:50:38Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -26,39 +23,16 @@
 *
 * ===========================================================================
 *
-* Author:  Aaron Ucko, NCBI
-*          Mati Shomrat
+* Author:  Aaron Ucko
 *
 * File Description:
+*   Accommodate gicache.c's use of MT_LOCK_cxx2c from ncbi_core_cxx.hpp
+*   when built as part of the C++ Toolkit.
 *
+* ===========================================================================
 */
-#include <corelib/ncbistd.hpp>
-
-#include <objtools/format/gather_items.hpp>
-
-
-BEGIN_NCBI_SCOPE
-BEGIN_SCOPE(objects)
-
-
-class CBioseqContext;
-class CBioseq;
-
-
-class NCBI_FORMAT_EXPORT CGenbankGatherer : public CFlatGatherer
-{
-public:
-    CGenbankGatherer(void);
-
-    virtual void x_DoSingleSection(CBioseqContext& ctx) const;
-
-private:
-    void x_GatherWGS(void) const;
-    void x_GatherTSA(void) const;
-};
-
-
-END_SCOPE(objects)
-END_NCBI_SCOPE
 
-#endif  /* OBJTOOLS_FORMAT___GENBANK_GATHER__HPP */
+#include <ncbi_pch.hpp>
+#include <corelib/ncbistl.hpp>
+USING_NCBI_SCOPE;
+#include "gicache.c"
diff --git a/c++/src/objtools/data_loaders/genbank/gicache/reader_gicache.cpp b/c++/src/objtools/data_loaders/genbank/gicache/reader_gicache.cpp
index 62ba4ff..8b1ecc0 100644
--- a/c++/src/objtools/data_loaders/genbank/gicache/reader_gicache.cpp
+++ b/c++/src/objtools/data_loaders/genbank/gicache/reader_gicache.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reader_gicache.cpp 440703 2014-07-16 15:38:41Z vasilche $
+/*  $Id: reader_gicache.cpp 494478 2016-03-07 19:26:06Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -150,7 +150,10 @@ bool CGICacheReader::LoadSeq_idAccVer(CReaderRequestResult& result,
         if ( got ) {
             if ( buffer[0] ) {
                 try {
-                    ids.SetLoadedAccVer(CSeq_id_Handle::GetHandle(buffer));
+                    TSequenceAcc acc;
+                    acc.acc_ver = CSeq_id_Handle::GetHandle(buffer);
+                    acc.sequence_found = true;
+                    ids.SetLoadedAccVer(acc);
                     return true;
                 }
                 catch ( CException& /*ignored*/ ) {
diff --git a/c++/src/objtools/data_loaders/genbank/id1/reader_id1.cpp b/c++/src/objtools/data_loaders/genbank/id1/reader_id1.cpp
index 6348740..25dced3 100644
--- a/c++/src/objtools/data_loaders/genbank/id1/reader_id1.cpp
+++ b/c++/src/objtools/data_loaders/genbank/id1/reader_id1.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reader_id1.cpp 468561 2015-05-26 15:57:12Z vasilche $
+/*  $Id: reader_id1.cpp 494478 2016-03-07 19:26:06Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -279,12 +279,10 @@ bool CId1Reader::LoadSeq_idGi(CReaderRequestResult& result,
     CID1server_back id1_reply;
     x_ResolveId(result, id1_reply, id1_request);
 
-    TGi gi;
+    TSequenceGi gi;
     if ( id1_reply.IsGotgi() ) {
-        gi = id1_reply.GetGotgi();
-    }
-    else {
-        gi = ZERO_GI;
+        gi.gi = id1_reply.GetGotgi();
+        gi.sequence_found = true;
     }
     SetAndSaveSeq_idGi(result, seq_id, gi);
     return true;
@@ -322,14 +320,15 @@ bool CId1Reader::LoadSeq_idSeq_ids(CReaderRequestResult& result,
     if ( !gi_lock.IsLoaded() ) {
         m_Dispatcher->LoadSeq_idGi(result, seq_id);
     }
-    TGi gi = gi_lock.GetGi();
-    if ( gi == ZERO_GI ) {
+    TSequenceGi data = gi_lock.GetGi();
+    if ( !gi_lock.IsFound(data) ) {
         // no gi -> no Seq-ids
         SetAndSaveNoSeq_idSeq_ids(result, seq_id, gi_lock);
         return true;
     }
 
-    CSeq_id_Handle gi_handle = CSeq_id_Handle::GetGiHandle(gi);
+    CSeq_id_Handle gi_handle =
+        CSeq_id_Handle::GetGiHandle(gi_lock.GetGi(data));
     CLoadLockSeqIds gi_ids_lock(result, gi_handle);
     if ( !gi_ids_lock.IsLoaded() ) {
         m_Dispatcher->LoadSeq_idSeq_ids(result, gi_handle);
@@ -430,8 +429,9 @@ bool CId1Reader::LoadSeq_idBlob_ids(CReaderRequestResult& result,
     if ( !gi_lock.IsLoaded() ) {
         m_Dispatcher->LoadSeq_idGi(result, seq_id);
     }
-    TGi gi = gi_lock.GetGi();
-    if ( gi == ZERO_GI ) {
+    TSequenceGi data = gi_lock.GetGi();
+    TGi gi = gi_lock.GetGi(data);
+    if ( !gi ) {
         // no gi -> no Seq-ids
         SetAndSaveNoSeq_idBlob_ids(result, seq_id, sel, gi_lock);
         return true;
@@ -625,7 +625,9 @@ CId1Reader::x_ResolveId(CReaderRequestResult& result,
             CBioseq_Handle::fState_no_data;
         break;
     case 10:
-        state = CBioseq_Handle::fState_no_data;
+        state =
+            CBioseq_Handle::fState_not_found|
+            CBioseq_Handle::fState_no_data;
         break;
     case 100:
         NCBI_THROW_FMT(CLoaderException, eConnectionFailed,
diff --git a/c++/src/objtools/data_loaders/genbank/info_cache.cpp b/c++/src/objtools/data_loaders/genbank/info_cache.cpp
index 2e917a0..c3725c6 100644
--- a/c++/src/objtools/data_loaders/genbank/info_cache.cpp
+++ b/c++/src/objtools/data_loaders/genbank/info_cache.cpp
@@ -1,4 +1,4 @@
-/*  $Id: info_cache.cpp 440718 2014-07-16 16:14:09Z vasilche $
+/*  $Id: info_cache.cpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -76,7 +76,7 @@ CInfoRequestorLock::~CInfoRequestorLock(void)
 }
 
 
-bool CInfoRequestorLock::SetLoaded(TExpirationTime new_expiration_time)
+bool CInfoRequestorLock::SetLoadedFor(TExpirationTime new_expiration_time)
 {
     _ASSERT(!IsLocked() || m_Mutex->m_LoadingRequestor == &GetRequestor());
     CInfo_Base& info = GetInfo();
@@ -89,8 +89,8 @@ bool CInfoRequestorLock::SetLoaded(TExpirationTime new_expiration_time)
 }
 
 
-bool CInfoRequestorLock::x_SetLoaded(TMainMutex::TWriteLockGuard& guard,
-                                     TExpirationTime new_expiration_time)
+bool CInfoRequestorLock::x_SetLoadedFor(TMainMutex::TWriteLockGuard& guard,
+                                        TExpirationTime new_expiration_time)
 {
     _ASSERT(!IsLocked() || m_Mutex->m_LoadingRequestor == &GetRequestor());
     CInfo_Base& info = GetInfo();
diff --git a/c++/src/objtools/data_loaders/genbank/processors.cpp b/c++/src/objtools/data_loaders/genbank/processors.cpp
index ddc4e0a..d2c99c2 100644
--- a/c++/src/objtools/data_loaders/genbank/processors.cpp
+++ b/c++/src/objtools/data_loaders/genbank/processors.cpp
@@ -1,4 +1,4 @@
-/*  $Id: processors.cpp 468561 2015-05-26 15:57:12Z vasilche $
+/*  $Id: processors.cpp 490251 2016-01-22 15:40:54Z vasilche $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -40,9 +40,9 @@
 #include <objtools/data_loaders/genbank/impl/statistics.hpp>
 
 #include <objtools/data_loaders/genbank/reader_snp.hpp>
-#include <objtools/data_loaders/genbank/impl/split_parser.hpp>
 #include <objtools/error_codes.hpp>
 
+#include <objmgr/impl/split_parser.hpp>
 #include <objmgr/impl/tse_split_info.hpp>
 #include <objmgr/annot_selector.hpp>
 
@@ -572,8 +572,7 @@ void CProcessor::OffsetAllGis(CTSE_SetObjectInfo& set_info, TIntId gi_offset)
     }
     NON_CONST_ITERATE ( CTSE_SetObjectInfo::TSeq_annot_InfoMap, it,
                         set_info.m_Seq_annot_InfoMap ) {
-        CSeq_annot_SNP_Info& snp_info = *it->second.m_SNP_annot_Info;
-        snp_info.SetGi(TIntId(snp_info.GetGi())+gi_offset);
+        it->second.m_SNP_annot_Info->OffsetGi(gi_offset);
     }
 }
 
@@ -598,6 +597,14 @@ void CProcessor::OffsetAllGisToOM(CBeginInfo obj, CTSE_SetObjectInfo* set_info)
 BEGIN_LOCAL_NAMESPACE;
 
 
+static inline
+bool s_CanBeWGSBlob(const CBlob_id& blob_id)
+{
+    return !CProcessor_ExtAnnot::IsExtAnnot(blob_id);
+}
+
+
+static
 bool s_GoodLetters(CTempString s) {
     ITERATE ( CTempString, it, s ) {
         if ( !isalpha(*it & 0xff) ) {
@@ -608,6 +615,7 @@ bool s_GoodLetters(CTempString s) {
 }
 
 
+static
 bool s_GoodDigits(CTempString s) {
     bool have_non_zero = false;
     ITERATE ( CTempString, it, s ) {
@@ -622,6 +630,7 @@ bool s_GoodDigits(CTempString s) {
 }
 
 
+static
 CSeq_id_Handle s_GetWGSMasterSeq_id(const CSeq_id_Handle& idh)
 {
     CSeq_id_Handle master_idh;
@@ -692,23 +701,22 @@ CSeq_id_Handle s_GetWGSMasterSeq_id(const CSeq_id_Handle& idh)
 }
 
 
-inline
-int s_GetGoodDescrMask(void)
-{
-    return
-        (1<<CSeqdesc::e_Pub) |
-        (1<<CSeqdesc::e_Comment) |
-        (1<<CSeqdesc::e_User);
-}
+static const int kForceDescrMask = ((1<<CSeqdesc::e_Pub) |
+                                    (1<<CSeqdesc::e_Comment) |
+                                    (1<<CSeqdesc::e_User));
+
+static const int kOptionalDescrMask = ((1<<CSeqdesc::e_Source) |
+                                       (1<<CSeqdesc::e_Molinfo) |
+                                       (1<<CSeqdesc::e_Create_date) |
+                                       (1<<CSeqdesc::e_Update_date));
+
+static const int kGoodDescrMask = kForceDescrMask | kOptionalDescrMask;
 
 
+static
 bool s_IsGoodDescr(const CSeqdesc& desc)
 {
-    if ( desc.Which() == CSeqdesc::e_Pub ||
-         desc.Which() == CSeqdesc::e_Comment ) {
-        return true;
-    }
-    else if ( desc.Which() == CSeqdesc::e_User ) {
+    if ( desc.Which() == CSeqdesc::e_User ) {
         const CObject_id& type = desc.GetUser().GetType();
         if ( type.Which() == CObject_id::e_Str ) {
             const string& name = type.GetStr();
@@ -720,10 +728,38 @@ bool s_IsGoodDescr(const CSeqdesc& desc)
             }
         }
     }
+    else if ( (1 << desc.Which()) & kGoodDescrMask ) {
+        return true;
+    }
     return false;
 }
 
 
+static
+void s_AddMasterDescr(CBioseq_Info& seq, const CSeq_descr& src)
+{
+    int existing_mask = 0;
+    CSeq_descr::Tdata& dst = seq.x_SetDescr().Set();
+    ITERATE ( CSeq_descr::Tdata, it, dst ) {
+        const CSeqdesc& desc = **it;
+        existing_mask |= 1 << desc.Which();
+    }
+    ITERATE ( CSeq_descr::Tdata, it, src.Get() ) {
+        int mask = 1 << (*it)->Which();
+        if ( mask & kOptionalDescrMask ) {
+            if ( mask & existing_mask ) {
+                continue;
+            }
+        }
+        else if ( !(mask & kForceDescrMask) ) {
+            continue;
+        }
+        dst.push_back(*it);
+    }
+}
+
+
+static
 CRef<CSeq_descr> s_GetWGSMasterDescr(CDataLoader* loader,
                                      const CSeq_id_Handle& master_idh)
 {
@@ -789,8 +825,7 @@ public:
     virtual void Update(CBioseq_Info& seq) {
         if ( HasMasterId(seq) ) {
             // register master descr chunk
-            seq.x_AddDescrChunkId(s_GetGoodDescrMask(),
-                                  kMasterWGS_ChunkId);
+            seq.x_AddDescrChunkId(kGoodDescrMask, kMasterWGS_ChunkId);
         }
     }
 };
@@ -810,7 +845,7 @@ public:
         if ( m_Descr &&
              seq.x_NeedUpdate(seq.fNeedUpdate_descr) &&
              HasMasterId(seq) ) {
-            seq.AddSeq_descr(*m_Descr);
+            s_AddMasterDescr(seq, *m_Descr);
         }
     }
 
@@ -1171,16 +1206,7 @@ void CProcessor_ID1_SNP::ProcessObjStream(CReaderRequestResult& result,
     }
     TSeqEntryInfo entry = GetSeq_entry(result, blob_id, reply);
     result.SetAndSaveBlobState(blob_id, entry.second);
-        
-    CLoadLockSetter setter(blob);
-    if ( !setter.IsLoaded() ) {
-        if ( entry.first ) {
-            OffsetAllGisToOM(*entry.first, &set_info);
-            setter.SetSeq_entry(*entry.first, &set_info);
-        }
-        setter.SetLoaded();
-    }
-        
+    
     CWriter* writer = GetWriter(result);
     if ( writer && version >= 0 ) {
         if ( set_info.m_Seq_annot_InfoMap.empty() || !entry.first ) {
@@ -1201,6 +1227,15 @@ void CProcessor_ID1_SNP::ProcessObjStream(CReaderRequestResult& result,
             }
         }
     }
+
+    CLoadLockSetter setter(blob);
+    if ( !setter.IsLoaded() ) {
+        if ( entry.first ) {
+            OffsetAllGisToOM(*entry.first, &set_info);
+            setter.SetSeq_entry(*entry.first, &set_info);
+        }
+        setter.SetLoaded();
+    }
 }
 
 
@@ -1269,6 +1304,7 @@ void CProcessor_SE::ProcessObjStream(CReaderRequestResult& result,
         OffsetAllGisToOM(*seq_entry);
         setter.SetSeq_entry(*seq_entry);
         if ( chunk_id == kMain_ChunkId &&
+             s_CanBeWGSBlob(blob_id) &&
              result.GetAddWGSMasterDescr() ) {
             AddWGSMaster(setter);
         }
@@ -1801,7 +1837,8 @@ void CProcessor_ID2::ProcessData(CReaderRequestResult& result,
         if ( !setter.IsLoaded() ) {
             OffsetAllGisToOM(*entry);
             setter.SetSeq_entry(*entry);
-            if ( result.GetAddWGSMasterDescr() ) {
+            if ( s_CanBeWGSBlob(blob_id) &&
+                 result.GetAddWGSMasterDescr() ) {
                 AddWGSMaster(setter);
             }
             setter.SetLoaded();
@@ -1875,7 +1912,8 @@ void CProcessor_ID2::ProcessData(CReaderRequestResult& result,
             lock->GetSplitInfo().SetSplitVersion(split_version);
             OffsetAllGisToOM(*split_info);
             CSplitParser::Attach(*lock, *split_info);
-            if ( result.GetAddWGSMasterDescr() ) {
+            if ( s_CanBeWGSBlob(blob_id) &&
+                 result.GetAddWGSMasterDescr() ) {
                 AddWGSMaster(setter);
             }
             setter.SetLoaded();
@@ -2008,7 +2046,7 @@ void CProcessor_ID2::x_FixCompression(CID2_Reply_Data& data)
         COSSWriter writer(new_data.SetData());
         CWStream wstream(&writer);
         CCompressionOStream stream(wstream,
-                                   new CZipStreamCompressor,
+                                   new CZipStreamCompressor(ICompression::eLevel_Lowest),
                                    CCompressionIStream::fOwnProcessor);
         ITERATE ( CID2_Reply_Data::TData, it, data.GetData() ) {
             stream.write(&(**it)[0], (*it)->size());
@@ -2452,6 +2490,7 @@ void CProcessor_ExtAnnot::Process(CReaderRequestResult& result,
     case eSubSat_microRNA:
         name.SetNamed("other");
         type.SetFeatSubtype(CSeqFeatData::eSubtype_ncRNA);
+        more_types.push_back(SAnnotTypeSelector(CSeqFeatData::eSubtype_otherRNA));
         db_name = "Annot:microRNA";
         break;
     case eSubSat_Exon:
diff --git a/c++/src/objtools/data_loaders/genbank/reader.cpp b/c++/src/objtools/data_loaders/genbank/reader.cpp
index eda9d2c..c19b1e3 100644
--- a/c++/src/objtools/data_loaders/genbank/reader.cpp
+++ b/c++/src/objtools/data_loaders/genbank/reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reader.cpp 452490 2014-11-20 15:50:53Z vasilche $
+/*  $Id: reader.cpp 494478 2016-03-07 19:26:06Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -570,8 +570,80 @@ bool CReader::LoadSequenceHash(CReaderRequestResult& result,
                                const CSeq_id_Handle& seq_id)
 {
     if ( !result.IsLoadedHash(seq_id) ) {
-        result.SetLoadedHash(seq_id, 0);
+        TSequenceHash hash;
+        CLoadLockSeqIds ids(result, seq_id);
+        if ( !ids.IsLoaded() ) {
+            m_Dispatcher->LoadSeq_idSeq_ids(result, seq_id);
+            hash.sequence_found = ids.GetSeq_ids().IsFound();
+            // no hash information by default
+        }
+        result.SetLoadedHash(seq_id, TSequenceHash());
+    }
+    return true;
+}
+
+
+bool CReader::LoadSequenceLength(CReaderRequestResult& result,
+                                 const CSeq_id_Handle& seq_id)
+{
+    if ( result.IsLoadedLength(seq_id) ) {
+        return true;
+    }
+
+    TSeqPos length = kInvalidSeqPos;
+    m_Dispatcher->LoadBlobs(result, seq_id, fBlobHasCore, 0);
+    CLoadLockBlobIds blobs(result, seq_id, static_cast<SAnnotSelector*>(0));
+    _ASSERT(blobs.IsLoaded());
+    CFixedBlob_ids blob_ids = blobs.GetBlob_ids();
+    ITERATE ( CFixedBlob_ids, it, blob_ids ) {
+        const CBlob_Info& info = *it;
+        const CBlob_id& blob_id = *info.GetBlob_id();
+        if ( !info.Matches(fBlobHasCore, 0) ) {
+            continue;
+        }
+        CLoadLockBlob blob(result, blob_id);
+        _ASSERT(blob.IsLoadedBlob());
+        CTSE_LoadLock& lock = blob.GetTSE_LoadLock();
+        _ASSERT(lock);
+        if ( CConstRef<CBioseq_Info> seq = lock->FindMatchingBioseq(seq_id) ) {
+            length = seq->GetInst().GetLength();
+            break;
+        }
     }
+    SetAndSaveSequenceLength(result, seq_id, length);
+    return true;
+}
+
+
+bool CReader::LoadSequenceType(CReaderRequestResult& result,
+                               const CSeq_id_Handle& seq_id)
+{
+    if ( result.IsLoadedType(seq_id) ) {
+        return true;
+    }
+
+    TSequenceType type;
+    m_Dispatcher->LoadBlobs(result, seq_id, fBlobHasCore, 0);
+    CLoadLockBlobIds blobs(result, seq_id, static_cast<SAnnotSelector*>(0));
+    _ASSERT(blobs.IsLoaded());
+    CFixedBlob_ids blob_ids = blobs.GetBlob_ids();
+    ITERATE ( CFixedBlob_ids, it, blob_ids ) {
+        const CBlob_Info& info = *it;
+        const CBlob_id& blob_id = *info.GetBlob_id();
+        if ( !info.Matches(fBlobHasCore, 0) ) {
+            continue;
+        }
+        CLoadLockBlob blob(result, blob_id);
+        _ASSERT(blob.IsLoadedBlob());
+        CTSE_LoadLock& lock = blob.GetTSE_LoadLock();
+        _ASSERT(lock);
+        if ( CConstRef<CBioseq_Info> seq = lock->FindMatchingBioseq(seq_id) ) {
+            type.type = seq->GetInst().GetMol();
+            type.sequence_found = true;
+            break;
+        }
+    }
+    SetAndSaveSequenceType(result, seq_id, type);
     return true;
 }
 
@@ -589,8 +661,11 @@ bool CReader::LoadAccVers(CReaderRequestResult& result,
             m_Dispatcher->LoadSeq_idAccVer(result, ids[i]);
         }
         if ( lock.IsLoadedAccVer() ) {
-            ret[i] = lock.GetAccVer();
-            loaded[i] = true;
+            TSequenceAcc data = lock.GetAccVer();
+            if ( lock.IsFound(data) ) {
+                ret[i] = lock.GetAcc(data);
+                loaded[i] = true;
+            }
         }
     }
     return true;
@@ -610,8 +685,11 @@ bool CReader::LoadGis(CReaderRequestResult& result,
             m_Dispatcher->LoadSeq_idGi(result, ids[i]);
         }
         if ( lock.IsLoadedGi() ) {
-            ret[i] = lock.GetGi();
-            loaded[i] = true;
+            TSequenceGi data = lock.GetGi();
+            if ( lock.IsFound(data) ) {
+                ret[i] = lock.GetGi(data);
+                loaded[i] = true;
+            }
         }
     }
     return true;
@@ -630,7 +708,7 @@ bool CReader::LoadLabels(CReaderRequestResult& result,
         if ( !lock.IsLoadedLabel() ) {
             m_Dispatcher->LoadSeq_idLabel(result, ids[i]);
         }
-        if ( lock.IsLoadedLabel() ) {
+        if ( lock.IsLoadedLabel() && !lock.GetLabel().empty() ) {
             ret[i] = lock.GetLabel();
             loaded[i] = true;
         }
@@ -651,7 +729,7 @@ bool CReader::LoadTaxIds(CReaderRequestResult& result,
         if ( !lock.IsLoadedTaxId() ) {
             m_Dispatcher->LoadSeq_idTaxId(result, ids[i]);
         }
-        if ( lock.IsLoadedTaxId() ) {
+        if ( lock.IsLoadedTaxId() && lock.GetTaxId() != -1 ) {
             ret[i] = lock.GetTaxId();
             loaded[i] = true;
         }
@@ -661,7 +739,8 @@ bool CReader::LoadTaxIds(CReaderRequestResult& result,
 
 
 bool CReader::LoadHashes(CReaderRequestResult& result,
-                         const TIds& ids, TLoaded& loaded, TTaxIds& ret)
+                         const TIds& ids, TLoaded& loaded,
+                         THashes& ret, TKnown& known)
 {
     size_t count = ids.size();
     for ( size_t i = 0; i < count; ++i ) {
@@ -673,7 +752,32 @@ bool CReader::LoadHashes(CReaderRequestResult& result,
             m_Dispatcher->LoadSequenceHash(result, ids[i]);
         }
         if ( lock.IsLoadedHash() ) {
-            ret[i] = lock.GetHash();
+            TSequenceHash hash = lock.GetHash();
+            if ( hash.sequence_found ) {
+                ret[i] = hash.hash;
+                loaded[i] = true;
+                known[i] = hash.hash_known;
+            }
+        }
+    }
+    return true;
+}
+
+
+bool CReader::LoadLengths(CReaderRequestResult& result,
+                          const TIds& ids, TLoaded& loaded, TLengths& ret)
+{
+    size_t count = ids.size();
+    for ( size_t i = 0; i < count; ++i ) {
+        if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+            continue;
+        }
+        CLoadLockLength lock(result, ids[i]);
+        if ( !lock.IsLoadedLength() ) {
+            m_Dispatcher->LoadSequenceLength(result, ids[i]);
+        }
+        if ( lock.IsLoadedLength() && lock.GetLength() != kInvalidSeqPos ) {
+            ret[i] = lock.GetLength();
             loaded[i] = true;
         }
     }
@@ -681,6 +785,30 @@ bool CReader::LoadHashes(CReaderRequestResult& result,
 }
 
 
+bool CReader::LoadTypes(CReaderRequestResult& result,
+                          const TIds& ids, TLoaded& loaded, TTypes& ret)
+{
+    size_t count = ids.size();
+    for ( size_t i = 0; i < count; ++i ) {
+        if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+            continue;
+        }
+        CLoadLockType lock(result, ids[i]);
+        if ( !lock.IsLoadedType() ) {
+            m_Dispatcher->LoadSequenceType(result, ids[i]);
+        }
+        if ( lock.IsLoadedType() ) {
+            TSequenceType data = lock.GetType();
+            if ( lock.IsFound(data) ) {
+                ret[i] = lock.GetType(data);
+                loaded[i] = true;
+            }
+        }
+    }
+    return true;
+}
+
+
 bool CReader::LoadStates(CReaderRequestResult& result,
                          const TIds& ids, TLoaded& loaded, TStates& ret)
 {
@@ -706,7 +834,8 @@ bool CReader::LoadStates(CReaderRequestResult& result,
                 if ( !state_lock.IsLoaded() ) {
                     m_Dispatcher->LoadBlobState(result, *it->GetBlob_id());
                 }
-                if ( state_lock.IsLoaded() ) {
+                if ( state_lock.IsLoaded() &&
+                     !(state_lock.GetBlobState() & CBioseq_Handle::fState_not_found) ) {
                     ret[i] = state_lock.GetBlobState();
                     loaded[i] = true;
                     break;
@@ -738,28 +867,6 @@ bool CReader::LoadSeq_idBlob_ids(CReaderRequestResult& result,
 
 
 bool CReader::LoadBlobs(CReaderRequestResult& result,
-                        const string& seq_id,
-                        TContentsMask mask,
-                        const SAnnotSelector* sel)
-{
-    CLoadLockSeqIds ids(result, seq_id);
-    if ( !ids.IsLoaded() ) {
-        if ( !LoadStringSeq_ids(result, seq_id) && !ids.IsLoaded() ) {
-            return false;
-        }
-        if ( !ids.IsLoaded() ) {
-            return true;
-        }
-    }
-    CFixedSeq_ids seq_ids = ids.GetSeq_ids();
-    if ( !seq_ids.empty() ) {
-        m_Dispatcher->LoadBlobs(result, seq_ids.front(), mask, sel);
-    }
-    return true;
-}
-
-
-bool CReader::LoadBlobs(CReaderRequestResult& result,
                         const CSeq_id_Handle& seq_id,
                         TContentsMask mask,
                         const SAnnotSelector* sel)
@@ -866,18 +973,10 @@ void CReader::SetAndSaveNoBlob(CReaderRequestResult& result,
                                TChunkId chunk_id,
                                TBlobState blob_state)
 {
-    blob_state |= CBioseq_Handle::fState_no_data;
-    if ( !result.SetNoBlob(blob_id, blob_state) ) {
-        return;
-    }
-    if ( CWriter* writer = result.GetBlobWriter() ) {
-        const CProcessor_St_SE* prc =
-            dynamic_cast<const CProcessor_St_SE*>
-            (&m_Dispatcher->GetProcessor(CProcessor::eType_St_Seq_entry));
-        if ( prc ) {
-            prc->SaveNoBlob(result, blob_id, chunk_id, blob_state, writer);
-        }
-    }
+    blob_state |=
+        CBioseq_Handle::fState_not_found|
+        CBioseq_Handle::fState_no_data;
+    result.SetNoBlob(blob_id, blob_state);
 }
 
 
@@ -927,25 +1026,12 @@ void CReader::SetAndSaveBlobVersion(CReaderRequestResult& result,
 }
 
 
-void CReader::SetAndSaveStringSeq_ids(CReaderRequestResult& result,
-                                      const string& seq_id,
-                                      const CFixedSeq_ids& seq_ids) const
-{
-    if ( !result.SetLoadedSeqIds(seq_id, seq_ids) ) {
-        return;
-    }
-    if ( CWriter* writer = result.GetIdWriter() ) {
-        writer->SaveStringSeq_ids(result, seq_id);
-    }
-}
-
-
 void CReader::SetAndSaveSeq_idSeq_ids(CReaderRequestResult& result,
                                       const CSeq_id_Handle& seq_id,
                                       const CFixedSeq_ids& seq_ids) const
 {
     TRACE_SET("SetAndSaveSeq_idSeq_ids("<<seq_id<<") state: "<<seq_ids.GetState());
-    if ( seq_ids.GetState() & CBioseq_Handle::fState_no_data ) {
+    if ( !seq_ids.IsFound() ) {
         SetAndSaveNoSeq_idBlob_ids(result, seq_id, 0, seq_ids.GetState());
     }
     if ( !result.SetLoadedSeqIds(seq_id, seq_ids) ) {
@@ -1039,43 +1125,22 @@ void CReader::SetAndSaveNoSeq_idBlob_ids(CReaderRequestResult& result,
 }
 
 
-void CReader::SetAndSaveNoStringSeq_ids(CReaderRequestResult& result,
-                                        const string& seq_id,
-                                        TState state) const
-{
-    state |= CBioseq_Handle::fState_no_data;
-    return SetAndSaveStringSeq_ids(result, seq_id, CFixedSeq_ids(state));
-}
-
-
 void CReader::SetAndSaveNoSeq_idSeq_ids(CReaderRequestResult& result,
                                         const CSeq_id_Handle& seq_id,
                                         TState state) const
 {
-    state |= CBioseq_Handle::fState_no_data;
+    state |=
+        CBioseq_Handle::fState_not_found|
+        CBioseq_Handle::fState_no_data;
     return SetAndSaveSeq_idSeq_ids(result, seq_id, CFixedSeq_ids(state));
 }
 
 
-void CReader::SetAndSaveStringGi(CReaderRequestResult& result,
-                                 const string& seq_id,
-                                 TGi gi) const
-{
-    if ( !result.SetLoadedGi(seq_id, gi) ) {
-        return;
-    }
-    if ( CWriter* writer = result.GetIdWriter() ) {
-        writer->SaveStringGi(result, seq_id);
-    }
-}
-
-
 void CReader::SetAndSaveSeq_idGi(CReaderRequestResult& result,
                                  const CSeq_id_Handle& seq_id,
-                                 TGi gi,
-                                 ESave save) const
+                                 const TSequenceGi& gi) const
 {
-    if ( !result.SetLoadedGi(seq_id, gi) || save != eSave ) {
+    if ( !result.SetLoadedGi(seq_id, gi) ) {
         return;
     }
     if ( CWriter* writer = result.GetIdWriter() ) {
@@ -1086,7 +1151,7 @@ void CReader::SetAndSaveSeq_idGi(CReaderRequestResult& result,
 
 void CReader::SetAndSaveSeq_idAccVer(CReaderRequestResult& result,
                                      const CSeq_id_Handle& seq_id,
-                                     const CSeq_id_Handle& acc_id) const
+                                     const TSequenceAcc& acc_id) const
 {
     if ( !result.SetLoadedAcc(seq_id, acc_id) ) {
         return;
@@ -1112,10 +1177,9 @@ void CReader::SetAndSaveSeq_idLabel(CReaderRequestResult& result,
 
 void CReader::SetAndSaveSeq_idTaxId(CReaderRequestResult& result,
                                     const CSeq_id_Handle& seq_id,
-                                    int taxid,
-                                    ESave save) const
+                                    int taxid) const
 {
-    if ( !result.SetLoadedTaxId(seq_id, taxid) || save != eSave ) {
+    if ( !result.SetLoadedTaxId(seq_id, taxid) ) {
         return;
     }
     if ( CWriter* writer = result.GetIdWriter() ) {
@@ -1126,10 +1190,9 @@ void CReader::SetAndSaveSeq_idTaxId(CReaderRequestResult& result,
 
 void CReader::SetAndSaveSequenceHash(CReaderRequestResult& result,
                                      const CSeq_id_Handle& seq_id,
-                                     int hash,
-                                     ESave save) const
+                                     const TSequenceHash& hash) const
 {
-    if ( !result.SetLoadedHash(seq_id, hash) || save != eSave ) {
+    if ( !result.SetLoadedHash(seq_id, hash) ) {
         return;
     }
     if ( CWriter* writer = result.GetIdWriter() ) {
@@ -1138,6 +1201,32 @@ void CReader::SetAndSaveSequenceHash(CReaderRequestResult& result,
 }
 
 
+void CReader::SetAndSaveSequenceLength(CReaderRequestResult& result,
+                                       const CSeq_id_Handle& seq_id,
+                                       TSeqPos length) const
+{
+    if ( !result.SetLoadedLength(seq_id, length) ) {
+        return;
+    }
+    if ( CWriter* writer = result.GetIdWriter() ) {
+        writer->SaveSequenceLength(result, seq_id);
+    }
+}
+
+
+void CReader::SetAndSaveSequenceType(CReaderRequestResult& result,
+                                     const CSeq_id_Handle& seq_id,
+                                     const TSequenceType& type) const
+{
+    if ( !result.SetLoadedType(seq_id, type) ) {
+        return;
+    }
+    if ( CWriter* writer = result.GetIdWriter() ) {
+        writer->SaveSequenceType(result, seq_id);
+    }
+}
+
+
 void CReader::SetAndSaveSeq_idBlob_ids(CReaderRequestResult& result,
                                        const CSeq_id_Handle& seq_id,
                                        const SAnnotSelector* sel,
@@ -1178,7 +1267,9 @@ void CReader::SetAndSaveNoSeq_idBlob_ids(CReaderRequestResult& result,
                                          CLoadLockBlobIds& lock,
                                          TBlobState state) const
 {
-    state |= CBioseq_Handle::fState_no_data;
+    state |=
+        CBioseq_Handle::fState_not_found|
+        CBioseq_Handle::fState_no_data;
     TRACE_SET("SetAndSaveNoSeq_idBlob_ids("<<seq_id<<")");
     if ( !lock.SetNoBlob_ids(state) ) {
         return;
diff --git a/c++/src/objtools/data_loaders/genbank/reader_id1_base.cpp b/c++/src/objtools/data_loaders/genbank/reader_id1_base.cpp
index f37f07c..bfedb07 100644
--- a/c++/src/objtools/data_loaders/genbank/reader_id1_base.cpp
+++ b/c++/src/objtools/data_loaders/genbank/reader_id1_base.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reader_id1_base.cpp 440703 2014-07-16 15:38:41Z vasilche $
+/*  $Id: reader_id1_base.cpp 494478 2016-03-07 19:26:06Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -57,13 +57,6 @@ CId1ReaderBase::~CId1ReaderBase()
 }
 
 
-bool CId1ReaderBase::LoadStringSeq_ids(CReaderRequestResult& /*result*/,
-                                       const string& /*seq_id*/)
-{
-    return false;
-}
-
-
 bool CId1ReaderBase::LoadBlob(CReaderRequestResult& result,
                               const TBlobId& blob_id)
 {
diff --git a/c++/src/objtools/data_loaders/genbank/reader_id2_base.cpp b/c++/src/objtools/data_loaders/genbank/reader_id2_base.cpp
index 6aa7e0f..3c3dd2a 100644
--- a/c++/src/objtools/data_loaders/genbank/reader_id2_base.cpp
+++ b/c++/src/objtools/data_loaders/genbank/reader_id2_base.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reader_id2_base.cpp 469251 2015-06-02 19:33:36Z vasilche $
+/*  $Id: reader_id2_base.cpp 500239 2016-05-03 15:03:41Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -55,6 +55,8 @@
 #include <objects/seqloc/Seq_id.hpp>
 #include <objects/seqset/Seq_entry.hpp>
 #include <objects/id2/id2__.hpp>
+#include <objects/id2/id2processor.hpp>
+#include <objects/id2/id2processor_interface.hpp>
 #include <objects/seqsplit/seqsplit__.hpp>
 
 #include <serial/iterator.hpp>
@@ -70,11 +72,16 @@
 #define NCBI_USE_ERRCODE_X   Objtools_Rd_Id2Base
 
 BEGIN_NCBI_SCOPE
+
+NCBI_DEFINE_ERR_SUBCODE_X(15);
+
 BEGIN_SCOPE(objects)
 
 NCBI_PARAM_DECL(int, GENBANK, ID2_DEBUG);
 NCBI_PARAM_DECL(int, GENBANK, ID2_MAX_CHUNKS_REQUEST_SIZE);
 NCBI_PARAM_DECL(int, GENBANK, ID2_MAX_IDS_REQUEST_SIZE);
+NCBI_PARAM_DECL(string, GENBANK, ID2_PROCESSOR);
+NCBI_PARAM_DECL(bool, GENBANK, VDB_WGS);
 
 #ifdef _DEBUG
 # define DEFAULT_DEBUG_LEVEL CId2ReaderBase::eTraceError
@@ -88,6 +95,10 @@ NCBI_PARAM_DEF_EX(int, GENBANK, ID2_MAX_CHUNKS_REQUEST_SIZE, 100,
                   eParam_NoThread, GENBANK_ID2_MAX_CHUNKS_REQUEST_SIZE);
 NCBI_PARAM_DEF_EX(int, GENBANK, ID2_MAX_IDS_REQUEST_SIZE, 100,
                   eParam_NoThread, GENBANK_ID2_MAX_IDS_REQUEST_SIZE);
+NCBI_PARAM_DEF_EX(string, GENBANK, ID2_PROCESSOR, "",
+                  eParam_NoThread, GENBANK_ID2_PROCESSOR);
+NCBI_PARAM_DEF_EX(bool, GENBANK, VDB_WGS, true,
+                  eParam_NoThread, GENBANK_VDB_WGS);
 
 int CId2ReaderBase::GetDebugLevel(void)
 {
@@ -96,6 +107,13 @@ int CId2ReaderBase::GetDebugLevel(void)
 }
 
 
+static const char kSpecialId_label[] = "LABEL";
+static const char kSpecialId_taxid[] = "TAXID";
+static const char kSpecialId_hash[] = "HASH";
+static const char kSpecialId_length[] = "Seq-inst.length";
+static const char kSpecialId_type[] = "Seq-inst.mol";
+
+
 // Number of chunks allowed in a single request
 // 0 = unlimited request size
 // 1 = do not use packets or get-chunks requests
@@ -148,7 +166,6 @@ struct SId2LoadedSet
     typedef map<CBlob_id, CConstRef<CID2_Reply_Data> > TSkeletons;
     typedef map<CBlob_id, int> TBlobStates;
 
-    TStringSeq_idsSet   m_Seq_idsByString;
     TSeq_idSeq_idsSet   m_Seq_ids;
     TBlob_idSet         m_Blob_ids;
     TSkeletons          m_Skeletons;
@@ -160,6 +177,31 @@ CId2ReaderBase::CId2ReaderBase(void)
     : m_RequestSerialNumber(1),
       m_AvoidRequest(0)
 {
+    vector<string> proc_list;
+    string proc_param = NCBI_PARAM_TYPE(GENBANK, ID2_PROCESSOR)::GetDefault();
+    NStr::Tokenize(proc_param, ";", proc_list, NStr::eNoMergeDelims);
+    ITERATE ( vector<string>, it, proc_list ) {
+        const string& proc_name = *it;
+        CRef<CID2Processor> proc;
+        try {
+            proc = CPluginManagerGetter<CID2Processor>::Get()->
+                CreateInstance(proc_name);
+        }
+        catch ( CException& exc ) {
+            ERR_POST_X(15, "CId2ReaderBase: "
+                       "cannot load ID2 processor "<<proc_name<<": "<<exc);
+        }
+        if ( proc ) {
+            // send init request
+            CID2_Request req;
+            req.SetRequest().SetInit();
+            x_SetContextData(req);
+            CID2_Request_Packet packet;
+            packet.Set().push_back(Ref(&req));
+            proc->ProcessSomeRequests(packet);
+            m_Processors.push_back(proc);
+        }
+    }
 }
 
 
@@ -172,14 +214,6 @@ CId2ReaderBase::~CId2ReaderBase(void)
 
 
 void CId2ReaderBase::x_SetResolve(CID2_Request_Get_Blob_Id& get_blob_id,
-                                  const string& seq_id)
-{
-    get_blob_id.SetSeq_id().SetSeq_id().SetString(seq_id);
-    get_blob_id.SetExternal();
-}
-
-
-void CId2ReaderBase::x_SetResolve(CID2_Request_Get_Blob_Id& get_blob_id,
                                   const CSeq_id& seq_id)
 {
     //get_blob_id.SetSeq_id().SetSeq_id().SetSeq_id(const_cast<CSeq_id&>(seq_id));
@@ -239,21 +273,6 @@ void CId2ReaderBase::x_SetResolve(CID2_Blob_Id& blob_id, const CBlob_id& src)
 }
 
 
-bool CId2ReaderBase::LoadStringSeq_ids(CReaderRequestResult& result,
-                                       const string& seq_id)
-{
-    CLoadLockSeqIds ids(result, seq_id);
-    if ( ids.IsLoaded() ) {
-        return true;
-    }
-
-    CID2_Request req;
-    x_SetResolve(req.SetRequest().SetGet_blob_id(), seq_id);
-    x_ProcessRequest(result, req, 0);
-    return true;
-}
-
-
 bool CId2ReaderBase::LoadSeq_idSeq_ids(CReaderRequestResult& result,
                                        const CSeq_id_Handle& seq_id)
 {
@@ -373,7 +392,7 @@ bool CId2ReaderBase::LoadSeq_idTaxId(CReaderRequestResult& result,
 bool CId2ReaderBase::LoadSequenceHash(CReaderRequestResult& result,
                                       const CSeq_id_Handle& seq_id)
 {
-    if ( m_AvoidRequest & fAvoidRequest_for_SequenceHash ) {
+    if ( m_AvoidRequest & fAvoidRequest_for_Seq_id_hash ) {
         return CReader::LoadSequenceHash(result, seq_id);
     }
 
@@ -389,7 +408,63 @@ bool CId2ReaderBase::LoadSequenceHash(CReaderRequestResult& result,
     x_ProcessRequest(result, req, 0);
 
     if ( !lock.IsLoadedHash() ) {
-        m_AvoidRequest |= fAvoidRequest_for_SequenceHash;
+        m_AvoidRequest |= fAvoidRequest_for_Seq_id_hash;
+        return true; // repeat
+    }
+
+    return true;
+}
+
+
+bool CId2ReaderBase::LoadSequenceLength(CReaderRequestResult& result,
+                                        const CSeq_id_Handle& seq_id)
+{
+    if ( m_AvoidRequest & fAvoidRequest_for_Seq_id_length ) {
+        return CReader::LoadSequenceLength(result, seq_id);
+    }
+
+    CLoadLockLength lock(result, seq_id);
+    if ( lock.IsLoadedLength() ) {
+        return true;
+    }
+    CID2_Request req;
+    CID2_Request::C_Request::TGet_seq_id& get_id =
+        req.SetRequest().SetGet_seq_id();
+    get_id.SetSeq_id().SetSeq_id().Assign(*seq_id.GetSeqId());
+    get_id.SetSeq_id_type(CID2_Request_Get_Seq_id::eSeq_id_type_all |
+                          CID2_Request_Get_Seq_id::eSeq_id_type_seq_length);
+    x_ProcessRequest(result, req, 0);
+
+    if ( !lock.IsLoadedLength() ) {
+        m_AvoidRequest |= fAvoidRequest_for_Seq_id_length;
+        return true; // repeat
+    }
+
+    return true;
+}
+
+
+bool CId2ReaderBase::LoadSequenceType(CReaderRequestResult& result,
+                                      const CSeq_id_Handle& seq_id)
+{
+    if ( m_AvoidRequest & fAvoidRequest_for_Seq_id_type ) {
+        return CReader::LoadSequenceType(result, seq_id);
+    }
+
+    CLoadLockType lock(result, seq_id);
+    if ( lock.IsLoadedType() ) {
+        return true;
+    }
+    CID2_Request req;
+    CID2_Request::C_Request::TGet_seq_id& get_id =
+        req.SetRequest().SetGet_seq_id();
+    get_id.SetSeq_id().SetSeq_id().Assign(*seq_id.GetSeqId());
+    get_id.SetSeq_id_type(CID2_Request_Get_Seq_id::eSeq_id_type_all |
+                          CID2_Request_Get_Seq_id::eSeq_id_type_seq_mol);
+    x_ProcessRequest(result, req, 0);
+
+    if ( !lock.IsLoadedType() ) {
+        m_AvoidRequest |= fAvoidRequest_for_Seq_id_type;
         return true; // repeat
     }
 
@@ -415,8 +490,11 @@ bool CId2ReaderBase::LoadAccVers(CReaderRequestResult& result,
         }
         CLoadLockAcc lock(result, ids[i]);
         if ( lock.IsLoadedAccVer() ) {
-            ret[i] = lock.GetAccVer();
-            loaded[i] = true;
+            TSequenceAcc data = lock.GetAccVer();
+            if ( lock.IsFound(data) ) {
+                ret[i] = lock.GetAcc(data);
+                loaded[i] = true;
+            }
             continue;
         }
         
@@ -438,8 +516,11 @@ bool CId2ReaderBase::LoadAccVers(CReaderRequestResult& result,
                 }
                 CLoadLockAcc lock(result, ids[i]);
                 if ( lock.IsLoadedAccVer() ) {
-                    ret[i] = lock.GetAccVer();
-                    loaded[i] = true;
+                    TSequenceAcc data = lock.GetAccVer();
+                    if ( lock.IsFound(data) ) {
+                        ret[i] = lock.GetAcc(data);
+                        loaded[i] = true;
+                    }
                     continue;
                 }
             }
@@ -456,8 +537,11 @@ bool CId2ReaderBase::LoadAccVers(CReaderRequestResult& result,
             }
             CLoadLockAcc lock(result, ids[i]);
             if ( lock.IsLoadedAccVer() ) {
-                ret[i] = lock.GetAccVer();
-                loaded[i] = true;
+                TSequenceAcc data = lock.GetAccVer();
+                if ( lock.IsFound(data) ) {
+                    ret[i] = lock.GetAcc(data);
+                    loaded[i] = true;
+                }
                 continue;
             }
         }
@@ -485,8 +569,11 @@ bool CId2ReaderBase::LoadGis(CReaderRequestResult& result,
         }
         CLoadLockGi lock(result, ids[i]);
         if ( lock.IsLoadedGi() ) {
-            ret[i] = lock.GetGi();
-            loaded[i] = true;
+            TSequenceGi data = lock.GetGi();
+            if ( lock.IsFound(data) ) {
+                ret[i] = lock.GetGi(data);
+                loaded[i] = true;
+            }
             continue;
         }
         
@@ -508,8 +595,11 @@ bool CId2ReaderBase::LoadGis(CReaderRequestResult& result,
                 }
                 CLoadLockGi lock(result, ids[i]);
                 if ( lock.IsLoadedGi() ) {
-                    ret[i] = lock.GetGi();
-                    loaded[i] = true;
+                    TSequenceGi data = lock.GetGi();
+                    if ( lock.IsFound(data) ) {
+                        ret[i] = lock.GetGi(data);
+                        loaded[i] = true;
+                    }
                     continue;
                 }
             }
@@ -526,8 +616,11 @@ bool CId2ReaderBase::LoadGis(CReaderRequestResult& result,
             }
             CLoadLockGi lock(result, ids[i]);
             if ( lock.IsLoadedGi() ) {
-                ret[i] = lock.GetGi();
-                loaded[i] = true;
+                TSequenceGi data = lock.GetGi();
+                if ( lock.IsFound(data) ) {
+                    ret[i] = lock.GetGi(data);
+                    loaded[i] = true;
+                }
                 continue;
             }
         }
@@ -715,12 +808,13 @@ bool CId2ReaderBase::LoadTaxIds(CReaderRequestResult& result,
 
 
 bool CId2ReaderBase::LoadHashes(CReaderRequestResult& result,
-                                const TIds& ids, TLoaded& loaded, THashes& ret)
+                                const TIds& ids, TLoaded& loaded,
+                                THashes& ret, TKnown& known)
 {
     size_t max_request_size = GetMaxIdsRequestSize();
     if ( max_request_size <= 1 ||
-         (m_AvoidRequest & fAvoidRequest_for_SequenceHash) ) {
-        return CReader::LoadHashes(result, ids, loaded, ret);
+         (m_AvoidRequest & fAvoidRequest_for_Seq_id_hash) ) {
+        return CReader::LoadHashes(result, ids, loaded, ret, known);
     }
 
     size_t count = ids.size();
@@ -731,14 +825,22 @@ bool CId2ReaderBase::LoadHashes(CReaderRequestResult& result,
         if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
             continue;
         }
-        if ( m_AvoidRequest & fAvoidRequest_for_SequenceHash ) {
-            return CReader::LoadHashes(result, ids, loaded, ret);
+        if ( m_AvoidRequest & fAvoidRequest_for_Seq_id_hash ) {
+            return CReader::LoadHashes(result, ids, loaded, ret, known);
         }
         CLoadLockHash lock(result, ids[i]);
         if ( lock.IsLoadedHash() ) {
-            ret[i] = lock.GetHash();
-            loaded[i] = true;
-            continue;
+            TSequenceHash hash = lock.GetHash();
+            if ( hash.hash_known ) {
+                ret[i] = hash.hash;
+                loaded[i] = true;
+                known[i] = true;
+                continue;
+            }
+            else if ( !hash.sequence_found ) {
+                // no sequence at all
+                continue;
+            }
         }
         
         CRef<CID2_Request> req(new CID2_Request);
@@ -759,12 +861,107 @@ bool CId2ReaderBase::LoadHashes(CReaderRequestResult& result,
                 }
                 CLoadLockHash lock(result, ids[i]);
                 if ( lock.IsLoadedHash() ) {
-                    ret[i] = lock.GetHash();
+                    TSequenceHash hash = lock.GetHash();
+                    if ( hash.hash_known ) {
+                        ret[i] = hash.hash;
+                        loaded[i] = true;
+                        known[i] = true;
+                        continue;
+                    }
+                    else if ( !hash.sequence_found ) {
+                        // no sequence at all
+                        continue;
+                    }
+                }
+                else {
+                    m_AvoidRequest |= fAvoidRequest_for_Seq_id_hash;
+                }
+            }
+            packet.Set().clear();
+        }
+    }
+
+    if ( !packet.Set().empty() ) {
+        x_ProcessPacket(result, packet, 0);
+
+        for ( size_t i = packet_start; i < count; ++i ) {
+            if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+                continue;
+            }
+            CLoadLockHash lock(result, ids[i]);
+            TSequenceHash hash = lock.GetHash();
+            if ( hash.hash_known ) {
+                ret[i] = hash.hash;
+                loaded[i] = true;
+                known[i] = true;
+                continue;
+            }
+            else if ( !hash.sequence_found ) {
+                // no sequence at all
+                continue;
+            }
+            else {
+                m_AvoidRequest |= fAvoidRequest_for_Seq_id_hash;
+            }
+        }
+    }
+
+    return true;
+}
+
+
+bool CId2ReaderBase::LoadLengths(CReaderRequestResult& result,
+                                 const TIds& ids, TLoaded& loaded, TLengths& ret)
+{
+    size_t max_request_size = GetMaxIdsRequestSize();
+    if ( max_request_size <= 1 ||
+         (m_AvoidRequest & fAvoidRequest_for_Seq_id_length) ) {
+        return CReader::LoadLengths(result, ids, loaded, ret);
+    }
+
+    size_t count = ids.size();
+    CID2_Request_Packet packet;
+    size_t packet_start = 0;
+    
+    for ( size_t i = 0; i < count; ++i ) {
+        if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+            continue;
+        }
+        if ( m_AvoidRequest & fAvoidRequest_for_Seq_id_length ) {
+            return CReader::LoadLengths(result, ids, loaded, ret);
+        }
+        CLoadLockLength lock(result, ids[i]);
+        if ( lock.IsLoadedLength() ) {
+            ret[i] = lock.GetLength();
+            loaded[i] = true;
+            continue;
+        }
+        
+        CRef<CID2_Request> req(new CID2_Request);
+        CID2_Request::C_Request::TGet_seq_id& get_id =
+            req->SetRequest().SetGet_seq_id();
+        get_id.SetSeq_id().SetSeq_id().Assign(*ids[i].GetSeqId());
+        get_id.SetSeq_id_type(CID2_Request_Get_Seq_id::eSeq_id_type_all |
+                              CID2_Request_Get_Seq_id::eSeq_id_type_seq_length);
+        if ( packet.Set().empty() ) {
+            packet_start = i;
+        }
+        packet.Set().push_back(req);
+        if ( packet.Set().size() == max_request_size ) {
+            x_ProcessPacket(result, packet, 0);
+            size_t count = i+1;
+            for ( size_t i = packet_start; i < count; ++i ) {
+                if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+                    continue;
+                }
+                CLoadLockLength lock(result, ids[i]);
+                if ( lock.IsLoadedLength() ) {
+                    ret[i] = lock.GetLength();
                     loaded[i] = true;
                     continue;
                 }
                 else {
-                    m_AvoidRequest |= fAvoidRequest_for_SequenceHash;
+                    m_AvoidRequest |= fAvoidRequest_for_Seq_id_length;
                 }
             }
             packet.Set().clear();
@@ -778,14 +975,104 @@ bool CId2ReaderBase::LoadHashes(CReaderRequestResult& result,
             if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
                 continue;
             }
-            CLoadLockHash lock(result, ids[i]);
-            if ( lock.IsLoadedHash() ) {
-                ret[i] = lock.GetHash();
+            CLoadLockLength lock(result, ids[i]);
+            if ( lock.IsLoadedLength() ) {
+                ret[i] = lock.GetLength();
                 loaded[i] = true;
                 continue;
             }
             else {
-                m_AvoidRequest |= fAvoidRequest_for_SequenceHash;
+                m_AvoidRequest |= fAvoidRequest_for_Seq_id_length;
+            }
+        }
+    }
+
+    return true;
+}
+
+
+bool CId2ReaderBase::LoadTypes(CReaderRequestResult& result,
+                               const TIds& ids, TLoaded& loaded, TTypes& ret)
+{
+    size_t max_request_size = GetMaxIdsRequestSize();
+    if ( max_request_size <= 1 ||
+         (m_AvoidRequest & fAvoidRequest_for_Seq_id_type) ) {
+        return CReader::LoadTypes(result, ids, loaded, ret);
+    }
+
+    size_t count = ids.size();
+    CID2_Request_Packet packet;
+    size_t packet_start = 0;
+    
+    for ( size_t i = 0; i < count; ++i ) {
+        if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+            continue;
+        }
+        if ( m_AvoidRequest & fAvoidRequest_for_Seq_id_type ) {
+            return CReader::LoadTypes(result, ids, loaded, ret);
+        }
+        CLoadLockType lock(result, ids[i]);
+        if ( lock.IsLoadedType() ) {
+            TSequenceType data = lock.GetType();
+            if ( lock.IsFound(data) ) {
+                ret[i] = lock.GetType(data);
+                loaded[i] = true;
+            }
+            continue;
+        }
+        
+        CRef<CID2_Request> req(new CID2_Request);
+        CID2_Request::C_Request::TGet_seq_id& get_id =
+            req->SetRequest().SetGet_seq_id();
+        get_id.SetSeq_id().SetSeq_id().Assign(*ids[i].GetSeqId());
+        get_id.SetSeq_id_type(CID2_Request_Get_Seq_id::eSeq_id_type_all |
+                              CID2_Request_Get_Seq_id::eSeq_id_type_seq_mol);
+        if ( packet.Set().empty() ) {
+            packet_start = i;
+        }
+        packet.Set().push_back(req);
+        if ( packet.Set().size() == max_request_size ) {
+            x_ProcessPacket(result, packet, 0);
+            size_t count = i+1;
+            for ( size_t i = packet_start; i < count; ++i ) {
+                if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+                    continue;
+                }
+                CLoadLockType lock(result, ids[i]);
+                if ( lock.IsLoadedType() ) {
+                    TSequenceType data = lock.GetType();
+                    if ( lock.IsFound(data) ) {
+                        ret[i] = lock.GetType(data);
+                        loaded[i] = true;
+                    }
+                    continue;
+                }
+                else {
+                    m_AvoidRequest |= fAvoidRequest_for_Seq_id_type;
+                }
+            }
+            packet.Set().clear();
+        }
+    }
+
+    if ( !packet.Set().empty() ) {
+        x_ProcessPacket(result, packet, 0);
+
+        for ( size_t i = packet_start; i < count; ++i ) {
+            if ( loaded[i] || CReadDispatcher::CannotProcess(ids[i]) ) {
+                continue;
+            }
+            CLoadLockType lock(result, ids[i]);
+            if ( lock.IsLoadedType() ) {
+                TSequenceType data = lock.GetType();
+                if ( lock.IsFound(data) ) {
+                    ret[i] = lock.GetType(data);
+                    loaded[i] = true;
+                }
+                continue;
+            }
+            else {
+                m_AvoidRequest |= fAvoidRequest_for_Seq_id_type;
             }
         }
     }
@@ -874,8 +1161,7 @@ bool CId2ReaderBase::LoadBlobState(CReaderRequestResult& result,
     CID2_Request_Get_Blob_Info& req2 = req.SetRequest().SetGet_blob_info();
     x_SetResolve(req2.SetBlob_id().SetBlob_id(), blob_id);
     x_ProcessRequest(result, req, 0);
-    if ( blob_id.GetSat() == CProcessor_ExtAnnot::eSat_ANNOT &&
-         blob_id.GetSubSat() != CID2_Blob_Id::eSub_sat_main ) {
+    if ( CProcessor_ExtAnnot::IsExtAnnot(blob_id) ) {
         // workaround for possible incorrect reply on request for non-existent
         // external annotations
         if ( !lock.IsLoadedBlobState() ) {
@@ -898,8 +1184,7 @@ bool CId2ReaderBase::LoadBlobVersion(CReaderRequestResult& result,
     CID2_Request_Get_Blob_Info& req2 = req.SetRequest().SetGet_blob_info();
     x_SetResolve(req2.SetBlob_id().SetBlob_id(), blob_id);
     x_ProcessRequest(result, req, 0);
-    if ( blob_id.GetSat() == CProcessor_ExtAnnot::eSat_ANNOT &&
-         blob_id.GetSubSat() != CID2_Blob_Id::eSub_sat_main ) {
+    if ( CProcessor_ExtAnnot::IsExtAnnot(blob_id) ) {
         // workaround for possible incorrect reply on request for non-existent
         // external annotations
         if ( !lock.IsLoadedBlobVersion() ) {
@@ -912,21 +1197,6 @@ bool CId2ReaderBase::LoadBlobVersion(CReaderRequestResult& result,
 
 
 bool CId2ReaderBase::LoadBlobs(CReaderRequestResult& result,
-                               const string& seq_id,
-                               TContentsMask /*mask*/,
-                               const SAnnotSelector* /*sel*/)
-{
-    if ( m_AvoidRequest & fAvoidRequest_nested_get_blob_info ) {
-        return LoadStringSeq_ids(result, seq_id);
-    }
-    if ( result.IsLoadedSeqIds(seq_id) ) {
-        return true;
-    }
-    return LoadStringSeq_ids(result, seq_id);
-}
-
-
-bool CId2ReaderBase::LoadBlobs(CReaderRequestResult& result,
                                const CSeq_id_Handle& seq_id,
                                TContentsMask mask,
                                const SAnnotSelector* sel)
@@ -1303,6 +1573,44 @@ void CId2ReaderBase::x_ProcessRequest(CReaderRequestResult& result,
 }
 
 
+BEGIN_LOCAL_NAMESPACE;
+
+
+class CProcessorResolver : public CID2ProcessorResolver
+{
+public:
+    CProcessorResolver(CReadDispatcher& dispatcher,
+                       CReaderRequestResult& result)
+        : m_Dispatcher(dispatcher),
+          m_RequestResult(result)
+        {
+        }
+
+    virtual TIds GetIds(const CSeq_id& id)
+        {
+            TIds ret;
+            CSeq_id_Handle idh = CSeq_id_Handle::GetHandle(id);
+            CLoadLockSeqIds lock(m_RequestResult, idh);
+            if ( !lock.IsLoaded() ) {
+                CReaderRequestResultRecursion recurse(m_RequestResult, true);
+                m_Dispatcher.LoadSeq_idSeq_ids(m_RequestResult, idh);
+            }
+            CFixedSeq_ids ids = lock.GetSeq_ids();
+            ITERATE ( CFixedSeq_ids, it, ids ) {
+                ret.push_back(it->GetSeqId());
+            }
+            return ret;
+        }
+
+private:
+    CReadDispatcher& m_Dispatcher;
+    CReaderRequestResult& m_RequestResult;
+};
+
+
+END_LOCAL_NAMESPACE;
+
+
 void CId2ReaderBase::x_SetContextData(CID2_Request& request)
 {
     if ( request.GetRequest().IsInit() ) {
@@ -1310,6 +1618,17 @@ void CId2ReaderBase::x_SetContextData(CID2_Request& request)
         param->SetName("log:client_name");
         param->SetValue().push_back(GetDiagContext().GetAppName());
         request.SetParams().Set().push_back(param);
+        if ( 1 ) {
+            CRef<CID2_Param> param(new CID2_Param);
+            param->SetName("id2:allow");
+            // allow new blob-state field in several ID2 replies
+            param->SetValue().push_back("*.blob-state");
+            if ( NCBI_PARAM_TYPE(GENBANK, VDB_WGS)::GetDefault() ) {
+                // enable VDB-based WGS sequences
+                param->SetValue().push_back("vdb-wgs");
+            }
+            request.SetParams().Set().push_back(param);
+        }
     }
     CRequestContext& rctx = CDiagContext::GetRequestContext();
     if ( rctx.IsSetSessionID() ) {
@@ -1360,6 +1679,93 @@ void CId2ReaderBase::x_ProcessPacket(CReaderRequestResult& result,
     }}
     vector<char> done(request_count);
     vector<SId2LoadedSet> loaded_sets(request_count);
+    
+    int remaining_count = request_count;
+    NON_CONST_ITERATE ( TProcessors, it, m_Processors ) {
+        if ( result.IsInProcessor() ) {
+            break;
+        }
+        CProcessorResolver resolver(*m_Dispatcher, result);
+        CID2Processor::TReplies replies =
+            (*it)->ProcessSomeRequests(packet, &resolver);
+        ITERATE ( CID2Processor::TReplies, it, replies ) {
+            CRef<CID2_Reply> reply = *it;
+            if ( GetDebugLevel() >= eTraceConn   ) {
+                CDebugPrinter s(0, "CId2Reader");
+                s << "Received from processor";
+                if ( GetDebugLevel() >= eTraceASN ) {
+                    if ( GetDebugLevel() >= eTraceBlobData ) {
+                        s << ": " << MSerial_AsnText << *reply;
+                    }
+                    else {
+                        CTypeIterator<CID2_Reply_Data> iter = Begin(*reply);
+                        if ( iter && iter->IsSetData() ) {
+                            CID2_Reply_Data::TData save;
+                            save.swap(iter->SetData());
+                            size_t size = 0, count = 0, max_chunk = 0;
+                            ITERATE ( CID2_Reply_Data::TData, i, save ) {
+                                ++count;
+                                size_t chunk = (*i)->size();
+                                size += chunk;
+                                max_chunk = max(max_chunk, chunk);
+                            }
+                            s << ": " << MSerial_AsnText << *reply <<
+                                "Data: " << size << " bytes in " <<
+                                count << " chunks with " <<
+                                max_chunk << " bytes in chunk max";
+                            save.swap(iter->SetData());
+                        }
+                        else {
+                            s << ": " << MSerial_AsnText << *reply;
+                        }
+                    }
+                }
+                else {
+                    s << " ID2-Reply.";
+                }
+            }
+            if ( GetDebugLevel() >= eTraceBlob ) {
+                for ( CTypeConstIterator<CID2_Reply_Data> it(Begin(*reply));
+                      it; ++it ) {
+                    if ( it->IsSetData() ) {
+                        try {
+                            CProcessor_ID2::DumpDataAsText(*it, NcbiCout);
+                        }
+                        catch ( CException& exc ) {
+                            ERR_POST_X(1, "Exception while dumping data: "
+                                       <<exc);
+                        }
+                    }
+                }
+            }
+            int num = reply->GetSerial_number() - start_serial_num;
+            if ( reply->IsSetDiscard() ||
+                 num < 0 || num >= request_count || done[num] ) {
+                // unknown serial num - bad reply
+                NCBI_THROW_FMT(CLoaderException, eOtherError,
+                               "CId2ReaderBase: bad reply serial number");
+            }
+            try {
+                x_ProcessReply(result, loaded_sets[num], *reply);
+            }
+            catch ( CException& exc ) {
+                NCBI_RETHROW(exc, CLoaderException, eOtherError,
+                             "CId2ReaderBase: failed to process reply");
+            }
+            if ( reply->IsSetEnd_of_reply() ) {
+                done[num] = true;
+                x_UpdateLoadedSet(result, loaded_sets[num], sel);
+                --remaining_count;
+            }
+        }
+        if ( size_t(remaining_count) != packet.Get().size() ) {
+            NCBI_THROW(CLoaderException, eOtherError,
+                       "CId2ReaderBase: processor discrepancy");
+        }
+        if ( packet.Get().empty() ) {
+            return;
+        }
+    }
 
     CConn conn(result, this);
     CRef<CID2_Reply> reply;
@@ -1394,7 +1800,6 @@ void CId2ReaderBase::x_ProcessPacket(CReaderRequestResult& result,
         }}
 
         // process replies
-        int remaining_count = request_count;
         while ( remaining_count > 0 ) {
             reply.Reset(new CID2_Reply);
             if ( GetDebugLevel() >= eTraceConn ) {
@@ -1547,14 +1952,6 @@ void CId2ReaderBase::x_UpdateLoadedSet(CReaderRequestResult& result,
                                        SId2LoadedSet& data,
                                        const SAnnotSelector* sel)
 {
-    NON_CONST_ITERATE ( SId2LoadedSet::TStringSeq_idsSet, it,
-                        data.m_Seq_idsByString ) {
-        SetAndSaveStringSeq_ids(result, it->first,
-                                CFixedSeq_ids(eTakeOwnership,
-                                              it->second.second,
-                                              it->second.first));
-    }
-    data.m_Seq_idsByString.clear();
     NON_CONST_ITERATE ( SId2LoadedSet::TSeq_idSeq_idsSet, it,
                         data.m_Seq_ids ) {
         SetAndSaveSeq_idSeq_ids(result, it->first,
@@ -1576,14 +1973,30 @@ void CId2ReaderBase::x_UpdateLoadedSet(CReaderRequestResult& result,
             const SId2BlobInfo::TAnnotInfo& ainfos = it2->second.m_AnnotInfo;
             CRef<CBlob_Annot_Info> blob_annot_info;
             ITERATE ( SId2BlobInfo::TAnnotInfo, it3, ainfos ) {
-                const CID2S_Seq_annot_Info& annot_info = **it3;
+                CID2S_Seq_annot_Info& annot_info = it3->GetNCObject();
                 if ( !blob_annot_info ) {
                     blob_annot_info = new CBlob_Annot_Info;
                 }
                 if ( (it2->second.m_ContentMask & fBlobHasNamedAnnot) &&
                      annot_info.IsSetName() ) {
                     blob_annot_info->AddNamedAnnotName(annot_info.GetName());
+                    // Heuristics to determine incorrect annot info records.
+                    if ( (annot_info.IsSetAlign() || annot_info.IsSetFeat()) &&
+                         annot_info.IsSetGraph() && ainfos.size() == 1 &&
+                         !ExtractZoomLevel(annot_info.GetName(), 0, 0) ) {
+                        // graphs are suppozed to be zoom tracks
+                        for ( int zoom = 10; zoom < 1000000; zoom *= 10 ) {
+                            CRef<CID2S_Seq_annot_Info> zoom_info;
+                            zoom_info = SerialClone(annot_info);
+                            zoom_info->ResetFeat();
+                            zoom_info->ResetAlign();
+                            zoom_info->SetName(CombineWithZoomLevel(annot_info.GetName(), zoom));
+                            blob_annot_info->AddAnnotInfo(*zoom_info);
+                        }
+                        annot_info.ResetGraph();
+                    }
                 }
+
                 if ( annot_info.IsSetName() &&
                      annot_info.IsSetSeq_loc() &&
                      (annot_info.IsSetAlign() ||
@@ -1592,11 +2005,6 @@ void CId2ReaderBase::x_UpdateLoadedSet(CReaderRequestResult& result,
                     // complete annot info
                     blob_annot_info->AddAnnotInfo(annot_info);
                 }
-                // Heuristics to determine incorrect annot info records.
-                if ( annot_info.IsSetAlign() && annot_info.IsSetGraph() ) {
-                    blob_annot_info.Reset();
-                    break;
-                }
             }
             if ( blob_annot_info &&
                  !(blob_annot_info->GetAnnotInfo().empty() &&
@@ -1884,12 +2292,6 @@ void CId2ReaderBase::x_ProcessGetSeqId(CReaderRequestResult& result,
     const CID2_Request_Get_Seq_id& request = reply.GetRequest();
     const CID2_Seq_id& req_id = request.GetSeq_id();
     switch ( req_id.Which() ) {
-    case CID2_Seq_id::e_String:
-        x_ProcessGetStringSeqId(result, loaded_set, main_reply,
-                                req_id.GetString(),
-                                reply);
-        break;
-
     case CID2_Seq_id::e_Seq_id:
         x_ProcessGetSeqIdSeqId(result, loaded_set, main_reply,
                                CSeq_id_Handle::GetHandle(req_id.GetSeq_id()),
@@ -1902,67 +2304,13 @@ void CId2ReaderBase::x_ProcessGetSeqId(CReaderRequestResult& result,
 }
 
 
-void CId2ReaderBase::x_ProcessGetStringSeqId(
-    CReaderRequestResult& result,
-    SId2LoadedSet& loaded_set,
-    const CID2_Reply& main_reply,
-    const string& seq_id,
-    const CID2_Reply_Get_Seq_id& reply)
+static bool sx_IsSpecialId(const CSeq_id& id)
 {
-    CLoadLockSeqIds ids(result, seq_id);
-    if ( ids.IsLoaded() ) {
-        return;
-    }
-
-    int state = 0;
-    TErrorFlags errors = x_GetMessageError(main_reply);
-    if ( errors & fError_no_data ) {
-        // no Seq-ids
-        state |= CBioseq_Handle::fState_no_data;
-        if ( errors & fError_restricted ) {
-            state |= CBioseq_Handle::fState_confidential;
-        }
-        if ( errors & fError_withdrawn ) {
-            state |= CBioseq_Handle::fState_withdrawn;
-        }
-        SetAndSaveNoStringSeq_ids(result, seq_id, state);
-        return;
-    }
-
-    switch ( reply.GetRequest().GetSeq_id_type() ) {
-    case CID2_Request_Get_Seq_id::eSeq_id_type_all:
-    {{
-        CReader::TSeqIds seq_ids;
-        ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
-            seq_ids.push_back(CSeq_id_Handle::GetHandle(**it));
-        }
-        if ( reply.IsSetEnd_of_reply() ) {
-            SetAndSaveStringSeq_ids(result, seq_id,
-                                    CFixedSeq_ids(eTakeOwnership,
-                                                  seq_ids,
-                                                  state));
-        }
-        else {
-            loaded_set.m_Seq_idsByString[seq_id].first = state;
-            loaded_set.m_Seq_idsByString[seq_id].second.swap(seq_ids);
-        }
-        break;
-    }}
-    case CID2_Request_Get_Seq_id::eSeq_id_type_gi:
-    case CID2_Request_Get_Seq_id::eSeq_id_type_any:
-    {{
-        ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
-            if ( (**it).IsGi() ) {
-                SetAndSaveStringGi(result, seq_id, (**it).GetGi());
-                break;
-            }
-        }
-        break;
-    }}
-    default:
-        // ???
-        break;
+    if ( !id.IsGeneral() ) {
+        return false;
     }
+    const string& db = id.GetGeneral().GetDb();
+    return db == kSpecialId_length || db == kSpecialId_type;
 }
 
 
@@ -1975,7 +2323,10 @@ void CId2ReaderBase::x_ProcessGetSeqIdSeqId(
 {
     int state = 0;
     TErrorFlags errors = x_GetMessageError(main_reply);
-    if ( errors & fError_no_data ) {
+    const CID2_Request_Get_Seq_id& req = reply.GetRequest();
+    if ( (errors & fError_no_data) &&
+         (req.GetSeq_id_type() == req.eSeq_id_type_any ||
+          (req.GetSeq_id_type()&req.eSeq_id_type_all)==req.eSeq_id_type_all) ) {
         state |= CBioseq_Handle::fState_no_data;
         // no Seq-ids
         if ( errors & fError_restricted ) {
@@ -1985,35 +2336,42 @@ void CId2ReaderBase::x_ProcessGetSeqIdSeqId(
             state |= CBioseq_Handle::fState_withdrawn;
         }
         SetAndSaveNoSeq_idSeq_ids(result, seq_id, state);
-        switch ( reply.GetRequest().GetSeq_id_type() ) {
-        case CID2_Request_Get_Seq_id::eSeq_id_type_gi:
-            SetAndSaveSeq_idGi(result, seq_id, ZERO_GI);
-            break;
-        case CID2_Request_Get_Seq_id::eSeq_id_type_text:
-            SetAndSaveSeq_idAccVer(result, seq_id, CSeq_id_Handle());
-            break;
-        case CID2_Request_Get_Seq_id::eSeq_id_type_label:
+        
+        if ( req.GetSeq_id_type() & req.eSeq_id_type_gi ) {
+            SetAndSaveSeq_idGi(result, seq_id, TSequenceGi());
+        }
+        if ( req.GetSeq_id_type() & req.eSeq_id_type_text ) {
+            SetAndSaveSeq_idAccVer(result, seq_id, TSequenceAcc());
+        }
+        if ( req.GetSeq_id_type() & req.eSeq_id_type_label ) {
             SetAndSaveSeq_idLabel(result, seq_id, "");
-            break;
-        case CID2_Request_Get_Seq_id::eSeq_id_type_taxid:
+        }
+        if ( req.GetSeq_id_type() & req.eSeq_id_type_taxid ) {
             SetAndSaveSeq_idTaxId(result, seq_id, -1);
-            break;
-        case CID2_Request_Get_Seq_id::eSeq_id_type_hash:
-            SetAndSaveSequenceHash(result, seq_id, 0);
-            break;
-        default:
-            break;
+        }
+        if ( req.GetSeq_id_type() & req.eSeq_id_type_hash ) {
+            SetAndSaveSequenceHash(result, seq_id, TSequenceHash());
+        }
+        if ( req.GetSeq_id_type() & req.eSeq_id_type_seq_length ) {
+            SetAndSaveSequenceLength(result, seq_id, kInvalidSeqPos);
+        }
+        if ( req.GetSeq_id_type() & req.eSeq_id_type_seq_mol ) {
+            SetAndSaveSequenceType(result, seq_id, TSequenceType());
         }
         return;
     }
-    switch ( reply.GetRequest().GetSeq_id_type() ) {
-    case CID2_Request_Get_Seq_id::eSeq_id_type_all:
-    {{
+    bool got_no_ids = false;
+    if ( (req.GetSeq_id_type()&req.eSeq_id_type_all)==req.eSeq_id_type_all ) {
         CReader::TSeqIds seq_ids;
         ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
+            if ( req.GetSeq_id_type() != req.eSeq_id_type_all &&
+                 sx_IsSpecialId(**it) ) {
+                continue;
+            }
             seq_ids.push_back(CSeq_id_Handle::GetHandle(**it));
         }
         if ( reply.IsSetEnd_of_reply() ) {
+            got_no_ids = seq_ids.empty();
             SetAndSaveSeq_idSeq_ids(result, seq_id,
                                     CFixedSeq_ids(eTakeOwnership,
                                                   seq_ids,
@@ -2023,87 +2381,108 @@ void CId2ReaderBase::x_ProcessGetSeqIdSeqId(
             loaded_set.m_Seq_ids[seq_id].first = state;
             loaded_set.m_Seq_ids[seq_id].second.swap(seq_ids);
         }
-        break;
-    }}
-    case CID2_Request_Get_Seq_id::eSeq_id_type_gi:
-    case CID2_Request_Get_Seq_id::eSeq_id_type_any:
-    {{
+    }
+    if ( req.GetSeq_id_type() & req.eSeq_id_type_gi ) {
+        TSequenceGi ret;
         ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
             if ( (**it).IsGi() ) {
-                SetAndSaveSeq_idGi(result, seq_id, (**it).GetGi());
+                ret.gi = (**it).GetGi();
+                ret.sequence_found = true;
                 break;
             }
         }
-        break;
-    }}
-    case CID2_Request_Get_Seq_id::eSeq_id_type_text:
-    {{
+        SetAndSaveSeq_idGi(result, seq_id, ret);
+    }
+    if ( req.GetSeq_id_type() & req.eSeq_id_type_text ) {
+        TSequenceAcc ret;
         ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
             if ( (**it).GetTextseq_Id() ) {
-                SetAndSaveSeq_idAccVer(result, seq_id,
-                                       CSeq_id_Handle::GetHandle(**it));
-                return;
+                ret.acc_ver = CSeq_id_Handle::GetHandle(**it);
+                ret.sequence_found = true;
+                break;
             }
         }
-        SetAndSaveSeq_idAccVer(result, seq_id, CSeq_id_Handle());
-        break;
-    }}
-    case CID2_Request_Get_Seq_id::eSeq_id_type_label:
-    {{
+        SetAndSaveSeq_idAccVer(result, seq_id, ret);
+    }
+    if ( req.GetSeq_id_type() & req.eSeq_id_type_label ) {
         ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
             const CSeq_id& id = **it;
             if ( id.IsGeneral() ) {
                 const CDbtag& dbtag = id.GetGeneral();
                 const CObject_id& obj_id = dbtag.GetTag();
-                if ( obj_id.IsStr() && dbtag.GetDb() == "LABEL" ) {
+                if ( obj_id.IsStr() && dbtag.GetDb() == kSpecialId_label ) {
                     SetAndSaveSeq_idLabel(result, seq_id, obj_id.GetStr());
                     break;
                 }
             }
         }
-        break;
-    }}
-    case CID2_Request_Get_Seq_id::eSeq_id_type_taxid:
-    {{
-        ESave save = eDoNotSave;
+    }
+    if ( req.GetSeq_id_type() & req.eSeq_id_type_taxid ) {
         int taxid = -1;
         ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
             const CSeq_id& id = **it;
             if ( id.IsGeneral() ) {
                 const CDbtag& dbtag = id.GetGeneral();
                 const CObject_id& obj_id = dbtag.GetTag();
-                if ( obj_id.IsId() && dbtag.GetDb() == "TAXID" ) {
+                if ( obj_id.IsId() && dbtag.GetDb() == kSpecialId_taxid ) {
                     taxid = obj_id.GetId();
-                    save = eSave;
                     break;
                 }
             }
         }
-        SetAndSaveSeq_idTaxId(result, seq_id, taxid, save);
-        break;
-    }}
-    case CID2_Request_Get_Seq_id::eSeq_id_type_hash:
-    {{
-        ESave save = eDoNotSave;
-        int hash = 0;
+        SetAndSaveSeq_idTaxId(result, seq_id, taxid);
+    }
+    if ( req.GetSeq_id_type() & req.eSeq_id_type_hash ) {
+        TSequenceHash hash;
         ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
             const CSeq_id& id = **it;
             if ( id.IsGeneral() ) {
                 const CDbtag& dbtag = id.GetGeneral();
                 const CObject_id& obj_id = dbtag.GetTag();
-                if ( obj_id.IsId() && dbtag.GetDb() == "HASH" ) {
-                    hash = obj_id.GetId();
-                    save = eSave;
+                if ( obj_id.IsId() && dbtag.GetDb() == kSpecialId_hash ) {
+                    hash.hash = obj_id.GetId();
+                    hash.sequence_found = true;
+                    hash.hash_known = true;
                     break;
                 }
             }
         }
-        SetAndSaveSequenceHash(result, seq_id, hash, save);
-        break;
-    }}
-    default:
-        // ???
-        break;
+        SetAndSaveSequenceHash(result, seq_id, hash);
+    }
+    if ( req.GetSeq_id_type() & req.eSeq_id_type_seq_length ) {
+        TSeqPos length = kInvalidSeqPos;
+        ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
+            const CSeq_id& id = **it;
+            if ( id.IsGeneral() ) {
+                const CDbtag& dbtag = id.GetGeneral();
+                const CObject_id& obj_id = dbtag.GetTag();
+                if ( obj_id.IsId() && dbtag.GetDb() == kSpecialId_length ) {
+                    length = TSeqPos(obj_id.GetId());
+                    break;
+                }
+            }
+        }
+        if ( length != kInvalidSeqPos || got_no_ids ) {
+            SetAndSaveSequenceLength(result, seq_id, length);
+        }
+    }
+    if ( req.GetSeq_id_type() & req.eSeq_id_type_seq_mol ) {
+        TSequenceType type;
+        ITERATE ( CID2_Reply_Get_Seq_id::TSeq_id, it, reply.GetSeq_id() ) {
+            const CSeq_id& id = **it;
+            if ( id.IsGeneral() ) {
+                const CDbtag& dbtag = id.GetGeneral();
+                const CObject_id& obj_id = dbtag.GetTag();
+                if ( obj_id.IsId() && dbtag.GetDb() == kSpecialId_type ) {
+                    type.type = CSeq_inst::EMol(obj_id.GetId());
+                    type.sequence_found = true;
+                    break;
+                }
+            }
+        }
+        if ( type.sequence_found || got_no_ids ) {
+            SetAndSaveSequenceType(result, seq_id, type);
+        }
     }
 }
 
@@ -2142,7 +2521,8 @@ void CId2ReaderBase::x_ProcessGetBlobId(
     }
     TContentsMask mask = 0;
     {{ // TODO: temporary logic, this info should be returned by server
-        if ( blob_id.GetSubSat() == CID2_Blob_Id::eSub_sat_main ) {
+        if ( blob_id.GetSubSat() == CID2_Blob_Id::eSub_sat_main ||
+             blob_id.GetSat() == CProcessor_ExtAnnot::eSat_VDB_WGS ) {
             mask |= fBlobHasAllLocal;
         }
         else {
diff --git a/c++/src/objtools/data_loaders/genbank/reader_snp.cpp b/c++/src/objtools/data_loaders/genbank/reader_snp.cpp
index 469c3c0..ae8237b 100644
--- a/c++/src/objtools/data_loaders/genbank/reader_snp.cpp
+++ b/c++/src/objtools/data_loaders/genbank/reader_snp.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reader_snp.cpp 468616 2015-05-26 19:33:41Z vasilche $
+/*  $Id: reader_snp.cpp 494478 2016-03-07 19:26:06Z ivanov $
  * ===========================================================================
  *                            PUBLIC DOMAIN NOTICE
  *               National Center for Biotechnology Information
@@ -75,6 +75,13 @@ BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
 
 
+static const size_t kMax_CommentLength = 65536;
+static const size_t kMax_ExtraLength = 256;
+static const size_t kMax_AlleleLength = 256;
+static const size_t kMax_QualityLength = 32;
+static const size_t kMax_StringLength = 256;
+
+
 /////////////////////////////////////////////////////////////////////////////
 // utility function
 
@@ -183,8 +190,11 @@ CSNP_Seq_feat_hook::~CSNP_Seq_feat_hook(void)
         size_t total =
             accumulate(m_Count, m_Count+SSNP_Info::eSNP_Type_last, size_t(0));
         NcbiCout << "CSeq_annot_SNP_Info statistic (gi = " <<
-            m_Seq_annot_SNP_Info.GetGi() << "):\n";
+            m_Seq_annot_SNP_Info.GetSeq_id().AsFastaString() << "):\n";
         for ( size_t i = 0; i < SSNP_Info::eSNP_Type_last; ++i ) {
+            if ( !m_Count[i] ) {
+                continue;
+            }
             NcbiCout <<
                 setw(40) << SSNP_Info::s_SNP_Type_Label[i] << ": " <<
                 setw(6) << m_Count[i] << "  " <<
@@ -197,6 +207,9 @@ CSNP_Seq_feat_hook::~CSNP_Seq_feat_hook(void)
             accumulate(s_TotalCount, s_TotalCount+SSNP_Info::eSNP_Type_last,size_t(0));
         NcbiCout << "cumulative CSeq_annot_SNP_Info statistic:\n";
         for ( size_t i = 0; i < SSNP_Info::eSNP_Type_last; ++i ) {
+            if ( !s_TotalCount[i] ) {
+                continue;
+            }
             NcbiCout <<
                 setw(40) << SSNP_Info::s_SNP_Type_Label[i] << ": " <<
                 setw(6) << s_TotalCount[i] << "  " <<
@@ -296,9 +309,8 @@ void CSeq_annot_SNP_Info_Reader::Parse(CObjectIStream& in,
 /////////////////////////////////////////////////////////////////////////////
 // reading and storing in binary format
 
-static void write_unsigned(CNcbiOstream& stream,
-                           size_t n,
-                           const char* name)
+static inline
+void write_unsigned(CNcbiOstream& stream, size_t n, const char* name)
 {
     if ( sizeof(n) > 4 && Uint4(n) != n ) {
         NCBI_THROW_FMT(CLoaderException, eLoaderFailed,
@@ -314,8 +326,8 @@ static void write_unsigned(CNcbiOstream& stream,
 }
 
 
-static unsigned read_unsigned(CNcbiIstream& stream,
-                              const char* name)
+static inline
+unsigned read_unsigned(CNcbiIstream& stream, const char* name)
 {
     char c[4];
     stream.read(c, sizeof(c));
@@ -332,9 +344,8 @@ static unsigned read_unsigned(CNcbiIstream& stream,
 }
 
 
-static void write_gi(CNcbiOstream& stream,
-                     TGi gi,
-                     const char* name)
+static inline
+void write_gi(CNcbiOstream& stream, TGi gi, const char* name)
 {
     TIntId n = gi;
     char c[8];
@@ -346,8 +357,8 @@ static void write_gi(CNcbiOstream& stream,
 }
 
 
-static TGi read_gi(CNcbiIstream& stream,
-                   const char* name)
+static inline
+TGi read_gi(CNcbiIstream& stream, const char* name)
 {
     char c[8];
     stream.read(c, sizeof(c));
@@ -377,7 +388,8 @@ static TGi read_gi(CNcbiIstream& stream,
 }
 
 
-static void write_size(CNcbiOstream& stream, size_t size)
+static inline
+void write_size(CNcbiOstream& stream, size_t size)
 {
     // use ASN.1 binary like format
     while ( size >= (1<<7) ) {
@@ -388,7 +400,8 @@ static void write_size(CNcbiOstream& stream, size_t size)
 }
 
 
-static size_t read_size(CNcbiIstream& stream, const char* name)
+static inline
+size_t read_size(CNcbiIstream& stream, const char* name)
 {
     size_t size = 0;
     static const int total_bits = sizeof(size)*8;
@@ -412,14 +425,55 @@ static size_t read_size(CNcbiIstream& stream, const char* name)
 }
 
 
+static inline
+void write_string(CNcbiOstream& stream, const string& str)
+{
+    size_t size = str.size();
+    write_size(stream, size);
+    stream.write(str.data(), size);
+}
+
+
+static inline
+void read_string(CNcbiIstream& stream, string& str, size_t max_length)
+{
+    size_t size = read_size(stream, "SNP table string size");
+    if ( size > max_length ) {
+        NCBI_THROW(CLoaderException, eLoaderFailed,
+                   "SNP table string is too long");
+    }
+    char buf[kMax_StringLength];
+    stream.read(buf, size);
+    if ( !stream ) {
+        NCBI_THROW(CLoaderException, eLoaderFailed,
+                   "Cannot read SNP table string");
+    }
+    str.assign(buf, buf+size);
+}
+
+
+static inline
+void write_seq_id(CNcbiOstream& stream, const CSeq_id& id)
+{
+    write_string(stream, id.AsFastaString());
+}
+
+
+static inline
+CRef<CSeq_id> read_seq_id(CNcbiIstream& stream)
+{
+    string str;
+    read_string(stream, str, kMax_StringLength);
+    return Ref(new CSeq_id(str));
+}
+
+
 void StoreIndexedStringsTo(CNcbiOstream& stream,
                            const CIndexedStrings& strings)
 {
     write_size(stream, strings.GetSize());
     for (size_t idx = 0; idx < strings.GetSize(); ++idx) {
-        size_t size = strings.GetString(idx).size();
-        write_size(stream, size);
-        stream.write(strings.GetString(idx).data(), size);
+        write_string(stream, strings.GetString(idx));
     }
 }
 
@@ -436,21 +490,8 @@ void LoadIndexedStringsFrom(CNcbiIstream& stream,
                    "SNP table string count is too big");
     }
     strings.Resize(count);
-    AutoPtr<char, ArrayDeleter<char> > buf(new char[max_length]);
     for (size_t idx = 0; idx < strings.GetSize(); ++idx) {
-        size_t size = read_size(stream, "SNP table string size");
-        if ( size > max_length ) {
-            strings.Clear();
-            NCBI_THROW(CLoaderException, eLoaderFailed,
-                       "SNP table string is too long");
-        }
-        stream.read(buf.get(), size);
-        if ( !stream ) {
-            strings.Clear();
-            NCBI_THROW(CLoaderException, eLoaderFailed,
-                       "Cannot read SNP table string");
-        }
-        strings.SetString(idx).assign(buf.get(), buf.get() + size);
+        read_string(stream, strings.SetString(idx), max_length);
     }
 }
 
@@ -645,7 +686,12 @@ void CSeq_annot_SNP_Info_Reader::x_Write(CNcbiOstream& stream,
 {
     // header
     write_unsigned(stream, MAGIC, "SNP table magic number");
-    write_gi(stream, snp_info.GetGi(), "SNP table GI");
+    const CSeq_id& id = snp_info.GetSeq_id();
+    TGi gi = id.IsGi()? id.GetGi(): ZERO_GI;
+    write_gi(stream, gi, "SNP table GI");
+    if ( !gi ) {
+        write_seq_id(stream, id);
+    }
 
     // strings
     StoreIndexedStringsTo(stream, snp_info.m_Comments);
@@ -662,11 +708,6 @@ void CSeq_annot_SNP_Info_Reader::x_Write(CNcbiOstream& stream,
 }
 
 
-static const size_t kMax_CommentLength = 65536;
-static const size_t kMax_ExtraLength = 256;
-static const size_t kMax_AlleleLength = 256;
-static const size_t kMax_QualityLength = 32;
-
 void CSeq_annot_SNP_Info_Reader::x_Read(CNcbiIstream& stream,
                                         CSeq_annot_SNP_Info& snp_info)
 {
@@ -678,7 +719,15 @@ void CSeq_annot_SNP_Info_Reader::x_Read(CNcbiIstream& stream,
         NCBI_THROW(CLoaderException, eLoaderFailed,
                    "Incompatible version of SNP table");
     }
-    snp_info.x_SetGi(read_gi(stream, "SNP table GI"));
+    TGi gi = read_gi(stream, "SNP table GI");
+    if ( !gi ) {
+        snp_info.SetSeq_id(*read_seq_id(stream));
+    }
+    else {
+        CRef<CSeq_id> gi_id(new CSeq_id);
+        gi_id->SetGi(gi);
+        snp_info.SetSeq_id(*gi_id);
+    }
 
     // strings
     LoadIndexedStringsFrom(stream,
diff --git a/c++/src/objtools/data_loaders/genbank/request_result.cpp b/c++/src/objtools/data_loaders/genbank/request_result.cpp
index ef2e7d5..a13aae5 100644
--- a/c++/src/objtools/data_loaders/genbank/request_result.cpp
+++ b/c++/src/objtools/data_loaders/genbank/request_result.cpp
@@ -1,4 +1,4 @@
-/*  $Id: request_result.cpp 468561 2015-05-26 15:57:12Z vasilche $
+/*  $Id: request_result.cpp 494478 2016-03-07 19:26:06Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -70,10 +70,18 @@ int s_GetLoadTraceLevel(void)
 // CFixedSeq_ids
 /////////////////////////////////////////////////////////////////////////////
 
+CFixedSeq_ids::CFixedSeq_ids(void)
+    : m_State(kUnknownState),
+      m_Ref(new TObject)
+{
+}
+
+
 CFixedSeq_ids::CFixedSeq_ids(TState state)
-    : m_State(state | CBioseq_Handle::fState_no_data),
+    : m_State(state),
       m_Ref(new TObject)
 {
+    SetNotFound();
 }
 
 
@@ -81,8 +89,8 @@ CFixedSeq_ids::CFixedSeq_ids(const TList& list, TState state)
     : m_State(state),
       m_Ref(new TObject(list))
 {
-    if ( list.empty() ) {
-        m_State |= CBioseq_Handle::fState_no_data;
+    if ( empty() ) {
+        SetNotFound();
     }
 }
 
@@ -99,38 +107,64 @@ CFixedSeq_ids::CFixedSeq_ids(ENcbiOwnership ownership, TList& list,
         ref->GetData() = list;
     }
     m_Ref = ref;
+    if ( empty() ) {
+        SetNotFound();
+    }
+}
+
+
+void CFixedSeq_ids::SetState(TState state)
+{
+    m_State = state;
 }
 
 
-TGi CFixedSeq_ids::FindGi(void) const
+void CFixedSeq_ids::SetNotFound(void)
 {
-    TGi gi = ZERO_GI;
-    ITERATE ( CFixedSeq_ids, it, *this ) {
-        if ( it->Which() == CSeq_id::e_Gi ) {
-            gi = it->GetGi();
-            break;
+    if ( m_State == kUnknownState ) {
+        m_State = 0;
+    }
+    m_State |=
+        CBioseq_Handle::fState_not_found |
+        CBioseq_Handle::fState_no_data;
+}
+
+
+CDataLoader::SGiFound CFixedSeq_ids::FindGi(void) const
+{
+    CDataLoader::SGiFound ret;
+    if ( IsFound() ) {
+        ret.sequence_found = true;
+        ITERATE ( CFixedSeq_ids, it, *this ) {
+            if ( it->Which() == CSeq_id::e_Gi ) {
+                ret.gi = it->GetGi();
+                break;
+            }
         }
     }
-    return gi;
+    return ret;
 }
 
 
-CSeq_id_Handle CFixedSeq_ids::FindAccVer(void) const
+CDataLoader::SAccVerFound CFixedSeq_ids::FindAccVer(void) const
 {
-    CSeq_id_Handle acc;
-    ITERATE ( CFixedSeq_ids, it, *this ) {
-        if ( !it->IsGi() && it->GetSeqId()->GetTextseq_Id() ) {
-            acc = *it;
-            break;
+    CDataLoader::SAccVerFound ret;
+    if ( IsFound() ) {
+        ret.sequence_found = true;
+        ITERATE ( CFixedSeq_ids, it, *this ) {
+            if ( !it->IsGi() && it->GetSeqId()->GetTextseq_Id() ) {
+                ret.acc_ver = *it;
+                break;
+            }
         }
     }
-    return acc;
+    return ret;
 }
 
 
 string CFixedSeq_ids::FindLabel(void) const
 {
-    return objects::GetLabel(*this);
+    return IsFound()? objects::GetLabel(*this): string();
 }
 
 
@@ -152,10 +186,18 @@ CNcbiOstream& operator<<(CNcbiOstream& out, const CFixedSeq_ids& ids)
 // CFixedBlob_ids
 /////////////////////////////////////////////////////////////////////////////
 
+CFixedBlob_ids::CFixedBlob_ids(void)
+    : m_State(kUnknownState),
+      m_Ref(new TObject)
+{
+}
+
+
 CFixedBlob_ids::CFixedBlob_ids(TState state)
-    : m_State(state | CBioseq_Handle::fState_no_data),
+    : m_State(state),
       m_Ref(new TObject)
 {
+    SetNotFound();
 }
 
 
@@ -165,7 +207,7 @@ CFixedBlob_ids::CFixedBlob_ids(const TList& list,
       m_Ref(new TObject(list))
 {
     if ( empty() ) {
-        m_State |= CBioseq_Handle::fState_no_data;
+        SetNotFound();
     }
 }
 
@@ -183,11 +225,28 @@ CFixedBlob_ids::CFixedBlob_ids(ENcbiOwnership ownership, TList& list,
     }
     m_Ref = ref;
     if ( empty() ) {
-        m_State |= CBioseq_Handle::fState_no_data;
+        SetNotFound();
     }
 }
 
 
+void CFixedBlob_ids::SetState(TState state)
+{
+    m_State = state;
+}
+
+
+void CFixedBlob_ids::SetNotFound(void)
+{
+    if ( m_State == kUnknownState ) {
+        m_State = 0;
+    }
+    m_State |=
+        CBioseq_Handle::fState_not_found |
+        CBioseq_Handle::fState_no_data;
+}
+
+
 CNcbiOstream& operator<<(CNcbiOstream& out, const CFixedBlob_ids& ids)
 {
     const char* sep = "( ";
@@ -429,7 +488,7 @@ void CLoadLockBlob::x_ObtainTSE_LoadLock(CReaderRequestResult& result)
     m_TSE_LoadLock = result.GetTSE_LoadLockIfLoaded(m_Blob_id);
     if ( m_TSE_LoadLock ) {
         _ASSERT(m_TSE_LoadLock.IsLoaded());
-        TParent::SetLoaded(m_TSE_LoadLock);
+        TParent::SetLoaded(m_TSE_LoadLock, GBL::eExpire_normal);
         result.x_AddTSE_LoadLock(m_TSE_LoadLock);
         return;
     }
@@ -581,7 +640,7 @@ void CLoadLockSetter::SetLoaded(void)
             LOG_POST(Info<<"GBLoader:"<<SBlobId(*m_TSE_LoadLock)<<" loaded");
         }
         m_TSE_LoadLock.SetLoaded();
-        TParent::SetLoaded(m_TSE_LoadLock);
+        TParent::SetLoaded(m_TSE_LoadLock, GBL::eExpire_normal);
         CReaderRequestResult& result =
             dynamic_cast<CReaderRequestResult&>(GetRequestor());
         result.x_AddTSE_LoadLock(m_TSE_LoadLock);
@@ -623,7 +682,7 @@ void CLoadLockSetter::x_ObtainTSE_LoadLock(CReaderRequestResult& result,
     m_TSE_LoadLock = result.GetTSE_LoadLock(blob_id);
     _ASSERT(m_TSE_LoadLock);
     if ( m_TSE_LoadLock.IsLoaded() ) {
-        TParent::SetLoaded(m_TSE_LoadLock);
+        TParent::SetLoaded(m_TSE_LoadLock, GBL::eExpire_normal);
         result.x_AddTSE_LoadLock(m_TSE_LoadLock);
         return;
     }
@@ -692,6 +751,7 @@ CReaderRequestResult::CReaderRequestResult(const CSeq_id_Handle& requested_id,
       m_Level(0),
       m_RequestedId(requested_id),
       m_RecursionLevel(0),
+      m_InProcessor(0),
       m_RecursiveTime(0),
       m_AllocatedConnection(0),
       m_RetryDelay(0),
@@ -713,16 +773,16 @@ CWriter* CReaderRequestResult::GetBlobWriter(void) const
 
 
 CReaderRequestResult::TExpirationTime
-CReaderRequestResult::GetNewIdExpirationTime(void) const
+CReaderRequestResult::GetNewIdExpirationTime(GBL::EExpirationType type) const
 {
-    return GetStartTime()+GetIdExpirationTimeout();
+    return GetStartTime()+GetIdExpirationTimeout(type);
 }
 
 
 CReaderRequestResult::TExpirationTime
-CReaderRequestResult::GetIdExpirationTimeout(void) const
+CReaderRequestResult::GetIdExpirationTimeout(GBL::EExpirationType type) const
 {
-    return 2*3600;
+    return type == GBL::eExpire_normal? 2*3600: 5;
 }
 
 
@@ -813,9 +873,9 @@ CReaderRequestResult::GetRequestTime(void) const
 
 
 CReaderRequestResult::TExpirationTime
-CReaderRequestResult::GetNewExpirationTime(void) const
+CReaderRequestResult::GetNewExpirationTime(GBL::EExpirationType type) const
 {
-    return GetNewIdExpirationTime();
+    return GetNewIdExpirationTime(type);
 }
 
 
@@ -825,13 +885,18 @@ CReaderRequestResult::GetNewExpirationTime(void) const
 
 
 CReaderRequestResultRecursion::CReaderRequestResultRecursion(
-    CReaderRequestResult& result)
+    CReaderRequestResult& result,
+    bool in_processor)
     : CStopWatch(eStart),
-      m_Result(result)
+      m_Result(result),
+      m_InProcessor(in_processor)
 {
     m_SaveTime = result.m_RecursiveTime;
     result.m_RecursiveTime = 0;
     ++result.m_RecursionLevel;
+    if ( m_InProcessor ) {
+        ++result.m_InProcessor;
+    }
 }
 
 
@@ -840,6 +905,9 @@ CReaderRequestResultRecursion::~CReaderRequestResultRecursion(void)
     _ASSERT(m_Result.m_RecursionLevel>0);
     m_Result.m_RecursiveTime += m_SaveTime;
     --m_Result.m_RecursionLevel;
+    if ( m_InProcessor ) {
+        --m_Result.m_InProcessor;
+    }
 }
 
 
@@ -866,11 +934,11 @@ CGBInfoManager::CGBInfoManager(size_t gc_size)
     : m_CacheAcc(GetMainMutex(), gc_size),
       m_CacheSeqIds(GetMainMutex(), gc_size),
       m_CacheGi(GetMainMutex(), gc_size),
-      m_CacheStrSeqIds(GetMainMutex(), gc_size),
-      m_CacheStrGi(GetMainMutex(), gc_size),
       m_CacheLabel(GetMainMutex(), gc_size),
       m_CacheTaxId(GetMainMutex(), gc_size),
       m_CacheHash(GetMainMutex(), gc_size),
+      m_CacheLength(GetMainMutex(), gc_size),
+      m_CacheType(GetMainMutex(), gc_size),
       m_CacheBlobIds(GetMainMutex(), gc_size),
       m_CacheBlobState(GetMainMutex(), gc_size),
       m_CacheBlobVersion(GetMainMutex(), gc_size),
@@ -892,12 +960,6 @@ CLoadLockSeqIds::CLoadLockSeqIds(CReaderRequestResult& result,
 
 
 CLoadLockSeqIds::CLoadLockSeqIds(CReaderRequestResult& result,
-                                 const string& id)
-    : TParent(result.GetLoadLockSeqIds(id))
-{
-}
-
-CLoadLockSeqIds::CLoadLockSeqIds(CReaderRequestResult& result,
                                  const CSeq_id_Handle& id,
                                  EAlreadyLoaded)
     : TParent(result.GetLoadedSeqIds(id))
@@ -905,14 +967,6 @@ CLoadLockSeqIds::CLoadLockSeqIds(CReaderRequestResult& result,
 }
 
 
-CLoadLockSeqIds::CLoadLockSeqIds(CReaderRequestResult& result,
-                                 const string& id,
-                                 EAlreadyLoaded)
-    : TParent(result.GetLoadedSeqIds(id))
-{
-}
-
-
 CLoadLockAcc::CLoadLockAcc(CReaderRequestResult& result,
                            const CSeq_id_Handle& id)
     : TParent(result.GetLoadLockAcc(id))
@@ -927,13 +981,6 @@ CLoadLockGi::CLoadLockGi(CReaderRequestResult& result,
 }
 
 
-CLoadLockGi::CLoadLockGi(CReaderRequestResult& result,
-                         const string& id)
-    : TParent(result.GetLoadLockGi(id))
-{
-}
-
-
 CLoadLockLabel::CLoadLockLabel(CReaderRequestResult& result,
                                const CSeq_id_Handle& id)
     : TParent(result.GetLoadLockLabel(id))
@@ -955,6 +1002,20 @@ CLoadLockHash::CLoadLockHash(CReaderRequestResult& result,
 }
 
 
+CLoadLockLength::CLoadLockLength(CReaderRequestResult& result,
+                                 const CSeq_id_Handle& id)
+    : TParent(result.GetLoadLockLength(id))
+{
+}
+
+
+CLoadLockType::CLoadLockType(CReaderRequestResult& result,
+                             const CSeq_id_Handle& id)
+    : TParent(result.GetLoadLockType(id))
+{
+}
+
+
 CLoadLockBlobIds::CLoadLockBlobIds(CReaderRequestResult& result,
                                    const CSeq_id_Handle& id,
                                    const SAnnotSelector* sel)
@@ -1043,52 +1104,10 @@ CReaderRequestResult::SetLoadedSeqIds(const CSeq_id_Handle& id,
     if ( s_GetLoadTraceLevel() > 0 ) {
         LOG_POST(Info<<"GBLoader:SeqId("<<id<<") seq_ids = "<<value);
     }
-    return GetGBInfoManager().m_CacheSeqIds.SetLoaded(*this, id, value);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// string -> Seq-ids
-
-bool
-CReaderRequestResult::IsLoadedSeqIds(const string& id)
-{
-    return GetGBInfoManager().m_CacheStrSeqIds.IsLoaded(*this, id);
-}
-
-
-bool
-CReaderRequestResult::MarkLoadingSeqIds(const string& id)
-{
-    return GetGBInfoManager().m_CacheStrSeqIds.MarkLoading(*this, id);
-}
-
-
-CReaderRequestResult::TInfoLockIds
-CReaderRequestResult::GetLoadLockSeqIds(const string& id)
-{
-    // if connection is allocated we cannot wait for another lock because
-    // of possible deadlock.
-    EDoNotWait do_not_wait = m_AllocatedConnection? eDoNotWait: eAllowWaiting;
-    return GetGBInfoManager().m_CacheStrSeqIds.GetLoadLock(*this, id, do_not_wait);
-}
-
-
-CReaderRequestResult::TInfoLockIds
-CReaderRequestResult::GetLoadedSeqIds(const string& id)
-{
-    return GetGBInfoManager().m_CacheStrSeqIds.GetLoaded(*this, id);
-}
-
-
-bool
-CReaderRequestResult::SetLoadedSeqIds(const string& id,
-                                      const CFixedSeq_ids& value)
-{
-    if ( s_GetLoadTraceLevel() > 0 ) {
-        LOG_POST(Info<<"GBLoader:StrId("<<id<<") seq_ids = "<<value);
-    }
-    return GetGBInfoManager().m_CacheStrSeqIds.SetLoaded(*this, id, value);
+    GBL::EExpirationType exp_type = CLoadLockSeqIds::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheSeqIds.
+        SetLoaded(*this, id, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
 }
 
 
@@ -1167,12 +1186,15 @@ CReaderRequestResult::GetLoadedAcc(const CSeq_id_Handle& id)
 
 bool
 CReaderRequestResult::SetLoadedAcc(const CSeq_id_Handle& id,
-                                   const CSeq_id_Handle& value)
+                                   const TSequenceAcc& value)
 {
     if ( s_GetLoadTraceLevel() > 0 ) {
-        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") acc = "<<value);
+        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") acc = "<<value.acc_ver);
     }
-    return GetGBInfoManager().m_CacheAcc.SetLoaded(*this, id, value);
+    GBL::EExpirationType exp_type = CLoadLockAcc::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheAcc.
+        SetLoaded(*this, id, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
 }
 
 
@@ -1185,20 +1207,20 @@ bool CReaderRequestResult::UpdateAccFromSeqIds(TInfoLockAcc& acc_lock,
     if ( acc_lock.IsLoaded() ) {
         return false;
     }
-    return acc_lock.SetLoaded(ids_lock.GetData().FindAccVer(),
-                              ids_lock.GetExpirationTime());
+    return acc_lock.SetLoadedFor(ids_lock.GetData().FindAccVer(),
+                                 ids_lock.GetExpirationTime());
 }
 
 
 bool CReaderRequestResult::SetLoadedAccFromSeqIds(const CSeq_id_Handle& id,
                                                   const CLoadLockSeqIds& ids)
 {
-    CSeq_id_Handle acc = ids.GetSeq_ids().FindAccVer();
+    TSequenceAcc data = ids.GetSeq_ids().FindAccVer();
     if ( s_GetLoadTraceLevel() > 0 ) {
-        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") acc = "<<acc);
+        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") acc = "<<data.acc_ver);
     }
-    TExpirationTime exp_time = ids.GetExpirationTime();
-    return GetGBInfoManager().m_CacheAcc.SetLoaded(*this, id, acc, exp_time);
+    return GetGBInfoManager().m_CacheAcc.
+        SetLoadedFor(*this, id, data, ids.GetExpirationTime());
 }
 
 
@@ -1209,13 +1231,12 @@ bool
 CReaderRequestResult::SetLoadedSeqIdsFromZeroGi(const CSeq_id_Handle& id,
                                                 const CLoadLockGi& gi_lock)
 {
-    _ASSERT(gi_lock.IsLoadedGi() && gi_lock.GetGi() == ZERO_GI);
+    _ASSERT(gi_lock.IsLoadedGi() && !gi_lock.GetGi(gi_lock.GetGi()));
     if ( s_GetLoadTraceLevel() > 0 ) {
         LOG_POST(Info<<"GBLoader:SeqId("<<id<<") seq_ids = null");
     }
     CLoadLockSeqIds lock(*this, id);
-    TBlobState state = CBioseq_Handle::fState_no_data;
-    return lock.SetLoadedSeq_ids(CFixedSeq_ids(state),
+    return lock.SetLoadedSeq_ids(CFixedSeq_ids(0),
                                  gi_lock.GetExpirationTimeGi());
 }
 
@@ -1225,14 +1246,13 @@ CReaderRequestResult::SetLoadedBlobIdsFromZeroGi(const CSeq_id_Handle& id,
                                                  const SAnnotSelector* sel,
                                                  const CLoadLockGi& gi_lock)
 {
-    _ASSERT(gi_lock.IsLoadedGi() && gi_lock.GetGi() == ZERO_GI);
+    _ASSERT(gi_lock.IsLoadedGi() && !gi_lock.GetGi(gi_lock.GetGi()));
     if ( s_GetLoadTraceLevel() > 0 ) {
         LOG_POST(Info<<"GBLoader:SeqId("<<id<<") blob_ids = null");
     }
     CLoadLockBlobIds lock(*this, id, sel);
-    TBlobState state = CBioseq_Handle::fState_no_data;
-    return lock.SetNoBlob_ids(state,
-                              gi_lock.GetExpirationTimeGi());
+    return lock.SetLoadedBlob_ids(CFixedBlob_ids(0),
+                                  gi_lock.GetExpirationTimeGi());
 }
 
 
@@ -1242,20 +1262,20 @@ bool CReaderRequestResult::UpdateGiFromSeqIds(TInfoLockGi& gi_lock,
     if ( gi_lock.IsLoaded() ) {
         return false;
     }
-    return gi_lock.SetLoaded(ids_lock.GetData().FindGi(),
-                             ids_lock.GetExpirationTime());
+    return gi_lock.SetLoadedFor(ids_lock.GetData().FindGi(),
+                                ids_lock.GetExpirationTime());
 }
 
 
 bool CReaderRequestResult::SetLoadedGiFromSeqIds(const CSeq_id_Handle& id,
                                                  const CLoadLockSeqIds& ids)
 {
-    TGi gi = ids.GetSeq_ids().FindGi();
+    TSequenceGi data = ids.GetSeq_ids().FindGi();
     if ( s_GetLoadTraceLevel() > 0 ) {
-        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") gi = "<<gi);
+        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") gi = "<<data.gi);
     }
-    TExpirationTime exp_time = ids.GetExpirationTime();
-    return GetGBInfoManager().m_CacheGi.SetLoaded(*this, id, gi, exp_time);
+    return GetGBInfoManager().m_CacheGi.
+        SetLoadedFor(*this, id, data, ids.GetExpirationTime());
 }
 
 
@@ -1304,66 +1324,15 @@ CReaderRequestResult::GetLoadedGi(const CSeq_id_Handle& id)
 
 bool
 CReaderRequestResult::SetLoadedGi(const CSeq_id_Handle& id,
-                                  const TGi& value)
+                                  const TSequenceGi& value)
 {
     if ( s_GetLoadTraceLevel() > 0 ) {
-        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") gi = "<<value);
+        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") gi = "<<value.gi);
     }
-    return GetGBInfoManager().m_CacheGi.SetLoaded(*this, id, value);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// string -> GI
-
-bool
-CReaderRequestResult::IsLoadedGi(const string& id)
-{
-    return GetGBInfoManager().m_CacheStrGi.IsLoaded(*this, id) ||
-        IsLoadedSeqIds(id);
-}
-
-
-bool
-CReaderRequestResult::MarkLoadingGi(const string& id)
-{
-    return GetGBInfoManager().m_CacheStrGi.MarkLoading(*this, id);
-}
-
-
-CReaderRequestResult::TInfoLockGi
-CReaderRequestResult::GetLoadLockGi(const string& id)
-{
-    // if connection is allocated we cannot wait for another lock because
-    // of possible deadlock.
-    EDoNotWait do_not_wait = m_AllocatedConnection? eDoNotWait: eAllowWaiting;
-    TInfoLockGi lock =
-        GetGBInfoManager().m_CacheStrGi.GetLoadLock(*this, id, do_not_wait);
-    if ( !lock.IsLoaded() ) {
-        TInfoLockIds ids_lock = GetLoadedSeqIds(id);
-        if ( ids_lock ) {
-            UpdateGiFromSeqIds(lock, ids_lock);
-        }
-    }
-    return lock;
-}
-
-
-CReaderRequestResult::TInfoLockGi
-CReaderRequestResult::GetLoadedGi(const string& id)
-{
-    return GetGBInfoManager().m_CacheStrGi.GetLoaded(*this, id);
-}
-
-
-bool
-CReaderRequestResult::SetLoadedGi(const string& id,
-                                  const TGi& value)
-{
-    if ( s_GetLoadTraceLevel() > 0 ) {
-        LOG_POST(Info<<"GBLoader:StrId("<<id<<") gi = "<<value);
-    }
-    return GetGBInfoManager().m_CacheStrGi.SetLoaded(*this, id, value);
+    GBL::EExpirationType exp_type = CLoadLockGi::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheGi.
+        SetLoaded(*this, id, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
 }
 
 
@@ -1376,8 +1345,8 @@ bool CReaderRequestResult::UpdateLabelFromSeqIds(TInfoLockLabel& label_lock,
     if ( label_lock.IsLoaded() ) {
         return false;
     }
-    return label_lock.SetLoaded(ids_lock.GetData().FindLabel(),
-                                ids_lock.GetExpirationTime());
+    return label_lock.SetLoadedFor(ids_lock.GetData().FindLabel(),
+                                   ids_lock.GetExpirationTime());
 }
 
 
@@ -1388,8 +1357,8 @@ bool CReaderRequestResult::SetLoadedLabelFromSeqIds(const CSeq_id_Handle& id,
     if ( s_GetLoadTraceLevel() > 0 ) {
         LOG_POST(Info<<"GBLoader:SeqId("<<id<<") label = "<<label);
     }
-    TExpirationTime exp_time = ids.GetExpirationTime();
-    return GetGBInfoManager().m_CacheLabel.SetLoaded(*this, id, label, exp_time);
+    return GetGBInfoManager().m_CacheLabel.
+        SetLoadedFor(*this, id, label, ids.GetExpirationTime());
 }
 
 
@@ -1434,7 +1403,10 @@ CReaderRequestResult::SetLoadedLabel(const CSeq_id_Handle& id,
     if ( s_GetLoadTraceLevel() > 0 ) {
         LOG_POST(Info<<"GBLoader:SeqId("<<id<<") label = "<<value);
     }
-    return GetGBInfoManager().m_CacheLabel.SetLoaded(*this, id, value);
+    GBL::EExpirationType exp_type = CLoadLockLabel::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheLabel.
+        SetLoaded(*this, id, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
 }
 
 
@@ -1479,7 +1451,10 @@ CReaderRequestResult::SetLoadedTaxId(const CSeq_id_Handle& id,
     if ( s_GetLoadTraceLevel() > 0 ) {
         LOG_POST(Info<<"GBLoader:SeqId("<<id<<") tax_id = "<<value);
     }
-    return GetGBInfoManager().m_CacheTaxId.SetLoaded(*this, id, value);
+    GBL::EExpirationType exp_type = CLoadLockTaxId::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheTaxId.
+        SetLoaded(*this, id, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
 }
 
 
@@ -1522,9 +1497,108 @@ CReaderRequestResult::SetLoadedHash(const CSeq_id_Handle& id,
                                     const TSequenceHash& value)
 {
     if ( s_GetLoadTraceLevel() > 0 ) {
+        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") hash = "<<value.hash);
+    }
+    GBL::EExpirationType exp_type = CLoadLockHash::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheHash.
+        SetLoaded(*this, id, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Seq-id -> Length
+
+bool
+CReaderRequestResult::IsLoadedLength(const CSeq_id_Handle& id)
+{
+    return GetGBInfoManager().m_CacheLength.IsLoaded(*this, id);
+}
+
+
+bool
+CReaderRequestResult::MarkLoadingLength(const CSeq_id_Handle& id)
+{
+    return GetGBInfoManager().m_CacheLength.MarkLoading(*this, id);
+}
+
+
+CReaderRequestResult::TInfoLockLength
+CReaderRequestResult::GetLoadLockLength(const CSeq_id_Handle& id)
+{
+    // if connection is allocated we cannot wait for another lock because
+    // of possible deadlock.
+    EDoNotWait do_not_wait = m_AllocatedConnection? eDoNotWait: eAllowWaiting;
+    return GetGBInfoManager().m_CacheLength.GetLoadLock(*this, id, do_not_wait);
+}
+
+
+CReaderRequestResult::TInfoLockLength
+CReaderRequestResult::GetLoadedLength(const CSeq_id_Handle& id)
+{
+    return GetGBInfoManager().m_CacheLength.GetLoaded(*this, id);
+}
+
+
+bool
+CReaderRequestResult::SetLoadedLength(const CSeq_id_Handle& id,
+                                    const TSequenceLength& value)
+{
+    if ( s_GetLoadTraceLevel() > 0 ) {
         LOG_POST(Info<<"GBLoader:SeqId("<<id<<") hash = "<<value);
     }
-    return GetGBInfoManager().m_CacheHash.SetLoaded(*this, id, value);
+    GBL::EExpirationType exp_type = CLoadLockLength::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheLength.
+        SetLoaded(*this, id, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Seq-id -> Type
+
+bool
+CReaderRequestResult::IsLoadedType(const CSeq_id_Handle& id)
+{
+    return GetGBInfoManager().m_CacheType.IsLoaded(*this, id);
+}
+
+
+bool
+CReaderRequestResult::MarkLoadingType(const CSeq_id_Handle& id)
+{
+    return GetGBInfoManager().m_CacheType.MarkLoading(*this, id);
+}
+
+
+CReaderRequestResult::TInfoLockType
+CReaderRequestResult::GetLoadLockType(const CSeq_id_Handle& id)
+{
+    // if connection is allocated we cannot wait for another lock because
+    // of possible deadlock.
+    EDoNotWait do_not_wait = m_AllocatedConnection? eDoNotWait: eAllowWaiting;
+    return GetGBInfoManager().m_CacheType.GetLoadLock(*this, id, do_not_wait);
+}
+
+
+CReaderRequestResult::TInfoLockType
+CReaderRequestResult::GetLoadedType(const CSeq_id_Handle& id)
+{
+    return GetGBInfoManager().m_CacheType.GetLoaded(*this, id);
+}
+
+
+bool
+CReaderRequestResult::SetLoadedType(const CSeq_id_Handle& id,
+                                    const TSequenceType& value)
+{
+    if ( s_GetLoadTraceLevel() > 0 ) {
+        LOG_POST(Info<<"GBLoader:SeqId("<<id<<") type = "<<value.type);
+    }
+    GBL::EExpirationType exp_type = CLoadLockType::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheType.
+        SetLoaded(*this, id, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
 }
 
 
@@ -1579,7 +1653,10 @@ CReaderRequestResult::SetLoadedBlobIds(const CSeq_id_Handle& id,
     if ( s_GetLoadTraceLevel() > 0 ) {
         LOG_POST(Info<<"GBLoader:SeqId("<<id<<") blob_ids("<<key.second<<") = "<<value);
     }
-    return GetGBInfoManager().m_CacheBlobIds.SetLoaded(*this, key, value);
+    GBL::EExpirationType exp_type = CLoadLockBlobIds::GetExpType(value);
+    bool changed = GetGBInfoManager().m_CacheBlobIds.
+        SetLoaded(*this, key, value, exp_type);
+    return changed && exp_type == GBL::eExpire_normal;
 }
 
 
@@ -1606,9 +1683,9 @@ CReaderRequestResult::s_KeyBlobIds(const CSeq_id_Handle& seq_id,
 bool CReaderRequestResult::SetLoadedBlobState(const CBlob_id& blob_id,
                                               TBlobState state)
 {
-    bool changed = GetGBInfoManager().m_CacheBlobState.SetLoaded(*this,
-                                                                 blob_id,
-                                                                 state);
+    GBL::EExpirationType exp_type = CLoadLockBlobState::GetExpType(state);
+    bool changed = GetGBInfoManager().m_CacheBlobState.
+        SetLoaded(*this, blob_id, state, exp_type);
     if ( changed ) {
         if ( s_GetLoadTraceLevel() > 0 ) {
             LOG_POST(Info<<"GBLoader:"<<blob_id<<" state = "<<state);
@@ -1619,7 +1696,7 @@ bool CReaderRequestResult::SetLoadedBlobState(const CBlob_id& blob_id,
             blob.GetTSE_LoadLock()->SetBlobState(state);
         }
     }
-    return changed;
+    return changed && exp_type == eExpire_normal;
 }
 
 
@@ -1664,9 +1741,9 @@ void CReaderRequestResult::SetAndSaveBlobState(const TKeyBlob& blob_id,
 bool CReaderRequestResult::SetLoadedBlobVersion(const CBlob_id& blob_id,
                                                 TBlobVersion version)
 {
-    bool changed = GetGBInfoManager().m_CacheBlobVersion.SetLoaded(*this,
-                                                                   blob_id,
-                                                                   version);
+    GBL::EExpirationType exp_type = CLoadLockBlobVersion::GetExpType(version);
+    bool changed = GetGBInfoManager().m_CacheBlobVersion.
+        SetLoaded(*this, blob_id, version, exp_type);
     if ( changed ) {
         if ( s_GetLoadTraceLevel() > 0 ) {
             LOG_POST(Info<<"GBLoader:"<<blob_id<<" version = "<<version);
@@ -1681,7 +1758,7 @@ bool CReaderRequestResult::SetLoadedBlobVersion(const CBlob_id& blob_id,
             _ASSERT(blob.GetKnownBlobVersion() == version);
         }
     }
-    return changed;
+    return changed && exp_type == GBL::eExpire_normal;
 }
 
 
diff --git a/c++/src/objtools/edit/Makefile.edit.lib b/c++/src/objtools/edit/Makefile.edit.lib
index 888cb6c..2e9c44c 100644
--- a/c++/src/objtools/edit/Makefile.edit.lib
+++ b/c++/src/objtools/edit/Makefile.edit.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.edit.lib 478650 2015-09-11 12:00:48Z ivanov $
+# $Id: Makefile.edit.lib 493845 2016-03-02 14:05:29Z ivanov $
 
 # Build library "xobjedit"
 ###############################
@@ -10,7 +10,7 @@ SRC = gene_utils seq_entry_edit promote autodef_available_modifier autodef \
       struc_comm_field text_desc_field gb_block_field \
       link_cds_mrna cds_fix capitalization_string loc_edit mail_report \
       feattable_edit gaps_edit source_edit rna_edit \
-      remote_updater parse_text_options
+      remote_updater parse_text_options publication_edit
 
 LIB    = xobjedit
 
diff --git a/c++/src/objtools/edit/autodef.cpp b/c++/src/objtools/edit/autodef.cpp
index 9138944..1a73f36 100644
--- a/c++/src/objtools/edit/autodef.cpp
+++ b/c++/src/objtools/edit/autodef.cpp
@@ -1,4 +1,4 @@
-/*  $Id: autodef.cpp 484817 2015-11-16 16:23:10Z ivanov $
+/*  $Id: autodef.cpp 499840 2016-04-28 16:08:14Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -390,6 +390,9 @@ bool CAutoDef::x_AddMiscRNAFeatures(CBioseq_Handle bh, const CSeq_feat& cf, cons
 }
 
 
+
+
+
 bool CAutoDef::x_AddtRNAAndOther(CBioseq_Handle bh, const CSeq_feat& cf, const CSeq_loc& mapped_loc, CAutoDefFeatureClause_Base &main_clause)
 {
     if (cf.GetData().GetSubtype() != CSeqFeatData::eSubtype_misc_feature ||
@@ -397,53 +400,20 @@ bool CAutoDef::x_AddtRNAAndOther(CBioseq_Handle bh, const CSeq_feat& cf, const C
         return false;
     }
 
-    string comment = cf.GetComment();
-    if (NStr::StartsWith(comment, "contains ")) {
-        comment = comment.substr(9);
-    }
-
-    size_t pos = NStr::Find(comment, " and ");
-    if (pos == string::npos) {
-        return false;
-    }
-    string trna_str = comment.substr(0, pos);
-    string other_str = comment.substr(pos + 5);
-
-    CAutoDefParsedClause* other = NULL;
-    if (NStr::Equal(other_str, "control region") ||
-        NStr::Equal(other_str, "D-loop")) {
-        // create a clause of the appropriate type
-        other = new CAutoDefParsedClause(bh, cf, mapped_loc, false, true);  
-        other->SetTypeword(other_str);
-        other->SetTypewordFirst(false);
-    } else {
+    vector<string> phrases = CAutoDefFeatureClause_Base::GetFeatureClausePhrases(cf.GetComment());
+    if (phrases.size() < 2) {
         return false;
     }
 
-    vector<string> trna_str_list;
-    NStr::Tokenize(trna_str, ",", trna_str_list);
-    vector<CAutoDefParsedtRNAClause*> trna_clause_list;
-    bool is_first = true;
-    ITERATE(vector<string>, it, trna_str_list) {
-        if (!NStr::IsBlank(*it)) {
-            CAutoDefParsedtRNAClause* trna = s_tRNAClauseFromNote(bh, cf, mapped_loc, *it, is_first, false);
-            if (trna) {
-                trna_clause_list.push_back(trna);
-            } else {
-                ITERATE(vector<CAutoDefParsedtRNAClause*>, tc, trna_clause_list) {
-                    delete(*tc);
-                }
-                delete other;
-                return false;
-            }
-            is_first = false;
-        }
+    bool first = true;
+    string last = phrases.back();
+    phrases.pop_back();
+    ITERATE(vector<string>, it, phrases) {
+        main_clause.AddSubclause(CAutoDefFeatureClause_Base::ClauseFromPhrase(*it, bh, cf, mapped_loc, first, false));
+        first = false;
     }
+    main_clause.AddSubclause(CAutoDefFeatureClause_Base::ClauseFromPhrase(last, bh, cf, mapped_loc, first, true));
 
-    ITERATE(vector<CAutoDefParsedtRNAClause*>, it, trna_clause_list) {
-        main_clause.AddSubclause(*it);
-    }
-    main_clause.AddSubclause(other);
     return true;
 }
 
@@ -466,19 +436,16 @@ void CAutoDef::x_RemoveOptionalFeatures(CAutoDefFeatureClause_Base *main_clause,
     }
     
     // keep LTRs only if requested or lonely and not in parent
-    if (!m_Options.GetKeepLTRs()) {
-        if (main_clause->GetNumSubclauses() > 1 
-            || main_clause->GetMainFeatureSubtype() != CSeqFeatData::eSubtype_LTR) {
-            main_clause->RemoveFeaturesByType(CSeqFeatData::eSubtype_LTR);
-        }
+    if (!m_Options.GetKeepLTRs() && !main_clause->IsFeatureTypeLonely(CSeqFeatData::eSubtype_LTR)) {
+        main_clause->RemoveFeaturesByType(CSeqFeatData::eSubtype_LTR);
     }
            
     // keep promoters only if requested or lonely and not in mRNA
-    if (!m_Options.GetKeepPromoters()) {
-        if (!main_clause->IsFeatureTypeLonely(CSeqFeatData::eSubtype_promoter)) {
-            main_clause->RemoveFeaturesByType(CSeqFeatData::eSubtype_promoter);
+    if (!m_Options.GetKeepRegulatoryFeatures()) {
+        if (!main_clause->IsFeatureTypeLonely(CSeqFeatData::eSubtype_regulatory)) {
+            main_clause->RemoveFeaturesByType(CSeqFeatData::eSubtype_regulatory, m_Options.GetUseFakePromoters());
         } else {
-            main_clause->RemoveFeaturesInmRNAsByType(CSeqFeatData::eSubtype_promoter);
+            main_clause->RemoveFeaturesInmRNAsByType(CSeqFeatData::eSubtype_regulatory, m_Options.GetUseFakePromoters());
         }
     }
     
@@ -745,7 +712,9 @@ string CAutoDef::x_GetFeatureClauses(CBioseq_Handle bh)
         
             if (new_clause != NULL && 
                 (new_clause->IsRecognizedFeature() ||
-                 (new_clause->GetMainFeatureSubtype() == CSeqFeatData::eSubtype_repeat_region && m_Options.GetKeepRepeatRegion()))) {
+                 (m_Options.GetKeepRepeatRegion() && 
+                  (new_clause->GetMainFeatureSubtype() == CSeqFeatData::eSubtype_repeat_region || 
+                   new_clause->GetMainFeatureSubtype() == CSeqFeatData::eSubtype_LTR)))) {
                 if (new_clause->GetMainFeatureSubtype() == CSeqFeatData::eSubtype_exon ||
                     new_clause->GetMainFeatureSubtype() == CSeqFeatData::eSubtype_intron) {
                     new_clause->Label(m_Options.GetSuppressAlleles());
@@ -789,10 +758,6 @@ string CAutoDef::x_GetFeatureClauses(CBioseq_Handle bh)
     main_clause.CountUnknownGenes();
     main_clause.RemoveDeletedSubclauses();
     
-    // remove miscRNA and otherRNA features that are trans-spliced leaders
-    main_clause.RemoveTransSplicedLeaders();
-    main_clause.RemoveDeletedSubclauses();
-    
     x_RemoveOptionalFeatures(&main_clause, bh);
     
     // if a gene is listed as part of another clause, they do not need
@@ -881,41 +846,43 @@ static unsigned int s_GetProductFlagFromCDSProductNames (CBioseq_Handle bh)
 	SAnnotSelector sel(CSeqFeatData::eSubtype_cdregion);
     CFeat_CI feat_ci(bh, sel);
 	while (feat_ci && product_flag == CBioSource::eGenome_unknown) {
-		string label;
-        CConstRef<CSeq_feat> prot
-            = sequence::GetBestOverlappingFeat(feat_ci->GetProduct(),
-                                               CSeqFeatData::e_Prot,
-                                               sequence::eOverlap_Simple,
-                                               bh.GetScope());
-        if (prot) {
-            feature::GetLabel(*prot, &label, feature::fFGL_Content);
-			if (NStr::Find (label, "macronuclear") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_macronuclear;
-			} else if (NStr::Find (label, "nucleomorph") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_nucleomorph;
-			} else if (NStr::Find (label, "mitochondrion") != NCBI_NS_STD::string::npos
-				       || NStr::Find (label, "mitochondrial") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_mitochondrion;
-			} else if (NStr::Find (label, "apicoplast") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_apicoplast;
-			} else if (NStr::Find (label, "chloroplast") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_chloroplast;
-			} else if (NStr::Find (label, "chromoplast") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_chromoplast;
-			} else if (NStr::Find (label, "kinetoplast") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_kinetoplast;
-			} else if (NStr::Find (label, "proplastid") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_proplastid;
-			} else if ((pos = NStr::Find (label, "plastid")) != NCBI_NS_STD::string::npos
-				       && (pos == 0 || isspace (label.c_str()[pos]))) {
-              product_flag = CBioSource::eGenome_plastid;
-			} else if (NStr::Find (label, "cyanelle") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_cyanelle;
-			} else if (NStr::Find (label, "leucoplast") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_leucoplast;
-			} else if (NStr::Find (label, "hydrogenosome") != NCBI_NS_STD::string::npos) {
-              product_flag = CBioSource::eGenome_hydrogenosome;
-			} 
+        if (feat_ci->IsSetProduct()) {
+            string label;
+            CConstRef<CSeq_feat> prot
+                = sequence::GetBestOverlappingFeat(feat_ci->GetProduct(),
+                CSeqFeatData::e_Prot,
+                sequence::eOverlap_Simple,
+                bh.GetScope());
+            if (prot) {
+                feature::GetLabel(*prot, &label, feature::fFGL_Content);
+                if (NStr::Find(label, "macronuclear") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_macronuclear;
+                } else if (NStr::Find(label, "nucleomorph") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_nucleomorph;
+                } else if (NStr::Find(label, "mitochondrion") != NCBI_NS_STD::string::npos
+                    || NStr::Find(label, "mitochondrial") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_mitochondrion;
+                } else if (NStr::Find(label, "apicoplast") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_apicoplast;
+                } else if (NStr::Find(label, "chloroplast") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_chloroplast;
+                } else if (NStr::Find(label, "chromoplast") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_chromoplast;
+                } else if (NStr::Find(label, "kinetoplast") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_kinetoplast;
+                } else if (NStr::Find(label, "proplastid") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_proplastid;
+                } else if ((pos = NStr::Find(label, "plastid")) != NCBI_NS_STD::string::npos
+                    && (pos == 0 || isspace(label.c_str()[pos]))) {
+                    product_flag = CBioSource::eGenome_plastid;
+                } else if (NStr::Find(label, "cyanelle") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_cyanelle;
+                } else if (NStr::Find(label, "leucoplast") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_leucoplast;
+                } else if (NStr::Find(label, "hydrogenosome") != NCBI_NS_STD::string::npos) {
+                    product_flag = CBioSource::eGenome_hydrogenosome;
+                }
+            }
         }
 		++feat_ci;
 	}
@@ -928,11 +895,13 @@ string CAutoDef::x_GetFeatureClauseProductEnding(const string& feature_clauses,
 {
     bool pluralize = false;
 	unsigned int product_flag_to_use;
+    unsigned int nuclear_copy_flag = CBioSource::eGenome_unknown;
     
 	if (m_Options.GetSpecifyNuclearProduct()) {
 	    product_flag_to_use = s_GetProductFlagFromCDSProductNames (bh);
 	} else {
 		product_flag_to_use = m_Options.GetProductFlag();
+        nuclear_copy_flag = m_Options.GetNuclearCopyFlag();
 	}
     if (NStr::Find(feature_clauses, "genes") != NCBI_NS_STD::string::npos) {
         pluralize = true;
@@ -972,19 +941,29 @@ string CAutoDef::x_GetFeatureClauseProductEnding(const string& feature_clauses,
     if (!NStr::IsBlank(ending)) {
         ending = "; " + ending;
     } else {
-        ending = OrganelleByGenome(product_flag_to_use);
-        if (NStr::IsBlank(ending)) {
-            if (!NStr::IsBlank(genome_from_mods)) {
-                ending = "; " + genome_from_mods;
-            }
-        } else {
-            if (NStr::Equal(ending, "mitochondrion")) {
-                ending = "mitochondrial";
-            }
-            if (pluralize) {
-                ending = "; nuclear genes for " + ending + " products";
+        if (product_flag_to_use != CBioSource::eGenome_unknown) {
+            ending = OrganelleByGenome(product_flag_to_use);
+            if (NStr::IsBlank(ending)) {
+                if (!NStr::IsBlank(genome_from_mods)) {
+                    ending = "; " + genome_from_mods;
+                }
             } else {
-                ending = "; nuclear gene for " +  ending + " product";
+                if (NStr::Equal(ending, "mitochondrion")) {
+                    ending = "mitochondrial";
+                }
+                if (pluralize) {
+                    ending = "; nuclear genes for " + ending + " products";
+                } else {
+                    ending = "; nuclear gene for " + ending + " product";
+                }
+            }
+        } else if (nuclear_copy_flag != CBioSource::eGenome_unknown) {
+            ending = OrganelleByGenome(nuclear_copy_flag);
+            if (!NStr::IsBlank(ending)) {
+                if (NStr::Equal(ending, "mitochondrion")) {
+                    ending = "mitochondrial";
+                }
+                ending = "; nuclear copy of " + ending + " gene";
             }
         }
     } 
@@ -1083,7 +1062,11 @@ string CAutoDef::GetOneFeatureClauseList(CBioseq_Handle bh, unsigned int genome_
             string biomol = "";
             CSeqdesc_CI mi(bh, CSeqdesc::e_Molinfo);
             if (mi && mi->GetMolinfo().IsSetBiomol()) {
-                biomol = CMolInfo::GetBiomolName(mi->GetMolinfo().GetBiomol());
+                if (mi->GetMolinfo().GetBiomol() == CMolInfo::eBiomol_mRNA) {
+                    biomol = "mRNA";
+                } else {
+                    biomol = CMolInfo::GetBiomolName(mi->GetMolinfo().GetBiomol());
+                }
             }
             if (!NStr::IsBlank(biomol)) {
                 feature_clauses = " " + biomol;
@@ -1290,6 +1273,23 @@ void CAutoDef::SetOptionsObject(const CUser_object& user)
 }
 
 
+CConstRef<CUser_object> GetOptionsForSet(CBioseq_set_Handle set)
+{
+    CConstRef<CUser_object> options(NULL);
+    CBioseq_CI b(set, CSeq_inst::eMol_na);
+    while (b && !options) {
+        CSeqdesc_CI desc(*b, CSeqdesc::e_User);
+        while (desc && desc->GetUser().GetObjectType() != CUser_object::eObjectType_AutodefOptions) {
+            ++desc;
+        }
+        if (desc) {
+            options.Reset(&(desc->GetUser()));
+        }
+    }
+    return options;
+}
+
+
 bool CAutoDef::RegenerateDefLines(CSeq_entry_Handle se)
 {
     bool any = false;
@@ -1331,6 +1331,38 @@ bool CAutoDef::RegenerateDefLines(CSeq_entry_Handle se)
             }                   
         }
     }
+
+    // update the title of the set 
+    for (CSeq_entry_CI si(se, CSeq_entry_CI::fRecursive | CSeq_entry_CI::fIncludeGivenEntry, CSeq_entry::e_Set); si; ++si) {
+        if (si->IsSet() && CAutoDef::NeedsDocsumDefline(*(si->GetSet().GetCompleteBioseq_set()))) {
+            CAutoDef autodef;
+            CConstRef<CUser_object> options = GetOptionsForSet(si->GetSet());
+            if (options) {
+                autodef.SetOptionsObject(*options);
+            }
+            autodef.AddSources(se);
+            string defline = autodef.GetDocsumDefLine(*si);
+
+            bool found_existing = false;
+            CBioseq_set_EditHandle bsseh(si->GetSet());
+            NON_CONST_ITERATE(CBioseq_set_EditHandle::TDescr::Tdata, it, bsseh.SetDescr().Set()) {
+                if ((*it)->IsTitle()) {
+                    if (!NStr::Equal((*it)->GetTitle(), defline)) {
+                        (*it)->SetTitle(defline);
+                        any = true;
+                    }
+                    found_existing = true;
+                    break;
+                }
+            }
+            if (!found_existing) {
+                CRef<CSeqdesc> new_desc(new CSeqdesc());
+                new_desc->SetTitle(defline);
+                bsseh.SetDescr().Set().push_back(new_desc);
+                any = true;
+            }
+        }
+    }
     return any;
 }
 
diff --git a/c++/src/objtools/edit/autodef_available_modifier.cpp b/c++/src/objtools/edit/autodef_available_modifier.cpp
index 4310cb8..8367541 100644
--- a/c++/src/objtools/edit/autodef_available_modifier.cpp
+++ b/c++/src/objtools/edit/autodef_available_modifier.cpp
@@ -1,4 +1,4 @@
-/*  $Id: autodef_available_modifier.cpp 459368 2015-02-18 14:46:24Z bollin $
+/*  $Id: autodef_available_modifier.cpp 500380 2016-05-04 13:50:52Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -269,6 +269,9 @@ string CAutoDefAvailableModifier::GetSubSourceLabel (CSubSource::ESubtype st)
         case CSubSource::eSubtype_haplotype:
             label = "haplotype";
             break;
+        case CSubSource::eSubtype_haplogroup:
+            label = "haplogroup";
+            break;
         case CSubSource::eSubtype_genotype:
             label = "genotype";
             break;
@@ -335,9 +338,6 @@ string CAutoDefAvailableModifier::GetSubSourceLabel (CSubSource::ESubtype st)
         case CSubSource::eSubtype_identified_by:
             label = "identified by";
             break;
-        case CSubSource::eSubtype_other:
-            label = "subsource note";
-            break;
         default:
             label = "";
             break;
@@ -446,9 +446,6 @@ string CAutoDefAvailableModifier::GetOrgModLabel(COrgMod::ESubtype st)
         case COrgMod::eSubtype_gb_synonym:
             label = "synonym";
             break;
-        case COrgMod::eSubtype_other:
-            label = "organism note";
-            break;
         default:
             label = COrgMod::GetSubtypeName(st);
             break;
diff --git a/c++/src/objtools/edit/autodef_feature_clause.cpp b/c++/src/objtools/edit/autodef_feature_clause.cpp
index afe08be..33f2f5e 100644
--- a/c++/src/objtools/edit/autodef_feature_clause.cpp
+++ b/c++/src/objtools/edit/autodef_feature_clause.cpp
@@ -1,4 +1,4 @@
-/*  $Id: autodef_feature_clause.cpp 485525 2015-11-23 16:14:31Z ivanov $
+/*  $Id: autodef_feature_clause.cpp 494438 2016-03-07 17:09:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -96,6 +96,9 @@ CAutoDefFeatureClause::~CAutoDefFeatureClause()
 
 CSeqFeatData::ESubtype CAutoDefFeatureClause::GetMainFeatureSubtype() const
 {
+    if (IsLTR(m_MainFeat)) {
+        return CSeqFeatData::eSubtype_LTR;
+    }
     return m_MainFeat.GetData().GetSubtype();
 }
 
@@ -182,7 +185,7 @@ bool CAutoDefFeatureClause::IsRecognizedFeature()
     CSeqFeatData::ESubtype subtype = m_MainFeat.GetData().GetSubtype();
     if (subtype == CSeqFeatData::eSubtype_3UTR
         || subtype == CSeqFeatData::eSubtype_5UTR
-        || subtype == CSeqFeatData::eSubtype_LTR
+        || IsLTR(m_MainFeat)
         || subtype == CSeqFeatData::eSubtype_cdregion
         || subtype == CSeqFeatData::eSubtype_gene
         || subtype == CSeqFeatData::eSubtype_mRNA
@@ -196,6 +199,7 @@ bool CAutoDefFeatureClause::IsRecognizedFeature()
         || subtype == CSeqFeatData::eSubtype_ncRNA
         || subtype == CSeqFeatData::eSubtype_preRNA
         || subtype == CSeqFeatData::eSubtype_D_loop
+        || subtype == CSeqFeatData::eSubtype_regulatory
         || IsNoncodingProductFeat()
         || IsMobileElement()
         || IsInsertionSequence()
@@ -237,6 +241,11 @@ bool CAutoDefFeatureClause::x_IsPseudo()
 bool CAutoDefFeatureClause::x_GetFeatureTypeWord(string &typeword)
 {
     string qual, comment;
+
+    if (IsLTR(m_MainFeat)) {
+        typeword = "LTR repeat region";
+        return true;
+    }
   
     CSeqFeatData::ESubtype subtype = m_MainFeat.GetData().GetSubtype();
     switch (subtype) {
@@ -252,10 +261,6 @@ bool CAutoDefFeatureClause::x_GetFeatureTypeWord(string &typeword)
             typeword = "D-loop";
             return true;
             break;
-        case CSeqFeatData::eSubtype_LTR:
-            typeword = "LTR";
-            return true;
-            break;
         case CSeqFeatData::eSubtype_3UTR:
             typeword = "3' UTR";
             return true;
@@ -301,6 +306,18 @@ bool CAutoDefFeatureClause::x_GetFeatureTypeWord(string &typeword)
                 return true;
             }
             break;
+        case CSeqFeatData::eSubtype_regulatory:
+            if (m_MainFeat.IsSetQual()) {
+                ITERATE(CSeq_feat::TQual, q, m_MainFeat.GetQual()) {
+                    if ((*q)->IsSetQual() &&
+                        NStr::Equal((*q)->GetQual(), "regulatory_class") &&
+                        (*q)->IsSetVal() && !NStr::IsBlank((*q)->GetVal())) {
+                        typeword = (*q)->GetVal();
+                        return true;
+                    }
+                }
+            }
+            break;
         default:
             break;
     }
@@ -607,38 +624,13 @@ bool CAutoDefFeatureClause::x_GetProductName(string &product_name)
             return true;
         }
     } else if (m_MainFeat.GetData().Which() == CSeqFeatData::e_Rna) {
-        if (subtype == CSeqFeatData::eSubtype_tRNA) {
-            string label;
-
-            feature::GetLabel(m_MainFeat, &label, feature::fFGL_Content);
-            if (NStr::Equal(label, "tRNA-Xxx")) {
-                label = "tRNA-OTHER";
-            } else if (!NStr::StartsWith(label, "tRNA-")) {
-                label = "tRNA-" + label;
-            }
-            product_name = label;
-            return true;
-        } else {
-            product_name = m_MainFeat.GetNamedQual("product");
-            if (NStr::IsBlank(product_name)) {
-                if (subtype == CSeqFeatData::eSubtype_otherRNA
-                    || subtype == CSeqFeatData::eSubtype_misc_RNA) {
-                    if (m_MainFeat.CanGetComment()) {
-                        product_name = m_MainFeat.GetComment();
-                        if (!NStr::IsBlank(product_name)) {
-                            string::size_type pos = NStr::Find(product_name, ";");
-                            if (pos != NCBI_NS_STD::string::npos) {
-                                product_name = product_name.substr(0, pos);
-                            }
-                        }
-                    }
-                } else if (m_MainFeat.GetData().GetRna().IsSetExt()
-                    && m_MainFeat.GetData().GetRna().GetExt().Which() == CRNA_ref::C_Ext::e_Name) {
-                    product_name = m_MainFeat.GetData().GetRna().GetExt().GetName();
-                }
-            }
-            return true;
+        product_name = m_MainFeat.GetData().GetRna().GetRnaProductName();
+        if (NStr::IsBlank(product_name) && m_MainFeat.IsSetComment()) {
+            product_name = m_MainFeat.GetComment();
         }
+        return true;
+    } else if (m_MainFeat.GetData().GetSubtype() == CSeqFeatData::eSubtype_regulatory) {
+        return true;
     } else {
         string label;
         
@@ -770,7 +762,7 @@ bool CAutoDefFeatureClause::x_GetDescription(string &description)
                || subtype == CSeqFeatData::eSubtype_3UTR
                || subtype == CSeqFeatData::eSubtype_5UTR) {
         return false;
-    } else if (subtype == CSeqFeatData::eSubtype_LTR) {
+    } else if (IsLTR(m_MainFeat)) {
         if (m_MainFeat.CanGetComment()) {
             string comment = m_MainFeat.GetComment();
             if (NStr::StartsWith(comment, "LTR ")) {
@@ -831,6 +823,12 @@ bool CAutoDefFeatureClause::IsPromoter()
 }
 
 
+bool CAutoDefFeatureClause::IsLTR()
+{
+    return IsLTR(m_MainFeat);
+}
+
+
 bool CAutoDefFeatureClause::IsPromoter(const CSeq_feat& feat)
 {
     if (feat.GetData().GetSubtype() == CSeqFeatData::eSubtype_promoter) {
@@ -844,6 +842,25 @@ bool CAutoDefFeatureClause::IsPromoter(const CSeq_feat& feat)
 }
 
 
+bool CAutoDefFeatureClause::IsLTR(const CSeq_feat& feat)
+{
+    if (feat.GetData().GetSubtype() == CSeqFeatData::eSubtype_LTR) {
+        return true;
+    } else if (feat.GetData().GetSubtype() != CSeqFeatData::eSubtype_repeat_region ||
+        !feat.IsSetQual()) {
+        return false;
+    }
+    ITERATE(CSeq_feat::TQual, it, feat.GetQual()) {
+        if ((*it)->IsSetQual() && (*it)->IsSetVal() &&
+            NStr::EqualNocase((*it)->GetQual(), "rpt_type") &&
+            NStr::FindNoCase((*it)->GetVal(), "long_terminal_repeat") != string::npos) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
 /* This function calculates the "interval" for a clause in the definition
  * line.  The interval could be an empty string, it could indicate whether
  * the location of the feature is partial or complete and whether or not
@@ -860,7 +877,7 @@ bool CAutoDefFeatureClause::x_GetGenericInterval (string &interval, bool suppres
         return false;
     }
     
-    CSeqFeatData::ESubtype subtype = m_MainFeat.GetData().GetSubtype();
+    CSeqFeatData::ESubtype subtype = GetMainFeatureSubtype();
     if (subtype == CSeqFeatData::eSubtype_exon && m_IsAltSpliced) {
         interval = "alternatively spliced";
         return true;
@@ -868,11 +885,13 @@ bool CAutoDefFeatureClause::x_GetGenericInterval (string &interval, bool suppres
     
     if (IsSatelliteClause() 
         || IsPromoter() 
+        || subtype == CSeqFeatData::eSubtype_regulatory
         || subtype == CSeqFeatData::eSubtype_exon
         || subtype == CSeqFeatData::eSubtype_intron
         || subtype == CSeqFeatData::eSubtype_5UTR
         || subtype == CSeqFeatData::eSubtype_3UTR
-        || (subtype == CSeqFeatData::eSubtype_repeat_region && !NStr::Equal(m_Typeword, "endogenous virus"))) {
+        || (subtype == CSeqFeatData::eSubtype_repeat_region && !NStr::Equal(m_Typeword, "endogenous virus"))
+        || IsLTR()) {
         return false;
     } 
     
@@ -1168,7 +1187,7 @@ bool CAutoDefFeatureClause::OkToGroupUnderByType(CAutoDefFeatureClause_Base *par
             || parent_clause->IsGeneCluster()) {
             ok_to_group = true;
         }
-    } else if (IsPromoter()) {
+    } else if (IsPromoter() || subtype == CSeqFeatData::eSubtype_regulatory) {
         if (parent_subtype == CSeqFeatData::eSubtype_cdregion
             || parent_subtype == CSeqFeatData::eSubtype_mRNA
             || parent_subtype == CSeqFeatData::eSubtype_gene
@@ -1201,7 +1220,7 @@ bool CAutoDefFeatureClause::OkToGroupUnderByType(CAutoDefFeatureClause_Base *par
         }
     } else if (subtype == CSeqFeatData::eSubtype_3UTR 
                || subtype == CSeqFeatData::eSubtype_5UTR
-               || subtype == CSeqFeatData::eSubtype_LTR) {
+               || IsLTR(m_MainFeat)) {
         if (parent_subtype == CSeqFeatData::eSubtype_cdregion
             || parent_subtype == CSeqFeatData::eSubtype_mRNA
             || parent_subtype == CSeqFeatData::eSubtype_gene
@@ -1789,6 +1808,9 @@ void CAutoDefParsedClause::SetMiscRNAWord(const string& phrase)
         }
     } else if (word_type == eMiscRnaWordType_RNA) {
         m_Description = phrase;
+        if (NStr::EndsWith(m_Description, " gene")) {
+            m_Description = m_Description.substr(0, m_Description.length() - 5);
+        }
         SetTypeword("gene");
         SetTypewordFirst(false);
     }
diff --git a/c++/src/objtools/edit/autodef_feature_clause_base.cpp b/c++/src/objtools/edit/autodef_feature_clause_base.cpp
index 6191629..e6a74f2 100644
--- a/c++/src/objtools/edit/autodef_feature_clause_base.cpp
+++ b/c++/src/objtools/edit/autodef_feature_clause_base.cpp
@@ -1,4 +1,4 @@
-/*  $Id: autodef_feature_clause_base.cpp 485525 2015-11-23 16:14:31Z ivanov $
+/*  $Id: autodef_feature_clause_base.cpp 490362 2016-01-25 12:43:11Z bollin $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -655,7 +655,7 @@ void CAutoDefFeatureClause_Base::PluralizeInterval()
 
 void CAutoDefFeatureClause_Base::PluralizeDescription()
 {
-    if (NStr::IsBlank(m_Description)) {
+    if (NStr::IsBlank(m_Description) || !NStr::IsBlank(m_Typeword)) {
         return;
     }
     m_Description += "s";
@@ -844,6 +844,7 @@ bool ShareInterval(const CSeq_loc& loc1, const CSeq_loc& loc2)
 }
 
 
+
 /* This function determines whether two CDS clauses meet the conditions for
  * alternative splicing, and if so, it returns the name of the alternatively
  * spliced product.  In order to be alternatively spliced, the two CDSs 
@@ -1421,13 +1422,13 @@ void CAutoDefFeatureClause_Base::GroupSegmentedCDSs (bool suppress_allele)
 }
 
 
-void CAutoDefFeatureClause_Base::RemoveFeaturesByType(unsigned int feature_type)
+void CAutoDefFeatureClause_Base::RemoveFeaturesByType(unsigned int feature_type, bool except_promoters)
 {
     for (unsigned int k = 0; k < m_ClauseList.size(); k++) {
-        if ((unsigned int)m_ClauseList[k]->GetMainFeatureSubtype() == feature_type) {
+        if ((unsigned int)m_ClauseList[k]->GetMainFeatureSubtype() == feature_type && (!except_promoters || !m_ClauseList[k]->IsPromoter())) {
             m_ClauseList[k]->MarkForDeletion();
         } else if (!m_ClauseList[k]->IsMarkedForDeletion()) {
-            m_ClauseList[k]->RemoveFeaturesByType(feature_type);
+            m_ClauseList[k]->RemoveFeaturesByType(feature_type, except_promoters);
         }        
     }
 }
@@ -1453,12 +1454,12 @@ bool CAutoDefFeatureClause_Base::IsFeatureTypeLonely(unsigned int feature_type)
 }
 
 
-void CAutoDefFeatureClause_Base::RemoveFeaturesInmRNAsByType(unsigned int feature_type)
+void CAutoDefFeatureClause_Base::RemoveFeaturesInmRNAsByType(unsigned int feature_type, bool except_promoters)
 {
     for (unsigned int k = 0; k < m_ClauseList.size(); k++) {
         if (m_ClauseList[k]->HasmRNA() 
             || m_ClauseList[k]->GetMainFeatureSubtype() == CSeqFeatData::eSubtype_mRNA) {
-            m_ClauseList[k]->RemoveFeaturesByType(feature_type);
+            m_ClauseList[k]->RemoveFeaturesByType(feature_type, except_promoters);
         }
     }
 }
@@ -1506,21 +1507,6 @@ void CAutoDefFeatureClause_Base::RemoveBioseqPrecursorRNAs()
 }
 
 
-void CAutoDefFeatureClause_Base::RemoveTransSplicedLeaders()
-{
-    for (unsigned int k = 0; k < m_ClauseList.size(); k++) {
-        unsigned int subtype = m_ClauseList[k]->GetMainFeatureSubtype();
-        if ((subtype == CSeqFeatData::eSubtype_otherRNA
-             || subtype == CSeqFeatData::eSubtype_misc_RNA)
-            && NStr::Find(m_ClauseList[k]->GetDescription(), "trans-spliced leader") != NCBI_NS_STD::string::npos) {
-            m_ClauseList[k]->MarkForDeletion();
-        } else {
-            m_ClauseList[k]->RemoveTransSplicedLeaders();
-        }
-    }
-}
-
-
 void CAutoDefFeatureClause_Base::RemoveuORFs()
 {
     for (unsigned int k = 0; k < m_ClauseList.size(); k++) {
@@ -1939,6 +1925,87 @@ vector<string> CAutoDefFeatureClause_Base::GetTrnaIntergenicSpacerClausePhrases(
 }
 
 
+bool CAutoDefFeatureClause_Base::IsValidFeatureClausePhrase(const string& phrase)
+{
+    string product_name = "";
+    string gene_name = "";
+    if (NStr::Equal(phrase, "control region") ||
+        NStr::Equal(phrase, "D-loop")) {
+        return true;
+    } else if (CAutoDefParsedtRNAClause::ParseString(phrase, gene_name, product_name))  {
+        return true;
+    } else if (x_GetRnaMiscWordType(phrase) != eMiscRnaWordType_Unrecognized) {
+        return true;
+    }
+    return false;
+}
+
+
+vector<string> CAutoDefFeatureClause_Base::GetFeatureClausePhrases(string comment)
+{
+    vector<string> phrases;
+
+    if (NStr::StartsWith(comment, "contains ")) {
+        comment = comment.substr(9);
+    }
+    vector<string> elements;
+    NStr::Tokenize(comment, ",", elements);
+    bool fail = false;
+    ITERATE(vector<string>, it, elements)
+    {
+        CTempString phrase = *it;
+        NStr::TruncateSpacesInPlace(phrase);
+        if (NStr::StartsWith(phrase, "and ")) {
+            phrase = phrase.substr(4);
+        }
+        size_t pos = NStr::Find(phrase, " and ");
+        if (pos != string::npos) {
+            string one = phrase.substr(0, pos);
+            string two = phrase.substr(pos + 5);
+            if (IsValidFeatureClausePhrase(one) && IsValidFeatureClausePhrase(two)) {
+                phrases.push_back(one);
+                phrases.push_back(two);
+            } else {
+                fail = true;
+                break;
+            }
+        } else {
+            if (IsValidFeatureClausePhrase(phrase)) {
+                phrases.push_back(phrase);
+            } else {
+                fail = true;
+                break;
+            }
+        }
+    }
+    if (fail) {
+        phrases.clear();
+    }
+    return phrases;
+}
+
+
+CAutoDefFeatureClause_Base * CAutoDefFeatureClause_Base::ClauseFromPhrase(const string& phrase, CBioseq_Handle bh, const CSeq_feat& cf, const CSeq_loc& mapped_loc, bool first, bool last)
+{
+    CAutoDefFeatureClause_Base *clause = NULL;
+
+    if (NStr::Equal(phrase, "control region") ||
+        NStr::Equal(phrase, "D-loop")) {
+        // create a clause of the appropriate type
+        CAutoDefParsedClause* other = new CAutoDefParsedClause(bh, cf, mapped_loc, first, last);
+        other->SetTypeword(phrase);
+        other->SetTypewordFirst(false);
+        return other;
+    } else if (x_GetRnaMiscWordType(phrase) != eMiscRnaWordType_Unrecognized) {
+        CAutoDefParsedClause *new_clause = new CAutoDefParsedClause(bh, cf, mapped_loc, first, last);
+        new_clause->SetMiscRNAWord(phrase);
+        return new_clause;
+    } else {
+        CAutoDefParsedtRNAClause* trna = s_tRNAClauseFromNote(bh, cf, mapped_loc, phrase, first, last);
+        return trna;
+    }
+}
+
 
 END_SCOPE(objects)
 END_NCBI_SCOPE
diff --git a/c++/src/objtools/edit/autodef_mod_combo.cpp b/c++/src/objtools/edit/autodef_mod_combo.cpp
index e7d32c7..042644c 100644
--- a/c++/src/objtools/edit/autodef_mod_combo.cpp
+++ b/c++/src/objtools/edit/autodef_mod_combo.cpp
@@ -1,4 +1,4 @@
-/*  $Id: autodef_mod_combo.cpp 484819 2015-11-16 16:23:56Z ivanov $
+/*  $Id: autodef_mod_combo.cpp 500380 2016-05-04 13:50:52Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -255,97 +255,6 @@ void CAutoDefModifierCombo::AddOrgMod(COrgMod::ESubtype st, bool even_if_not_uni
 }
 
 
-void CAutoDefModifierCombo::GetAvailableModifiers (CAutoDefSourceDescription::TAvailableModifierVector &modifier_list)
-{
-    unsigned int k;
-    
-    // first, set up modifier list with blanks
-    modifier_list.clear();
-    //note - later come back and rearrange in order of importance
-    // add orgmod modifiers
-    //dosage, old name, and old lineage are deliberately omitted
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_strain, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_substrain, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_type, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_subtype, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_variety, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_serotype, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_serogroup, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_serovar, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_cultivar, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_pathovar, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_chemovar, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_biovar, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_biotype, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_group, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_subgroup, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_isolate, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_common, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_acronym, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_nat_host, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_sub_species, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_specimen_voucher, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_authority, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_forma, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_forma_specialis, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_ecotype, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_synonym, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_anamorph, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_teleomorph, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_breed, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_bio_material, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_culture_collection, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_gb_acronym, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_gb_anamorph, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_gb_synonym, true));
-    modifier_list.push_back(CAutoDefAvailableModifier(COrgMod::eSubtype_other, true));
-
-
-    // add subsource modifiers
-    // map, fwd_primer_name, fwd_primer_seq, rev_primer_name, and rev_primer_seq are deliberately omitted
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_chromosome, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_clone, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_subclone, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_haplotype, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_genotype, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_sex, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_cell_line, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_cell_type, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_tissue_type, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_clone_lib, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_dev_stage, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_frequency, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_germline, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_rearranged, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_lab_host, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_pop_variant, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_tissue_lib, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_plasmid_name, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_transposon_name, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_insertion_seq_name, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_plastid_name, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_country, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_segment, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_endogenous_virus_name, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_transgenic, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_environmental_sample, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_isolation_source, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_lat_lon, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_altitude, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_collection_date, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_collected_by, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_identified_by, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_mating_type, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_linkage_group, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_haplogroup, false));
-    modifier_list.push_back(CAutoDefAvailableModifier(CSubSource::eSubtype_other, false));
-
-    for (k = 0; k < m_GroupList.size(); k++) {
-        m_GroupList[k]->GetAvailableModifiers(modifier_list);
-    }
-}
-
-
 string CAutoDefModifierCombo::x_GetSubSourceLabel (CSubSource::ESubtype st)
 {
     string label = "";
@@ -570,9 +479,13 @@ void CAutoDefModifierCombo::x_AddHIVModifiers(TExtraOrgMods& extra_orgmods, TExt
     bool     src_has_clone = false;
     bool     src_has_isolate = false;
     
-    if (!bsrc.IsSetOrg() || !bsrc.GetOrg().IsSetTaxname() ||
-        (!NStr::Equal(bsrc.GetOrg().GetTaxname(), "HIV-1") &&
-         !NStr::Equal(bsrc.GetOrg().GetTaxname(), "HIV-2"))) {
+    if (!bsrc.IsSetOrg() || !bsrc.GetOrg().IsSetTaxname()) {
+        return;
+    }
+    string   source_description = bsrc.GetOrg().GetTaxname();
+    x_CleanUpTaxName(source_description);
+    if (!NStr::Equal(source_description, "HIV-1") &&
+        !NStr::Equal(source_description, "HIV-2")) {
         return;
     }
 
@@ -702,37 +615,84 @@ static const SPreferredQual s_PreferredList[] = {
     { CSubSource::eSubtype_pop_variant, false } ,
     { CSubSource::eSubtype_segment, false } ,
     { CSubSource::eSubtype_subclone, false } ,
+    { CSubSource::eSubtype_other, false } ,
+    { COrgMod::eSubtype_other, true } ,
 };
 
 
 static const size_t kNumPreferred = sizeof(s_PreferredList) / sizeof (SPreferredQual);
 
+void CAutoDefModifierCombo::GetAvailableModifiers(CAutoDefSourceDescription::TAvailableModifierVector &modifier_list)
+{
+    size_t k;
+
+    // first, set up modifier list with blanks
+    modifier_list.clear();
+
+    for (k = 0; k < kNumPreferred; k++) {
+        if (s_PreferredList[k].is_orgmod) {
+            modifier_list.push_back(CAutoDefAvailableModifier((COrgMod::ESubtype)s_PreferredList[k].subtype, true));
+        } else {
+            modifier_list.push_back(CAutoDefAvailableModifier((CSubSource::ESubtype)s_PreferredList[k].subtype, false));
+        }
+    }
+
+    for (k = 0; k < m_GroupList.size(); k++) {
+        m_GroupList[k]->GetAvailableModifiers(modifier_list);
+    }
+}
+
+
+bool CAutoDefModifierCombo::IsUsableInDefline(CSubSource::ESubtype subtype)
+{
+    size_t k;
+    for (k = 0; k < kNumPreferred; k++) {
+        if (!s_PreferredList[k].is_orgmod && (CSubSource::ESubtype)s_PreferredList[k].subtype == subtype) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
+bool CAutoDefModifierCombo::IsUsableInDefline(COrgMod::ESubtype subtype)
+{
+    size_t k;
+    for (k = 0; k < kNumPreferred; k++) {
+        if (s_PreferredList[k].is_orgmod && (COrgMod::ESubtype)s_PreferredList[k].subtype == subtype) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
 bool CAutoDefModifierCombo::IsModifierRequiredByDefault(bool is_orgmod, int subtype)
 {
     bool rval = false;
-    if (is_orgmod) {
-        rval = false;
+if (is_orgmod) {
+    rval = false;
+} else {
+    if (subtype == CSubSource::eSubtype_endogenous_virus_name ||
+        subtype == CSubSource::eSubtype_plasmid_name ||
+        subtype == CSubSource::eSubtype_transgenic) {
+        rval = true;
     } else {
-        if (subtype == CSubSource::eSubtype_endogenous_virus_name ||
-            subtype == CSubSource::eSubtype_plasmid_name ||
-            subtype == CSubSource::eSubtype_transgenic) {
-            rval = true;
-        } else {
-            rval = false;
-        }
+        rval = false;
     }
-    return rval;
+}
+return rval;
 }
 
 
-string CAutoDefModifierCombo::GetSourceDescriptionString (const CBioSource& bsrc) 
+string CAutoDefModifierCombo::GetSourceDescriptionString(const CBioSource& bsrc)
 {
     unsigned int k;
     string       source_description = "";
     map<COrgMod::ESubtype, bool> orgmods;
     map<CSubSource::ESubtype, bool> subsrcs;
     bool no_extras = false;
-    
+
     /* start with tax name */
     source_description += bsrc.GetOrg().GetTaxname();
     x_CleanUpTaxName(source_description);
@@ -772,7 +732,7 @@ string CAutoDefModifierCombo::GetSourceDescriptionString (const CBioSource& bsrc
             no_extras = true;
         }
     }
-    
+
     if (!no_extras) {
         if (bsrc.CanGetOrigin() && bsrc.GetOrigin() == CBioSource::eOrigin_mut) {
             source_description = "Mutant " + source_description;
@@ -800,16 +760,60 @@ string CAutoDefModifierCombo::GetSourceDescriptionString (const CBioSource& bsrc
                 x_AddOrgModString(source_description, bsrc, (COrgMod::ESubtype)s_PreferredList[k].subtype);
             }
         } else {
-            if (subsrcs.find((CSubSource::ESubtype)s_PreferredList[k].subtype) != subsrcs.end()) { 
+            if (subsrcs.find((CSubSource::ESubtype)s_PreferredList[k].subtype) != subsrcs.end()) {
                 x_AddSubsourceString(source_description, bsrc, (CSubSource::ESubtype)s_PreferredList[k].subtype);
             }
         }
     }
+
+    // add maxicircle/minicircle
+    x_AddMinicircle(source_description, bsrc);
     
     return source_description;
 }
 
 
+bool CAutoDefModifierCombo::x_AddMinicircle(string& source_description, const string& note_text)
+{
+    bool any_change = false;
+    vector<CTempString> tokens;
+    NStr::Tokenize(note_text, ";", tokens);
+    ITERATE(vector<CTempString>, t, tokens) {
+        if (NStr::Find(*t, "maxicircle") != string::npos ||
+            NStr::Find(*t, "minicircle") != string::npos) {
+            string add = *t;
+            NStr::TruncateSpacesInPlace(add);
+            source_description += " " + add;
+            any_change = true;
+        }
+    }
+    return any_change;
+}
+
+
+bool CAutoDefModifierCombo::x_AddMinicircle(string& source_description, const CBioSource& bsrc)
+{
+    bool any_change = false;
+    if (bsrc.IsSetSubtype()) {
+        ITERATE(CBioSource::TSubtype, it, bsrc.GetSubtype()) {
+            if ((*it)->IsSetSubtype() && (*it)->IsSetName() &&
+                (*it)->GetSubtype() == CSubSource::eSubtype_other) {
+                any_change |= x_AddMinicircle(source_description, (*it)->GetName());
+            }
+        }
+    }
+    if (bsrc.IsSetOrg() && bsrc.GetOrg().IsSetOrgname() && bsrc.GetOrg().GetOrgname().IsSetMod()) {
+        ITERATE(COrgName::TMod, it, bsrc.GetOrg().GetOrgname().GetMod()) {
+            if ((*it)->IsSetSubtype() && (*it)->IsSetSubname() &&
+                (*it)->GetSubtype() == COrgMod::eSubtype_other) {
+                any_change |= x_AddMinicircle(source_description, (*it)->GetSubname());
+            }
+        }
+    }
+    return any_change;
+}
+
+
 unsigned int CAutoDefModifierCombo::GetNumUnique () const
 {
     unsigned int num = 0;
diff --git a/c++/src/objtools/edit/autodef_options.cpp b/c++/src/objtools/edit/autodef_options.cpp
index 8de2f63..d1a613a 100644
--- a/c++/src/objtools/edit/autodef_options.cpp
+++ b/c++/src/objtools/edit/autodef_options.cpp
@@ -1,4 +1,4 @@
-/*  $Id: autodef_options.cpp 483235 2015-10-29 14:22:28Z ivanov $
+/*  $Id: autodef_options.cpp 499840 2016-04-28 16:08:14Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -67,9 +67,13 @@ CRef<CUser_object> CAutoDefOptions::MakeUserObject() const
     user->SetData().push_back(x_MakeHIVRule());
     if (!GetSpecifyNuclearProduct()) {
         user->SetData().push_back(x_MakeProductFlag());
+        user->SetData().push_back(x_MakeNuclearCopyFlag());
     }
     x_MakeSuppressedFeatures(*user);
     x_MakeModifierList(*user);
+    if (!NStr::IsBlank(m_TargetedLocusName)) {
+        user->SetData().push_back(x_MakeTargetedLocusName());
+    }
 
     return user;
 }
@@ -85,18 +89,31 @@ CRef<CUser_object> CAutoDefOptions::MakeUserObject() const
 void CAutoDefOptions::InitFromUserObject(const CUser_object& obj)
 {
     x_Reset();
-
+    m_BooleanFlags[eOptionFieldType_SpecifyNuclearProduct] = false;
     ITERATE(CUser_object::TData, it, obj.GetData()) {
         if ((*it)->IsSetLabel() && (*it)->GetLabel().IsStr()) {}
         TFieldType field_type = GetFieldType((*it)->GetLabel().GetStr());
+        if (field_type == eOptionFieldType_Unknown && NStr::EqualNocase((*it)->GetLabel().GetStr(), "KeepPromoters")) {
+            field_type = eOptionFieldType_KeepRegulatoryFeatures;
+        }
         if (field_type != eOptionFieldType_Unknown) {
             if (x_IsBoolean(field_type)) {
                 if ((*it)->IsSetData() && (*it)->GetData().IsBool() && (*it)->GetData().GetBool()) {
                     m_BooleanFlags[field_type] = true;
                 }
+            } else if (field_type == eOptionFieldType_SpecifyNuclearProduct &&
+                       (*it)->GetData().IsBool() && (*it)->GetData().GetBool()) {
+                m_BooleanFlags[eOptionFieldType_SpecifyNuclearProduct] = true;
             } else if (field_type == eOptionFieldType_ProductFlag) {
                 if ((*it)->IsSetData() && (*it)->GetData().IsStr()) { 
                     m_ProductFlag = GetProductFlag((*it)->GetData().GetStr());
+                    m_NuclearCopyFlag = CBioSource::eGenome_unknown;
+                    m_BooleanFlags[eOptionFieldType_SpecifyNuclearProduct] = false;
+                }
+            } else if (field_type == eOptionFieldType_NuclearCopyFlag) {
+                if ((*it)->IsSetData() && (*it)->GetData().IsStr()) {
+                    m_NuclearCopyFlag = GetProductFlag((*it)->GetData().GetStr());
+                    m_ProductFlag = CBioSource::eGenome_unknown;
                     m_BooleanFlags[eOptionFieldType_SpecifyNuclearProduct] = false;
                 }
             INITENUMFIELD(FeatureListType)
@@ -111,6 +128,10 @@ void CAutoDefOptions::InitFromUserObject(const CUser_object& obj)
                 }
             } else if (field_type == eOptionFieldType_ModifierList) {
                 x_SetModifierList(**it);
+            } else if (field_type == eOptionFieldType_TargetedLocusName) {
+                if ((*it)->IsSetData() && (*it)->GetData().IsStr()) {
+                    m_TargetedLocusName = (*it)->GetString();
+                }
             }
         }
     }
@@ -122,6 +143,7 @@ void CAutoDefOptions::x_Reset()
     m_FeatureListType = eListAllFeatures;
     m_MiscFeatRule = eNoncodingProductFeat;
     m_ProductFlag = CBioSource::eGenome_unknown;
+    m_NuclearCopyFlag = CBioSource::eGenome_unknown;
     m_HIVRule = eWantBoth;
     m_MaxMods = -99;
 
@@ -155,13 +177,14 @@ const TNameValPair sc_FieldTypes[] = {
         { "KeepLTRs", CAutoDefOptions::eOptionFieldType_KeepLTRs },
         { "KeepMobileElements", CAutoDefOptions::eOptionFieldType_KeepMobileElements },
         { "KeepPrecursorRNA", CAutoDefOptions::eOptionFieldType_KeepPrecursorRNA },
-        { "KeepPromoters", CAutoDefOptions::eOptionFieldType_KeepPromoters },
+        { "KeepRegulatoryFeatures", CAutoDefOptions::eOptionFieldType_KeepRegulatoryFeatures },
         { "KeepRepeatRegion", CAutoDefOptions::eOptionFieldType_KeepRepeatRegion },
         { "KeepuORFs", CAutoDefOptions::eOptionFieldType_KeepuORFs },
         { "LeaveParenthetical", CAutoDefOptions::eOptionFieldType_LeaveParenthetical },
         { "MaxMods", CAutoDefOptions::eOptionFieldType_MaxMods },
         { "MiscFeatRule", CAutoDefOptions::eOptionFieldType_MiscFeatRule },
         { "ModifierList", CAutoDefOptions::eOptionFieldType_ModifierList },
+        { "NuclearCopyFlag", CAutoDefOptions::eOptionFieldType_NuclearCopyFlag },
         { "ProductFlag", CAutoDefOptions::eOptionFieldType_ProductFlag },
         { "SpecifyNuclearProduct", CAutoDefOptions::eOptionFieldType_SpecifyNuclearProduct },
         { "SuppressAlleles", CAutoDefOptions::eOptionFieldType_SuppressAlleles },
@@ -169,6 +192,7 @@ const TNameValPair sc_FieldTypes[] = {
         { "SuppressFeatureAltSplice", CAutoDefOptions::eOptionFieldType_SuppressFeatureAltSplice },
         { "SuppressLocusTags", CAutoDefOptions::eOptionFieldType_SuppressLocusTags },
         { "SuppressMobileElementSubfeatures", CAutoDefOptions::eOptionFieldType_SuppressMobileElementSubfeatures },
+        { "Targeted Locus Name", CAutoDefOptions::eOptionFieldType_TargetedLocusName },
         { "UseFakePromoters", CAutoDefOptions::eOptionFieldType_UseFakePromoters },
         { "UseLabels", CAutoDefOptions::eOptionFieldType_UseLabels },
         { "UseNcRNAComment", CAutoDefOptions::eOptionFieldType_UseNcRNAComment }
@@ -241,6 +265,19 @@ CBioSource::TGenome CAutoDefOptions::GetProductFlag(const string& value) const
 }
 
 
+string CAutoDefOptions::GetNuclearCopyFlag(CBioSource::TGenome value) const
+{
+    return CBioSource::GetOrganelleByGenome(value);
+}
+
+
+CBioSource::TGenome CAutoDefOptions::GetNuclearCopyFlag(const string& value) const
+{
+    return CBioSource::GetGenomeByOrganelle(value);
+}
+
+
+
 bool CAutoDefOptions::x_IsBoolean(TFieldType field_type) const
 {
     bool rval = true;
@@ -250,9 +287,11 @@ bool CAutoDefOptions::x_IsBoolean(TFieldType field_type) const
         case eOptionFieldType_FeatureListType:
         case eOptionFieldType_MiscFeatRule:
         case eOptionFieldType_ProductFlag:
+        case eOptionFieldType_NuclearCopyFlag:
         case eOptionFieldType_SuppressedFeatures:
         case eOptionFieldType_ModifierList:
         case eOptionFieldType_MaxMods:
+        case eOptionFieldType_TargetedLocusName:
             rval = false;
             break;
         default:
@@ -376,9 +415,15 @@ void CAutoDefOptions::x_MakeModifierList(CUser_object& user) const
     if (!m_SubSources.empty()) {
         CRef<CUser_field> subsources(new CUser_field());
         subsources->SetLabel().SetStr(kSubSources);
+        vector<string> vals;
         ITERATE(TSubSources, it, m_SubSources) {
-            string val = CSubSource::GetSubtypeName(*it);
-            subsources->SetData().SetStrs().push_back(val);
+            vals.push_back(CSubSource::GetSubtypeName(*it));
+        }
+        sort(vals.begin(), vals.end());
+        vector<string>::iterator sort_it = std::unique(vals.begin(), vals.end());
+        vals.resize(distance(vals.begin(), sort_it));
+        ITERATE(vector<string>, it, vals) {
+            subsources->SetData().SetStrs().push_back(*it);
         }
         field->SetData().SetFields().push_back(subsources);
     }
@@ -386,9 +431,15 @@ void CAutoDefOptions::x_MakeModifierList(CUser_object& user) const
     if (!m_OrgMods.empty()) {
         CRef<CUser_field> orgmods(new CUser_field());
         orgmods->SetLabel().SetStr(kOrgMods);
+        vector<string> vals;
         ITERATE(TOrgMods, it, m_OrgMods) {
-            string val = COrgMod::GetSubtypeName(*it);
-            orgmods->SetData().SetStrs().push_back(val);
+            vals.push_back(COrgMod::GetSubtypeName(*it));
+        }
+        sort(vals.begin(), vals.end());
+        vector<string>::iterator sort_it = std::unique(vals.begin(), vals.end());
+        vals.resize(distance(vals.begin(), sort_it));
+        ITERATE(vector<string>, it, vals) {
+            orgmods->SetData().SetStrs().push_back(*it);
         }
         field->SetData().SetFields().push_back(orgmods);
     }
@@ -435,5 +486,15 @@ CRef<CUser_field> CAutoDefOptions::x_MakeMaxMods() const
 }
 
 
+CRef<CUser_field> CAutoDefOptions::x_MakeTargetedLocusName() const
+{
+    CRef<CUser_field> field(new CUser_field());
+    field->SetLabel().SetStr(GetFieldType(eOptionFieldType_TargetedLocusName));
+    field->SetData().SetStr(m_TargetedLocusName);
+    return field;
+}
+
+
+
 END_SCOPE(objects)
 END_NCBI_SCOPE
diff --git a/c++/src/objtools/edit/capitalization_string.cpp b/c++/src/objtools/edit/capitalization_string.cpp
index 1803153..78e42f5 100644
--- a/c++/src/objtools/edit/capitalization_string.cpp
+++ b/c++/src/objtools/edit/capitalization_string.cpp
@@ -1,4 +1,4 @@
-/*  $Id: capitalization_string.cpp 458478 2015-02-05 15:31:46Z filippov $
+/*  $Id: capitalization_string.cpp 490174 2016-01-21 20:09:56Z asztalos $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -765,7 +765,8 @@ bool FixStateAbbreviationsInCitSub(CCit_sub& sub)
             if (NStr::CompareNocase(country, "United States of America") == 0 ||
                 NStr::CompareNocase(country, "United States") == 0 ||
                 NStr::CompareNocase(country, "U.S.A.") == 0 ||
-                NStr::CompareNocase(country, "U S A") == 0 ) 
+                NStr::CompareNocase(country, "U S A") == 0 ||
+                NStr::CompareNocase(country, "US") == 0) 
             {
                 std.SetCountry("USA");
                 modified = true;
diff --git a/c++/src/objtools/edit/cds_fix.cpp b/c++/src/objtools/edit/cds_fix.cpp
index e3b69b8..6bc97b5 100644
--- a/c++/src/objtools/edit/cds_fix.cpp
+++ b/c++/src/objtools/edit/cds_fix.cpp
@@ -1,4 +1,4 @@
-/*  $Id: cds_fix.cpp 480562 2015-10-01 16:51:28Z ivanov $
+/*  $Id: cds_fix.cpp 499445 2016-04-26 14:17:08Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -786,44 +786,11 @@ CRef<CGenetic_code> GetGeneticCodeForBioseq(CBioseq_Handle bh)
     }
     CSeqdesc_CI src(bh, CSeqdesc::e_Source);
     if (src && src->GetSource().IsSetOrg() && src->GetSource().GetOrg().IsSetOrgname()) {
-        if (src->GetSource().IsSetGenome()) {
-            switch (src->GetSource().GetGenome()) {
-                case CBioSource::eGenome_mitochondrion:
-                case CBioSource::eGenome_kinetoplast:
-                case CBioSource::eGenome_hydrogenosome:
-                    if (src->GetSource().IsSetMgcode()) {
-                        code.Reset(new CGenetic_code());
-                        code->SetId(src->GetSource().GetMgcode());
-                    }
-                    break;
-                case CBioSource::eGenome_chloroplast:
-                case CBioSource::eGenome_chromoplast:
-                case CBioSource::eGenome_plasmid:
-                case CBioSource::eGenome_cyanelle:
-                case CBioSource::eGenome_apicoplast:
-                case CBioSource::eGenome_leucoplast:
-                case CBioSource::eGenome_proplastid:
-                case CBioSource::eGenome_chromatophore:
-                    if (src->GetSource().IsSetPgcode()) {
-                        code.Reset(new CGenetic_code());
-                        code->SetId(src->GetSource().GetPgcode());
-                    } else {
-                        code.Reset(new CGenetic_code());
-                        code->SetId(11);
-                    }
-                    break;
-                default:
-                    if (src->GetSource().IsSetGcode()) {
-                        code.Reset(new CGenetic_code());
-                        code->SetId(src->GetSource().GetGcode());
-                    }
-                    break;
-            }
-        } else {
-            if (src->GetSource().IsSetGcode()) {
-                code.Reset(new CGenetic_code());
-                code->SetId(src->GetSource().GetGcode());
-            }
+        const CBioSource & bsrc = src->GetSource();
+        int bioseqGenCode = bsrc.GetGenCode(0);
+        if (bioseqGenCode > 0) {
+            code.Reset(new CGenetic_code());
+            code->SetId(bioseqGenCode);
         }
     }
     return code;
diff --git a/c++/src/objtools/edit/feattable_edit.cpp b/c++/src/objtools/edit/feattable_edit.cpp
index 1ba2ce6..ad6bfa7 100644
--- a/c++/src/objtools/edit/feattable_edit.cpp
+++ b/c++/src/objtools/edit/feattable_edit.cpp
@@ -1,4 +1,4 @@
-/*  $Id: feattable_edit.cpp 478464 2015-09-09 15:29:44Z ivanov $
+/*  $Id: feattable_edit.cpp 498135 2016-04-13 17:19:58Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -33,8 +33,11 @@
 #include <ncbi_pch.hpp>
 
 #include <objects/general/Object_id.hpp>
+#include <objects/seqfeat/Seq_feat.hpp>
+#include <objects/seqfeat/RNA_ref.hpp>
 #include <objects/seqfeat/Feat_id.hpp>
 #include <objects/seqfeat/Gb_qual.hpp>
+#include <objects/seqfeat/SeqFeatXref.hpp>
 
 #include <objmgr/object_manager.hpp>
 #include <objmgr/scope.hpp>
@@ -42,7 +45,6 @@
 #include <objmgr/util/sequence.hpp>
 #include <objmgr/util/feature.hpp>
 
-#include <objtools/edit/cds_fix.hpp>
 #include <objtools/edit/loc_edit.hpp>
 #include <objtools/edit/feattable_edit.hpp>
 
@@ -61,6 +63,41 @@ const string str)
     return pProduct;
 }
 
+//  ----------------------------------------------------------------------------
+string sGetCdsProductName (
+    const CSeq_feat& cds, 
+    CScope& scope)
+//  ----------------------------------------------------------------------------
+{
+    string productName;
+    if (cds.IsSetProduct()) {
+        CBioseq_Handle bsh = sequence::GetBioseqFromSeqLoc(cds.GetProduct(), scope);
+        if (bsh) {
+            CFeat_CI protCi(bsh, CSeqFeatData::e_Prot);
+            if (protCi) {
+                const CProt_ref& prot = protCi->GetOriginalFeature().GetData().GetProt();
+                if (prot.IsSetName() && prot.GetName().size() > 0) {
+                    productName = prot.GetName().front();
+                }
+            }
+            return productName;
+        }  
+    } 
+    if (cds.IsSetXref()) {
+        ITERATE(CSeq_feat::TXref, it, cds.GetXref()) {
+            const CSeqFeatXref& xref = **it;
+            if (xref.IsSetData() && xref.GetData().IsProt()) {
+                const CProt_ref& prot = xref.GetData().GetProt();
+                if (prot.IsSetName() && prot.GetName().size() > 0) {
+                    productName = prot.GetName().front();
+                }
+            }
+            return productName;
+        }
+    }
+    return productName;
+}
+
 //  -------------------------------------------------------------------------
 CFeatTableEdit::CFeatTableEdit(
     CSeq_annot& annot,
@@ -89,7 +126,14 @@ CFeatTableEdit::~CFeatTableEdit()
 };
 
 //  -------------------------------------------------------------------------
-void CFeatTableEdit::InferParentMrnas()
+void CFeatTableEdit::GenerateMissingGeneForCds()
+//  -------------------------------------------------------------------------
+{
+    xGenerateMissingGeneForSubtype(CSeqFeatData::eSubtype_cdregion);
+}
+
+//  -------------------------------------------------------------------------
+void CFeatTableEdit::GenerateMissingMrnaForCds()
 //  -------------------------------------------------------------------------
 {
     SAnnotSelector sel;
@@ -97,13 +141,29 @@ void CFeatTableEdit::InferParentMrnas()
     CFeat_CI it(mHandle, sel);
     for ( ; it; ++it) {
         const CSeq_feat& cds = it->GetOriginalFeature();
-        CRef<CSeq_feat> pRna = edit::MakemRNAforCDS(cds, *mpScope);
-        if (!pRna) {
+        CConstRef<CSeq_feat> pOverlappingRna =
+            sequence::GetBestOverlappingFeat(
+                cds.GetLocation(),
+                CSeqFeatData::e_Rna,
+                sequence::eOverlap_CheckIntRev,
+                *mpScope);
+        if (pOverlappingRna) {
             continue;
         }
+        //CRef<CSeq_feat> pRna = edit::MakemRNAforCDS(cds, *mpScope);
+        //if (!pRna) {
+        //    //should never happen!
+        //    continue;
+        //}
+        CRef<CSeq_feat> pRna(new CSeq_feat);
+        pRna->SetData().SetRna().SetType(CRNA_ref::eType_mRNA);
+        pRna->SetLocation().Assign(cds.GetLocation());
         pRna->SetLocation().SetPartialStart(false, eExtreme_Positional);
         pRna->SetLocation().SetPartialStop(false, eExtreme_Positional);
         pRna->ResetPartial();
+        //product name
+        pRna->SetData().SetRna().SetExt().SetName(
+            sGetCdsProductName(cds, *mpScope));
         //find proper name for rna
         string rnaId(xNextFeatId());
         pRna->SetId().SetLocal().SetStr(rnaId);
@@ -112,45 +172,29 @@ void CFeatTableEdit::InferParentMrnas()
         feh.AddFeatXref(rnaId);
         //add new rna to feature table
         mEditHandle.AddFeat(*pRna);
+        mTree.AddFeature(mpScope->GetObjectHandle(*pRna));
     }
 }
 
+//  -------------------------------------------------------------------------
+void CFeatTableEdit::InferParentMrnas()
+//  -------------------------------------------------------------------------
+{
+    GenerateMissingMrnaForCds();
+}
+
+//  ---------------------------------------------------------------------------
+void CFeatTableEdit::GenerateMissingGeneForMrna()
+//  ---------------------------------------------------------------------------
+{
+    xGenerateMissingGeneForSubtype(CSeqFeatData::eSubtype_mRNA);
+}
+
 //  ---------------------------------------------------------------------------
 void CFeatTableEdit::InferParentGenes()
 //  ---------------------------------------------------------------------------
 {
-    SAnnotSelector sel;
-    sel.IncludeFeatSubtype(CSeqFeatData::eSubtype_mRNA);
-    CFeat_CI it(mHandle, sel);
-    for ( ; it; ++it) {
-        CMappedFeat rna = *it;
-        CRef<CSeq_feat> pGene = xMakeGeneForMrna(rna);
-        if (!pGene) {
-            if (!rna.IsSetPartial() ||  !rna.GetPartial()) {
-                continue;
-            }
-            CMappedFeat parentGene = feature::GetBestGeneForMrna(rna); 
-            if (parentGene  &&  
-                    !(parentGene.IsSetPartial()  &&  parentGene.GetPartial())) {
-                CRef<CSeq_feat> pEditedGene(new CSeq_feat);
-                pEditedGene->Assign(parentGene.GetOriginalFeature());
-                pEditedGene->SetPartial(true);
-                CSeq_feat_EditHandle geneEh(
-                    mpScope->GetObjectHandle(parentGene.GetOriginalFeature()));
-                geneEh.Replace(*pEditedGene);
-            }
-            continue;
-        }
-        //find proper name for gene
-        string geneId(xNextFeatId());
-        pGene->SetId().SetLocal().SetStr(geneId);
-        //add gene xref to rna
-        CSeq_feat_EditHandle feh(
-            mpScope->GetObjectHandle(rna.GetOriginalFeature()));
-        feh.AddFeatXref(geneId);
-        //add new gene to feature table
-        mEditHandle.AddFeat(*pGene);
-    }
+    GenerateMissingGeneForMrna();
 }
 
 //  ----------------------------------------------------------------------------
@@ -283,6 +327,47 @@ void CFeatTableEdit::GenerateProteinAndTranscriptIds()
     }
 }
 
+//  ---------------------------------------------------------------------------
+void CFeatTableEdit::xGenerateMissingGeneForSubtype(
+    CSeqFeatData::ESubtype subType)
+//  ---------------------------------------------------------------------------
+{
+    SAnnotSelector sel;
+    sel.IncludeFeatSubtype(subType);
+    CFeat_CI it(mHandle, sel);
+    for ( ; it; ++it) {
+        CMappedFeat mf = *it;
+        CRef<CSeq_feat> pGene = xMakeGeneForFeature(mf);
+        if (pGene) {
+            // missing gene was created. make it fit and add to table:
+            string geneId(xNextFeatId());
+            pGene->SetId().SetLocal().SetStr(geneId);
+            CSeq_feat_EditHandle feh(
+                mpScope->GetObjectHandle(mf.GetOriginalFeature()));
+            feh.AddFeatXref(geneId);
+            mEditHandle.AddFeat(*pGene);
+            mTree.AddFeature(mpScope->GetObjectHandle(*pGene));
+        }
+        else {
+            // gene wasn't missing. just adjust partialness if necessary:
+            if (!mf.IsSetPartial()  ||  !mf.GetPartial()) {
+                continue;
+            }
+            CMappedFeat parentGene = feature::GetBestGeneForFeat(mf, &mTree);
+            //assert(parentGene); //we would not be "else" if not
+            if (parentGene.IsSetPartial()  &&  parentGene.GetPartial()) {
+                continue;
+            }
+            CRef<CSeq_feat> pEditedGene(new CSeq_feat);
+            pEditedGene->Assign(parentGene.GetOriginalFeature());
+            pEditedGene->SetPartial(true);
+            CSeq_feat_EditHandle geneEH(
+                mpScope->GetObjectHandle(parentGene.GetOriginalFeature()));
+            geneEH.Replace(*pEditedGene);
+        }        
+    }
+}
+
 //  ----------------------------------------------------------------------------
 void CFeatTableEdit::xFeatureAddProteinId(
     CMappedFeat mf)
@@ -300,7 +385,6 @@ void CFeatTableEdit::xFeatureAddProteinId(
     }
     CMappedFeat associateFeat;
 
-    CSeqFeatData::ESubtype s = mf.GetFeatSubtype();
     switch (mf.GetFeatSubtype()) {
         default:
             // we do this only for select feature types
@@ -338,7 +422,6 @@ void CFeatTableEdit::xFeatureAddTranscriptId(
     }
     CMappedFeat associateFeat;
 
-    CSeqFeatData::ESubtype s = mf.GetFeatSubtype();
     switch (mf.GetFeatSubtype()) {
     default:
         // we do this only for select feature types
@@ -400,23 +483,17 @@ void CFeatTableEdit::xGenerateLocusIdsRegenerate()
     selOthers.ExcludeFeatSubtype(CSeqFeatData::eSubtype_gene);
     for (CFeat_CI it(mHandle, selOthers); it; ++it) {
         CMappedFeat mf = *it;
-        const CSeq_feat& f = mf.GetOriginalFeature();
         CSeq_feat_EditHandle feh(mf);
 
-        //feh.RemoveQualifier("locus_tag");
-        //feh.RemoveQualifier("protein_id");
         feh.RemoveQualifier("orig_protein_id");
-        //feh.RemoveQualifier("transcript_id");
         feh.RemoveQualifier("orig_transcript_id");
 
         CSeqFeatData::ESubtype subtype = mf.GetFeatSubtype();
         switch (subtype) {
             case CSeqFeatData::eSubtype_mRNA: {
                 string proteinId = xNextProteinId(mf);
-                //feh.AddQualifier("protein_id", proteinId);
                 feh.AddQualifier("orig_protein_id", proteinId);
                 string transcriptId = xNextTranscriptId(mf);
-                //feh.AddQualifier("transcript_id", transcriptId);
                 feh.AddQualifier("orig_transcript_id", transcriptId);
                 break;
             }
@@ -519,7 +596,6 @@ void CFeatTableEdit::GenerateLocusTags()
     //  to the features that live on them when we generate a flat file,
     //  but we don't want them here in the ASN.1
 	for ( ; itOther; ++itOther) {
-        const CSeq_feat& feat = itOther->GetOriginalFeature();		
         CSeq_feat_EditHandle feh(mpScope->GetObjectHandle(
             (itOther)->GetOriginalFeature()));
 		feh.RemoveQualifier("locus_tag");
@@ -577,7 +653,9 @@ string CFeatTableEdit::xNextProteinId(
 	const CMappedFeat& mf)
 //	----------------------------------------------------------------------------
 {
-	// format: mLocusTagPrefix|<locus tag of gene>[_numeric disambiguation]
+    const string dbPrefix("gnl|");
+
+    // format: mLocusTagPrefix|<locus tag of gene>[_numeric disambiguation]
     CMappedFeat parentGene = feature::GetBestGeneForFeat(mf, &mTree);
     if (!parentGene) {
 		return "";
@@ -592,7 +670,7 @@ string CFeatTableEdit::xNextProteinId(
 		++mMapProtIdCounts[locusTag];
 		disAmbig = string("_") + NStr::IntToString(mMapProtIdCounts[locusTag]);
 	}
-	return (mLocusTagPrefix + "|" + locusTag + disAmbig);
+    return (dbPrefix + mLocusTagPrefix + "|" + locusTag + disAmbig);
 }
 
 //	----------------------------------------------------------------------------
@@ -600,6 +678,8 @@ string CFeatTableEdit::xNextTranscriptId(
 	const CMappedFeat& cds)
 //	----------------------------------------------------------------------------
 {
+    const string dbPrefix("gnl|");
+
 	// format: mLocusTagPrefix|mrna.<locus tag of gene>[_numeric disambiguation]
 	CMappedFeat parentGene = feature::GetBestGeneForFeat(cds, &mTree);
     if (!parentGene) {
@@ -611,11 +691,11 @@ string CFeatTableEdit::xNextTranscriptId(
 	if (it != mMapProtIdCounts.end()  &&  mMapProtIdCounts[locusTag] != 0) {
 		disAmbig = string("_") + NStr::IntToString(mMapProtIdCounts[locusTag]);
 	}
-	return (mLocusTagPrefix + "|mrna." + locusTag + disAmbig);
+	return (dbPrefix + mLocusTagPrefix + "|mrna." + locusTag + disAmbig);
 }
 
 //  ----------------------------------------------------------------------------
-CRef<CSeq_feat> CFeatTableEdit::xMakeGeneForMrna(
+CRef<CSeq_feat> CFeatTableEdit::xMakeGeneForFeature(
     const CMappedFeat& rna)
 //  ----------------------------------------------------------------------------
 {
@@ -626,7 +706,7 @@ CRef<CSeq_feat> CFeatTableEdit::xMakeGeneForMrna(
     if (!sah) {
         return pGene;
     }
-    CMappedFeat existingGene = feature::GetBestGeneForMrna(rna, &mTree);
+    CMappedFeat existingGene = feature::GetBestGeneForFeat(rna, &mTree);
     if (existingGene) {
         return pGene;
     }
diff --git a/c++/src/objtools/edit/field_handler.cpp b/c++/src/objtools/edit/field_handler.cpp
index 32ab4a5..b7e64fb 100644
--- a/c++/src/objtools/edit/field_handler.cpp
+++ b/c++/src/objtools/edit/field_handler.cpp
@@ -1,4 +1,4 @@
-/*  $Id: field_handler.cpp 481033 2015-10-06 16:46:10Z ivanov $
+/*  $Id: field_handler.cpp 488758 2016-01-05 17:44:28Z asztalos $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -245,8 +245,10 @@ vector<CConstRef<CSeq_feat> > GetRelatedFeatures (const CSeq_feat& obj_feat, CSe
         // examine objects on protein sequence
         // need to find coding region for obj_feat
         if (obj_type == CSeqFeatData::eSubtype_cdregion) {
-            CBioseq_Handle p_bsh = scope->GetBioseqHandle(obj_feat.GetProduct());
-            feat_list = s_GetProtFeatures(p_bsh, constraint_type);
+            if (obj_feat.IsSetProduct()) {
+                CBioseq_Handle p_bsh = scope->GetBioseqHandle(obj_feat.GetProduct());
+                feat_list = s_GetProtFeatures(p_bsh, constraint_type);
+            }
         } else if (obj_type == CSeqFeatData::eSubtype_mRNA) {
             const CSeq_feat* cds = sequence::GetBestCdsForMrna(obj_feat, *scope);
             if (cds) {
diff --git a/c++/src/objtools/edit/loc_edit.cpp b/c++/src/objtools/edit/loc_edit.cpp
index 6828ddd..f5da4e8 100644
--- a/c++/src/objtools/edit/loc_edit.cpp
+++ b/c++/src/objtools/edit/loc_edit.cpp
@@ -1,4 +1,4 @@
-/*  $Id: loc_edit.cpp 472216 2015-07-08 13:39:11Z ivanov $
+/*  $Id: loc_edit.cpp 499445 2016-04-26 14:17:08Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -208,7 +208,7 @@ string SeqLocPrintUseBestID(const CSeq_loc& seq_loc, CScope& scope, bool range_o
 }
 
 
-bool s_Is5AtEndOfSeq(const CSeq_loc& loc, CBioseq_Handle bsh)
+bool CLocationEditPolicy::Is5AtEndOfSeq(const CSeq_loc& loc, CBioseq_Handle bsh)
 {
     bool rval = false;
 
@@ -226,7 +226,7 @@ bool s_Is5AtEndOfSeq(const CSeq_loc& loc, CBioseq_Handle bsh)
 }
 
 
-bool s_Is3AtEndOfSeq(const CSeq_loc& loc, CBioseq_Handle bsh)
+bool CLocationEditPolicy::Is3AtEndOfSeq(const CSeq_loc& loc, CBioseq_Handle bsh)
 {
     bool rval = false;
     ENa_strand strand = loc.GetStrand();
@@ -286,13 +286,13 @@ bool CLocationEditPolicy::Interpret5Policy
         case ePartialPolicy_eSet:
             if (!orig_feat.GetLocation().IsPartialStart(eExtreme_Biological)) {
                 do_set_5_partial = true;
-            } else if (m_Extend5 && !s_Is5AtEndOfSeq(loc, bsh)
+            } else if (m_Extend5 && !Is5AtEndOfSeq(loc, bsh)
                        && (bsh || s_Know5WithoutBsh(loc))) {
                 do_set_5_partial = true;
             }
             break;
         case ePartialPolicy_eSetAtEnd:
-            if (s_Is5AtEndOfSeq(loc, bsh) 
+            if (Is5AtEndOfSeq(loc, bsh) 
                 && !orig_feat.GetLocation().IsPartialStart(eExtreme_Biological)
                 && (bsh || s_Know5WithoutBsh(loc))) {
                 do_set_5_partial = true;
@@ -331,7 +331,7 @@ bool CLocationEditPolicy::Interpret5Policy
             break;
         case ePartialPolicy_eClearNotAtEnd:
             if (orig_feat.GetLocation().IsPartialStart(eExtreme_Biological)
-                && !s_Is5AtEndOfSeq(orig_feat.GetLocation(), bsh)
+                && !Is5AtEndOfSeq(orig_feat.GetLocation(), bsh)
                 && (bsh || s_Know5WithoutBsh(loc))) {
                 do_clear_5_partial = true;
             }
@@ -377,13 +377,13 @@ bool CLocationEditPolicy::Interpret3Policy
         case ePartialPolicy_eSet:
             if (!orig_feat.GetLocation().IsPartialStop(eExtreme_Biological)) {
                 do_set_3_partial = true;
-            } else if (m_Extend3 && !s_Is3AtEndOfSeq(loc, bsh) && (bsh || s_Know3WithoutBsh(loc))) {
+            } else if (m_Extend3 && !Is3AtEndOfSeq(loc, bsh) && (bsh || s_Know3WithoutBsh(loc))) {
                 do_set_3_partial = true;
             }
             break;
         case ePartialPolicy_eSetAtEnd:
             if (!orig_feat.GetLocation().IsPartialStop(eExtreme_Biological) 
-                && s_Is3AtEndOfSeq(orig_feat.GetLocation(), bsh)
+                && Is3AtEndOfSeq(orig_feat.GetLocation(), bsh)
                 && (bsh || s_Know3WithoutBsh(loc))) {
                 do_set_3_partial = true;
             }
@@ -415,7 +415,7 @@ bool CLocationEditPolicy::Interpret3Policy
             break;
         case ePartialPolicy_eClearNotAtEnd:
             if (orig_feat.GetLocation().IsPartialStop(eExtreme_Biological)
-                && !s_Is3AtEndOfSeq(orig_feat.GetLocation(), bsh)
+                && !Is3AtEndOfSeq(orig_feat.GetLocation(), bsh)
                 && (bsh || s_Know3WithoutBsh(loc))) {
                 do_clear_3_partial = true;
             }
diff --git a/c++/src/objtools/edit/parse_text_options.cpp b/c++/src/objtools/edit/parse_text_options.cpp
index 9892d13..2d4f221 100644
--- a/c++/src/objtools/edit/parse_text_options.cpp
+++ b/c++/src/objtools/edit/parse_text_options.cpp
@@ -1,4 +1,4 @@
-/*  $Id: parse_text_options.cpp 477904 2015-09-02 15:51:03Z ivanov $
+/*  $Id: parse_text_options.cpp 477678 2015-09-01 13:43:13Z asztalos $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/edit/publication_edit.cpp b/c++/src/objtools/edit/publication_edit.cpp
new file mode 100644
index 0000000..f97b258
--- /dev/null
+++ b/c++/src/objtools/edit/publication_edit.cpp
@@ -0,0 +1,156 @@
+/*  $Id: publication_edit.cpp 493845 2016-03-02 14:05:29Z ivanov $
+* ===========================================================================
+*
+*                            PUBLIC DOMAIN NOTICE
+*               National Center for Biotechnology Information
+*
+*  This software/database is a "United States Government Work" under the
+*  terms of the United States Copyright Act.  It was written as part of
+*  the author's official duties as a United States Government employee and
+*  thus cannot be copyrighted.  This software/database is freely available
+*  to the public for use. The National Library of Medicine and the U.S.
+*  Government have not placed any restriction on its use or reproduction.
+*
+*  Although all reasonable efforts have been taken to ensure the accuracy
+*  and reliability of the software and data, the NLM and the U.S.
+*  Government do not and cannot warrant the performance or results that
+*  may be obtained by using this software or data. The NLM and the U.S.
+*  Government disclaim all warranties, express or implied, including
+*  warranties of performance, merchantability or fitness for any particular
+*  purpose.
+*
+*  Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* Author:  Igor Filippov, Andrea Asztalos
+*
+* File Description:
+*   
+*/
+
+#include <ncbi_pch.hpp>
+#include <objects/general/Name_std.hpp>
+#include <objtools/edit/publication_edit.hpp>
+
+BEGIN_NCBI_SCOPE
+BEGIN_SCOPE(objects)
+BEGIN_SCOPE(edit)
+
+string GetFirstInitial(string input, bool skip_rest)
+{
+    char letter;
+    string inits;
+    string::iterator p = input.begin();
+
+    // skip leading punct
+    while (p != input.end() && !isalpha(*p))
+        p++;
+
+    while (p != input.end()) {
+        if (p != input.end() && isalpha(*p)) {
+            letter = *p;
+            inits += toupper(letter);
+            inits += '.';
+            p++;
+        }
+
+        // skip rest of name
+        if (skip_rest) {
+            while (p != input.end() && isalpha(*p))
+                p++;
+        }
+        else { // skip only subsequent low case letters
+            while (p != input.end() && isalpha(*p) && *p == tolower(*p))
+                p++;
+        }
+
+        bool dash = false;
+        while (p != input.end() && !isalpha(*p)) {
+            if (*p == '-')
+                dash = true;
+            p++;
+        }
+        if (dash)
+            inits += '-';
+    }
+    return NStr::ToUpper(inits);
+}
+
+bool GenerateInitials(CName_std& name)
+{
+    string first_init;
+    if (name.IsSetFirst()) {
+        string first = name.GetFirst();
+        first_init = GetFirstInitial(first, true);
+    }
+
+    string original_init = (name.IsSetInitials()) ? name.GetInitials() : kEmptyStr;
+    if (!NStr::IsBlank(original_init)) {
+        if (NStr::IsBlank(first_init)) {
+            first_init += ".";
+        }
+        first_init += original_init;
+    }
+    if (first_init.empty()) {
+        return false;
+    }
+
+    name.SetInitials(first_init);
+    FixInitials(name);
+    return true;
+}
+
+bool FixInitials(CName_std& name)
+{
+    if (!name.IsSetInitials())
+        return false;
+
+    string first_init;
+    if (name.IsSetFirst()) {
+        string first = name.GetFirst();
+        first_init = GetFirstInitial(first, true);
+    }
+
+    string original_init = name.GetInitials();
+    string middle_init = GetFirstInitial(original_init, false);
+
+    if (!NStr::IsBlank(first_init) && NStr::StartsWith(middle_init, first_init, NStr::eNocase)) {
+        middle_init = middle_init.substr(first_init.length());
+    }
+
+    string init(first_init);
+    if (!NStr::IsBlank(middle_init)) {
+        init.append(middle_init);
+    }
+    if (!NStr::IsBlank(init) && init != original_init) {
+        name.SetInitials(init);
+        return true;
+    }
+    return false;
+}
+
+bool MoveMiddleToFirst(CName_std& name)
+{
+    if (!name.IsSetInitials())
+        return false;
+
+    string initials = name.GetInitials();
+    string first = (name.IsSetFirst()) ? name.GetFirst() : kEmptyStr;
+    SIZE_TYPE dot = NStr::FindNoCase(initials, ".");
+    if (dot != NPOS) {
+        SIZE_TYPE cp = dot;
+        while (isalpha((unsigned char)initials[++cp])) {}
+        string middle = initials.substr(++dot, cp - 2);
+        if (middle.size() > 1) {
+            name.SetFirst(first + " " + middle);
+            return true;
+        }
+    }
+    return false;
+}
+
+
+END_SCOPE(edit)
+END_SCOPE(objects)
+END_NCBI_SCOPE
diff --git a/c++/src/objtools/edit/remote_updater.cpp b/c++/src/objtools/edit/remote_updater.cpp
index e8e5d69..1f82898 100644
--- a/c++/src/objtools/edit/remote_updater.cpp
+++ b/c++/src/objtools/edit/remote_updater.cpp
@@ -1,4 +1,4 @@
-/*  $Id: remote_updater.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: remote_updater.cpp 499431 2016-04-26 14:13:07Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -164,13 +164,18 @@ public:
 
     CRef<CT3Reply> GetOrgReply(const COrg_ref& in_org)
     {
-        string id;
 
+#if 0
+        string id;
         NStr::IntToString(id, in_org.GetTaxId());
         if (in_org.IsSetTaxname())
             id += in_org.GetTaxname();
-
         CRef<CT3Reply>& reply = (*m_cache)[id];
+#else
+        CNcbiStrstream os;
+        os << MSerial_AsnText << in_org;
+        CRef<CT3Reply>& reply = (*m_cache)[os.str()];
+#endif
         if (reply.Empty())
         {
             CTaxon3_request request;
@@ -183,11 +188,16 @@ public:
             request.SetRequest().push_back(rq);
             CRef<CTaxon3_reply> result = m_taxon->SendRequest (request);
             reply = *result->SetReply().begin();
+            if (reply->IsData() && reply->SetData().IsSetOrg())
+            {
+                reply->SetData().SetOrg().ResetSyn();
+            }
+
         }
         else
         {
 #ifdef _DEBUG
-            //cerr << "Using cache for:" << id << endl;
+            //cerr << "Using cache for:" << os.str() << endl;
 #endif
         }
         return reply;
@@ -242,9 +252,6 @@ void CRemoteUpdater::xUpdateOrgTaxname(objects::ILineErrorListener* logger, COrg
     CRef<COrg_ref> new_org = m_taxClient->GetOrg(org, logger);
     if (new_org.NotEmpty())
     {
-        if (new_org->IsSetSyn())
-            new_org->ResetSyn();
-
         org.Assign(*new_org);
     }
 }
@@ -362,30 +369,94 @@ void CRemoteUpdater::xUpdatePubReferences(objects::CSeq_descr& seq_descr)
     }
 }
 
-void CRemoteUpdater::UpdateOrgFromTaxon(objects::ILineErrorListener* logger, objects::CSeq_entry& entry)
+namespace
 {
-    if (entry.IsSet())
+    typedef set<CRef< CSeqdesc >* > TOwnerSet;
+    typedef struct { TOwnerSet owner; CRef<COrg_ref> org_ref; } TOwner;
+    typedef map<string, TOwner > TOrgMap;
+    void _UpdateOrgFromTaxon(objects::ILineErrorListener* logger, objects::CSeq_entry& entry, TOrgMap& m)
     {
-        NON_CONST_ITERATE(CSeq_entry::TSet::TSeq_set, it, entry.SetSet().SetSeq_set())
+        if (entry.IsSet())
         {
-            UpdateOrgFromTaxon(logger, **it);
+            NON_CONST_ITERATE(CSeq_entry::TSet::TSeq_set, it, entry.SetSet().SetSeq_set())
+            {
+                _UpdateOrgFromTaxon(logger, **it, m);
+            }
         }
-    }
 
-    if (!entry.IsSetDescr())
-        return;
+        if (!entry.IsSetDescr())
+            return;
 
-    NON_CONST_ITERATE(CSeq_descr::Tdata, it, entry.SetDescr().Set())
+        NON_CONST_ITERATE(CSeq_descr::Tdata, it, entry.SetDescr().Set())
+        {
+            CRef<CSeqdesc>* owner = &*it;
+            CSeqdesc& desc = **owner;
+            CRef<COrg_ref> org_ref;
+            if (desc.IsOrg())
+            {
+                //xUpdateOrgTaxname(logger, desc.SetOrg());
+                org_ref.Reset(&desc.SetOrg());
+            }
+            else
+            if (desc.IsSource() && desc.GetSource().IsSetOrg())
+            {
+                //xUpdateOrgTaxname(logger, desc.SetSource().SetOrg());
+                org_ref.Reset(&desc.SetSource().SetOrg());
+            }
+            if (org_ref)
+            {
+                string id;
+                CNcbiStrstream os;
+                os << MSerial_AsnText << *org_ref;
+                id = os.str();
+                TOwner& v = m[id];
+                v.owner.insert(owner);
+                v.org_ref = org_ref;
+            }
+        }
+    }
+
+    void xUpdate(TOwnerSet& owner, COrg_ref& org_ref)
     {
-        CSeqdesc& desc = **it;
-        if (desc.IsOrg())
+        NON_CONST_ITERATE(TOwnerSet, owner_it, owner)
         {
-            xUpdateOrgTaxname(logger, desc.SetOrg());
+            if ((**owner_it)->IsOrg())
+            {
+                (**owner_it)->SetOrg(org_ref);
+            }
+            else
+                if ((**owner_it)->IsSource())
+                {
+                    (**owner_it)->SetSource().SetOrg(org_ref);
+                }
         }
-        else
-        if (desc.IsSource() && desc.GetSource().IsSetOrg())
+    }
+}
+void CRemoteUpdater::UpdateOrgFromTaxon(objects::ILineErrorListener* logger, objects::CSeq_entry& entry)
+{   
+    TOrgMap org_to_update;
+
+    _UpdateOrgFromTaxon(logger, entry, org_to_update); 
+    if (org_to_update.empty())
+        return;
+
+    CTaxon3 taxon;
+    taxon.Init();
+
+    NON_CONST_ITERATE(TOrgMap, it, org_to_update)
+    {
+        vector<CRef<COrg_ref> > reflist;
+        reflist.push_back(it->second.org_ref);
+        CRef<CTaxon3_reply> reply = taxon.SendOrgRefList(reflist);
+
+        CTaxon3_reply::TReply::iterator reply_it = reply->SetReply().begin();
         {
-            xUpdateOrgTaxname(logger, desc.SetSource().SetOrg());
+            if ((*reply_it)->IsData() && (*reply_it)->SetData().IsSetOrg())
+            {
+                (*reply_it)->SetData().SetOrg().ResetSyn();
+
+                xUpdate(it->second.owner, (*reply_it)->SetData().SetOrg());
+            }
         }
     }
 }
@@ -438,7 +509,7 @@ CRef<CAuthor> StdAuthorFromMl(const string& val)
 {
     CRef<CAuthor> new_auth(new CAuthor());
     vector<string> tokens;
-    NStr::Tokenize(val, " ", tokens);
+    NStr::Split(val, " ", tokens);
     string suffix = "";
     string init = s_GetInitials(tokens);
     if (NStr::IsBlank(init) && tokens.size() > 1) {
@@ -454,7 +525,7 @@ CRef<CAuthor> StdAuthorFromMl(const string& val)
     if (!NStr::IsBlank(init)) {                
         new_auth->SetName().SetName().SetFirst(init.substr(0, 1));
         vector<string> letters;
-        NStr::Tokenize(init, "", letters);
+        NStr::Split(init, "", letters);
         string initials = NStr::Join(letters, ".");
         new_auth->SetName().SetName().SetInitials(initials);
     }
diff --git a/c++/src/objtools/edit/seq_entry_edit.cpp b/c++/src/objtools/edit/seq_entry_edit.cpp
index 3235b7b..1efc86b 100644
--- a/c++/src/objtools/edit/seq_entry_edit.cpp
+++ b/c++/src/objtools/edit/seq_entry_edit.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seq_entry_edit.cpp 468566 2015-05-26 16:19:06Z filippov $
+/*  $Id: seq_entry_edit.cpp 500378 2016-05-04 13:49:57Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -59,6 +59,10 @@
 #include <objtools/edit/edit_exception.hpp>
 #include <objtools/edit/seq_entry_edit.hpp>
 #include <objtools/edit/loc_edit.hpp>
+
+#include <objtools/edit/gene_utils.hpp>
+#include <objtools/edit/autodef_options.hpp>
+
 #include <set>
 #include <sstream>
 #include <map>
@@ -1370,6 +1374,86 @@ void DivvyUpAlignments(const TVecOfSeqEntryHandles & vecOfSeqEntryHandles)
     }
 }
 
+
+void BioseqSetDescriptorPropagateUp(CBioseq_set_Handle set)
+{
+    if (set.IsEmptySeq_set()) {
+        return;
+    }
+    CConstRef<CBioseq_set> top_set = set.GetCompleteBioseq_set();
+    CRef<CSeq_descr> master(new CSeq_descr());
+    bool first = true;
+    ITERATE(CBioseq_set::TSeq_set, it, top_set->GetSeq_set()) {
+        if ((*it)->IsSetDescr()) {
+            if (first) {
+                ITERATE(CSeq_descr::Tdata, d, (*it)->GetDescr().Get()) {
+                    if (!(*d)->IsTitle() && !(*d)->IsMolinfo() && !(*d)->IsSource()) {
+                        // add to master list
+                        CRef<CSeqdesc> cpy(new CSeqdesc());
+                        cpy->Assign(**d);
+                        master->Set().push_back(cpy);
+                    }
+                }
+                first = false;
+            } else {
+                // remove from master any descriptor not on member
+                CSeq_descr::Tdata::iterator d = master->Set().begin();
+                while (d != master->Set().end()) {
+                    bool found = false;
+                    ITERATE(CSeq_descr::Tdata, s, (*it)->GetDescr().Get()) {
+                        if ((*d)->Equals(**s)) {
+                            found = true;
+                            break;
+                        }
+                    }
+                    if (found) {
+                        ++d;
+                    } else {
+                        d = master->Set().erase(d);
+                    }
+                }
+            }
+        } else {
+            master->Reset();
+            break;
+        }
+    }
+    if (master->IsSet() && !master->Set().empty()) {
+        // copy each descriptor to master, remove from member
+        CBioseq_set_EditHandle etop(set);
+        ITERATE(CSeq_descr::Tdata, d, master->Get()) {
+            // remove from components
+            ITERATE(CBioseq_set::TSeq_set, it, top_set->GetSeq_set()) {
+                if ((*it)->IsSeq()) {
+                    CBioseq_Handle bs = set.GetScope().GetBioseqHandle((*it)->GetSeq());
+                    CBioseq_EditHandle bse(bs);
+                    CBioseq::TDescr::Tdata::iterator di = bse.SetDescr().Set().begin();
+                    while (di != bse.SetDescr().Set().end() && !(*di)->Equals(**d)) {
+                        ++di;
+                    }
+                    if (di != bse.SetDescr().Set().end()) {
+                        bse.RemoveSeqdesc(**di);
+                    }
+                } else  if ((*it)->IsSet()) {
+                    CBioseq_set_Handle bss = set.GetScope().GetBioseq_setHandle((*it)->GetSet());
+                    CBioseq_set_EditHandle bsse(bss);
+                    CBioseq_set::TDescr::Tdata::iterator di = bsse.SetDescr().Set().begin();
+                    while (di != bsse.SetDescr().Set().end() && !(*di)->Equals(**d)) {
+                        ++di;
+                    }
+                    if (di != bsse.SetDescr().Set().end()) {
+                        bsse.RemoveSeqdesc(**di);
+                    }
+                }
+            }
+            CRef<CSeqdesc> cpy(new CSeqdesc());
+            cpy->Assign(**d);
+            etop.AddSeqdesc(*cpy);
+        }        
+    }
+}
+
+
 void BioseqSetDescriptorPropagateDown(
     const CBioseq_set_Handle & bioseq_set_h,
     const vector<CSeqdesc::E_Choice> &choices_to_delete )
@@ -2482,8 +2566,7 @@ void TrimSeqGraph(CBioseq_Handle bsh,
     // Copy over seqgraph data values.  Handle BYTE type only (see 
     // C Toolkit's GetGraphsProc function in api/sqnutil2.c)
     CSeq_graph::TGraph& dst_data = graph->SetGraph();
-    switch ( dst_data.Which() ) {
-    case CSeq_graph::TGraph::e_Byte:
+    if (dst_data.IsByte()) {
         // Keep original min, max, axis
 
         // Copy start/stop values are relative to bioseq coordinate system.
@@ -2504,7 +2587,6 @@ void TrimSeqGraph(CBioseq_Handle bsh,
 
         // Update seqloc
         s_UpdateSeqGraphLoc(graph, sorted_cuts);
-        break;
     }
 }
 
@@ -3028,6 +3110,19 @@ bool IsUnverifiedFeature(const CBioseq& seq)
     return false;
 }
 
+bool IsUnverifiedMisassembled(const CBioseq& seq)
+{
+    if (!seq.IsSetDescr()) {
+        return false;
+    }
+    ITERATE(CBioseq::TDescr::Tdata, it, seq.GetDescr().Get()) {
+        if ((*it)->IsUser() && (*it)->GetUser().IsUnverifiedMisassembled()) {
+            return true;
+        }
+    }
+    return false;
+}
+
 void SortSeqDescr(CSeq_descr& descr)
 {
     descr.Set().sort(CompareSeqdesc());
@@ -3045,6 +3140,246 @@ void SortSeqDescr(CSeq_entry& entry)
 }
 
 
+// For Targeted Locus Sequences
+
+const string& GetTargetedLocusName(const CGene_ref& gene)
+{
+    if (gene.IsSetLocus()) {
+        return gene.GetLocus();
+    } else {
+        return kEmptyStr;
+    }
+}
+
+
+const string& GetTargetedLocusName(const CProt_ref& prot)
+{
+    if (prot.IsSetName() &&
+        prot.GetName().size() > 0) {
+        return prot.GetName().front();
+    } else {
+        return kEmptyStr;
+    }
+
+}
+
+
+string GetTargetedLocusName(const CRNA_ref& rna)
+{
+    return rna.GetRnaProductName();
+}
+
+
+string GetTargetedLocusName(const CSeq_feat& feat)
+{
+    string tln = kEmptyStr;
+    if (feat.IsSetData()) {
+        switch (feat.GetData().Which()) {
+            case CSeqFeatData::e_Prot:
+                tln = GetTargetedLocusName(feat.GetData().GetProt());
+                break;
+            case CSeqFeatData::e_Gene:
+                tln = GetTargetedLocusName(feat.GetData().GetGene());
+                break;
+            case CSeqFeatData::e_Rna:
+                tln = GetTargetedLocusName(feat.GetData().GetRna());
+                break;
+            case CSeqFeatData::e_Imp:
+                if (feat.GetData().GetSubtype() == CSeqFeatData::eSubtype_misc_feature &&
+                    feat.IsSetComment()) {
+                    tln = feat.GetComment();
+                }
+                break;
+            default:
+                break;
+        }
+    }
+    return tln;
+}
+
+
+string GetTargetedLocusName(const CSeq_feat& cds, CScope& scope)
+{
+    string tls = kEmptyStr;
+    CConstRef <CSeq_feat> gene_for_feat = GetGeneForFeature(cds, scope);
+    if (gene_for_feat) {
+        tls = GetTargetedLocusName(*gene_for_feat);
+    }
+    if (NStr::IsBlank(tls) && cds.IsSetProduct()) {
+        CBioseq_Handle prot = scope.GetBioseqHandle(cds.GetProduct());
+        if (prot) {
+            CFeat_CI f(prot, CSeqFeatData::eSubtype_prot);
+            if (f) {
+                tls = GetTargetedLocusName(*(f->GetSeq_feat()));
+            }
+        }
+    }
+    return tls;
+}
+
+
+string GenerateTargetedLocusName(CBioseq_Handle seq)
+{
+    CFeat_CI f(seq);
+    string tls = kEmptyStr;
+    bool quit = false;
+    while (f && !quit) {
+        switch (f->GetData().Which()) {
+        case CSeqFeatData::e_Cdregion:
+            tls = GetTargetedLocusName(*(f->GetSeq_feat()), seq.GetScope());
+            quit = true;
+            break;
+        case CSeqFeatData::e_Gene:
+            tls = GetTargetedLocusName(f->GetData().GetGene());
+            break;
+        case CSeqFeatData::e_Rna:
+        case CSeqFeatData::e_Imp:
+            tls = GetTargetedLocusName(*(f->GetSeq_feat()));
+            quit = true;
+            break;
+        default:
+            break;
+        }
+        ++f;
+    }
+    return tls;
+}
+
+
+void SetTargetedLocusName(CBioseq_Handle seq, const string& tls)
+{
+    bool found = false;
+    CBioseq_EditHandle bh(seq);
+    if (bh.GetCompleteBioseq()->IsSetDescr()) {
+        NON_CONST_ITERATE(CBioseq::TDescr::Tdata, it, bh.SetDescr().Set()) {
+            if ((*it)->IsUser() && 
+                (*it)->GetUser().GetObjectType() == CUser_object::eObjectType_AutodefOptions) {
+                CAutoDefOptions* opts = new CAutoDefOptions();
+                opts->InitFromUserObject((*it)->GetUser());
+                opts->SetTargetedLocusName(tls);
+                CRef<CUser_object> new_obj = opts->MakeUserObject();
+                delete opts;
+                (*it)->SetUser().Assign(*new_obj);
+                found = true;
+                break;
+            }
+        }
+    }
+    if (!found) {
+        CAutoDefOptions * opts = new CAutoDefOptions();
+        opts->SetTargetedLocusName(tls);
+        CRef<CUser_object> new_obj = opts->MakeUserObject();
+        delete opts;
+        CRef<CSeqdesc> new_desc(new CSeqdesc());
+        new_desc->SetUser().Assign(*new_obj);
+        bh.SetDescr().Set().push_back(new_desc);
+    }
+    
+}
+
+
+string GetTargetedLocusNameConsensus(const string& tls1, const string& tls2)
+{
+    // This section is used to calculate the parts of a product name that
+    // are "the same" for use as the name of an alternatively spliced product.
+    // The common portion of the string must end at a recognized separator,
+    // such as a space, comma, or dash instead of in the middle of a word.
+    // The matching portions of the string could occur at the beginning or end
+    // of the string, or even occasionally at the beginning and end of a
+    // string, but not as the center of the string with a different beginning
+    // and ending.
+    if (NStr::IsBlank(tls1)) {
+        return tls2;
+    } else if (NStr::IsBlank(tls2)) {
+        return tls1;
+    } 
+
+    if (NStr::Equal(tls1, tls2)) {
+        return tls1;
+    } else if (NStr::StartsWith(tls1, tls2)) {
+        return tls2;
+    } else if (NStr::StartsWith(tls2, tls1)) {
+        return tls1;
+    } else if (NStr::EndsWith(tls1, tls2)) {
+        return tls2;
+    } else if (NStr::EndsWith(tls2, tls1)) {
+        return tls1;
+    }
+
+    vector<string> tokens1;
+    NStr::Tokenize(tls1, " ", tokens1);
+    vector<string> tokens2;
+    NStr::Tokenize(tls2, " ", tokens2);
+
+    size_t t1_pos = 0;
+    size_t t1_match_start = string::npos;
+    size_t t1_match_end = 0;
+    ITERATE(vector<string>, it1, tokens1){
+        ITERATE(vector<string>, it2, tokens2) {
+            if (NStr::Equal(*it1, *it2)) {
+                t1_match_start = t1_pos;
+                t1_match_end = t1_pos;
+                ++it1;
+                ++it2;
+                while (it1 != tokens1.end() && it2 != tokens2.end() && NStr::Equal(*it1, *it2)) {
+                    ++t1_match_end;
+                    ++it1;
+                    ++it2;
+                }
+                break;
+            }
+        }
+        if (t1_match_start != string::npos) {
+            break;
+        }
+        t1_pos++;
+    }
+
+    if (t1_match_start == string::npos) {
+        return kEmptyStr;
+    }
+
+
+    size_t start_pos = 0;
+    string::const_iterator s = tls1.begin();
+    while (s != tls1.end() && (*s == ' ' || *s == ',' || *s == '-')) {
+        ++start_pos;
+        ++s;
+    }
+    size_t i = 0;
+    while (i < t1_match_start) {
+        start_pos += tokens1[i].length();
+        for (size_t k = 0; k < tokens1[i].length(); k++) {
+            ++s;
+        }
+        while (s != tls1.end() && (*s == ' ' || *s == ',' || *s == '-')) {
+            ++start_pos;
+            ++s;
+        }
+        ++i;
+    }
+    size_t match_len = tokens1[i].length();
+    for (size_t k = 0; k < tokens1[i].length(); k++) {
+        ++s;
+    }
+
+    ++i;
+    while (i <= t1_match_end) {
+        while (s != tls1.end() && (*s == ' ' || *s == ',' || *s == '-')) {
+            ++match_len;
+            ++s;
+        }
+        match_len += tokens1[i].length();
+        for (size_t k = 0; k < tokens1[i].length(); k++) {
+            ++s;
+        }
+        ++i;
+    }
+
+    string consensus = tls1.substr(start_pos, match_len);
+
+    return consensus;
+}
 
 
 END_SCOPE(edit)
diff --git a/c++/src/objtools/edit/seqid_guesser.cpp b/c++/src/objtools/edit/seqid_guesser.cpp
index a464594..a74a3fc 100644
--- a/c++/src/objtools/edit/seqid_guesser.cpp
+++ b/c++/src/objtools/edit/seqid_guesser.cpp
@@ -1,4 +1,4 @@
-/*  $Id: seqid_guesser.cpp 482749 2015-10-26 17:01:22Z ivanov $
+/*  $Id: seqid_guesser.cpp 482267 2015-10-21 19:28:06Z filippov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/edit/struc_comm_field.cpp b/c++/src/objtools/edit/struc_comm_field.cpp
index d5cd111..c2993aa 100644
--- a/c++/src/objtools/edit/struc_comm_field.cpp
+++ b/c++/src/objtools/edit/struc_comm_field.cpp
@@ -1,4 +1,4 @@
-/*  $Id: struc_comm_field.cpp 432910 2014-04-21 11:50:11Z bollin $
+/*  $Id: struc_comm_field.cpp 493879 2016-03-02 14:17:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -451,6 +451,74 @@ CRef<CUser_object> CStructuredCommentField::MakeUserObject(const string& prefix)
 }
 
 
+bool s_UserFieldCompare(const CRef<CUser_field>& f1, const CRef<CUser_field>& f2)
+{
+    if (!f1->IsSetLabel()) return true;
+    if (!f2->IsSetLabel()) return false;
+    return f1->GetLabel().Compare(f2->GetLabel()) < 0;
+}
+
+
+bool CStructuredCommentField::IsValid(const CUser_object& obj, const string& desired_prefix)
+{
+    string prefix = CComment_rule::GetStructuredCommentPrefix(obj);
+    if (!NStr::Equal(prefix, desired_prefix)) {
+        return false;
+    }
+
+    CConstRef<CComment_set> comment_rules = CComment_set::GetCommentRules();
+    if (!comment_rules) {
+        return false;
+    }
+
+    try {
+        const CComment_rule& rule = comment_rules->FindCommentRule(prefix);
+
+        if (rule.GetRequire_order()) {
+            CComment_rule::TErrorList errors = rule.IsValid(obj);
+            if (errors.size() == 0) {
+                return true;
+            } else {
+                return false;
+            }
+        } else {
+            CUser_object tmp;
+            tmp.Assign(obj);
+            CUser_object::TData& fields = tmp.SetData();
+            stable_sort(fields.begin(), fields.end(), s_UserFieldCompare);
+            CComment_rule::TErrorList errors = rule.IsValid(obj);
+            if (errors.size() == 0) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+    } catch (CException) {
+        // no rule for this prefix
+        return false;
+    }
+}
+
+
+void CStructuredCommentField::ReorderFields(CUser_object& obj)
+{
+    string prefix = CComment_rule::GetStructuredCommentPrefix(obj);
+
+    CConstRef<CComment_set> comment_rules = CComment_set::GetCommentRules();
+    if (!comment_rules) {
+        return;
+    }
+
+    try {
+        const CComment_rule& rule = comment_rules->FindCommentRule(prefix);
+        rule.ReorderFields(obj);
+    } catch (CException) {
+        // no rule for this prefix
+    }
+}
+
+
+
 const string kGenomeAssemblyData = "Genome-Assembly-Data";
 const string kAssemblyMethod = "Assembly Method";
 const string kGenomeCoverage = "Genome Coverage";
@@ -705,52 +773,99 @@ CRef<CUser_object> CGenomeAssemblyComment::MakeUserObject()
 }
 
 
-bool s_UserFieldCompare (const CRef<CUser_field>& f1, const CRef<CUser_field>& f2)
+bool CGenomeAssemblyComment::IsValid(const CUser_object& obj)
 {
-    if (!f1->IsSetLabel()) return true;
-    if (!f2->IsSetLabel()) return false;
-    return f1->GetLabel().Compare(f2->GetLabel()) < 0;
+    return CStructuredCommentField::IsValid(obj, kGenomeAssemblyData);
 }
 
 
-bool CGenomeAssemblyComment::IsValid(const CUser_object& obj)
+const string kANI = "Taxonomic-Update-Statistics";
+const string kANIThisGenome = "This Genome (query)";
+const string kANICurrentName = "Current Name";
+const string kANIPreviousName = "Previous Name";
+const string kANIDateUpdated = "Date Updated";
+const string kANIAnalysisType = "Analysis Type";
+const string kANIAnalysis1 = "Analysis 1 (A1)";
+const string kANIA1Genome = "A1 Genome (subject)";
+const string kANIA1Name = "A1 Name";
+const string kANIA1ANI = "A1 ANI";
+const string kANIA1QueryCoverage = "A1 Query Coverage";
+const string kANIA1SubjectCoverage = "A1 Subject Coverage";
+const string kANIAnalysis2 = "Analysis 2 (A2)";
+const string kANIA2Genome = "A2 Genome (subject)";
+const string kANIA2Name = "A2 Name";
+const string kANIA2ANI = "A2 ANI";
+const string kANIA2QueryCoverage = "A2 Query Coverage";
+const string kANIA2SubjectCoverage = "A2 Subject Coverage";
+
+CANIComment::CANIComment()
 {
-    string prefix = CComment_rule::GetStructuredCommentPrefix(obj);
-    if (!NStr::Equal(prefix, kGenomeAssemblyData)) {
-        return false;
-    }
+    m_User = MakeEmptyUserObject();
+}
 
-    CConstRef<CComment_set> comment_rules = CComment_set::GetCommentRules();
-    if (!comment_rules) {
-        return false;
-    }
 
-    try {
-        const CComment_rule& rule = comment_rules->FindCommentRule(prefix);
+CANIComment::CANIComment(CUser_object& user)
+{
+    m_User.Reset(new CUser_object());
+    m_User->Assign(user);
+}
 
-        if (rule.GetRequire_order()) {
-            CComment_rule::TErrorList errors = rule.IsValid(obj);
-            if (errors.size() == 0) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            CUser_object tmp;
-            tmp.Assign(obj);
-            CUser_object::TData& fields = tmp.SetData();
-            stable_sort (fields.begin(), fields.end(), s_UserFieldCompare);
-            CComment_rule::TErrorList errors = rule.IsValid(obj);
-            if (errors.size() == 0) {
-                return true;
-            } else {
-                return false;
-            }
-        }
-    } catch (CException ) {
-        // no rule for this prefix
-        return false;
-    }
+
+CRef<CUser_object> CANIComment::MakeEmptyUserObject()
+{
+    CRef<CUser_object> obj = CStructuredCommentField::MakeUserObject(kANI);
+    return obj;
+}
+
+#define ANI_STRING_FIELD_IMPLEMENTATION(Fieldname) \
+void CANIComment::Set##Fieldname(CUser_object& obj, string val, EExistingText existing_text) \
+{ \
+    CStructuredCommentField field(kANI, kANI##Fieldname); \
+    field.SetVal(obj, val, existing_text); \
+} \
+string CANIComment::Get##Fieldname(const CUser_object& obj) \
+{ \
+    CStructuredCommentField field(kANI, kANI##Fieldname); \
+    return field.GetVal(obj); \
+} \
+CANIComment& CANIComment::Set##Fieldname(string val, EExistingText existing_text) \
+{ \
+    Set##Fieldname(*m_User, val, existing_text); \
+    return *this; \
+}
+
+ANI_STRING_FIELD_IMPLEMENTATION(ThisGenome)
+ANI_STRING_FIELD_IMPLEMENTATION(CurrentName)
+ANI_STRING_FIELD_IMPLEMENTATION(PreviousName)
+ANI_STRING_FIELD_IMPLEMENTATION(DateUpdated)
+ANI_STRING_FIELD_IMPLEMENTATION(AnalysisType)
+ANI_STRING_FIELD_IMPLEMENTATION(Analysis1)
+ANI_STRING_FIELD_IMPLEMENTATION(A1Genome)
+ANI_STRING_FIELD_IMPLEMENTATION(A1Name)
+ANI_STRING_FIELD_IMPLEMENTATION(A1ANI)
+ANI_STRING_FIELD_IMPLEMENTATION(A1QueryCoverage)
+ANI_STRING_FIELD_IMPLEMENTATION(A1SubjectCoverage)
+ANI_STRING_FIELD_IMPLEMENTATION(Analysis2)
+ANI_STRING_FIELD_IMPLEMENTATION(A2Genome)
+ANI_STRING_FIELD_IMPLEMENTATION(A2Name)
+ANI_STRING_FIELD_IMPLEMENTATION(A2ANI)
+ANI_STRING_FIELD_IMPLEMENTATION(A2QueryCoverage)
+ANI_STRING_FIELD_IMPLEMENTATION(A2SubjectCoverage)
+
+
+CRef<CUser_object> CANIComment::MakeUserObject()
+{
+    CRef<CUser_object> obj(new CUser_object());
+    obj->Assign(*m_User);
+    CStructuredCommentField::ReorderFields(*obj);
+
+    return obj;
+}
+
+
+bool CANIComment::IsValid(const CUser_object& obj)
+{
+    return CStructuredCommentField::IsValid(obj, kANI);
 }
 
 
diff --git a/c++/src/objtools/format/Makefile.xformat.lib b/c++/src/objtools/format/Makefile.xformat.lib
index 6a2d1b3..72ebee8 100644
--- a/c++/src/objtools/format/Makefile.xformat.lib
+++ b/c++/src/objtools/format/Makefile.xformat.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.xformat.lib 474406 2015-07-28 18:14:17Z ivanov $
+# $Id: Makefile.xformat.lib 472056 2015-07-06 19:29:12Z gotvyans $
 
 # Build library "xformat"
 ###############################
diff --git a/c++/src/objtools/format/accession_item.cpp b/c++/src/objtools/format/accession_item.cpp
index 35df007..afbe719 100644
--- a/c++/src/objtools/format/accession_item.cpp
+++ b/c++/src/objtools/format/accession_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: accession_item.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: accession_item.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/cigar_formatter.cpp b/c++/src/objtools/format/cigar_formatter.cpp
index edb4989..8f1aca6 100644
--- a/c++/src/objtools/format/cigar_formatter.cpp
+++ b/c++/src/objtools/format/cigar_formatter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: cigar_formatter.cpp 484561 2015-11-12 17:46:42Z ivanov $
+/*  $Id: cigar_formatter.cpp 484522 2015-11-12 15:23:46Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/comment_item.cpp b/c++/src/objtools/format/comment_item.cpp
index 08f5ee8..d9fe9c8 100644
--- a/c++/src/objtools/format/comment_item.cpp
+++ b/c++/src/objtools/format/comment_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: comment_item.cpp 478449 2015-09-09 15:23:58Z ivanov $
+/*  $Id: comment_item.cpp 495721 2016-03-21 14:22:49Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -831,7 +831,7 @@ string CCommentItem::GetStringForWGS(CBioseqContext& ctx)
         }
     }
 
-    string version = (wgsname.length() == 15) ? 
+    string version = (wgsname.length() == 15 || NStr::StartsWith(wgsname, "NZ_")) ?
         wgsname.substr(7, 2) : wgsname.substr(4, 2);
 
     CNcbiOstrstream text;
@@ -925,6 +925,70 @@ string CCommentItem::GetStringForTSA(CBioseqContext& ctx)
     return CNcbiOstrstreamToString(text);
 }
 
+string CCommentItem::GetStringForTLS(CBioseqContext& ctx)
+{
+    static const string default_str = "?";
+
+    if (!ctx.IsTLSMaster()) {
+        return kEmptyStr;
+    }
+
+    const string& tlsaccn = ctx.GetTLSMasterAccn();
+    const string& tlsname = ctx.GetTLSMasterName();
+
+    if (NStr::IsBlank(tlsaccn)  ||  NStr::IsBlank(tlsname)) {
+        return kEmptyStr;
+    }
+
+    const string* taxname = &default_str;
+    for (CSeqdesc_CI it(ctx.GetHandle(), CSeqdesc::e_Source); it; ++it) {
+        const CBioSource& src = it->GetSource();
+        if (src.IsSetOrg()  &&  src.GetOrg().IsSetTaxname()  &&
+            !NStr::IsBlank(src.GetOrg().GetTaxname()) ) {
+            taxname = &(src.GetOrg().GetTaxname());
+        }
+    }
+
+    const string* first = &default_str, *last = &default_str;
+    for (CSeqdesc_CI it(ctx.GetHandle(), CSeqdesc::e_User); it; ++it) {
+        const CUser_object& uo = it->GetUser();
+        if (uo.IsSetType()  &&  uo.GetType().IsStr()  &&
+            ( NStr::EqualNocase(uo.GetType().GetStr(), "TLSProjects") ) ) 
+        {
+            if (uo.HasField("TLS_accession_first")) {
+                const CUser_field& uf = uo.GetField("TLS_accession_first");
+                if (uf.IsSetData()  &&  uf.GetData().IsStr()  &&
+                    !NStr::IsBlank(uf.GetData().GetStr()) ) {
+                    first = &(uf.GetData().GetStr());
+                }
+            }
+            if (uo.HasField("TLS_accession_last")) {
+                const CUser_field& uf = uo.GetField("TLS_accession_last");
+                if (uf.IsSetData()  &&  uf.GetData().IsStr()  &&
+                    !NStr::IsBlank(uf.GetData().GetStr())) {
+                    last = &(uf.GetData().GetStr());
+                }
+            }
+        }
+    }
+
+    string version = (tlsname.length() == 15) ? 
+        tlsname.substr(7, 2) : tlsname.substr(4, 2);
+
+    CNcbiOstrstream text;
+    text << "The " << *taxname 
+         << " targeted locus study (TLS) project has the project accession " 
+         << tlsaccn << ".  This version of the project (" << version 
+         << ") has the accession number " << tlsname << ",";
+    if (*first != *last) {
+        text << " and consists of sequences " << *first << "-" << *last << ".";
+    } else {
+        text << " and consists of sequence " << *first << ".";
+    }
+
+    return CNcbiOstrstreamToString(text);
+}
+
 string CCommentItem::GetStringForMolinfo(const CMolInfo& mi, CBioseqContext& ctx)
 {
     _ASSERT(mi.CanGetCompleteness());
diff --git a/c++/src/objtools/format/context.cpp b/c++/src/objtools/format/context.cpp
index 6bbfde0..e37b4b7 100644
--- a/c++/src/objtools/format/context.cpp
+++ b/c++/src/objtools/format/context.cpp
@@ -1,4 +1,4 @@
-/*  $Id: context.cpp 468376 2015-05-22 13:03:34Z vasilche $
+/*  $Id: context.cpp 495721 2016-03-21 14:22:49Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -110,6 +110,8 @@ CBioseqContext::CBioseqContext
     m_IsWGSMaster(false),
     m_IsTSA(false),
     m_IsTSAMaster(false),
+    m_IsTLS(false),
+    m_IsTLSMaster(false),
     m_IsHup(false),
     m_Gi(ZERO_GI),
     m_ShowGBBSource(false),
@@ -168,6 +170,8 @@ CBioseqContext::CBioseqContext
     m_IsWGSMaster(false),
     m_IsTSA(false),
     m_IsTSAMaster(false),
+    m_IsTLS(false),
+    m_IsTLSMaster(false),
     m_IsHup(false),
     m_Gi(ZERO_GI),
     m_ShowGBBSource(false),
@@ -216,9 +220,9 @@ void CBioseqContext::x_Init(const CBioseq_Handle& seq, const CSeq_loc* user_loc)
 
     // NB: order of execution is important
     m_Repr = x_GetRepr();
-    x_SetId();
     m_Mol  = seq.GetInst_Mol();
     m_Molinfo.Reset(x_GetMolInfo());
+    x_SetId();
 
     if ( IsSegmented() ) {
         m_HasParts = x_HasParts();
@@ -582,6 +586,8 @@ void CBioseqContext::x_SetDataFromUserObjects(void)
                             m_fUnverified |= fUnverified_Organism;
                         } else if( NStr::EqualNocase( field.GetData().GetStr(), "Features") ) {
                             m_fUnverified |= fUnverified_SequenceOrAnnotation;
+                        } else if( NStr::EqualNocase( field.GetData().GetStr(), "Misassembled") ) {
+                            m_fUnverified |= fUnverified_Misassembled;
                         }
                     }
                 }
@@ -810,6 +816,20 @@ void CBioseqContext::x_SetId(void)
             }
         } 
 
+        // TLS
+        m_IsTLS = m_IsTLS  ||  ( GetTech() == CMolInfo::eTech_targeted );
+
+        if ( m_IsTLS  &&  !acc.empty() ) {
+            if ( m_Repr == CSeq_inst::eRepr_virtual) {
+                m_IsTLSMaster = true;
+            }
+            if ( m_IsTLSMaster ) {
+                m_TLSMasterAccn = acc;
+                m_TLSMasterName = tsip->CanGetName() ? tsip->GetName() : kEmptyStr;
+            }
+        }
+
+
         // GBB source
         m_ShowGBBSource = m_ShowGBBSource  ||  (acc_info == CSeq_id::eAcc_gsdb_dirsub);
     }
diff --git a/c++/src/objtools/format/ctrl_items.cpp b/c++/src/objtools/format/ctrl_items.cpp
index 2901e7d..61f5e68 100644
--- a/c++/src/objtools/format/ctrl_items.cpp
+++ b/c++/src/objtools/format/ctrl_items.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ctrl_items.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: ctrl_items.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/dbsource_item.cpp b/c++/src/objtools/format/dbsource_item.cpp
index 119eaef..50a35bc 100644
--- a/c++/src/objtools/format/dbsource_item.cpp
+++ b/c++/src/objtools/format/dbsource_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dbsource_item.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: dbsource_item.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/defline_item.cpp b/c++/src/objtools/format/defline_item.cpp
index 23b4e39..deace8e 100644
--- a/c++/src/objtools/format/defline_item.cpp
+++ b/c++/src/objtools/format/defline_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: defline_item.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: defline_item.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/embl_formatter.cpp b/c++/src/objtools/format/embl_formatter.cpp
index 49d5521..490caaf 100644
--- a/c++/src/objtools/format/embl_formatter.cpp
+++ b/c++/src/objtools/format/embl_formatter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: embl_formatter.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: embl_formatter.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/feature_item.cpp b/c++/src/objtools/format/feature_item.cpp
index b26ebd8..12e1b30 100644
--- a/c++/src/objtools/format/feature_item.cpp
+++ b/c++/src/objtools/format/feature_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: feature_item.cpp 481617 2015-10-14 14:42:01Z ivanov $
+/*  $Id: feature_item.cpp 498880 2016-04-20 13:36:23Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1204,7 +1204,6 @@ void CFeatureItem::x_AddQualPseudo(
 //  ----------------------------------------------------------------------------
 {
     if ( !pseudo || 
-        subtype == CSeqFeatData::eSubtype_repeat_region ||
         subtype == CSeqFeatData::eSubtype_mobile_element ||
         subtype == CSeqFeatData::eSubtype_centromere ||
         subtype == CSeqFeatData::eSubtype_telomere ) 
@@ -1301,11 +1300,12 @@ void CFeatureItem::x_AddQualSeqfeatNote(CBioseqContext &ctx)
                         const string & comment = (*it)->GetComment();
                         // certain comments require special handling
                         const static string ktRNAscanSE = "tRNA features were annotated by tRNAscan-SE";
-                        if( NStr::StartsWith(comment, ktRNAscanSE, NStr::eNocase) && 
-                            ! x_HasMethodtRNAscanSE() ) 
+                        if( NStr::StartsWith(comment, ktRNAscanSE, NStr::eNocase) /* && ! x_HasMethodtRNAscanSE() */ ) 
                         {
-                            // don't propagate tRNAscan-SE comments to irrelevant features
-                            continue;
+                            if ( m_Feat.GetData().GetSubtype() != CSeqFeatData::eSubtype_tRNA ) {
+                                // don't propagate tRNAscan-SE comments to irrelevant features
+                                continue;
+                            }
                         }
                         string comm = comment;
                         TrimSpacesAndJunkFromEnds( comm, false );
@@ -1643,8 +1643,7 @@ void CFeatureItem::x_AddQuals(
     bool suppressed = false;
 
     const bool gene_forbidden_if_genbank = 
-        ( subtype == CSeqFeatData::eSubtype_repeat_region || 
-          subtype == CSeqFeatData::eSubtype_mobile_element ||
+        ( subtype == CSeqFeatData::eSubtype_mobile_element ||
           subtype == CSeqFeatData::eSubtype_centromere ||
           subtype == CSeqFeatData::eSubtype_telomere );
 
@@ -1677,38 +1676,6 @@ void CFeatureItem::x_AddQuals(
         }
     }
 
-    /*
-    if ( feat_gene_xref && feat_gene_xref->IsSuppressed() ) {
-        // suppress gene by overlap
-    } else if ( type != CSeqFeatData::e_Gene &&
-         subtype != CSeqFeatData::eSubtype_operon &&
-         subtype != CSeqFeatData::eSubtype_gap && 
-         (  ! gene_forbidden_if_genbank || is_not_genbank ) )
-    {
-        CMappedFeat mapped_gene = GetBestGeneForFeat (m_Feat, m_Feat_Tree);
-        if (mapped_gene && subtype != CSeqFeatData::eSubtype_primer_bind) {
-            gene_feat = &mapped_gene.GetOriginalFeature();
-            gene_ref = &gene_feat->GetData().GetGene();
-        } else {
-            // e.g., check sig_peptide for gene overlapping parent CDS
-            CSeq_feat_Handle parent_feat_handle;
-            if( parentFeatureItem ) {
-                parent_feat_handle = parentFeatureItem->GetFeat();
-            }
-            CGeneFinder::GetAssociatedGeneInfo( m_Feat, ctx, m_Loc, m_GeneRef, gene_ref, 
-                gene_feat, parent_feat_handle );
-        }
-
-    } else if( ! is_not_genbank && gene_forbidden_if_genbank ) {
-        // We include a gene_ref on the genbank-forbidden features if there's
-        // an explicit xref and the referenced gene does not exist
-        // e.g. NC_014095.1
-        if( feat_gene_xref && ! CGeneFinder::ResolveGeneXref(feat_gene_xref, ctx.GetTopLevelEntry()) ) {
-            gene_ref = feat_gene_xref;
-        }
-    }
-    */
-
     bool pseudo = x_GetPseudo(gene_ref, gene_feat );
 
     //
@@ -1928,12 +1895,28 @@ void CFeatureItem::x_AddQualsRna(
                     aa = s_ToIupacaa(aa);
                 }
                 const string& aa_str = s_AaName(aa);
+                string amino_acid_str = aa_str;
+                
                 if ( !aa_str.empty() ) {
-                    x_AddQual(eFQ_product, new CFlatStringQVal(aa_str));
-                    if ( trna.IsSetAnticodon()  &&  !aa_str.empty() ) {
+                    const string& ac_str = aa_str;
+                    if (NStr::CompareNocase (ac_str, "tRNA-Met") == 0) {
+                        const CSeq_feat_Base::TQual & qual = m_Feat.GetQual();
+                        ITERATE( CSeq_feat::TQual, it, qual ) {
+                            if (!(*it)->IsSetQual()  ||  !(*it)->IsSetVal()) continue;
+                            if (NStr::CompareNocase( (*it)->GetQual(), "product") != 0) continue;
+                            if (NStr::CompareNocase ((*it)->GetVal (), "tRNA-fMet") == 0) {
+                                amino_acid_str = "tRNA-fMet";
+                            }
+                            if (NStr::CompareNocase ((*it)->GetVal (), "tRNA-iMet") == 0) {
+                                amino_acid_str = "tRNA-iMet";
+                            }
+                        }
+                    }
+                    x_AddQual(eFQ_product, new CFlatStringQVal(amino_acid_str));
+                    if ( trna.IsSetAnticodon()  &&  !ac_str.empty() ) {
                         x_AddQual(eFQ_anticodon,
                             new CFlatAnticodonQVal(trna.GetAnticodon(),
-                                                   aa_str.substr(5, NPOS)));
+                                                   ac_str.substr(5, NPOS)));
                     }
                 }
                 if ( trna.IsSetCodon() ) {
@@ -2984,6 +2967,10 @@ void CFeatureItem::x_AddQualsGene(
 
     const bool is_gene = (subtype == CSeqFeatData::eSubtype_gene);
 
+    const bool okay_to_propage = (subtype != CSeqFeatData::eSubtype_mobile_element &&
+                                  subtype != CSeqFeatData::eSubtype_centromere &&
+                                  subtype != CSeqFeatData::eSubtype_telomere);
+
     const string* locus = (gene_ref->IsSetLocus()  &&  !NStr::IsBlank(gene_ref->GetLocus())) ?
         &gene_ref->GetLocus() : NULL;
     const string* desc = (gene_ref->IsSetDesc() &&  !NStr::IsBlank(gene_ref->GetDesc())) ?
@@ -2995,12 +2982,11 @@ void CFeatureItem::x_AddQualsGene(
         &gene_ref->GetLocus_tag() : 0;
 
     //  gene:
-//    if ( subtype != CSeqFeatData::eSubtype_repeat_region ) {
-    if ( !from_overlap  ||  subtype != CSeqFeatData::eSubtype_repeat_region ) {
+    if ( !from_overlap  ||  okay_to_propage ) {
         if ( locus != 0 ) {
             m_Gene = *locus;
         } 
-        else if ( ( desc != 0 ) && (subtype != CSeqFeatData::eSubtype_repeat_region) ) {
+        else if ( ( desc != 0 ) && okay_to_propage ) {
             m_Gene = *desc;
         }
         else if (syn != NULL) {
@@ -3014,15 +3000,9 @@ void CFeatureItem::x_AddQualsGene(
             }
         }
     }
-    else { // for repeat regions
-//        if ( from_overlap && locus != 0 ) {
-//            m_Gene = *locus;
-//            x_AddQual(eFQ_gene, new CFlatGeneQVal(m_Gene));
-//        }
-    }
 
     //  locus tag:
-    if ( gene_ref  ||  subtype != CSeqFeatData::eSubtype_repeat_region ) {
+    if ( gene_ref  ||  okay_to_propage ) {
         if (locus != NULL) {
             if (locus_tag != NULL) {
                 x_AddQual(eFQ_locus_tag, new CFlatStringQVal(*locus_tag, CFormatQual::eTrim_WhitespaceOnly));
@@ -3034,7 +3014,7 @@ void CFeatureItem::x_AddQualsGene(
     }
 
     //  gene desc:
-    if ( gene_ref  ||  subtype != CSeqFeatData::eSubtype_repeat_region ) {
+    if ( gene_ref  ||  okay_to_propage ) {
         if (locus != NULL) {
             if (is_gene  &&  desc != NULL) {
                 string desc_cleaned = *desc;
@@ -3050,7 +3030,7 @@ void CFeatureItem::x_AddQualsGene(
     }
 
     //  gene syn:
-    if ( gene_ref  ||  subtype != CSeqFeatData::eSubtype_repeat_region ) {
+    if ( gene_ref  ||  okay_to_propage ) {
         if (locus != NULL) {
             if (syn != NULL) {
                 x_AddQual(eFQ_gene_syn, new CFlatGeneSynonymsQVal(*syn));
@@ -3083,8 +3063,7 @@ void CFeatureItem::x_AddQualsGene(
         // these bool vars just break up the if-statement to make it easier to understand
         const bool is_type_where_allele_from_gene_forbidden = (subtype == CSeqFeatData::eSubtype_variation);
         const bool is_type_where_allele_from_gene_forbidden_except_with_embl_or_ddbj = 
-            ( subtype == CSeqFeatData::eSubtype_repeat_region ||
-              subtype == CSeqFeatData::eSubtype_mobile_element || 
+            ( subtype == CSeqFeatData::eSubtype_mobile_element || 
               subtype == CSeqFeatData::eSubtype_centromere ||
               subtype == CSeqFeatData::eSubtype_telomere );
         const bool is_embl_or_ddbj = ( GetContext()->IsEMBL() || GetContext()->IsDDBJ() );
@@ -3812,8 +3791,20 @@ void CFeatureItem::x_AddRptUnitQual(
 static bool s_IsValidRptType(const string& type)
 {
     static const char* const valid_rpt[] = {
-        "direct", "dispersed", "flanking", "inverted", "other",
-        "tandem", "terminal"
+        "centromeric_repeat",
+        "direct",
+        "dispersed",
+        "engineered_foreign_repetitive_element",
+        "flanking",
+        "inverted",
+        "long_terminal_repeat",
+        "non_LTR_retrotransposon_polymeric_tract",
+        "other",
+        "tandem",
+        "telomeric_repeat",
+        "terminal",
+        "X_element_combinatorial_repeat",
+        "Y_prime_element"
     };
     typedef CStaticArraySet<string, PNocase> TValidRptTypes;
     DEFINE_STATIC_ARRAY_MAP(TValidRptTypes, valid_types, valid_rpt);
@@ -4892,6 +4883,9 @@ bool CFeatureItem::x_AddFTableGeneQuals(
     if ( gene.IsSetLocus()  &&  !gene.GetLocus().empty() ) {
         x_AddFTableQual("gene", gene.GetLocus(), CFormatQual::eTrim_WhitespaceOnly);
     }
+    if ( gene.IsSetAllele()  &&  !gene.GetAllele().empty() ) {
+        x_AddFTableQual("allele", gene.GetAllele());
+    }
     ITERATE (CGene_ref::TSyn, it, gene.GetSyn()) {
         x_AddFTableQual("gene_syn", *it, CFormatQual::eTrim_WhitespaceOnly);
     }
@@ -5342,6 +5336,14 @@ static string s_GetSpecimenVoucherText(
         if( voucher_info_ref->m_Prefix != NULL ) {
             text << *voucher_info_ref->m_Prefix;
         }
+        if( voucher_info_ref->m_PadTo > 0 && voucher_info_ref->m_PadWith != NULL) {
+            int len_id = id.length();
+            int len_pad = voucher_info_ref->m_PadWith->length();
+            while (len_id < voucher_info_ref->m_PadTo) {
+                text << *voucher_info_ref->m_PadWith;
+                len_id += len_pad;
+            }
+        }
         text << id;
         if( voucher_info_ref->m_Suffix ) {
             text << *voucher_info_ref->m_Suffix;
diff --git a/c++/src/objtools/format/flat_file_config.cpp b/c++/src/objtools/format/flat_file_config.cpp
index 6700df2..e5e055e 100644
--- a/c++/src/objtools/format/flat_file_config.cpp
+++ b/c++/src/objtools/format/flat_file_config.cpp
@@ -1,4 +1,4 @@
-/*  $Id: flat_file_config.cpp 481617 2015-10-14 14:42:01Z ivanov $
+/*  $Id: flat_file_config.cpp 500529 2016-05-05 14:28:05Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -501,7 +501,7 @@ void CFlatFileConfig::AddArgumentDescriptions(CArgDescriptions& args)
                                  CArgDescriptions::eString, "genbank");
          arg_desc->SetConstraint("format",
                                  &(*new CArgAllow_Strings,
-                                   "genbank", "embl", "ddbj", "gbseq", "ftable", "gff", "gff3"));
+                                   "genbank", "embl", "ddbj", "gbseq", "ftable", "gff", "gff3", "lite"));
 
          // mode (default: dump)
          arg_desc->AddDefaultKey("mode", "Mode",
@@ -646,6 +646,8 @@ CFlatFileConfig::EFormat x_GetFormat(const CArgs& args)
         return CFlatFileConfig::eFormat_GBSeq;
     } else if ( format == "ftable" ) {
         return CFlatFileConfig::eFormat_FTable;
+    } else if ( format == "lite" ) {
+        return CFlatFileConfig::eFormat_Lite;
     }
     if (format == "gff"  ||  format == "gff3") {
         string msg = 
diff --git a/c++/src/objtools/format/flat_file_generator.cpp b/c++/src/objtools/format/flat_file_generator.cpp
index e9a4e17..830d148 100644
--- a/c++/src/objtools/format/flat_file_generator.cpp
+++ b/c++/src/objtools/format/flat_file_generator.cpp
@@ -1,4 +1,4 @@
-/*  $Id: flat_file_generator.cpp 481618 2015-10-14 14:42:22Z ivanov $
+/*  $Id: flat_file_generator.cpp 498882 2016-04-20 13:37:11Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -44,6 +44,7 @@
 #include <objmgr/util/sequence.hpp>
 #include <objmgr/mapped_feat.hpp>
 #include <objmgr/util/feature.hpp>
+#include <objmgr/annot_ci.hpp>
 
 #include <objtools/cleanup/cleanup.hpp>
 #include <objtools/format/flat_file_generator.hpp>
@@ -55,6 +56,7 @@
 #include <objtools/format/context.hpp>
 #include <objtools/format/flat_expt.hpp>
 
+#include <objects/misc/sequence_macros.hpp>
 
 BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
@@ -166,6 +168,138 @@ void CFlatFileGenerator::Generate
     SAnnotSelector sel = m_Ctx->SetAnnotSelector();
     m_Ctx->SetEntry(entry);
 
+
+    bool onlyNearFeats = false;
+    bool nearFeatsSuppress = false;
+
+    bool isNc = false;
+    bool isNgNtNwNz = false;
+    bool isGED = false;
+    bool isTPA = false;
+
+    bool hasLocalFeat = false;
+    bool forceOnlyNear = false;
+
+    for (CBioseq_CI bi(entry); bi; ++bi) {
+        const CBioseq_Handle& bh = *bi;
+  
+        const CBioseq& bsp = *(bi->GetCompleteBioseq());
+
+        FOR_EACH_SEQID_ON_BIOSEQ (it, bsp) {
+            const CSeq_id& sid = **it;
+            switch (sid.Which()) {
+                case CSeq_id::e_Genbank:
+                case CSeq_id::e_Embl:
+                case CSeq_id::e_Ddbj:
+                    isGED = true;
+                    break;
+                case CSeq_id::e_Tpg:
+                case CSeq_id::e_Tpe:
+                case CSeq_id::e_Tpd:
+                    isTPA = true;
+                    break;
+                case CSeq_id::e_Other:
+                    {
+                         const CTextseq_id* tsid = sid.GetTextseq_Id ();
+                        if (tsid != NULL && tsid->IsSetAccession()) {
+                            const string& acc = tsid->GetAccession().substr(0, 3);
+                            if (acc == "NC_") {
+                                isNc = true;
+                            } else if (acc == "NG_" || acc == "NT_" || acc == "NW_" || acc == "NZ_") {
+                                isNgNtNwNz = true;
+                            }
+                        }
+                    }
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        FOR_EACH_SEQDESC_ON_BIOSEQ (desc_it, bsp) {
+            const CSeqdesc& desc = **desc_it;
+            if (! desc.IsUser()) continue;
+            if (! desc.GetUser().IsSetType()) continue;
+            const CUser_object& usr = desc.GetUser();
+            const CObject_id& oi = usr.GetType();
+            if (! oi.IsStr()) continue;
+            const string& type = oi.GetStr();
+            if (! NStr::EqualNocase(type, "FeatureFetchPolicy")) continue;
+            FOR_EACH_USERFIELD_ON_USEROBJECT (uitr, usr) {
+                const CUser_field& fld = **uitr;
+                if (FIELD_IS_SET_AND_IS(fld, Label, Str)) {
+                    const string &label_str = GET_FIELD(fld.GetLabel(), Str);
+                    if (! NStr::EqualNocase(label_str, "Policy")) continue;
+                    if (fld.IsSetData() && fld.GetData().IsStr()) {
+                        const string& str = fld.GetData().GetStr();
+                        if (NStr::EqualNocase(str, "OnlyNearFeatures")) {
+                            forceOnlyNear = true;
+                        }
+                    }
+                }
+            }
+        }
+
+        CSeq_annot_CI annot_ci(bh);
+        for (; annot_ci; ++annot_ci) {
+              const CSeq_annot_Handle& annt = *annot_ci;
+              CConstRef<CSeq_annot> pAnnot = annt.GetCompleteSeq_annot();
+              const CSeq_annot& antx = *pAnnot;
+              FOR_EACH_SEQFEAT_ON_SEQANNOT (feat_it, antx) {
+                  const CSeq_feat& sft = **feat_it;
+                  const CSeqFeatData& data = sft.GetData();
+                  CSeqFeatData::ESubtype subtype = data.GetSubtype();
+                  if (isNc) {
+                      switch (subtype) {
+                          case CSeqFeatData::eSubtype_centromere:
+                          case CSeqFeatData::eSubtype_telomere:
+                          case CSeqFeatData::eSubtype_rep_origin:
+                          case CSeqFeatData::eSubtype_region:
+                              break;
+                          default:
+                              hasLocalFeat = true;
+                              break;
+                      }
+                  } else {
+                      hasLocalFeat = true;
+                  }
+              }
+              if (hasLocalFeat) {
+                break;
+              }
+         }
+    }
+
+    if (forceOnlyNear) {
+        onlyNearFeats = true;
+    /*
+    } else if (isNc) {
+        nearFeatsSuppress = true;
+    } else if (isNgNtNwNz) {
+        onlyNearFeats = true;
+    } else if (isTPA) {
+        onlyNearFeats = true;
+    } else if (isGED) {
+        nearFeatsSuppress = true;
+    */
+    }
+
+    if (onlyNearFeats) {
+        m_Ctx->SetAnnotSelector().SetResolveDepth(0);
+    /*
+    } else if (nearFeatsSuppress) {
+        if (hasLocalFeat) {
+            m_Ctx->SetAnnotSelector().SetResolveDepth(0);
+        } else {
+            m_Ctx->SetAnnotSelector().SetResolveDepth(1);
+        }
+    */
+    } else {
+        // m_Ctx->SetAnnotSelector().SetResolveDepth(1);
+        m_Ctx->SetAnnotSelector().SetAdaptiveDepth(true);
+    }
+
+
     CFlatFileConfig::TFormat format = m_Ctx->GetConfig().GetFormat();
     CRef<CFlatItemFormatter> formatter(CFlatItemFormatter::New(format));
     if ( !formatter ) {
@@ -249,6 +383,11 @@ void CFlatFileGenerator::Generate
     location->Assign(loc);
     m_Ctx->SetLocation(location);
 
+    CFlatFileConfig& cfg = m_Ctx->GetConfig();
+    if (cfg.IsStyleNormal()) {
+        cfg.SetStyleMaster();
+    }
+
     Generate(entry, item_os);
 }
 
diff --git a/c++/src/objtools/format/flat_seqloc.cpp b/c++/src/objtools/format/flat_seqloc.cpp
index d77b266..de5e5d8 100644
--- a/c++/src/objtools/format/flat_seqloc.cpp
+++ b/c++/src/objtools/format/flat_seqloc.cpp
@@ -1,4 +1,4 @@
-/*  $Id: flat_seqloc.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: flat_seqloc.cpp 500211 2016-05-03 13:44:08Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -88,6 +88,63 @@ static bool s_IsVirtualLocation(const CSeq_loc& loc, const CBioseq_Handle& seq)
 }
 
 
+static bool s_NeedsFlattening (const CSeq_loc &loc)
+
+{
+    if (! loc.IsMix()) return false;
+
+    ITERATE (CSeq_loc_mix::Tdata, it, loc.GetMix().Get()) {
+        if ((*it)->IsPacked_int()) {
+            return true;
+        }
+    }
+
+    return false;
+}
+
+
+static CConstRef<CSeq_loc> s_FlattenLoc (const CSeq_loc &loc)
+
+{
+    bool any_nulls_seen = false;
+    CRef<CSeq_loc_mix> new_mix(new CSeq_loc_mix);
+    CSeq_loc_mix::Tdata & new_mix_pieces = new_mix->Set();
+
+    ITERATE (CSeq_loc_mix::Tdata, it, loc.GetMix().Get()) {
+        const CSeq_loc& curr = **it;
+        if (curr.IsNull()) {
+            any_nulls_seen = true;
+        } else if (curr.IsPacked_int()) {
+            ITERATE (CPacked_seqint::Tdata, pit, curr.GetPacked_int().Get()) {
+                if( any_nulls_seen && ! new_mix_pieces.empty() ) {
+                    CRef<CSeq_loc> null_piece( new CSeq_loc );
+                    null_piece->SetNull();
+                    new_mix_pieces.push_back( null_piece );
+                }
+                CRef<CSeq_loc> old_piece(new CSeq_loc);
+                const CSeq_interval& seqint = **pit;
+                old_piece->SetInt().Assign(seqint);
+                new_mix_pieces.push_back( old_piece );
+            }
+        } else {
+            if( any_nulls_seen && ! new_mix_pieces.empty() ) {
+                CRef<CSeq_loc> null_piece( new CSeq_loc );
+                null_piece->SetNull();
+                new_mix_pieces.push_back( null_piece );
+            }
+            CRef<CSeq_loc> old_piece(new CSeq_loc);
+            old_piece->Assign(curr);
+            new_mix_pieces.push_back( old_piece );
+        }
+    }
+
+    CRef<CSeq_loc> new_loc(new CSeq_loc);
+    new_loc->SetMix(*new_mix);
+
+    return new_loc;
+}
+
+
 CFlatSeqLoc::CFlatSeqLoc
 (const CSeq_loc& loc,
  CBioseqContext& ctx,
@@ -145,7 +202,12 @@ CFlatSeqLoc::CFlatSeqLoc
     }
 
     CNcbiOstrstream oss;
-    x_Add(loc, oss, ctx, type, true);
+    if (s_NeedsFlattening (loc)) {
+        CConstRef<CSeq_loc> flat = s_FlattenLoc (loc);
+        x_Add(*flat, oss, ctx, type, true);
+    } else {
+        x_Add(loc, oss, ctx, type, true);
+    }
     ((string)CNcbiOstrstreamToString(oss)).swap( m_String );
 }
 
diff --git a/c++/src/objtools/format/gather_items.cpp b/c++/src/objtools/format/gather_items.cpp
index 8d04f44..51d4a9f 100644
--- a/c++/src/objtools/format/gather_items.cpp
+++ b/c++/src/objtools/format/gather_items.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gather_items.cpp 478453 2015-09-09 15:25:04Z ivanov $
+/*  $Id: gather_items.cpp 500529 2016-05-05 14:28:05Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -178,6 +178,7 @@ CFlatGatherer* CFlatGatherer::New(CFlatFileConfig::TFormat format)
     switch ( format ) {
     case CFlatFileConfig::eFormat_GenBank:
     case CFlatFileConfig::eFormat_GBSeq:
+    case CFlatFileConfig::eFormat_Lite:
         //case CFlatFileGenerator<>::eFormat_Index:
         return new CGenbankGatherer;
         
@@ -796,6 +797,7 @@ void CFlatGatherer::x_GatherComments(void) const
     x_RefSeqGenomeComments(ctx);
     x_WGSComment(ctx);
     x_TSAComment(ctx);
+    x_TLSComment(ctx);
     x_UnorderedComments(ctx);
     if ( ctx.ShowGBBSource() ) {
         x_GBBSourceComment(ctx);
@@ -936,7 +938,8 @@ void CFlatGatherer::x_UnverifiedComment(CBioseqContext& ctx) const
     typedef SStaticPair<CBioseqContext::TUnverified, const char*> TUnverifiedElem;
     static const TUnverifiedElem sc_unverified_map[] = {
         { CBioseqContext::fUnverified_Organism,              "source organism" },
-        { CBioseqContext::fUnverified_SequenceOrAnnotation,  "sequence and/or annotation" }
+        { CBioseqContext::fUnverified_SequenceOrAnnotation,  "sequence and/or annotation" },
+        { CBioseqContext::fUnverified_Misassembled,          "sequence assembly" }
     };
     typedef CStaticArrayMap<CBioseqContext::TUnverified, const char*> TUnverifiedMap;
     DEFINE_STATIC_ARRAY_MAP(TUnverifiedMap, sc_UnverifiedMap, sc_unverified_map);
@@ -1022,9 +1025,13 @@ void CFlatGatherer::x_IdComments(CBioseqContext& ctx,
             {{
                 if ( ctx.IsRSCompleteGenomic() ) {  // NC
                     if ( !genome_build_number.empty()   &&
-                         !has_ref_track_status &&
-                         eGenomeAnnotComment == eGenomeAnnotComment_Yes ) {
-                        x_AddComment(new CGenomeAnnotComment(ctx, genome_build_number));
+                         !has_ref_track_status /* &&
+                         eGenomeAnnotComment == eGenomeAnnotComment_Yes */ ) {
+                        if ( eGenomeAnnotComment == eGenomeAnnotComment_Yes ) {
+                            x_AddComment(new CGenomeAnnotComment(ctx, genome_build_number));
+                        } else {
+                            x_AddComment(new CGenomeAnnotComment(ctx));
+                        }
                     }
                 }
                 else if ( ctx.IsRSContig()  ||  ctx.IsRSIntermedWGS() ) {
@@ -1033,8 +1040,12 @@ void CFlatGatherer::x_IdComments(CBioseqContext& ctx,
                         if ( !NStr::IsBlank(encode) ) {
                             x_AddComment(new CCommentItem(encode, ctx));
                         }
-                    } else if ( !has_ref_track_status && eGenomeAnnotComment == eGenomeAnnotComment_Yes ) {
-                        x_AddComment(new CGenomeAnnotComment(ctx, genome_build_number));
+                    } else if ( !has_ref_track_status /* && eGenomeAnnotComment == eGenomeAnnotComment_Yes */ ) {
+                        if ( eGenomeAnnotComment == eGenomeAnnotComment_Yes ) {
+                             x_AddComment(new CGenomeAnnotComment(ctx, genome_build_number));
+                       } else {
+                            x_AddComment(new CGenomeAnnotComment(ctx));
+                        }
                     }
                 }
                 if ( ctx.IsRSPredictedProtein()  ||
@@ -1133,8 +1144,8 @@ void CFlatGatherer::x_RefSeqComments(CBioseqContext& ctx,
                     CCommentItem::eFormat_Html : CCommentItem::eFormat_Text;
                 string str = 
                     CCommentItem::GetStringForRefTrack(uo, ctx.GetHandle(), format, 
-                    ( eGenomeAnnotComment == eGenomeAnnotComment_Yes ? 
-                      CCommentItem::eGenomeBuildComment_Yes : 
+                    ( /* eGenomeAnnotComment == eGenomeAnnotComment_Yes ?
+                      CCommentItem::eGenomeBuildComment_Yes : */
                       CCommentItem::eGenomeBuildComment_No ) );
                 if ( !str.empty() ) {
                     x_AddComment(new CCommentItem(str, ctx, &uo));
@@ -1228,7 +1239,7 @@ void CFlatGatherer::x_TSAComment(CBioseqContext& ctx) const
     }
 
     if ( ctx.GetTech() == CMolInfo::eTech_tsa &&
-         ctx.GetBiomol() == CMolInfo::eBiomol_mRNA ) 
+         (ctx.GetBiomol() == CMolInfo::eBiomol_mRNA || ctx.GetBiomol() == CMolInfo::eBiomol_transcribed_RNA) ) 
     {
         string str = CCommentItem::GetStringForTSA(ctx);
         if ( !str.empty() ) {
@@ -1237,6 +1248,21 @@ void CFlatGatherer::x_TSAComment(CBioseqContext& ctx) const
     }
 }
 
+void CFlatGatherer::x_TLSComment(CBioseqContext& ctx) const
+{
+    if ( !ctx.IsTLSMaster()  ||  ctx.GetTLSMasterName().empty() ) {
+        return;
+    }
+
+    if ( ctx.GetTech() == CMolInfo::eTech_targeted ) 
+    {
+        string str = CCommentItem::GetStringForTLS(ctx);
+        if ( !str.empty() ) {
+            x_AddComment(new CCommentItem(str, ctx));
+        }
+    }
+}
+
 void CFlatGatherer::x_GBBSourceComment(CBioseqContext& ctx) const
 {
     if (!ctx.ShowGBBSource()) {
@@ -1623,9 +1649,9 @@ void CFlatGatherer::x_CollectBioSourcesOnBioseq
     const CFlatFileConfig& cfg = ctx.Config();
 
     // collect biosources descriptors on bioseq
-    if ( !cfg.IsFormatFTable()  ||  cfg.IsModeDump() ) {
+    // if ( !cfg.IsFormatFTable()  ||  cfg.IsModeDump() ) {
         x_CollectSourceDescriptors(bh, ctx, srcs);
-    }
+    // }
 
     // collect biosources features on bioseq
     if ( !ctx.DoContigStyle()  ||  cfg.ShowContigSources() ) {
@@ -1668,7 +1694,7 @@ void CFlatGatherer::x_CollectBioSources(TSourceFeatSet& srcs) const
     }
 
     // if no source found create one (only if not FTable format or Dump mode)
-    if ( srcs.empty()  &&  ! cfg.IsFormatFTable()  &&  ! cfg.IsModeDump() ) {
+    if ( srcs.empty()  &&  /* ! cfg.IsFormatFTable()  && */  ! cfg.IsModeDump() ) {
         CRef<CBioSource> bsrc(new CBioSource);
         bsrc->SetOrg();
         CRef<CSourceFeatureItem> sf(new CSourceFeatureItem(*bsrc, CRange<TSeqPos>::GetWhole(), ctx, m_Feat_Tree));
diff --git a/c++/src/objtools/format/gbseq_formatter.cpp b/c++/src/objtools/format/gbseq_formatter.cpp
index 43c49aa..f3eb1a9 100644
--- a/c++/src/objtools/format/gbseq_formatter.cpp
+++ b/c++/src/objtools/format/gbseq_formatter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gbseq_formatter.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: gbseq_formatter.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/genbank_formatter.cpp b/c++/src/objtools/format/genbank_formatter.cpp
index 540ca0d..a8e25e0 100644
--- a/c++/src/objtools/format/genbank_formatter.cpp
+++ b/c++/src/objtools/format/genbank_formatter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: genbank_formatter.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: genbank_formatter.cpp 498243 2016-04-14 15:15:47Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -348,7 +348,7 @@ void CGenbankFormatter::FormatLocus
     string units = "bp";
     if ( !ctx.IsProt() ) {
         if ( ( ctx.IsWGSMaster() && ! ctx.IsRSWGSNuc() ) || 
-            ctx.IsTSAMaster() ) 
+            ctx.IsTSAMaster() || ctx.IsTLSMaster() ) 
         {
             units = "rc";
         }
@@ -1093,7 +1093,8 @@ CGenbankFormatter::x_LocusHtmlPrefix( string &first_line, CBioseqContext& ctx )
     {{
         // we split the if-statement into little local vars for ease of reading
         const bool is_wgs_master = ( ctx.IsWGSMaster() && ctx.GetTech() == CMolInfo::eTech_wgs );
-        const bool is_tsa_master = ( ctx.IsTSAMaster() && ctx.GetTech() == CMolInfo::eTech_tsa && ctx.GetBiomol() == CMolInfo::eBiomol_mRNA );
+        const bool is_tsa_master = ( ctx.IsTSAMaster() && ctx.GetTech() == CMolInfo::eTech_tsa && 
+                                     (ctx.GetBiomol() == CMolInfo::eBiomol_mRNA || ctx.GetBiomol() == CMolInfo::eBiomol_transcribed_RNA) );
         const bool do_contig_style = ctx.DoContigStyle();
         const bool show_contig = ( (ctx.IsSegmented()  &&  ctx.HasParts())  ||
                                    (ctx.IsDelta()  &&  ! ctx.IsDeltaLitOnly()) );
@@ -2063,17 +2064,41 @@ void CGenbankFormatter::FormatTSA
 
     string tag;
 
-    switch ( tsa.GetType() ) {
-    case CTSAItem::eTSA_Projects:
-        tag = "TSA";
-        break;
+    const bool bHtml = tsa.GetContext()->Config().DoHTML();
+
+   if ( tsa.GetType() == CTSAItem::eTLS_Projects ) {
+
+        list<string> l;
+        string first_id = tsa.GetFirstID();
+        if( bHtml ) {
+            TryToSanitizeHtml( first_id );
+        }
+        string id_range;
+        if ( tsa.GetFirstID() == tsa.GetLastID() ) {
+            id_range = first_id;
+        } else {
+            string last_id = tsa.GetLastID();
+            id_range = first_id + "-" + last_id;
+        }
+
+        if( bHtml ) {
+            TryToSanitizeHtml( id_range );
+
+            string tls_master = tsa.GetContext()->GetTLSMasterName();
+            tls_master = tls_master.substr(0, 6);
+            TryToSanitizeHtml(tls_master);
+            if( ! tls_master.empty() ) {
+                id_range = "<a href=\"https://www.ncbi.nlm.nih.gov/Traces/wgs?val=" + tls_master + "#contigs\">" + id_range + "</a>";
+            }
+        }
+
+        Wrap(l, "TLS", id_range, ePara, bHtml);
+
+        text_os.AddParagraph(l, tsa.GetObject());
 
-    default:
         return;
     }
 
-    const bool bHtml = tsa.GetContext()->Config().DoHTML();
-
     list<string> l;
     string first_id = tsa.GetFirstID();
     if( bHtml ) {
@@ -2102,7 +2127,7 @@ void CGenbankFormatter::FormatTSA
         }
     }
 
-    Wrap(l, tag, id_range, ePara, bHtml);
+    Wrap(l, "TSA", id_range, ePara, bHtml);
 
     text_os.AddParagraph(l, tsa.GetObject());
 }
diff --git a/c++/src/objtools/format/genbank_gather.cpp b/c++/src/objtools/format/genbank_gather.cpp
index d63f16e..51636ea 100644
--- a/c++/src/objtools/format/genbank_gather.cpp
+++ b/c++/src/objtools/format/genbank_gather.cpp
@@ -1,4 +1,4 @@
-/*  $Id: genbank_gather.cpp 428492 2014-03-04 21:09:14Z kans $
+/*  $Id: genbank_gather.cpp 500529 2016-05-05 14:28:05Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -132,6 +132,12 @@ void CGenbankGatherer::x_DoSingleSection(CBioseqContext& ctx) const
         }
     }
 
+    if (cfg.IsFormatLite()) {
+        // minimal information for Lite format
+        GATHER_BLOCK(Locus, CLocusItem);
+        return;
+    }
+
     // gather needed blocks
     GATHER_BLOCK(Head, CStartSectionItem);
     GATHER_ANCHOR(Locus, "locus");
@@ -187,10 +193,13 @@ void CGenbankGatherer::x_DoSingleSection(CBioseqContext& ctx) const
         GATHER_VIA_FUNC(Wgs, x_GatherWGS);
     } else if( ctx.IsTSAMaster()  &&
                ctx.GetTech() == CMolInfo::eTech_tsa &&
-               ctx.GetBiomol() == CMolInfo::eBiomol_mRNA ) 
+               (ctx.GetBiomol() == CMolInfo::eBiomol_mRNA || ctx.GetBiomol() == CMolInfo::eBiomol_transcribed_RNA) ) 
     {
         // Yes, the TSA info is considered a kind of PRIMARY block
         GATHER_VIA_FUNC(Tsa, x_GatherTSA);
+    } else if( ctx.IsTLSMaster()  &&  ctx.GetTech() == CMolInfo::eTech_targeted ) 
+    {
+        GATHER_VIA_FUNC(Tsa, x_GatherTLS);
     } else if ( ctx.DoContigStyle() ) {
         if ( cfg.ShowContigFeatures() ) {
             GATHER_VIA_FUNC(FeatAndGap, x_GatherFeatures);
@@ -332,5 +341,40 @@ void CGenbankGatherer::x_GatherTSA(void) const
     }    
 }
 
+void CGenbankGatherer::x_GatherTLS(void) const
+{
+    CBioseqContext& ctx = *m_Current;
+
+    const string* first = 0;
+    const string* last  = 0;
+
+    for (CSeqdesc_CI desc(ctx.GetHandle(), CSeqdesc::e_User);  desc;  ++desc) {
+        const CUser_object& uo = desc->GetUser();
+
+        const string& type = uo.GetType().GetStr();
+        if ( ! NStr::EqualNocase(type, "TLSProjects") )
+        {
+            continue;
+        }
+
+        ITERATE (CUser_object::TData, it, uo.GetData()) {
+            if ( !(*it)->GetLabel().IsStr() ) {
+                continue;
+            }
+            const string& label = (*it)->GetLabel().GetStr();
+            if ( NStr::CompareNocase(label, "TLS_accession_first") == 0 ) {
+                first = &((*it)->GetData().GetStr());
+            } else if ( NStr::CompareNocase(label, "TLS_accession_last") == 0 ) {
+                last = &((*it)->GetData().GetStr());
+            }
+        }
+
+        if ( (first != 0)  &&  (last != 0) ) {
+            CConstRef<IFlatItem> item( new CTSAItem(CTSAItem::eTLS_Projects, *first, *last, uo, ctx) );
+            ItemOS() << item;
+        }
+    }    
+}
+
 END_SCOPE(objects)
 END_NCBI_SCOPE
diff --git a/c++/src/objtools/format/gene_finder.cpp b/c++/src/objtools/format/gene_finder.cpp
index 4eca430..f8c065f 100644
--- a/c++/src/objtools/format/gene_finder.cpp
+++ b/c++/src/objtools/format/gene_finder.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gene_finder.cpp 481005 2015-10-06 14:22:12Z ivanov $
+/*  $Id: gene_finder.cpp 490514 2016-01-26 18:13:55Z kans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -677,6 +677,8 @@ CGeneFinder::GetFeatViaSubsetThenExtremesIfPossible(
     return GetFeatViaSubsetThenExtremesIfPossible_Helper( ctx, scope, *cleaned_location, sought_type, filtering_gene_xref );
 }
 
+SAFE_CONST_STATIC_STRING(kGbLoader, "GBLOADER");
+
 // static
 CConstRef<CSeq_feat> 
 CGeneFinder::GetFeatViaSubsetThenExtremesIfPossible_Helper(
@@ -686,27 +688,28 @@ CGeneFinder::GetFeatViaSubsetThenExtremesIfPossible_Helper(
     // holds reference to temporary scope if it's used
     CRef<CScope> temp_scope;
 
-    const static string kGbLoader = "GBLOADER";
     bool needToAddGbLoaderBack = false;
     if( scope && ( ctx.IsEMBL() || ctx.IsDDBJ() ) && 
-        scope->GetObjectManager().FindDataLoader(kGbLoader) ) 
+        scope->GetObjectManager().FindDataLoader(*kGbLoader) ) 
     {
         // try to remove the GBLOADER temporarily
         try {
-            scope->RemoveDataLoader(kGbLoader);
+            scope->RemoveDataLoader(*kGbLoader);
             needToAddGbLoaderBack = true;
         } catch(...) {
             // we couldn't remove the GBLOADER temporarily, so we make a temporary substitute CScope
-
-            // add copy of scope, but without the gbloader
-            // TODO: check if this call is fast
-            scope = new CScope(*CObjectManager::GetInstance());
-            scope->AddDefaults();
-            scope->RemoveDataLoader(kGbLoader);
-            temp_scope.Reset(scope);
+            scope = NULL;
         }
     }
 
+    if (scope == NULL) {
+        // TODO: check if this call is fast
+        temp_scope.Reset(new CScope(*CObjectManager::GetInstance()));
+        temp_scope->AddDefaults();
+        temp_scope->RemoveDataLoader(*kGbLoader);
+        scope = temp_scope.GetPointer();
+    }
+    
     CConstRef<CSeq_feat> feat;
     feat = GetFeatViaSubsetThenExtremesIfPossible_Helper_subset(
         ctx, scope, location, sought_type,
@@ -718,7 +721,7 @@ CGeneFinder::GetFeatViaSubsetThenExtremesIfPossible_Helper(
     }
 
     if( needToAddGbLoaderBack ) {
-        scope->AddDataLoader(kGbLoader);
+        scope->AddDataLoader(*kGbLoader);
     }
 
     return feat;
diff --git a/c++/src/objtools/format/genome_project_item.cpp b/c++/src/objtools/format/genome_project_item.cpp
index a31795f..f05d12e 100644
--- a/c++/src/objtools/format/genome_project_item.cpp
+++ b/c++/src/objtools/format/genome_project_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: genome_project_item.cpp 482361 2015-10-22 15:48:50Z ivanov $
+/*  $Id: genome_project_item.cpp 482262 2015-10-21 19:18:29Z kans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/gff_gather.cpp b/c++/src/objtools/format/gff_gather.cpp
index 5b08af4..4cac7c9 100644
--- a/c++/src/objtools/format/gff_gather.cpp
+++ b/c++/src/objtools/format/gff_gather.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gff_gather.cpp 478453 2015-09-09 15:25:04Z ivanov $
+/*  $Id: gff_gather.cpp 477043 2015-08-25 20:27:27Z kans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/inst_info_map.cpp b/c++/src/objtools/format/inst_info_map.cpp
index 4733995..4d548ee 100644
--- a/c++/src/objtools/format/inst_info_map.cpp
+++ b/c++/src/objtools/format/inst_info_map.cpp
@@ -1,4 +1,4 @@
-/* $Id: inst_info_map.cpp 451488 2014-11-06 20:12:57Z kans $
+/* $Id: inst_info_map.cpp 498880 2016-04-20 13:36:23Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -62,7 +62,7 @@ CInstInfoMap::GetInstitutionVoucherInfo(
     static const string  s_fsu_base("http://www.prz.uni-jena.de/data.php?fsu=");
     static const string  s_jcm_base("http://www.jcm.riken.jp/cgi-bin/jcm/jcm_number?JCM=");
     static const string  s_kctc_base("http://www.brc.re.kr/English/_SearchView.aspx?sn=");
-    static const string  s_ku_base("http://collections.nhm.ku.edu/");
+    static const string  s_ku_base("https://ichthyology.specify.ku.edu/specify/bycatalog/");
     static const string  s_lcr_base("http://scd.landcareresearch.co.nz/Specimen/");
     static const string  s_maff_base("http://www.gene.affrc.go.jp/databases-micro_search_detail_en.php?maff=");
     static const string  s_mcz_base("http://mczbase.mcz.harvard.edu/guid/");
@@ -70,6 +70,7 @@ CInstInfoMap::GetInstitutionVoucherInfo(
     static const string  s_mucl_base("http://bccm.belspo.be/db/mucl_search_results.php?FIRSTITEM=1&LIST1=STRAIN_NUMBER&TEXT1=");
     static const string  s_nbrc_base("http://www.nbrc.nite.go.jp/NBRC2/NBRCCatalogueDetailServlet?ID=NBRC&CAT=");
     static const string  s_ncimb_base("http://www.ncimb.com/BioloMICS.aspx?Table=NCIMBstrains&ExactMatch=T&Fields=All&Name=NCIMB%20");
+    static const string  s_nctc_base("https://www.phe-culturecollections.org.uk/products/bacteria/detail.jsp?collection=nctc&refId=NCTC+");
     static const string  s_nrrl_base("http://nrrl.ncaur.usda.gov/cgi-bin/usda/prokaryote/report.html?nrrlcodes=“");
     static const string  s_pcc_base("http://www.crbip.pasteur.fr/fiches/fichecata.jsp?crbip=PCC+");
     static const string  s_pcmb_base("http://www2.bishopmuseum.org/HBS/PCMB/results3.asp?searchterm3=");
@@ -79,7 +80,9 @@ CInstInfoMap::GetInstitutionVoucherInfo(
     static const string  s_uam_base("http://arctos.database.museum/guid/");
     static const string  s_uamh_base("https://secure.devonian.ualberta.ca/uamh/details.php?id=");
     static const string  s_usnm_base("http://collections.mnh.si.edu/services/resolver/resolver.php?");
-    static const string  s_ypm_base("http://peabody.research.yale.edu/cgi-bin/Query.Ledger?");
+    static const string  s_ypm_base("http://collections.peabody.yale.edu/search/Record/");
+
+    static const string yp0("0");
 
     static const string s_colon_pfx(":");
     static const string s_uscr_pfx("_");
@@ -89,111 +92,113 @@ CInstInfoMap::GetInstitutionVoucherInfo(
     static const string s_psu_pfx("PSU:Mamm:");
     static const string s_usnm_pfx("voucher=Birds:");
 
-    static const string s_ypment_pfx("LE=ent&SU=0&ID=");
-    static const string s_ypmher_pfx("LE=her&SU=0&ID=");
-    static const string s_ypmich_pfx("LE=ich&SU=0&ID=");
-    static const string s_ypmiz_pfx("LE=iz&SU=0&ID=");
-    static const string s_ypmmam_pfx("LE=mam&SU=0&ID=");
-    static const string s_ypmorn_pfx("LE=orn&SU=0&ID=");
+    static const string s_ypment_pfx("YPM-ENT-");
+    static const string s_ypmher_pfx("YPM-HER-");
+    static const string s_ypmich_pfx("YPM-ICH-");
+    static const string s_ypmiz_pfx ("YPM-IZ-");
+    static const string s_ypmmam_pfx("YPM-MAM-");
+    static const string s_ypmorn_pfx("YPM-ORN-");
 
     static const string s_acbr_sfx("&Fields=All&ExactMatch=T");
     static const string s_atcc_sfx(".aspx");
     static const string s_bcrc_sfx("&type_id=9&keyword=");
+    static const string s_ku_sfx("/");
     static const string s_mucl_sfx("&LIST2=ALL+FIELDS&CONJ=OR&RANGE=20&B3=Run+Query");
     static const string s_pycc_sfx("&Fields=All&ExactMatch=T");
 
     typedef SStaticPair<const char*, TVoucherInfoRef> TVoucherInfoElem;
     static const TVoucherInfoElem sc_voucher_info_map[] = {
-        { "ACBR",             TVoucherInfoRef(new SVoucherInfo(&s_acbr_base,  false, NULL,          &s_acbr_sfx, "Austrian Center of Biological Resources and Applied Mycology") ) },
-        { "ATCC",             TVoucherInfoRef(new SVoucherInfo(&s_atcc_base,  false, NULL,          &s_atcc_sfx, "American Type Culture Collection") ) },
-        { "BCRC",             TVoucherInfoRef(new SVoucherInfo(&s_bcrc_base,  false, NULL,          &s_bcrc_sfx, "Bioresource Collection and Research Center") ) },
-        { "CAS:HERP",         TVoucherInfoRef(new SVoucherInfo(&s_cas_base,   true,  &s_colon_pfx,  NULL,        "California Academy of Sciences, Herpetology collection") ) },
-        { "CBS",              TVoucherInfoRef(new SVoucherInfo(&s_cbs_base,   false, NULL,          NULL,        "Centraalbureau voor Schimmelcultures, Fungal and Yeast Collection") ) },
-        { "CCAP",             TVoucherInfoRef(new SVoucherInfo(&s_ccap_base,  false, NULL,          NULL,        "Culture Collection of Algae and Protozoa") ) },
-        { "CCMP",             TVoucherInfoRef(new SVoucherInfo(&s_ccmp_base,  false, NULL,          NULL,        "Provasoli-Guillard National Center for Culture of Marine Phytoplankton") ) },
-        { "CCUG",             TVoucherInfoRef(new SVoucherInfo(&s_ccug_base,  false, NULL,          NULL,        "Culture Collection, University of Goteborg, Department of Clinical Bacteriology") ) },
-        { "CFMR",             TVoucherInfoRef(new SVoucherInfo(&s_cfmr_base,  false, NULL,          NULL,        "Center for Forest Mycology Research") ) },
-        { "CHR",              TVoucherInfoRef(new SVoucherInfo(&s_lcr_base,   true,  &s_uscr_pfx,   NULL,        "Allan Herbarium, Landcare Research New Zealand Limited") ) },
-        { "CRCM:Bird",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Washington State University, Charles R. Conner Museum, bird collection") ) },
-        { "Coriell",          TVoucherInfoRef(new SVoucherInfo(&s_cori_base,  false, NULL,          NULL,        "Coriell Institute for Medical Research") ) },
-        { "DGR:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, bird tissue collection") ) },
-        { "DGR:Ento",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, entomology tissue collection") ) },
-        { "DGR:Fish",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, fish tissue collection") ) },
-        { "DGR:Herp",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, herpetology tissue collection") ) },
-        { "DGR:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, mammal tissue collection") ) },
-        { "DMNS:Bird",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Denver Museum of Nature and Science, Ornithology Collections") ) },
-        { "DMNS:Mamm",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Denver Museum of Nature and Science, Mammology Collection") ) },
-        { "DSM",              TVoucherInfoRef(new SVoucherInfo(&s_dsmz_base,  false, NULL,          NULL,        "Deutsche Sammlung von Mikroorganismen und Zellkulturen GmbH") ) },
-        { "FRR",              TVoucherInfoRef(new SVoucherInfo(&s_frr_base,   false, NULL,          NULL,        "Food Science Australia, Ryde") ) },
-        { "FSU<DEU>",         TVoucherInfoRef(new SVoucherInfo(&s_fsu_base,   false, NULL,          NULL,        "Jena Microbial Resource Collection") ) },
-        { "ICMP",             TVoucherInfoRef(new SVoucherInfo(&s_lcr_base,   true,  &s_uscr_pfx,   NULL,        "International Collection of Microorganisms from Plants") ) },
-        { "JCM",              TVoucherInfoRef(new SVoucherInfo(&s_jcm_base,   false, NULL,          NULL,        "Japan Collection of Microorganisms") ) },
-        { "KCTC",             TVoucherInfoRef(new SVoucherInfo(&s_kctc_base,  false, NULL,          NULL,        "Korean Collection for Type Cultures") ) },
-        { "KNWR:Ento",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Kenai National Wildlife Refuge, Entomology Collection") ) },
-        /*
-        { "KU:I",             TVoucherInfoRef(new SVoucherInfo(&s_ku_base,    false, &s_kui_pfx,    NULL,        "University of Kansas, Museum of Natural History, Ichthyology collection") ) },
-        { "KU:IT",            TVoucherInfoRef(new SVoucherInfo(&s_ku_base,    false, &s_kuit_pfx,   NULL,        "University of Kansas, Museum of Natural History, Ichthyology tissue collection") ) },
-        */
-        { "KWP:Ento",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Kenelm W. Philip Collection, University of Alaska Museum of the North, Lepidoptera collection") ) },
-        { "MAFF",             TVoucherInfoRef(new SVoucherInfo(&s_maff_base,  false, NULL,          NULL,        "Genebank, Ministry of Agriculture Forestry and Fisheries") ) },
-        { "MCZ:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Ornithology Collection") ) },
-        { "MCZ:Cryo",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Cryogenic Collection") ) },
-        { "MCZ:Ent",          TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Entomology Collection") ) },
-        { "MCZ:Fish",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Icthyology Collection") ) },
-        { "MCZ:Herp",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Herpetology Collection") ) },
-        { "MCZ:IP",           TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Invertebrate Paleontology Collection") ) },
-        { "MCZ:IZ",           TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Invertebrate Zoology Collection") ) },
-        { "MCZ:Mala",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Mollusk Collection") ) },
-        { "MCZ:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Mammal Collection") ) },
-        { "MLZ:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Moore Laboratory of Zoology, Occidental College, Bird Collection" ) ) },
-        { "MLZ:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Moore Laboratory of Zoology, Occidental College, Mammal Collection" ) ) },
-        { "MSB:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Southwestern Biology, Bird Collection") ) },
-        { "MSB:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Southwestern Biology, Mammal Collection") ) },
-        { "MSB:Para",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Southwestern Biology, Parasitology Collection") ) },
-        { "MTCC",             TVoucherInfoRef(new SVoucherInfo(&s_mtcc_base,  false, NULL,          NULL,        "Microbial Type Culture Collection & Gene Bank") ) },
-        { "MUCL",             TVoucherInfoRef(new SVoucherInfo(&s_mucl_base,  false, NULL,          &s_mucl_sfx, "Mycotheque de l'Universite Catholique de Louvain") ) },
-        { "MVZ:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Bird Collection") ) },
-        { "MVZ:Egg",          TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Egg Collection") ) },
-        { "MVZ:Herp",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Herpetology Collection") ) },
-        { "MVZ:Hild",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Milton Hildebrand collection") ) },
-        { "MVZ:Img",          TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Image Collection") ) },
-        { "MVZ:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Mammal Collection") ) },
-        { "MVZ:Page",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Notebook Page Collection") ) },
-        { "MVZObs:Herp",      TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Herpetology Collection") ) },
-        { "NBRC",             TVoucherInfoRef(new SVoucherInfo(&s_nbrc_base,  false, NULL,          NULL,        "NITE Biological Resource Center") ) },
-        { "NBSB:Bird",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "National Biomonitoring Specimen Bank, U.S. Geological Survey, bird collection") ) },
-        { "NCIMB",            TVoucherInfoRef(new SVoucherInfo(&s_ncimb_base, false, NULL,          NULL,        "National Collections of Industrial Food and Marine Bacteria (incorporating the NCFB)") ) },
-        { "NRRL",             TVoucherInfoRef(new SVoucherInfo(&s_nrrl_base,  false, NULL,          NULL,        "Agricultural Research Service Culture Collection") ) },
-        { "NZAC",             TVoucherInfoRef(new SVoucherInfo(&s_lcr_base,   true,  &s_uscr_pfx,   NULL,        "New Zealand Arthropod Collection") ) },
-        { "PCC",              TVoucherInfoRef(new SVoucherInfo(&s_pcc_base,   false, NULL,          NULL,        "Pasteur Culture Collection of Cyanobacteria") ) },
-        { "PCMB",             TVoucherInfoRef(new SVoucherInfo(&s_pcmb_base,  false, NULL,          NULL,        "The Pacific Center for Molecular Biodiversity") ) },
-        { "PDD",              TVoucherInfoRef(new SVoucherInfo(&s_lcr_base,   true,  &s_uscr_pfx,   NULL,        "New Zealand Fungal Herbarium") ) },
-        { "PSU<USA-OR>:Mamm", TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   false, &s_psu_pfx,    NULL,        "Portland State University, Vertebrate Biology Museum, Mammal Collection") ) },
-        { "PYCC",             TVoucherInfoRef(new SVoucherInfo(&s_pycc_base,  false, NULL,          &s_pycc_sfx, "Portuguese Yeast Culture Collection") ) },
-        { "SAG",              TVoucherInfoRef(new SVoucherInfo(&s_sag_base,   false, NULL,          NULL,        "Sammlung von Algenkulturen at Universitat Gottingen") ) },
-        { "TGRC",             TVoucherInfoRef(new SVoucherInfo(&s_tgrc_base,  false, NULL,          NULL,        "C.M. Rick Tomato Genetics Resource Center") ) },
-        { "UAM:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Bird Collection") ) },
-        { "UAM:Bryo",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Bryozoan Collection") ) },
-        { "UAM:Crus",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Marine Arthropod Collection") ) },
-        { "UAM:Ento",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Insect Collection") ) },
-        { "UAM:Fish",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Fish Collection") ) },
-        { "UAM:Herb",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, UAM Herbarium") ) },
-        { "UAM:Herp",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Amphibian and Reptile Collection") ) },
-        { "UAM:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Mammal Collection") ) },
-        { "UAM:Moll",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Mollusc Collection") ) },
-        { "UAM:Paleo",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, paleontology collection") ) },
-        { "UAMH",             TVoucherInfoRef(new SVoucherInfo(&s_uamh_base,  false, NULL,          NULL,        "University of Alberta Microfungus Collection and Herbarium") ) },
-        { "UAMObs:Mamm",      TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Mammal Collection") ) },
-        { "USNM:Birds",       TVoucherInfoRef(new SVoucherInfo(&s_usnm_base,  false, &s_usnm_pfx,   NULL,        "National Museum of Natural History, Smithsonian Institution, Division of Birds") ) },
-        { "WNMU:Bird",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Western New Mexico University Museum, bird collection") ) },
-        { "WNMU:Fish",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Western New Mexico University Museum, fish collection") ) },
-        { "WNMU:Mamm",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  &s_colon_pfx,  NULL,        "Western New Mexico University Museum, mammal collection") ) },
-        { "YPM:ENT",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, &s_ypment_pfx, NULL,        "Yale Peabody Museum of Natural History, Entomology Collection") ) },
-        { "YPM:HER",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, &s_ypmher_pfx, NULL,        "Yale Peabody Museum of Natural History, Herpetology Collection") ) },
-        { "YPM:ICH",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, &s_ypmich_pfx, NULL,        "Yale Peabody Museum of Natural History, Ichthyology Collection") ) },
-        { "YPM:IZ",           TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, &s_ypmiz_pfx,  NULL,        "Yale Peabody Museum of Natural History, Invertebrate Zoology Collection") ) },
-        { "YPM:MAM",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, &s_ypmmam_pfx, NULL,        "Yale Peabody Museum of Natural History, Mammology Collection") ) },
-        { "YPM:ORN",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, &s_ypmorn_pfx, NULL,        "Yale Peabody Museum of Natural History, Ornithology Collection") ) }
+        { "ACBR",             TVoucherInfoRef(new SVoucherInfo(&s_acbr_base,  false, 0, NULL,   NULL,          &s_acbr_sfx, "Austrian Center of Biological Resources and Applied Mycology") ) },
+        { "ATCC",             TVoucherInfoRef(new SVoucherInfo(&s_atcc_base,  false, 0, NULL,   NULL,          &s_atcc_sfx, "American Type Culture Collection") ) },
+        { "BCRC",             TVoucherInfoRef(new SVoucherInfo(&s_bcrc_base,  false, 0, NULL,   NULL,          &s_bcrc_sfx, "Bioresource Collection and Research Center") ) },
+        { "CAS:HERP",         TVoucherInfoRef(new SVoucherInfo(&s_cas_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "California Academy of Sciences, Herpetology collection") ) },
+        { "CBS",              TVoucherInfoRef(new SVoucherInfo(&s_cbs_base,   false, 0, NULL,   NULL,          NULL,        "Centraalbureau voor Schimmelcultures, Fungal and Yeast Collection") ) },
+        { "CCAP",             TVoucherInfoRef(new SVoucherInfo(&s_ccap_base,  false, 0, NULL,   NULL,          NULL,        "Culture Collection of Algae and Protozoa") ) },
+        { "CCMP",             TVoucherInfoRef(new SVoucherInfo(&s_ccmp_base,  false, 0, NULL,   NULL,          NULL,        "Provasoli-Guillard National Center for Culture of Marine Phytoplankton") ) },
+        { "CCUG",             TVoucherInfoRef(new SVoucherInfo(&s_ccug_base,  false, 0, NULL,   NULL,          NULL,        "Culture Collection, University of Goteborg, Department of Clinical Bacteriology") ) },
+        { "CFMR",             TVoucherInfoRef(new SVoucherInfo(&s_cfmr_base,  false, 0, NULL,   NULL,          NULL,        "Center for Forest Mycology Research") ) },
+        { "CHR",              TVoucherInfoRef(new SVoucherInfo(&s_lcr_base,   true,  0, NULL,   &s_uscr_pfx,   NULL,        "Allan Herbarium, Landcare Research New Zealand Limited") ) },
+        { "CRCM:Bird",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Washington State University, Charles R. Conner Museum, bird collection") ) },
+        { "Coriell",          TVoucherInfoRef(new SVoucherInfo(&s_cori_base,  false, 0, NULL,   NULL,          NULL,        "Coriell Institute for Medical Research") ) },
+        { "DGR:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, bird tissue collection") ) },
+        { "DGR:Ento",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, entomology tissue collection") ) },
+        { "DGR:Fish",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, fish tissue collection") ) },
+        { "DGR:Herp",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, herpetology tissue collection") ) },
+        { "DGR:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Division of Genomic Resources, University of New Mexico, mammal tissue collection") ) },
+        { "DMNS:Bird",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Denver Museum of Nature and Science, Ornithology Collections") ) },
+        { "DMNS:Mamm",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Denver Museum of Nature and Science, Mammology Collection") ) },
+        { "DSM",              TVoucherInfoRef(new SVoucherInfo(&s_dsmz_base,  false, 0, NULL,   NULL,          NULL,        "Deutsche Sammlung von Mikroorganismen und Zellkulturen GmbH") ) },
+        { "FRR",              TVoucherInfoRef(new SVoucherInfo(&s_frr_base,   false, 0, NULL,   NULL,          NULL,        "Food Science Australia, Ryde") ) },
+        { "FSU<DEU>",         TVoucherInfoRef(new SVoucherInfo(&s_fsu_base,   false, 0, NULL,   NULL,          NULL,        "Jena Microbial Resource Collection") ) },
+        { "ICMP",             TVoucherInfoRef(new SVoucherInfo(&s_lcr_base,   true,  0, NULL,   &s_uscr_pfx,   NULL,        "International Collection of Microorganisms from Plants") ) },
+        { "JCM",              TVoucherInfoRef(new SVoucherInfo(&s_jcm_base,   false, 0, NULL,   NULL,          NULL,        "Japan Collection of Microorganisms") ) },
+        { "KCTC",             TVoucherInfoRef(new SVoucherInfo(&s_kctc_base,  false, 0, NULL,   NULL,          NULL,        "Korean Collection for Type Cultures") ) },
+        { "KNWR:Ento",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Kenai National Wildlife Refuge, Entomology Collection") ) },
+        { "KU:I",             TVoucherInfoRef(new SVoucherInfo(&s_ku_base,    false, 0, NULL,   &s_kui_pfx,    NULL,        "University of Kansas, Museum of Natural History, Ichthyology collection") ) },
+        { "KU:IT",            TVoucherInfoRef(new SVoucherInfo(&s_ku_base,    false, 0, NULL,   &s_kuit_pfx,   NULL,        "University of Kansas, Museum of Natural History, Ichthyology tissue collection") ) },
+        { "KWP:Ento",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Kenelm W. Philip Collection, University of Alaska Museum of the North, Lepidoptera collection") ) },
+        { "MAFF",             TVoucherInfoRef(new SVoucherInfo(&s_maff_base,  false, 0, NULL,   NULL,          NULL,        "Genebank, Ministry of Agriculture Forestry and Fisheries") ) },
+        { "MCZ:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Ornithology Collection") ) },
+        { "MCZ:Cryo",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Cryogenic Collection") ) },
+        { "MCZ:Ent",          TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Entomology Collection") ) },
+        { "MCZ:Fish",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Icthyology Collection") ) },
+        { "MCZ:Herp",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Herpetology Collection") ) },
+        { "MCZ:IP",           TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Invertebrate Paleontology Collection") ) },
+        { "MCZ:IZ",           TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Invertebrate Zoology Collection") ) },
+        { "MCZ:Ich",          TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Icthyology Collection") ) },
+        { "MCZ:Mala",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Mollusk Collection") ) },
+        { "MCZ:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Mammal Collection") ) },
+        { "MCZ:Orn",          TVoucherInfoRef(new SVoucherInfo(&s_mcz_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Harvard Museum of Comparative Zoology, Ornithology Collection") ) },
+        { "MLZ:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Moore Laboratory of Zoology, Occidental College, Bird Collection" ) ) },
+        { "MLZ:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Moore Laboratory of Zoology, Occidental College, Mammal Collection" ) ) },
+        { "MSB:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Southwestern Biology, Bird Collection") ) },
+        { "MSB:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Southwestern Biology, Mammal Collection") ) },
+        { "MSB:Para",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Southwestern Biology, Parasitology Collection") ) },
+        { "MTCC",             TVoucherInfoRef(new SVoucherInfo(&s_mtcc_base,  false, 0, NULL,   NULL,          NULL,        "Microbial Type Culture Collection & Gene Bank") ) },
+        { "MUCL",             TVoucherInfoRef(new SVoucherInfo(&s_mucl_base,  false, 0, NULL,   NULL,          &s_mucl_sfx, "Mycotheque de l'Universite Catholique de Louvain") ) },
+        { "MVZ:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Bird Collection") ) },
+        { "MVZ:Egg",          TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Egg Collection") ) },
+        { "MVZ:Herp",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Herpetology Collection") ) },
+        { "MVZ:Hild",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Milton Hildebrand collection") ) },
+        { "MVZ:Img",          TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Image Collection") ) },
+        { "MVZ:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Mammal Collection") ) },
+        { "MVZ:Page",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Notebook Page Collection") ) },
+        { "MVZObs:Herp",      TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Museum of Vertebrate Zoology, University of California at Berkeley, Herpetology Collection") ) },
+        { "NBRC",             TVoucherInfoRef(new SVoucherInfo(&s_nbrc_base,  false, 0, NULL,   NULL,          NULL,        "NITE Biological Resource Center") ) },
+        { "NBSB:Bird",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "National Biomonitoring Specimen Bank, U.S. Geological Survey, bird collection") ) },
+        { "NCIMB",            TVoucherInfoRef(new SVoucherInfo(&s_ncimb_base, false, 0, NULL,   NULL,          NULL,        "National Collections of Industrial Food and Marine Bacteria (incorporating the NCFB)") ) },
+        { "NCTC",             TVoucherInfoRef(new SVoucherInfo(&s_nctc_base,  false, 0, NULL,   NULL,          NULL,        "National Collection of Type Cultures") ) },
+        { "NRRL",             TVoucherInfoRef(new SVoucherInfo(&s_nrrl_base,  false, 0, NULL,   NULL,          NULL,        "Agricultural Research Service Culture Collection") ) },
+        { "NZAC",             TVoucherInfoRef(new SVoucherInfo(&s_lcr_base,   true,  0, NULL,   &s_uscr_pfx,   NULL,        "New Zealand Arthropod Collection") ) },
+        { "PCC",              TVoucherInfoRef(new SVoucherInfo(&s_pcc_base,   false, 0, NULL,   NULL,          NULL,        "Pasteur Culture Collection of Cyanobacteria") ) },
+        { "PCMB",             TVoucherInfoRef(new SVoucherInfo(&s_pcmb_base,  false, 0, NULL,   NULL,          NULL,        "The Pacific Center for Molecular Biodiversity") ) },
+        { "PDD",              TVoucherInfoRef(new SVoucherInfo(&s_lcr_base,   true,  0, NULL,   &s_uscr_pfx,   NULL,        "New Zealand Fungal Herbarium") ) },
+        { "PSU<USA-OR>:Mamm", TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   false, 0, NULL,   &s_psu_pfx,    NULL,        "Portland State University, Vertebrate Biology Museum, Mammal Collection") ) },
+        { "PYCC",             TVoucherInfoRef(new SVoucherInfo(&s_pycc_base,  false, 0, NULL,   NULL,          &s_pycc_sfx, "Portuguese Yeast Culture Collection") ) },
+        { "SAG",              TVoucherInfoRef(new SVoucherInfo(&s_sag_base,   false, 0, NULL,   NULL,          NULL,        "Sammlung von Algenkulturen at Universitat Gottingen") ) },
+        { "TGRC",             TVoucherInfoRef(new SVoucherInfo(&s_tgrc_base,  false, 0, NULL,   NULL,          NULL,        "C.M. Rick Tomato Genetics Resource Center") ) },
+        { "UAM:Bird",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Bird Collection") ) },
+        { "UAM:Bryo",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Bryozoan Collection") ) },
+        { "UAM:Crus",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Marine Arthropod Collection") ) },
+        { "UAM:Ento",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Insect Collection") ) },
+        { "UAM:Fish",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Fish Collection") ) },
+        { "UAM:Herb",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, UAM Herbarium") ) },
+        { "UAM:Herp",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Amphibian and Reptile Collection") ) },
+        { "UAM:Mamm",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Mammal Collection") ) },
+        { "UAM:Moll",         TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Mollusc Collection") ) },
+        { "UAM:Paleo",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, paleontology collection") ) },
+        { "UAMH",             TVoucherInfoRef(new SVoucherInfo(&s_uamh_base,  false, 0, NULL,   NULL,          NULL,        "University of Alberta Microfungus Collection and Herbarium") ) },
+        { "UAMObs:Mamm",      TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "University of Alaska, Museum of the North, Mammal Collection") ) },
+        { "USNM:Birds",       TVoucherInfoRef(new SVoucherInfo(&s_usnm_base,  false, 0, NULL,   &s_usnm_pfx,   NULL,        "National Museum of Natural History, Smithsonian Institution, Division of Birds") ) },
+        { "WNMU:Bird",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Western New Mexico University Museum, bird collection") ) },
+        { "WNMU:Fish",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Western New Mexico University Museum, fish collection") ) },
+        { "WNMU:Mamm",        TVoucherInfoRef(new SVoucherInfo(&s_uam_base,   true,  0, NULL,   &s_colon_pfx,  NULL,        "Western New Mexico University Museum, mammal collection") ) },
+        { "YPM:ENT",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, 6, &yp0,  &s_ypment_pfx, NULL,        "Yale Peabody Museum of Natural History, Entomology Collection") ) },
+        { "YPM:HER",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, 6, &yp0,  &s_ypmher_pfx, NULL,        "Yale Peabody Museum of Natural History, Herpetology Collection") ) },
+        { "YPM:ICH",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, 6, &yp0,  &s_ypmich_pfx, NULL,        "Yale Peabody Museum of Natural History, Ichthyology Collection") ) },
+        { "YPM:IZ",           TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, 6, &yp0,  &s_ypmiz_pfx,  NULL,        "Yale Peabody Museum of Natural History, Invertebrate Zoology Collection") ) },
+        { "YPM:MAM",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, 6, &yp0,  &s_ypmmam_pfx, NULL,        "Yale Peabody Museum of Natural History, Mammology Collection") ) },
+        { "YPM:ORN",          TVoucherInfoRef(new SVoucherInfo(&s_ypm_base,   false, 6, &yp0,  &s_ypmorn_pfx, NULL,        "Yale Peabody Museum of Natural History, Ornithology Collection") ) }
     };
     typedef CStaticArrayMap<const char*, TVoucherInfoRef, PCase_CStr> TVoucherInfoMap;
     DEFINE_STATIC_ARRAY_MAP(TVoucherInfoMap, sc_VoucherInfoMap, sc_voucher_info_map);
diff --git a/c++/src/objtools/format/inst_info_map.hpp b/c++/src/objtools/format/inst_info_map.hpp
index 3b19f01..54f0d8a 100644
--- a/c++/src/objtools/format/inst_info_map.hpp
+++ b/c++/src/objtools/format/inst_info_map.hpp
@@ -1,4 +1,4 @@
-/* $Id: inst_info_map.hpp 303782 2011-06-13 16:55:07Z kornbluh $
+/* $Id: inst_info_map.hpp 498880 2016-04-20 13:36:23Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -46,17 +46,23 @@ public:
         SVoucherInfo( 
             const string *links,
             bool          prependInstitute,
+            int           pad_to,
+            const string *pad_with,
             const string *prefix,
             const string *suffix,
             const char   *inst_full_name ): 
-        m_Links(links),
+            m_Links(links),
             m_PrependInstitute(prependInstitute),
+            m_PadTo(pad_to),
+            m_PadWith(pad_with),
             m_Prefix(prefix),
             m_Suffix(suffix),
             m_InstFullName(inst_full_name) { }
 
         const string *m_Links;
         bool          m_PrependInstitute;
+        int           m_PadTo;
+        const string *m_PadWith;
         const string *m_Prefix;
         const string *m_Suffix;
         const char   *m_InstFullName;
diff --git a/c++/src/objtools/format/item_formatter.cpp b/c++/src/objtools/format/item_formatter.cpp
index 5112e7b..4910096 100644
--- a/c++/src/objtools/format/item_formatter.cpp
+++ b/c++/src/objtools/format/item_formatter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: item_formatter.cpp 481007 2015-10-06 14:22:51Z ivanov $
+/*  $Id: item_formatter.cpp 500529 2016-05-05 14:28:05Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -83,6 +83,7 @@ CFlatItemFormatter* CFlatItemFormatter::New(CFlatFileConfig::TFormat format)
     switch ( format ) {
     case CFlatFileConfig::eFormat_GenBank:
     case CFlatFileConfig::eFormat_FeaturesOnly:
+    case CFlatFileConfig::eFormat_Lite:
         return new CGenbankFormatter;
         
     case CFlatFileConfig::eFormat_EMBL:
diff --git a/c++/src/objtools/format/keywords_item.cpp b/c++/src/objtools/format/keywords_item.cpp
index 799ebb5..4c7bf1e 100644
--- a/c++/src/objtools/format/keywords_item.cpp
+++ b/c++/src/objtools/format/keywords_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: keywords_item.cpp 468774 2015-05-28 01:25:57Z kans $
+/*  $Id: keywords_item.cpp 493897 2016-03-02 14:22:41Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -233,6 +233,11 @@ void CKeywordsItem::x_GatherInfo(CBioseqContext& ctx)
             is_tsa = true; // remember so we don't add it twice
             break;
 
+        case CMolInfo::eTech_targeted:
+            x_AddKeyword("TLS");
+            x_AddKeyword("Targeted Locus Study");
+            break;
+
         case CMolInfo::eTech_unknown:
         case CMolInfo::eTech_standard:
         case CMolInfo::eTech_other:
@@ -282,7 +287,12 @@ void CKeywordsItem::x_GatherInfo(CBioseqContext& ctx)
         }
     }
 
-    if( ctx.GetUnverifiedType() != CBioseqContext::fUnverified_None ) {
+    CBioseqContext::TUnverified unv = ctx.GetUnverifiedType();
+    if ((unv & CBioseqContext::fUnverified_Organism) != 0) {
+        x_AddKeyword("UNVERIFIED_ORGANISM");
+    } else if ((unv & CBioseqContext::fUnverified_Misassembled) != 0) {
+        x_AddKeyword("UNVERIFIED_MISASSEMBLY");
+    } else if ((unv & CBioseqContext::fUnverified_SequenceOrAnnotation) != 0) {
         x_AddKeyword("UNVERIFIED");
     }
 
diff --git a/c++/src/objtools/format/locus_item.cpp b/c++/src/objtools/format/locus_item.cpp
index 8583a08..753466e 100644
--- a/c++/src/objtools/format/locus_item.cpp
+++ b/c++/src/objtools/format/locus_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: locus_item.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: locus_item.cpp 497806 2016-04-11 13:57:53Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -599,6 +599,19 @@ static CTempString x_GetDivisionProc(const CBioseq_Handle& bsh, bool is_prot,
 string CLocusItem::GetDivision(const CBioseq_Handle& bsh)
 
 {
+    if ( bsh.IsSetInst_Repr() && bsh.GetInst_Repr() == CSeq_inst::eRepr_delta) {
+        if (bsh.IsSetInst_Ext()) {
+            const CBioseq_Handle::TInst_Ext& ext = bsh.GetInst_Ext();
+            if ( ext.IsDelta() ) {
+                ITERATE (CDelta_ext::Tdata, it, ext.GetDelta().Get()) {
+                    if ( (*it)->IsLoc() ) {
+                        return "CON";
+                    }
+                }
+            }
+        }
+    }
+
     CMolInfo::TTech tech = 0;
 
     CSeqdesc_CI::TDescChoices desc_choices;
@@ -608,6 +621,7 @@ string CLocusItem::GetDivision(const CBioseq_Handle& bsh)
     for (CSeqdesc_CI desc_it(bsh, desc_choices); desc_it;  ++desc_it) {
         if (desc_it->Which() == CSeqdesc::e_Molinfo) {
             tech = desc_it->GetMolinfo().GetTech();
+            break;
         }
     }
 
diff --git a/c++/src/objtools/format/primary_item.cpp b/c++/src/objtools/format/primary_item.cpp
index f99c408..f01ac8e 100644
--- a/c++/src/objtools/format/primary_item.cpp
+++ b/c++/src/objtools/format/primary_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: primary_item.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: primary_item.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/qualifiers.cpp b/c++/src/objtools/format/qualifiers.cpp
index d206fda..9cc29e7 100644
--- a/c++/src/objtools/format/qualifiers.cpp
+++ b/c++/src/objtools/format/qualifiers.cpp
@@ -1,4 +1,4 @@
-/*  $Id: qualifiers.cpp 483654 2015-11-03 12:42:05Z ivanov $
+/*  $Id: qualifiers.cpp 493626 2016-03-01 13:43:04Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1164,7 +1164,7 @@ void CFlatSubSourcePrimer::Format(
         if ( NStr::StartsWith( m_fwd_name, "(" ) && NStr::EndsWith( m_fwd_name, ")" ) ) {
             fwd_name = m_fwd_name.substr( 1, m_fwd_name.size() - 2 );
         }
-        NStr::Tokenize( fwd_name, ",", fwd_names );
+        NStr::Split( fwd_name, ",", fwd_names );
     }
     
     vector< string > rev_names;
@@ -1173,14 +1173,14 @@ void CFlatSubSourcePrimer::Format(
         if ( NStr::StartsWith( m_rev_name, "(" ) && NStr::EndsWith( m_rev_name, ")" ) ) {
             rev_name = m_rev_name.substr( 1, m_rev_name.size() - 2 );
         }
-        NStr::Tokenize( rev_name, ",", rev_names );
+        NStr::Split( rev_name, ",", rev_names );
     }
 
     vector< string > fwd_seqs;
     if ( ! m_fwd_seq.empty() ) {
         string fwd_seq = NStr::Replace( m_fwd_seq, "(", "" );
         NStr::ReplaceInPlace( fwd_seq, ")", "" );
-        NStr::Tokenize( fwd_seq, ",", fwd_seqs );
+        NStr::Split( fwd_seq, ",", fwd_seqs );
     }
     if ( fwd_seqs.empty() ) {
         return;
@@ -1190,7 +1190,7 @@ void CFlatSubSourcePrimer::Format(
     if ( ! m_rev_seq.empty() ) {
         string rev_seq = NStr::Replace( m_rev_seq, "(", "" );
         NStr::ReplaceInPlace( rev_seq, ")", "" );
-        NStr::Tokenize( rev_seq, ",", rev_seqs );
+        NStr::Split( rev_seq, ",", rev_seqs );
     }
 
     for ( size_t i=0; i < fwd_seqs.size(); ++i ) {
diff --git a/c++/src/objtools/format/reference_item.cpp b/c++/src/objtools/format/reference_item.cpp
index 7ae5286..2b5e63b 100644
--- a/c++/src/objtools/format/reference_item.cpp
+++ b/c++/src/objtools/format/reference_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reference_item.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: reference_item.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/sam_formatter.cpp b/c++/src/objtools/format/sam_formatter.cpp
index 6b4f1bb..d9db4e3 100644
--- a/c++/src/objtools/format/sam_formatter.cpp
+++ b/c++/src/objtools/format/sam_formatter.cpp
@@ -1,4 +1,4 @@
-/*  $Id: sam_formatter.cpp 485551 2015-11-23 18:31:26Z ivanov $
+/*  $Id: sam_formatter.cpp 485538 2015-11-23 16:45:34Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/format/source_item.cpp b/c++/src/objtools/format/source_item.cpp
index 890c91a..ddcbc30 100644
--- a/c++/src/objtools/format/source_item.cpp
+++ b/c++/src/objtools/format/source_item.cpp
@@ -1,4 +1,4 @@
-/*  $Id: source_item.cpp 474406 2015-07-28 18:14:17Z ivanov $
+/*  $Id: source_item.cpp 472056 2015-07-06 19:29:12Z gotvyans $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/readers/bed_reader.cpp b/c++/src/objtools/readers/bed_reader.cpp
index 14dc7ab..1ea5a22 100644
--- a/c++/src/objtools/readers/bed_reader.cpp
+++ b/c++/src/objtools/readers/bed_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: bed_reader.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: bed_reader.cpp 493621 2016-03-01 13:41:26Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -177,7 +177,7 @@ CBedReader::ReadSeqAnnot(
 
         //  parse
         vector<string> fields;
-        NStr::Tokenize( record_copy, " \t", fields, NStr::eMergeDelims );
+        NStr::Split( record_copy, " \t", fields, NStr::eMergeDelims );
         try {
             xCleanColumnValues(fields);
         }
@@ -605,7 +605,7 @@ void CBedReader::xSetFeatureLocationBlock(
     {{
         blockSizes.reserve(blockCount);
         vector<string> vals; 
-        NStr::Tokenize(fields[10], ",", vals);
+        NStr::Split(fields[10], ",", vals);
         if (vals.back() == "") {
             vals.erase(vals.end()-1);
         }
@@ -635,7 +635,7 @@ void CBedReader::xSetFeatureLocationBlock(
         blockStarts.reserve(blockCount);
         vector<string> vals; 
         size_t baseStart = NStr::StringToUInt(fields[1]);
-        NStr::Tokenize(fields[11], ",", vals);
+        NStr::Split(fields[11], ",", vals);
         if (vals.back() == "") {
             vals.erase(vals.end()-1);
         }
@@ -851,7 +851,7 @@ void CBedReader::xSetFeatureBedData(
         srgb.push_back("0");
     }
     else {
-        NStr::Tokenize(fields[8], ",", srgb);
+        NStr::Split(fields[8], ",", srgb);
     }
     if (srgb.size() != 3)
     {
@@ -1056,7 +1056,7 @@ CBedReader::xReadBedRecordRaw(
 	NStr::TruncateSpacesInPlace(linecopy);
 
     //  parse
-    NStr::Tokenize( linecopy, " \t", columns, NStr::eMergeDelims );
+    NStr::Split( linecopy, " \t", columns, NStr::eMergeDelims );
     try {
         xCleanColumnValues(columns);
     }
diff --git a/c++/src/objtools/readers/fasta.cpp b/c++/src/objtools/readers/fasta.cpp
index e720dc7..1df1a90 100644
--- a/c++/src/objtools/readers/fasta.cpp
+++ b/c++/src/objtools/readers/fasta.cpp
@@ -1,4 +1,4 @@
-/*  $Id: fasta.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: fasta.cpp 499434 2016-04-26 14:13:36Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1241,7 +1241,7 @@ bool CFastaReader::ParseGapLine(
     bool bConflictingGapTypes = false;
     // extract the mods, if any
     SGap::TNullableGapType pGapType;
-    ELinkEvid eLinkEvid = eLinkEvid_UnspecifiedOnly;
+    CSeq_gap::ELinkEvid eLinkEvid = CSeq_gap::eLinkEvid_UnspecifiedOnly;
     set<CLinkage_evidence::EType> setOfLinkageEvidence;
     ITERATE(TModKeyValueMultiMap, modKeyValue_it, modKeyValueMultiMap) {
         const TStr & sKey   = modKeyValue_it->first;
@@ -1250,7 +1250,7 @@ bool CFastaReader::ParseGapLine(
         string canonicalKey = CanonicalizeString(sKey);
         if(  canonicalKey == "gap-type") {
 
-            const SGapTypeInfo *pGapTypeInfo = NameToGapTypeInfo(sValue);
+            const CSeq_gap::SGapTypeInfo *pGapTypeInfo = CSeq_gap::NameToGapTypeInfo(sValue);
             if( pGapTypeInfo ) {
                  CSeq_gap::EType eGapType = pGapTypeInfo->m_eType;
 
@@ -1323,7 +1323,7 @@ bool CFastaReader::ParseGapLine(
 
     // check if linkage-evidence(s) compatible with gap-type
     switch( eLinkEvid ) {
-    case eLinkEvid_UnspecifiedOnly:
+    case CSeq_gap::eLinkEvid_UnspecifiedOnly:
         if( setOfLinkageEvidence.empty() ) {
             if( pGapType ) {
                 // silently add the required "unspecified"
@@ -1343,7 +1343,7 @@ bool CFastaReader::ParseGapLine(
             setOfLinkageEvidence.insert(CLinkage_evidence::eType_unspecified);
         }
         break;
-    case eLinkEvid_Forbidden:
+    case CSeq_gap::eLinkEvid_Forbidden:
         if( ! setOfLinkageEvidence.empty() ) {
             FASTA_WARNING(LineNumber(),
                 "FASTA-Reader: This gap-type cannot have any "
@@ -1353,7 +1353,7 @@ bool CFastaReader::ParseGapLine(
             setOfLinkageEvidence.clear();
         }
         break;
-    case eLinkEvid_Required:
+    case CSeq_gap::eLinkEvid_Required:
         if( setOfLinkageEvidence.empty() ) {
             setOfLinkageEvidence.insert(CLinkage_evidence::eType_unspecified);
         }
@@ -2113,43 +2113,6 @@ string CFastaReader::CanonicalizeString(const TStr & sValue)
 }
 
 // static
-const CFastaReader::SGapTypeInfo *
-CFastaReader::NameToGapTypeInfo(const CTempString & sName)
-{
-    const CFastaReader::TGapTypeMap & gapTypeMap =
-        GetNameToGapTypeInfoMap();
-
-    TGapTypeMap::const_iterator find_iter =
-        gapTypeMap.find( CanonicalizeString(sName).c_str() );
-    if( find_iter == gapTypeMap.end() ) {
-        // not found
-        return NULL;
-    } else {
-        return & find_iter->second;
-    }
-}
-
-// static
-const CFastaReader::TGapTypeMap & 
-CFastaReader::GetNameToGapTypeInfoMap(void)
-{
-    // gap-type name to info
-    typedef SStaticPair<const char*, SGapTypeInfo> TGapTypeElem;
-    static const TGapTypeElem sc_gap_type_map[] = {
-        {"between-scaffolds",        { CSeq_gap::eType_contig,          eLinkEvid_Required} },
-        {"centromere",               { CSeq_gap::eType_centromere,      eLinkEvid_Forbidden} },
-        {"heterochromatin",          { CSeq_gap::eType_heterochromatin, eLinkEvid_Forbidden} },
-        {"repeat-between-scaffolds", { CSeq_gap::eType_repeat,          eLinkEvid_Forbidden} },
-        {"repeat-within-scaffold",   { CSeq_gap::eType_repeat,          eLinkEvid_Required} },
-        {"short-arm",                { CSeq_gap::eType_short_arm,       eLinkEvid_Forbidden} },
-        {"telomere",                 { CSeq_gap::eType_telomere,        eLinkEvid_Forbidden} },
-        {"unknown",                  { CSeq_gap::eType_unknown,         eLinkEvid_UnspecifiedOnly} },
-        {"within-scaffold",          { CSeq_gap::eType_scaffold,        eLinkEvid_Forbidden} },
-    };
-    DEFINE_STATIC_ARRAY_MAP(TGapTypeMap, sc_GapTypeMap, sc_gap_type_map);
-    return sc_GapTypeMap;
-}
-
 CFastaReader::SGap::SGap(
     TSeqPos uPos,
     TSignedSeqPos uLen,
diff --git a/c++/src/objtools/readers/format_guess_ex.cpp b/c++/src/objtools/readers/format_guess_ex.cpp
index 532499b..a68bfa5 100644
--- a/c++/src/objtools/readers/format_guess_ex.cpp
+++ b/c++/src/objtools/readers/format_guess_ex.cpp
@@ -1,4 +1,4 @@
-/*  $Id: format_guess_ex.cpp 479675 2015-09-22 18:45:37Z ivanov $
+/*  $Id: format_guess_ex.cpp 478995 2015-09-15 16:48:20Z gotvyans $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/readers/gff2_data.cpp b/c++/src/objtools/readers/gff2_data.cpp
index a024df1..9fe671e 100644
--- a/c++/src/objtools/readers/gff2_data.cpp
+++ b/c++/src/objtools/readers/gff2_data.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gff2_data.cpp 479671 2015-09-22 18:44:45Z ivanov $
+/*  $Id: gff2_data.cpp 497078 2016-04-04 14:59:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -64,6 +64,21 @@ BEGIN_NCBI_SCOPE
 BEGIN_objects_SCOPE // namespace ncbi::objects::
 
 //  ----------------------------------------------------------------------------
+CCdregion::EFrame FramePlusToMinus(
+    CCdregion::EFrame frame)
+//  ----------------------------------------------------------------------------
+{
+    static map<CCdregion::EFrame, CCdregion::EFrame> mFramePlusToMinus;
+    if (mFramePlusToMinus.empty()) {
+        mFramePlusToMinus[CCdregion::eFrame_not_set] = CCdregion::eFrame_not_set;
+        mFramePlusToMinus[CCdregion::eFrame_one] = CCdregion::eFrame_three;
+        mFramePlusToMinus[CCdregion::eFrame_two] = CCdregion::eFrame_two;
+        mFramePlusToMinus[CCdregion::eFrame_three] = CCdregion::eFrame_one;
+    }
+    return mFramePlusToMinus[frame];
+}
+
+//  ----------------------------------------------------------------------------
 CRef<CCode_break> s_StringToCodeBreak(
     const string& str,
     CSeq_id& id,
@@ -265,8 +280,8 @@ bool CGff2Record::AssignFromGff(
     columns[2].Copy(m_strType, 0, CTempString::npos);
 
     try {
-        m_uSeqStart = NStr::StringToUInt( columns[3] ) - 1;
-        m_uSeqStop = NStr::StringToUInt( columns[4] ) - 1;
+    m_uSeqStart = NStr::StringToUInt( columns[3] ) - 1;
+    m_uSeqStop = NStr::StringToUInt( columns[4] ) - 1;
     }
     catch (const CException&) {
         AutoPtr<CObjReaderLineException> pErr(
@@ -329,7 +344,7 @@ bool CGff2Record::AssignFromGff(
 
     columns[8].Copy(m_strAttributes, 0, CTempString::npos);
     
-    return x_AssignAttributesFromGff(columns[8]);
+    return x_AssignAttributesFromGff(m_strType, columns[8]);
 }
 
 //  ----------------------------------------------------------------------------
@@ -358,7 +373,7 @@ bool CGff2Record::GetAttribute(
     if (it == m_Attributes.end()) {
         return false;
     }
-    NStr::Split(it->second, ",", values);
+    NStr::Split(it->second, ",", values, 0);
     return !values.empty();
 }
 
@@ -387,26 +402,25 @@ CRef<CSeq_loc> CGff2Record::GetSeqLoc(
 
 //  ----------------------------------------------------------------------------
 string CGff2Record::xNormalizedAttributeKey(
-    const string& strRawKey )
+    const CTempString& strRawKey )
 //  ----------------------------------------------------------------------------
 {
-    string strKey = NStr::TruncateSpaces( strRawKey );
-    return strKey;
+    return NStr::TruncateSpaces_Unsafe(strRawKey);
 }
 
 //  ----------------------------------------------------------------------------
 string CGff2Record::xNormalizedAttributeValue(
-    const string& strRawValue )
+    const CTempString& strRawValue )
 //  ----------------------------------------------------------------------------
 {
-    string strValue = NStr::TruncateSpaces( strRawValue );
+    CTempString strValue = NStr::TruncateSpaces_Unsafe(strRawValue);
     if ( NStr::StartsWith( strValue, "\"" ) ) {
         strValue = strValue.substr( 1, string::npos );
     }
     if ( NStr::EndsWith( strValue, "\"" ) ) {
         strValue = strValue.substr( 0, strValue.length() - 1 );
-    }
-    return NStr::URLDecode(strValue);
+    }   
+    return NStr::URLDecode(strValue, NStr::eUrlDec_Percent);
 }
 
 
@@ -501,6 +515,7 @@ bool x_GetNextAttribute(CTempString& input, CTempString& key, CTempString& value
 }
 
 bool CGff2Record::x_AssignAttributesFromGff(
+    const string& strType,
     const string& strRawAttributes )
 //  ----------------------------------------------------------------------------
 {
@@ -562,7 +577,7 @@ bool CGff2Record::InitializeFeature(
 {
     return (
         x_InitFeatureLocation(flags, pFeature)  &&
-        x_InitFeatureData(flags, pFeature)  &&
+        xInitFeatureData(flags, pFeature)  &&
         x_MigrateId(pFeature)  &&
         x_MigrateStartStopStrand(pFeature)  &&
         x_MigrateType(pFeature)  &&
@@ -577,6 +592,13 @@ bool CGff2Record::UpdateFeature(
     CRef<CSeq_feat> pFeature ) const
 //  ----------------------------------------------------------------------------
 {
+    // mss-582:
+    //  if the parent feature is a gene then don't mess with the gene's location
+    //
+    CSeqFeatData::ESubtype subtype = pFeature->GetData().GetSubtype();
+    if (subtype == CSeqFeatData::eSubtype_gene) {
+        return true;
+    }
     const CSeq_loc& target = pFeature->GetLocation();
     CRef<CSeq_loc> pAddLoc = GetSeqLoc(flags);
 
@@ -595,9 +617,55 @@ bool CGff2Record::UpdateFeature(
             pOld->Assign(pFeature->GetLocation());
             pFeature->SetLocation().SetMix().AddSeqLoc(*pOld);
         }
+    }
+    if (!this->xUpdateFeatureData(flags, pFeature)) {
+        return false;
+    }
+    return true;
+}
+
+//  ----------------------------------------------------------------------------
+bool CGff2Record::xUpdateFeatureData(
+    int flags,
+    CRef<CSeq_feat> pFeature) const
+    //  ----------------------------------------------------------------------------
+{
+    const CSeq_loc& target = pFeature->GetLocation();
+    CSeqFeatData::ESubtype subtype = pFeature->GetData().GetSubtype();
+    CRef<CSeq_loc> pAddLoc = GetSeqLoc(flags);
+
+    switch(subtype) {
+        default: {
+            return true;
+        }
+        case CSeqFeatData::eSubtype_cdregion: {
+            // if incoming piece is new feature start then it will provide the
+            //  frame
+            //
+            if (!pAddLoc->GetInt().CanGetStrand()) {
+                return true;
+            }
+            if (pAddLoc->GetInt().GetStrand() == eNa_strand_plus) {
+                size_t curStart = target.GetStart(eExtreme_Positional);
+                size_t newStart = pAddLoc->GetStart(eExtreme_Positional);
+                if (curStart == newStart) {
+                    pFeature->SetData().SetCdregion().SetFrame(Phase());
+                }
+                return true;
+            }
+            if (pAddLoc->GetInt().GetStrand() == eNa_strand_minus) {
+                size_t curStop = target.GetStop(eExtreme_Positional);
+                size_t newStop = pAddLoc->GetStop(eExtreme_Positional);
+                if (curStop == newStop) {
+                    pFeature->SetData().SetCdregion().SetFrame(Phase());
+                }
+                return true;
+            }
         }
+    }
     return true;
 }
+    
 
 //  ----------------------------------------------------------------------------
 bool CGff2Record::x_MigrateId(
@@ -665,7 +733,7 @@ bool CGff2Record::x_MigrateAttributes(
     it = attrs_left.find("Dbxref");
     if (it != attrs_left.end()) {
         vector<string> dbxrefs;
-        NStr::Tokenize(it->second, ",", dbxrefs, NStr::eMergeDelims);
+        NStr::Split(it->second, ",", dbxrefs, NStr::eMergeDelims);
         for (vector<string>::iterator it1 = dbxrefs.begin(); it1 != dbxrefs.end();
                 ++it1 ) {
             string dbtag = xNormalizedAttributeValue(*it1);
@@ -684,6 +752,15 @@ bool CGff2Record::x_MigrateAttributes(
         }
     }
 
+    it = attrs_left.find("Parent");
+    if (it != attrs_left.end()) {
+        if (Type() != "CDS") {
+            xMigrateAttributeSingle(
+                attrs_left, "Parent", pFeature, "Parent", flags);
+        }
+        else attrs_left.erase(it);
+    }
+
     it = attrs_left.find("Name");
     if (it != attrs_left.end()) {
         if (0 == NStr::CompareNocase(Type(), "cds")) {
@@ -766,7 +843,7 @@ bool CGff2Record::x_MigrateAttributes(
     if (it != attrs_left.end()) {
         if (pFeature->GetData().IsGene()) {
             list<string> geneValues;
-            NStr::Split(it->second, ",", geneValues);
+            NStr::Split(it->second, ",", geneValues, 0);
             string value;
             list<string>::const_iterator cit = geneValues.begin();
             if (cit != geneValues.end()) {
@@ -795,15 +872,15 @@ bool CGff2Record::x_MigrateAttributes(
     it = attrs_left.find("gene_synonym");
     if (it != attrs_left.end()) {
         if (pFeature->GetData().IsGene()) {
-        vector<string> synonyms;
-        NStr::Tokenize(it->second, ",", synonyms, NStr::eMergeDelims);
-        for (vector<string>::iterator it1 = synonyms.begin(); it1 != synonyms.end();
-                ++it1 ) {
-            string synonym = xNormalizedAttributeValue(*it1);
-            pFeature->SetData().SetGene().SetSyn().push_back(synonym);
-        }
-            attrs_left.erase(it);
+            vector<string> synonyms;
+            NStr::Split(it->second, ",", synonyms, NStr::eMergeDelims);
+            for (vector<string>::iterator it1 = synonyms.begin(); it1 != synonyms.end();
+                    ++it1 ) {
+                string synonym = xNormalizedAttributeValue(*it1);
+                pFeature->SetData().SetGene().SetSyn().push_back(synonym);
+            }
         }
+        attrs_left.erase(it);
     }
 
     it = attrs_left.find("inference");
@@ -906,7 +983,7 @@ bool CGff2Record::x_MigrateAttributes(
     if (it != attrs_left.end()) {
         if (pFeature->GetData().IsCdregion()) {
             vector<string> codebreaks;
-            NStr::Tokenize(it->second, ",", codebreaks, NStr::eMergeDelims);
+            NStr::Split(it->second, ",", codebreaks, NStr::eMergeDelims);
             for (vector<string>::iterator it1 = codebreaks.begin(); 
                     it1 != codebreaks.end(); ++it1 ) {
                 CRef<CCode_break> pCodeBreak = s_StringToCodeBreak(
@@ -943,7 +1020,7 @@ bool CGff2Record::x_MigrateAttributes(
     //  Turn whatever is left into a gbqual:
     //
     while (!attrs_left.empty()) {
-        string key = attrs_left.begin()->first;
+        const string& key = attrs_left.begin()->first;
         if (!xMigrateAttributeDefault(attrs_left, key, pFeature, key, flags)) {
             return false;
         }
@@ -989,9 +1066,9 @@ bool CGff2Record::xMigrateAttributeDefault(
     if (it == attributes.end()) {
         return true;
     }
-    list<string> values;
-    NStr::Split(it->second, ",", values);
-    for (list<string>::const_iterator cit = values.begin(); cit != values.end();
+    list<CTempStringEx> values;
+    NStr::Split(it->second, ",", values, 0);
+    for (list<CTempStringEx>::const_iterator cit = values.begin(); cit != values.end();
             cit++) {
         string value = xNormalizedAttributeValue(*cit);
         pFeature->AddQualifier(qualKey, value);
@@ -1152,17 +1229,11 @@ bool CGff2Record::x_InitFeatureLocation(
 }
 
 //  ----------------------------------------------------------------------------
-bool CGff2Record::x_InitFeatureData(
+bool CGff2Record::xInitFeatureData(
     int flags,
     CRef<CSeq_feat> pFeature ) const
 //  ----------------------------------------------------------------------------
 {
-    map<CCdregion::EFrame, CCdregion::EFrame> FramePlusToMinus;
-    FramePlusToMinus[CCdregion::eFrame_not_set] = CCdregion::eFrame_not_set;
-    FramePlusToMinus[CCdregion::eFrame_one] = CCdregion::eFrame_three;
-    FramePlusToMinus[CCdregion::eFrame_two] = CCdregion::eFrame_two;
-    FramePlusToMinus[CCdregion::eFrame_three] = CCdregion::eFrame_one;
-
     string gbkey;
     if (GetAttribute("gbkey", gbkey)) {
         if (gbkey == "Src") {
@@ -1173,12 +1244,13 @@ bool CGff2Record::x_InitFeatureData(
 
     CFeatListItem itemtype = SofaTypes().MapSofaTermToFeatListItem( Type());
     switch( itemtype.GetType() ) {
-        default:
-            break;
-
-        case CSeqFeatData::e_Gene:
+        default: {
+            return true;
+        }
+        case CSeqFeatData::e_Gene: {
             pFeature->SetData().SetGene();
             return true;
+        }
 
         case CSeqFeatData::e_Cdregion: {
             //oh my --- phases again ---
@@ -1186,9 +1258,6 @@ bool CGff2Record::x_InitFeatureData(
             if (frame == CCdregion::eFrame_not_set) {
                 frame = CCdregion::eFrame_one;
             }
-            else if (Strand() == eNa_strand_minus) {
-                frame = FramePlusToMinus[frame];
-            } 
             pFeature->SetData().SetCdregion();
             pFeature->SetData().SetCdregion().SetFrame(frame);
             return true;
@@ -1200,6 +1269,9 @@ bool CGff2Record::x_InitFeatureData(
                 default:
                     rnaref.SetType(CRNA_ref::eType_unknown);
                     return true;
+               case CSeqFeatData::eSubtype_tmRNA:
+                    rnaref.SetType(CRNA_ref::eType_tmRNA);
+                    return true;
                case CSeqFeatData::eSubtype_mRNA:
                     rnaref.SetType(CRNA_ref::eType_mRNA);
                     return true;
@@ -1221,15 +1293,24 @@ bool CGff2Record::x_InitFeatureData(
             }
             return true;
         }
+        case CSeqFeatData::e_Imp: {
+            CSeqFeatData::TImp& imp = pFeature->SetData().SetImp();
+            CSeqFeatData::ESubtype subType = 
+                static_cast<CSeqFeatData::ESubtype>(itemtype.GetSubtype());
+            if (subType == CSeqFeatData::eSubtype_bad) {
+                if (Type() == ".") {
+                    imp.SetKey("misc_feature");
+                    return true;
+                }
+                imp.SetKey(Type());
+                return true;
+            }
+            const string& key = CSeqFeatData::SubtypeValueToName(
+                static_cast<CSeqFeatData::ESubtype>(itemtype.GetSubtype()));
+            imp.SetKey(key);
+            return true;
+        }
     }
-    pFeature->SetData().SetImp();  
-    if (Type() == ".") {
-        pFeature->SetData().SetImp().SetKey("misc_feature");
-    }
-    else {
-        pFeature->SetData().SetImp().SetKey(Type());
-    }
-    return true;
 }
 
 END_objects_SCOPE
diff --git a/c++/src/objtools/readers/gff2_reader.cpp b/c++/src/objtools/readers/gff2_reader.cpp
index ad7926e..30687bf 100644
--- a/c++/src/objtools/readers/gff2_reader.cpp
+++ b/c++/src/objtools/readers/gff2_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gff2_reader.cpp 479671 2015-09-22 18:44:45Z ivanov $
+/*  $Id: gff2_reader.cpp 497078 2016-04-04 14:59:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -343,26 +343,18 @@ bool CGff2Reader::x_ParseFeatureGff(
         ProcessError(err, pEC);
         return false;
     }
-    if (pRecord->Type() == "protein") {
-        if (this->m_iFlags & CGff2Reader::fGenbankMode) {
-            AutoPtr<CObjReaderLineException> pErr(
-                CObjReaderLineException::Create(
-                eDiag_Fatal,
-                0,
-                "Type \"protein\" in column 3 is not supported in -genbank mode.",
-                ILineError::eProblem_FeatureNameNotAllowed));
-            ProcessError(*pErr, pEC);
-        }
-        else {
-            AutoPtr<CObjReaderLineException> pErr(
-                CObjReaderLineException::Create(
-                eDiag_Warning,
-                0,
-                "Type \"protein\" in column 3 is not supported - ignored.",
-                ILineError::eProblem_FeatureNameNotAllowed));
-            ProcessError(*pErr, pEC);
-        }
-        return false;
+    string ftype = pRecord->Type();
+    if (xIsIgnoredFeatureType(ftype)) {
+        string message = string("GFF3 feature type \"") + ftype + 
+            string("\" not supported- ignored.");
+        AutoPtr<CObjReaderLineException> pErr(
+            CObjReaderLineException::Create(
+            eDiag_Warning,
+            0,
+            message,
+            ILineError::eProblem_FeatureNameNotAllowed));
+        ProcessError(*pErr, pEC);
+        return true;
     }
 
     //
@@ -401,7 +393,6 @@ bool CGff2Reader::x_ParseFeatureGff(
         }
         annots.insert(annots.begin(), pAnnot );      
     }
-
     return true; 
 };
 
@@ -470,7 +461,7 @@ bool CGff2Reader::x_ParseBrowserLineGff(
         return false;
     }
     vector< string > columns;
-    NStr::Tokenize( strRawInput, " \t", columns, NStr::eMergeDelims );
+    NStr::Split( strRawInput, " \t", columns, NStr::eMergeDelims );
 
     if ( columns.size() <= 1 || 1 != ( columns.size() % 2 ) ) {
         // don't know how to unwrap this
@@ -510,7 +501,7 @@ bool CGff2Reader::x_ParseTrackLineGff(
         }
     }
     vector< string > columns;
-    NStr::Tokenize( strCookedInput, " \t", columns, NStr::eMergeDelims );
+    NStr::Split( strCookedInput, " \t", columns, NStr::eMergeDelims );
 
     if ( columns.size() <= 1 ) {
         pAnnotDesc.Reset();
@@ -603,7 +594,7 @@ bool CGff2Reader::x_UpdateAnnotFeature(
     if ( ! x_FeatureSetQualifiers( gff, pFeature ) ) {
         return false;
     }
-    if (!x_AddFeatureToAnnot( pFeature, pAnnot )) {
+    if (!xAddFeatureToAnnot( pFeature, pAnnot )) {
         return false;
     }
     string strId;
@@ -647,7 +638,7 @@ bool CGff2Reader::xAlignmentSetSegment(
     if (!gff.GetAttribute("Target", targetInfo)) {
         return false;
     }
-    NStr::Tokenize(targetInfo, " ", targetParts);
+    NStr::Split(targetInfo, " ", targetParts);
     if (targetParts.size() != 4) {
         return false;
     }
@@ -655,7 +646,7 @@ bool CGff2Reader::xAlignmentSetSegment(
     string gapInfo;
     vector<string> gapParts;
     if (gff.GetAttribute("Gap", gapInfo)) {
-        NStr::Tokenize(gapInfo, " ", gapParts);
+        NStr::Split(gapInfo, " ", gapParts);
     }
     else {
         gapParts.push_back(string("M") + NStr::NumericToString(gff.SeqStop()-gff.SeqStart()+1));
@@ -670,9 +661,9 @@ bool CGff2Reader::xAlignmentSetSegment(
 
     //ids
     denseg.SetIds().push_back(
-        CRef<CSeq_id>(new CSeq_id(targetParts[0])));
+        CReadUtil::AsSeqId(targetParts[0]));
     denseg.SetIds().push_back(
-        CRef<CSeq_id>(new CSeq_id(gff.Id())));
+        CReadUtil::AsSeqId(gff.Id()));
 
     //starts
     size_t targetOffset = 0;
@@ -852,6 +843,10 @@ bool CGff2Reader::x_FeatureTrimQualifiers(
             it++;
             continue;
         }
+        if (qualKey == "old_locus_tag") {
+            it++;
+            continue;
+        }
         const string& qualVal = (*it)->GetVal();
         string attrVal;
         if (!record.GetAttribute(qualKey, attrVal)) {
@@ -897,6 +892,20 @@ bool CGff2Reader::x_FeatureSetQualifiers(
 }
 
 //  ----------------------------------------------------------------------------
+bool CGff2Reader::xFeatureSetQualifier(
+    const string& key,
+    const string& value,
+    CRef<CSeq_feat> pTargetFeature)
+//  ----------------------------------------------------------------------------
+{
+    if (!pTargetFeature) {
+        return false;
+    }
+    pTargetFeature->AddOrReplaceQualifier(key, value);
+    return true;
+}
+
+//  ----------------------------------------------------------------------------
 bool CGff2Reader::x_FeatureSetGffInfo(
     const CGff2Record& record,
     CRef< CSeq_feat > pFeature )
@@ -1085,7 +1094,7 @@ bool CGff2Reader::IsCds(
 }
 
 //  ----------------------------------------------------------------------------
-bool CGff2Reader::x_AddFeatureToAnnot(
+bool CGff2Reader::xAddFeatureToAnnot(
     CRef< CSeq_feat > pFeature,
     CRef< CSeq_annot > pAnnot )
 //  ----------------------------------------------------------------------------
@@ -1251,7 +1260,7 @@ bool CGff2Reader::xGenerateParentChildXrefs(
         CSeq_feat& feat = **featIt;
         const string& parentStr = feat.GetNamedQual("Parent");
         PARENTS parents;
-        NStr::Split(parentStr, ",", parents);
+        NStr::Split(parentStr, ",", parents, 0);
         for (PARENTS::iterator parentIt = parents.begin(); parentIt != parents.end(); ++parentIt) {
             const string& parent = *parentIt; 
             xSetAncestryLine(feat, parent);
@@ -1277,7 +1286,7 @@ void CGff2Reader::xSetAncestryLine(
         xSetAncestorXrefs(feat, *pAncestor);
         ancestorStr = pAncestor->GetNamedQual("Parent");
         PARENTS ancestors;
-        NStr::Split(ancestorStr, ",", ancestors);
+        NStr::Split(ancestorStr, ",", ancestors, 0);
         for (PARENTS::iterator it = ancestors.begin(); it != ancestors.end(); ++it) {
             const string& ancestorStr = *it;
             xSetAncestryLine(feat, ancestorStr);
@@ -1359,5 +1368,13 @@ bool CGff2Reader::IsAlignmentData(
     return false;
 }
 
+//  ============================================================================
+bool CGff2Reader::xIsIgnoredFeatureType(
+    const string& type)
+//  ============================================================================
+{
+    return false;
+}
+
 END_objects_SCOPE
 END_NCBI_SCOPE
diff --git a/c++/src/objtools/readers/gff3_reader.cpp b/c++/src/objtools/readers/gff3_reader.cpp
index fcc786c..2155acc 100644
--- a/c++/src/objtools/readers/gff3_reader.cpp
+++ b/c++/src/objtools/readers/gff3_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gff3_reader.cpp 484580 2015-11-12 19:14:09Z ivanov $
+/*  $Id: gff3_reader.cpp 497078 2016-04-04 14:59:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -81,6 +81,7 @@
 #include <objects/seqfeat/Feat_id.hpp>
 #include <objects/seqset/Bioseq_set.hpp>
 
+#include <objtools/readers/read_util.hpp>
 #include <objtools/readers/reader_exception.hpp>
 #include <objtools/readers/line_error.hpp>
 #include <objtools/readers/message_listener.hpp>
@@ -167,6 +168,13 @@ CGff3Reader::~CGff3Reader()
 }
 
 //  ----------------------------------------------------------------------------
+bool CGff3Reader::IsInGenbankMode() const
+//  ----------------------------------------------------------------------------
+{
+    return (m_iFlags & CGff3Reader::fGenbankMode);
+}
+
+//  ----------------------------------------------------------------------------
 bool CGff3Reader::x_UpdateFeatureCds(
     const CGff2Record& gff,
     CRef<CSeq_feat> pFeature)
@@ -191,7 +199,7 @@ bool CGff3Reader::x_UpdateAnnotFeature(
 
     string type = record.Type();
     NStr::ToLower(type);
-    if (type == "exon"  ||  type == "five_prime_utr"  ||  type == "three_prime_utr") {
+    if (type == "exon" || type == "five_prime_utr" || type == "three_prime_utr") {
         return xUpdateAnnotExon(record, pFeature, pAnnot, pEC);
     }
     if (type == "cds") {
@@ -279,114 +287,101 @@ bool CGff3Reader::xUpdateAnnotCds(
             eDiag_Error,
             0,
             "Bad data line: CDS record with bad parent assignments.",
-            ILineError::eProblem_FeatureBadStartAndOrStop) );
+            ILineError::eProblem_GeneralParsingError) );
         ProcessError(*pErr, pEC);
+        return false;
     }
 
-    //if the feature has a parent that's still under construction then
-    // add feature location to parent location:
     list<string> parents;
-    if (record.GetAttribute("Parent", parents)) {
-        for (list<string>::const_iterator it = parents.begin(); it != parents.end(); 
-                ++it) {
-            IdToFeatureMap::iterator fit = m_MapIdToFeature.find(*it);
-            if (fit != m_MapIdToFeature.end()) {
-                if (!record.UpdateFeature(m_iFlags, fit->second)) {
-                    return false;
-                }
-            }
-        }
+    record.GetAttribute("Parent", parents);
+    map<string, string> impliedCdsFeats;
+
+    // Preliminary:
+    //  We do not support multiparented CDS features in -genbank mode yet.
+    if (IsInGenbankMode()  &&  parents.size() > 1){
+        AutoPtr<CObjReaderLineException> pErr(
+            CObjReaderLineException::Create(
+            eDiag_Error,
+            0,
+            "Unsupported: CDS record with multiple parents.",
+            ILineError::eProblem_GeneralParsingError) );
+        ProcessError(*pErr, pEC);
+        return false;
     }
 
-    string id;
-    record.GetAttribute("ID", id);
-    string strParents;
-    if (record.GetAttribute("Parent", strParents)) {
-        list<string> parents;
-        NStr::Split(strParents, ",", parents);
-        for (list<string>::const_iterator cit = parents.begin();
-                cit != parents.end();
-                ++cit) {
-            //the following needs to happen for each of the parent mRNAs:
-            // try to find a CDS feature that belongs to the same parent and that should
-            //  be appended to
-            // if successful then update the pre-existing CDS feature
-            // if not then create a brand new CDS feature
-
-            //find pre-existing cds to append to ---
-            // if this record had an ID attribute then look for a cds of the same ID:parent
-            // combination:
-            string cdsId;
-            if (!id.empty()) {
-                cdsId = id + ":" + *cit;
-                IdToFeatureMap::iterator it = m_MapIdToFeature.find(cdsId);
-                if (it != m_MapIdToFeature.end()) {
-                    record.UpdateFeature(m_iFlags, it->second);
-                    continue;
-                }
-            }
-            //find pre-existing cds to append to ---
-            // if this record did not have an ID attribute then look for a cds with feature
-            // ID of pattern genericXX:parent:
-            else {
-                cdsId = xNextGenericId() + ":" + *cit;
-                IdToFeatureMap::iterator it;
-                for (it = m_MapIdToFeature.begin(); it != m_MapIdToFeature.end(); ++it) {
-                    string key = it->first;
-                    string prefix, parent;
-                    NStr::SplitInTwo(key, ":", prefix, parent);
-                    if (!NStr::StartsWith(prefix, "generic")) {
-                        continue;
-                    }
-                    if (parent != *cit) {
-                        continue;
-                    }
-                    break;
-                }
-                if (it != m_MapIdToFeature.end()) {
-                    record.UpdateFeature(m_iFlags, it->second);
-                    continue;
-                }
+    // Step 1:
+    // Locations of parent mRNAs are constructed on the fly, by joining in the 
+    //  locations of child exons and CDSs as we discover them. Do this
+    //  first.
+    // IDs for CDS features are derived from the IDs of their parent features.
+    //  Generate a list of CDS IDs this record pertains to as we cycle through
+    //  the parent list.
+    //
+    for (list<string>::const_iterator it = parents.begin(); it != parents.end(); 
+            ++it) {
+        string parentId = *it;
+
+        //update parent location:
+        IdToFeatureMap::iterator featIt = m_MapIdToFeature.find(parentId);
+        if (featIt != m_MapIdToFeature.end()) {
+            if (!record.UpdateFeature(m_iFlags, featIt->second)) {
+                return false;
             }
+        }
 
-            //still here?
-            // create brand new CDS feature:
-            if (!record.InitializeFeature(m_iFlags, pFeature)) {
-                return false;
+        //generate applicable CDS ID:
+        string siblingId("cds:");
+        siblingId += parentId;
+        impliedCdsFeats[siblingId] = parentId;
+    }
+    // deal with unparented cds
+    if (parents.empty()) {
+        string cdsId;
+        if (!record.GetAttribute("ID", cdsId)) {
+            if (IsInGenbankMode()) {
+                cdsId = xNextGenericId();
             }
-            if (!xFeatureSetXrefParent(*cit, pFeature)) {
-                AutoPtr<CObjReaderLineException> pErr(
-                    CObjReaderLineException::Create(
-                    eDiag_Warning,
-                    0,
-                    "Bad data line: CDS record with bad parent assignment.",
-                    ILineError::eProblem_MissingContext) );
-                ProcessError(*pErr, pEC);
+            else {
+                cdsId = "cds";
             }
-            if (m_iFlags & fGeneXrefs) {
-                if (!xFeatureSetXrefGrandParent(*cit, pFeature)) {
-                    AutoPtr<CObjReaderLineException> pErr(
-                        CObjReaderLineException::Create(
-                        eDiag_Warning,
-                        0,
-                        "Bad data line: CDS record with bad parent assignment.",
-                        ILineError::eProblem_MissingContext) );
-                    ProcessError(*pErr, pEC);
+        }
+        impliedCdsFeats[cdsId] = "";
+    }
+
+    // Step 2:
+    // For every sibling CDS feature, look if there is already a feature with that
+    //  ID under construction.
+    // If there is, use record to update feature under construction.
+    // If there isn't, use record to initialize a brand new feature.
+    //
+    for (map<string, string>::iterator featIt = impliedCdsFeats.begin(); 
+            featIt != impliedCdsFeats.end(); ++featIt) {
+        string cdsId = featIt->first;
+        string parentId = featIt->second;
+        IdToFeatureMap::iterator idIt = m_MapIdToFeature.find(cdsId);
+        if (idIt != m_MapIdToFeature.end()) {
+            //found feature with ID in question: update
+            record.UpdateFeature(m_iFlags, idIt->second);
+        }
+        else {
+            //didn't find feature with that ID: create new one
+            pFeature.Reset(new CSeq_feat);
+            record.InitializeFeature(m_iFlags, pFeature);
+            if (!parentId.empty()) {
+                xFeatureSetQualifier("Parent", parentId, pFeature);
+                xFeatureSetXrefParent(parentId, pFeature);
+                if (m_iFlags & fGeneXrefs) {
+                    xFeatureSetXrefGrandParent(parentId, pFeature);
                 }
             }
-            if (! x_AddFeatureToAnnot(pFeature, pAnnot)) {
-                return false;
-            }
-            if (! cdsId.empty()) {
-                m_MapIdToFeature[cdsId] = pFeature;
-            }
-            pFeature.Reset(new CSeq_feat);
+            xAddFeatureToAnnot(pFeature, pAnnot);
+            m_MapIdToFeature[cdsId] = pFeature;
         }
-        return true;
     }
-    return false;
+    return true;
 }
 
+
 //  ----------------------------------------------------------------------------
 bool CGff3Reader::xFeatureSetXrefGrandParent(
     const string& parent,
@@ -400,7 +395,7 @@ bool CGff3Reader::xFeatureSetXrefGrandParent(
     CRef<CSeq_feat> pParent = it->second;
     const string &grandParentsStr = pParent->GetNamedQual("Parent");
     list<string> grandParents;
-    NStr::Split(grandParentsStr, ",", grandParents);
+    NStr::Split(grandParentsStr, ",", grandParents, 0);
     for (list<string>::const_iterator gpcit = grandParents.begin();
             gpcit != grandParents.end(); ++gpcit) {
         IdToFeatureMap::iterator gpit = m_MapIdToFeature.find(*gpcit);
@@ -470,16 +465,51 @@ bool CGff3Reader::xUpdateAnnotGeneric(
         }
     }
 
+    string featType = record.Type();
+    if (featType == "stop_codon_read_through"  ||  featType == "selenocysteine") {
+        string cdsParent;
+        if (!record.GetAttribute("Parent", cdsParent)) {
+            cerr << "BAD!" << endl;
+        }
+        IdToFeatureMap::iterator it = m_MapIdToFeature.find(cdsParent);
+        if (it == m_MapIdToFeature.end()) {
+            cerr << "BAD!" << endl;
+        }
+
+        CRef<CCode_break> pCodeBreak(new CCode_break); 
+        CSeq_interval& cbLoc = pCodeBreak->SetLoc().SetInt();        
+        CRef< CSeq_id > pId = CReadUtil::AsSeqId(record.Id(), m_iFlags);
+        cbLoc.SetId(*pId);
+        cbLoc.SetFrom(record.SeqStart());
+        cbLoc.SetTo(record.SeqStop());
+        if (record.IsSetStrand()) {
+            cbLoc.SetStrand(record.Strand());
+        }
+        pCodeBreak->SetAa().SetNcbieaa(
+            (featType == "selenocysteine") ? 'U' : 'X');
+
+
+        CRef<CSeq_feat> pCds = it->second;
+        CCdregion& cdRegion = pCds->SetData().SetCdregion();
+        list< CRef< CCode_break > >& codeBreaks = cdRegion.SetCode_break();
+        codeBreaks.push_back(pCodeBreak);
+        return true;
+    }
     if (!record.InitializeFeature(m_iFlags, pFeature)) {
         return false;
     }
-    if (! x_AddFeatureToAnnot(pFeature, pAnnot)) {
+    if (! xAddFeatureToAnnot(pFeature, pAnnot)) {
         return false;
     }
     string strId;
     if ( record.GetAttribute("ID", strId)) {
         m_MapIdToFeature[strId] = pFeature;
     }
+    if (pFeature->GetData().IsRna()) {
+        CRef<CSeq_interval> rnaLoc(new CSeq_interval);
+        rnaLoc->Assign(pFeature->GetLocation().GetInt());
+        mMrnaLocs[strId] = rnaLoc;
+    }
     return true;
 }
 
@@ -518,7 +548,7 @@ bool CGff3Reader::xUpdateAnnotMrna(
     string parentsStr;
     if ((m_iFlags & fGeneXrefs)  &&  record.GetAttribute("Parent", parentsStr)) {
         list<string> parents;
-        NStr::Split(parentsStr, ",", parents);
+        NStr::Split(parentsStr, ",", parents, 0);
         for (list<string>::const_iterator cit = parents.begin();
                 cit != parents.end();
                 ++cit) {
@@ -534,7 +564,7 @@ bool CGff3Reader::xUpdateAnnotMrna(
         }
     }
 
-    if (! x_AddFeatureToAnnot(pFeature, pAnnot)) {
+    if (! xAddFeatureToAnnot(pFeature, pAnnot)) {
         return false;
     }
     string strId;
@@ -556,7 +586,7 @@ bool CGff3Reader::xUpdateAnnotGene(
 }
 
 //  ----------------------------------------------------------------------------
-bool CGff3Reader::x_AddFeatureToAnnot(
+bool CGff3Reader::xAddFeatureToAnnot(
     CRef< CSeq_feat > pFeature,
     CRef< CSeq_annot > pAnnot )
 //  ----------------------------------------------------------------------------
@@ -595,5 +625,61 @@ bool CGff3Reader::xReadInit()
     return true;
 }
 
+//  ----------------------------------------------------------------------------
+bool CGff3Reader::xIsIgnoredFeatureType(
+    const string& ftype)
+//  ----------------------------------------------------------------------------
+{
+    vector<string>::const_iterator cit;
+
+    static vector<string> ignoredTypesAlways;
+    if (ignoredTypesAlways.empty()) {
+        ignoredTypesAlways.push_back("protein");
+    }
+    static vector<string> ignoredTypesGenbank;
+    if (ignoredTypesGenbank.empty()) {
+        ignoredTypesGenbank.push_back("replicon");
+        ignoredTypesGenbank.push_back("chromosome");
+        ignoredTypesGenbank.push_back("dna_chromosome");
+        ignoredTypesGenbank.push_back("rna_chromosome");
+        ignoredTypesGenbank.push_back("apicoplast_chromosome");
+        ignoredTypesGenbank.push_back("chloroplast_chromosome");
+        ignoredTypesGenbank.push_back("chromoplast_chromosome");
+        ignoredTypesGenbank.push_back("cyanelle_chromosome");
+        ignoredTypesGenbank.push_back("leucoplast_chromosome");
+        ignoredTypesGenbank.push_back("macronuclear_chromosome");
+        ignoredTypesGenbank.push_back("micronuclear_chromosome");
+        ignoredTypesGenbank.push_back("mitochondrial_chromosome");
+        ignoredTypesGenbank.push_back("nuclear_chromosome");
+        ignoredTypesGenbank.push_back("nucleomorphic_chromosome");
+        ignoredTypesGenbank.push_back("contig");
+        ignoredTypesGenbank.push_back("supercontig");
+        ignoredTypesGenbank.push_back("ultracontig");
+        ignoredTypesGenbank.push_back("partial_genomic_sequence_assembly");
+        ignoredTypesGenbank.push_back("sequence_assembly");
+        ignoredTypesGenbank.push_back("assembly");
+    }
+
+    cit = std::find(ignoredTypesAlways.begin(), ignoredTypesAlways.end(), ftype);
+    if (cit != ignoredTypesAlways.end()) {
+        return true;
+    }
+    if (!IsInGenbankMode()) {
+        return false;
+    }
+
+    /* -genbank mode:*/
+    cit = std::find(ignoredTypesGenbank.begin(), ignoredTypesGenbank.end(), ftype);
+    if (cit != ignoredTypesGenbank.end()) {
+        return true;
+    }
+    CSeqFeatData::ESubtype iGenbankType = SofaTypes().MapSofaTermToGenbankType(ftype);
+    if (iGenbankType == CSeqFeatData::eSubtype_bad) {
+        return true;
+    }
+    /*anything else?*/
+    return false;
+}
+
 END_objects_SCOPE
 END_NCBI_SCOPE
diff --git a/c++/src/objtools/readers/gff3_sofa.cpp b/c++/src/objtools/readers/gff3_sofa.cpp
index 72fc270..b3061c6 100644
--- a/c++/src/objtools/readers/gff3_sofa.cpp
+++ b/c++/src/objtools/readers/gff3_sofa.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gff3_sofa.cpp 403742 2013-06-18 15:26:09Z grichenk $
+/*  $Id: gff3_sofa.cpp 496421 2016-03-28 15:14:58Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -83,7 +83,7 @@ CSeqFeatData::ESubtype CGff3SofaTypes::MapSofaTermToGenbankType(
 {
     TLookupSofaToGenbankCit cit = m_Lookup->find( strSofa );
     if ( cit == m_Lookup->end() ) {
-        return CSeqFeatData::eSubtype_misc_feature;
+        return CSeqFeatData::eSubtype_bad;
     }
     return CSeqFeatData::ESubtype(cit->second.GetSubtype());
 }
@@ -96,7 +96,7 @@ CFeatListItem CGff3SofaTypes::MapSofaTermToFeatListItem(
     TLookupSofaToGenbankCit cit = m_Lookup->find( strSofa );
     if ( cit == m_Lookup->end() ) {
         return CFeatListItem(CSeqFeatData::e_Imp, 
-            CSeqFeatData::eSubtype_misc_feature, "", "");
+            CSeqFeatData::eSubtype_bad, "", "");
     }
     return cit->second;
 }
diff --git a/c++/src/objtools/readers/gff_reader.cpp b/c++/src/objtools/readers/gff_reader.cpp
index c741b9b..db0b855 100644
--- a/c++/src/objtools/readers/gff_reader.cpp
+++ b/c++/src/objtools/readers/gff_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gff_reader.cpp 468563 2015-05-26 16:00:34Z vasilche $
+/*  $Id: gff_reader.cpp 493622 2016-03-01 13:41:45Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -718,7 +718,7 @@ CRef<CSeq_align> CGFFReader::x_ParseAlignRecord(const SRecord& record)
     SRecord::TAttrs::const_iterator tgit = record.FindAttribute("Target");
     vector<string> target;
     if (tgit != record.attrs.end()) {
-        NStr::Tokenize((*tgit)[1], " +-", target, NStr::eMergeDelims);
+        NStr::Split((*tgit)[1], " +-", target, NStr::eMergeDelims);
     }
     if (target.size() != 3) {
         x_Warn("Bad Target attribute", record.line_no);
diff --git a/c++/src/objtools/readers/gtf_reader.cpp b/c++/src/objtools/readers/gtf_reader.cpp
index e3eab6e..334475f 100644
--- a/c++/src/objtools/readers/gtf_reader.cpp
+++ b/c++/src/objtools/readers/gtf_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: gtf_reader.cpp 479671 2015-09-22 18:44:45Z ivanov $
+/*  $Id: gtf_reader.cpp 497078 2016-04-04 14:59:49Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -118,6 +118,7 @@ bool s_AnnotId(
 
 //  ----------------------------------------------------------------------------
 bool CGtfReadRecord::x_AssignAttributesFromGff(
+    const string& strGtfType,
     const string& strRawAttributes )
 //  ----------------------------------------------------------------------------
 {
@@ -127,9 +128,21 @@ bool CGtfReadRecord::x_AssignAttributesFromGff(
 	for ( size_t u=0; u < attributes.size(); ++u ) {
         string strKey;
         string strValue;
-        if ( ! NStr::SplitInTwo( attributes[u], "=", strKey, strValue ) ) {
-            if ( ! NStr::SplitInTwo( attributes[u], " ", strKey, strValue ) ) {
-                return false;
+        string strAttr(attributes[u]);
+        if (!NStr::SplitInTwo(strAttr, "=", strKey, strValue)) {
+            if (!NStr::SplitInTwo(strAttr, " ", strKey, strValue)) {
+                if (strGtfType == "gene") {
+                    m_Attributes["gene_id"] = xNormalizedAttributeValue(strAttr);
+                    continue;
+                }
+                if (strGtfType == "transcript") {
+                    if (!NStr::SplitInTwo(strAttr, ".", strKey, strValue)) {
+                        return false;
+                    }
+                    m_Attributes["gene_id"] = xNormalizedAttributeValue(strKey);
+                    m_Attributes["transcript_id"] = xNormalizedAttributeValue(strAttr);
+                    continue;
+                }
             }
         }
         strKey = xNormalizedAttributeKey( strKey );
@@ -304,7 +317,11 @@ bool CGtfReader::x_UpdateAnnotFeature(
     if ( strType == "intron_CNS" ) {
         return x_UpdateAnnotIntronCns( gff, pAnnot );
     }
-    if ( strType == "exon" ) {
+    if ( strType == "exon"  ||
+         strType == "initial"  ||
+         strType == "internal"  ||
+         strType == "terminal"  ||
+         strType == "single") {
         return x_UpdateAnnotExon( gff, pAnnot );
     }
 
@@ -322,6 +339,11 @@ bool CGtfReader::x_UpdateAnnotFeature(
             return false;
         }
     }
+    if (strType == "mRNA") {
+        if ( ! x_CreateParentMrna(gff, pAnnot) ) {
+            return false;
+        }
+    }
     return x_UpdateAnnotMiscFeature( gff, pAnnot );
 }
 
@@ -368,6 +390,9 @@ bool CGtfReader::x_UpdateAnnotCds(
         if ( ! x_MergeFeatureLocationMultiInterval( gff, pCds ) ) {
             return false;
         }
+        if (!x_FeatureTrimQualifiers(gff, pCds)) {
+            return false;
+        }
     }
 
     if ( x_CdsIsPartial( gff ) ) {
@@ -429,7 +454,45 @@ bool CGtfReader::x_UpdateAnnotStopCodon(
     //  coding regions. Hence, we will treat (pieces of) the stop codon just
     //  like (pieces of) CDS.
     //
-    return x_UpdateAnnotCds( gff, pAnnot );
+    //
+    // If there is no gene feature to go with this CDS then make one. Otherwise,
+    //  make sure the existing gene feature includes the location of the CDS.
+    //
+    CRef<CSeq_feat> pGene;
+    if (!x_FindParentGene(gff, pGene)) {
+        if (!x_CreateParentGene(gff, pAnnot)) {
+            return false;
+        }
+    }
+    else {
+        if (!x_MergeParentGene(gff, pGene)) {
+            return false;
+        }
+    }
+
+    //
+    // If there is no CDS feature with this gene_id|transcript_id then make one.
+    //  Otherwise, fix up the location of the existing one.
+    //
+    CRef<CSeq_feat> pCds;
+    if (!x_FindParentCds(gff, pCds)) {
+        //
+        // Create a brand new CDS feature:
+        //
+        if (!x_CreateParentCds(gff, pAnnot)) {
+            return false;
+        }
+        x_FindParentCds(gff, pCds);
+    }
+    else {
+        //
+        // Update an already existing CDS features:
+        //
+        if (!x_MergeFeatureLocationMultiInterval(gff, pCds)) {
+            return false;
+        }
+    }
+    return true;
 }
 
 //  ----------------------------------------------------------------------------
@@ -474,6 +537,9 @@ bool CGtfReader::x_UpdateAnnot5utr(
         if ( ! x_MergeFeatureLocationMultiInterval( gff, pMrna ) ) {
             return false;
         }
+        //if (!x_FeatureTrimQualifiers(gff, pMrna)) {
+        //    return false;
+        //}
     }
 
     return true;
@@ -521,6 +587,9 @@ bool CGtfReader::x_UpdateAnnot3utr(
         if ( ! x_MergeFeatureLocationMultiInterval( gff, pMrna ) ) {
             return false;
         }
+        //if (!x_FeatureTrimQualifiers(gff, pMrna)) {
+        //    return false;
+        //}
     }
 
     return true;
@@ -646,7 +715,15 @@ bool CGtfReader::x_CreateFeatureLocation(
     CSeq_interval& location = pFeature->SetLocation().SetInt();
     location.SetId( *pId );
     location.SetFrom( record.SeqStart() );
-    location.SetTo( record.SeqStop() );
+    if (record.Type() != "mRNA") {
+        location.SetTo(record.SeqStop());
+    }
+    else {
+        // place holder
+        //  actual location will be computed from the exons and CDSs living on 
+        //  this feature.
+        location.SetTo(record.SeqStart());
+    }
     if ( record.IsSetStrand() ) {
         location.SetStrand( record.Strand() );
     }
@@ -715,9 +792,6 @@ bool CGtfReader::x_MergeFeatureLocationSingleInterval(
     if ( gene_int.GetTo() < record.SeqStop() - 1 ) {
         pFeature->SetLocation().SetInt().SetTo( record.SeqStop() );
     }
-    if (record.Type() == "exon"  &&  pFeature->GetData().IsGene()) {
-        return x_FeatureTrimQualifiers(record, pFeature);
-    }
     if (record.Type() == "CDS"  &&  pFeature->GetData().IsCdregion()) {
         return x_FeatureTrimQualifiers(record, pFeature);
     }
@@ -743,8 +817,7 @@ bool CGtfReader::x_MergeFeatureLocationMultiInterval(
     pLocation = pLocation->Add( 
         pFeature->SetLocation(), CSeq_loc::fSortAndMerge_All, 0 );
     pFeature->SetLocation( *pLocation );
-
-    return x_FeatureTrimQualifiers(record, pFeature);
+    return true;
 }
 
 //  -----------------------------------------------------------------------------
@@ -772,7 +845,7 @@ bool CGtfReader::x_CreateParentGene(
     }
     m_GeneMap[ s_GeneKey( gff ) ] = pFeature;
 
-    x_AddFeatureToAnnot( pFeature, pAnnot );
+    xAddFeatureToAnnot( pFeature, pAnnot );
     return true;
 }
     
@@ -830,7 +903,7 @@ bool CGtfReader::x_CreateParentCds(
 
     m_CdsMap[ s_FeatureKey( gff ) ] = pFeature;
 
-    return x_AddFeatureToAnnot( pFeature, pAnnot );
+    return xAddFeatureToAnnot( pFeature, pAnnot );
 }
 
 //  -----------------------------------------------------------------------------
@@ -862,7 +935,7 @@ bool CGtfReader::x_CreateParentMrna(
 
     m_MrnaMap[ s_FeatureKey( gff ) ] = pFeature;
 
-    return x_AddFeatureToAnnot( pFeature, pAnnot );
+    return xAddFeatureToAnnot( pFeature, pAnnot );
 }
 
 //  ----------------------------------------------------------------------------
@@ -923,9 +996,10 @@ bool CGtfReader::x_FeatureSetDataGene(
     if ( record.GetAttribute( "gene_synonym", strValue ) ) {
         gene.SetSyn().push_back( strValue );
     }
-    if ( record.GetAttribute( "gene_id", strValue ) ) {
-        gene.SetSyn().push_front( strValue );
-    }
+    //  mss-399: do -not- use gene_id for /gene_syn or /gene:
+    //if ( record.GetAttribute( "gene_id", strValue ) ) {
+    //    gene.SetSyn().push_front( strValue );
+    //}
     return true;
 }
 
@@ -989,6 +1063,24 @@ bool CGtfReader::x_FeatureSetDataCDS(
 }
 
 //  ----------------------------------------------------------------------------
+bool CGtfReader::x_FeatureSetQualifiers(
+    const CGff2Record& record,
+    CRef< CSeq_feat > pFeature)
+//  ----------------------------------------------------------------------------
+{
+    if (this->m_iFlags & fGenbankMode) {
+        // mss-399: Strip gene_id and transcript_id qualifiers in their 
+        //  entirety.
+        return CGff2Reader::x_FeatureSetQualifiers(record, pFeature);
+    }
+    else {
+        // mss-399: Keep gene_id and transcript_id as qualifiers without any 
+        //  further processing
+        return CGff2Reader::x_FeatureSetQualifiers(record, pFeature);
+    }
+}
+
+//  ----------------------------------------------------------------------------
 bool CGtfReader::x_SkipAttribute(
     const CGff2Record& record,
     const string& strKey ) const
@@ -1076,10 +1168,6 @@ bool CGtfReader::x_ProcessQualifierSpecialCase(
     if (0 == NStr::CompareNocase(it->first, "exon_number")) {
         return true;
     }
-    if (0 == NStr::CompareNocase(it->first, "transcript_id")  &&  
-            pFeature->GetData().IsGene()) {
-        return true;
-    }
     if ( 0 == NStr::CompareNocase( it->first, "note" ) ) {
         pFeature->SetComment( it->second );
         return true;
@@ -1088,7 +1176,7 @@ bool CGtfReader::x_ProcessQualifierSpecialCase(
         0 == NStr::CompareNocase( it->first, "db_xref" ) ) 
     {
         vector< string > tags;
-        NStr::Tokenize( it->second, ";", tags );
+        NStr::Split( it->second, ";", tags );
         for ( vector<string>::iterator it = tags.begin(); 
             it != tags.end(); ++it ) {
             pFeature->SetDbxref().push_back( x_ParseDbtag( *it ) );
@@ -1104,6 +1192,36 @@ bool CGtfReader::x_ProcessQualifierSpecialCase(
         pFeature->SetPartial( true );
         return true;
     }
+    if (0 == NStr::CompareNocase(it->first, "gene_id")) {
+        if (m_iFlags | fGenbankMode) {
+            // mss-399:
+            //  in genbank mode, drop gene_id altogether
+            return true;
+        }
+        else {
+            // mss-399:
+            //  in regular mode, retain gene_id as a qualifier but do nothing
+            //  else with it.
+            return false;
+        }
+    }
+    if (0 == NStr::CompareNocase(it->first, "transcript_id")) {
+        if (m_iFlags | fGenbankMode) {
+            // mss-399:
+            //  in genbank mode, drop transcript_id altogether
+            return true;
+        }
+        else {
+            // mss-399:
+            //  in regular mode, retain transcript_id as a qualifier but do 
+            //  nothing else with it.
+            return false;
+        }
+    }
+    //if (0 == NStr::CompareNocase(it->first, "transcript_id") &&
+    //    pFeature->GetData().IsGene()) {
+    //    return true;
+    //}
 
     return false;
 }  
diff --git a/c++/src/objtools/readers/gvf_reader.cpp b/c++/src/objtools/readers/gvf_reader.cpp
index 791e7c3..7d24ae0 100644
--- a/c++/src/objtools/readers/gvf_reader.cpp
+++ b/c++/src/objtools/readers/gvf_reader.cpp
@@ -1,4 +1,4 @@
- /*  $Id: gvf_reader.cpp 479671 2015-09-22 18:44:45Z ivanov $
+ /*  $Id: gvf_reader.cpp 489339 2016-01-12 15:46:54Z ludwigf $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -136,6 +136,7 @@ bool CGvfReadRecord::AssignFromGff(
 
 //  ----------------------------------------------------------------------------
 bool CGvfReadRecord::x_AssignAttributesFromGff(
+    const string& strGffType,
     const string& strRawAttributes )
 //  ----------------------------------------------------------------------------
 {
@@ -344,7 +345,7 @@ bool CGvfReader::xFeatureSetLocationInterval(
     size_t lower, upper;
     if (record.GetAttribute( "Start_range", strRange ) )
     {
-        NStr::Split( strRange, ",", range_borders );
+        NStr::Split( strRange, ",", range_borders, 0 );
         if ( range_borders.size() != 2 ) {
             AutoPtr<CObjReaderLineException> pErr(
                 CObjReaderLineException::Create(
@@ -387,7 +388,7 @@ bool CGvfReader::xFeatureSetLocationInterval(
     range_borders.clear();
     if (record.GetAttribute( "End_range", strRange ) )
     {
-        NStr::Split( strRange, ",", range_borders );
+        NStr::Split( strRange, ",", range_borders, 0 );
         if ( range_borders.size() != 2 ) {
             AutoPtr<CObjReaderLineException> pErr(
                 CObjReaderLineException::Create(
@@ -473,7 +474,7 @@ bool CGvfReader::xFeatureSetLocationPoint(
 
     list<string> bounds;
     size_t lower, upper;
-    NStr::Split( strRangeLower, ",", bounds );
+    NStr::Split( strRangeLower, ",", bounds, 0 );
     if (bounds.size() != 2) {
         AutoPtr<CObjReaderLineException> pErr(
             CObjReaderLineException::Create(
@@ -590,7 +591,7 @@ bool CGvfReader::xVariationSetInsertions(
     string strAlleles;
     if ( record.GetAttribute( "Variant_seq", strAlleles ) ) {
         list<string> alleles;
-        NStr::Split( strAlleles, ",", alleles );
+        NStr::Split( strAlleles, ",", alleles, 0 );
         alleles.sort();
         alleles.unique();
         for ( list<string>::const_iterator cit = alleles.begin(); 
@@ -877,7 +878,7 @@ bool CGvfReader::xVariationSetDeletions(
     string strAlleles;
     if ( record.GetAttribute( "Variant_seq", strAlleles ) ) {
         list<string> alleles;
-        NStr::Split( strAlleles, ",", alleles );
+        NStr::Split( strAlleles, ",", alleles, 0 );
         alleles.sort();
         alleles.unique();
         for ( list<string>::const_iterator cit = alleles.begin(); 
@@ -940,7 +941,7 @@ bool CGvfReader::xVariationSetSnvs(
     string strAlleles;
     if ( record.GetAttribute( "Variant_seq", strAlleles ) ) {
         list<string> alleles;
-        NStr::Split( strAlleles, ",", alleles );
+        NStr::Split( strAlleles, ",", alleles, 0 );
         alleles.sort();
         alleles.unique();
         for ( list<string>::const_iterator cit = alleles.begin(); 
diff --git a/c++/src/objtools/readers/idmapper.cpp b/c++/src/objtools/readers/idmapper.cpp
index 77ff6a7..bd1b41c 100644
--- a/c++/src/objtools/readers/idmapper.cpp
+++ b/c++/src/objtools/readers/idmapper.cpp
@@ -1,4 +1,4 @@
-/*  $Id: idmapper.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: idmapper.cpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/readers/idmapper_builtin.cpp b/c++/src/objtools/readers/idmapper_builtin.cpp
index 558a4f3..af4825b 100644
--- a/c++/src/objtools/readers/idmapper_builtin.cpp
+++ b/c++/src/objtools/readers/idmapper_builtin.cpp
@@ -1,4 +1,4 @@
-/*  $Id: idmapper_builtin.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: idmapper_builtin.cpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/readers/idmapper_config.cpp b/c++/src/objtools/readers/idmapper_config.cpp
index 0d56b1f..31b28a3 100644
--- a/c++/src/objtools/readers/idmapper_config.cpp
+++ b/c++/src/objtools/readers/idmapper_config.cpp
@@ -1,4 +1,4 @@
-/*  $Id: idmapper_config.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: idmapper_config.cpp 486243 2015-12-02 16:47:28Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -125,7 +125,8 @@ void CIdMapperConfig::Initialize(CNcbiIstream& istr)
         }
         string id_set = reg.Get(m_strContext, *iter);
         list<string> ids;
-        NStr::Split(id_set, " \t\n\r", ids);
+        NStr::Split(id_set, " \t\n\r", ids,
+            NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
         ///
         /// id_from and id_to are naturally reversed, since we use a format
@@ -187,7 +188,7 @@ CIdMapperConfig::SetCurrentContext(
 //  ============================================================================
 {
     vector<string> columns;
-    NStr::Tokenize( strLine, " \t[]|:", columns, NStr::eMergeDelims );
+    NStr::Tokenize( strLine, " \t[]|:", columns, NStr::fSplit_MergeDelimiters);
     
     //sanity check: only a single columns remaining
     if ( columns.size() != 1 ) {
diff --git a/c++/src/objtools/readers/microarray_reader.cpp b/c++/src/objtools/readers/microarray_reader.cpp
index d525a37..d6fa9a2 100644
--- a/c++/src/objtools/readers/microarray_reader.cpp
+++ b/c++/src/objtools/readers/microarray_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: microarray_reader.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: microarray_reader.cpp 493622 2016-03-01 13:41:45Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -160,7 +160,7 @@ CMicroArrayReader::ReadSeqAnnot(
 
         //  parse
         vector<string> fields;
-        NStr::Tokenize( record_copy, " \t", fields, NStr::eMergeDelims );
+        NStr::Split( record_copy, " \t", fields, NStr::eMergeDelims );
         try {
             xCleanColumnValues(fields);
         }
diff --git a/c++/src/objtools/readers/phrap.cpp b/c++/src/objtools/readers/phrap.cpp
index 1582397..9b6163c 100644
--- a/c++/src/objtools/readers/phrap.cpp
+++ b/c++/src/objtools/readers/phrap.cpp
@@ -1,4 +1,4 @@
-/*  $Id: phrap.cpp 311373 2011-07-11 19:16:41Z grichenk $
+/*  $Id: phrap.cpp 486243 2015-12-02 16:47:28Z grichenk $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -521,7 +521,7 @@ void CPhrap_Read::ReadDS(CNcbiIstream& in)
     m_DS = new SReadDS;
     string tag = ReadLine(in);
     list<string> values;
-    NStr::Split(tag, " ", values, NStr::eNoMergeDelims);
+    NStr::Split(tag, " ", values, 0);
     bool in_time = false;
     ITERATE(list<string>, it, values) {
         if (*it == "CHROMAT_FILE:") {
@@ -993,7 +993,8 @@ void CPhrap_Contig::ReadTag(CNcbiIstream& in, char tag)
     SContigTag ct;
     string data = ReadLine(in);
     list<string> fields;
-    NStr::Split(data, " ", fields);
+    NStr::Split(data, " ", fields,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     list<string>::const_iterator f = fields.begin();
 
     // Need some tricks to get optional NoTrans flag
diff --git a/c++/src/objtools/readers/read_util.cpp b/c++/src/objtools/readers/read_util.cpp
index 6f0fe3a..f89400a 100644
--- a/c++/src/objtools/readers/read_util.cpp
+++ b/c++/src/objtools/readers/read_util.cpp
@@ -1,4 +1,4 @@
-/*  $Id: read_util.cpp 478458 2015-09-09 15:27:57Z ivanov $
+/*  $Id: read_util.cpp 496064 2016-03-23 15:33:38Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -71,10 +71,10 @@ void CReadUtil::Tokenize(
         }
     }
     if (temp.empty()) {
-        NStr::Tokenize(str, delim, parts, NStr::eMergeDelims);
+        NStr::Split(str, delim, parts, NStr::eMergeDelims);
         return;
     }
-    NStr::Tokenize(temp, delim, parts, NStr::eMergeDelims);
+    NStr::Split(temp, delim, parts, NStr::eMergeDelims);
     for (size_t j=0; j < parts.size(); ++j) {
         for (size_t i=0; i < parts[j].size(); ++i) {
             if (parts[j][i] == joiner) {
@@ -92,7 +92,7 @@ CRef<CSeq_id> CReadUtil::AsSeqId(
     bool localInts)
 //  -----------------------------------------------------------------
 {
-    string rawId(NStr::URLDecode(givenId));
+    string rawId(NStr::URLDecode(givenId, NStr::eUrlDec_Percent));
 
     if (flags & CReaderBase::fAllIdsAsLocal) {
         CRef<CSeq_id> pId(new CSeq_id);
@@ -127,7 +127,7 @@ CRef<CSeq_id> CReadUtil::AsSeqId(
         }
         return pId;
     }
-    catch(...) {
+    catch(CSeqIdException&) {
     }
     return CRef<CSeq_id>(new CSeq_id(CSeq_id::e_Local, rawId));
 }
diff --git a/c++/src/objtools/readers/reader_base.cpp b/c++/src/objtools/readers/reader_base.cpp
index db928f5..d9382bb 100644
--- a/c++/src/objtools/readers/reader_base.cpp
+++ b/c++/src/objtools/readers/reader_base.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reader_base.cpp 484580 2015-11-12 19:14:09Z ivanov $
+/*  $Id: reader_base.cpp 493622 2016-03-01 13:41:45Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -407,7 +407,7 @@ bool CReaderBase::xParseBrowserLine(
     CAnnot_descr& desc = annot->SetDesc();
     
     vector<string> fields;
-    NStr::Tokenize( strLine, " \t", fields, NStr::eMergeDelims );
+    NStr::Split( strLine, " \t", fields, NStr::eMergeDelims );
     for ( vector<string>::iterator it = fields.begin(); it != fields.end(); ++it ) {
         if ( *it == "position" ) {
             ++it;
diff --git a/c++/src/objtools/readers/readfeat.cpp b/c++/src/objtools/readers/readfeat.cpp
index 3cb8149..db40982 100644
--- a/c++/src/objtools/readers/readfeat.cpp
+++ b/c++/src/objtools/readers/readfeat.cpp
@@ -110,6 +110,54 @@ BEGIN_objects_SCOPE // namespace ncbi::objects::
 
 namespace {
     static const char * const kCdsFeatName = "CDS";
+    // priorities, inherited from C toolkit
+    static Uint1 std_order[CSeq_id::e_MaxChoice] = {
+        83,  /* 0 = not set */
+        80,  /* 1 = local Object-id */
+        70,  /* 2 = gibbsq */
+        70,  /* 3 = gibbmt */
+        70,  /* 4 = giim Giimport-id */
+        60,  /* 5 = genbank */
+        60,  /* 6 = embl */
+        60,  /* 7 = pir */
+        60,  /* 8 = swissprot */
+        81,  /* 9 = patent */
+        65,  /* 10 = other TextSeqId */
+        80,  /* 11 = general Dbtag */
+        82,  /* 12 = gi */
+        60,  /* 13 = ddbj */
+        60,  /* 14 = prf */
+        60,  /* 15 = pdb */
+        60,  /* 16 = tpg */
+        60,  /* 17 = tpe */
+        60,  /* 18 = tpd */
+        68,  /* 19 = gpp */
+        69   /* 20 = nat */
+    };
+
+CRef<CSeq_id> GetBestId(const CBioseq::TId& ids)
+{
+    if (ids.size() == 1)
+        return ids.front();
+
+    CRef<CSeq_id> id;
+    if (!ids.empty())
+    {
+        Uint1 best_weight = UINT_MAX;
+        ITERATE(CBioseq::TId, it, ids)
+        {
+            Uint1 new_weight = std_order[(*it)->Which()];
+            if (new_weight < best_weight)
+            {
+                id = *it;
+                best_weight = new_weight;
+            }
+        };
+    }
+
+    return id;
+}
+
 }
 
 class /* NCBI_XOBJREAD_EXPORT */ CFeature_table_reader_imp
@@ -296,7 +344,7 @@ private:
     bool x_AddQualifierToCdregion (CRef<CSeq_feat> sfp, CSeqFeatData& sfdata,
                                    EQual qtype, const string& val,
                                    ILineErrorListener *pMessageListener, int line_num, const string &seq_id );
-    bool x_AddQualifierToRna      (CSeqFeatData& sfdata,
+    bool x_AddQualifierToRna      (CRef<CSeq_feat> sfp,
                                    EQual qtype, const string& val,
                                    ILineErrorListener *pMessageListener, int line_num, const string &seq_id );
     bool x_AddQualifierToImp      (CRef<CSeq_feat> sfp, CSeqFeatData& sfdata,
@@ -314,7 +362,7 @@ private:
                                   const string& qual, const string& val);
 
     bool x_AddGeneOntologyToFeature (CRef<CSeq_feat> sfp, 
-                                     const string& qual, const string& val);
+                                     const CTempString& qual, const CTempString& val);
 
     typedef CConstRef<CSeq_feat> TFeatConstRef;
     struct SFeatAndLineNum {
@@ -1246,15 +1294,19 @@ int CFeature_table_reader_imp::x_ParseTrnaString (
 )
 
 {
-    string fst, scd;
+    CTempString value(val);
 
-    scd = val;
-    if (NStr::StartsWith (val, "tRNA-")) {
-        NStr::SplitInTwo (val, "-", fst, scd);
+    if (NStr::StartsWith(value, "tRNA-")) {
+        value.assign(value, strlen("tRNA-"), CTempString::npos);
+    }
+    CTempString::size_type pos = value.find('(');
+    if (pos != CTempString::npos)
+    {
+        value.erase(pos);
     }
 
-    TTrnaMap::const_iterator t_iter = sm_TrnaKeys.find (scd.c_str ());
-    if (t_iter != sm_TrnaKeys.end ()) {
+    TTrnaMap::const_iterator t_iter = sm_TrnaKeys.find(string(value).c_str());
+    if (t_iter != sm_TrnaKeys.end()) {
         return t_iter->second;
     }
 
@@ -1397,7 +1449,7 @@ long CFeature_table_reader_imp::x_StringToLongNoThrow (
 
 
 bool CFeature_table_reader_imp::x_AddQualifierToRna (
-    CSeqFeatData& sfdata,
+    CRef<CSeq_feat> sfp,
     EQual qtype,
     const string& val,
     ILineErrorListener *pMessageListener, 
@@ -1405,6 +1457,7 @@ bool CFeature_table_reader_imp::x_AddQualifierToRna (
     const string &seq_id
 )
 {
+    CSeqFeatData& sfdata = sfp->SetData();
     CRNA_ref& rrp = sfdata.SetRna ();
     CRNA_ref::EType rnatyp = rrp.GetType ();
     switch (rnatyp) {
@@ -1464,21 +1517,22 @@ bool CFeature_table_reader_imp::x_AddQualifierToRna (
         case CRNA_ref::eType_tRNA:
             switch (qtype) {
                 case eQual_product: {
-                        CRNA_ref::TExt& tex = rrp.SetExt ();
-                        CRNA_ref::C_Ext::E_Choice exttype = tex.Which ();
-                        if (exttype == CRNA_ref::C_Ext::e_Name) return false;
-                        CTrna_ext& trx = tex.SetTRNA ();
-                        int aaval = x_ParseTrnaString (val);
+                        if (rrp.IsSetExt() && rrp.GetExt().Which() == CRNA_ref::C_Ext::e_Name) 
+                            return false;
+
+                        sfp->SetComment(val);
+                        int aaval = x_ParseTrnaString(val);
                         if (aaval > 0) {
-                            CTrna_ext::TAa& taa = trx.SetAa ();
-                            taa.SetNcbieaa (aaval);
-                            trx.SetAa (taa);
-                            tex.SetTRNA (trx);
-                        } else {
-                            x_ProcessMsg( pMessageListener, 
-                                ILineError::eProblem_QualifierBadValue, eDiag_Error,
+                            CRNA_ref::TExt& tex = rrp.SetExt ();
+                            CTrna_ext& trx = tex.SetTRNA();
+                            CTrna_ext::TAa& taa = trx.SetAa();
+                            taa.SetNcbieaa(aaval);
+                        }
+                        else {
+                            x_ProcessMsg(pMessageListener,
+                                ILineError::eProblem_QualifierBadValue, eDiag_Warning,
                                 seq_id, line_num,
-                                "tRNA", "product", val );
+                                "tRNA", "product", val);
                         }
                         return true;
                     }
@@ -1778,8 +1832,8 @@ static const int k_NumGoQuals = sizeof (k_GoQuals) / sizeof (string);
 
 bool CFeature_table_reader_imp::x_AddGeneOntologyToFeature (
     CRef<CSeq_feat> sfp,
-    const string& qual,
-    const string& val
+    const CTempString& qual,
+    const CTempString& val
 )
 
 {
@@ -1793,8 +1847,8 @@ bool CFeature_table_reader_imp::x_AddGeneOntologyToFeature (
         return false;
     }
 
-    vector<string> fields;
-    NStr::Tokenize(val, "|", fields);
+    vector<CTempString> fields; fields.reserve(4);
+    NStr::Split(val, "|", fields);
     while (fields.size() < 4) {
         fields.push_back("");
     }
@@ -1817,13 +1871,19 @@ bool CFeature_table_reader_imp::x_AddGeneOntologyToFeature (
             }
         }
     }
-    string label (1, toupper((unsigned char) qual[0]));
-    label += qual.substr(1);
+    string label;
+    qual.Copy(label, 3, CTempString::npos); // prefix 'go_' should be eliminated
+    label[0] = toupper(label[0]);
 
     sfp->SetExt().SetType().SetStr("GeneOntology");
-    CUser_field& field = sfp->SetExt().SetField(label);
-    CRef<CUser_field> text_field (new CUser_field());
-    text_field->SetLabel().SetStr("text_string");
+    CUser_field& wrap = sfp->SetExt().SetField(label);
+    CRef<CUser_field> new_field(new CUser_field);
+    CUser_field& field = *new_field;
+    wrap.SetData().SetFields().push_back(new_field);
+    field.SetLabel().SetId(0); // compatible with C-toolkit
+
+    CRef<CUser_field> text_field(new CUser_field());
+    text_field->SetLabel().SetStr("text string");
     text_field->SetData().SetStr( CUtf8::AsUTF8(fields[0], eEncoding_Ascii));
     field.SetData().SetFields().push_back(text_field);
   
@@ -2132,7 +2192,7 @@ bool CFeature_table_reader_imp::x_AddQualifierToFeature (
                     if (x_AddQualifierToCdregion (sfp, sfdata, qtype, val, pMessageListener, line, seq_id)) return true;
                     break;
                 case CSeqFeatData::e_Rna:
-                    if (x_AddQualifierToRna (sfdata, qtype, val, pMessageListener, line, seq_id)) return true;
+                    if (x_AddQualifierToRna (sfp, qtype, val, pMessageListener, line, seq_id)) return true;
                     break;
                 case CSeqFeatData::e_Imp:
                     if (x_AddQualifierToImp (sfp, sfdata, qtype, qual, val)) return true;
@@ -2227,15 +2287,16 @@ bool CFeature_table_reader_imp::x_AddQualifierToFeature (
                     }
                 case eQual_inference:
                     {
-                        string prefix = "", remainder = "";
-                        CInferencePrefixList::GetPrefixAndRemainder (val, prefix, remainder);
-                        if (!NStr::IsBlank(prefix) && NStr::StartsWith (val, prefix)) {
-                            x_AddGBQualToFeature (sfp, qual, val);
-                        } else {
-                            x_ProcessMsg( pMessageListener, 
+                        string prefix, remainder;
+                        CInferencePrefixList::GetPrefixAndRemainder(val, prefix, remainder);
+                        if (!NStr::IsBlank(prefix)) {
+                            x_AddGBQualToFeature(sfp, qual, val);
+                        }
+                        else {
+                            x_ProcessMsg(pMessageListener,
                                 ILineError::eProblem_QualifierBadValue, eDiag_Error,
                                 seq_id, line,
-                                feat_name, qual, val );
+                                feat_name, qual, val);
                         }
                         return true;
                     }
@@ -2352,7 +2413,7 @@ bool CFeature_table_reader_imp::x_AddQualifierToFeature (
                     }
                     return false;
                 case eQual_protein_id:
-                    // see SQD-1535
+                    // see SQD-1535 and SQD-3496
                     if (typ == CSeqFeatData::e_Cdregion ||
                         (typ == CSeqFeatData::e_Rna &&
                         sfdata.GetRna().GetType() == CRNA_ref::eType_mRNA))
@@ -2361,11 +2422,13 @@ bool CFeature_table_reader_imp::x_AddQualifierToFeature (
                         CSeq_id::ParseIDs(ids, val,                                
                                  CSeq_id::fParse_ValidLocal
                                | CSeq_id::fParse_PartialOK);
-                        if (ids.size()>1)
+                        if ((flags & CFeature_table_reader::fLeaveProteinIds) || (ids.size()>1))
                         {
                             x_AddGBQualToFeature (sfp, qual, val); // need to store all ids
                         }
-                        sfp->SetProduct().SetWhole(*ids.front());
+                        CRef<CSeq_id> best = GetBestId(ids);
+                        if (!best.Empty())
+                           sfp->SetProduct().SetWhole(*best);
                         return true;
                     } catch( CSeqIdException & ) {
                         return false;
@@ -2622,6 +2685,12 @@ bool CFeature_table_reader_imp::x_SetupSeqFeat (
                 case CSeqFeatData::eSubtype_sig_peptide_aa:
                     prot_ref.SetProcessed(CProt_ref::eProcessed_signal_peptide);
                     break;
+                case CSeqFeatData::eSubtype_preprotein:
+                    prot_ref.SetProcessed(CProt_ref::eProcessed_preprotein);
+                    break;
+                case CSeqFeatData::eSubtype_transit_peptide_aa:
+                    prot_ref.SetProcessed(CProt_ref::eProcessed_transit_peptide);
+                    break;
             }
         }
 
@@ -3194,7 +3263,8 @@ CRef<CSeq_annot> CFeature_table_reader::ReadSequinFeatureTable (
     ILineReader& reader,
     const TFlags flags,
     ILineErrorListener* pMessageListener,
-    ITableFilter *filter
+    ITableFilter *filter,
+    const string& seqid_prefix
 )
 {
     string fst, scd, seqid, annotname;
@@ -3209,6 +3279,18 @@ CRef<CSeq_annot> CFeature_table_reader::ReadSequinFeatureTable (
         }
     }
 
+    if (!seqid_prefix.empty())
+    {
+        if (seqid.find('|') == string::npos)
+           seqid.insert(0, seqid_prefix);
+        else
+        if (NStr::StartsWith(seqid, "lcl|"))
+        {
+            seqid.erase(0, 4);
+            seqid.insert(0, seqid_prefix);
+        }
+    }
+
     // then read features from 5-column table
     return ReadSequinFeatureTable (reader, seqid, annotname, flags, pMessageListener, filter);
 
@@ -3304,7 +3386,7 @@ void CFeature_table_reader::AddFeatQual (
     const string& val,
     const CFeature_table_reader::TFlags flags,
     ILineErrorListener* pMessageListener,
-    int line, 	
+    int line, 	 
     const string &seq_id 
 )
 
diff --git a/c++/src/objtools/readers/rm_reader.cpp b/c++/src/objtools/readers/rm_reader.cpp
index c212d58..6537374 100644
--- a/c++/src/objtools/readers/rm_reader.cpp
+++ b/c++/src/objtools/readers/rm_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: rm_reader.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: rm_reader.cpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/readers/source_mod_parser.cpp b/c++/src/objtools/readers/source_mod_parser.cpp
index cf8a612..c872057 100644
--- a/c++/src/objtools/readers/source_mod_parser.cpp
+++ b/c++/src/objtools/readers/source_mod_parser.cpp
@@ -1,4 +1,4 @@
-/*  $Id: source_mod_parser.cpp 478277 2015-09-08 14:32:41Z ivanov $
+/*  $Id: source_mod_parser.cpp 499427 2016-04-26 14:11:26Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -510,12 +510,17 @@ void CSourceModParser::x_ApplyMods(CAutoInitDesc<CBioSource>& bsrc,
         }
     }
 
-    if ( !organism.empty()
-        &&  ( !bsrc->GetOrg().IsSetTaxname()
-             ||  !NStr::EqualNocase(bsrc->GetOrg().GetTaxname(), organism))) {
-        bsrc->ResetOrg();
-        bsrc->ResetSubtype();
-        bsrc->SetOrg().SetTaxname(organism);
+    if ( !organism.empty())
+    {
+        if (!(bsrc->GetOrg().IsSetTaxname() && NStr::EqualNocase(bsrc->GetOrg().GetTaxname(), organism)))
+        {
+            if (bsrc->GetOrg().IsSetTaxname())
+            {
+                bsrc->ResetOrg();
+                bsrc->ResetSubtype();
+            }
+            bsrc->SetOrg().SetTaxname(organism);
+        }
     }
 
     // location
@@ -749,11 +754,18 @@ void CSourceModParser::x_ApplyMods(CAutoInitDesc<CBioSource>& bsrc,
     }
 
     // note[s]
-    if ((mod = FindMod("note", "notes")) != NULL) {
-        CRef< CSubSource > new_subsource( new CSubSource );
-        new_subsource->SetSubtype( CSubSource::eSubtype_other );
-        new_subsource->SetName( mod->value );
-        bsrc->SetSubtype().push_back( new_subsource );
+    TModsRange mods[2];
+    mods[0] = FindAllMods("note");
+    mods[1] = FindAllMods("notes");
+    for (size_t i = 0; i < 2; i++)
+    {
+        for (TModsCI it = mods[i].first; it != mods[i].second; it++)
+        {
+            CRef< CSubSource > new_subsource(new CSubSource);
+            new_subsource->SetSubtype(CSubSource::eSubtype_other);
+            new_subsource->SetName(it->value);
+            bsrc->SetSubtype().push_back(new_subsource);
+        }
     }
 
     // focus
@@ -788,6 +800,7 @@ static const TTechMapEntry sc_TechArray[] = {
     { "standard",           CMolInfo::eTech_standard },
     { "STS",                CMolInfo::eTech_sts },
     { "survey",             CMolInfo::eTech_survey },
+    { "targeted",           CMolInfo::eTech_targeted },
     { "tsa",                CMolInfo::eTech_tsa },
     { "wgs",                CMolInfo::eTech_wgs }
 };
@@ -906,7 +919,7 @@ void CSourceModParser::x_ApplyMods(CAutoInitDesc<CGB_block>& gbb)
     if ((mod = FindMod("secondary-accession", "secondary-accessions")) != NULL)
     {
         list<CTempString> ranges;
-        NStr::Split(mod->value, ",", ranges);
+        NStr::Split(mod->value, ",", ranges, NStr::fSplit_MergeDelimiters);
         ITERATE (list<CTempString>, it, ranges) {
             string s = NStr::TruncateSpaces_Unsafe(*it);
             try {
@@ -923,7 +936,7 @@ void CSourceModParser::x_ApplyMods(CAutoInitDesc<CGB_block>& gbb)
     // keyword[s]
     if ((mod = FindMod("keyword", "keywords")) != NULL) {
         list<string> keywordList;
-        NStr::Split( mod->value, ",;", keywordList );
+        NStr::Split(mod->value, ",;", keywordList, NStr::fSplit_MergeDelimiters);
         // trim every string and push it into the real keyword list
         NON_CONST_ITERATE( list<string>, keyword_iter, keywordList ) {
             NStr::TruncateSpacesInPlace( *keyword_iter );
@@ -941,7 +954,7 @@ void CSourceModParser::x_ApplyMods(CAutoInitRef<CSeq_hist>& hist)
     if ((mod = FindMod("secondary-accession", "secondary-accessions")) != NULL)
     {
         list<CTempString> ranges;
-        NStr::Split(mod->value, ",", ranges);
+        NStr::Split(mod->value, ",", ranges, NStr::fSplit_MergeDelimiters);
         ITERATE (list<CTempString>, it, ranges) {
             string s = NStr::TruncateSpaces_Unsafe(*it);
             try {
@@ -1019,7 +1032,7 @@ void CSourceModParser::x_ApplyTPAMods(CAutoInitRef<CUser_object>& tpa)
     if ((mod = FindMod("primary", "primary-accessions")) != NULL) {
         CUser_object::TData data;
         list<CTempString> accns;
-        NStr::Split(mod->value, ",", accns);
+        NStr::Split(mod->value, ",", accns, NStr::fSplit_MergeDelimiters);
         ITERATE (list<CTempString>, it, accns) {
             CRef<CUser_field> field(new CUser_field), subfield(new CUser_field);
             field->SetLabel().SetId(0);
@@ -1045,7 +1058,7 @@ CSourceModParser::x_ApplyGenomeProjectsDBMods(CAutoInitRef<CUser_object>& gpdb)
     if ((mod = FindMod("project", "projects")) != NULL) {
         CUser_object::TData data;
         list<CTempString> ids;
-        NStr::Split(mod->value, ",;", ids);
+        NStr::Split(mod->value, ",;", ids, NStr::fSplit_MergeDelimiters);
         ITERATE (list<CTempString>, it, ids) {
             unsigned int id = NStr::StringToUInt(*it, NStr::fConvErr_NoThrow);
             if (id > 0) {
@@ -1338,5 +1351,22 @@ void CSourceModParser::ApplyMods(CGB_block& gbb)
     x_ApplyMods(ref);
 }
 
+void CSourceModParser::SetAllUnused()
+{
+    NON_CONST_ITERATE(TMods, it, m_Mods)
+    {
+        const_cast<SMod&>(*it).used = false;
+    }
+}
+
+void CSourceModParser::AddMods(const CTempString& name, const CTempString& value)
+{
+    SMod newmod;
+    newmod.key = name;
+    newmod.value = value;
+
+    m_Mods.insert(newmod);
+}
+
 END_SCOPE(objects)
 END_NCBI_SCOPE
diff --git a/c++/src/objtools/readers/ucscregion_reader.cpp b/c++/src/objtools/readers/ucscregion_reader.cpp
index 619f0f8..5726bba 100644
--- a/c++/src/objtools/readers/ucscregion_reader.cpp
+++ b/c++/src/objtools/readers/ucscregion_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ucscregion_reader.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: ucscregion_reader.cpp 472138 2015-07-07 16:07:55Z grichenk $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/objtools/readers/vcf_reader.cpp b/c++/src/objtools/readers/vcf_reader.cpp
index bf07c67..1031688 100644
--- a/c++/src/objtools/readers/vcf_reader.cpp
+++ b/c++/src/objtools/readers/vcf_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: vcf_reader.cpp 481063 2015-10-06 17:15:25Z ivanov $
+/*  $Id: vcf_reader.cpp 493624 2016-03-01 13:42:25Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -306,7 +306,7 @@ CVcfReader::xProcessMetaLineInfo(
         string key, id, numcount, type, description;
         string info = line.substr( 
             prefix.length(), line.length() - prefix.length() - postfix.length() );
-        NStr::Tokenize( info, ",", fields );
+        NStr::Split( info, ",", fields );
         NStr::SplitInTwo( fields[0], "=", key, id );
         if ( key != "ID" ) {
             AutoPtr<CObjReaderLineException> pErr(
@@ -375,7 +375,7 @@ CVcfReader::xProcessMetaLineFilter(
         string key, id, description;
         string info = line.substr( 
             prefix.length(), line.length() - prefix.length() - postfix.length() );
-        NStr::Tokenize( info, ",", fields );
+        NStr::Split( info, ",", fields );
         NStr::SplitInTwo( fields[0], "=", key, id );
         if ( key != "ID" ) {
             AutoPtr<CObjReaderLineException> pErr(
@@ -424,7 +424,7 @@ CVcfReader::xProcessMetaLineFormat(
         string key, id, numcount, type, description;
         string info = line.substr( 
             prefix.length(), line.length() - prefix.length() - postfix.length() );
-        NStr::Tokenize( info, ",", fields );
+        NStr::Split( info, ",", fields );
         NStr::SplitInTwo( fields[0], "=", key, id );
         if ( key != "ID" ) {
             AutoPtr<CObjReaderLineException> pErr(
@@ -496,7 +496,7 @@ CVcfReader::xProcessHeaderLine(
     //  After that come the various headers for the genotype information, and these
     //  need to be preserved:
     //
-    NStr::Tokenize(line, " \t", m_GenotypeHeaders, NStr::eMergeDelims);
+    NStr::Split(line, " \t", m_GenotypeHeaders, NStr::eMergeDelims);
     vector<string>::iterator pos_format = find(
         m_GenotypeHeaders.begin(), m_GenotypeHeaders.end(), "FORMAT");
     if ( pos_format == m_GenotypeHeaders.end() ) {
@@ -818,7 +818,7 @@ CVcfReader::xParseData(
 //  ----------------------------------------------------------------------------
 {
     vector<string> columns;
-    NStr::Tokenize( line, "\t", columns, NStr::eMergeDelims );
+    NStr::Split( line, "\t", columns, NStr::eMergeDelims );
     if ( columns.size() < 8 ) {
         return false;
     }
@@ -827,12 +827,12 @@ CVcfReader::xParseData(
 
         data.m_strChrom = columns[0];
         data.m_iPos = NStr::StringToInt( columns[1] );
-        NStr::Tokenize( columns[2], ";", data.m_Ids, NStr::eNoMergeDelims );
+        NStr::Split( columns[2], ";", data.m_Ids, NStr::eNoMergeDelims );
         if ( (data.m_Ids.size() == 1)  &&  (data.m_Ids[0] == ".") ) {
             data.m_Ids.clear();
         }
         data.m_strRef = columns[3];
-        NStr::Tokenize( columns[4], ",", data.m_Alt, NStr::eNoMergeDelims );
+        NStr::Split( columns[4], ",", data.m_Alt, NStr::eNoMergeDelims );
         if ( columns[5] != "." ) {
             data.m_pdQual = new double( NStr::StringToDouble( columns[5] ) );
         }
@@ -840,22 +840,22 @@ CVcfReader::xParseData(
 
         vector<string> infos;
         if ( columns[7] != "." ) {
-            NStr::Tokenize( columns[7], ";", infos, NStr::eMergeDelims );
+            NStr::Split( columns[7], ";", infos, NStr::eMergeDelims );
             for ( vector<string>::iterator it = infos.begin(); 
                 it != infos.end(); ++it ) 
             {
                 string key, value;
                 NStr::SplitInTwo( *it, "=", key, value );
                 data.m_Info[key] = vector<string>();
-                NStr::Tokenize( value, ",", data.m_Info[key] );
+                NStr::Split( value, ",", data.m_Info[key] );
             }
         }
         if ( columns.size() > 8 ) {
-            NStr::Tokenize( columns[8], ":", data.m_FormatKeys, NStr::eMergeDelims );
+            NStr::Split( columns[8], ":", data.m_FormatKeys, NStr::eMergeDelims );
 
             for ( size_t u=9; u < columns.size(); ++u ) {
                 vector<string> values;
-                NStr::Tokenize( columns[u], ":", values, NStr::eMergeDelims );
+                NStr::Split( columns[u], ":", values, NStr::eMergeDelims );
                 data.m_GenotypeData[ m_GenotypeHeaders[u-9] ] = values;
             }
         }
diff --git a/c++/src/objtools/readers/wiggle_reader.cpp b/c++/src/objtools/readers/wiggle_reader.cpp
index 8148397..6d2b1a8 100644
--- a/c++/src/objtools/readers/wiggle_reader.cpp
+++ b/c++/src/objtools/readers/wiggle_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: wiggle_reader.cpp 477847 2015-09-02 13:12:31Z ivanov $
+/*  $Id: wiggle_reader.cpp 472933 2015-07-15 13:13:48Z ludwigf $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -1101,6 +1101,15 @@ void CWiggleReader::xGetFixedStepInfo(
         }
         else if ( name == "start" ) {
             fixedStepInfo.mStart = NStr::StringToUInt(value);
+            if (0 == fixedStepInfo.mStart) {
+                AutoPtr<CObjReaderLineException> pErr(
+                    CObjReaderLineException::Create(
+                    eDiag_Warning,
+                    0,
+                    "Bad start value: must be positive. Assuming \"start=1\"."));
+                ProcessError(*pErr, pMessageListener);
+                fixedStepInfo.mStart = 1;
+            }
         }
         else if ( name == "step" ) {
             fixedStepInfo.mStep = NStr::StringToUInt(value);
diff --git a/c++/src/serial/Makefile.serial.lib b/c++/src/serial/Makefile.serial.lib
index c7ee512..082d110 100644
--- a/c++/src/serial/Makefile.serial.lib
+++ b/c++/src/serial/Makefile.serial.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.serial.lib 478544 2015-09-10 13:20:18Z ivanov $
+# $Id: Makefile.serial.lib 476397 2015-08-18 18:56:47Z grichenk $
 
 # Build library "XSER"
 #################################
diff --git a/c++/src/serial/choice.cpp b/c++/src/serial/choice.cpp
index d424227..4c6a2d0 100644
--- a/c++/src/serial/choice.cpp
+++ b/c++/src/serial/choice.cpp
@@ -1,4 +1,4 @@
-/*  $Id: choice.cpp 448624 2014-10-07 18:54:36Z gouriano $
+/*  $Id: choice.cpp 497436 2016-04-06 17:56:51Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -338,7 +338,7 @@ void CChoiceTypeInfoFunctions::AssignSimple(TTypeInfo typeInfo,
 }
 
 
-void CChoiceTypeInfo::SetSelectDelayFunction(TSelectDelayFunction func)
+void CChoiceTypeInfo::SetSelectDelay(TSelectDelayFunction func)
 {
     _ASSERT(m_SelectDelayFunction == 0);
     _ASSERT(func != 0);
@@ -522,7 +522,7 @@ void CChoiceTypeInfo::SetGlobalHook(const CTempString& variants,
     }
     else {
         vector<CTempString> tokens;
-        NStr::Tokenize(variants, ",", tokens);
+        NStr::Split(variants, ",", tokens, NStr::fSplit_NoMergeDelims);
         ITERATE ( vector<CTempString>, it, tokens ) {
             const_cast<CVariantInfo*>(GetVariantInfo(*it))->
                 SetGlobalReadHook(hook);
diff --git a/c++/src/serial/classinfo.cpp b/c++/src/serial/classinfo.cpp
index 33f7eb0..4b9d7c1 100644
--- a/c++/src/serial/classinfo.cpp
+++ b/c++/src/serial/classinfo.cpp
@@ -1,4 +1,4 @@
-/*  $Id: classinfo.cpp 412224 2013-09-05 15:30:00Z gouriano $
+/*  $Id: classinfo.cpp 497436 2016-04-06 17:56:51Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -545,7 +545,7 @@ void CClassTypeInfo::SetGlobalHook(const CTempString& members,
     }
     else {
         vector<CTempString> tokens;
-        NStr::Tokenize(members, ",", tokens);
+        NStr::Split(members, ",", tokens, NStr::fSplit_NoMergeDelims);
         ITERATE ( vector<CTempString>, it, tokens ) {
             const_cast<CMemberInfo*>(GetMemberInfo(*it))->
                 SetGlobalReadHook(hook);
diff --git a/c++/src/serial/datatool/blocktype.cpp b/c++/src/serial/datatool/blocktype.cpp
index e61e1c3..6e6c119 100644
--- a/c++/src/serial/datatool/blocktype.cpp
+++ b/c++/src/serial/datatool/blocktype.cpp
@@ -1,4 +1,4 @@
-/*  $Id: blocktype.cpp 455924 2015-01-06 14:35:19Z gouriano $
+/*  $Id: blocktype.cpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -261,8 +261,16 @@ void CDataMemberContainerType::PrintXMLSchema(CNcbiOstream& out,
                     tmp += " type=\"" + tname + "\"/>";
                     PrintASNNewLine(out, indent) << tmp;
                 } else {
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+                    PrintASNNewLine(out, indent) << tmp;
+                    if (!Comments().PrintSchemaComments(out, indent+1)) {
+                        out << '>';
+                    }
+                    ++indent;
+#else
                     tmp += ">";
                     opentag.push_back(tmp);
+#endif
                     closetag2.push_front("</xs:element>");
                 }
 
@@ -987,7 +995,9 @@ void CDataMember::PrintSpecDump(CNcbiOstream& out, int indent, const char* tag)
 
 void CDataMember::PrintXMLSchema(CNcbiOstream& out, int indent, bool contents_only) const
 {
+#if !_DATATOOL_USE_SCHEMA_STYLE_COMMENTS
     m_Comments.PrintDTD(out, CComments::eNoEOL); 
+#endif
     GetType()->PrintXMLSchema(out, indent, contents_only);
 }
 
diff --git a/c++/src/serial/datatool/choicestr.cpp b/c++/src/serial/datatool/choicestr.cpp
index 8a6f83d..2aa4533 100644
--- a/c++/src/serial/datatool/choicestr.cpp
+++ b/c++/src/serial/datatool/choicestr.cpp
@@ -1,4 +1,4 @@
-/*  $Id: choicestr.cpp 461337 2015-03-09 18:00:58Z gouriano $
+/*  $Id: choicestr.cpp 477153 2015-08-26 18:45:21Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -432,7 +432,7 @@ void CChoiceTypeStrings::GenerateClassCode(CClassCode& code,
             "inline\n"
             "void "<<methodPrefix<<"SelectDelayBuffer(" STATE_ENUM " index)\n"
             "{\n"
-            "    if ( " STATE_MEMBER " != " STATE_NOT_SET " || " DELAY_MEMBER ".GetIndex() != (index - 1))\n"
+            "    if ( " STATE_MEMBER " != " STATE_NOT_SET " || " DELAY_MEMBER ".GetIndex() != index)\n"
             "        NCBI_THROW(ncbi::CSerialException,eIllegalCall, \"illegal call\");\n"
             "    " STATE_MEMBER " = index;\n"
             "}\n"
diff --git a/c++/src/serial/datatool/comments.cpp b/c++/src/serial/datatool/comments.cpp
index f7d4921..bb48aa0 100644
--- a/c++/src/serial/datatool/comments.cpp
+++ b/c++/src/serial/datatool/comments.cpp
@@ -1,4 +1,4 @@
-/*  $Id: comments.cpp 195971 2010-06-29 13:34:20Z gouriano $
+/*  $Id: comments.cpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -88,6 +88,36 @@ CNcbiOstream& CComments::PrintHPPMember(CNcbiOstream& out) const
     return Empty() ? out : Print(out, "    ///","\n    ///","\n");
 }
 
+bool CComments::PrintSchemaComments(CNcbiOstream& out, int indent, int /*flags*/) const
+{
+    if ( Empty() ) {
+        return false;
+    }
+    
+    out << '>'; // close 'element' tag
+#if 0
+    PrintASNNewLine(out, indent) << "<xs:annotation><xs:documentation>";
+    ITERATE ( TComments, i, m_Comments ) {
+        out << '\n' << *i;
+    }
+    PrintASNNewLine(out, indent) << "</xs:documentation></xs:annotation>";
+#else
+    if ( OneLine() ) {
+        PrintASNNewLine(out, indent) << "<xs:annotation><xs:documentation>";
+        out << NStr::TruncateSpaces(m_Comments.front());
+        out << "</xs:documentation></xs:annotation>";
+    }
+    else {
+        PrintASNNewLine(out, indent) << "<xs:annotation><xs:documentation>";
+        ITERATE ( TComments, i, m_Comments ) {
+            out << '\n' << *i;
+        }
+        PrintASNNewLine(out, indent) << "</xs:documentation></xs:annotation>";
+    }
+#endif
+    return true;
+}
+
 CNcbiOstream& CComments::PrintDTD(CNcbiOstream& out, int flags) const
 {
     if ( Empty() ) // no comments
diff --git a/c++/src/serial/datatool/comments.hpp b/c++/src/serial/datatool/comments.hpp
index 7d90c47..f91343c 100644
--- a/c++/src/serial/datatool/comments.hpp
+++ b/c++/src/serial/datatool/comments.hpp
@@ -1,7 +1,7 @@
 #ifndef COMMENTS__HPP
 #define COMMENTS__HPP
 
-/*  $Id: comments.hpp 122761 2008-03-25 16:45:09Z gouriano $
+/*  $Id: comments.hpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -38,6 +38,8 @@
 
 BEGIN_NCBI_SCOPE
 
+#define _DATATOOL_USE_SCHEMA_STYLE_COMMENTS  1
+
 class CComments
 {
 public:
@@ -60,6 +62,7 @@ public:
     
     CNcbiOstream& Print(CNcbiOstream& out, const string& before,
                         const string& between, const string& after) const;
+    bool PrintSchemaComments(CNcbiOstream& out, int indent, int flags = 0) const;
     CNcbiOstream& PrintDTD(CNcbiOstream& out, int flags = 0) const;
     CNcbiOstream& PrintASN(CNcbiOstream& out, int indent, int flags = 0) const;
 
diff --git a/c++/src/serial/datatool/datatool.cpp b/c++/src/serial/datatool/datatool.cpp
index 8572338..b381b54 100644
--- a/c++/src/serial/datatool/datatool.cpp
+++ b/c++/src/serial/datatool/datatool.cpp
@@ -1,4 +1,4 @@
-/*  $Id: datatool.cpp 471533 2015-06-29 11:41:42Z ivanov $
+/*  $Id: datatool.cpp 485907 2015-11-30 14:26:20Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -271,7 +271,7 @@ bool CDataTool::ProcessModules(void)
     
     if ( generator.GetOpt("opm", &opt) ) {
 //        modulesPath.clear();
-        NStr::Split(opt, ",", modulesPath);
+        NStr::Split(opt, ",", modulesPath, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     }
     
     SourceFile::EType srctype =
@@ -727,7 +727,7 @@ SourceFile::EType CDataTool::LoadDefinitions(
     ITERATE (CArgValue::TStringArray, n, nameList) {
         if (split_names) {
             list<string> t;
-            NStr::Split(*n, " ", t);
+            NStr::Split(*n, " ", t, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             names.insert(names.end(), t.begin(), t.end());
         } else {
             names.push_back(*n);
diff --git a/c++/src/serial/datatool/enumstr.cpp b/c++/src/serial/datatool/enumstr.cpp
index 5b96b33..f94ad07 100644
--- a/c++/src/serial/datatool/enumstr.cpp
+++ b/c++/src/serial/datatool/enumstr.cpp
@@ -1,4 +1,4 @@
-/*  $Id: enumstr.cpp 471532 2015-06-29 11:41:24Z ivanov $
+/*  $Id: enumstr.cpp 471296 2015-06-25 12:36:15Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/serial/datatool/enumtype.cpp b/c++/src/serial/datatool/enumtype.cpp
index 9718da8..7cc913f 100644
--- a/c++/src/serial/datatool/enumtype.cpp
+++ b/c++/src/serial/datatool/enumtype.cpp
@@ -1,4 +1,4 @@
-/*  $Id: enumtype.cpp 471532 2015-06-29 11:41:24Z ivanov $
+/*  $Id: enumtype.cpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -158,7 +158,15 @@ void CEnumDataType::PrintXMLSchema(CNcbiOstream& out,
                 use = "optional";
             }
         }
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+        PrintASNNewLine(out, indent) << tmp;
+        if (!Comments().PrintSchemaComments(out, indent+1)) {
+            out << '>';
+        }
+        ++indent;
+#else
         opentag.push_back(tmp + ">");
+#endif
         closetag.push_front("</xs:element>");
         opentag.push_back("<xs:complexType>");
         closetag.push_front("</xs:complexType>");
@@ -171,8 +179,8 @@ void CEnumDataType::PrintXMLSchema(CNcbiOstream& out,
         }
     }
     string tmp = "<xs:attribute name=\"" + value + "\" use=\"" + use + "\"" + form;
+    const CDataMember* mem = GetDataMember();
     if (!inAttlist) {
-        const CDataMember* mem = GetDataMember();
         if (mem && mem->Optional() && mem->GetDefault()) {
             tmp += " default=\"" + GetXmlValueName(mem->GetDefault()->GetXmlString()) + "\"";
         }
@@ -195,14 +203,25 @@ void CEnumDataType::PrintXMLSchema(CNcbiOstream& out,
         }
     }
     if ( haveComments ) {
-        out << "\n<!--\n";
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+        PrintASNNewLine(out, indent) << "<xs:annotation><xs:documentation>";
         ITERATE ( TValues, i, m_Values ) {
             if ( !i->GetComments().Empty() ) {
-                i->GetComments().Print(out, "    "+i->GetName()+"\t- ",
-                                       "\n        ", "\n");
+                i->GetComments().Print(out, "\n "+i->GetName()+"\t- ",
+                                            "\n ", "");
             }
         }
-        out << "-->";
+        PrintASNNewLine(out, indent) << "</xs:documentation></xs:annotation>";
+#else
+        out << "\n<!--";
+        ITERATE ( TValues, i, m_Values ) {
+            if ( !i->GetComments().Empty() ) {
+                i->GetComments().Print(out, "\n    "+i->GetName()+"\t- ",
+                                       "\n        ", "");
+            }
+        }
+        out << "\n-->";
+#endif
     }
     ITERATE ( TValues, i, m_Values ) {
         PrintASNNewLine(out, indent) <<
diff --git a/c++/src/serial/datatool/enumtype.hpp b/c++/src/serial/datatool/enumtype.hpp
index 653bde2..b880d1d 100644
--- a/c++/src/serial/datatool/enumtype.hpp
+++ b/c++/src/serial/datatool/enumtype.hpp
@@ -1,7 +1,7 @@
 #ifndef ENUMTYPE_HPP
 #define ENUMTYPE_HPP
 
-/*  $Id: enumtype.hpp 471532 2015-06-29 11:41:24Z ivanov $
+/*  $Id: enumtype.hpp 471296 2015-06-25 12:36:15Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/serial/datatool/filecode.cpp b/c++/src/serial/datatool/filecode.cpp
index 9858e9e..088e679 100644
--- a/c++/src/serial/datatool/filecode.cpp
+++ b/c++/src/serial/datatool/filecode.cpp
@@ -1,4 +1,4 @@
-/*  $Id: filecode.cpp 435421 2014-05-15 19:29:47Z ucko $
+/*  $Id: filecode.cpp 485907 2015-11-30 14:26:20Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -438,7 +438,7 @@ void CFileCode::GenerateHPP(const string& path, string& fileName) const
     string extra = m_CodeGenerator->GetConfig().Get("-","_extra_headers");
     if (!extra.empty()) {
         list<string> extra_values;
-        NStr::Split(extra, " \t\n\r,;", extra_values);
+        NStr::Split(extra, " \t\n\r,;", extra_values, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         header << "// extra headers\n";
         list<string>::const_iterator i;
         for (i = extra_values.begin(); i != extra_values.end(); ++i) {
diff --git a/c++/src/serial/datatool/generate.cpp b/c++/src/serial/datatool/generate.cpp
index 1a48560..709cf22 100644
--- a/c++/src/serial/datatool/generate.cpp
+++ b/c++/src/serial/datatool/generate.cpp
@@ -1,4 +1,4 @@
-/*  $Id: generate.cpp 452865 2014-11-25 17:18:48Z vasilche $
+/*  $Id: generate.cpp 485907 2015-11-30 14:26:20Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -307,7 +307,7 @@ void CCodeGenerator::UndoGenerateCode(void)
             }
             NStr::ReplaceInPlace(strline,"GENFILES =","");
             list<string> files;
-            NStr::Split( strline, " ", files);
+            NStr::Split( strline, " ", files, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             ITERATE(list<string>, f, files) {
                 CFile fo;
                 fo.Reset( MakeAbsolutePath( Path(m_HPPDir, *f)) + "_.hpp");
@@ -953,7 +953,7 @@ void CCodeGenerator::GenerateClientCode(void)
         // explicit name; must be enabled
         list<string> l;
         // if multiple items, may have whitespace, commas, or both...
-        NStr::Split(clients, ", \t", l);
+        NStr::Split(clients, ", \t", l, NStr::fSplit_MergeDelimiters);
         ITERATE (list<string>, it, l) {
             if ( !it->empty() ) {
                 GenerateClientCode(*it, true);
diff --git a/c++/src/serial/datatool/module.cpp b/c++/src/serial/datatool/module.cpp
index 901ba99..a7b705b 100644
--- a/c++/src/serial/datatool/module.cpp
+++ b/c++/src/serial/datatool/module.cpp
@@ -1,4 +1,4 @@
-/*  $Id: module.cpp 412225 2013-09-05 15:31:52Z gouriano $
+/*  $Id: module.cpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -269,7 +269,9 @@ void CDataTypeModule::PrintXMLSchema(CNcbiOstream& out) const
     m_ExtraDefs.clear();
     ITERATE ( TDefinitions, i, m_Definitions ) {
         out << "\n";
+#if !_DATATOOL_USE_SCHEMA_STYLE_COMMENTS
         i->second->PrintDTDTypeComments(out, 0);
+#endif
         i->second->PrintXMLSchema(out,0);
     }
     out << m_ExtraDefs;
diff --git a/c++/src/serial/datatool/reftype.cpp b/c++/src/serial/datatool/reftype.cpp
index a91dcc4..8c421c6 100644
--- a/c++/src/serial/datatool/reftype.cpp
+++ b/c++/src/serial/datatool/reftype.cpp
@@ -1,4 +1,4 @@
-/*  $Id: reftype.cpp 412225 2013-09-05 15:31:52Z gouriano $
+/*  $Id: reftype.cpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -108,7 +108,13 @@ void CReferenceDataType::PrintXMLSchema(CNcbiOstream& out,
             if (GetDataMember() && GetDataMember()->Optional()) {
                 out << " minOccurs=\"0\"";
             }
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+            if (!(GetDataMember() && GetDataMember()->GetComments().PrintSchemaComments(out, indent))) {
+                out << ">";
+            }
+#else
             out << ">";
+#endif
             PrintASNNewLine(out,indent++) << "<xs:complexType>";
             PrintASNNewLine(out,indent++) << "<xs:sequence>";
         }
diff --git a/c++/src/serial/datatool/rpcgen.cpp b/c++/src/serial/datatool/rpcgen.cpp
index b6b4fbb..44f6b48 100644
--- a/c++/src/serial/datatool/rpcgen.cpp
+++ b/c++/src/serial/datatool/rpcgen.cpp
@@ -1,4 +1,4 @@
-/*  $Id: rpcgen.cpp 282780 2011-05-16 16:02:27Z gouriano $
+/*  $Id: rpcgen.cpp 485360 2015-11-20 17:03:34Z ucko $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -85,7 +85,7 @@ static const CChoiceDataType* s_ChoiceType(const CDataType* dtype,
 {
     vector<string> v;
     if ( !element.empty() ) {
-        NStr::Tokenize(element, ".", v);
+        NStr::Split(element, ".", v, NStr::fSplit_NoMergeDelims);
     }
     ITERATE (vector<string>, subelement, v) {
         const CDataMemberContainerType* dct
diff --git a/c++/src/serial/datatool/statictype.cpp b/c++/src/serial/datatool/statictype.cpp
index a15688a..38556b3 100644
--- a/c++/src/serial/datatool/statictype.cpp
+++ b/c++/src/serial/datatool/statictype.cpp
@@ -1,4 +1,4 @@
-/*  $Id: statictype.cpp 412225 2013-09-05 15:31:52Z gouriano $
+/*  $Id: statictype.cpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -120,16 +120,20 @@ void CStaticDataType::PrintXMLSchema(CNcbiOstream& out,
     if (IsNillable()) {
         out << " nillable=\"true\"";
     }
-    if (type.empty() && PrintXMLSchemaContents(out,indent+1)) {
+    if (PrintXMLSchemaContents(out,indent+1,mem)) {
         PrintASNNewLine(out, indent) << "</xs:" << xsdk << ">";
     } else {
         out << "/>";
     }
 }
 
-bool CStaticDataType::PrintXMLSchemaContents(CNcbiOstream& out, int indent) const
+bool CStaticDataType::PrintXMLSchemaContents(CNcbiOstream& out, int indent, const CDataMember* mem) const
 {
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+    return (mem && mem->GetComments().PrintSchemaComments(out,indent));
+#else
     return false;
+#endif
 }
 
 void CStaticDataType::PrintDTDElement(CNcbiOstream& out, bool contents_only) const
@@ -201,9 +205,15 @@ const char* CNullDataType::GetXMLContents(void) const
     return "EMPTY";
 }
 
-bool CNullDataType::PrintXMLSchemaContents(CNcbiOstream& out, int indent) const
+bool CNullDataType::PrintXMLSchemaContents(CNcbiOstream& out, int indent, const CDataMember* mem) const
 {
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+    if (!CStaticDataType::PrintXMLSchemaContents(out, indent, mem)) {
+        out << ">";
+    }
+#else
     out << ">";
+#endif
     PrintASNNewLine(out, indent) << "<xs:complexType/>";
     return true;
 }
@@ -266,14 +276,22 @@ string CBoolDataType::GetSchemaTypeString(void) const
     return kEmptyStr;
 }
 
-bool CBoolDataType::PrintXMLSchemaContents(CNcbiOstream& out, int indent) const
+bool CBoolDataType::PrintXMLSchemaContents(CNcbiOstream& out, int indent, const CDataMember* mem) const
 {
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+    bool tagclosed = CStaticDataType::PrintXMLSchemaContents(out, indent, mem);
+#else
+    bool tagclosed = false;
+#endif
+
     if (GetParentType() && 
         GetParentType()->GetDataMember() &&
         GetParentType()->GetDataMember()->Attlist()) {
-        return false;
+        return tagclosed;
+    }
+    if (!tagclosed) {
+        out << ">";
     }
-    out << ">";
     const CBoolDataValue *val = GetDataMember() ?
         dynamic_cast<const CBoolDataValue*>(GetDataMember()->GetDefault()) : 0;
 
@@ -629,9 +647,15 @@ const char* CBitStringDataType::GetXMLContents(void) const
     return DTDEntitiesEnabled() ? "%BITS;" : "#PCDATA";
 }
 
-bool CBitStringDataType::PrintXMLSchemaContents(CNcbiOstream& out, int indent) const
+bool CBitStringDataType::PrintXMLSchemaContents(CNcbiOstream& out, int indent, const CDataMember* mem) const
 {
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+    if (!CStaticDataType::PrintXMLSchemaContents(out, indent, mem)) {
+        out << ">";
+    }
+#else
     out << ">";
+#endif
     PrintASNNewLine(out,indent++) << "<xs:simpleType>";
     PrintASNNewLine(out,indent++) << "<xs:restriction base=\"xs:string\">";
     PrintASNNewLine(out,indent)   << "<xs:pattern value=\"([0-1])*\"/>";
diff --git a/c++/src/serial/datatool/statictype.hpp b/c++/src/serial/datatool/statictype.hpp
index 53e28f2..b12c2ce 100644
--- a/c++/src/serial/datatool/statictype.hpp
+++ b/c++/src/serial/datatool/statictype.hpp
@@ -1,7 +1,7 @@
 #ifndef STATICTYPE_HPP
 #define STATICTYPE_HPP
 
-/*  $Id: statictype.hpp 122761 2008-03-25 16:45:09Z gouriano $
+/*  $Id: statictype.hpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -50,7 +50,7 @@ public:
     //virtual string GetDefaultCType(void) const;
     virtual const char* GetDefaultCType(void) const = 0;
     virtual const char* GetXMLContents(void) const = 0;
-    virtual bool PrintXMLSchemaContents(CNcbiOstream& out, int indent) const;
+    virtual bool PrintXMLSchemaContents(CNcbiOstream& out, int indent, const CDataMember* mem) const;
 };
 
 class CNullDataType : public CStaticDataType {
@@ -65,7 +65,7 @@ public:
     virtual const char* GetASNKeyword(void) const;
     virtual const char* GetDEFKeyword(void) const;
     virtual const char* GetXMLContents(void) const;
-    virtual bool PrintXMLSchemaContents(CNcbiOstream& out, int indent) const;
+    virtual bool PrintXMLSchemaContents(CNcbiOstream& out, int indent, const CDataMember* mem) const;
 };
 
 class CBoolDataType : public CStaticDataType {
@@ -81,7 +81,7 @@ public:
     virtual const char* GetDEFKeyword(void) const;
     virtual const char* GetXMLContents(void) const;
     virtual string GetSchemaTypeString(void) const;
-    virtual bool PrintXMLSchemaContents(CNcbiOstream& out, int indent) const;
+    virtual bool PrintXMLSchemaContents(CNcbiOstream& out, int indent, const CDataMember* mem) const;
 
     void PrintDTDExtra(CNcbiOstream& out) const;
 };
@@ -156,7 +156,7 @@ public:
     virtual const char* GetASNKeyword(void) const;
     virtual const char* GetDEFKeyword(void) const;
     virtual const char* GetXMLContents(void) const;
-    virtual bool PrintXMLSchemaContents(CNcbiOstream& out, int indent) const;
+    virtual bool PrintXMLSchemaContents(CNcbiOstream& out, int indent, const CDataMember* mem) const;
 };
 
 class COctetStringDataType : public CBitStringDataType {
diff --git a/c++/src/serial/datatool/testdata/res/set.ent.3 b/c++/src/serial/datatool/testdata/res/set.ent.3
new file mode 100644
index 0000000..5f43c37
--- /dev/null
+++ b/c++/src/serial/datatool/testdata/res/set.ent.3
@@ -0,0 +1,482 @@
+Seq-entry ::= set {
+  class phy-set,
+  descr {
+    create-date std {
+      year 1998,
+      month 10,
+      day 30
+    },
+    pub {
+      pub {
+        article {
+          title {
+            name "Evolution of the Fucaceae (Phaeophyceae) Inferred
+ fromnrDNA-ITS"
+          },
+          authors {
+            names std {
+{
+name
+name {
+last "Serrao" ,
+first "Ester" ,
+initials "E.A." } } ,
+{
+name
+name {
+last "Alice" ,
+first "Lawrence" ,
+initials "L.A." } } ,
+{
+name
+name {
+last "Brawley" ,
+first "Susan" ,
+initials "S.H." } } },
+            affil std {
+              affil "University of Algarve",
+              div "Centro de Ciencias do Mar, U.C.T.R.A.",
+              city "Faro",
+              country "Portugal",
+              street "Campus de Gambelas",
+              postal-code "8000"
+            }
+          },
+          from journal {
+            title {
+              iso-jta "J. Phycol."
+            },
+            imp {
+              date std {
+                year 1999
+              },
+              prepub in-press
+            }
+          }
+        }
+      }
+    },
+    update-date std {
+      year 1999,
+      month 1,
+      day 20
+    }
+  },
+  seq-set {
+    seq {
+      id {
+        genbank {
+          name "AF102903",
+          accession "AF102903",
+          version 1
+        },
+        gi 4580781
+      },
+      descr {
+        create-date std {
+          year 1999,
+          month 4,
+          day 12
+        },
+        source {
+          org {
+            taxname "Fucus ceranoides",
+            db {
+              {
+                db "taxon",
+                tag id 87146
+              }
+            },
+            orgname {
+              name binomial {
+                genus "Fucus",
+                species "ceranoides"
+              },
+              lineage "Eukaryota; stramenopiles;
+ Phaeophyceae/Xanthophyceaegroup; Phaeophyceae; Fucales; Fucaceae; Fucus",
+              gcode 1,
+              mgcode 1,
+              div "PLN"
+            }
+          },
+          subtype {
+            {
+              subtype country,
+              name "Great Britain: Isle of Man"
+            }
+          }
+        },
+        molinfo {
+          biomol genomic,
+          completeness no-ends
+        },
+        title "Fucus ceranoides country Great Britain: Isle of Man
+ 18Sribosomal RNA gene, partial sequence; internal transcribed spacer 1,
+ 5.8Sribosomal RNA gene and internal transcribed spacer 2, complete sequence;
+ and26S ribosomal RNA gene, partial sequence.",
+        pub {
+          pub {
+            sub {
+              authors {
+                names std {
+{
+name
+name {
+last "Serrao" ,
+first "Ester" ,
+initials "E.A." } } ,
+{
+name
+name {
+last "Alice" ,
+first "Lawrence" ,
+initials "L.A." } } ,
+{
+name
+name {
+last "Brawley" ,
+first "Susan" ,
+initials "S.H." } } },
+                affil std {
+                  affil "University of Algarve",
+                  div "Centro de Ciencias do Mar, U.C.T.R.A.",
+                  city "Faro",
+                  country "Portugal",
+                  street "Campus de Gambelas",
+                  postal-code "8000"
+                }
+              },
+              date std {
+                year 1998,
+                month 10,
+                day 30
+              }
+            }
+          }
+        }
+      },
+      inst {
+        repr raw,
+        mol dna,
+        length 1012,
+        seq-data ncbi4na '8424411441821881221811112111182828828212844444282188
+424148288224244128888899111811889188828881848442514422411121244228848818881142
+412411811881888111228882428268424442144112244222422842881211124444824125111248
+488488888222884222424444412412895124411141818884882484228828818221881518441841
+188441251124244125148442822A24884144284244444584484831812281224222428422241118
+111422411221241112126228191482491828411821824411441144114411441342883622884884
+482828221623412221224224142188121818124811241281111128882142412441848288442822
+212812418411411242142411842418128288424128842141182214841182182111128884112421
+228842428822444111822284441421842884824414848284884124221182428141222288448282
+841824448484828442441281841484882244114248114224224148221224114818481141888481
+144222184241121821222422248241148414881484214488444824888124414482228888828228
+824141414414444482111188124482242224224812884241444244414118284822484828442488
+884214182184111441824182488888482444144281248222222442214241428882112121118421
+888118828122822418251421'H
+      },
+      annot {
+        {
+          data ftable {
+            {
+              data rna {
+                type rRNA,
+                ext name "18S ribosomal RNA"
+              },
+              partial TRUE,
+              location int {
+                from 0,
+                to 15,
+                id gi 4580781,
+                fuzz-from lim lt
+              }
+            },
+            {
+              data rna {
+                type rRNA,
+                ext name "5.8S ribosomal RNA"
+              },
+              location int {
+                from 493,
+                to 643,
+                id gi 4580781
+              }
+            },
+            {
+              data rna {
+                type rRNA,
+                ext name "26S ribosomal RNA"
+              },
+              partial TRUE,
+              location int {
+                from 997,
+                to 1011,
+                id gi 4580781,
+                fuzz-to lim gt
+              }
+            },
+            {
+              data rna {
+                type other,
+                ext name "internal transcribed spacer 1"
+              },
+              comment "ITS1",
+              location int {
+                from 16,
+                to 492,
+                strand plus,
+                id gi 4580781
+              }
+            },
+            {
+              data rna {
+                type other,
+                ext name "internal transcribed spacer 2"
+              },
+              comment "ITS2",
+              location int {
+                from 644,
+                to 996,
+                strand plus,
+                id gi 4580781
+              }
+            }
+          }
+        }
+      }
+    },
+    seq {
+      id {
+        genbank {
+          name "AF102904",
+          accession "AF102904",
+          version 1
+        },
+        gi 4580782
+      },
+      descr {
+        create-date std {
+          year 1999,
+          month 4,
+          day 12
+        },
+        source {
+          org {
+            taxname "Fucus spiralis",
+            db {
+              {
+                db "taxon",
+                tag id 87149
+              }
+            },
+            orgname {
+              name binomial {
+                genus "Fucus",
+                species "spiralis"
+              },
+              lineage "Eukaryota; stramenopiles;
+ Phaeophyceae/Xanthophyceaegroup; Phaeophyceae; Fucales; Fucaceae; Fucus",
+              gcode 1,
+              mgcode 1,
+              div "PLN"
+            }
+          },
+          subtype {
+            {
+              subtype country,
+              name "Spain: Canary Islands"
+            }
+          }
+        },
+        molinfo {
+          biomol genomic,
+          completeness no-ends
+        },
+        title "Fucus spiralis country Spain: Canary Islands 18S ribosomal
+ RNAgene, partial sequence; internal transcribed spacer 1, 5.8S ribosomal
+ RNAgene and internal transcribed spacer 2, complete sequence; and 26S
+ ribosomalRNA gene, partial sequence.",
+        pub {
+          pub {
+            sub {
+              authors {
+                names std {
+{
+name
+name {
+last "Serrao" ,
+first "Ester" ,
+initials "E.A." } } ,
+{
+name
+name {
+last "Alice" ,
+first "Lawrence" ,
+initials "L.A." } } ,
+{
+name
+name {
+last "Brawley" ,
+first "Susan" ,
+initials "S.H." } } },
+                affil std {
+                  affil "University of Algarve",
+                  div "Centro de Ciencias do Mar, U.C.T.R.A.",
+                  city "Faro",
+                  country "Portugal",
+                  street "Campus de Gambelas",
+                  postal-code "8000"
+                }
+              },
+              date std {
+                year 1998,
+                month 10,
+                day 30
+              }
+            }
+          }
+        }
+      },
+      inst {
+        repr raw,
+        mol dna,
+        length 1024,
+        seq-data ncbi4na '8882248144841122842441144182188122181111211118282882
+821284444428218842414828822424412888888811181188818882888184844241442241112124
+422884881888114241241181188188811122888242822842444214411224422242284288121112
+444482412411124848848888882288422242444441241288112441114181888488248422882881
+822188141844184118844124112424412414844282282488414428424444448448481181228122
+422242842224111811142241122124111212122111148241182841182182441144114411441142
+281422884884442828221422412224224142188121818124811241281111128882142412441848
+288442822212812418411411242142411184241812482884241288421411822148411821821111
+288849124212288424288224441118222844414218428848244148482848841242211824281412
+222284482828418244484848284424412818414848822441142481142242241482212241148184
+811418884811442221842411218212224222482411484148814842144884448248881244144822
+288888282288241414144144444821111881244822442212248128842414442444141182848224
+848284424888842141821841114418241824888884824441148281248422222442214241428882
+112121118421888118828122822418211421'H
+      },
+      annot {
+        {
+          data ftable {
+            {
+              data rna {
+                type rRNA,
+                ext name "18S ribosomal RNA"
+              },
+              partial TRUE,
+              location int {
+                from 0,
+                to 31,
+                id gi 4580782,
+                fuzz-from lim lt
+              }
+            },
+            {
+              data rna {
+                type rRNA,
+                ext name "5.8S ribosomal RNA"
+              },
+              location int {
+                from 502,
+                to 654,
+                id gi 4580782
+              }
+            },
+            {
+              data rna {
+                type rRNA,
+                ext name "26S ribosomal RNA"
+              },
+              partial TRUE,
+              location int {
+                from 1009,
+                to 1023,
+                id gi 4580782,
+                fuzz-to lim gt
+              }
+            },
+            {
+              data rna {
+                type other,
+                ext name "internal transcribed spacer 1"
+              },
+              comment "ITS1",
+              location int {
+                from 32,
+                to 501,
+                strand plus,
+                id gi 4580782
+              }
+            },
+            {
+              data rna {
+                type other,
+                ext name "internal transcribed spacer 2"
+              },
+              comment "ITS2",
+              location int {
+                from 655,
+                to 1008,
+                strand plus,
+                id gi 4580782
+              }
+            }
+          }
+        }
+      }
+    }
+  },
+  annot {
+    {
+      data align {
+        {
+          type partial,
+          dim 77,
+          segs denseg {
+            dim 77,
+            numseg 10,
+            ids {
+              gi 4580781
+            },
+            starts {
+              1,
+              3,
+              3,
+              1,
+              2,
+              4,
+              1,
+              1,
+              1,
+              20
+            },
+            lens {
+              1,
+              3,
+              3,
+              1,
+              2,
+              4,
+              1,
+              1,
+              1,
+              20
+            },
+            strands {
+              unknown,
+              unknown,
+              unknown,
+              unknown,
+              unknown,
+              unknown,
+              unknown,
+              unknown,
+              unknown,
+              unknown
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/c++/src/serial/datatool/traversal_spec_file_parser.cpp b/c++/src/serial/datatool/traversal_spec_file_parser.cpp
index ebc0d58..ecdb95b 100644
--- a/c++/src/serial/datatool/traversal_spec_file_parser.cpp
+++ b/c++/src/serial/datatool/traversal_spec_file_parser.cpp
@@ -1,4 +1,4 @@
-/*  $Id: traversal_spec_file_parser.cpp 354091 2012-02-23 12:02:31Z kornbluh $
+/*  $Id: traversal_spec_file_parser.cpp 485907 2015-11-30 14:26:20Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -199,17 +199,17 @@ CTraversalSpecFileParser::CDescFileNode::CDescFileNode(
     EWhen when ) 
     : m_Func(func), m_ConstantArgs(constant_args), m_ID(++ms_HighestID), m_When(when)
 {
-    NStr::Tokenize( pattern, ".", m_Pattern );
+    NStr::Split( pattern, ".", m_Pattern, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate );
 
     m_ExceptPatterns.resize( except_patterns.size() );
     int ii = 0;
     for( ; ii < (int)m_ExceptPatterns.size(); ++ii ) {
-        NStr::Tokenize( except_patterns[ii], ".", m_ExceptPatterns[ii] );
+        NStr::Split( except_patterns[ii], ".", m_ExceptPatterns[ii], NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate );
     }
 
     m_ArgPatterns.resize( arg_patterns.size() );
     for( ; ii < (int)m_ArgPatterns.size(); ++ii ) {
-        NStr::Tokenize( arg_patterns[ii], ".", m_ArgPatterns[ii] );
+        NStr::Split( arg_patterns[ii], ".", m_ArgPatterns[ii], NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate );
     }
 }
 
@@ -435,7 +435,7 @@ void CTraversalSpecFileParser::x_ParseOutputClassNameClause( CTokenizer &tokeniz
     string output_class_name_with_namespace;
     tokenizer.GetNextOrThrow( output_class_name_with_namespace );
 
-    NStr::Tokenize( output_class_name_with_namespace, "::", m_Namespace );
+    NStr::Split( output_class_name_with_namespace, "::", m_Namespace, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate );
 
     // last piece becomes class-name, though
     m_OutputClassName = m_Namespace.back();
@@ -642,7 +642,7 @@ void CTraversalSpecFileParser::x_ParseDeprecated( CTokenizer &tokenizer )
         }
 
         TPattern pattern;
-        NStr::Tokenize( pattern_str, ".", pattern );
+        NStr::Split( pattern_str, ".", pattern, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate );
 
         m_DeprecatedPatterns.push_back( pattern );
 
diff --git a/c++/src/serial/datatool/unitype.cpp b/c++/src/serial/datatool/unitype.cpp
index aa5d514..7bc6270 100644
--- a/c++/src/serial/datatool/unitype.cpp
+++ b/c++/src/serial/datatool/unitype.cpp
@@ -1,4 +1,4 @@
-/*  $Id: unitype.cpp 449690 2014-10-20 14:10:16Z gouriano $
+/*  $Id: unitype.cpp 485707 2015-11-25 13:58:19Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -134,7 +134,9 @@ void CUniSequenceDataType::PrintXMLSchema(CNcbiOstream& out,
         string type(typeStatic ? typeStatic->GetSchemaTypeString() : typeElem->GetSchemaTypeString());
         bool any = dynamic_cast<const CAnyContentDataType*>(typeStatic) != 0;
         PrintASNNewLine(out, indent++);
+        string xsdk("element");
         if (any) {
+            xsdk = "any";
             out << "<xs:any processContents=\"lax\"";
             const string& ns = GetNamespaceName();
             if (!ns.empty()) {
@@ -164,7 +166,13 @@ void CUniSequenceDataType::PrintXMLSchema(CNcbiOstream& out,
             }
         }
         if (hasAttlist) {
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+            if (!(GetDataMember() && GetDataMember()->GetComments().PrintSchemaComments(out, indent+1))) {
+                out << ">";
+            }
+#else
             out << ">";
+#endif
             PrintASNNewLine(out, indent++) << "<xs:complexType>";
             PrintASNNewLine(out, indent++) << "<xs:simpleContent>";
             PrintASNNewLine(out, indent++) << "<xs:extension base=\"" << type << "\">";
@@ -174,7 +182,15 @@ void CUniSequenceDataType::PrintXMLSchema(CNcbiOstream& out,
             PrintASNNewLine(out, --indent) << "</xs:complexType>";
             PrintASNNewLine(out, --indent) << "</xs:element>";
         } else {
+#if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
+            if (GetDataMember() && GetDataMember()->GetComments().PrintSchemaComments(out, indent)) {
+                PrintASNNewLine(out, --indent) << "</xs:" << xsdk << ">";
+            } else {
+                out << "/>";
+            }
+#else
             out << "/>";
+#endif
         }
     } else {
         bool asn_container = false;
diff --git a/c++/src/serial/datatool/xsdparser.cpp b/c++/src/serial/datatool/xsdparser.cpp
index 7d5d3c9..634aacf 100644
--- a/c++/src/serial/datatool/xsdparser.cpp
+++ b/c++/src/serial/datatool/xsdparser.cpp
@@ -1,4 +1,4 @@
-/*  $Id: xsdparser.cpp 470480 2015-06-16 15:07:01Z ivanov $
+/*  $Id: xsdparser.cpp 486439 2015-12-04 15:06:23Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -256,8 +256,10 @@ bool XSDParser::DefineElementType(DTDElement& node)
     if (IsValue("string") || IsValue("token") ||
         IsValue("normalizedString") ||
         IsValue("duration") || IsValue("language") ||
-        IsValue("anyType") || IsValue("anyURI") || IsValue("QName") ||
+        IsValue("anyType") || IsValue("anyURI") ||
+        IsValue("Name") ||IsValue("NCName") || IsValue("QName") ||
         IsValue("dateTime") || IsValue("time") || IsValue("date") ||
+        IsValue("gYearMonth") || IsValue("gYear") || IsValue("gMonthDay") || IsValue("gMonth") || IsValue("gDay") || 
         IsValue("anySimpleType")) {
         node.SetType(DTDElement::eString);
     } else if (IsValue("double") || IsValue("float") || IsValue("decimal")) {
@@ -572,6 +574,9 @@ string XSDParser::ParseElementContent(DTDElement* owner, int emb)
     tok = GetRawAttributeSet();
 
     if (GetAttribute("ref")) {
+        if (!owner) {
+            ParseError("ref attribute not allowed for root elements", "");
+        }
         if (IsValue("schema") &&
             GetElementNamespace(m_ValuePrefix) == eSchemaNamespace) {
             name = CreateTmpEmbeddedName(owner->GetName(), emb);
diff --git a/c++/src/serial/enumerated.cpp b/c++/src/serial/enumerated.cpp
index 557c798..b0fe8d8 100644
--- a/c++/src/serial/enumerated.cpp
+++ b/c++/src/serial/enumerated.cpp
@@ -1,4 +1,4 @@
-/*  $Id: enumerated.cpp 471532 2015-06-29 11:41:24Z ivanov $
+/*  $Id: enumerated.cpp 471296 2015-06-25 12:36:15Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/serial/member.cpp b/c++/src/serial/member.cpp
index 598aa99..8277d71 100644
--- a/c++/src/serial/member.cpp
+++ b/c++/src/serial/member.cpp
@@ -1,4 +1,4 @@
-/*  $Id: member.cpp 450827 2014-10-30 18:38:02Z grichenk $
+/*  $Id: member.cpp 478484 2015-09-09 17:35:39Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -966,9 +966,10 @@ void CMemberInfoFunctions::WriteWithDefaultMember(CObjectOStream& out,
     _ASSERT(memberInfo->GetDefault());
     TTypeInfo memberType = memberInfo->GetTypeInfo();
     TConstObjectPtr memberPtr = memberInfo->GetItemPtr(classPtr);
-    if ( memberType->Equals(memberPtr, memberInfo->GetDefault()) )
+    if (!out.IsWritingDefaultValuesEnforced() &&
+        memberType->Equals(memberPtr, memberInfo->GetDefault()) ) {
         return;
-
+    }
     out.WriteClassMember(memberInfo->GetId(), memberType, memberPtr);
 }
 
@@ -981,6 +982,9 @@ void CMemberInfoFunctions::WriteWithDefaultMemberX(
     TTypeInfo memberType = memberInfo->GetTypeInfo();
     TConstObjectPtr memberPtr = memberInfo->GetItemPtr(classPtr);
     CMemberInfo::ESetFlag flag = memberInfo->GetSetFlag(classPtr);
+    if (out.IsWritingDefaultValuesEnforced() &&  memberInfo->GetDefault()) {
+        goto do_write;
+    }
     if (flag == CMemberInfo::eSetNo) {
         if (memberInfo->Optional()) {
             return;
@@ -1004,6 +1008,7 @@ void CMemberInfoFunctions::WriteWithDefaultMemberX(
             return;
         }
     }
+do_write:
     out.WriteClassMember(memberInfo->GetId(), memberType, memberPtr);
 }
 
@@ -1013,6 +1018,9 @@ void CMemberInfoFunctions::WriteWithSetFlagMember(CObjectOStream& out,
 {
     _ASSERT(!memberInfo->CanBeDelayed());
     _ASSERT(memberInfo->HaveSetFlag());
+    if (out.IsWritingDefaultValuesEnforced() &&  memberInfo->GetDefault()) {
+        goto do_write;
+    }
     if ( memberInfo->GetSetFlagNo(classPtr) ) {
         if (memberInfo->Optional()) {
             return;
@@ -1064,6 +1072,7 @@ void CMemberInfoFunctions::WriteWithSetFlagMember(CObjectOStream& out,
         }
     }
 #endif
+do_write:
     out.WriteClassMember(memberInfo->GetId(),
                          memberInfo->GetTypeInfo(),
                          memberInfo->GetItemPtr(classPtr));
diff --git a/c++/src/serial/memberlist.cpp b/c++/src/serial/memberlist.cpp
index 6e96019..273ba43 100644
--- a/c++/src/serial/memberlist.cpp
+++ b/c++/src/serial/memberlist.cpp
@@ -1,4 +1,4 @@
-/*  $Id: memberlist.cpp 483285 2015-10-29 18:05:21Z ivanov $
+/*  $Id: memberlist.cpp 481847 2015-10-16 15:34:27Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/serial/objistrasn.cpp b/c++/src/serial/objistrasn.cpp
index b16fe6a..a6b0c4b 100644
--- a/c++/src/serial/objistrasn.cpp
+++ b/c++/src/serial/objistrasn.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objistrasn.cpp 483285 2015-10-29 18:05:21Z ivanov $
+/*  $Id: objistrasn.cpp 481847 2015-10-16 15:34:27Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -1598,4 +1598,10 @@ string CObjectIStreamAsn::ReadOtherPointer(void)
     return ReadTypeId(SkipWhiteSpace());
 }
 
+void CObjectIStreamAsn::StartDelayBuffer(void)
+{
+    SkipWhiteSpace();
+    CObjectIStream::StartDelayBuffer();
+}
+
 END_NCBI_SCOPE
diff --git a/c++/src/serial/objistrjson.cpp b/c++/src/serial/objistrjson.cpp
index f9dcb28..a732e43 100644
--- a/c++/src/serial/objistrjson.cpp
+++ b/c++/src/serial/objistrjson.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objistrjson.cpp 481917 2015-10-19 13:23:10Z ivanov $
+/*  $Id: objistrjson.cpp 480247 2015-09-29 14:08:47Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/serial/objostr.cpp b/c++/src/serial/objostr.cpp
index 1173c87..796664c 100644
--- a/c++/src/serial/objostr.cpp
+++ b/c++/src/serial/objostr.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objostr.cpp 463313 2015-03-26 17:05:21Z vasilche $
+/*  $Id: objostr.cpp 484578 2015-11-12 19:13:20Z vasilche $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -295,6 +295,7 @@ CObjectOStream::CObjectOStream(ESerialDataFormat format,
       m_ParseDelayBuffers(eDelayBufferPolicyNotSet),
       m_FastWriteDouble(s_FastWriteDouble->Get()),
       m_SpecialCaseWrite(eWriteAsNormal),
+      m_EnforceWritingDefaults(false),
       m_FixMethod(x_GetFixCharsMethodDefault()),
       m_VerifyData(x_GetVerifyDataDefault())
 {
@@ -655,6 +656,11 @@ bool CObjectOStream::Write(CByteSource& source)
     return true;
 }
 
+void CObjectOStream::Write(const char* data, size_t size)
+{
+    m_Output.Write(data, size);
+}
+
 void CObjectOStream::WriteFileHeader(TTypeInfo /*type*/)
 {
     // do nothing by default
diff --git a/c++/src/serial/objostrasn.cpp b/c++/src/serial/objostrasn.cpp
index 73312eb..3a5f880 100644
--- a/c++/src/serial/objostrasn.cpp
+++ b/c++/src/serial/objostrasn.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objostrasn.cpp 483285 2015-10-29 18:05:21Z ivanov $
+/*  $Id: objostrasn.cpp 481847 2015-10-16 15:34:27Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -174,7 +174,7 @@ void CObjectOStreamAsn::WriteUint8(Uint8 data)
 
 void CObjectOStreamAsn::WriteDouble2(double data, unsigned digits)
 {
-#if 1
+#if 0
     if (isnan(data)) {
         ThrowError(fInvalidData, "invalid double: not a number");
     }
diff --git a/c++/src/serial/objostrasnb.cpp b/c++/src/serial/objostrasnb.cpp
index 0698ade..9f2b720 100644
--- a/c++/src/serial/objostrasnb.cpp
+++ b/c++/src/serial/objostrasnb.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objostrasnb.cpp 463313 2015-03-26 17:05:21Z vasilche $
+/*  $Id: objostrasnb.cpp 472634 2015-07-13 14:50:50Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -705,7 +705,7 @@ void CObjectOStreamAsnBinary::WriteDouble2(double data, unsigned digits)
     Uint1 type = eDecimal;
     WriteSysTag(eReal);
 
-#if 1
+#if 0
     if (isnan(data)) {
         ThrowError(fInvalidData, "invalid double: not a number");
     }
@@ -713,9 +713,9 @@ void CObjectOStreamAsnBinary::WriteDouble2(double data, unsigned digits)
         ThrowError(fInvalidData, "invalid double: infinite");
     }
 #else
-// changed 21 Sep 2014
-// to enable later
-// also see below
+// CXX-5248
+// for backward compatibility, this stays disabled
+#if 0
     if (data == 0.) {
         double zero = 0.;
         if (memcmp(&data, &zero, sizeof(double)) == 0) {
@@ -723,7 +723,9 @@ void CObjectOStreamAsnBinary::WriteDouble2(double data, unsigned digits)
             return;
         }
         type = eNegativeZero;
-    } else if (isnan(data)) {
+    } else 
+#endif
+    if (isnan(data)) {
         type = eNotANumber;
     } else if (!finite(data)) {
         if (data > 0) {
@@ -758,15 +760,18 @@ void CObjectOStreamAsnBinary::WriteDouble2(double data, unsigned digits)
 
     WriteLength(width + 1);
     if (width) {
-// added 21 Sep 2014
-// to enable later
+// CXX-5248
+// for backward compatibility, this stays disabled
 #if 0
         type = eDecimal_NR1;
-        if (strchr(buffer,'.')) {
-            type = eDecimal_NR2;
-        }
-        if (strpbrk(buffer,"eE") != NULL) {
-            type = eDecimal_NR3;
+        for (const char* p = buffer + width - 1;  p >= buffer;  --p) {
+            if (*p == '.') {
+                type = eDecimal_NR2;
+                break;
+            } else if (*p == 'e'  ||  *p == 'E') {
+                type = eDecimal_NR3;
+                break;
+            }
         }
 #endif
         WriteByte(type);
diff --git a/c++/src/serial/objostrjson.cpp b/c++/src/serial/objostrjson.cpp
index 852a30b..2496dd3 100644
--- a/c++/src/serial/objostrjson.cpp
+++ b/c++/src/serial/objostrjson.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objostrjson.cpp 481916 2015-10-19 13:22:37Z ivanov $
+/*  $Id: objostrjson.cpp 483499 2015-11-02 13:37:41Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -74,6 +74,7 @@ CObjectOStreamJson::CObjectOStreamJson(CNcbiOstream& out, bool deleteOut)
     m_WrapAt(0)
 {
     m_WriteNamedIntegersByValue = true;
+    m_EnforceWritingDefaults = true;
 }
 
 CObjectOStreamJson::CObjectOStreamJson(CNcbiOstream& out, EOwnership deleteOut)
@@ -85,6 +86,7 @@ CObjectOStreamJson::CObjectOStreamJson(CNcbiOstream& out, EOwnership deleteOut)
     m_WrapAt(0)
 {
     m_WriteNamedIntegersByValue = true;
+    m_EnforceWritingDefaults = true;
 }
 
 CObjectOStreamJson::~CObjectOStreamJson(void)
diff --git a/c++/src/serial/objostrxml.cpp b/c++/src/serial/objostrxml.cpp
index 801ab68..3a3de22 100644
--- a/c++/src/serial/objostrxml.cpp
+++ b/c++/src/serial/objostrxml.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objostrxml.cpp 471531 2015-06-29 11:40:57Z ivanov $
+/*  $Id: objostrxml.cpp 471224 2015-06-24 17:35:04Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/serial/objstack.cpp b/c++/src/serial/objstack.cpp
index 7cd9264..bbaa149 100644
--- a/c++/src/serial/objstack.cpp
+++ b/c++/src/serial/objstack.cpp
@@ -1,4 +1,4 @@
-/*  $Id: objstack.cpp 483285 2015-10-29 18:05:21Z ivanov $
+/*  $Id: objstack.cpp 481847 2015-10-16 15:34:27Z gouriano $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/serial/pathhook.cpp b/c++/src/serial/pathhook.cpp
index 9c4c962..7f468f4 100644
--- a/c++/src/serial/pathhook.cpp
+++ b/c++/src/serial/pathhook.cpp
@@ -1,4 +1,4 @@
-/*  $Id: pathhook.cpp 483285 2015-10-29 18:05:21Z ivanov $
+/*  $Id: pathhook.cpp 481847 2015-10-16 15:34:27Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
diff --git a/c++/src/serial/rpcbase.cpp b/c++/src/serial/rpcbase.cpp
index 7e74bc1..194af4a 100644
--- a/c++/src/serial/rpcbase.cpp
+++ b/c++/src/serial/rpcbase.cpp
@@ -1,4 +1,4 @@
-/*  $Id: rpcbase.cpp 483519 2015-11-02 14:44:04Z ivanov $
+/*  $Id: rpcbase.cpp 499300 2016-04-25 15:23:35Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@
 #include <ncbi_pch.hpp>
 #include <corelib/ncbistr.hpp>
 #include <corelib/ncbi_cookies.hpp>
-#include <serial/rpcbase.hpp>
+#include <serial/rpcbase_impl.hpp>
 
 BEGIN_NCBI_SCOPE
 
@@ -64,7 +64,6 @@ CRPCClient_Base::CRPCClient_Base(const string&     service,
       m_RetryCount(0),
       m_RecursionCount(0),
       m_Service(service),
-      m_Timeout(kDefaultTimeout),
       m_RetryLimit(retry_limit)
 {
 }
@@ -73,9 +72,6 @@ CRPCClient_Base::CRPCClient_Base(const string&     service,
 CRPCClient_Base::~CRPCClient_Base(void)
 {
     Disconnect();
-    if ( !sx_IsSpecial(m_Timeout) ) {
-        delete const_cast<STimeout*>(m_Timeout);
-    }
 }
 
 
@@ -264,16 +260,18 @@ void CRPCClient_Base::x_Ask(const CSerialObject& request, CSerialObject& reply)
                     CTimeSpan(max_span).AsSmartString());
             }
         }
-        // Do not try to force reconnect in recursive calls.
-        if ( !(m_RetryCount & 1)  ||  m_RetryCtx.NeedReconnect() ) {
-            // reset on every other attempt in case we're out of sync
-            try {
-                Reset();
-            } STD_CATCH_ALL_XX(Serial_RPCClient, 1 ,"CRPCClient_Base::Reset()");
-        }
+        // Always reconnect on retry.
+        try {
+            Reset();
+        } STD_CATCH_ALL_XX(Serial_RPCClient, 1 ,"CRPCClient_Base::Reset()");
     }
     // Reset retry context when done.
     m_RetryCtx.Reset();
+    // If there were any retries, force disconnect to prevent using old
+    // retry url, args etc. with the next request.
+    if ( m_RetryCount > 0) {
+        Disconnect();
+    }
 }
 
 
@@ -300,32 +298,12 @@ CTimeSpan CRPCClient_Base::x_GetRetryDelay(double max_delay) const
 }
 
 
-EHTTP_HeaderParse
-CRPCClient_Base::sx_ParseHeader(const char* http_header,
-                                void*       user_data,
-                                int         server_error)
-{
-    if ( !user_data ) return eHTTP_HeaderContinue;
-    CHttpRetryContext* retry_ctx = reinterpret_cast<CHttpRetryContext*>(user_data);
-    _ASSERT(retry_ctx);
-    retry_ctx->ParseHeader(http_header);
-
-    // Always read response body - normal content or error.
-    return eHTTP_HeaderContinue;
-}
-
-
-bool CRPCClient_Base::sx_IsSpecial(const STimeout* timeout)
-{
-    return timeout == kDefaultTimeout  ||  timeout == kInfiniteTimeout;
-}
-
-
 const char* CRPCClientException::GetErrCodeString(void) const
 {
     switch (GetErrCode()) {
     case eRetry:  return "eRetry";
     case eFailed: return "eFailed";
+    case eArgs:   return "eArgs";
     case eOther:  return "eOther";
     default:      return CException::GetErrCodeString();
     }
diff --git a/c++/src/util/Makefile.util.lib b/c++/src/util/Makefile.util.lib
index 9709e9d..2cc98da 100644
--- a/c++/src/util/Makefile.util.lib
+++ b/c++/src/util/Makefile.util.lib
@@ -1,4 +1,4 @@
-# $Id: Makefile.util.lib 483516 2015-11-02 14:43:15Z ivanov $
+# $Id: Makefile.util.lib 486585 2015-12-07 18:41:13Z gouriano $
 
 SRC = random_gen utf8 checksum bytesrc strbuffer itree smalldns \
       thread_pool_old ddump_viewer strsearch logrotate \
@@ -7,7 +7,7 @@ SRC = random_gen utf8 checksum bytesrc strbuffer itree smalldns \
       transmissionrw miscmath mutex_pool ncbi_cache line_reader \
       util_exception uttp multi_writer itransaction thread_pool \
       thread_pool_ctrl scheduler distribution rangelist util_misc \
-      histogram_binning table_printer retry_ctx
+      histogram_binning table_printer retry_ctx stream_source file_manifest
 
 LIB = xutil
 PROJ_TAG = core
diff --git a/c++/src/util/checksum.cpp b/c++/src/util/checksum.cpp
index 29554e4..1938e2b 100644
--- a/c++/src/util/checksum.cpp
+++ b/c++/src/util/checksum.cpp
@@ -1,4 +1,4 @@
-/*  $Id: checksum.cpp 462148 2015-03-16 19:31:40Z vasilche $
+/*  $Id: checksum.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -207,7 +207,7 @@ Uint4 CChecksum::GetChecksum(void) const
         char extra_bytes[8];
         size_t extra_len = 0;
         for ( size_t len = m_CharCount; len; len >>= 8 ) {
-            extra_bytes[extra_len++] = len & 0xff;
+            extra_bytes[extra_len++] = char(len & 0xff);
         }
         CChecksum extra(*this);
         extra.AddChars(extra_bytes, extra_len);
diff --git a/c++/src/util/compress/api/archive.cpp b/c++/src/util/compress/api/archive.cpp
index 811300e..241215b 100644
--- a/c++/src/util/compress/api/archive.cpp
+++ b/c++/src/util/compress/api/archive.cpp
@@ -1,4 +1,4 @@
-/* $Id: archive.cpp 430126 2014-03-24 12:25:47Z ivanov $
+/* $Id: archive.cpp 484782 2015-11-16 13:40:06Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -615,7 +615,7 @@ auto_ptr<CArchive::TEntries> CArchive::x_ReadAndProcess(EAction action)
         if ( match  &&  m_MaskPattern.mask ) {
             match = false;
             list<CTempString> elems;
-            NStr::Split(path, "/", elems);
+            NStr::Split(path, "/", elems, NStr::fSplit_MergeDelimiters);
             ITERATE(list<CTempString>, it, elems) {
                 if (m_MaskPattern.mask->Match(*it, m_MaskPattern.acase)) {
                     match = true;
@@ -916,7 +916,7 @@ auto_ptr<CArchive::TEntries> CArchive::x_Append(const string&   src_path,
     }
     if ( match  &&  m_MaskPattern.mask ) {
         list<CTempString> elems;
-        NStr::Split(temp, "/", elems);
+        NStr::Split(temp, "/", elems, NStr::fSplit_MergeDelimiters);
         ITERATE(list<CTempString>, it, elems) {
             if (*it == "..") {
                 ARCHIVE_THROW(eBadName, "Name '" + temp + "' embeds parent directory ('..')");
diff --git a/c++/src/util/compress/api/compress.cpp b/c++/src/util/compress/api/compress.cpp
index a0a1973..645425a 100644
--- a/c++/src/util/compress/api/compress.cpp
+++ b/c++/src/util/compress/api/compress.cpp
@@ -1,4 +1,4 @@
-/*  $Id: compress.cpp 355801 2012-03-08 16:20:00Z ivanovp $
+/*  $Id: compress.cpp 489141 2016-01-08 18:55:07Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -258,10 +258,7 @@ Uint2 CCompressionUtil::GetUI2(const void* buffer)
         NCBI_THROW(CCoreException, eInvalidArg, "Incorrect buffer pointer");
     }
     const unsigned char* buf = (const unsigned char*)buffer;
-    Uint2 value = buf[1];
-    value <<= 8;
-    value += buf[0];
-    return value;
+    return Uint2(((Uint2)(buf[1]) << 8) + buf[0]);
 }
 
 
diff --git a/c++/src/util/compress/api/streambuf.cpp b/c++/src/util/compress/api/streambuf.cpp
index 2053c81..d94a416 100644
--- a/c++/src/util/compress/api/streambuf.cpp
+++ b/c++/src/util/compress/api/streambuf.cpp
@@ -1,4 +1,4 @@
-/* $Id: streambuf.cpp 430126 2014-03-24 12:25:47Z ivanov $
+/* $Id: streambuf.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -328,7 +328,7 @@ CT_INT_TYPE CCompressionStreambuf::overflow(CT_INT_TYPE c)
         // (this function is called when pptr() == eptr() but we
         // have reserved one byte more in the constructor, thus
         // *epptr() and now *pptr() point to valid positions)
-        *pptr() = c;
+        *pptr() = (CT_CHAR_TYPE)c;
         // Increment put pointer
         pbump(1);
     }
diff --git a/c++/src/util/compress/api/tar.cpp b/c++/src/util/compress/api/tar.cpp
index 385adfe..3e5dfa0 100644
--- a/c++/src/util/compress/api/tar.cpp
+++ b/c++/src/util/compress/api/tar.cpp
@@ -1,4 +1,4 @@
-/* $Id: tar.cpp 463379 2015-03-26 21:18:59Z lavr $
+/* $Id: tar.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -96,7 +96,7 @@ static bool s_NumToOctal(Uint8 val, char* ptr, size_t len)
 {
     _ASSERT(len > 0);
     do {
-        ptr[--len] = '0' + char(val & 7);
+        ptr[--len] = char('0' + char(val & 7));
         val >>= 3;
     } while (len);
     return val ? false : true;
@@ -2933,7 +2933,8 @@ auto_ptr<CTar::TEntries> CTar::x_ReadAndProcess(EAction action)
         if (match  &&  m_Mask[eExcludeMask].mask  &&  action != eTest) {
             list<CTempString> elems;
             _ASSERT(!m_Current.GetName().empty());
-            NStr::Split(m_Current.GetName(), "/", elems);
+            NStr::Split(m_Current.GetName(), "/", elems,
+                        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
             match = !s_MatchPattern(elems,
                                     m_Mask[eExcludeMask].mask,
                                     m_Mask[eExcludeMask].acase);
@@ -3573,7 +3574,8 @@ auto_ptr<CTar::TEntries> CTar::x_Append(const string&   name,
     }
 
     list<CTempString> elems;
-    NStr::Split(temp, "/", elems);
+    NStr::Split(temp, "/", elems,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     if (find(elems.begin(), elems.end(), "..") != elems.end()) {
         TAR_THROW(this, eBadName,
                   "Name '" + temp + "' embeds parent directory ('..')");
@@ -3757,7 +3759,8 @@ auto_ptr<CTar::TEntries> CTar::x_Append(const CTarUserEntryInfo& entry,
     }
 
     list<CTempString> elems;
-    NStr::Split(temp, "/", elems);
+    NStr::Split(temp, "/", elems,
+                NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     if (find(elems.begin(), elems.end(), "..") != elems.end()) {
         TAR_THROW(this, eBadName,
                   "Name '" + temp + "' embeds parent directory ('..')");
diff --git a/c++/src/util/compress/api/zlib.cpp b/c++/src/util/compress/api/zlib.cpp
index 4bc0185..17588b2 100644
--- a/c++/src/util/compress/api/zlib.cpp
+++ b/c++/src/util/compress/api/zlib.cpp
@@ -1,4 +1,4 @@
-/*  $Id: zlib.cpp 460187 2015-02-25 16:32:09Z ivanov $
+/*  $Id: zlib.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -110,7 +110,7 @@ CZipCompression::~CZipCompression()
 
 
 // gzip magic header
-const int gz_magic[2] = {0x1f, 0x8b};
+const unsigned char gz_magic[2] = {0x1f, 0x8b};
 
 // gzip flag byte
 #define ASCII_FLAG   0x01 // bit 0 set: file probably ascii text
diff --git a/c++/src/util/creaders/alnread.c b/c++/src/util/creaders/alnread.c
index 682b26e..e46153c 100644
--- a/c++/src/util/creaders/alnread.c
+++ b/c++/src/util/creaders/alnread.c
@@ -1,5 +1,5 @@
 /*
- * $Id: alnread.c 463944 2015-04-02 14:59:37Z bollin $
+ * $Id: alnread.c 489147 2016-01-08 19:29:35Z ivanov $
  *
  * ===========================================================================
  *
@@ -39,8 +39,9 @@
 #define strdup _strdup
 #endif
 
-static const int kMaxPrintedIntLen = 10;
-#define MAX_PRINTED_INT_LEN_PLUS_ONE 11
+static const size_t kMaxPrintedIntLen = 10;
+#define             kMaxPrintedIntLenPlusOne 11
+
 
 /*  ---------------------------------------------------------------------- */
 typedef enum {
@@ -247,7 +248,7 @@ s_ReportBadCharError
     eip->category = eAlnErr_BadData;
     if (id != NULL) eip->id = strdup (id);
     eip->line_num = line_number;
-    eip->message = (char *) malloc (strlen (err_format) + 2 * kMaxPrintedIntLen
+    eip->message = (char*) malloc (strlen (err_format) + 2 * kMaxPrintedIntLen
                                     + strlen (reason) + 3);
     if (eip->message != NULL)
     {
@@ -325,7 +326,7 @@ s_ReportLineLengthError
     TErrorInfoPtr eip;
     char *        msg;
     const char *  format = "Expected line length %d, actual length %d";
-    int           len;
+    size_t        len;
 
     if (lip == NULL  ||  report_error == NULL) {
         return;
@@ -336,19 +337,19 @@ s_ReportLineLengthError
         return;
     }
     eip->category = eAlnErr_BadFormat;
-    eip->id = strdup (id);
+    eip->id = strdup(id);
     eip->line_num = lip->line_num;
-    msg = (char *) malloc (strlen (format) + kMaxPrintedIntLen + 1);
+    msg = (char*)malloc(strlen(format) + kMaxPrintedIntLen + 1);
     if (msg != NULL) {
         if (lip->data == NULL) {
             len = 0;
         } else {
-            len = strlen (lip->data);
+            len = strlen(lip->data);
         }
-        sprintf (msg, format, expected_length, len);
+        sprintf(msg, format, expected_length, len);
         eip->message = msg;
     }
-    report_error (eip, report_error_userdata);
+    report_error(eip, report_error_userdata);
 }
 
 
@@ -378,7 +379,7 @@ s_ReportBlockLengthError
     eip->category = eAlnErr_BadFormat;
     eip->id = strdup (id);
     eip->line_num = line_num;
-    eip->message = (char *)malloc (strlen (err_format) + 2 * kMaxPrintedIntLen + 1);
+    eip->message = (char*)malloc(strlen(err_format) + 2 * kMaxPrintedIntLen + 1);
     if (eip->message != NULL) {
       sprintf (eip->message, err_format, expected_num, actual_num);
     }
@@ -493,8 +494,7 @@ s_ReportIncorrectNumberOfSequences
         return;
     }
     eip->category = eAlnErr_BadFormat;
-    eip->message = (char *) malloc (strlen (err_format) +
-                                    2 * kMaxPrintedIntLen + 1);
+    eip->message = (char*)malloc(strlen(err_format) + 2 * kMaxPrintedIntLen + 1);
                                      
     if (eip->message != NULL)
     {
@@ -523,10 +523,8 @@ s_ReportIncorrectSequenceLength
     }
 
     eip->category = eAlnErr_BadFormat;
-    eip->message = (char *)malloc (strlen (err_format)
-                                   + 2 * kMaxPrintedIntLen + 1);
-    if (eip->message != NULL)
-    {
+    eip->message = (char*)malloc(strlen(err_format) + 2 * kMaxPrintedIntLen + 1);
+    if (eip->message != NULL) {
       sprintf (eip->message, err_format, len_expected, len_found);
     }
     report_error (eip, report_error_userdata);
@@ -560,8 +558,8 @@ s_ReportRepeatedOrganismName
     if (id != NULL ) {
         eip->id = strdup (id);
     }
-    eip->message = (char *)malloc (strlen (err_format) + strlen (org_name)
-                           + kMaxPrintedIntLen + 1);
+    eip->message = (char*)malloc(strlen(err_format) + strlen(org_name)
+                                 + kMaxPrintedIntLen + 1);
     if (eip->message != NULL) {
         sprintf (eip->message, err_format, org_name, second_line_num);
     }
@@ -611,31 +609,31 @@ s_ReportRepeatedId
         return;
     }
 
-    eip = ErrorInfoNew (NULL);
+    eip = ErrorInfoNew(NULL);
     if (eip == NULL) {
         return;
     }
 
     eip->category = eAlnErr_BadData;
-    eip->id = strdup (scp->string);
+    eip->id = strdup(scp->string);
     if (scp->line_numbers != NULL) {
         eip->line_num = scp->line_numbers->ival;
     }
-    eip->message = (char *) malloc ( strlen (err_format)
-                                    + strlen (scp->string)
-                                    + scp->num_appearances * 15
-                                    + 1);
+    eip->message = (char*)malloc(strlen(err_format)
+                                 + strlen(scp->string)
+                                 + (size_t)scp->num_appearances * 15
+                                 + 1);
     if (eip->message != NULL) {
-        sprintf (eip->message, err_format, scp->string);
+        sprintf(eip->message, err_format, scp->string);
         cp = eip->message + strlen (eip->message);
         for (line_number = scp->line_numbers;
              line_number != NULL;
              line_number = line_number->next) {
-            sprintf (cp, " %d", line_number->ival);
+            sprintf(cp, " %d", line_number->ival);
             cp += strlen (cp);
         }
     }
-    report_error (eip, report_error_userdata);
+    report_error(eip, report_error_userdata);
 }
 
 
@@ -680,8 +678,8 @@ s_ReportSegmentedAlignmentError
     const char * msg = "This file contains sequences in brackets (indicating "
         "a segmented alignment) as well as sequences not in brackets at lines "
         "%s.  Please either add or remove brackets to correct this problem.";
-    int num_lines = 0;
-    int         msg_len = 0;
+    size_t      num_lines = 0;
+    size_t      msg_len = 0;
     TIntLinkPtr t;
     char *      line_text_list;
     char *      line_text_list_offset;
@@ -689,21 +687,19 @@ s_ReportSegmentedAlignmentError
     if (errfunc == NULL || offset_list == NULL) {
         return;
     }
-
-    for (t = offset_list; t != NULL; t = t->next)
-    {
-        num_lines ++;
+    for (t = offset_list; t != NULL; t = t->next) {
+        ++num_lines;
     }
     msg_len = num_lines * (kMaxPrintedIntLen + 2);
-    if (num_lines > 1) 
-    {
+    if (num_lines > 1) {
     	msg_len += 4;
     }
-    line_text_list = (char *) malloc (msg_len);
+    
+    line_text_list = (char*)malloc(msg_len);
     if (line_text_list == NULL) return;
     line_text_list_offset = line_text_list;
-    for (t = offset_list; t != NULL; t = t->next)
-    {
+
+    for (t = offset_list; t != NULL; t = t->next) {
         if (t->next == NULL)
         {
             sprintf (line_text_list_offset, "%d", t->ival);
@@ -723,18 +719,18 @@ s_ReportSegmentedAlignmentError
         line_text_list_offset += strlen (line_text_list_offset);
     }
 
-    msg_len += strlen (msg) + 1;
+    msg_len += strlen(msg) + 1;
 
     eip = ErrorInfoNew (NULL);
     if (eip != NULL) {
         eip->category = eAlnErr_BadData;
         eip->message = (char *) malloc (msg_len);
         if (eip->message != NULL) {
-            sprintf (eip->message, msg, line_text_list);
+            sprintf(eip->message, msg, line_text_list);
         }
-        errfunc (eip, errdata);
+        errfunc(eip, errdata);
     }
-    free (line_text_list);
+    free(line_text_list);
 }
 
 
@@ -788,7 +784,7 @@ static void s_ReportBadNumSegError
     if (eip != NULL) {
         eip->line_num = line_num;
         eip->category = eAlnErr_BadData;
-        eip->message = (char *) malloc (strlen (msg) + 2 * kMaxPrintedIntLen + 1);
+        eip->message = (char*) malloc(strlen(msg) + 2 * kMaxPrintedIntLen + 1);
         if (eip->message != NULL) {
             sprintf (eip->message, msg, num_seg, num_seg_exp);
         }
@@ -862,14 +858,12 @@ s_ReportUnusedLine
         eip->category = eAlnErr_BadFormat;
         eip->line_num = line_num_start;
         if (line_num_start == line_num_stop) {
-              eip->message = (char *) malloc (strlen (errformat1)
-                                            + kMaxPrintedIntLen + 1);
+              eip->message = (char*)malloc(strlen(errformat1) + kMaxPrintedIntLen + 1);
             if (eip->message != NULL) {
                 sprintf (eip->message, errformat1, line_num_start);
             }
         } else {
-            eip->message = (char *) malloc (strlen (errformat2)
-                                            + 2 * kMaxPrintedIntLen + 1);
+            eip->message = (char*)malloc(strlen(errformat2) + 2*kMaxPrintedIntLen + 1);
             if (eip->message != NULL) {
                 sprintf (eip->message, errformat2, line_num_start,
                          line_num_stop);
@@ -1417,11 +1411,11 @@ static void s_BracketedCommentListAddLine
 		return;
 	}
 
-    comment->comment_lines = s_AddLineInfo (comment->comment_lines, string, line_num, line_offset);
+    comment->comment_lines = s_AddLineInfo(comment->comment_lines, string, line_num, line_offset);
 }
 
 /* This function counts the sequences found in a bracketed comment. */
-static int s_CountSequencesInBracketedComment (TBracketedCommentListPtr comment)
+static int s_CountSequencesInBracketedComment(TBracketedCommentListPtr comment)
 {
     TLineInfoPtr lip;
     int          num_segments = 0;
@@ -1433,7 +1427,7 @@ static int s_CountSequencesInBracketedComment (TBracketedCommentListPtr comment)
 	
 	lip = comment->comment_lines;
 	/* First line must be left bracket on a line by itself */
-	if (lip->data[0] != '[' || strspn (lip->data + 1, " \t\r\n") != strlen (lip->data + 1))
+	if (lip->data[0] != '[' || strspn(lip->data + 1, " \t\r\n") != strlen (lip->data + 1))
 	{
 		return 0;
 	}
@@ -1448,7 +1442,7 @@ static int s_CountSequencesInBracketedComment (TBracketedCommentListPtr comment)
 			}
 			else
 			{
-				num_segments ++;
+				++num_segments;
 				skipped_line_since_last_defline = eFalse;
 			}
 		}
@@ -1495,7 +1489,7 @@ static int s_GetNumSegmentsInAlignment
 	
 	for (comment = comment_list; comment != NULL; comment = comment->next)
 	{
-	    num_segments_this_bracket = s_CountSequencesInBracketedComment (comment);
+	    num_segments_this_bracket = s_CountSequencesInBracketedComment(comment);
         segcount_list = s_AddSizeInfoAppearances (segcount_list,
                                                   num_segments_this_bracket,
                                                   1);
@@ -1536,7 +1530,7 @@ static TIntLinkPtr GetSegmentOffsetList (TBracketedCommentListPtr comment_list)
     
     for (comment = comment_list; comment != NULL; comment = comment->next)
     {
-    	if (s_CountSequencesInBracketedComment (comment) == 0) 
+    	if (s_CountSequencesInBracketedComment(comment) == 0) 
     	{
     		continue;
     	}
@@ -1554,8 +1548,8 @@ static TIntLinkPtr GetSegmentOffsetList (TBracketedCommentListPtr comment_list)
 
 static char * s_TokenizeString (char * str, const char *delimiter, char **last)
 {
-    int skip;
-    int length;
+    size_t skip;
+    size_t length;
 
     if (str == NULL) {
         str = *last;
@@ -1596,8 +1590,8 @@ static TLineInfoPtr s_BuildTokenList (TLineInfoPtr line_list)
     first_token = NULL;
 
     for (lip = line_list;  lip != NULL;  lip = lip->next) {
-        if (lip->data != NULL  &&  (tmp = strdup (lip->data)) != NULL) {
-            piece = s_TokenizeString (tmp, " \t\r", &last);
+        if (lip->data != NULL  &&  (tmp = strdup(lip->data)) != NULL) {
+            piece = s_TokenizeString(tmp, " \t\r", &last);
             while (piece != NULL) {
                 line_pos = piece - tmp;
                 line_pos += lip->line_offset;
@@ -2167,7 +2161,7 @@ s_GetOneNexusSizeComment
  const char * valname, 
  int        * val)
 {
-    char   buf[MAX_PRINTED_INT_LEN_PLUS_ONE];
+    char   buf[kMaxPrintedIntLenPlusOne];
     char * cpstart;
     char * cpend;
     int    maxlen;
@@ -2200,7 +2194,8 @@ s_GetOneNexusSizeComment
         cpend ++;
     }
     maxlen = cpend - cpstart;
-    if (maxlen > kMaxPrintedIntLen) maxlen = kMaxPrintedIntLen;
+    if (maxlen > kMaxPrintedIntLen) 
+        maxlen = kMaxPrintedIntLen;
 
     strncpy (buf, cpstart, maxlen);
     buf [maxlen] = 0;
@@ -2621,6 +2616,7 @@ static TCommentLocPtr s_FindComment (char * string)
 static void s_RemoveCommentFromLine (char * linestring)
 {
     TCommentLocPtr clp;
+    size_t offset;
 
     if (linestring == NULL) {
         return;
@@ -2637,8 +2633,14 @@ static void s_RemoveCommentFromLine (char * linestring)
      * line, get rid of the arrow character as well so it doesn't end up 
      * in the sequence data
      */
-    if ( linestring [0] == '>'  &&  linestring [1] == 0) {
-        linestring [0] = 0;
+    if ( linestring [0] == '>') {
+        offset = 1;
+        while (isspace(linestring[offset])) {
+            offset++;
+        }
+        if (linestring[offset] == 0) {
+            linestring[0] = 0;
+        }
     }
 
     /* if the line now contains only space, truncate it */
@@ -5983,7 +5985,7 @@ s_ConvertDataToOutput
                     s_LineInfoMergeAndStripSpaces (arsp->sequence_data);
 
         if (afp->sequences [index] != NULL) {
-            lengths [curr_seg] = s_AddSizeInfo (lengths [curr_seg], strlen (afp->sequences [index]));
+            lengths [curr_seg] = s_AddSizeInfo(lengths[curr_seg], strlen (afp->sequences[index]));
         }
         afp->ids [index] = strdup (arsp->id);
         curr_seg ++;
diff --git a/c++/src/util/ddump_viewer.cpp b/c++/src/util/ddump_viewer.cpp
index 4aec8f1..7d0774a 100644
--- a/c++/src/util/ddump_viewer.cpp
+++ b/c++/src/util/ddump_viewer.cpp
@@ -1,4 +1,4 @@
-/*  $Id: ddump_viewer.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/*  $Id: ddump_viewer.cpp 485909 2015-11-30 14:28:28Z gouriano $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -115,12 +115,12 @@ bool CDebugDumpViewer::x_CheckLocation(const char* file, int line)
     // otherwise - look for this particular line
     // location range must be in the form "10,20-30,150-200"
     list<string> loc;
-    NStr::Split( value,",",loc);
+    NStr::Split( value,",",loc, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
     list<string>::iterator it_loc;
     for (it_loc = loc.begin(); it_loc != loc.end(); ++it_loc) {
         list<string> range;
         list<string>::iterator it_range;
-        NStr::Split( *it_loc,"-",range);
+        NStr::Split( *it_loc,"-",range, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         int from=0, to;
         try {
             it_range = range.begin();
@@ -175,7 +175,7 @@ void CDebugDumpViewer::Bpt(
 
     while (x_GetInput(input)) {
         cmnd.clear();
-        NStr::Split( input, " ", cmnd);
+        NStr::Split( input, " ", cmnd, NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         narg = cmnd.size();
         need_info = true;
 
diff --git a/c++/src/util/dictionary_util.cpp b/c++/src/util/dictionary_util.cpp
index 57353ac..8c16729 100644
--- a/c++/src/util/dictionary_util.cpp
+++ b/c++/src/util/dictionary_util.cpp
@@ -1,4 +1,4 @@
-/*  $Id: dictionary_util.cpp 464904 2015-04-15 14:26:24Z kotliaro $
+/*  $Id: dictionary_util.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -47,6 +47,7 @@ static const size_t kMaxMetaphoneStack = 10;
 void CDictionaryUtil::GetMetaphone(const string& in, string* out,
                                    size_t max_chars)
 {
+    _ASSERT(out);
     out->erase();
     if (in.empty()) {
         return;
@@ -89,7 +90,7 @@ void CDictionaryUtil::GetMetaphone(const string& in, string* out,
         case 'l':
         case 'n':
         case 'r':
-            *out += tolower((unsigned char)(*iter));
+            *out += (char)tolower((unsigned char)(*iter));
             break;
 
         case 'c':
@@ -196,11 +197,11 @@ void CDictionaryUtil::GetMetaphone(const string& in, string* out,
             if (remaining  &&  prev_len  &&
                 vowels.find(*(iter + 1)) != string::npos  &&
                 CTempString("cgpst").find(*(iter - 1)) == string::npos) {
-                *out += tolower((unsigned char)(*iter));
+                *out += (char)tolower((unsigned char)(*iter));
                 ++iter;
             }
             else if ( !prev_len ) {
-                *out += tolower((unsigned char)(*iter));
+                *out += (char)tolower((unsigned char)(*iter));
             }
             break;
 
@@ -211,7 +212,7 @@ void CDictionaryUtil::GetMetaphone(const string& in, string* out,
                 *out += 'n';
                 break;
             }
-            *out += tolower((unsigned char)(*iter));
+            *out += (char)tolower((unsigned char)(*iter));
             break;
 
         case 'p':
@@ -224,7 +225,7 @@ void CDictionaryUtil::GetMetaphone(const string& in, string* out,
                 *out += 'f';
                 break;
             }
-            *out += tolower((unsigned char)(*iter));
+            *out += (char)tolower((unsigned char)(*iter));
             break;
 
         case 'q':
@@ -269,7 +270,7 @@ void CDictionaryUtil::GetMetaphone(const string& in, string* out,
                 ++iter;
                 break;
             }
-            *out += tolower((unsigned char)(*iter));
+            *out += (char)tolower((unsigned char)(*iter));
             break;
 
         case 'v':
@@ -284,7 +285,7 @@ void CDictionaryUtil::GetMetaphone(const string& in, string* out,
                     ++iter;
                     break;
                 }
-                *out += tolower((unsigned char)(*iter));
+                *out += (char)tolower((unsigned char)(*iter));
                 break;
             }
 
@@ -293,7 +294,7 @@ void CDictionaryUtil::GetMetaphone(const string& in, string* out,
                  *(iter - 1) == 'i'  ||
                  *(iter - 1) == 'o'  ||
                  *(iter - 1) == 'u') {
-                *out += tolower((unsigned char)(*iter));
+                *out += (char)tolower((unsigned char)(*iter));
             }
             break;
 
@@ -310,7 +311,7 @@ void CDictionaryUtil::GetMetaphone(const string& in, string* out,
                   *(iter + 1) == 'u')) {
                 break;
             }
-            *out += tolower((unsigned char)(*iter));
+            *out += (char)tolower((unsigned char)(*iter));
             break;
 
         case 'z':
@@ -374,7 +375,7 @@ void CDictionaryUtil::GetSoundex(const string& in, string* out,
 
     // preserve the first character, in upper case
     string::const_iterator iter = in.begin();
-    *out += toupper((unsigned char)(*iter));
+    *out += (char)toupper((unsigned char)(*iter));
 
     // now, iterate substituting codes, using no more than four characters
     // total
@@ -415,8 +416,8 @@ size_t CDictionaryUtil::GetEditDistance(const string& str1,
             string::const_iterator iter1 = pstr1->begin();
             string::const_iterator iter2 = pstr2->begin();
             for ( ;  iter1 != pstr1->end()  &&  iter2 != pstr2->end();  ) {
-                char c1_0 = tolower((unsigned char)(*iter1));
-                char c2_0 = tolower((unsigned char)(*iter2));
+                char c1_0 = (char)tolower((unsigned char)(*iter1));
+                char c2_0 = (char)tolower((unsigned char)(*iter2));
                 if (c1_0 == c2_0) {
                     /// identity: easy out
                     ++iter1;
@@ -440,8 +441,8 @@ size_t CDictionaryUtil::GetEditDistance(const string& str1,
                     char corner2 = *(iter2 + radius);
                     bool match = false;
                     for (int i = radius;  i >= 0;  --i) {
-                        c1_0 = tolower((unsigned char)(*(iter1 + i)));
-                        c2_0 = tolower((unsigned char)(*(iter2 + i)));
+                        c1_0 = (char)tolower((unsigned char)(*(iter1 + i)));
+                        c2_0 = (char)tolower((unsigned char)(*(iter2 + i)));
                         if (c1_0 == corner2) {
                             match = true;
                             cost = radius;
diff --git a/c++/src/util/file_manifest.cpp b/c++/src/util/file_manifest.cpp
new file mode 100644
index 0000000..5438158
--- /dev/null
+++ b/c++/src/util/file_manifest.cpp
@@ -0,0 +1,165 @@
+/*  $Id: file_manifest.cpp 494188 2016-03-04 12:23:34Z ivanov $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors:  Cheinan Marks
+ *
+ * File Description:
+ *   C++ class to handle GPipe manifest files.  These are action node
+ *   newline-separated, one column file path manifests.  Do not confuse
+ *   this manifest with the queue XML manifest in gpipe/objects/manifest.
+ */
+
+#include <ncbi_pch.hpp>
+
+#include <corelib/ncbiargs.hpp>
+#include <corelib/ncbistre.hpp>
+#include <corelib/ncbifile.hpp>
+#include <util/file_manifest.hpp>
+#include <fstream>
+#include <algorithm>
+
+
+BEGIN_NCBI_SCOPE
+
+
+CFileManifest::CFileManifest( const string & manifest_path ) 
+    : m_ManifestPath( manifest_path )
+{
+    x_Init();
+}
+
+CFileManifest::CFileManifest( const CArgValue& manifest_path ) 
+    : m_ManifestPath( manifest_path.AsString() )
+{
+    x_Init();
+}
+
+void CFileManifest::x_Init()
+{
+    if ( m_ManifestPath.empty() ) {
+        NCBI_THROW( CManifestException, eEmptyManifestName, "" );
+    }
+}
+
+void CFileManifest::Validate() const
+{
+    //  Check each file whether it can be opened for reading.
+    CFile manifest_file( m_ManifestPath );
+    if ( ! manifest_file.IsFile() ) {
+        NCBI_THROW( CManifestException, eCantOpenManifestForRead, 
+                    m_ManifestPath );
+    }
+    CNcbiIfstream   manifest_stream( m_ManifestPath.c_str() );
+    if ( ! manifest_stream ) {
+        NCBI_THROW( CManifestException, eCantOpenManifestForRead, 
+                    m_ManifestPath );
+    }
+    
+    CManifest_CI    manifest_line_iter( manifest_stream );
+    CManifest_CI    end_iter;
+    while ( manifest_line_iter != end_iter ) {
+        CFile file( *manifest_line_iter );
+        if ( ! file.IsFile() ) {
+            string error_string = "Manifest: " + m_ManifestPath;
+            error_string += " Bad file: ";
+            error_string += *manifest_line_iter;
+            NCBI_THROW( CManifestException, eCantOpenFileInManifest, 
+                        error_string );
+        }
+        CNcbiIfstream   manifest_file_stream( manifest_line_iter->c_str() );
+        if ( ! manifest_file_stream ) {
+            string error_string = "Manifest: " + m_ManifestPath;
+            error_string += " Cannot read file: ";
+            error_string += *manifest_line_iter;
+            NCBI_THROW( CManifestException, eCantOpenFileInManifest, 
+                        error_string );
+        }
+        ++manifest_line_iter;
+    }
+}
+
+
+vector<string> CFileManifest::GetAllFilePaths() const
+{
+    CNcbiIfstream   manifest_stream( m_ManifestPath.c_str() );
+    if ( ! manifest_stream ) {
+        NCBI_THROW( CManifestException, eCantOpenManifestForRead,
+                    m_ManifestPath );
+    }
+
+    CManifest_CI    manifest_line_iter( manifest_stream );
+    CManifest_CI    end_iter;
+    vector<string>  file_paths;
+    string          path;
+
+    for( ;  manifest_line_iter != end_iter;  ++manifest_line_iter) {
+        path = CDirEntry::CreateAbsolutePath(*manifest_line_iter);
+        path = CDirEntry::NormalizePath(path);
+        file_paths.push_back(path);
+    }
+
+    return  file_paths;
+}
+
+
+string CFileManifest::GetSingleFilePath() const
+{
+    //  Read the first file path and check for the second.  
+    //  Throw if the second is present. An empty manifest is ok.  
+    //  We return an empty string. 
+    string only_file_path;
+    
+    CNcbiIfstream   manifest_stream( m_ManifestPath.c_str() );
+    if ( ! manifest_stream ) {
+        NCBI_THROW( CManifestException, eCantOpenManifestForRead, 
+                    m_ManifestPath );
+    }
+
+    CManifest_CI    manifest_line_iter( manifest_stream );
+    CManifest_CI    end_iter;
+    if ( manifest_line_iter != end_iter ) {
+        only_file_path = *manifest_line_iter++;
+        if ( manifest_line_iter != end_iter ) {
+            NCBI_THROW( CManifestException, eMoreThanOneFile, m_ManifestPath );
+        }
+    }
+    
+    return  only_file_path;
+}
+
+
+void CFileManifest::WriteManyFilePaths( const vector<string> & file_paths )
+{
+    CNcbiOfstream   manifest_stream( m_ManifestPath.c_str() );
+    if ( ! manifest_stream ) {
+        NCBI_THROW( CManifestException, eCantOpenManifestForWrite, 
+                    m_ManifestPath );
+    }
+    ostream_iterator<string>  manifest_iterator( manifest_stream, "\n" );
+    copy( file_paths.begin(), file_paths.end(), manifest_iterator );
+}
+
+
+END_NCBI_SCOPE
diff --git a/c++/src/util/format_guess.cpp b/c++/src/util/format_guess.cpp
index 80cc7dc..b35f941 100644
--- a/c++/src/util/format_guess.cpp
+++ b/c++/src/util/format_guess.cpp
@@ -1,4 +1,4 @@
-/*  $Id: format_guess.cpp 479107 2015-09-16 15:58:57Z ivanov $
+/*  $Id: format_guess.cpp 497436 2016-04-06 17:56:51Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -116,50 +116,46 @@ static void init_symbol_type_table(void)
 {
     if ( symbol_type_table[0] == 0 ) {
         for ( const char* s = "ACGNTU"; *s; ++s ) {
-            unsigned char c = *s;
+            int c = *s;
             symbol_type_table[c] |= fDNA_Main_Alphabet;
             c = tolower(c);
             symbol_type_table[c] |= fDNA_Main_Alphabet;
         }
         for ( const char* s = "BDHKMRSVWY"; *s; ++s ) {
-            unsigned char c = *s;
+            int c = *s;
             symbol_type_table[c] |= fDNA_Ambig_Alphabet;
             c = tolower(c);
             symbol_type_table[c] |= fDNA_Ambig_Alphabet;
         }
         for ( const char* s = "ACDEFGHIKLMNPQRSTVWYBZX"; *s; ++s ) {
-            unsigned char c = *s;
+            int c = *s;
             symbol_type_table[c] |= fProtein_Alphabet;
             c = tolower(c);
             symbol_type_table[c] |= fProtein_Alphabet;
         }
-        symbol_type_table[(unsigned char)'-']
-            |= fDNA_Main_Alphabet | fProtein_Alphabet;
-        symbol_type_table[(unsigned char)'*'] |= fProtein_Alphabet;
+        symbol_type_table[(int)'-'] |= fDNA_Main_Alphabet | fProtein_Alphabet;
+        symbol_type_table[(int)'*'] |= fProtein_Alphabet;
         for ( const char* s = "\r\n"; *s; ++s ) {
-            unsigned char c = *s;
+            int c = *s;
             symbol_type_table[c] |= fLineEnd;
         }
         for ( int c = 1; c < 256; ++c ) {
-            if ( isalpha(c) )
+            if ( isalpha((unsigned char)c) )
                 symbol_type_table[c] |= fAlpha;
-            if ( isdigit(c) )
+            if ( isdigit((unsigned char)c) )
                 symbol_type_table[c] |= fDigit;
-            if ( isspace(c) )
+            if ( isspace((unsigned char)c) )
                 symbol_type_table[c] |= fSpace;
         }
         symbol_type_table[0] |= fInvalid;
     }
 }
 
-//  ----------------------------------------------------------------------------
-int
-CFormatGuess::s_CheckOrder[] =
-//  ----------------------------------------------------------------------------
+
+// Must list all EFormats except eUnknown and eFormat_max. 
+// Will cause assertion if violated!
+int CFormatGuess::s_CheckOrder[] =
 {
-    //  must list all EFormats except eUnknown and eFormat_max. Will cause
-    //  assertion if violated!
-    //
     eBam, // must precede eGZip!
     eZip,
     eGZip,
@@ -198,7 +194,8 @@ CFormatGuess::s_CheckOrder[] =
 // This array must stay in sync with enum EFormat, but that's not
 // supposed to change in the middle anyway, so the explicit size
 // should suffice to avoid accidental skew.
-const char* const CFormatGuess::sm_FormatNames[CFormatGuess::eFormat_max] = {
+const char* const CFormatGuess::sm_FormatNames[CFormatGuess::eFormat_max] =
+{
     "unknown",
     "binary ASN.1",
     "RepeatMasker",
@@ -393,12 +390,12 @@ CFormatGuess::GuessFormat(
         return eUnknown;
     }
     EMode mode = eQuick;
-    unsigned int uFormatCount = sizeof( s_CheckOrder ) / sizeof( int );
+    size_t uFormatCount = ArraySize(s_CheckOrder);
 
     // First, try to use hints
     if ( !m_Hints.IsEmpty() ) {
-        for (unsigned int f = 0; f < uFormatCount; ++f) {
-            EFormat fmt = EFormat( s_CheckOrder[ f ] );
+        for (size_t f = 0; f < uFormatCount; ++f) {
+            EFormat fmt = EFormat( s_CheckOrder[f] );
             if (m_Hints.IsPreferred(fmt)  &&  x_TestFormat(fmt, mode)) {
                 return fmt;
             }
@@ -406,8 +403,8 @@ CFormatGuess::GuessFormat(
     }
 
     // Check other formats, skip the ones that are disabled through hints
-    for (unsigned int f = 0; f < uFormatCount; ++f) {
-        EFormat fmt = EFormat( s_CheckOrder[ f ] );
+    for (size_t f = 0; f < uFormatCount; ++f) {
+        EFormat fmt = EFormat( s_CheckOrder[f] );
         if ( ! m_Hints.IsDisabled(fmt)  &&  x_TestFormat(fmt, mode) ) {
             return fmt;
         }
@@ -423,8 +420,7 @@ CFormatGuess::TestFormat( EFormat format, EMode )
 }
 
 //  ----------------------------------------------------------------------------
-bool
-CFormatGuess::TestFormat(
+bool CFormatGuess::TestFormat(
     EFormat format,
     EOnError onerror )
 {
@@ -664,8 +660,7 @@ bool CFormatGuess::x_TestInput( CNcbiIstream& input, EOnError onerror )
 }
 
 //  ----------------------------------------------------------------------------
-bool
-CFormatGuess::TestFormatRepeatMasker(
+bool CFormatGuess::TestFormatRepeatMasker(
     EMode /* not used */ )
 {
     if ( ! EnsureStats() || ! EnsureSplitLines() ) {
@@ -909,14 +904,46 @@ CFormatGuess::TestFormatNewick(
 
     bool is_nexus = false;
     bool has_trees = false;
+    const size_t check_size = 12;
+
     ITERATE( list<string>, it, m_TestLines ) {
         if ( NPOS != it->find( "#NEXUS" ) ) {
             is_nexus = true;
         }
+    }
 
-        // case insensitive
-        if (NPOS != NStr::FindNoCase(*it, "begin trees;")) { 
-            has_trees = true;
+    // Trees can be anywhere in a nexus file.  If nexus is true, 
+    // try to read the whole file to see if there is a tree.
+    if (is_nexus) {
+        // Read in file one chunk at a time.  Readline would be better
+        // but is not avialable for this stream.  Since the text we 
+        // are looking for "begin trees;" may span two chunks, we
+        // copy the last 12 characters of the previous chunk to
+        // the front of the new one.
+        const size_t read_size = 16384;
+        char test_buf[read_size + check_size + 1];
+        memset(test_buf, ' ', check_size); // "previous chunk" initially blank.
+
+        size_t max_reads = 32768;  // max read to locate tree: 512 MB
+        for (size_t i = 0; i < max_reads; ++i) {
+            m_Stream.read(test_buf+check_size, read_size);
+            size_t num_read = m_Stream.gcount();
+            if (num_read > 0) {
+                test_buf[num_read + check_size] = 0; // null terminator
+                if (NPOS != NStr::FindNoCase(CTempString(test_buf), "begin trees;")) {
+                    has_trees = true;
+                    m_Stream.clear();  // in case we reached eof
+                    break;
+                }
+                // copy end of buffer to beginning in case string
+                // spans two buffers:
+                strncpy(test_buf, test_buf + num_read, check_size);
+            }
+
+            if (m_Stream.eof() || m_Stream.fail()) {
+                m_Stream.clear();  // clear eof
+                break;
+            }
         }
     }
 
@@ -995,7 +1022,7 @@ CFormatGuess::TestFormatDistanceMatrix(
     list<string> toks;
 
     /// first line: one token, one number
-    NStr::Split(*iter++, "\t ", toks);
+    NStr::Split(*iter++, "\t ", toks, NStr::fSplit_Tokenize);
     if (toks.size() != 1  ||
         toks.front().find_first_not_of("0123456789") != string::npos) {
         return false;
@@ -1006,7 +1033,7 @@ CFormatGuess::TestFormatDistanceMatrix(
     // line, the number of values should increase monotonically
     for (size_t i = 1;  iter != m_TestLines.end();  ++i, ++iter) {
         toks.clear();
-        NStr::Split(*iter, "\t ", toks);
+        NStr::Split(*iter, "\t ", toks, NStr::fSplit_Tokenize);
         if (toks.size() != i) {
             /// we can ignore the last line ; it may be truncated
             list<string>::const_iterator it = iter;
@@ -1100,9 +1127,7 @@ CFormatGuess::TestFormatXml(
     static const char* known_types[] = {
         "<Blast4-request>"
     };
-    const int num_types = sizeof( known_types ) / sizeof( const char* );
-
-    for ( int i=0; i < num_types; ++i ) {
+    for ( size_t i=0; i < ArraySize(known_types); ++i ) {
         if ( NStr::StartsWith( input, known_types[i], NStr::eCase ) ) {
             return true;
         }
@@ -1164,7 +1189,7 @@ CFormatGuess::TestFormatAlignment(
         }
 
         toks.clear();
-        NStr::Split(*iter, delims, toks);
+        NStr::Split(*iter, delims, toks, NStr::fSplit_Tokenize);
         ncols = toks.size();
         found = true;
     }
@@ -1181,7 +1206,7 @@ CFormatGuess::TestFormatAlignment(
         } 
 
         toks.clear();
-        NStr::Split(*iter, delims, toks);
+        NStr::Split(*iter, delims, toks, NStr::fSplit_Tokenize);
         if (toks.size() != ncols) {
             list<string>::const_iterator it = iter;
             ++it;
@@ -1192,7 +1217,7 @@ CFormatGuess::TestFormatAlignment(
             ++nlines;
         }
     }
-    return ( nlines >= 2 );
+    return ( nlines >= 3 );
  }
 
 bool
@@ -1256,8 +1281,7 @@ void SkipCommentAndBlank(CTempString &text)
 }
 
 bool
-CFormatGuess::TestFormatFasta(
-    EMode /* not used */ )
+CFormatGuess::TestFormatFasta( EMode /* not used */ )
 {
     if ( ! EnsureStats() ) {
         return false;
@@ -1277,9 +1301,9 @@ CFormatGuess::TestFormatFasta(
     }
 
     // remaining decision based on text stats:
-    double dAlNumFraction =  (double)m_iStatsCountAlNumChars / m_iTestDataSize;
-    double dDnaFraction = (double)m_iStatsCountDnaChars / m_iStatsCountData;
-    double dAaFraction = (double)m_iStatsCountAaChars / m_iStatsCountData;
+    double dAlNumFraction = (double)m_iStatsCountAlNumChars / (double)m_iTestDataSize;
+    double dDnaFraction   = (double)m_iStatsCountDnaChars / (double)m_iStatsCountData;
+    double dAaFraction    = (double)m_iStatsCountAaChars / (double)m_iStatsCountData;
 
     // want at least 80% text-ish overall:
     if ( dAlNumFraction < 0.8 ) {
@@ -1312,7 +1336,8 @@ CFormatGuess::TestFormatTextAsn(
     // at least 80% text-ish,
     // "::=" as the 2nd field of the first non-blank non comment line.
     //
-    double dAlNumFraction =  (double)(m_iStatsCountAlNumChars+m_iStatsCountBraces) / m_iTestDataSize;
+    double dAlNumFraction = (double)(m_iStatsCountAlNumChars+m_iStatsCountBraces) /
+                            (double)m_iTestDataSize;
     if ( dAlNumFraction < 0.80 ) {
         return false;
     }
@@ -1323,8 +1348,8 @@ CFormatGuess::TestFormatTextAsn(
 
     while ( ! TestBuffer.fail() ) {
         vector<string> Fields;
-        NcbiGetline( TestBuffer, strLine, "\n\r" );
-        NStr::Tokenize( strLine, " \t", Fields, NStr::eMergeDelims );
+        NcbiGetline(TestBuffer, strLine, "\n\r");
+        NStr::Split(strLine, " \t", Fields, NStr::fSplit_Tokenize);
         if ( IsAsnComment( Fields  ) ) {
             continue;
         }
@@ -1401,7 +1426,7 @@ CFormatGuess::TestFormatBed(
         }
 
         vector<string> columns;
-        NStr::Tokenize( str, " \t", columns, NStr::eMergeDelims );
+        NStr::Split(str, " \t", columns, NStr::fSplit_Tokenize);
         if (columns.size() < 3 || columns.size() > 12) {
             return false;
         }
@@ -1454,7 +1479,7 @@ CFormatGuess::TestFormatBed15(
         }
 
         vector<string> columns;
-        NStr::Tokenize( *it, " \t", columns, NStr::eMergeDelims );
+        NStr::Split(*it, " \t", columns, NStr::fSplit_Tokenize);
         if ( columns.size() != columncount ) {
             return false;
         } else {
@@ -1990,7 +2015,7 @@ bool CFormatGuess::IsLineAgp(
     }
 
     vector<string> tokens;
-    if ( NStr::Tokenize( line, " \t", tokens, NStr::eMergeDelims ).size() < 8 ) {
+    if ( NStr::Split(line, " \t", tokens, NStr::fSplit_Tokenize).size() < 8 ) {
         return false;
     }
 
@@ -2047,7 +2072,7 @@ bool CFormatGuess::IsLineGlimmer3(
     const string& line )
 {
     list<string> toks;
-    NStr::Split(line, "\t ", toks);
+    NStr::Split(line, "\t ", toks, NStr::fSplit_Tokenize);
     if (toks.size() != 5) {
         return false;
     }
@@ -2088,7 +2113,7 @@ bool CFormatGuess::IsLineGtf(
     const string& line )
 {
     vector<string> tokens;
-    if ( NStr::Tokenize( line, " \t", tokens, NStr::eMergeDelims ).size() < 8 ) {
+    if ( NStr::Split(line, " \t", tokens, NStr::fSplit_Tokenize).size() < 8 ) {
         return false;
     }
     if ( ! s_IsTokenPosInt( tokens[3] ) ) {
@@ -2120,7 +2145,7 @@ bool CFormatGuess::IsLineGvf(
 //  ----------------------------------------------------------------------------
 {
     vector<string> tokens;
-    if ( NStr::Tokenize( line, " \t", tokens, NStr::eMergeDelims ).size() < 8 ) {
+    if ( NStr::Split(line, " \t", tokens, NStr::fSplit_Tokenize).size() < 8 ) {
         return false;
     }
     if ( ! s_IsTokenPosInt( tokens[3] ) ) {
@@ -2195,7 +2220,7 @@ bool CFormatGuess::IsLineGff3(
     const string& line )
 {
     vector<string> tokens;
-    if ( NStr::Tokenize( line, " \t", tokens, NStr::eMergeDelims ).size() < 8 ) {
+    if ( NStr::Split(line, " \t", tokens, NStr::fSplit_Tokenize).size() < 8 ) {
         return false;
     }
     if ( ! s_IsTokenPosInt( tokens[3] ) ) {
@@ -2239,7 +2264,7 @@ bool CFormatGuess::IsLineGff2(
     const string& line )
 {
     vector<string> tokens;
-    if ( NStr::Tokenize( line, " \t", tokens, NStr::eMergeDelims ).size() < 8 ) {
+    if ( NStr::Split(line, " \t", tokens, NStr::fSplit_Tokenize).size() < 8 ) {
         return false;
     }
     if ( ! s_IsTokenPosInt( tokens[3] ) ) {
@@ -2266,7 +2291,7 @@ bool CFormatGuess::IsLinePhrapId(
     const string& line )
 {
     vector<string> values;
-    if ( NStr::Tokenize( line, " \t", values, NStr::eMergeDelims ).empty() ) {
+    if ( NStr::Split(line, " \t", values, NStr::fSplit_Tokenize).empty() ) {
         return false;
     }
 
@@ -2299,7 +2324,7 @@ bool CFormatGuess::IsLineRmo(
     //  Make sure there is enough stuff on that line:
     //
     list<string> values;
-    if ( NStr::Split( line, " \t", values ).size() < MIN_VALUES_PER_RECORD ) {
+    if ( NStr::Split(line, " \t", values, NStr::fSplit_Tokenize).size() < MIN_VALUES_PER_RECORD ) {
         return false;
     }
 
@@ -2403,14 +2428,14 @@ CFormatGuess::EnsureSplitLines()
     string data( m_pTestBuffer, (size_t)m_iTestDataSize );
     m_TestLines.clear();
 
-    if ( string::npos != data.find( "\r\n" ) ) {
-        NStr::Split( data, "\r\n", m_TestLines );
+    if ( string::npos != data.find("\r\n") ) {
+        NStr::Split(data, "\r\n", m_TestLines, NStr::fSplit_Tokenize);
     }
-    else if ( string::npos != data.find( "\n" ) ) {
-        NStr::Split( data, "\n", m_TestLines );
+    else if ( string::npos != data.find("\n") ) {
+        NStr::Split(data, "\n", m_TestLines, NStr::fSplit_Tokenize);
     }
-    else if ( string::npos != data.find( "\r" ) ) {
-        NStr::Split( data, "\r", m_TestLines );
+    else if ( string::npos != data.find("\r") ) {
+        NStr::Split(data, "\r", m_TestLines, NStr::fSplit_Tokenize);
     }
     else {
         //single truncated line
@@ -2437,7 +2462,7 @@ CFormatGuess::IsAsciiText()
             ++count_print;
         }
     }
-    if (count_print < count * REQUIRED_ASCII_RATIO) {
+    if (count_print < (double)count * REQUIRED_ASCII_RATIO) {
 		return false;
     }
     return true;
diff --git a/c++/src/util/itree.cpp b/c++/src/util/itree.cpp
index 0a95ad0..e5da2a4 100644
--- a/c++/src/util/itree.cpp
+++ b/c++/src/util/itree.cpp
@@ -1,4 +1,4 @@
-/*  $Id: itree.cpp 103491 2007-05-04 17:18:18Z kazimird $
+/*  $Id: itree.cpp 489095 2016-01-08 13:02:41Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -258,7 +258,7 @@ pair<double, CIntervalTree::size_type> CIntervalTree::Stat(void) const
     SStat stat;
     stat.total = stat.count = stat.max = 0;
     Stat(&m_Root, stat);
-    return make_pair(double(stat.total) / stat.count, stat.max);
+    return make_pair(double(stat.total) / (double)stat.count, stat.max);
 }
 
 void CIntervalTree::Stat(const TTreeNode* node, SStat& stat) const
diff --git a/c++/src/util/line_reader.cpp b/c++/src/util/line_reader.cpp
index e766a21..cdd7980 100644
--- a/c++/src/util/line_reader.cpp
+++ b/c++/src/util/line_reader.cpp
@@ -1,4 +1,4 @@
-/*  $Id: line_reader.cpp 402024 2013-06-04 18:18:01Z kornbluh $
+/*  $Id: line_reader.cpp 489926 2016-01-19 21:27:32Z elisovdn $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -106,13 +106,46 @@ bool CStreamLineReader::AtEOF(void) const
 
 char CStreamLineReader::PeekChar(void) const
 {
-    return m_UngetLine? *m_Line.begin(): m_Stream->peek();
+    _ASSERT(!AtEOF());
+    /* If at EOF - undefined behavior, return m_Stream->peek() */
+    if (AtEOF()) {
+        return (char)m_Stream->peek();
+    }
+    /* If right after constructor (line number is 0 and line was not ungot) - 
+       return the first character of the first line */
+    if (m_LineNumber == 0 && !m_UngetLine) {
+        char c = (char)m_Stream->peek();
+        /* If there are delimiters right from the start (which means the
+        first line is empty), return 0 */
+        if (c == '\n' || c == '\r') {
+            return 0;
+        }
+        return c;
+    }
+    /* If line was ungot - return its first symbol */
+    if (m_UngetLine) {
+        /* if line is empty - return 0 */
+        if (m_Line.empty()) {
+            return 0;
+        }
+        return *m_Line.begin();
+    }
+    char c = (char)m_Stream->peek();
+    /* If line is empty - return 0 */
+    if (c == '\n' || c == '\r') {
+        return 0;
+    }
+    return c;
 }
 
 
 void CStreamLineReader::UngetLine(void)
 {
-    _ASSERT(!m_UngetLine);
+    _ASSERT(!m_UngetLine && m_LineNumber != 0);
+    /* If after UngetLine() or after constructor - noop */
+    if (m_UngetLine || m_LineNumber == 0) {
+        return;
+    }
     --m_LineNumber;
     m_UngetLine = true;
 }
@@ -120,6 +153,11 @@ void CStreamLineReader::UngetLine(void)
 
 CStreamLineReader& CStreamLineReader::operator++(void)
 {
+    /* If at EOF - noop */
+    if (AtEOF()) {
+        m_Line = string();
+        return *this;
+    }
     ++m_LineNumber;
     if ( m_UngetLine ) {
         m_UngetLine = false;
@@ -140,6 +178,19 @@ CStreamLineReader& CStreamLineReader::operator++(void)
 CTempString CStreamLineReader::operator*(void) const
 {
     _ASSERT(!m_UngetLine);
+    /* After UngetLine() - undefined behavior */
+    if (m_UngetLine) {
+        return CTempString(NULL);
+    }
+    /* If at EOF - returns NULL */
+//    if (AtEOF()) {
+//        return CTempString(NULL);
+//    }
+    /* Right after constructor (m_LineNumber is 0 and UngetLine() was not run, 
+       the latter was already checked) - returns NULL */
+    if (m_LineNumber == 0) {
+        return CTempString(NULL);
+    }
     return CTempString(m_Line);
 }
 
@@ -156,6 +207,11 @@ CT_POS_TYPE CStreamLineReader::GetPosition(void) const
 
 unsigned int CStreamLineReader::GetLineNumber(void) const
 {
+    /* Right after constructor (m_LineNumber is 0 and UngetLine() was not run) 
+       - 0 */
+    /* If at EOF - returns the number of the last string */
+    /* After UngetLine() - number of the previous string */
+    /* Not at EOF, not after UngetLine() - number of the current string */
     return m_LineNumber;
 }
 
@@ -260,14 +316,35 @@ bool CMemoryLineReader::AtEOF(void) const
 
 char CMemoryLineReader::PeekChar(void) const
 {
+    _ASSERT(!AtEOF());
+    /* If at EOF - undefined behavior, return m_Pos */
+    if (AtEOF()) {
+        return *m_Pos;
+    }
+    /* If line was ungot - return its first symbol */
+    if (m_Pos == m_Line.begin()) {
+        /* if line is empty - return 0 */
+        if (m_Line.empty()) {
+            return 0;
+        }
+        return *m_Pos;
+    }
+    /* If line is empty - return 0 */
+    if (*m_Pos == '\n' || *m_Pos == '\r') {
+        return 0;
+    }
     return *m_Pos;
 }
 
 
 void CMemoryLineReader::UngetLine(void)
 {
-    _ASSERT(m_Line.begin());
     _ASSERT(m_Pos != m_Line.begin());
+    _ASSERT(m_Line.begin() != 0);
+    /* If after UngetLine() or after constructor - noop */
+    if (m_Pos == m_Line.begin() || m_Line.begin() == 0) {
+        return;
+    }
     --m_LineNumber;
     m_Pos = m_Line.begin();
 }
@@ -275,17 +352,23 @@ void CMemoryLineReader::UngetLine(void)
 
 CMemoryLineReader& CMemoryLineReader::operator++(void)
 {
+    /* If at EOF - noop */
+    if (AtEOF()) {
+        m_Line = CTempString(NULL);
+        return *this;
+    }
     const char* p = m_Pos;
     if ( p == m_Line.begin() ) {
+        /* If after UngetLine(), line is already in buffer, so end is known*/
         p = m_Line.end();
-    }
-    else {
+    } else {
+        /* Line is in stream, go char by char until delimiters */
         while ( p < m_End  &&  *p != '\r'  && *p != '\n' ) {
             ++p;
         }
         m_Line = CTempString(m_Pos, p - m_Pos);
     }
-    // skip over delimiters
+    // skip over delimiters until the beginning of the next string
     if (p + 1 < m_End  &&  *p == '\r'  &&  p[1] == '\n') {
         m_Pos = p + 2;
     } else if (p < m_End) {
@@ -300,7 +383,16 @@ CMemoryLineReader& CMemoryLineReader::operator++(void)
 
 CTempString CMemoryLineReader::operator*(void) const
 {
-    _ASSERT(m_Line.begin());
+    _ASSERT(m_Pos != m_Line.begin());
+    /* After UngetLine() - undefined behavior */
+    if (m_Pos == m_Line.begin()) {
+        return CTempString(NULL);
+    }
+    /* Right after constructor (m_LineNumber is 0 and UngetLine() was not run,
+    the latter was already checked) - returns NULL */
+    if (m_LineNumber == 0) {
+        return CTempString(NULL);
+    }
     return m_Line;
 }
 
@@ -313,6 +405,11 @@ CT_POS_TYPE CMemoryLineReader::GetPosition(void) const
 
 unsigned int CMemoryLineReader::GetLineNumber(void) const
 {
+    /* Right after constructor (m_LineNumber is 0 and UngetLine() was not run)
+    - 0 */
+    /* If at EOF - returns the number of the last string */
+    /* After UngetLine() - number of the previous string */
+    /* Not at EOF, not after UngetLine() - number of the current string */
     return m_LineNumber;
 }
 
@@ -377,14 +474,33 @@ bool CBufferedLineReader::AtEOF(void) const
 
 char CBufferedLineReader::PeekChar(void) const
 {
-    return m_UngetLine? *m_Line.begin(): *m_Pos;
+    _ASSERT(!AtEOF());
+    /* If at EOF - undefined behavior */
+    if (AtEOF()) {
+        return *m_Pos;
+    }
+    /* If line was ungot - return its first symbol */
+    if (m_UngetLine) {
+        /* if line is empty - return 0 */
+        if (m_Line.empty()) {
+            return 0;
+        }
+        return *m_Line.begin();
+    }
+    /* If line is empty - return 0 */
+    if (*m_Pos == '\n' || *m_Pos == '\r') {
+        return 0;
+    }
+    return *m_Pos;
 }
 
 
 void CBufferedLineReader::UngetLine(void)
 {
-    _ASSERT(!m_UngetLine);
-    _ASSERT(m_Line.begin());
+    _ASSERT(!m_UngetLine && m_Line.begin());
+    /* If after UngetLine() or after constructor - noop */
+    if (m_UngetLine || m_Line.begin() == NULL)
+        return;
     --m_LineNumber;
     m_UngetLine = true;
 }
@@ -392,6 +508,11 @@ void CBufferedLineReader::UngetLine(void)
 
 CBufferedLineReader& CBufferedLineReader::operator++(void)
 {
+    /* If at EOF - noop */
+    if (AtEOF()) {
+        m_Line = CTempString(NULL);
+        return *this;
+    }
     ++m_LineNumber;
     if ( m_UngetLine ) {
         _ASSERT(m_Line.begin());
@@ -534,6 +655,16 @@ bool CBufferedLineReader::x_ReadBuffer()
 
 CTempString CBufferedLineReader::operator*(void) const
 {
+    _ASSERT(!m_UngetLine);
+    /* After UngetLine() - undefined behavior */
+    if (m_UngetLine) {
+        return CTempString(NULL);
+    }
+    /* Right after constructor (m_LineNumber is 0 and UngetLine() was not run,
+    the latter was already checked) - returns NULL */
+    if (m_Line.begin() == NULL) {
+        return CTempString(NULL);
+    }
     return m_Line;
 }
 
@@ -550,6 +681,11 @@ CT_POS_TYPE CBufferedLineReader::GetPosition(void) const
 
 unsigned int CBufferedLineReader::GetLineNumber(void) const
 {
+    /* Right after constructor (m_LineNumber is 0 and UngetLine() was not run)
+       - 0 */
+    /* If at EOF - returns the number of the last string */
+    /* After UngetLine() - number of the previous string */
+    /* Not at EOF, not after UngetLine() - number of the current string */
     return m_LineNumber;
 }
 
diff --git a/c++/src/util/retry_ctx.cpp b/c++/src/util/retry_ctx.cpp
index a0b2139..bb70b52 100644
--- a/c++/src/util/retry_ctx.cpp
+++ b/c++/src/util/retry_ctx.cpp
@@ -1,4 +1,4 @@
-/*  $Id: retry_ctx.cpp 483516 2015-11-02 14:43:15Z ivanov $
+/*  $Id: retry_ctx.cpp 499300 2016-04-25 15:23:35Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -67,7 +67,8 @@ CHttpRetryContext& CHttpRetryContext::operator=(const CRetryContext& ctx)
 void CHttpRetryContext::ParseHeader(const char* http_header)
 {
     list<string> lines;
-    NStr::Split(http_header, HTTP_EOL, lines);
+    NStr::Split(http_header, HTTP_EOL, lines,
+        NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
 
     SetContentOverride(eNot_set);
     ResetContent();
@@ -87,25 +88,21 @@ void CHttpRetryContext::ParseHeader(const char* http_header)
 
         if ( NStr::EqualNocase(name, kHeader_Stop) ) {
             SetStop(value);
+            continue; // Do not set NeedRetry flag.
         }
-        if ( NStr::EqualNocase(name, kHeader_Delay) ) {
+        else if ( NStr::EqualNocase(name, kHeader_Delay) ) {
             double val = NStr::StringToDouble(value);
             if (errno == 0) {
                 SetDelay(val);
             }
-            SetNeedRetry(); // Even if the value was wrong.
         }
-        if ( NStr::EqualNocase(name, kHeader_Args) ) {
+        else if ( NStr::EqualNocase(name, kHeader_Args) ) {
             SetArgs(value);
-            SetNeedReconnect();
-            SetNeedRetry();
         }
-        if ( NStr::EqualNocase(name, kHeader_Url) ) {
+        else if ( NStr::EqualNocase(name, kHeader_Url) ) {
             SetUrl(value);
-            SetNeedReconnect();
-            SetNeedRetry();
         }
-        if ( NStr::EqualNocase(name, kHeader_Content) ) {
+        else if ( NStr::EqualNocase(name, kHeader_Content) ) {
             string content = value;
             if ( NStr::EqualNocase(content, kContent_None) ) {
                 SetContentOverride(eNoContent);
@@ -117,8 +114,13 @@ void CHttpRetryContext::ParseHeader(const char* http_header)
                 SetContentOverride(eData);
                 SetContent(NStr::URLDecode(content.substr(strlen(kContent_Value))));
             }
-            SetNeedRetry();
         }
+        else {
+            continue;
+        }
+        SetNeedRetry();
+        // Any retry must force reconnecting.
+        SetNeedReconnect();
     }
 }
 
diff --git a/c++/src/util/scheduler.cpp b/c++/src/util/scheduler.cpp
index a56896d..ca6dac5 100644
--- a/c++/src/util/scheduler.cpp
+++ b/c++/src/util/scheduler.cpp
@@ -1,4 +1,4 @@
-/*  $Id: scheduler.cpp 367943 2012-06-29 14:58:56Z ivanovp $
+/*  $Id: scheduler.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -291,7 +291,7 @@ CScheduler_MT::x_AddQueueTask
     CRef<CScheduler_QueueEvent> event_info(new CScheduler_QueueEvent());
 
     if (id == 0) {
-        id = m_IDCounter.Add(1);
+        id = (TScheduler_SeriesID)m_IDCounter.Add(1);
     }
 
     event_info->id = id;
@@ -656,8 +656,7 @@ CScheduler_ExecThread_Impl::Main(void)
     CTime cur_time(CTime::eCurrent);
     while ( !m_Stopped ) {
         CTimeSpan timeout = m_Scheduler->GetNextExecutionTime() - cur_time;
-        m_WaitTrigger.TryWait(timeout.GetCompleteSeconds(),
-                              timeout.GetNanoSecondsAfterSecond());
+        m_WaitTrigger.TryWait(CTimeout(timeout));
 
         // If we are already stopped we will not do unnecessary work
         if ( !m_Stopped ) {
diff --git a/c++/src/util/sequtil/sequtil_convert_imp.cpp b/c++/src/util/sequtil/sequtil_convert_imp.cpp
index c3fe0c3..9e637c6 100644
--- a/c++/src/util/sequtil/sequtil_convert_imp.cpp
+++ b/c++/src/util/sequtil/sequtil_convert_imp.cpp
@@ -1,4 +1,4 @@
-/*  $Id: sequtil_convert_imp.cpp 443752 2014-08-19 12:38:37Z grichenk $
+/*  $Id: sequtil_convert_imp.cpp 495186 2016-03-15 16:38:09Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -281,7 +281,7 @@ SIZE_TYPE CSeqConvert_imp::x_ConvertIupacnaTo2na
     if ( length % 4 != 0 ) {
         *dst = 0x0;
         for( size_t i = 0; i < (length % 4); ++i, ++src_i ) {
-            *dst |= table[static_cast<Uint1>(*src_i) * 4 + i];
+            *dst |= (char)table[static_cast<Uint1>(*src_i) * 4 + i];
         }
     }
     
@@ -429,7 +429,7 @@ SIZE_TYPE CSeqConvert_imp::x_Convert2naTo4na
         {{
             *dst = table[static_cast<Uint1>(*iter) * 2 + 1];
             if ( length == 1 ) {
-                *dst &= 0xf0;
+                *dst &= (char)0xf0;
                 return length;
             }
             size -= 2;
@@ -562,23 +562,23 @@ SIZE_TYPE CSeqConvert_imp::x_Convert2naExpandTo2na
     // main loop. pack 4 ncbi2na_expand bytes into a single bye and add it
     // to the output container
     for ( size_t i = length / 4; i; --i, ++dst ) {
-        *dst = (*iter << 6) | (*(iter + 1) << 4) | 
-               (*(iter + 2) << 2) | (*(iter + 3));
+        *dst = char((*iter << 6) | (*(iter + 1) << 4) | 
+                    (*(iter + 2) << 2) | (*(iter + 3)));
         iter += 4;
     }
 
     switch ( length % 4 ) {
     case 1:
-        *dst = (*iter << 6);
+        *dst = char(*iter << 6);
         break;
     case 2:
-        *dst = (*iter << 6) | (*(iter + 1) << 4);
+        *dst = char((*iter << 6) | (*(iter + 1) << 4));
         break;
     case 3:
-        *dst = (*iter << 6) | (*(iter + 1) << 4) | (*(iter + 2) << 2);
+        *dst = char((*iter << 6) | (*(iter + 1) << 4) | (*(iter + 2) << 2));
         break;
     }
-    
+   
     return length;
 }
 
@@ -696,9 +696,9 @@ SIZE_TYPE CSeqConvert_imp::x_Convert4naTo2na
                     *dst = (table[static_cast<Uint1>(*iter) * 2]) & 0xF0;
                     break;
                 case 3:
-                    *dst = 
-                        table[static_cast<Uint1>(*iter) * 2]           |
-                        (table[static_cast<Uint1>(*(iter + 1)) * 2 + 1] & 0xFC);
+                    *dst = (char)(
+                        table[static_cast<Uint1>(*iter) * 2] |
+                        (table[static_cast<Uint1>(*(iter + 1)) * 2 + 1] & 0xFC));
                     break;
                 }
             }
@@ -723,14 +723,14 @@ SIZE_TYPE CSeqConvert_imp::x_Convert4naTo2na
                     *dst = table[static_cast<Uint1>(*iter) * 3] & 0xC0;
                     break;
                 case 2:
-                    *dst = 
+                    *dst = (char)(
                         table[static_cast<Uint1>(*iter) * 3]           |
-                        (table[static_cast<Uint1>(*(iter + 1)) * 3 + 1] & 0xF0);
+                        (table[static_cast<Uint1>(*(iter + 1)) * 3 + 1] & 0xF0));
                     break;
                 case 3:
-                    *dst = 
+                    *dst = (char)(
                         table[static_cast<Uint1>(*iter) * 3]           |
-                        (table[static_cast<Uint1>(*(iter + 1)) * 3 + 1] & 0xFC);
+                        (table[static_cast<Uint1>(*(iter + 1)) * 3 + 1] & 0xFC));
                     break;
                 }
             }
@@ -809,7 +809,7 @@ SIZE_TYPE CSeqConvert_imp::x_Convert8naTo2na
     if ( (length % 4) != 0 ) {
         *dst = 0;
         for( size_t i = 0; i < (length % 4); ++i, ++iter ) {
-            *dst |= table[static_cast<Uint1>(*iter) * 4 + i];
+            *dst |= (char)table[static_cast<Uint1>(*iter)*4 + i];
         }
     }
     
@@ -862,12 +862,12 @@ SIZE_TYPE CSeqConvert_imp::x_Convert8naTo4na
     const char* iter = src + pos;
 
     for ( size_t i = length / 2; i; --i, ++dst ) {
-        *dst = (*iter << 4) | (*(iter + 1));
+        *dst = char((*iter << 4) | (*(iter + 1)));
         iter += 2;
     }
 
     if ( (length % 2) != 0 ) {
-        *dst = (*iter << 4) & 0xf0;
+        *dst = char((*iter << 4) & 0xf0);
     }
     
     return length;
@@ -1012,7 +1012,7 @@ SIZE_TYPE CSeqConvert_imp::Subseq
                 const char* end  = iter + length;
                 
                 for ( ; iter != end; ++iter, ++dst ) {
-                    *dst = toupper((unsigned char)(*iter));
+                    *dst = (char)toupper((unsigned char)(*iter));
                 }
                 converted = length;
             }}
@@ -1115,6 +1115,12 @@ SIZE_TYPE CSeqConvert_imp::Pack(const char* src, TSeqPos length,
 const CSeqUtil::ECoding CSeqConvert_imp::CPacker::kNoCoding
     = CSeqUtil::e_Ncbi2na_expand; // never used by best_coding
 
+CSeqConvert_imp::CPacker::~CPacker()
+{
+    m_EndingNarrow.Reset();
+    m_EndingWide.shared_codings = NULL;
+}
+
 SIZE_TYPE CSeqConvert_imp::CPacker::Pack(const char* src, TSeqPos length)
 {
     const char* src_end   = src + GetBytesNeeded(m_SrcCoding, length);
@@ -1132,13 +1138,13 @@ SIZE_TYPE CSeqConvert_imp::CPacker::Pack(const char* src, TSeqPos length)
             TCoding type1 = m_BestCoding[(residue >> 4)   * 0x11],
                     type2 = m_BestCoding[(residue & 0x0F) * 0x11];
             if (type1 != prev_type) {
-                x_AddBoundary((p - src) * 2, type1);
+                x_AddBoundary(TSeqPos((p - src)*2), type1);
             }
-            x_AddBoundary((p - src) * 2 + 1, type2);
+            x_AddBoundary(TSeqPos((p - src)*2 + 1), type2);
             prev_type = type2;
         } else if (p != src_end) {
             _ASSERT(curr_type != kNoCoding);
-            x_AddBoundary((p - src) * m_SrcDensity, curr_type);
+            x_AddBoundary(TSeqPos((p - src) * m_SrcDensity), curr_type);
             prev_type = curr_type;
         }
     }
@@ -1152,14 +1158,22 @@ SIZE_TYPE CSeqConvert_imp::CPacker::Pack(const char* src, TSeqPos length)
 
     // XXX - fine-tune 4na/2na boundaries to minimize wastage?
 
-    size_t n = best_arrangement->codings.size();
-    _ASSERT(n == m_Boundaries.size() - 1);
+    size_t n = m_Boundaries.size() - 1;
+    vector<TCoding> coding_vec(n);
+    SCodings*       codings = best_arrangement->codings;
+    for (size_t i = 0;  i < n;
+         i += codings->current_used, codings = codings->previous) {
+        _ASSERT(codings != NULL);
+        memcpy(coding_vec.data() + (n - i - codings->current_used),
+               codings->current, codings->current_used * sizeof(TCoding));
+    }
+    _ASSERT(codings == NULL);
 
     SIZE_TYPE result = 0;
     for (size_t i = 0;  i < n;  ++i) {
-        TCoding coding  = best_arrangement->codings[i];
+        TCoding coding  = coding_vec[i];
         TSeqPos start   = m_Boundaries[i];
-        while (i < n - 1  &&  best_arrangement->codings[i + 1] == coding) {
+        while (i < n - 1  &&  coding_vec[i + 1] == coding) {
             ++i; // merge when possible
         }
 
@@ -1182,8 +1196,8 @@ void CSeqConvert_imp::CPacker::x_AddBoundary(TSeqPos pos, TCoding new_coding)
     if (m_Boundaries.empty()) {
         _ASSERT(pos == 0);
         m_Boundaries.push_back(pos);
-        m_EndingNarrow.codings.push_back(new_coding);
-        m_EndingWide.codings.push_back(m_WideCoding);
+        m_EndingNarrow.AddCoding(new_coding);
+        m_EndingWide.AddCoding(m_WideCoding);
         m_EndingWide.cost   = m_Target.GetOverhead(m_WideCoding);
         m_EndingNarrow.cost = m_Target.GetOverhead(new_coding);
         return;
@@ -1193,7 +1207,7 @@ void CSeqConvert_imp::CPacker::x_AddBoundary(TSeqPos pos, TCoding new_coding)
     _ASSERT(last_length > 0);
     m_Boundaries.push_back(pos);
 
-    TCoding last_narrow = m_EndingNarrow.codings.back();
+    TCoding last_narrow = m_EndingNarrow.codings->GetLast();
     // This always rounds up to full bytes, and as such can slightly
     // overestimate the total cost of ncbi4na.
     m_EndingNarrow.cost += GetBytesNeeded(last_narrow,  last_length);
@@ -1230,10 +1244,46 @@ void CSeqConvert_imp::CPacker::x_AddBoundary(TSeqPos pos, TCoding new_coding)
     }
     // _TRACE('(' << m_EndingNarrow.cost << ", " << m_EndingWide.cost << ')');
 
-    m_EndingNarrow.codings.push_back(new_coding);
-    m_EndingWide.codings.push_back(m_WideCoding);
-    _ASSERT(m_EndingNarrow.codings.size() == m_Boundaries.size());
-    _ASSERT(m_EndingWide.codings.size() == m_Boundaries.size());    
+    m_EndingNarrow.AddCoding(new_coding);
+    m_EndingWide.AddCoding(m_WideCoding);
+}
+
+CSeqConvert_imp::CPacker::SArrangement&
+CSeqConvert_imp::CPacker::SArrangement::operator= (SArrangement& arr)
+{
+    _ASSERT(arr.shared_codings == shared_codings);
+    if (codings->previous == shared_codings) {
+        _ASSERT(arr.codings->previous == shared_codings);
+        codings->current_used = arr.codings->current_used;
+        memcpy(codings->current, arr.codings->current,
+               codings->current_used * sizeof(TCoding));
+    } else {
+        Reset();
+        codings = new SCodings(*arr.codings);
+        shared_codings = arr.shared_codings = codings->previous;
+    }
+    cost = arr.cost;
+    return *this;
+}
+
+void CSeqConvert_imp::CPacker::SArrangement::Reset(void)
+{
+    while (codings != NULL  &&  codings != shared_codings) {
+        SCodings* previous = codings->previous;
+        delete codings;
+        codings = previous;
+    }
+}
+
+void CSeqConvert_imp::CPacker::SArrangement::AddCoding(TCoding coding)
+{
+    if (codings == NULL  ||  codings->current_used == SCodings::kBlockSize) {
+        SCodings* new_codings = new SCodings;
+        new_codings->previous = codings;
+        new_codings->current_used = 0;
+        codings = new_codings;
+    }
+    codings->current[codings->current_used++] = coding;
 }
 
 CSeqUtil::ECoding
diff --git a/c++/src/util/sequtil/sequtil_convert_imp.hpp b/c++/src/util/sequtil/sequtil_convert_imp.hpp
index 8665bc3..8e3da15 100644
--- a/c++/src/util/sequtil/sequtil_convert_imp.hpp
+++ b/c++/src/util/sequtil/sequtil_convert_imp.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL_SEQUTIL___SEQUTIL_CONVERT_IMP__HPP
 #define UTIL_SEQUTIL___SEQUTIL_CONVERT_IMP__HPP
 
-/*  $Id: sequtil_convert_imp.hpp 343922 2011-11-10 15:31:33Z ucko $
+/*  $Id: sequtil_convert_imp.hpp 495186 2016-03-15 16:38:09Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -251,6 +251,7 @@ private:
               m_Target(dst), m_SrcDensity(GetBasesPerByte(src_coding)),
               m_GapsOK(gaps_ok), m_WideCoding(x_GetWideCoding(src_coding))
             { }
+        ~CPacker();
 
         SIZE_TYPE Pack(const char* src, TSeqPos length);
 
@@ -258,9 +259,27 @@ private:
         void x_AddBoundary(TSeqPos pos, TCoding new_coding);
         static TCoding x_GetWideCoding(const TCoding coding);
 
+        struct SCodings {
+            enum {
+                kBlockSize = 16
+            };
+            TCoding GetLast(void) const { return current[current_used - 1]; }
+            TCoding   current[16 /* kBlockSize */];
+            SCodings* previous;
+            unsigned  current_used;
+        };
         struct SArrangement {
-            vector<TCoding> codings;
-            SIZE_TYPE       cost;
+            SArrangement()
+                : codings(NULL), shared_codings(NULL), cost(0)
+                { }
+            ~SArrangement()
+                { Reset(); }
+            SArrangement& operator= (SArrangement& arr);
+            void Reset(void);
+            void AddCoding(TCoding coding);
+            SCodings* codings;
+            SCodings* shared_codings; // last common ancestor
+            SIZE_TYPE cost;
         };
 
         const TCoding        m_SrcCoding;
diff --git a/c++/src/util/sequtil/sequtil_manip.cpp b/c++/src/util/sequtil/sequtil_manip.cpp
index 4f60ae5..bce6b84 100644
--- a/c++/src/util/sequtil/sequtil_manip.cpp
+++ b/c++/src/util/sequtil/sequtil_manip.cpp
@@ -1,4 +1,4 @@
-/*  $Id: sequtil_manip.cpp 419494 2013-11-26 12:49:50Z bollin $
+/*  $Id: sequtil_manip.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -87,13 +87,13 @@ static SIZE_TYPE s_2naReverse
             *dst = table[static_cast<Uint1>(*iter) * 2 + 1];
             if ( iter != begin ) {
                 --iter;
-                *dst |= table[static_cast<Uint1>(*iter) * 2];
+                *dst |= (char)table[static_cast<Uint1>(*iter) * 2];
             }
         }
     }
 
     // now, take care of the last byte
-    *dst &= (0xFF << ((4 - (length % 4)) % 4) * 2);
+    *dst &= char(0xFF << ((4 - (length % 4)) % 4) * 2);
 
     return length;
 }
@@ -122,7 +122,7 @@ static SIZE_TYPE s_4naReverse
             }
             --dst;
             if ( length % 2 != 0 ) {
-                *dst &= 0xF0;
+                *dst &= (char)0xF0;
             }
         }}
         break;
@@ -131,13 +131,13 @@ static SIZE_TYPE s_4naReverse
         {{
             for ( size_t count = length / 2; count; --count, ++dst ) {
                 --iter;
-                *dst = (static_cast<Uint1>(*iter) & 0xF0) |
-                         (static_cast<Uint1>(*(iter - 1)) & 0x0F);
+                *dst = char((static_cast<Uint1>(*iter) & 0xF0) |
+                            (static_cast<Uint1>(*(iter - 1)) & 0x0F));
             }
 
             if ( length % 2 != 0 ) {
                 --iter;
-                *dst = static_cast<Uint1>(*iter) & 0xF0;
+                *dst = char(static_cast<Uint1>(*iter) & 0xF0);
             }
         }}
         break;
@@ -280,31 +280,31 @@ static SIZE_TYPE s_Ncbi2naComplement
 
     if ( pos % 4 == 0 ) {
         for ( ; iter != end; ++iter, ++dst ) {
-            *dst = ~(*iter);
+            *dst = char(~(*iter));
         }
 
         if ( length % 4 != 0 ) {
-            *(--dst) &= (0xFF << (8 - (length % 4) * 2));
+            *(--dst) &= char(0xFF << (8 - (length % 4) * 2));
         }
     } else {
         const Uint1* table = C2naCmp::GetTable(pos % 4);
 
         for ( size_t count = length / 4;  count; --count, ++dst, ++iter ) {
-            *dst= 
+            *dst= char(
                 table[static_cast<Uint1>(*iter) * 2] |
-                table[static_cast<Uint1>(*(iter + 1)) * 2 + 1];
+                table[static_cast<Uint1>(*(iter + 1)) * 2 + 1] );
         }
 
         // handle the overhang
         if ( length % 4 != 0 ) {
-            *dst = table[static_cast<Uint1>(*iter) * 2];
+            *dst = (char)table[static_cast<Uint1>(*iter) * 2];
             if ( ++iter != end ) {
-                *dst |= table[static_cast<Uint1>(*iter) * 2 + 1];
+                *dst |= (char)table[static_cast<Uint1>(*iter) * 2 + 1];
             }
         }
     }
     // now, take care of the last byte
-    *dst &= (0xFF << ((4 - (length % 4)) % 4) * 2);
+    *dst &= char(0xFF << ((4 - (length % 4)) % 4) * 2);
 
     return length;
 }
@@ -320,7 +320,7 @@ static SIZE_TYPE s_Ncbi2naExpandComplement
     const char* iter = src + pos;
 
     for ( ; iter != end; ++iter, ++dst ) {
-        *dst = 3 - static_cast<Uint1>(*iter);
+        *dst = char(3 - static_cast<Uint1>(*iter));
     }
 
     return length;
@@ -342,11 +342,11 @@ static SIZE_TYPE s_Ncbi4naComplement
     case 0:
         {{
             for ( ; iter != end; ++iter, ++dst ) {
-                *dst = table[static_cast<Uint1>(*iter)];
+                *dst = (char)table[static_cast<Uint1>(*iter)];
             }
 
             if ( length % 2 != 0 ) {
-                *dst &= 0xF0;
+                *dst &= char(0xF0);
             }
         }}
         break;
@@ -354,13 +354,13 @@ static SIZE_TYPE s_Ncbi4naComplement
     case 1:
         {{
             for ( size_t count = length / 2;  count; --count, ++iter, ++dst ) {
-                *dst =
+                *dst = char(
                     table[static_cast<Uint1>(*iter) * 2] |
-                    table[static_cast<Uint1>(*(iter + 1)) * 2 + 1];
+                    table[static_cast<Uint1>(*(iter + 1)) * 2 + 1] );
             }
 
             if ( length % 2 != 0 ) {
-                *dst = table[static_cast<Uint1>(*iter) * 2];
+                *dst = (char)table[static_cast<Uint1>(*iter) * 2];
             }
         }}
         break;
@@ -480,7 +480,7 @@ static SIZE_TYPE s_Ncbi2naRevCmp
             *dst = table[static_cast<Uint1>(*iter) * 2];
             if ( iter != begin ) {
                 --iter;
-                *dst |= table[static_cast<Uint1>(*iter) * 2 + 1];
+                *dst |= (char)table[static_cast<Uint1>(*iter) * 2 + 1];
             }
         }
         break;
@@ -494,7 +494,7 @@ static SIZE_TYPE s_Ncbi2naRevCmp
     }
 
     // zero redundent bits
-    *dst &= (0xFF << ((4 - (length % 4)) % 4) * 2);
+    *dst &= char(0xFF << ((4 - (length % 4)) % 4) * 2);
 
     return length;
 }
@@ -510,7 +510,7 @@ static SIZE_TYPE s_Ncbi2naExpandRevCmp
     const char* iter  = src + pos + length;
 
     for ( ; iter != begin; ++dst ) {
-        *dst = 3 - static_cast<Uint1>(*--iter);
+        *dst = char(3 - static_cast<Uint1>(*--iter));
     }
 
     return length;
@@ -552,7 +552,7 @@ static SIZE_TYPE s_Ncbi4naRevCmp
             }
 
             if ( length % 2 != 0 ) {
-                *dst &= 0xF0;
+                *dst &= char(0xF0);
             }
         }}
         break;
@@ -651,8 +651,8 @@ static SIZE_TYPE s_Ncbi2naExpandRevCmp
     char temp;
 
     for ( ; first <= last; ++first, --last ) {
-        temp = 3 - *first;
-        *first = 3 - *last;
+        temp = char(3 - *first);
+        *first = char(3 - *last);
         *last = temp;
     }
 
diff --git a/c++/src/util/sequtil/sequtil_shared.hpp b/c++/src/util/sequtil/sequtil_shared.hpp
index 4b77854..3ccf355 100644
--- a/c++/src/util/sequtil/sequtil_shared.hpp
+++ b/c++/src/util/sequtil/sequtil_shared.hpp
@@ -1,7 +1,7 @@
 #ifndef UTIL_SEQUTIL___SEQUTIL_SHARED__HPP
 #define UTIL_SEQUTIL___SEQUTIL_SHARED__HPP
 
-/* $Id: sequtil_shared.hpp 343922 2011-11-10 15:31:33Z ucko $
+/* $Id: sequtil_shared.hpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -98,7 +98,7 @@ void AdjustLength(C& container, CSeqUtil::TCoding coding,
     size_t bases_per_byte = GetBasesPerByte(coding);
     
     if ( pos + length > container.size() * bases_per_byte ) {
-        length = container.size() * bases_per_byte - pos;
+        length = (TSeqPos)(container.size() * bases_per_byte - pos);
     }
 }
 
diff --git a/c++/src/util/smalldns.cpp b/c++/src/util/smalldns.cpp
index b8eeece..91a9296 100644
--- a/c++/src/util/smalldns.cpp
+++ b/c++/src/util/smalldns.cpp
@@ -1,4 +1,4 @@
-/*  $Id: smalldns.cpp 403742 2013-06-18 15:26:09Z grichenk $
+/*  $Id: smalldns.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -91,7 +91,7 @@ bool CSmallDNS::IsValidIP(const string& ip)
 {
     list<string> dig;
     
-    NStr::Split(ip, ".", dig);
+    NStr::Split(ip, ".", dig, NStr::fSplit_NoMergeDelims);
     if (dig.size() != 4) {
         return false;
     }
diff --git a/c++/src/util/strbuffer.cpp b/c++/src/util/strbuffer.cpp
index 41ae634..9003e9d 100644
--- a/c++/src/util/strbuffer.cpp
+++ b/c++/src/util/strbuffer.cpp
@@ -1,4 +1,4 @@
-/*  $Id: strbuffer.cpp 465289 2015-04-20 15:17:20Z vasilche $
+/*  $Id: strbuffer.cpp 489095 2016-01-08 13:02:41Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -42,6 +42,7 @@
 
 BEGIN_NCBI_SCOPE
 
+
 static const size_t KInitialBufferSize = 4096;
 
 static inline
@@ -50,6 +51,7 @@ size_t BiggerBufferSize(size_t size) THROWS1_NONE
     return size * 2;
 }
 
+
 CIStreamBuffer::CIStreamBuffer(void)
     THROWS1((bad_alloc))
     : m_Error(0), m_BufferPos(0),
@@ -62,6 +64,7 @@ CIStreamBuffer::CIStreamBuffer(void)
 {
 }
 
+
 CIStreamBuffer::CIStreamBuffer(const char* buffer, size_t size)
     : m_Error(0), m_BufferPos(0),
       m_BufferSize(0), m_Buffer(const_cast<char*>(buffer)),
@@ -73,6 +76,7 @@ CIStreamBuffer::CIStreamBuffer(const char* buffer, size_t size)
 {
 }
 
+
 CIStreamBuffer::~CIStreamBuffer(void)
 {
     try {
@@ -84,6 +88,7 @@ CIStreamBuffer::~CIStreamBuffer(void)
     }
 }
 
+
 void CIStreamBuffer::Open(CByteSourceReader& reader)
 {
     Close();
@@ -95,6 +100,7 @@ void CIStreamBuffer::Open(CByteSourceReader& reader)
     m_Error = 0;
 }
 
+
 void CIStreamBuffer::Open(const char* buffer, size_t size)
 {
     Close();
@@ -108,6 +114,7 @@ void CIStreamBuffer::Open(const char* buffer, size_t size)
     m_Error = 0;
 }
 
+
 void CIStreamBuffer::Close(void)
 {
     if ( m_Input ) {
@@ -124,11 +131,13 @@ void CIStreamBuffer::Close(void)
     m_Error = 0;
 }
 
+
 void CIStreamBuffer::SetCanceledCallback(const ICanceled* canceled_callback)
 {
     m_CanceledCallback = canceled_callback;
 }
 
+
 size_t CIStreamBuffer::SetBufferLock(size_t size)
 {
     _ASSERT(size > 0);
@@ -137,6 +146,7 @@ size_t CIStreamBuffer::SetBufferLock(size_t size)
     return pos;
 }
 
+
 void CIStreamBuffer::ResetBufferLock(size_t pos)
 {
     _ASSERT(m_Buffer+pos <= m_CurrentPos);
@@ -144,6 +154,7 @@ void CIStreamBuffer::ResetBufferLock(size_t pos)
     m_CurrentPos = m_Buffer+pos;
 }
 
+
 void CIStreamBuffer::StartSubSource(void)
 {
     if ( m_Collector ) {
@@ -164,6 +175,7 @@ void CIStreamBuffer::StartSubSource(void)
     }
 }
 
+
 CRef<CByteSource> CIStreamBuffer::EndSubSource(void)
 {
     _ASSERT(m_Collector);
@@ -189,6 +201,7 @@ CRef<CByteSource> CIStreamBuffer::EndSubSource(void)
     return source;
 }
 
+
 // this method is highly optimized
 char CIStreamBuffer::SkipSpaces(void)
     THROWS1((CIOException))
@@ -232,6 +245,7 @@ char CIStreamBuffer::SkipSpaces(void)
     }
 }
 
+
 // this method is highly optimized
 void CIStreamBuffer::FindChar(char c)
     THROWS1((CIOException))
@@ -266,6 +280,7 @@ void CIStreamBuffer::FindChar(char c)
     }
 }
 
+
 // this method is highly optimized
 size_t CIStreamBuffer::PeekFindChar(char c, size_t limit)
     THROWS1((CIOException))
@@ -283,6 +298,7 @@ size_t CIStreamBuffer::PeekFindChar(char c, size_t limit)
     return limit;
 }
 
+
 bool CIStreamBuffer::TrySetCurrentPos(const char* pos)
 {
     if (m_BufferPos == 0 && pos >= m_Buffer && pos <= m_DataEndPos) {
@@ -292,6 +308,7 @@ bool CIStreamBuffer::TrySetCurrentPos(const char* pos)
     return false;
 }
 
+
 const char* CIStreamBuffer::FillBuffer(const char* pos, bool noEOF)
     THROWS1((CIOException, bad_alloc))
 {
@@ -407,6 +424,7 @@ const char* CIStreamBuffer::FillBuffer(const char* pos, bool noEOF)
     return pos;
 }
 
+
 char CIStreamBuffer::FillBufferNoEOF(const char* pos)
 {
     pos = FillBuffer(pos, true);
@@ -416,11 +434,13 @@ char CIStreamBuffer::FillBufferNoEOF(const char* pos)
         return *pos;
 }
 
+
 bool CIStreamBuffer::TryToFillBuffer(void)
 {
     return FillBuffer(m_CurrentPos, true) < m_DataEndPos;
 }
 
+
 void CIStreamBuffer::GetChars(char* buffer, size_t count)
     THROWS1((CIOException))
 {
@@ -444,6 +464,7 @@ void CIStreamBuffer::GetChars(char* buffer, size_t count)
     }
 }
 
+
 void CIStreamBuffer::GetChars(string& str, size_t count)
     THROWS1((CIOException))
 {
@@ -473,6 +494,7 @@ void CIStreamBuffer::GetChars(string& str, size_t count)
     }
 }
 
+
 void CIStreamBuffer::SkipEndOfLine(char lastChar)
     THROWS1((CIOException))
 {
@@ -486,6 +508,7 @@ void CIStreamBuffer::SkipEndOfLine(char lastChar)
         SkipChar();
 }
 
+
 size_t CIStreamBuffer::ReadLine(char* buff, size_t size)
     THROWS1((CIOException))
 {
@@ -515,6 +538,7 @@ size_t CIStreamBuffer::ReadLine(char* buff, size_t size)
     }
 }
 
+
 void CIStreamBuffer::BadNumber(void)
     THROWS1((CUtilException))
 {
@@ -523,6 +547,7 @@ void CIStreamBuffer::BadNumber(void)
                    "bad number in line " << GetLine());
 }
 
+
 void CIStreamBuffer::NumberOverflow(void)
     THROWS1((CUtilException))
 {
@@ -531,11 +556,13 @@ void CIStreamBuffer::NumberOverflow(void)
                    "number overflow in line " << GetLine());
 }
 
+
 void CIStreamBuffer::SetStreamOffset(CNcbiStreampos pos)
 {
     SetStreamPos(pos);
 }
 
+
 void CIStreamBuffer::SetStreamPos(CNcbiStreampos pos)
 {
     if ( m_Input ) {
@@ -555,6 +582,7 @@ void CIStreamBuffer::SetStreamPos(CNcbiStreampos pos)
     }
 }
 
+
 char CIStreamBuffer::SkipWs(void)
 {
     char c;
@@ -563,6 +591,7 @@ char CIStreamBuffer::SkipWs(void)
     return c;
 }
 
+
 Int4 CIStreamBuffer::GetInt4(void)
     THROWS1((CIOException,CUtilException))
 {
@@ -591,8 +620,8 @@ Int4 CIStreamBuffer::GetInt4(void)
     const Uint1 kMaxLimitAdd = Uint1(kMax_I4%10 + sign);
     
     for ( ;; ) {
-        Uint1 d = PeekCharNoEOF() - '0';
-        if  ( d > 9 )
+        Uint1 d = (Uint1)(PeekCharNoEOF() - '0');
+        if ( d > 9 )
             break;
         SkipChar();
         
@@ -608,6 +637,7 @@ Int4 CIStreamBuffer::GetInt4(void)
         return n;
 }
 
+
 Uint4 CIStreamBuffer::GetUint4(void)
     THROWS1((CIOException,CUtilException))
 {
@@ -624,7 +654,7 @@ Uint4 CIStreamBuffer::GetUint4(void)
     const Uint1 kMaxLimitAdd = Uint1(kMax_UI4%10);
     
     for ( ;; ) {
-        Uint1 d = PeekCharNoEOF() - '0';
+        Uint1 d = (Uint1)(PeekCharNoEOF() - '0');
         if  ( d > 9 )
             break;
         SkipChar();
@@ -638,6 +668,7 @@ Uint4 CIStreamBuffer::GetUint4(void)
     return n;
 }
 
+
 Int8 CIStreamBuffer::GetInt8(void)
     THROWS1((CIOException,CUtilException))
 {
@@ -666,8 +697,8 @@ Int8 CIStreamBuffer::GetInt8(void)
     const Uint1 kMaxLimitAdd = Uint1(kMax_I8%10 + sign);
 
     for ( ;; ) {
-        Uint1 d = PeekCharNoEOF() - '0';
-        if  ( d > 9 )
+        Uint1 d = (Uint1)(PeekCharNoEOF() - '0');
+        if ( d > 9 )
             break;
         SkipChar();
 
@@ -683,13 +714,14 @@ Int8 CIStreamBuffer::GetInt8(void)
         return n;
 }
 
+
 Uint8 CIStreamBuffer::GetUint8(void)
     THROWS1((CIOException))
 {
     char c = SkipWs();
     if ( c == '+' )
         c = GetChar();
-    Uint1 d = c - '0';
+    Uint1 d = (Uint1)(c - '0');
     if ( d > 9 )
         BadNumber();
     
@@ -699,8 +731,8 @@ Uint8 CIStreamBuffer::GetUint8(void)
     const Uint8 kMaxBeforeMul = kMax_UI8/10;
     
     for ( ;; ) {
-        d = PeekCharNoEOF() - '0';
-        if  ( d > 9 )
+        d = (Uint1)(PeekCharNoEOF() - '0');
+        if ( d > 9 )
             break;
         SkipChar();
 
@@ -716,6 +748,7 @@ Uint8 CIStreamBuffer::GetUint8(void)
     return n;
 }
 
+
 COStreamBuffer::COStreamBuffer(CNcbiOstream& out, bool deleteOut)
     THROWS1((bad_alloc))
     : m_Output(out), m_DeleteOutput(deleteOut), m_Error(0),
@@ -729,6 +762,7 @@ COStreamBuffer::COStreamBuffer(CNcbiOstream& out, bool deleteOut)
 {
 }
 
+
 COStreamBuffer::~COStreamBuffer(void)
 {
     try {
@@ -745,6 +779,7 @@ COStreamBuffer::~COStreamBuffer(void)
     delete[] m_Buffer;
 }
 
+
 BEGIN_LOCAL_NAMESPACE;
 
 struct STemporarilyClearStreamState
@@ -787,11 +822,13 @@ void COStreamBuffer::Close(void)
     m_LineLength = 0;
 }
 
+
 void COStreamBuffer::SetCanceledCallback(const ICanceled* callback)
 {
     m_CanceledCallback = callback;
 }
 
+
 void COStreamBuffer::FlushBuffer(bool fullBuffer)
     THROWS1((CIOException))
 {
@@ -871,6 +908,7 @@ char* COStreamBuffer::DoReserve(size_t count)
     return m_CurrentPos;
 }
 
+
 void COStreamBuffer::PutInt4(Int4 v)
     THROWS1((CIOException, bad_alloc))
 {
@@ -883,7 +921,7 @@ void COStreamBuffer::PutInt4(Int4 v)
     char* pos = b + BSIZE;
     do {
         Int4 a = '0'+n;
-        *--pos = a-10*(n/=Uint4(10));
+        *--pos = char(a-10*(n/=Uint4(10)));
     } while ( n );
     if ( v < 0 ) {
         *--pos = '-';
@@ -895,6 +933,7 @@ void COStreamBuffer::PutInt4(Int4 v)
     }
 }
 
+
 void COStreamBuffer::PutUint4(Uint4 v)
     THROWS1((CIOException, bad_alloc))
 {
@@ -904,7 +943,7 @@ void COStreamBuffer::PutUint4(Uint4 v)
     char* pos = b + BSIZE;
     do {
         Uint4 a = '0'+n;
-        *--pos = a-10*(n/=Uint4(10));
+        *--pos = char(a-10*(n/=Uint4(10)));
     } while ( n );
     int len = (int)(b + BSIZE - pos);
     char* dst = Skip(len);
@@ -913,6 +952,7 @@ void COStreamBuffer::PutUint4(Uint4 v)
     }
 }
 
+
 // On some platforms division of Int8 is very slow,
 // so will try to optimize it working with chunks.
 // Works only for radix base == 10.
@@ -938,14 +978,14 @@ void COStreamBuffer::PutInt8(Int8 v)
         char* end = pos - PRINT_INT8_CHUNK_SIZE;
         do {
             Uint4 a = '0'+m;
-            *--pos = a-10*(m/=10);
+            *--pos = char(a-10*(m/=10));
         } while ( pos != end );
     }
     // process all remaining digits in 32-bit number
     Uint4 m = Uint4(n);
     do {
         Uint4 a = '0'+m;
-        *--pos = a-10*(m/=10);
+        *--pos = char(a-10*(m/=10));
     } while ( m );
 #else
     do {
@@ -963,6 +1003,7 @@ void COStreamBuffer::PutInt8(Int8 v)
     }
 }
 
+
 void COStreamBuffer::PutUint8(Uint8 v)
     THROWS1((CIOException, bad_alloc))
 {
@@ -978,14 +1019,14 @@ void COStreamBuffer::PutUint8(Uint8 v)
         char* end = pos - PRINT_INT8_CHUNK_SIZE;
         do {
             Uint4 a = '0'+m;
-            *--pos = a-10*(m/=10);
+            *--pos = char(a-10*(m/=10));
         } while ( pos != end );
     }
     // process all remaining digits in 32-bit number
     Uint4 m = Uint4(n);
     do {
         Uint4 a = '0'+m;
-        *--pos = a-10*(m/=10);
+        *--pos = char(a-10*(m/=10));
     } while ( m );
 #else
     do {
@@ -1000,6 +1041,7 @@ void COStreamBuffer::PutUint8(Uint8 v)
     }
 }
 
+
 void COStreamBuffer::PutEolAtWordEnd(size_t lineLength)
     THROWS1((CIOException, bad_alloc))
 {
@@ -1058,6 +1100,7 @@ void COStreamBuffer::PutEolAtWordEnd(size_t lineLength)
     ++m_Line;
 }
 
+
 void COStreamBuffer::Write(const char* data, size_t dataLength)
     THROWS1((CIOException, bad_alloc))
 {
@@ -1078,6 +1121,7 @@ void COStreamBuffer::Write(const char* data, size_t dataLength)
     m_CurrentPos += dataLength;
 }
 
+
 void COStreamBuffer::Write(CByteSourceReader& reader)
     THROWS1((CIOException, bad_alloc))
 {
diff --git a/c++/src/util/stream_source.cpp b/c++/src/util/stream_source.cpp
new file mode 100644
index 0000000..5aa2547
--- /dev/null
+++ b/c++/src/util/stream_source.cpp
@@ -0,0 +1,394 @@
+/*  $Id: stream_source.cpp 497775 2016-04-11 11:26:07Z mozese2 $
+ * ===========================================================================
+ *
+ *                            PUBLIC DOMAIN NOTICE
+ *               National Center for Biotechnology Information
+ *
+ *  This software/database is a "United States Government Work" under the
+ *  terms of the United States Copyright Act.  It was written as part of
+ *  the author's official duties as a United States Government employee and
+ *  thus cannot be copyrighted.  This software/database is freely available
+ *  to the public for use. The National Library of Medicine and the U.S.
+ *  Government have not placed any restriction on its use or reproduction.
+ *
+ *  Although all reasonable efforts have been taken to ensure the accuracy
+ *  and reliability of the software and data, the NLM and the U.S.
+ *  Government do not and cannot warrant the performance or results that
+ *  may be obtained by using this software or data. The NLM and the U.S.
+ *  Government disclaim all warranties, express or implied, including
+ *  warranties of performance, merchantability or fitness for any particular
+ *  purpose.
+ *
+ *  Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ *
+ * Authors:  Mike DiCuccio
+ *
+ * File Description:
+ *
+ */
+
+#include <ncbi_pch.hpp>
+#include <corelib/ncbifile.hpp>
+#include <util/file_manifest.hpp>
+#include <util/stream_source.hpp>
+
+BEGIN_NCBI_SCOPE
+
+static set<string> s_InputStreamSourcePrefixes;
+
+void CInputStreamSource::SetStandardInputArgs(CArgDescriptions& arg_desc,
+                                              const string &prefix,
+                                              const string &description,
+                                              bool is_mandatory)
+{
+    arg_desc.SetCurrentGroup("Input Options for " + prefix);
+    if (prefix == "input") {
+        arg_desc.AddDefaultKey("input", "InputFile",
+                               "Stream of " + description,
+                               CArgDescriptions::eInputFile,
+                               "-");
+        arg_desc.AddAlias("i", "input");
+    } else {
+        if (is_mandatory) {
+            arg_desc.AddKey(prefix, "InputFile",
+                            "Stream of " + description,
+                            CArgDescriptions::eInputFile);
+        }
+        else {
+            arg_desc.AddOptionalKey(prefix, "InputFile",
+                                    "Stream of " + description,
+                                    CArgDescriptions::eInputFile);
+        }
+    }
+
+    arg_desc.AddOptionalKey(prefix + "-path", "InputPath",
+                            "Path to " + description,
+                            CArgDescriptions::eString);
+    arg_desc.AddOptionalKey(prefix + "-mask", "FileMask",
+                            "File pattern to search for " + description,
+                            CArgDescriptions::eString);
+    arg_desc.SetDependency(prefix + "-mask",
+                           CArgDescriptions::eRequires,
+                           prefix + "-path");
+
+    arg_desc.AddOptionalKey(prefix + "-manifest", "InputFile",
+                            "File containing a list of files containing " + description,
+                            CArgDescriptions::eInputFile);
+
+    arg_desc.SetDependency(prefix,
+                           CArgDescriptions::eExcludes,
+                           prefix + "-manifest");
+
+    arg_desc.SetDependency(prefix,
+                           CArgDescriptions::eExcludes,
+                           prefix + "-path");
+
+    arg_desc.SetDependency(prefix + "-manifest",
+                           CArgDescriptions::eExcludes,
+                           prefix + "-path");
+
+    if (prefix == "input") {
+        arg_desc.AddAlias("I", "input-manifest");
+    }
+
+    s_InputStreamSourcePrefixes.insert(prefix);
+}
+
+vector<string> CInputStreamSource::RecreateInputArgs(const CArgs& args, const string &prefix)
+{
+    vector<string> result;
+    if (args[prefix + "-path"].HasValue()) {
+        result.push_back("-" + prefix + "-path");
+        result.push_back(args[prefix + "-path"].AsString());
+        if (args[prefix + "-mask"]) {
+            result.push_back("-" + prefix + "-mask");
+            result.push_back(args[prefix + "-mask"].AsString());
+        }
+    }
+    else if (args[prefix + "-manifest"].HasValue()) {
+        result.push_back("-" + prefix + "-manifest");
+        result.push_back(args[prefix + "-manifest"].AsString());
+    }
+    else {
+        result.push_back("-" + prefix);
+        result.push_back(args[prefix].AsString());
+    }
+    return result;
+}
+
+bool CInputStreamSource::HaveArgsForPrefix(const string &prefix)
+{
+    return s_InputStreamSourcePrefixes.count(prefix);
+}
+
+CInputStreamSource::CInputStreamSource()
+    : m_Istr(NULL), m_CurrIndex(0)
+{
+}
+
+
+CInputStreamSource::CInputStreamSource(const CArgs& args, const string& prefix)
+    : m_Istr(NULL), m_CurrIndex(0)
+{
+    InitArgs(args, prefix);
+}
+
+void CInputStreamSource::InitArgs(const CArgs& args, const string &prefix)
+{
+    m_Args.Assign(args);
+    m_Prefix = prefix;
+
+    if (m_Args[prefix + "-path"].HasValue()) {
+        string path = m_Args[prefix + "-path"].AsString();
+        string mask;
+        if (m_Args[prefix + "-mask"]) {
+            mask = m_Args[prefix + "-mask"].AsString();
+        }
+        InitFilesInDirSubtree(path, mask);
+    }
+    else if (m_Args[prefix + "-manifest"].HasValue()) {
+        InitManifest(m_Args[prefix + "-manifest"].AsString());
+    }
+    else if (m_Args[prefix].HasValue() && m_Args[prefix].AsString() == "-") {
+        /// NOTE: this is ignored if either -input-path or -input-mask is
+        /// provided
+        InitStream(m_Args[prefix].AsInputFile(), m_Args[prefix].AsString());
+    }
+    else if (m_Args[prefix].HasValue()) {
+        /// Input file; init as input file, so it can be opened multiple times
+        InitFile(m_Args[prefix].AsString());
+    }
+}
+
+
+/// Initialize from a given stream which is the sole content.
+/// As precondition, expect that the stream is in a good condition
+/// prior to being handed off to consumers.
+///
+void CInputStreamSource::InitStream(CNcbiIstream& istr, const string& fname)
+{
+    if (m_Istr  ||  m_CurrIndex < m_Files.size()) {
+        NCBI_THROW(CException, eUnknown,
+                   "CInputStreamSource::InitManifest(): "
+                   "attempt to init already initted class");
+    }
+    if (! istr) {
+        NCBI_THROW(CException, eUnknown,
+                   "CInputStreamSource::InitStream(): "
+                   "stream is bad");
+    }
+    m_Files.clear();
+    m_Istr = &istr;
+    m_CurrFile = fname;
+    m_CurrIndex = 0;
+}
+
+
+/// Initialize from a single file path.
+///
+void CInputStreamSource::InitFile(const string& file_path)
+{
+    if (m_Istr  ||  m_CurrIndex < m_Files.size()) {
+        NCBI_THROW(CException, eUnknown,
+                   "CInputStreamSource::InitFile(): "
+                   "attempt to init already initted class");
+    }
+
+    /**
+     * commented out: this breaks stream processing
+    if ( !CFile(file_path).Exists() ) {
+        NCBI_THROW(CException, eUnknown,
+                   "input file " + file_path + " does not exist");
+    }
+    **/
+
+    m_Files.clear();
+    m_Files.push_back(file_path);
+    Rewind();
+}
+
+
+/// Initialize from a manifest file.
+///
+/// @see CFileManifest
+void CInputStreamSource::InitManifest(const string& manifest)
+{
+    if (m_Istr  || m_CurrIndex < m_Files.size()) {
+        NCBI_THROW(CException, eUnknown,
+                   "CInputStreamSource::InitManifest(): "
+                   "attempt to init already initted class");
+    }
+
+    m_Files.clear();
+    CFileManifest src(manifest);
+    vector<string> all(src.GetAllFilePaths());
+    std::copy( all.begin(), all.end(), std::back_inserter(m_Files));
+
+    _TRACE("Added " << m_Files.size() << " files from input manifest");
+
+    Rewind();
+}
+
+
+/// Initialize from a file search path
+///
+void CInputStreamSource::InitFilesInDirSubtree(const string& file_path,
+                                               const string& file_mask)
+{
+    if (m_Istr  ||  m_CurrIndex < m_Files.size()) {
+        NCBI_THROW(CException, eUnknown,
+                   "CInputStreamSource::InitFilesInDirSubtree(): "
+                   "atemmpt to init already initted class");
+    }
+
+    CDir d(file_path);
+    if ( !d.Exists() ) {
+        NCBI_THROW(CException, eUnknown,
+                   "input directory " + file_path + " does not exist");
+    }
+
+    vector<string> paths;
+    paths.push_back(file_path);
+
+    vector<string> masks;
+    if ( !file_mask.empty() ) {
+        masks.push_back(file_mask);
+    } else {
+        masks.push_back("*");
+    }
+
+    m_Files.clear();
+    FindFiles(m_Files,
+              paths.begin(), paths.end(),
+              masks.begin(), masks.end(),
+              fFF_File | fFF_Recursive);
+    _TRACE("Added " << m_Files.size() << " files from input path");
+
+    Rewind();
+}
+
+
+CNcbiIstream& CInputStreamSource::GetStream(string* fname)
+{
+    if (m_Istr) {
+        if (fname) {
+            *fname = m_CurrFile;
+        }
+        return *m_Istr;
+    }
+
+    if (m_IstrOwned.get()) {
+        if (fname) {
+            *fname = m_CurrFile;
+        }
+        return *m_IstrOwned;
+    }
+
+    NCBI_THROW(CException, eUnknown, "All input streams consumed");
+}
+
+CNcbiIstream& CInputStreamSource::GetStream(void)
+{
+    if (m_Istr) {
+        return *m_Istr;
+    }
+
+    if (m_IstrOwned.get()) {
+        return *m_IstrOwned;
+    }
+
+    NCBI_THROW(CException, eUnknown, "All input streams consumed");
+}
+
+
+CNcbiIstream& CInputStreamSource::operator*()
+{
+    return GetStream();
+}
+
+
+CInputStreamSource& CInputStreamSource::operator++()
+{
+    // The next stream can be held in either of two places. Clear both.
+
+    // Clear first place.
+    if (m_Istr) {
+        if (m_Istr->bad()) {
+            // Check that the stream, at the end, didn't go bad as might
+            // happen if there was a disk read error. On the other hand,
+            // ok if it has failbit set so ignore that, e.g. getline sets
+            // failbit at the last line, if it has a teminator.
+            NCBI_THROW(CException, eUnknown,
+                       "CInputStreamSource::operator++(): "
+                       "Unknown error in input stream, "
+                       "which is in a bad state after use");
+        }
+        m_Istr = NULL;
+    }
+
+    // Clear second place.
+    if (m_IstrOwned.get()) {
+        if (m_IstrOwned->bad()) {
+            // Samecheck  as for m_Istr.
+            string msg("CInputStreamSource::operator++(): "
+                       "Unknown error reading file, "
+                       "which is in a bad state after use: ");
+            NCBI_THROW(CException, eUnknown, msg + m_CurrFile);
+        }
+        m_IstrOwned.reset();
+    }
+
+    // The current filename currently applies to only the first source,
+    // but someday might apply to others, so clear it here rather than
+    // inside the above conditionals.
+    m_CurrFile.erase();
+
+    // Advance to the next stream, if there is any.
+    if (m_CurrIndex < m_Files.size()) {
+        m_CurrFile = m_Files[m_CurrIndex++];
+        m_IstrOwned.reset(new CNcbiIfstream(m_CurrFile.c_str()));
+        if (m_IstrOwned->fail()) {
+            // Do not provide to clients with streams that are already
+            // known not to be good (fail, meaning badbit or failbit).
+            string msg("CInputStreamSource::operator++(): "
+                       "File is not accessible: ");
+            NCBI_THROW(CException, eUnknown, msg + m_CurrFile);
+        }
+    }
+    return *this;
+}
+
+CInputStreamSource& CInputStreamSource::Rewind(void)
+{
+    m_CurrIndex = 0;
+    ++(*this);
+    return *this;
+}
+
+string CInputStreamSource::GetCurrentFileName(void) const
+{
+    return m_CurrFile;
+}
+
+size_t CInputStreamSource::GetCurrentStreamIndex(size_t* count) const
+{
+    if (count) {
+        *count = m_Files.size();
+    }
+    return m_CurrIndex;
+}
+
+CInputStreamSource::operator bool()
+{
+    // The stream contains data if it references a stream (given on input)
+    // owns a stream (extracted from a manifest), or still has a non-empty
+    // queued list of files.
+    return (m_Istr  ||  m_IstrOwned.get()  ||  m_CurrIndex < m_Files.size());
+}
+
+
+
+END_NCBI_SCOPE
+
diff --git a/c++/src/util/strsearch.cpp b/c++/src/util/strsearch.cpp
index c726488..f64a590 100644
--- a/c++/src/util/strsearch.cpp
+++ b/c++/src/util/strsearch.cpp
@@ -1,4 +1,4 @@
-/*  $Id: strsearch.cpp 462120 2015-03-16 18:27:48Z vasilche $
+/*  $Id: strsearch.cpp 489095 2016-01-08 13:02:41Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -96,7 +96,7 @@ void CBoyerMooreMatcher::SetWordDelimiters(const string& word_delimeters,
 
     // Init the word delimiting alphabet
     for (int i = 0; i < sm_AlphabetSize; ++i) {
-        char ch = m_CaseSensitive ? i : toupper((unsigned char) i);
+        char ch = (char)(m_CaseSensitive ? i : toupper((unsigned char)i));
         string::size_type n = word_d.find_first_of(ch);
         m_WordDelimiters[i] = (!invert_delimiters) == (n != string::npos);
     }
@@ -114,7 +114,7 @@ void CBoyerMooreMatcher::AddDelimiters(const string& word_delimeters)
     }
 
     for (int i = 0; i < sm_AlphabetSize; ++i) {
-        char ch = m_CaseSensitive ? i : toupper((unsigned char) i);
+        char ch = (char)(m_CaseSensitive ? i : toupper((unsigned char)i));
         string::size_type n = word_d.find_first_of(ch);
         if (n != NPOS) {
             m_WordDelimiters[i] = true;
@@ -141,7 +141,7 @@ void CBoyerMooreMatcher::InitCommonDelimiters()
     }
 
     for (int i = 0; i < sm_AlphabetSize; ++i) {
-        char ch = m_CaseSensitive ? i : toupper((unsigned char) i);
+        char ch = (char)(m_CaseSensitive ? i : toupper((unsigned char)i));
         if ((ch >= 'A' && ch <= 'Z') ||
             (ch >= '0' && ch <= '9') ||
             (ch == '_')){
diff --git a/c++/src/util/table_printer.cpp b/c++/src/util/table_printer.cpp
index 4106709..455634e 100644
--- a/c++/src/util/table_printer.cpp
+++ b/c++/src/util/table_printer.cpp
@@ -1,4 +1,4 @@
-/*  $Id: table_printer.cpp 406601 2013-07-15 11:23:57Z kornbluh $
+/*  $Id: table_printer.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -64,7 +64,7 @@ CTablePrinter::CTablePrinter(
         SColInfoVec::TColInfoVec, col_it, m_vecColInfo.m_colInfoVec) 
     {
         col_it->m_iColWidth =
-            max<Uint4>(col_it->m_iColWidth, col_it->m_sColName.length());
+            max<Uint4>(col_it->m_iColWidth, (Uint4)col_it->m_sColName.length());
     }
 }
 
@@ -131,8 +131,9 @@ void CTablePrinter::x_AddCellValue(
         // handle a cell value that's too long
         switch(colInfo.m_eDataTooLong) {
         case eDataTooLong_ShowErrorInColumn: {
-            const static string kErrMsg = "**ERROR**";
-            if( colInfo.m_iColWidth >= kErrMsg.length() ) {
+            static const char kErrMsg[] = "**ERROR**";
+            static const size_t kErrMsgLen = sizeof(kErrMsg) - 1;
+            if( colInfo.m_iColWidth >= kErrMsgLen ) {
                 m_ostrm << kErrMsg;
             } else {
                 m_ostrm << string(colInfo.m_iColWidth, '?');
diff --git a/c++/src/util/tables/raw_scoremat.c b/c++/src/util/tables/raw_scoremat.c
index 757a8c1..493abbe 100644
--- a/c++/src/util/tables/raw_scoremat.c
+++ b/c++/src/util/tables/raw_scoremat.c
@@ -1,4 +1,4 @@
-/*  $Id: raw_scoremat.c 458581 2015-02-06 15:18:12Z boratyng $
+/*  $Id: raw_scoremat.c 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -60,7 +60,7 @@ int NCBISM_GetIndex(const SNCBIPackedScoreMatrix* sm, int aa)
     }
 
     p = strchr(sm->symbols, aa);
-    return p ? p - sm->symbols : -1;
+    return p ? (int)(p - sm->symbols) : -1;
 }
 
 
@@ -71,7 +71,7 @@ TNCBIScore NCBISM_GetScore(const SNCBIPackedScoreMatrix* sm,
     i1 = NCBISM_GetIndex(sm, aa1);
     i2 = NCBISM_GetIndex(sm, aa2);
     if (i1 >=0  &&  i2 >= 0) {
-        return sm->scores[i1 * strlen(sm->symbols) + i2];
+        return sm->scores[(size_t)i1 * strlen(sm->symbols) + (size_t)i2];
     } else {
         return sm->defscore;
     }
@@ -85,7 +85,7 @@ void NCBISM_Unpack(const SNCBIPackedScoreMatrix* psm,
     int         dim, i, j, aa1, aa2;
 
     sym = psm->symbols;
-    dim = strlen(sym);
+    dim = (int)strlen(sym);
     /* fill with default */
     memset(&fsm->s, psm->defscore, NCBI_FSM_DIM * NCBI_FSM_DIM);
     for (i = 0;  i < dim;  ++i) {
diff --git a/c++/src/util/thread_pool.cpp b/c++/src/util/thread_pool.cpp
index d49976a..90d7102 100644
--- a/c++/src/util/thread_pool.cpp
+++ b/c++/src/util/thread_pool.cpp
@@ -1,4 +1,4 @@
-/*  $Id: thread_pool.cpp 413109 2013-09-12 14:32:15Z vakatov $
+/*  $Id: thread_pool.cpp 497872 2016-04-11 18:27:29Z ivanov $
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
@@ -788,7 +788,9 @@ CThreadPool_Impl::TaskFinished(void)
 {
     m_ExecutingTasks.Add(-1);
     m_TotalTasks.Add(-1);
-    m_RoomWait.Post();
+    if ( !m_IsQueueAllowed ) {
+        m_RoomWait.Post();
+    }
     CallControllerOther();
 }
 
@@ -1086,8 +1088,10 @@ CThreadPool_ServiceThread::x_Idle(void)
     m_Pool->CallController(CThreadPool_Controller::eOther);
 
     CTimeSpan timeout = m_Pool->GetSafeSleepTime();
-    m_IdleTrigger.TryWait(timeout.GetCompleteSeconds(),
-                          timeout.GetNanoSecondsAfterSecond());
+    // TODO: it would be better to use CTimeout for all timeouts
+    _ASSERT(timeout.GetSign() != eNegative);
+    m_IdleTrigger.TryWait((unsigned int)timeout.GetCompleteSeconds(),
+                          (unsigned int)timeout.GetNanoSecondsAfterSecond());
 }
 
 inline void
@@ -1347,12 +1351,16 @@ CThreadPool_ThreadImpl::Main(void)
                 x_TaskFinished(status);
             }
             catch (exception& e) {
-                ERR_POST_X(7, "Exception from task in ThreadPool: "
-                              << e.what());
-                x_TaskFinished(CThreadPool_Task::eFailed);
+                ERR_POST_X(7, "Exception from task in ThreadPool: " << e);
+                if (m_CurrentTask.NotEmpty()) {
+                    x_TaskFinished(CThreadPool_Task::eFailed);
+                }
             }
             catch (...) {
-                x_TaskFinished(CThreadPool_Task::eFailed);
+                ERR_POST_X(7, "Non-standard exception from task in ThreadPool");
+                if (m_CurrentTask.NotEmpty()) {
+                    x_TaskFinished(CThreadPool_Task::eFailed);
+                }
                 throw;
             }
         }
@@ -1601,19 +1609,21 @@ CThreadPool_Impl::x_WaitForPredicate(TWaitPredicate      wait_func,
                                      const CTimeSpan*    timeout,
                                      const CStopWatch*   timer)
 {
-    while (!(this->*wait_func)()) {
+    bool done = (this->*wait_func)();
+    if (done) {
+        wait_sema->TryWait();
+        return true;
+    }
+
+    while ( !done ) {
         pool_guard->Release();
 
         if (timeout) {
-            CTimeSpan next_tm =
-                CTimeSpan(timeout->GetAsDouble() - timer->Elapsed());
+            CTimeSpan next_tm = CTimeSpan(timeout->GetAsDouble() - timer->Elapsed());
             if (next_tm.GetSign() == eNegative) {
                 return false;
             }
-
-            if (! wait_sema->TryWait(next_tm.GetCompleteSeconds(),
-                                     next_tm.GetNanoSecondsAfterSecond()))
-            {
+            if (! wait_sema->TryWait(CTimeout(next_tm))) {
                 return false;
             }
         }
@@ -1622,6 +1632,7 @@ CThreadPool_Impl::x_WaitForPredicate(TWaitPredicate      wait_func,
         }
 
         pool_guard->Guard();
+        done = (this->*wait_func)();
     }
 
     return true;
diff --git a/c++/src/util/transmissionrw.cpp b/c++/src/util/transmissionrw.cpp
index ef4a9bc..4adcb81 100644
--- a/c++/src/util/transmissionrw.cpp
+++ b/c++/src/util/transmissionrw.cpp
@@ -1,4 +1,4 @@
-/*  $Id: transmissionrw.cpp 208686 2010-10-20 12:11:04Z kazimird $
+/*  $Id: transmissionrw.cpp 477239 2015-08-27 15:35:49Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -46,7 +46,8 @@ CTransmissionWriter::CTransmissionWriter(IWriter* wrt,
                                          ESendEofPacket send_eof)
     : m_Wrt(wrt),
       m_OwnWrt(own_writer),
-      m_SendEof(send_eof)
+      m_SendEof(send_eof),
+      m_PacketBytesToWrite(0)
 {
     _ASSERT(wrt);
 
@@ -62,14 +63,14 @@ namespace {
 class CIOBytesCountGuard 
 {
 public:
-    CIOBytesCountGuard(size_t* ret, const size_t& count)
-        : m_Ret(ret), m_Count(count) 
+    size_t count;
+    CIOBytesCountGuard(size_t* ret)
+        : count(0), m_Ret(ret)
     {}
 
-    ~CIOBytesCountGuard() { if (m_Ret) *m_Ret = m_Count; }
+    ~CIOBytesCountGuard() { if (m_Ret) *m_Ret = count; }
 private:
     size_t* m_Ret;
-    const size_t& m_Count;
 };
 } // namespace
 
@@ -77,51 +78,26 @@ ERW_Result CTransmissionWriter::Write(const void* buf,
                                       size_t      count,
                                       size_t*     bytes_written)
 {
-    size_t wrt_count = 0;
-    CIOBytesCountGuard guard(bytes_written, wrt_count);
+    CIOBytesCountGuard wrt(bytes_written);
 
-    if (count < sEndPacket)
-        return x_WritePacket(buf, count, wrt_count);
-
-    // The buffer cannot fit in one packet -- split it.
-    const size_t split_packet_size = (size_t) 0x80008000LU;
-
-    const char* ptr = (const char*) buf;
-    size_t remaining = count;
-
-    do {
-        size_t written;
-        ERW_Result res = x_WritePacket(ptr, remaining < split_packet_size ?
-            remaining : split_packet_size, written);
-        if (res != eRW_Success)
-            return res;
-        ptr += written;
-        wrt_count += written;
-        remaining -= written;
-    } while (remaining > 0);
-
-    return eRW_Success;
-}
+    if (count >= sEndPacket) {
+        // The buffer cannot fit in one packet -- split it.
+        count = (size_t) 0x80008000LU;
+    }
 
-ERW_Result CTransmissionWriter::x_WritePacket(const void* buf,
-                                              size_t      count,
-                                              size_t&     bytes_written)
-{
-    bytes_written = 0;
-    Uint4 cnt = (Uint4) count;
-    size_t written = 0;
-    ERW_Result res = m_Wrt->Write(&cnt, sizeof(cnt), &written);
-    if (res != eRW_Success) 
-        return res;
-    if (written != sizeof(cnt))
-        return eRW_Error;
-    for (const char* ptr = (char*)buf; count > 0; ptr += written) {
-        res = m_Wrt->Write(ptr, count, &written);
+    if (!m_PacketBytesToWrite) {
+        Uint4 cnt = (Uint4) count;
+        size_t written = 0;
+        ERW_Result res = m_Wrt->Write(&cnt, sizeof(cnt), &written);
         if (res != eRW_Success) 
             return res;
-        count -= written;
-        bytes_written += written;
+        if (written != sizeof(cnt))
+            return eRW_Error;
+        m_PacketBytesToWrite = cnt;
     }
+
+    ERW_Result res = m_Wrt->Write(buf, m_PacketBytesToWrite, &wrt.count);
+    if (res == eRW_Success) m_PacketBytesToWrite -= wrt.count;
     return res;
 }
 
@@ -132,6 +108,10 @@ ERW_Result CTransmissionWriter::Flush(void)
 
 ERW_Result CTransmissionWriter::Close(void)
 {
+    if (m_PacketBytesToWrite) {
+        return eRW_Error;
+    }
+
     if (m_SendEof != eSendEofPacket)
         return eRW_Success;
 
@@ -172,8 +152,7 @@ ERW_Result CTransmissionReader::Read(void*    buf,
                                      size_t*  bytes_read)
 {
     ERW_Result res;
-    size_t read_count = 0;
-    CIOBytesCountGuard guard(bytes_read, read_count);
+    CIOBytesCountGuard read(bytes_read);
 
     if (!m_StartRead) {
         res = x_ReadStart();
@@ -201,8 +180,8 @@ ERW_Result CTransmissionReader::Read(void*    buf,
 
     size_t to_read = min(count, m_PacketBytesToRead);
 
-    res = m_Rdr->Read(buf, to_read, &read_count);
-    m_PacketBytesToRead -= read_count;
+    res = m_Rdr->Read(buf, to_read, &read.count);
+    m_PacketBytesToRead -= read.count;
 
     return res;
 }
diff --git a/c++/src/util/utf8.cpp b/c++/src/util/utf8.cpp
index f27e48a..b3c02b9 100644
--- a/c++/src/util/utf8.cpp
+++ b/c++/src/util/utf8.cpp
@@ -1,4 +1,4 @@
-/*  $Id: utf8.cpp 191410 2010-05-12 18:16:26Z ivanov $
+/*  $Id: utf8.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -246,7 +246,7 @@ long StringToCode(const string&      src,
     }
         
     unsigned char mask = 0xFF;
-    mask = mask >> (int)utf_len; 
+    mask = (unsigned char)(mask >> (int)utf_len);
     dst_code = ch & mask;
 
     for (size_t j = 1; j < utf_len; j++)
diff --git a/c++/src/util/util_misc.cpp b/c++/src/util/util_misc.cpp
index 13c6488..315726c 100644
--- a/c++/src/util/util_misc.cpp
+++ b/c++/src/util/util_misc.cpp
@@ -1,4 +1,4 @@
-/*  $Id: util_misc.cpp 447439 2014-09-25 17:52:46Z vakatov $
+/*  $Id: util_misc.cpp 485043 2015-11-18 14:43:31Z sadyrovr $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -158,7 +158,8 @@ string g_FindDataFile(const CTempString& name, CDirEntry::EType type)
         TNCBIDataDir dir;
 
         if ( !path.Get().empty() ) {
-            NStr::Split(path.Get(), kDelim, dirs);
+            NStr::Split(path.Get(), kDelim, dirs,
+                    NStr::fSplit_MergeDelimiters | NStr::fSplit_Truncate);
         }
         if ( !dir.Get().empty() ) {
             dirs.push_back(dir.Get());
diff --git a/c++/src/util/uttp.cpp b/c++/src/util/uttp.cpp
index b86c0e7..35fcfd0 100644
--- a/c++/src/util/uttp.cpp
+++ b/c++/src/util/uttp.cpp
@@ -1,4 +1,4 @@
-/*  $Id: uttp.cpp 407643 2013-07-23 15:32:31Z kazimird $
+/*  $Id: uttp.cpp 489095 2016-01-08 13:02:41Z ivanov $
  * ===========================================================================
  *
  *                            PUBLIC DOMAIN NOTICE
@@ -202,9 +202,9 @@ bool CUTTPWriter::SendChunk(const char* chunk,
 
     Uint8 number = chunk_length;
 
-    do
-        *--result = char(number % 10) + '0';
-    while (number /= 10);
+    do {
+        *--result = char((number % 10) + '0');
+    } while (number /= 10);
 
     size_t string_len = m_InternalBuffer + sizeof(m_InternalBuffer) - result;
     size_t free_buf_size = m_BufferSize - m_OutputBufferSize;
@@ -248,7 +248,7 @@ bool CUTTPWriter::SendNumber(Int8 number)
     }
 
     do
-        *--result = char(number % 10) + '0';
+        *--result = char((number % 10) + '0');
     while (number /= 10);
 
     size_t string_len = m_InternalBuffer + sizeof(m_InternalBuffer) - result;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/ncbi-blast+.git



More information about the debian-med-commit mailing list